ngx-techlify-core 11.3.4 → 11.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ngx-techlify-core.umd.js +646 -104
- package/bundles/ngx-techlify-core.umd.js.map +1 -1
- package/bundles/ngx-techlify-core.umd.min.js +2 -2
- package/bundles/ngx-techlify-core.umd.min.js.map +1 -1
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list.component.js +2 -2
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/email-subscription-user-list-filter.component.js +2 -2
- package/esm2015/lib/login-history-for-user/login-history-for-user.component.js +11 -2
- package/esm2015/lib/note/index.js +2 -1
- package/esm2015/lib/note/note-list/note-list.component.js +2 -2
- package/esm2015/lib/techlify-feature/on-off-switch/on-off-switch.component.js +27 -0
- package/esm2015/lib/techlify-feature/techlify-feature-enabled.directive.js +77 -0
- package/esm2015/lib/techlify-feature/techlify-feature-listing.component.js +174 -0
- package/esm2015/lib/techlify-feature/techlify-feature.module.js +30 -0
- package/esm2015/lib/techlify-feature/techlify-feature.routing.js +12 -0
- package/esm2015/lib/techlify-feature/techlify-feature.service.js +28 -0
- package/esm2015/lib/timeline-filter/calculate-timeline.js +2 -2
- package/esm2015/lib/timeline-filter/timeline-filter.component.js +146 -16
- package/esm2015/ngx-techlify-core.js +4 -1
- package/esm2015/public-api.js +5 -1
- package/fesm2015/ngx-techlify-core.js +537 -88
- package/fesm2015/ngx-techlify-core.js.map +1 -1
- package/lib/login-history-for-user/login-history-for-user.component.d.ts +2 -0
- package/lib/note/index.d.ts +1 -0
- package/lib/techlify-feature/on-off-switch/on-off-switch.component.d.ts +9 -0
- package/lib/techlify-feature/techlify-feature-enabled.directive.d.ts +16 -0
- package/lib/techlify-feature/techlify-feature-listing.component.d.ts +34 -0
- package/lib/techlify-feature/techlify-feature.module.d.ts +2 -0
- package/lib/techlify-feature/techlify-feature.routing.d.ts +2 -0
- package/lib/techlify-feature/techlify-feature.service.d.ts +8 -0
- package/lib/timeline-filter/calculate-timeline.d.ts +5 -0
- package/lib/timeline-filter/timeline-filter.component.d.ts +47 -6
- package/ngx-techlify-core.d.ts +3 -0
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/dialog"),require("@angular/material/table"),require("@angular/material/sort"),require("@ngneat/until-destroy"),require("@angular/common"),require("@angular/forms"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@angular/material/snack-bar"),require("@angular/cdk/a11y"),require("@angular/cdk/coercion"),require("@angular/material/form-field"),require("@angular/material/select"),require("@angular/material/icon"),require("@angular/router"),require("@angular/material/tooltip"),require("@angular/material/core"),require("@angular/material/button"),require("@angular/material/checkbox"),require("@angular/material/input"),require("@angular/material/menu"),require("@angular/material/progress-spinner"),require("@angular/material/card"),require("@angular/material/divider"),require("@angular/material/chips"),require("@angular/material/datepicker"),require("@angular/material/list"),require("@angular/flex-layout"),require("ngx-infinite-scroll"),require("ngx-doc-viewer"),require("ngx-editor"),require("xlsx"),require("@angular/platform-browser"),require("jsondiffpatch"),require("@angular/cdk/keycodes"),require("@angular/material/autocomplete"),require("@angular/material/button-toggle")):"function"==typeof define&&define.amd?define("ngx-techlify-core",["exports","@angular/core","@angular/material/dialog","@angular/material/table","@angular/material/sort","@ngneat/until-destroy","@angular/common","@angular/forms","@angular/common/http","rxjs","rxjs/operators","@angular/material/snack-bar","@angular/cdk/a11y","@angular/cdk/coercion","@angular/material/form-field","@angular/material/select","@angular/material/icon","@angular/router","@angular/material/tooltip","@angular/material/core","@angular/material/button","@angular/material/checkbox","@angular/material/input","@angular/material/menu","@angular/material/progress-spinner","@angular/material/card","@angular/material/divider","@angular/material/chips","@angular/material/datepicker","@angular/material/list","@angular/flex-layout","ngx-infinite-scroll","ngx-doc-viewer","ngx-editor","xlsx","@angular/platform-browser","jsondiffpatch","@angular/cdk/keycodes","@angular/material/autocomplete","@angular/material/button-toggle"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["ngx-techlify-core"]={},t.ng.core,t.ng.material.dialog,t.ng.material.table,t.ng.material.sort,t["@ngneat/until-destroy"],t.ng.common,t.ng.forms,t.ng.common.http,t.rxjs,t.rxjs.operators,t.ng.material.snackBar,t.ng.cdk.a11y,t.ng.cdk.coercion,t.ng.material.formField,t.ng.material.select,t.ng.material.icon,t.ng.router,t.ng.material.tooltip,t.ng.material.core,t.ng.material.button,t.ng.material.checkbox,t.ng.material.input,t.ng.material.menu,t.ng.material.progressSpinner,t.ng.material.card,t.ng.material.divider,t.ng.material.chips,t.ng.material.datepicker,t.ng.material.list,t.ng.flexLayout,t["ngx-infinite-scroll"],t["ngx-doc-viewer"],t["ngx-editor"],t.xlsx,t.ng.platformBrowser,t.jsondiffpatch,t.ng.cdk.keycodes,t.ng.material.autocomplete,t.ng.material.buttonToggle)}(this,(function(t,e,n,o,i,r,a,l,s,c,u,d,p,m,f,h,g,y,v,b,C,x,F,I,w,D,S,M,T,
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/dialog"),require("@angular/material/table"),require("@angular/material/sort"),require("@ngneat/until-destroy"),require("@angular/common"),require("@angular/forms"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@angular/material/snack-bar"),require("@angular/cdk/a11y"),require("@angular/cdk/coercion"),require("@angular/material/form-field"),require("@angular/material/select"),require("@angular/material/icon"),require("@angular/router"),require("@angular/material/tooltip"),require("@angular/material/core"),require("@angular/material/button"),require("@angular/material/checkbox"),require("@angular/material/input"),require("@angular/material/menu"),require("@angular/material/progress-spinner"),require("@angular/material/card"),require("@angular/material/divider"),require("@angular/material/chips"),require("@angular/material/datepicker"),require("@angular/material/list"),require("@angular/flex-layout"),require("ngx-infinite-scroll"),require("ngx-doc-viewer"),require("ngx-editor"),require("xlsx"),require("@angular/platform-browser"),require("jsondiffpatch"),require("@angular/cdk/keycodes"),require("@angular/material/autocomplete"),require("@angular/material/button-toggle"),require("@angular/material/slide-toggle")):"function"==typeof define&&define.amd?define("ngx-techlify-core",["exports","@angular/core","@angular/material/dialog","@angular/material/table","@angular/material/sort","@ngneat/until-destroy","@angular/common","@angular/forms","@angular/common/http","rxjs","rxjs/operators","@angular/material/snack-bar","@angular/cdk/a11y","@angular/cdk/coercion","@angular/material/form-field","@angular/material/select","@angular/material/icon","@angular/router","@angular/material/tooltip","@angular/material/core","@angular/material/button","@angular/material/checkbox","@angular/material/input","@angular/material/menu","@angular/material/progress-spinner","@angular/material/card","@angular/material/divider","@angular/material/chips","@angular/material/datepicker","@angular/material/list","@angular/flex-layout","ngx-infinite-scroll","ngx-doc-viewer","ngx-editor","xlsx","@angular/platform-browser","jsondiffpatch","@angular/cdk/keycodes","@angular/material/autocomplete","@angular/material/button-toggle","@angular/material/slide-toggle"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["ngx-techlify-core"]={},t.ng.core,t.ng.material.dialog,t.ng.material.table,t.ng.material.sort,t["@ngneat/until-destroy"],t.ng.common,t.ng.forms,t.ng.common.http,t.rxjs,t.rxjs.operators,t.ng.material.snackBar,t.ng.cdk.a11y,t.ng.cdk.coercion,t.ng.material.formField,t.ng.material.select,t.ng.material.icon,t.ng.router,t.ng.material.tooltip,t.ng.material.core,t.ng.material.button,t.ng.material.checkbox,t.ng.material.input,t.ng.material.menu,t.ng.material.progressSpinner,t.ng.material.card,t.ng.material.divider,t.ng.material.chips,t.ng.material.datepicker,t.ng.material.list,t.ng.flexLayout,t["ngx-infinite-scroll"],t["ngx-doc-viewer"],t["ngx-editor"],t.xlsx,t.ng.platformBrowser,t.jsondiffpatch,t.ng.cdk.keycodes,t.ng.material.autocomplete,t.ng.material.buttonToggle,t.ng.material.slideToggle)}(this,(function(t,e,n,o,i,r,a,l,s,c,u,d,p,m,f,h,g,y,v,b,C,x,F,I,w,D,S,M,_,T,L,k,A,E,V,U,P,j,O,R,N){"use strict";var H=function(){},G=function(){function t(t,e){this.dialogRef=t,this.data=e}return t.prototype.ngOnInit=function(){},t.prototype.closeDialog=function(){this.dialogRef.close()},t.prototype.confirm=function(){this.dialogRef.close(this.data)},t}();G.decorators=[{type:e.Component,args:[{selector:"app-action-popup",template:'<div fxLayout="column">\n <div mat-dialog-title class="text-center">\n <div>{{data.title}}</div>\n </div>\n <div mat-dialog-content fxLayout="column">\n <div fxLayout="row wrap">\n <div fxFlex="100%">{{data.message}}</div>\n\n <div fxFlex="100%" fxLayout="row" fxLayoutGap="1.5rem" fxLayoutAlign="end" class="my-4">\n <button mat-raised-button (click)="closeDialog()">\n Cancel\n </button>\n <button mat-raised-button color="primary" (click)="confirm()">\n Proceed\n </button>\n </div>\n </div>\n\n </div>\n\n</div>',styles:[""]}]}],G.ctorParameters=function(){return[{type:n.MatDialogRef},{type:H,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]}]};
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
var G=function(t,e){return(G=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 q(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}G(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function B(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function z(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{s(o.next(t))}catch(t){r(t)}}function l(t){try{s(o.throw(t))}catch(t){r(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,l)}s((o=o.apply(t,e||[])).next())}))}function $(t,e){var n,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function l(r){return function(l){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,o=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(6===r[0]&&a.label<i[1]){a.label=i[1],i=r;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,l])}}}Object.create;function Y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function W(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Y(arguments[e]));return t}var K;Object.create;t.ɵi=K=function(){function t(){this.dataSource=new o.MatTableDataSource([]),this.action=new e.EventEmitter,this.selctionChange=new e.EventEmitter,this.rowClick=new e.EventEmitter,this.tableScroll=new e.EventEmitter,this.sortChanged=new e.EventEmitter,this.elementId="data-table-"+K.nextId++}return t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){var t=this;this.dataSource=new o.MatTableDataSource(this.data),this.selection&&this.selection.changed.pipe().subscribe((function(e){t.selection.selected&&t.selctionChange.emit(t.selection.selected)})),this.sort&&this.sort.sortChange.pipe(r.untilDestroyed(this)).subscribe((function(e){t.sortChanged.emit(e)}))},t.prototype.isAllSelected=function(){return this.selection.selected.length===this.dataSource.data.length},t.prototype.masterToggle=function(){var t=this;this.isAllSelected()?this.clearSelection():this.dataSource.data.forEach((function(e){return t.selection.select(e)}))},t.prototype.clearSelection=function(){this.selection.clear(),this.selctionChange.emit(this.selection.selected)},t.prototype.ngOnChanges=function(t){this.initializeConfig(t),t.data&&!t.data.isFirstChange()&&this.dataSource&&(this.dataSource.data=t.data.currentValue)},t.prototype.initializeConfig=function(t){t.config&&!t.config.isFirstChange()&&(this.config=t.config.currentValue),this.page=this.config.page||1,this.lastPage=this.config.lastPage||this.page,this.perPage=this.config.perPage||20},t.prototype.onScroll=function(){this.page<this.lastPage&&(this.page+=1,this.tableScroll.emit({page:this.page,lastPage:this.lastPage,perPage:this.perPage}))},t.prototype.editClicked=function(t,e){this.action.emit({action:"edit",value:e}),t.stopPropagation()},t.prototype.viewClicked=function(t,e){this.action.emit({action:"view",value:e}),t.stopPropagation()},t.prototype.deactivateClicked=function(t,e){this.action.emit({action:"deactivate",value:e}),t.stopPropagation()},t.prototype.downloadClicked=function(t,e){this.action.emit({action:"download",value:e}),t.stopPropagation()},t.prototype.printClicked=function(t,e){this.action.emit({action:"print",value:e}),t.stopPropagation()},t.prototype.rowClicked=function(t,e){this.rowClick.emit(e),t.stopPropagation()},t.prototype.actionMenuClick=function(t,e,n){this.action.emit({action:n,value:e}),this.trigger.closeMenu(),t.stopPropagation()},t.prototype.actionMenuTriggerClick=function(t,e){this.trigger=e,t.stopPropagation()},t.prototype.checkEdit=function(t){return!this.config.editDisableFunction||this.config.editDisableFunction(t)},t.prototype.checkView=function(t){return!this.config.viewDisableFunction||this.config.viewDisableFunction(t)},t.prototype.checkPrint=function(t){return!this.config.printDisableFunction||this.config.printDisableFunction(t)},t.prototype.checkActions=function(t){return!this.config.actionsMenuFunction||this.config.actionsMenuFunction(t)},t.prototype.checkActionButton=function(t,e){return!this.config.actionsMenuButtonFunction||this.config.actionsMenuButtonFunction(t,e)},t.prototype.getValue=function(t,e){for(var n=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),o=0,i=n.length;o<i;++o){var r=n[o];if(!t||!(r in t))return;t=t[r]}return t},t.prototype.ngOnDestroy=function(){},t}(),t.ɵi.nextId=0,t.ɵi.decorators=[{type:e.Component,args:[{selector:"app-data-table",template:'<div fxLayout="column" [ngClass]="{\n \'mat-elevation-z1\': !config.disableElevation\n }" class="scroll-container" infiniteScroll [infiniteScrollDistance]="1" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false" [ngStyle]="config.style">\n <table mat-table [dataSource]="dataSource" matSort [id]="elementId">\n \x3c!-- Checkbox Column --\x3e\n <ng-container matColumnDef="select">\n <th mat-header-cell *matHeaderCellDef style="width:60px">\n <mat-checkbox *ngIf="selection" (change)="$event ? masterToggle() : null"\n [checked]="selection.hasValue() && isAllSelected()"\n [indeterminate]="selection.hasValue() && !isAllSelected()">\n </mat-checkbox>\n </th>\n <td mat-cell *matCellDef="let row" style="width:60px">\n <mat-checkbox *ngIf="selection" (click)="$event.stopPropagation()"\n (change)="$event ? selection.toggle(row) : null" [checked]="selection.isSelected(row)">\n </mat-checkbox>\n </td>\n </ng-container>\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef="let index = index">\n {{ (index + 1) }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef class="action-width d-print-none">\n {{ config.customActionLabel }}\n </th>\n\n <td mat-cell *matCellDef="let element; let index = index" class="d-print-none">\n <div>\n <button *ngIf="\n config.actionsConfig.download && element[config.downloadLink]\n " type="button" mat-icon-button (click)="downloadClicked($event, element)">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n\n <button *ngIf="config.actionsConfig.edit" [disabled]="!this.checkEdit(element)" type="button"\n mat-icon-button (click)="editClicked($event, element)">\n <mat-icon>edit</mat-icon>\n </button>\n\n <button *ngIf="config.actionsConfig.print" [disabled]="!this.checkPrint(element)" type="button"\n mat-icon-button (click)="printClicked($event,element)">\n <mat-icon>print</mat-icon>\n </button>\n\n <button *ngIf="config.actionsConfig.view" [disabled]="!this.checkView(element)" type="button"\n mat-icon-button (click)="viewClicked($event, element)">\n <mat-icon>description</mat-icon>\n </button>\n\n <button *ngIf="config.actionsConfig.deactivate" type="button" mat-icon-button\n (click)="deactivateClicked($event, element)">\n <mat-icon>delete</mat-icon>\n </button>\n\n <button #menuTrigger="matMenuTrigger" *ngIf="\n config.actionsConfig.actionsMenu &&\n this.checkActions(element) &&\n config.actionsConfig.actionsMenu.length > 0\n " type="button" mat-icon-button [matMenuTriggerFor]="actionsMenu"\n (click)="actionMenuTriggerClick($event, menuTrigger)">\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n\n <mat-menu #actionsMenu="matMenu">\n <div *ngFor="let item of config.actionsConfig.actionsMenu">\n <button *ngIf="this.checkActionButton(element, item.value)" mat-menu-item\n (click)="actionMenuClick($event, element, item.value)">\n <span>{{ item.name }}</span>\n </button>\n </div>\n </mat-menu>\n </td>\n </ng-container>\n\n \x3c!-- Actual Columns --\x3e\n <ng-container matColumnDef="{{ column.value }}" *ngFor="let column of config.columnsConfig">\n <ng-container *ngIf="column?.sort; else noSort">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>\n {{ column.title }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th mat-header-cell *matHeaderCellDef>\n {{ column.title }}\n </th>\n </ng-template>\n <ng-container *ngIf="column.dateField; else currencyField">\n <td mat-cell *matCellDef="let element">\n <div class="text-truncate" appToolTip>\n {{ getValue(element, column.value) | date:column.format? column.format: \'mediumDate\' }}\n </div>\n </td>\n </ng-container>\n\n <ng-template #currencyField>\n <div *ngIf="column.currencyField; else normalField">\n <td mat-cell *matCellDef="let element">\n <div class="text-truncate" appToolTip>\n {{ getValue(element, column.value) | currency: "$":\'symbol\' : \'1.0-0\' }}\n </div>\n </td>\n </div>\n </ng-template>\n\n <ng-template #normalField>\n <td mat-cell *matCellDef="let element">\n <div class="text-truncate" appToolTip>\n {{ getValue(element, column.value) }}\n </div>\n </td>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf="config.stickyHeader; else normalHeader">\n <tr class="font-weight-bold" mat-header-row *matHeaderRowDef="config.displayedColumns; sticky:true"></tr>\n </ng-container>\n <ng-template #normalHeader>\n <tr class="font-weight-bold" mat-header-row *matHeaderRowDef="config.displayedColumns;">\n </tr>\n </ng-template>\n\n <div *ngIf="!config.enableRowClick">\n <tr mat-row *matRowDef="let row; columns: config.displayedColumns"></tr>\n </div>\n\n <div *ngIf="config.enableRowClick">\n <tr mat-row *matRowDef="let row; columns: config.displayedColumns" (click)="rowClicked($event, row)"\n class="hoverable row-hover"></tr>\n </div>\n </table>\n</div>',styles:["table{width:100%}.mat-table{background:inherit}.mat-column-select{overflow:initial}td.mat-cell,td.mat-footer-cell,th.mat-header-cell{padding:0 2px}.action-width{min-width:175px;width:175px!important}.noOverFlow{overflow-x:auto;overflow-y:hidden}.scroll-container{max-height:400px;overflow:auto}.mat-header-row{background-color:inherit;position:sticky;top:0}tr.row-hover:hover{background-color:#dcdcdc}td.mat-cell:first-of-type,td.mat-footer-cell:first-of-type,th.mat-header-cell:first-of-type{padding-left:24px!important}"]}]}],t.ɵi.ctorParameters=function(){return[]},t.ɵi.propDecorators={data:[{type:e.Input}],config:[{type:e.Input}],selection:[{type:e.Input}],action:[{type:e.Output}],selctionChange:[{type:e.Output}],rowClick:[{type:e.Output}],tableScroll:[{type:e.Output}],sortChanged:[{type:e.Output}],sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}],elementId:[{type:e.Input}]},t.ɵi=K=B([r.UntilDestroy()],t.ɵi);var J=function(){},Q=function(){},Z=function(){function t(){this.remove=new e.EventEmitter}return t.prototype.ngOnInit=function(){this.initData()},t.prototype.removeFile=function(){this.remove.emit()},t.prototype.initData=function(){if(this.file){var t=this.getFileExtension(this.file);this.viewerType="ppt"===t||"pptx"===t||"doc"===t||"docx"===t||"xls"===t||"xlsx"===t?"office":"jpg"===t||"jpeg"===t||"png"===t||"gif"===t?"image":"pdf"===t?"pdf":null}},Object.defineProperty(t.prototype,"fileName",{get:function(){if(this.file){var t=this.file.split("/");return 2===t.length?t[1]:t[0]}return""},enumerable:!1,configurable:!0}),t.prototype.getFileExtension=function(t){return t.split(".").pop()},t}();Z.decorators=[{type:e.Component,args:[{selector:"app-document-viewer",template:'<mat-card *ngIf="viewerType === \'image\'">\n <img [ngStyle]="config.imageStyle" mat-card-image [src]="fileUrl" />\n <mat-card-actions>\n <button type="button" mat-raised-button (click)="removeFile()" *ngIf="!disableEdit && !config.hideRemove">\n Remove\n </button>\n </mat-card-actions>\n</mat-card>\n\n<div class="mat-elevation-z1 p-4" *ngIf="viewerType !== \'image\'">\n <a [href]="fileUrl" target="_blank">{{fileName}}</a>\n <ngx-doc-viewer [ngStyle]="config.viewerStyle" *ngIf="viewerType !== null" [url]="fileUrl" [viewer]="viewerType">\n </ngx-doc-viewer>\n <div class="mt-2" *ngIf="!config.hideRemove">\n <button type="button" mat-raised-button (click)="removeFile()" *ngIf="!disableEdit">\n Remove\n </button>\n </div>\n</div>',styles:[".image-fit{height:100%;object-fit:cover;width:100%}"]}]}],Z.ctorParameters=function(){return[]},Z.propDecorators={config:[{type:e.Input}],file:[{type:e.Input}],fileUrl:[{type:e.Input}],disableEdit:[{type:e.Input}],remove:[{type:e.Output}]};var X,tt=function(){};(X=t.LogLevel||(t.LogLevel={}))[X.Off=0]="Off",X[X.Error=1]="Error",X[X.Warning=2]="Warning",X[X.Info=3]="Info",X[X.Debug=4]="Debug";var et=function(){function e(t){this.source=t}return e.enableProductionMode=function(){e.level=t.LogLevel.Warning},e.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.log(console.log,t.LogLevel.Debug,e)},e.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.log(console.info,t.LogLevel.Info,e)},e.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.log(console.warn,t.LogLevel.Warning,e)},e.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.log(console.error,t.LogLevel.Error,e)},e.prototype.log=function(t,n,o){var i=this;if(n<=e.level){var r=this.source?["["+this.source+"]"].concat(o):o;t.apply(console,r),e.outputs.forEach((function(t){return t.apply(t,W([i.source,n],o))}))}},e}();et.level=t.LogLevel.Debug,et.outputs=[];var nt=function(){function t(t){this.projectKey="",this.environment="",this.authClientSecret="",this.authGrantType="",this.apiUrl="",this.loadFromMap(t)}return t.prototype.loadFromMap=function(t){this.projectKey=t.projectKey,this.environment=t.environment,this.authClientSecret=t.authClientSecret,this.authGrantType=t.authGrantType,this.apiUrl=t.apiUrl,this.storage=null==t?void 0:t.storage,this.rawConfigs=t},t}(),ot=function(){function t(t){this.config=t}return t.prototype.getConfigsRaw=function(){return this.config.rawConfigs},t.prototype.getProjectKey=function(){return this.config.projectKey},t.prototype.getApiUrl=function(){return this.config.apiUrl},t.prototype.getAuthClientSecret=function(){return this.config.authClientSecret},t.prototype.getStorage=function(){return this.config.storage?this.config.storage:localStorage},t.prototype.getAuthGrantType=function(){return this.config.authGrantType},t.prototype.getCredentialsKey=function(){return this.config.projectKey+"_"+t.BASE_CREDENTIALS},t}();ot.BASE_CREDENTIALS="credentials",ot.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ot(e.ɵɵinject(nt))},token:ot,providedIn:"root"}),ot.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ot.ctorParameters=function(){return[{type:nt}]};var it=function(t){this.data=t};it.decorators=[{type:e.Component,args:[{selector:"snack-bar-component-example-snack",template:'<div class="row-container">\n <span class="icon-column">\n <mat-icon class="success"> check_circle_outline</mat-icon>\n </span>\n <span class="text-column">\n {{ data }}\n </span>\n</div>',styles:[".error{color:#dc3545}.success{color:#28a745}.row-container{display:flex}.icon-column{flex:5%;padding-right:5px}.text-column{color:#fff;flex:95%;text-align:center}"]}]}],it.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[d.MAT_SNACK_BAR_DATA]}]}]};var rt=function(t){this.data=t};rt.decorators=[{type:e.Component,args:[{selector:"snack-bar-component-example-snack",template:'<div class="row-container">\n <span class="icon-column">\n <mat-icon class="error"> cancel</mat-icon>\n </span>\n <span class="text-column">\n {{ data }}\n </span>\n</div>',styles:[".error{color:#dc3545}.success{color:#28a745}.row-container{display:flex}.icon-column{flex:5%;padding-right:5px}.text-column{color:#fff;flex:95%;text-align:center}"]}]}],rt.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[d.MAT_SNACK_BAR_DATA]}]}]};var at=function(){function t(t){this.snackBar=t}return t.prototype.addAlert=function(t,e,n){void 0===n&&(n=3),"success"==e?this.snackBar.openFromComponent(it,{duration:1e3*n,data:t}):this.snackBar.openFromComponent(rt,{duration:1e3*n,data:t})},t}();at.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new at(e.ɵɵinject(d.MatSnackBar))},token:at,providedIn:"root"}),at.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],at.ctorParameters=function(){return[{type:d.MatSnackBar}]};var lt=function(){function t(t){this.alerter=t}return t.prototype.handleError=function(t,e){var n,o,i,r;void 0===e&&(e="");var a=[];if(null==t?void 0:t.error){if(null===(n=null==t?void 0:t.error)||void 0===n?void 0:n.errors)for(var l in t.error.errors){if(null===(o=t.error.errors)||void 0===o?void 0:o.hasOwnProperty(l))(null===(i=null==t?void 0:t.error)||void 0===i?void 0:i.errors[l]).forEach((function(t){return a.push(t)}))}0===a.length&&a.push(t.error.message?t.error.message:null===(r=t.error)||void 0===r?void 0:r.error)}var s=a.length?a[0]:e;this.alerter.addAlert("Error: "+s,"warning")},t}();lt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new lt(e.ɵɵinject(at))},token:lt,providedIn:"root"}),lt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],lt.ctorParameters=function(){return[{type:at}]};new et("ErrorHandlerInterceptor");var st=function(){function t(t,e){this.configService=t,this.errorHandler=e}return t.prototype.intercept=function(t,e){var n=this;return e.handle(t).pipe(u.catchError((function(t){return n.handleError(t)})))},t.prototype.handleError=function(t){var e,n;if(t.error instanceof ErrorEvent)"Client Error: "+(null===(e=this.configService)||void 0===e?void 0:e.getProjectKey())+": "+t.error.message;else{"Server Error: "+(null===(n=this.configService)||void 0===n?void 0:n.getProjectKey());try{this.errorHandler.handleError(t,"Unexpected Server Error, try later or contact service team")}catch(t){console.log("Unable to handle server error",t)}}return c.throwError(t)},t}();st.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new st(e.ɵɵinject(ot),e.ɵɵinject(lt))},token:st,providedIn:"root"}),st.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],st.ctorParameters=function(){return[{type:ot},{type:lt}]};var ct=new et("HttpCacheService"),ut=function(){function t(t){this.configService=t,this.cachedData={},this.storage=this.configService.getStorage(),this.cachePersistenceKey=this.configService.getProjectKey()+"_HTTP_CACHE",this.loadCacheData()}return t.prototype.setCacheData=function(t,e,n){this.cachedData[t]={lastUpdated:n||new Date,data:e},ct.debug('Cache set for key: "'+t+'"'),this.saveCacheData()},t.prototype.getCacheData=function(t){var e=this.cachedData[t];return e?(ct.debug('Cache hit for key: "'+t+'"'),e.data):null},t.prototype.getHttpCacheEntry=function(t){return this.cachedData[t]||null},t.prototype.clearCache=function(t){delete this.cachedData[t],ct.debug('Cache cleared for key: "'+t+'"'),this.saveCacheData()},t.prototype.cleanCache=function(t){var e=this;t?Object(this.cachedData).keys.forEach((function(n){var o;t>=(null===(o=e.cachedData[n])||void 0===o?void 0:o.lastUpdated)&&delete e.cachedData[n]})):this.cachedData={},this.saveCacheData()},t.prototype.setPersistence=function(t){this.cleanCache(),this.storage="local"===t?localStorage:"session"===t?sessionStorage:null,this.loadCacheData()},t.prototype.saveCacheData=function(){this.storage&&(this.storage[this.cachePersistenceKey]=JSON.stringify(this.cachedData))},t.prototype.loadCacheData=function(){var t=this.storage?this.storage[this.cachePersistenceKey]:null;this.cachedData=t?JSON.parse(t):{}},t}();ut.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ut(e.ɵɵinject(ot))},token:ut,providedIn:"root"}),ut.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ut.ctorParameters=function(){return[{type:ot}]};var dt=function(){function t(t){this.httpCacheService=t,this.forceUpdate=!1}return t.prototype.configure=function(e){var n=new t(this.httpCacheService);return e&&e.update&&(n.forceUpdate=!0),n},t.prototype.intercept=function(t,e){var n=this;return"GET"!==t.method?e.handle(t):new c.Observable((function(o){var i=n.forceUpdate?null:n.httpCacheService.getCacheData(t.urlWithParams);null!==i?(o.next(new s.HttpResponse(i)),o.complete()):e.handle(t).subscribe((function(e){e instanceof s.HttpResponse&&n.httpCacheService.setCacheData(t.urlWithParams,e),o.next(e)}),(function(t){return o.error(t)}),(function(){return o.complete()}))}))},t}();dt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new dt(e.ɵɵinject(ut))},token:dt,providedIn:"root"}),dt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],dt.ctorParameters=function(){return[{type:ut}]};var pt=function(){function t(t){this.configService=t}return t.prototype.intercept=function(t,e){return/^(http|https):/i.test(t.url)||(t=t.clone({url:this.configService.getApiUrl()+t.url})),e.handle(t)},t}();pt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new pt(e.ɵɵinject(ot))},token:pt,providedIn:"root"}),pt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],pt.ctorParameters=function(){return[{type:ot}]};var mt=function(){function t(t){this.configService=t,this._credentials=null}return Object.defineProperty(t.prototype,"isAuthenticated",{get:function(){return!!this.credentials},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credentials",{get:function(){return this._credentials||(this._credentials=JSON.parse(sessionStorage.getItem(this.configService.getCredentialsKey())||localStorage.getItem(this.configService.getCredentialsKey()))),this._credentials},enumerable:!1,configurable:!0}),t.prototype.setCredentials=function(t,e){this._credentials=t||null,t?(e?localStorage:sessionStorage).setItem(this.configService.getCredentialsKey(),JSON.stringify(t)):(sessionStorage.clear(),localStorage.clear(),this._credentials=null)},t.prototype.getAccessToken=function(){var t,e,n,o,i=(null===(e=null===(t=this.credentials)||void 0===t?void 0:t.token)||void 0===e?void 0:e.expires_in)||"",r=(null===(o=null===(n=this.credentials)||void 0===n?void 0:n.token)||void 0===o?void 0:o.access_token)||"";return r&&i?Date.now()>parseInt(i)?(this.setCredentials(),null):r:null},t.prototype.getExpiration=function(){var t,e;return(null===(e=null===(t=this.credentials)||void 0===t?void 0:t.token)||void 0===e?void 0:e.expires_in)||""},t.prototype.getRefreshToken=function(){var t,e;return(null===(e=null===(t=this.credentials)||void 0===t?void 0:t.token)||void 0===e?void 0:e.refresh_token)||""},t.prototype.refresh=function(){return this._credentials=null,this},t}();mt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new mt(e.ɵɵinject(ot))},token:mt,providedIn:"root"}),mt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],mt.ctorParameters=function(){return[{type:ot}]};var ft=function(){function t(t){this.credentials=t}return t.prototype.intercept=function(t,e){return t=t.clone({setHeaders:{Authorization:"Bearer "+(this.credentials.getAccessToken()||"")}}),e.handle(t)},t}();ft.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ft(e.ɵɵinject(mt))},token:ft,providedIn:"root"}),ft.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ft.ctorParameters=function(){return[{type:mt}]};var ht=function(){function t(){}return t.prototype.intercept=function(t,e){return t=t.clone({setHeaders:{"Content-Type":t.headers.get("Content-Type")||"application/json"}}),e.handle(t)},t}();ht.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ht},token:ht,providedIn:"root"}),ht.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var gt=function(){function t(t,e){this.next=t,this.interceptor=e}return t.prototype.handle=function(t){return this.interceptor.intercept(t,this.next)},t}(),yt=new e.InjectionToken("HTTP_DYNAMIC_INTERCEPTORS"),vt=function(t){function e(e,n,o){void 0===o&&(o=[]);var i=t.call(this,e)||this;return i.httpHandler=e,i.injector=n,i.interceptors=o,i.interceptors||(i.interceptors=[i.injector.get(pt),i.injector.get(ht),i.injector.get(ft),i.injector.get(st)]),i}return q(e,t),e.prototype.cache=function(t){var e=this.injector.get(dt).configure({update:t});return this.addInterceptor(e)},e.prototype.skipErrorHandler=function(){return this.removeInterceptor(st)},e.prototype.skipApiPrefix=function(){return this.removeInterceptor(pt)},e.prototype.skipToken=function(){return this.removeInterceptor(ft)},e.prototype.skipHeader=function(){return this.removeInterceptor(ht)},e.prototype.request=function(t,e,n){var o=this.interceptors.reduceRight((function(t,e){return new gt(t,e)}),this.httpHandler);return new s.HttpClient(o).request(t,e,n)},e.prototype.removeInterceptor=function(t){return new e(this.httpHandler,this.injector,this.interceptors.filter((function(e){return!(e instanceof t)})))},e.prototype.addInterceptor=function(t){return new e(this.httpHandler,this.injector,this.interceptors.concat([t]))},e}(s.HttpClient);vt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new vt(e.ɵɵinject(s.HttpHandler),e.ɵɵinject(e.INJECTOR),e.ɵɵinject(yt,8))},token:vt,providedIn:"root"}),vt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],vt.ctorParameters=function(){return[{type:s.HttpHandler},{type:e.Injector},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[yt]}]}]};var bt=function(){function t(t){this.http=t}return t.prototype.getEntityFiles=function(t){return this.http.get("api/entity-files",{params:t}).toPromise()},t.prototype.createEntityFile=function(t){return this.http.post("api/entity-files",t).toPromise()},t.prototype.updateEntityFile=function(t){return this.http.put("api/entity-files/"+t.id,t).toPromise()},t.prototype.deleteEntityFile=function(t){return this.http.delete("api/entity-files/"+t.id).toPromise()},t.prototype.uploadEntityFile=function(t){var e=new FormData;return e.append("fileData",t,t.name),this.http.skipHeader().post("api/entity-files-upload",e).toPromise()},t}();bt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new bt(e.ɵɵinject(vt))},token:bt,providedIn:"root"}),bt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],bt.ctorParameters=function(){return[{type:vt}]};var Ct=function(){function t(){}return t.prototype.isFieldValid=function(t,e,n){return!e.get(t).valid&&e.get(t).touched||!e.get(t).valid&&e.get(t).untouched&&n},t.prototype.getErrorMessage=function(t,e,n,o){var i=Object.keys(e.get(t).errors);return i.length>0&&n[o||t][i[0]]?n[o||t][i[0]]:""},t}();Ct.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ct},token:Ct,providedIn:"root"}),Ct.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ct.ctorParameters=function(){return[]};var xt={url:{required:"File is required"}},Ft=function(){function t(t,e,n,o,i,r){this.dialogRef=t,this.data=e,this.formValidatorService=n,this.fb=o,this.entityFileService=i,this.alertService=r,this.fileList=[],this.createForm()}return t.prototype.createForm=function(){this.entityFileGroup=this.fb.group({id:[""],title:[""],details:[""],entity_type:[""],entity_id:[],file:["",l.Validators.required],url:["",l.Validators.required]})},t.prototype.ngOnInit=function(){var t,e;this.data.entity&&(this.entityFileGroup.get("entity_type").setValue(this.data.entity.entity_type),this.entityFileGroup.get("entity_id").setValue(this.data.entity.entity_id)),this.data.file&&(this.updateMode=!0,this.entityFileGroup.patchValue(this.data.file)),(null===(t=this.data)||void 0===t?void 0:t.hideTitleAndDetails)&&(this.hideTitleAndDetails=null===(e=this.data)||void 0===e?void 0:e.hideTitleAndDetails),this.fileConfig={fileId:"subjectFile",containerId:"subjectFileContainer",styles:{height:"200px"},multiple:!1,acceptFile:"*",maxSize:10,acceptFileText:"All Files"},this.viewerConfig={viewerStyle:{height:"200px",width:"100%"}}},t.prototype.submit=function(){return z(this,void 0,void 0,(function(){var t,e,n;return $(this,(function(o){switch(o.label){case 0:return this.assignmentFileFirstAttempt=!0,this.entityFileGroup.valid?(t=this.entityFileGroup.value,this.hideTitleAndDetails&&(t.title=t.file),this.updateMode?[4,this.entityFileService.updateEntityFile(t)]:[3,2]):[2];case 1:return n=o.sent(),[3,4];case 2:return[4,this.entityFileService.createEntityFile(t)];case 3:n=o.sent(),o.label=4;case 4:return e=n,this.dialogRef.close(e.item),this.alertService.addAlert("File submitted successfully","success"),[2]}}))}))},t.prototype.fileChanged=function(t){return z(this,void 0,void 0,(function(){var e;return $(this,(function(n){switch(n.label){case 0:return this.fileList=t,this.fileList.length>0?[4,this.entityFileService.uploadEntityFile(this.fileList[0])]:[3,2];case 1:e=n.sent(),this.entityFileGroup.get("file").setValue(e.item.file),this.entityFileGroup.get("url").setValue(e.item.url),this.fileList=[],n.label=2;case 2:return[2]}}))}))},t.prototype.removeFile=function(){return z(this,void 0,void 0,(function(){return $(this,(function(t){if(this.entityFileGroup.value.file)try{this.entityFileGroup.patchValue({file:"",url:""})}catch(t){this.alertService.addAlert("Unable to remove file, try later","warn")}return[2]}))}))},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.entityFileGroup,this.assignmentFileFirstAttempt)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.entityFileGroup,xt)},t}();Ft.decorators=[{type:e.Component,args:[{selector:"entity-file-form",template:'<form [formGroup]="entityFileGroup" (ngSubmit)="submit()">\n <div fxLayout="column" class="mat-typography">\n <div mat-dialog-title class="text-center">\n <div>Entity File</div>\n </div>\n\n <div mat-dialog-content fxLayout="column" fxLayoutAlign.="start">\n <ng-container *ngIf="!hideTitleAndDetails">\n <mat-form-field>\n <input type="text" matInput formControlName="title" placeholder="Title" autocomplete="off">\n </mat-form-field>\n <mat-form-field>\n <textarea matInput formControlName="details" placeholder="Details" autocomplete="off"></textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-template #fileUpload>\n <section fxFlex="100%">\n <div>Entity File*</div>\n <app-file-dropper [config]="fileConfig" (fileChanged)="fileChanged($event)" [fileArray]="fileList">\n </app-file-dropper>\n <div class="text-danger" *ngIf="isFieldValid(\'url\')">\n {{getErrorMessage("url")}}\n </div>\n </section>\n </ng-template>\n\n\n <div fxFlex="100%" class="mt-2" *ngIf="entityFileGroup.get(\'url\').value;else fileUpload;">\n <app-document-viewer [file]="entityFileGroup.get(\'file\').value"\n [fileUrl]="entityFileGroup.get(\'url\').value" [config]="this.viewerConfig" (remove)="removeFile()"\n [disableEdit]="updateMode">\n </app-document-viewer>\n\n </div>\n\n <div class="mt-4 mb-2" fxLayout="row" fxLayoutGap="30px" fxLayoutAlign="end" fxFlex="100%">\n <button mat-raised-button type="button" (click)="dialogRef.close()">\n Cancel\n </button>\n <button mat-raised-button type="submit" color="primary">Save</button>\n </div>\n </div>\n </div>\n</form>',styles:[""]}]}],Ft.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:Ct},{type:l.FormBuilder},{type:bt},{type:at}]},t.ɵo=function(){function t(t,e,n,o){this.entityFileService=t,this.location=e,this.alertService=n,this.dialog=o,this.viewOnly=!1,this.filters={},this.entityFiles=[],this.displayedColumns=["index","title","details","file"],this.isWorking=!1,this.search=new l.FormControl(""),this.page=1,this.perPage=25,this.lastPage=0}return t.prototype.ngOnInit=function(){var t=this;this.viewerConfig={imageStyle:{height:"200px",width:"200px"},viewerStyle:{height:" 160px",width:"200px"},hideRemove:!0},this.hideTitleAndDetails&&(this.displayedColumns=this.displayedColumns.filter((function(t){return"details"!==t&&"title"!==t}))),this.filters={entity_type:this.entityType,entity_id:this.entityId,title:""},this.search.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){t.filters.title=e,t.reload()})),this.fetchEntityFilesDetails(),this.viewOnly||this.displayedColumns.push("actions")},t.prototype.fetchEntityFilesDetails=function(){return z(this,void 0,void 0,(function(){var t;return $(this,(function(e){switch(e.label){case 0:return this.filters.page=this.page,this.isWorking=!0,[4,this.entityFileService.getEntityFiles(this.filters)];case 1:return t=e.sent(),this.lastPage=t.last_page||this.page,this.entityFiles=this.entityFiles.concat(t.data),this.isWorking=!1,[2]}}))}))},t.prototype.addEntityFile=function(){var t=this;this.dialog.open(Ft,{width:"700px",data:{entity:this.filters,hideTitleAndDetails:this.hideTitleAndDetails},autoFocus:!1,restoreFocus:!1}).afterClosed().subscribe((function(e){return z(t,void 0,void 0,(function(){var t;return $(this,(function(n){return e&&((t=W(this.entityFiles)).push(e),this.entityFiles=t),[2]}))}))}))},t.prototype.editEntityFile=function(t){var e=this;this.dialog.open(Ft,{width:"700px",autoFocus:!1,data:{file:t,hideTitleAndDetails:this.hideTitleAndDetails}}).afterClosed().subscribe((function(t){t&&e.reload()}))},t.prototype.deleteEntityFile=function(t){var e=this;this.dialog.open(H,{width:"400px",data:{title:"Delete File",message:"Are you sure to proceed delete the file "+t.title+"?"},autoFocus:!1}).afterClosed().subscribe((function(n){return z(e,void 0,void 0,(function(){return $(this,(function(e){switch(e.label){case 0:return n?[4,this.entityFileService.deleteEntityFile(t)]:[3,2];case 1:e.sent(),this.alertService.addAlert("File successfully deleted","success"),this.reload(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.onScroll=function(){this.page<this.lastPage&&!this.isWorking&&(this.page+=1,this.fetchEntityFilesDetails())},t.prototype.reload=function(){this.entityFiles=[],this.page=1,this.isWorking||this.fetchEntityFilesDetails()},t.prototype.ngOnDestroy=function(){},t.prototype.resetFieldValue=function(){this.search.setValue("")},t}(),t.ɵo.decorators=[{type:e.Component,args:[{selector:"app-entity-files-view-all",template:'<div fxLayout="column" fxLayoutGap="1rem" class="mat-typography p-4" *ngIf="!displayMode">\n <div fxLayout="column" fxLayoutGap="0.25rem">\n <h3 class="font-weight-bold" fxLayoutAlign="center center"> Files\n <button type="button" class="mx-1" mat-mini-fab color="primary" (click)="addEntityFile()" *ngIf="!viewOnly">\n <mat-icon>add</mat-icon>\n </button>\n </h3>\n <div fxLayout="row wrap" fxLayoutAlign="start" *ngIf="!removeSearch">\n <mat-form-field class="mt-1">\n <input type="text" matInput [formControl]="search" placeholder="Title" name="title"\n autocomplete="off" />\n <button mat-button *ngIf="filters.title" matSuffix mat-icon-button (click)="resetFieldValue()">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </div>\n <table mat-table [dataSource]="entityFiles" class="w-100" matSort multiTemplateDataRows\n infiniteScrollContainer="body" infiniteScroll [infiniteScrollDistance]="1.5" [infiniteScrollThrottle]="50"\n [fromRoot]="true" (scrolled)="onScroll()">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let element; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n \x3c!-- Title Column --\x3e\n <ng-container matColumnDef="title">\n <th mat-header-cell *matHeaderCellDef> Title </th>\n <td mat-cell *matCellDef="let element"> {{element.title}} </td>\n </ng-container>\n\n \x3c!-- Details Column --\x3e\n <ng-container matColumnDef="details">\n <th mat-header-cell *matHeaderCellDef> Details </th>\n <td mat-cell *matCellDef="let element"> {{element.details}} </td>\n </ng-container>\n\n \x3c!-- File Column --\x3e\n <ng-container matColumnDef="file">\n <th mat-header-cell *matHeaderCellDef> File </th>\n <td mat-cell *matCellDef="let element">\n <a href="{{element.url}}" target="_blank">\n <button mat-button type="button">View</button>\n </a>\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let element" style="min-width:110px">\n <button type="button" mat-icon-button (click)="editEntityFile(element)">\n <mat-icon>edit</mat-icon>\n </button>\n <button type="button" mat-icon-button (click)="deleteEntityFile(element)">\n <mat-icon>delete</mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n</div>\n\n<div fxLayout="row wrap" fxLayoutGap="1rem" class="mat-typography p-4" *ngIf="displayMode">\n\n <div *ngFor="let efile of entityFiles">\n <app-document-viewer [file]="efile.file" [fileUrl]="efile.url" [config]="this.viewerConfig"\n [disableEdit]="true">\n </app-document-viewer>\n <a href="{{efile.url}}" target="_blank">\n <button mat-button type="button">View</button>\n </a>\n </div>\n\n</div>',styles:[""]}]}],t.ɵo.ctorParameters=function(){return[{type:bt},{type:a.Location},{type:at},{type:n.MatDialog}]},t.ɵo.propDecorators={entityId:[{type:e.Input}],entityType:[{type:e.Input}],viewOnly:[{type:e.Input}],removeSearch:[{type:e.Input}],hideTitleAndDetails:[{type:e.Input}],displayMode:[{type:e.Input}]},t.ɵo=B([r.UntilDestroy()],t.ɵo);var It=function(){function t(t){this.alertService=t,this.fileArray=[],this.fileChanged=new e.EventEmitter,this.border="1px dashed #989898"}return t.prototype.ngOnInit=function(){this.isSingleMode=!Boolean(this.config.multiple)},t.prototype.dragEnter=function(t){t.target.style.background=this.config.dragColor||"#c0c0c0",t.target.style.border="1px dashed black",t.preventDefault()},t.prototype.dragOver=function(t){t.preventDefault()},t.prototype.dragLeave=function(t){t.target.style.background="",t.target.style.border=this.border,t.preventDefault()},t.prototype.dropEvent=function(t){t.target.style.background="",t.target.style.border=this.border;var e=t.dataTransfer.files;if(e.length>0){var n=Array.from(e);this.addFiles(n)}t.preventDefault()},t.prototype.onFileChange=function(t){if(t.target.files&&t.target.files.length){var e=Array.from(t.target.files);this.addFiles(e),document.getElementById(this.config.fileId).value=""}},t.prototype.addFiles=function(t){var e=this;this.isSingleMode?0===this.fileArray.length&&this.fileSizeAllowed(t[0])&&(this.fileArray.push(t[0]),this.fileArray.sort(this.sortFiles),this.fileChanged.emit(this.fileArray)):(t.forEach((function(t){e.fileArray=e.fileArray.filter((function(e){return e.name!==t.name})),e.fileSizeAllowed(t)&&e.fileArray.push(t)})),this.fileArray.sort(this.sortFiles),this.fileChanged.emit(this.fileArray))},t.prototype.sortFiles=function(t,e){var n=t.name.toUpperCase(),o=e.name.toUpperCase();return n<o?-1:n>o?1:0},t.prototype.fileSizeAllowed=function(t){return!Boolean(this.config.maxSize)||(t.size/1048576<this.config.maxSize||(this.alertService.addAlert("The size of the file exceeds the limit "+this.config.maxSize+" MB, kindly upload a file with size "+this.config.maxSize+" MB or below","warn"),!1))},t.prototype.clickEvent=function(t){this.isSingleMode&&this.fileArray.length>0||document.getElementById(this.config.fileId).click(),t.preventDefault()},t}();It.decorators=[{type:e.Component,args:[{selector:"app-file-dropper",template:'<div\n id="{{ config.containerId }}"\n [ngStyle]="config.styles"\n class="file-border"\n (dragleave)="dragLeave($event)"\n (dragenter)="dragEnter($event)"\n (dragover)="dragOver($event)"\n (click)="clickEvent($event)"\n (drop)="dropEvent($event)"\n [ngClass]="{ \'disable-div\': isSingleMode && fileArray.length > 0 }"\n>\n <div fxFill fxLayout="column" fxLayoutAlign="center center">\n <div>\n <span>Drag and drop file</span>\n </div>\n\n <div class="mt-2">\n <span>or</span>\n </div>\n\n <div class="mt-2">\n <button mat-raised-button color="primary" type="button">Browse</button>\n </div>\n\n <div class="mt-4">\n <span>Supported files</span>\n </div>\n\n <div *ngIf="config.acceptFileText">\n <span>{{ config.acceptFileText }}</span>\n </div>\n </div>\n</div>\n<input\n type="file"\n id="{{ config.fileId }}"\n [accept]="config.acceptFile"\n (change)="onFileChange($event)"\n [multiple]="config.multiple === true"\n style="display:none"\n/>\n',styles:[".disable-div{cursor:not-allowed}.file-border{border:1px dashed #989898}"]}]}],It.ctorParameters=function(){return[{type:at}]},It.propDecorators={fileArray:[{type:e.Input}],config:[{type:e.Input}],fileChanged:[{type:e.Output}],styles:[{type:e.Input}]};var wt=function(){},Dt=function(){function t(t){this.http=t}return t.prototype.getNotes=function(t){return this.http.get("api/notes",{params:t}).toPromise()},t.prototype.addNote=function(t){return this.http.post("api/notes",t).toPromise()},t.prototype.editNote=function(t){return this.http.put("api/notes/"+t.id,t).toPromise()},t.prototype.deleteNote=function(t){return this.http.delete("api/notes/"+t.id).toPromise()},t}();Dt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Dt(e.ɵɵinject(vt))},token:Dt,providedIn:"root"}),Dt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Dt.ctorParameters=function(){return[{type:vt}]};var St={note:{required:"Note is required"}},Mt=function(){function t(t,e,n,o,i,r){this.dialogRef=t,this.data=e,this.fb=n,this.formValidatorService=o,this.alertService=i,this.noteService=r,this.createForm()}return t.prototype.createForm=function(){this.noteFormGroup=this.fb.group({id:[""],note:["",l.Validators.compose([l.Validators.required])],model_type:[""],related_model_id:[""]})},t.prototype.ngOnInit=function(){this.data.update&&(this.updateMode=!0),this.noteFormGroup.patchValue(this.data.note)},t.prototype.submit=function(){var t;return z(this,void 0,void 0,(function(){var e,n,o;return $(this,(function(i){switch(i.label){case 0:return this.noteFormFirstAttempt=!0,this.noteFormGroup.valid?(e=this.noteFormGroup.value,this.updateMode?[4,this.noteService.editNote(e)]:[3,2]):[3,5];case 1:return o=i.sent(),[3,4];case 2:return[4,this.noteService.addNote(e)];case 3:o=i.sent(),i.label=4;case 4:n=o,this.alertService.addAlert((null===(t=this.data)||void 0===t?void 0:t.labelText)+" saved successfully","success"),this.dialogRef.close(n),i.label=5;case 5:return[2]}}))}))},t.prototype.cancel=function(){this.dialogRef.close()},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.noteFormGroup,this.noteFormFirstAttempt)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.noteFormGroup,St)},t}();Mt.decorators=[{type:e.Component,args:[{selector:"app-note-form",template:'<form [formGroup]="noteFormGroup" (ngSubmit)="submit()">\n <div fxLayout="column" class="mat-typography">\n <div mat-dialog-title class="text-center">\n <div>{{data?.labelText}}</div>\n </div>\n\n <div mat-dialog-content fxLayout="column">\n <div fxLayout="row wrap" fxLayoutAlign="space-between">\n <mat-form-field fxFlex="100%">\n <textarea matInput formControlName="note" placeholder="{{data?.labelText}}" autocomplete="off"\n required></textarea>\n <mat-error *ngIf="isFieldValid(\'note\')">{{\n getErrorMessage("note")\n }}</mat-error>\n </mat-form-field>\n\n <div class="my-2" fxLayout="row" fxLayoutGap="30px" fxLayoutAlign="end" fxFlex="100%">\n <button mat-raised-button type="button" (click)="cancel()">\n Cancel\n </button>\n <button mat-raised-button type="submit" color="primary">Save</button>\n </div>\n </div>\n </div>\n </div>\n</form>',styles:[""]}]}],Mt.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:l.FormBuilder},{type:Ct},{type:at},{type:Dt}]};var Tt,_t=function(){function t(t,e){this.noteService=t,this.dialog=e,this.readonly=!1,this.labelText="Note",this.commentsView=!1,this.notes=[],this.displayedColumns=["index","note","actions"],this.page=1,this.lastPage=1,this.filters={},this.filters.sort_by="created_at|DESC"}return t.prototype.ngOnInit=function(){this.readonly&&(this.displayedColumns=this.displayedColumns.filter((function(t){return"actions"!==t}))),this.filters.related_model_id=this.relatedModelId,this.filters.model_type=this.modelType,this.loadData()},t.prototype.loadData=function(){return z(this,void 0,void 0,(function(){var t;return $(this,(function(e){switch(e.label){case 0:return[4,this.noteService.getNotes(Object.assign(Object.assign({},this.filters),{page:this.page}))];case 1:return t=e.sent(),this.notes=this.notes.concat(t.data),this.page=t.current_page,this.lastPage=t.last_page,[2]}}))}))},t.prototype.addNote=function(){var t=this;this.dialog.open(Mt,{width:"400px",data:{note:{related_model_id:this.relatedModelId,model_type:this.modelType},labelText:this.labelText},autoFocus:!1}).afterClosed().subscribe((function(e){e&&(t.resetScroll(),t.loadData())}))},t.prototype.editNote=function(t){var e=this;this.dialog.open(Mt,{width:"400px",data:{note:t,update:!0,labelText:this.labelText},autoFocus:!1}).afterClosed().subscribe((function(t){t&&(e.resetScroll(),e.loadData())}))},t.prototype.deleteNote=function(t){return z(this,void 0,void 0,(function(){var e=this;return $(this,(function(n){return this.dialog.open(H,{width:"400px",data:{title:"Delete "+this.labelText,message:"Are you sure to delete?"},autoFocus:!1}).afterClosed().subscribe((function(n){return z(e,void 0,void 0,(function(){return $(this,(function(e){switch(e.label){case 0:return n?[4,this.noteService.deleteNote(t)]:[3,2];case 1:e.sent(),this.notes=this.notes.filter((function(e){return e.id!==t.id})),e.label=2;case 2:return[2]}}))}))})),[2]}))}))},t.prototype.resetScroll=function(){this.page=1,this.lastPage=1,this.notes=[]},t.prototype.onScroll=function(){this.page<this.lastPage&&(this.page+=1,this.loadData())},t.prototype.commentAction=function(t){if("save"===t.type)return t.value.id?void this.editComment(t.value):void this.addComment(t.value);this.deleteNote(t.value)},t.prototype.editComment=function(t){return z(this,void 0,void 0,(function(){var e,n;return $(this,(function(o){switch(o.label){case 0:return[4,this.noteService.editNote(t)];case 1:return e=o.sent(),-1!==(n=this.notes.findIndex((function(e){return e.id===t.id})))&&(this.notes[n]=e.item),[2]}}))}))},t.prototype.addComment=function(t){return z(this,void 0,void 0,(function(){var e;return $(this,(function(n){switch(n.label){case 0:return t.related_model_id=this.relatedModelId,t.model_type=this.modelType,[4,this.noteService.addNote(t)];case 1:return e=n.sent(),this.notes.push(e.item),[2]}}))}))},t}();_t.decorators=[{type:e.Component,args:[{selector:"app-note-list",template:'<div fxLayout="column" fxLayoutGap="1.5rem" class="m-4" *ngIf="!commentsView">\n\n <div fxLayout fxLayoutAlign="center center" fxLayoutGap="1rem">\n <h3 class="m-0 font-weight-bold mr-3">{{labelText}}s</h3>\n <button class="d-print-none" *ngIf="!readonly" mat-raised-button color="primary" type="button"\n (click)="addNote()">+ Add</button>\n </div>\n\n <div class="w-100 scroll-container" infiniteScroll [infiniteScrollDistance]="1" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="notes" class="w-100" multiTemplateDataRows>\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let note; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n\n <ng-container matColumnDef="note">\n <th mat-header-cell *matHeaderCellDef> {{labelText}} </th>\n <td mat-cell *matCellDef="let note">\n {{note?.note}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef class="d-print-none"> Actions </th>\n <td mat-cell *matCellDef="let note" class="d-print-none">\n <button type="button" mat-icon-button (click)="editNote(note)">\n <mat-icon>edit</mat-icon>\n </button>\n <button type="button" mat-icon-button (click)="deleteNote(note)">\n <mat-icon>delete</mat-icon>\n </button>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n\n</div>\n\n<div fxLayout="column" fxLayoutGap="1.5rem" class="m-4" *ngIf="commentsView">\n <div fxLayout fxLayoutAlign="center center" fxLayoutGap="1rem">\n <h3 class="m-0 font-weight-bold mr-3">{{labelText}}s</h3>\n </div>\n\n <div fxLayout="column" class="w-100 scroll-container jumbotron p-4" infiniteScroll [infiniteScrollDistance]="1"\n [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" fxLayoutAlign="start"\n fxFlex="100%">\n <app-comment-form [commentData]="comment" (action)="commentAction($event)" *ngFor="let comment of notes">\n </app-comment-form>\n <app-comment-form (action)="commentAction($event)"></app-comment-form>\n </div>\n</div>',styles:[".scroll-container{max-height:400px;overflow-y:auto}"]}]}],_t.ctorParameters=function(){return[{type:Dt},{type:n.MatDialog}]},_t.propDecorators={relatedModelId:[{type:e.Input}],modelType:[{type:e.Input}],readonly:[{type:e.Input}],labelText:[{type:e.Input}],commentsView:[{type:e.Input}]},t.ɵx=Tt=function(){function t(t,n,o,i,r,a){var l=this;this._focusMonitor=n,this.http=o,this._elementRef=i,this.dialog=r,this.ngControl=a,this.valueField="id",this.titleField="title",this.multiple=!1,this.selectedValueChange=new e.EventEmitter,this.enableSearch=!0,this.add=!1,this.edit=!1,this.sort=!0,this.items=[],this.selectionChange=new e.EventEmitter,this.itemsChange=new e.EventEmitter,this.isLoading=!1,this.onChange=function(){},this.onTouched=function(){},this.stateChanges=new c.Subject,this.focused=!1,this.controlType="searchable-selctor",this.id="searchable-selctor-"+Tt.nextId++,this.describedBy="",this._required=!1,this._disabled=!1,this.selectorForm=t.group({select_value:[null],search:""}),n.monitor(i,!0).subscribe((function(t){l.focused&&!t&&l.onTouched(),l.focused=!!t,l.stateChanges.next()})),null!=this.ngControl&&(this.ngControl.valueAccessor=this)}return Object.defineProperty(t.prototype,"empty",{get:function(){return!this.selectorForm.value.select_value},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldLabelFloat",{get:function(){return this.focused||!this.empty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this.selectorForm.get("select_value").setValidators(l.Validators.required),this._required=m.coerceBooleanProperty(t),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=m.coerceBooleanProperty(t),this._disabled?this.selectorForm.disable():this.selectorForm.enable(),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.selectorForm.valid?this.selectorForm.value.select_value:""},set:function(t){this.selectorForm.patchValue({select_value:t||""}),this.stateChanges.next()},enumerable:!1,configurable:!0}),t.prototype.openedChange=function(t){0===this.dataItems.length&&this.selectorForm.get("search").value&&this.selectorForm.get("search").setValue("")},Object.defineProperty(t.prototype,"dataItems",{get:function(){var t=this,e=[];return e=(e=this.multiple&&this.selectedValue&&this.selectedValue.length>0?W(this.selectedValue,this.items):!this.multiple&&this.selectedValue?W([this.selectedValue],this.items):this.items).filter((function(e,n,o){return o.findIndex((function(e){return e[t.valueField]===o[n][t.valueField]}))===n})),this.itemsChange.emit(e),e},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.selectorForm.get("search").valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){t.enableSearch&&t.search(e)})),this.filters={perPage:25,search:"",page:1,lastPage:1},this.sort&&(this.filters.sort_by=this.sortBy||this.titleField+"|asc"),0===this.items.length&&this.fetchItemList()},t.prototype.fetchItemList=function(){var t=this;this.isLoading=!0,c.of().pipe(u.startWith(!0),u.switchMap((function(e){return c.from(t.http.get(t.apiUrl,{params:t.filters}))})),u.finalize((function(){return t.isLoading=!1})),r.untilDestroyed(this)).subscribe((function(e){t.items=t.items.concat(e.data),t.filters.page=e.current_page,t.filters.lastPage=e.last_page}))},t.prototype.setDescribedByIds=function(t){this.describedBy=t.join(" ")},t.prototype.onContainerClick=function(t){t.stopPropagation()},t.prototype.writeValue=function(t){this.value=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.getPropertyValue=function(t,e){for(var n=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),o=0,i=n.length;o<i;++o){var r=n[o];if(!t||!(r in t))return;t=t[r]}return t},t.prototype._handleInput=function(){var t=this;this.onChange(this.value),this.multiple?this.selectedValue=this.value.map((function(e){return t.dataItems.find((function(n){return n[t.valueField]===e}))})):this.selectedValue=this.dataItems.find((function(e){return e[t.valueField]===t.value})),this.selectedValueChange.emit(this.selectedValue),this.selectionChange.emit(this.value)},Object.defineProperty(t.prototype,"errorState",{get:function(){return this.ngControl&&this.ngControl.invalid&&(this.ngControl.touched||this.ngControl.dirty)},enumerable:!1,configurable:!0}),t.prototype.onScroll=function(){this.filters.lastPage>this.filters.page&&(this.filters.page+=1,this.fetchItemList())},t.prototype.reloadData=function(){this.items=[],this.filters.page=1,this.filters.lastPage=1,this.fetchItemList()},t.prototype.search=function(t){this.searchField?this.filters[this.searchField]=t:this.filters.search=t,this.reloadData()},t.prototype.addItem=function(t){var e=this;this.dialog.open(this.itemComponent,Object.assign({width:"400px",autoFocus:!1,data:{}},this.addConfig)).afterClosed().subscribe((function(t){t&&(e.items.push(t.item),e.selectorForm.get("select_value").setValue(t.item[e.valueField]),e._handleInput())})),t.stopPropagation()},t.prototype.editItem=function(t){var e=this;this.dialog.open(this.itemComponent,Object.assign({width:"400px",autoFocus:!1,data:{item:this.selectedValue}},this.editConfig)).afterClosed().subscribe((function(t){t&&(e.items=e.items.filter((function(t){return t[e.valueField]!==e.selectedValue[e.valueField]})),e.items.push(t.item),e.selectedValue=null,e.selectorForm.get("select_value").setValue(t.item[e.valueField]),e._handleInput())})),t.stopPropagation()},t.prototype.ngOnDestroy=function(){this.stateChanges.complete(),this._focusMonitor.stopMonitoring(this._elementRef)},t}(),t.ɵx.nextId=0,t.ɵx.decorators=[{type:e.Component,args:[{selector:"app-searchable-selector",template:'<div [formGroup]="selectorForm" class="searchable-selctor-container">\n <mat-select formControlName="select_value" focused="false" [multiple]="multiple" [required]="required"\n autocomplete="off" (selectionChange)="_handleInput()" msInfiniteScroll (infiniteScroll)="onScroll()"\n (openedChange)="openedChange($event)">\n <mat-form-field *ngIf="enableSearch" class="p-1 w-100">\n <input matInput formControlName="search" placeholder="Search..." (keydown)="$event.stopPropagation();"\n autocomplete="off">\n </mat-form-field>\n <div>\n \x3c!-- TODO:Implement scroll only for options and have search fixed --\x3e\n <mat-option *ngFor=" let item of dataItems" [value]="getPropertyValue(item,valueField)">\n {{getPropertyValue(item,titleField)}}\n </mat-option>\n </div>\n <div fxlayout="column" class="w-100" fxLayoutAlign="center center">\n <mat-spinner class="my-4" color="primary" diameter="30" *ngIf="isLoading"></mat-spinner>\n </div>\n </mat-select>\n <mat-icon *ngIf="add" class="relative-icon" matSuffix (click)="addItem($event)">add_circle_outline</mat-icon>\n <mat-icon *ngIf="edit && selectedValue" class="relative-icon" matSuffix (click)="editItem($event)">edit</mat-icon>\n</div>',providers:[{provide:f.MatFormFieldControl,useExisting:Tt}],styles:[".searchable-selctor-container{display:flex}.relative-icon{position:relative;top:-4px}"]}]}],t.ɵx.ctorParameters=function(){return[{type:l.FormBuilder},{type:p.FocusMonitor},{type:vt},{type:e.ElementRef},{type:n.MatDialog},{type:l.NgControl,decorators:[{type:e.Optional},{type:e.Self}]}]},t.ɵx.propDecorators={valueField:[{type:e.Input}],titleField:[{type:e.Input}],apiUrl:[{type:e.Input}],multiple:[{type:e.Input}],selectedValue:[{type:e.Input}],selectedValueChange:[{type:e.Output}],enableSearch:[{type:e.Input}],add:[{type:e.Input}],addConfig:[{type:e.Input}],edit:[{type:e.Input}],editConfig:[{type:e.Input}],sort:[{type:e.Input}],sortBy:[{type:e.Input}],searchField:[{type:e.Input}],itemComponent:[{type:e.Input}],items:[{type:e.Input}],selectionChange:[{type:e.Output}],itemsChange:[{type:e.Output}],required:[{type:e.Input}],disabled:[{type:e.Input}],value:[{type:e.Input}]},t.ɵx=Tt=B([r.UntilDestroy()],t.ɵx);var Lt=function(){function t(t,n){this.matSelect=t,this.ngZone=n,this.threshold="15%",this.debounceTime=150,this.infiniteScroll=new e.EventEmitter,this.thrPx=0,this.thrPc=0,this.singleOptionHeight=h.SELECT_ITEM_HEIGHT_EM,this.destroyed$=new c.Subject}return t.prototype.ngOnInit=function(){this.evaluateThreshold()},t.prototype.ngAfterViewInit=function(){var t=this;this.matSelect.openedChange.pipe(u.takeUntil(this.destroyed$)).subscribe((function(e){e&&(t.panel=t.matSelect.panel.nativeElement,t.singleOptionHeight=t.getSelectItemHeightPx(),t.registerScrollListener())}))},t.prototype.ngOnDestroy=function(){this.destroyed$.next(!0),this.destroyed$.complete()},t.prototype.evaluateThreshold=function(){this.threshold.lastIndexOf("%")>-1?(this.thrPx=0,this.thrPc=parseFloat(this.threshold)/100):(this.thrPx=parseFloat(this.threshold),this.thrPc=0)},t.prototype.registerScrollListener=function(){var t=this;c.fromEvent(this.panel,"scroll").pipe(u.takeUntil(this.destroyed$),u.debounceTime(this.debounceTime),u.tap((function(e){t.handleScrollEvent(e)}))).subscribe()},t.prototype.handleScrollEvent=function(t){var e=this;this.ngZone.runOutsideAngular((function(){if(!e.complete){var n=e.matSelect.options.length,o=e.singleOptionHeight*n,i=0!==e.thrPc?o*e.thrPc:e.thrPx;e.panel.clientHeight+t.target.scrollTop+i>=o&&e.ngZone.run((function(){return e.infiniteScroll.emit()}))}}))},t.prototype.getSelectItemHeightPx=function(){return parseFloat(getComputedStyle(this.panel).fontSize)*h.SELECT_ITEM_HEIGHT_EM},t}();Lt.decorators=[{type:e.Directive,args:[{selector:"[msInfiniteScroll]"}]}],Lt.ctorParameters=function(){return[{type:h.MatSelect},{type:e.NgZone}]},Lt.propDecorators={threshold:[{type:e.Input}],debounceTime:[{type:e.Input}],complete:[{type:e.Input}],infiniteScroll:[{type:e.Output}]};var kt=function(){function t(){this.numItemsChange=new e.EventEmitter}return t.prototype.numItemsChanged=function(){this.numItemsChange.emit(this.numItems)},t}();kt.decorators=[{type:e.Component,args:[{selector:"num-items-selector",template:'<select [(ngModel)]="numItems" class="form-control" id="numItems" name="numItems" (change)="numItemsChanged()">\r\n <option value="25">25</option>\r\n <option value="50">50</option>\r\n <option value="100">100</option>\r\n <option value="250">250</option>\r\n <option value="500">500</option>\r\n <option value="1000">1000</option>\r\n <option value="2000">2000</option>\r\n <option value="3000">3000</option>\r\n <option value="4000">4000</option>\r\n <option value="5000">5000</option>\r\n <option value="5000000000">All</option>\r\n</select> '}]}],kt.ctorParameters=function(){return[]},kt.propDecorators={numItems:[{type:e.Input}],numItemsChange:[{type:e.Output}]};var At=function(){function t(){}return t.prototype.getYYYYMMDDString=function(t){return t.getFullYear()+"-"+(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-"+(t.getDate()<10?"0"+t.getDate():t.getDate())},t.prototype.getYYYY=function(t){return t.getFullYear()},t.prototype.getMM=function(t){return t.getMonth()+1},t.prototype.getDateTime=function(t){return t.getFullYear()+"-"+(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-"+(t.getDate()<10?"0"+t.getDate():t.getDate())+" "+t.toLocaleTimeString()},t}();At.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new At},token:At,providedIn:"root"}),At.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var Et=function(){function t(){this.items=new Array,this.selectedValueChange=new e.EventEmitter}return t.prototype.numChanged=function(){this.selectedValueChange.emit(this.selectedValue)},t.prototype.ngOnInit=function(){for(var t=this.start_value;t<this.end_value+1;t++)this.items.push(t)},t}();function Ut(t){var e=new Date,n={date_from:e,date_to:e,show_custom_field:!1};switch(t){case 1:n.show_custom_field=!0;break;case 2:n.date_from=e,n.date_to=e;break;case 3:var o=new Date(e);o.setDate(o.getDate()-1),n.date_from=o,n.date_to=o;break;case 4:var i=e.getDate()-e.getDay()+1,r=i+6;n.date_from=new Date(e.setDate(i)),n.date_to=new Date(e.setDate(r));break;case 5:var a=(s=new Date).setTime(s.getTime()-24*(s.getDay()?s.getDay():7)*60*60*1e3),l=s.setTime(s.getTime()-5184e5);n.date_from=new Date(l),n.date_to=new Date(a);break;case 6:n.date_from=new Date(e.getFullYear(),e.getMonth(),1),n.date_to=new Date(e.getFullYear(),e.getMonth()+1,0);break;case 7:var s;(s=new Date).setDate(1),s.setHours(-1),n.date_from=new Date(e.getFullYear(),e.getMonth()-1,1),n.date_to=s;break;case 8:var c=Math.floor(e.getMonth()/3),u=new Date(e.getFullYear(),3*c,1),d=new Date(u.getFullYear(),u.getMonth()+3,0);n.date_from=u,n.date_to=d;break;case 9:c=Math.floor(e.getMonth()/3),u=new Date(e.getFullYear(),3*c-3,1),d=new Date(u.getFullYear(),u.getMonth()+3,0);n.date_from=u,n.date_to=d;break;case 10:n.date_from=new Date("1/1/"+(new Date).getFullYear()),n.date_to=new Date("12/31/"+(new Date).getFullYear());break;case 11:n.date_from=new Date("1/1/"+((new Date).getFullYear()-1)),n.date_to=new Date("12/31/"+((new Date).getFullYear()-1));break;default:n.date_from="",n.date_to=""}return n}Et.decorators=[{type:e.Component,args:[{selector:"number-selector",template:'<div class="number-selector-wrapper">\n <select name="selectedValue" [(ngModel)]="selectedValue" class="form-control" (change)="numChanged()">\n <option value="">-- Student Status --</option>\n <option *ngFor="let start_value of items;" value="{{start_value}}">{{start_value}}</option>\n </select>\n</div>'}]}],Et.ctorParameters=function(){return[]},Et.propDecorators={start_value:[{type:e.Input}],end_value:[{type:e.Input}],selectedValueChange:[{type:e.Output}],selectedValue:[{type:e.Input}]};var Vt=function(){};Vt.CUSTOM=1,Vt.TODAY=2,Vt.YESTERDAY=3,Vt.THIS_WEEK=4,Vt.LAST_WEEK=5,Vt.THIS_MONTH=6,Vt.LAST_MONTH=7,Vt.THIS_QUARTER=8,Vt.LAST_QUARTER=9,Vt.THIS_YEAR=10,Vt.LAST_YEAR=11,Vt.ALL=12,t.ɵbb=function(){function t(){this.timelineValue=new l.FormControl(""),this.timelines=[{value:1,viewValue:"Custom"},{value:2,viewValue:"Today"},{value:3,viewValue:"Yesterday"},{value:4,viewValue:"This Week"},{value:5,viewValue:"Last Week"},{value:6,viewValue:"This Month"},{value:7,viewValue:"Last Month"},{value:8,viewValue:"This Quarter"},{value:9,viewValue:"Last Quarter"},{value:10,viewValue:"This Year"},{value:11,viewValue:"Last Year"},{value:12,viewValue:"All dates"}],this.labelText="Select Timeline",this.dateFrom="date_from",this.dateTo="date_to",this.appearance="legacy",this.showClearbutton=!1,this.showCustomDateFields=!1}return Object.defineProperty(t.prototype,"defaultValue",{set:function(t){this.timelineValue.setValue(t),this.changeTimeline(t)},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.timelineValue.valueChanges.pipe(u.debounceTime(100),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){return t.changeTimeline(e)}))},t.prototype.resetFieldValue=function(t){this.form.get(t).setValue("")},t.prototype.getFieldValue=function(t){return this.form.get(t).value},t.prototype.setFieldValue=function(t,e){this.form.get(t).setValue(e)},t.prototype.changeTimeline=function(t){var e=Ut(t);e&&(this.setFieldValue(this.dateFrom,e.date_from),this.setFieldValue(this.dateTo,e.date_to),this.showCustomDateFields=e.show_custom_field)},t}(),t.ɵbb.decorators=[{type:e.Component,args:[{selector:"app-timeline-filter",template:'<ng-container [formGroup]="form">\n <mat-form-field [appearance]="appearance">\n <mat-label>{{labelText}}</mat-label>\n <mat-select [formControl]="timelineValue">\n <mat-option *ngFor="let timeline of timelines" [value]="timeline.value">\n {{timeline.viewValue}}\n </mat-option>\n </mat-select>\n <button mat-button *ngIf="showClearbutton && timelineValue.value" matSuffix mat-icon-button\n (click)="timelineValue.setValue(\'\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <ng-container *ngIf="showCustomDateFields">\n <mat-form-field [appearance]="appearance">\n <mat-label>From Date</mat-label>\n <input matInput formControlName="{{dateFrom}}" [matDatepicker]="fromPicker" (click)="fromPicker.open()"\n placeholder="From Date" readonly />\n <mat-datepicker-toggle matSuffix [for]="fromPicker"></mat-datepicker-toggle>\n <mat-datepicker #fromPicker></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(dateFrom)" matSuffix mat-icon-button\n (click)="resetFieldValue(dateFrom)">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field [appearance]="appearance">\n <mat-label>To Date</mat-label>\n <input matInput formControlName="{{dateTo}}" [matDatepicker]="toPicker" (click)="toPicker.open()"\n placeholder="To Date" readonly />\n <mat-datepicker-toggle matSuffix [for]=""></mat-datepicker-toggle>\n <mat-datepicker #toPicker></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(dateTo)" matSuffix mat-icon-button\n (click)="resetFieldValue(dateTo)">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n </ng-container>\n</ng-container>',styles:[""]}]}],t.ɵbb.ctorParameters=function(){return[]},t.ɵbb.propDecorators={timelineValue:[{type:e.Input}],timelines:[{type:e.Input}],labelText:[{type:e.Input}],dateFrom:[{type:e.Input}],dateTo:[{type:e.Input}],appearance:[{type:e.Input}],showClearbutton:[{type:e.Input}],form:[{type:e.Input}],defaultValue:[{type:e.Input}]},t.ɵbb=B([r.UntilDestroy()],t.ɵbb);var Pt=function(){function t(){this.isLoading=!1,this.size=.6}return t.prototype.ngOnInit=function(){},t}();Pt.decorators=[{type:e.Component,args:[{selector:"app-loader",template:'<div [hidden]="!isLoading">\n <mat-progress-spinner mode="indeterminate" [strokeWidth]="2" [diameter]="32 * size"></mat-progress-spinner>\n <span class="message">{{message}}</span>\n</div>\n',styles:[".mat-progress-spinner{display:inline-block;vertical-align:middle}.message{margin-left:.5em}"]}]}],Pt.ctorParameters=function(){return[]},Pt.propDecorators={isLoading:[{type:e.Input}],size:[{type:e.Input}],message:[{type:e.Input}]};var jt=function(){};jt.decorators=[{type:e.NgModule,args:[{declarations:[it,rt],imports:[a.CommonModule,d.MatSnackBarModule,g.MatIconModule],exports:[it,rt]}]}];var Ot=new et("AuthenticationGuard"),Rt=function(){function t(t,e){this.router=t,this.credentialsService=e}return t.prototype.canActivate=function(t,e){return this.isUserAuthenticated(t,e)},t.prototype.canLoad=function(t,e){return this.isUserAuthenticated(t,e)},t.prototype.isUserAuthenticated=function(t,e){return!!this.credentialsService.isAuthenticated||(Ot.debug("Not authenticated, redirecting and adding redirect url..."),this.router.navigate(["/login"],{queryParams:{redirect:e.url},replaceUrl:!0}),!1)},t}();Rt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Rt(e.ɵɵinject(y.Router),e.ɵɵinject(mt))},token:Rt,providedIn:"root"}),Rt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Rt.ctorParameters=function(){return[{type:y.Router},{type:mt}]};var Nt=function(){function t(t,e){this.credentialsService=t,this.http=e}return t.prototype.login=function(t){var e=this,n={};return this.http.skipToken().post("oauth/token",t).pipe(u.concatMap((function(o){return z(e,void 0,void 0,(function(){var e;return $(this,(function(i){switch(i.label){case 0:return o.expires_in=Date.now()+1e3*o.expires_in,n.token=o,n.user={},this.credentialsService.setCredentials(n,t.remember),[4,this.http.get("api/user/current").toPromise()];case 1:return e=i.sent(),n.user=null==e?void 0:e.user,this.credentialsService.setCredentials(n,t.remember),[2,n]}}))}))})))},t.prototype.logout=function(){return this.credentialsService.setCredentials(),c.of(!0)},t}();Nt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Nt(e.ɵɵinject(mt),e.ɵɵinject(vt))},token:Nt,providedIn:"root"}),Nt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Nt.ctorParameters=function(){return[{type:mt},{type:vt}]};var Ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.shouldDetach=function(t){return!1},e.prototype.store=function(t,e){},e.prototype.shouldAttach=function(t){return!1},e.prototype.retrieve=function(t){return null},e.prototype.shouldReuseRoute=function(t,e){var n,o,i;return t.routeConfig===e.routeConfig||Boolean((null===(n=t.routeConfig)||void 0===n?void 0:n.component)&&(null===(o=t.routeConfig)||void 0===o?void 0:o.component)===(null===(i=e.routeConfig)||void 0===i?void 0:i.component))},e}(y.RouteReuseStrategy);Ht.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ht},token:Ht,providedIn:"root"}),Ht.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var Gt=function(){function t(){this.storageSub=new c.Subject}return t.prototype.watch=function(){return this.storageSub.asObservable()},t.prototype.setItem=function(t,e){localStorage.setItem(t,e),this.storageSub.next({key:t,value:e})},t.prototype.getItem=function(t){return localStorage.getItem(t)},t.prototype.removeItem=function(t){var e=this.getItem(t);localStorage.removeItem(t),this.storageSub.next({key:t,value:e})},t}();Gt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Gt},token:Gt,providedIn:"root"}),Gt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Gt.ctorParameters=function(){return[]};var qt=function(){function t(t){this.http=t}return t.prototype.GET=function(t,e){return void 0===e&&(e={}),this.http.get(t,{params:e}).toPromise()},t.prototype.POST=function(t,e){return null==e&&(e={blank:"blank"}),this.http.post(t,e).toPromise()},t.prototype.POSTRAW=function(t,e){return null==e&&(e={blank:"blank"}),this.http.skipHeader().post(t,e).toPromise()},t.prototype.PUT=function(t,e){return null==e&&(e={blank:"blank"}),this.http.put(t,e).toPromise()},t.prototype.PATCH=function(t,e){return null==e&&(e={blank:"blank"}),this.http.patch(t,e).toPromise()},t.prototype.DELETE=function(t){return this.http.delete(t).toPromise()},t}();qt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new qt(e.ɵɵinject(vt))},token:qt,providedIn:"root"}),qt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],qt.ctorParameters=function(){return[{type:vt}]};var Bt=function(){};Bt.decorators=[{type:e.NgModule,args:[{exports:[C.MatButtonModule,x.MatCheckboxModule,b.MatCommonModule,n.MatDialogModule,f.MatFormFieldModule,g.MatIconModule,F.MatInputModule,b.MatLineModule,I.MatMenuModule,b.MatNativeDateModule,b.MatOptionModule,w.MatProgressSpinnerModule,b.MatPseudoCheckboxModule,b.MatRippleModule,h.MatSelectModule,i.MatSortModule,o.MatTableModule,D.MatCardModule,S.MatDividerModule,M.MatChipsModule,T.MatDatepickerModule,_.MatListModule,v.MatTooltipModule]}]}];var zt=function(t){if(t)throw new Error(t+" has already been loaded. Import Core module in the root module only.")};zt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,s.HttpClientModule,y.RouterModule,jt],providers:[{provide:s.HttpClient,useClass:vt},{provide:y.RouteReuseStrategy,useClass:Ht}],exports:[jt]}]}],zt.ctorParameters=function(){return[{type:zt,decorators:[{type:e.Optional},{type:e.SkipSelf}]}]};var $t=function(){};$t.decorators=[{type:e.NgModule,args:[{imports:[L.FlexLayoutModule,a.CommonModule,Bt],declarations:[H],exports:[H],entryComponents:[H]}]}];var Yt=function(){};Yt.decorators=[{type:e.NgModule,args:[{imports:[L.FlexLayoutModule,a.CommonModule,k.InfiniteScrollModule,Bt],declarations:[t.ɵi],exports:[t.ɵi]}]}];var Wt=function(){};Wt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,L.FlexLayoutModule,A.NgxDocViewerModule,Bt],declarations:[Z],exports:[Z]}]}];var Kt=function(){};Kt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,L.FlexLayoutModule,Bt],declarations:[It],exports:[It]}]}];var Jt=function(){};Jt.decorators=[{type:e.NgModule,args:[{declarations:[Ft,t.ɵo],imports:[a.CommonModule,l.FormsModule,l.ReactiveFormsModule,L.FlexLayoutModule,Kt,Wt,k.InfiniteScrollModule,$t,Bt],exports:[t.ɵo],entryComponents:[Ft]}]}];var Qt=function(){function t(t,n){this.fb=t,this.credentialService=n,this.action=new e.EventEmitter,this.createForm()}return Object.defineProperty(t.prototype,"commentData",{set:function(t){this.view=!!t,this._commentData=t,this.commentFormGroup.patchValue(t)},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},Object.defineProperty(t.prototype,"isLoggedIn",{get:function(){return this.credentialService.isAuthenticated},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentUser",{get:function(){return this.credentialService.credentials.user},enumerable:!1,configurable:!0}),t.prototype.createForm=function(){this.commentFormGroup=this.fb.group({id:[""],note:[""],model_type:[""],related_model_id:[""]})},t.prototype.submit=function(){this.commentFormGroup.get("note").value?(this._commentData&&(this.view=!this.view),this.action.emit({type:"save",value:this.commentFormGroup.value}),this.commentFormGroup.reset()):this.commentFormGroup.get("id").value&&this.deleteComment()},t.prototype.hideEdit=function(){this.commentFormGroup.get("id").value&&(this.view=!this.view)},t.prototype.editComment=function(){this.view=!this.view,this.commentFormGroup.patchValue(this._commentData)},t.prototype.deleteComment=function(){this.action.emit({type:"delete",value:this.commentFormGroup.value})},t.prototype.ngOnDestroy=function(){},t}();Qt.decorators=[{type:e.Component,args:[{selector:"app-comment-form",template:'<form (ngSubmit)="submit()" [formGroup]="commentFormGroup">\n <div fxLayout="column" class="my-2" [ngClass]="{ \'border border-primary shadow rounded \': view}">\n <div *ngIf="!view" fxLayout="column">\n <mat-form-field appearance="outline" style="background-color:white;">\n <mat-label>Comment</mat-label>\n <textarea matInput rows="5" placeholder="Add a comment..." formControlName="note" autocomplete="off"></textarea>\n </mat-form-field>\n\n <div fxLayout fxLayoutGap="1rem" class="mt-2">\n <span fxFlex></span>\n <button *ngIf="_commentData" mat-button type="button" (click)="view = !view">\n Cancel\n </button>\n <button mat-raised-button color="primary" type="submit">\n {{ _commentData ? "Update" : "Post comment" }}\n </button>\n </div>\n </div>\n\n <div fxLayout="column" *ngIf="view" class="p-2 m-2">\n <div fxLayout="row wrap" fxLayoutGap=".5rem">\n <div fxFlex="20%" fxLayoutAlign="start">\n <button mat-icon-button type="button" style="color:grey">\n <mat-icon style="font-size:60px">account_circle</mat-icon>\n </button>\n </div>\n <div fxFlex="75%">\n <div fxLayout="column" fxLayoutGap=".5rem">\n <div class="font-weight-bold">{{ _commentData?.creator?.name }}</div>\n <div class="text-muted">{{ _commentData.updated_at | date:\'medium\' }}</div>\n </div>\n </div>\n </div>\n <app-read-more class="mt-2" [text]="_commentData.note"></app-read-more>\n <div fxLayout class="mt-1" fxLayoutGap="1rem" *ngIf="isLoggedIn && currentUser.id === _commentData.creator_id">\n <a href="javascript:;" (click)="editComment()">\n Edit\n </a>\n <a href="javascript:;" (click)="deleteComment()">\n Delete\n </a>\n </div>\n </div>\n </div>\n</form>',styles:[":host ::ng-deep .mat-form-field-wrapper{margin:0!important;padding-bottom:0!important}"]}]}],Qt.ctorParameters=function(){return[{type:l.FormBuilder},{type:mt}]},Qt.propDecorators={commentData:[{type:e.Input}],action:[{type:e.Output}]};var Zt=function(){function t(){this.maxLength=100,this.hideToggle=!0,this.isCollapsed=!0}return t.prototype.ngOnInit=function(){this.determineView()},t.prototype.toggleView=function(){this.isCollapsed=!this.isCollapsed,this.determineView()},t.prototype.determineView=function(){if(!this.text||this.text.length<=this.maxLength)return this.currentText=this.text,this.isCollapsed=!1,void(this.hideToggle=!0);this.hideToggle=!1,1==this.isCollapsed?this.currentText=this.text.substring(0,this.maxLength)+"...":0==this.isCollapsed&&(this.currentText=this.text)},t}();Zt.decorators=[{type:e.Component,args:[{selector:"app-read-more",template:'<div [innerHTML]="currentText"></div>\n<a href="javascript:;" *ngIf="!hideToggle" class="primary-color hoverable" (click)="toggleView()">Read\n {{ isCollapsed ? "more" : "less" }}</a>',styles:["div.collapsed{height:250px;overflow:hidden}.primary-color{color:#009fdd!important}"]}]}],Zt.ctorParameters=function(){return[]},Zt.propDecorators={text:[{type:e.Input}],maxLength:[{type:e.Input}]};var Xt=function(){};Xt.decorators=[{type:e.NgModule,args:[{declarations:[Zt],imports:[a.CommonModule,Bt,L.FlexLayoutModule],exports:[Zt]}]}];var te=function(){};te.decorators=[{type:e.NgModule,args:[{declarations:[_t,Mt,Qt],imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,L.FlexLayoutModule,$t,Bt,Xt],exports:[_t],entryComponents:[Mt]}]}];var ee=function(){};ee.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.ReactiveFormsModule,L.FlexLayoutModule,Bt],declarations:[t.ɵx,Lt],exports:[t.ɵx,Lt]}]}];var ne=function(){};ne.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.FormsModule],declarations:[kt,Et],exports:[kt,Et]}]}];var oe=function(){};oe.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var ie=function(){};ie.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbb],imports:[a.CommonModule,oe,L.FlexLayoutModule,Bt,l.ReactiveFormsModule],exports:[t.ɵbb]}]}];var re=function(){};re.decorators=[{type:e.NgModule,args:[{declarations:[Pt],imports:[a.CommonModule,w.MatProgressSpinnerModule],exports:[Pt]}]}];var ae=function(){};ae.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var le=function(){};le.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,ae]}]}];var se=function(){};se.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var ce=function(){};ce.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,se]}]}];var ue=function(){};ue.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];new et("EmailSubscriptionUser Form");var de={user_id:{required:"User is required"},email_type_id:{required:"Email Type is required"}};t.ɵbe=function(){function t(t,e,n,o,i,r){this.fb=t,this.formValidatorService=e,this.alertService=n,this.dialogRef=o,this.data=i,this.http=r,this.createForm()}return t.prototype.createForm=function(){this.esUserFormGroup=this.fb.group({id:[""],user_id:["",l.Validators.required],email_type_id:["",l.Validators.required]})},t.prototype.ngOnInit=function(){var t,e,n,o;(null===(e=null===(t=this.data)||void 0===t?void 0:t.esUser)||void 0===e?void 0:e.id)&&(this.esUser=this.data.esUser,this.updateMode=!0,this.selectedType=null===(n=this.esUser)||void 0===n?void 0:n.email_type,this.selectedUser=null===(o=this.esUser)||void 0===o?void 0:o.user,this.esUserFormGroup.patchValue(this.esUser))},t.prototype.submit=function(){var t=this;if(this.esUserFormGroup.markAllAsTouched(),this.esUserFormFirstAttempt=!0,this.esUserFormGroup.valid){this.isSubmitLoading=!0;var e=this.esUserFormGroup.value;(this.updateMode?this.http.put("api/email-subscription-users/"+(null==e?void 0:e.id),e):this.http.post("api/email-subscription-users",e)).pipe(u.finalize((function(){return t.isSubmitLoading=!1})),r.untilDestroyed(this)).subscribe((function(e){t.alertService.addAlert("Subscription saved successfully","success"),t.dialogRef.close(e)}))}},t.prototype.cancel=function(){this.dialogRef.close()},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.esUserFormGroup,this.esUserFormFirstAttempt)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.esUserFormGroup,de)},t.prototype.ngOnDestroy=function(){},t}(),t.ɵbe.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-user-form",template:'<form [formGroup]="esUserFormGroup" (ngSubmit)="submit()" class="mat-typography">\n <div fxLayout="column">\n <div mat-dialog-title class="text-center">\n <div>Email Subscription User</div>\n </div>\n\n <div mat-dialog-content fxLayout="column">\n <div fxLayout="row wrap" fxLayoutAlign="space-between center">\n\n <mat-form-field fxFlex="48%" class="mt-1">\n <mat-label>User</mat-label>\n <app-searchable-selector formControlName="user_id" apiUrl="api/users" titleField="name" required\n [selectedValue]="selectedUser">\n </app-searchable-selector>\n <mat-error *ngIf="isFieldValid(\'user_id\')">{{getErrorMessage(\'user_id\')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="48%" class="mt-1">\n <mat-label>Email Type</mat-label>\n <app-searchable-selector formControlName="email_type_id" apiUrl="api/email-subscription-types"\n required [selectedValue]="selectedType">\n </app-searchable-selector>\n <mat-error *ngIf="isFieldValid(\'email_type_id\')">{{getErrorMessage(\'email_type_id\')}}</mat-error>\n </mat-form-field>\n\n <div class="my-2" fxLayout="row" fxLayoutGap="30px" fxLayoutAlign="end" fxFlex="100%">\n <button mat-raised-button type="button" (click)="cancel()">Cancel</button>\n <button mat-raised-button type="submit" color="primary" [disabled]="isSubmitLoading">\n <app-loader class="inline-loader" [isLoading]="isSubmitLoading"></app-loader>\n Save\n </button>\n </div>\n </div>\n </div>\n\n\n </div>\n</form>',styles:[""]}]}],t.ɵbe.ctorParameters=function(){return[{type:l.FormBuilder},{type:Ct},{type:at},{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:vt}]},t.ɵbe=B([r.UntilDestroy()],t.ɵbe);var pe=function(){};pe.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbe],imports:[a.CommonModule,Bt,L.FlexLayoutModule,l.ReactiveFormsModule,ee,ue,re],entryComponents:[t.ɵbe]}]}];var me=new et("EmailSubscriptionUser list");t.ɵbf=function(){function e(t,e,n){this.dialog=t,this.http=e,this.router=n,this.esUserList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc"},this.displayColumns=new l.FormControl(["index","user.name","email_type.title","creator.name","created_at","actions"]),this.displayedColumns=[],this.availableDisplayColumns=[{order:1,value:"index",name:"Index"},{order:2,value:"user.name",name:"User"},{order:3,value:"email_type.title",name:"Email Type"},{order:4,value:"creator.name",name:"Creator"},{order:5,value:"actions",name:"Actions"}]}return e.prototype.ngOnInit=function(){var t=this;this.displayedColumns=this.displayColumns.value,this.initializeData(),this.sort&&this.sort.sortChange.pipe(r.untilDestroyed(this)).subscribe((function(e){t.changeSort(e)}))},Object.defineProperty(e.prototype,"selectedColumns",{get:function(){var t=this;return this.availableDisplayColumns.filter((function(e){return t.displayColumns.value.some((function(t){return t===e.value}))})).sort((function(t,e){return t.order>e.order?1:e.order>t.order?-1:0})).map((function(t){return t.value}))},enumerable:!1,configurable:!0}),e.prototype.columnsChange=function(){this.displayedColumns=this.selectedColumns},e.prototype.initializeData=function(){var t=this;this.http.get("api/email-subscription-users",{params:Object.assign(Object.assign({},this.filters),this.pageEvent)}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.esUserList=t.esUserList.concat(e.data),t.pageEvent.page=e.current_page,t.pageEvent.lastPage=e.last_page}))},e.prototype.filterChange=function(t){this.filters=Object.assign(Object.assign({},this.filters),t),this.reload()},e.prototype.addEmailSubscriptionUser=function(){var e=this;this.dialog.open(t.ɵbe,{width:"800px",autoFocus:!1,data:{}}).afterClosed().subscribe((function(t){t&&(me.debug(t),e.reload())}))},e.prototype.editEmailSubscriptionUser=function(e,n){var o=this;e.stopPropagation(),this.dialog.open(t.ɵbe,{width:"800px",autoFocus:!1,data:{esUser:n}}).afterClosed().subscribe((function(t){t&&(me.debug(t),o.reload())}))},e.prototype.deleteEmailSubscriptionUser=function(t,e){var n=this;t.stopPropagation(),this.dialog.open(H,{width:"400px",data:{title:"Delete Subscription",message:"Are you sure to proceed delete the esUser "+e.name+"?"},autoFocus:!1}).afterClosed().subscribe((function(t){t&&n.http.delete("api/email-subscription-users/"+(null==e?void 0:e.id)).pipe(r.untilDestroyed(n)).subscribe((function(t){n.esUserList=n.esUserList.filter((function(t){return t.id!==e.id}))}))}))},e.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.initializeData())},e.prototype.changeSort=function(t){t.direction&&(this.filters.sort_by=t.active+"|"+t.direction,this.reload())},e.prototype.reload=function(){this.esUserList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.initializeData()},e.prototype.ngOnDestroy=function(){},e}(),t.ɵbf.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-user-list",template:'<div class="mat-typography m-4">\n <div fxLayout="row" fxLayoutAlign="start center">\n <app-email-subscription-user-list-filter (valueChange)="filterChange($event)">\n </app-email-subscription-user-list-filter>\n <div class="ml-2">\n <button mat-raised-button color="primary" type="button" (click)="addEmailSubscriptionUser()">+\n User Subscription</button>\n </div>\n <span fxFlex></span>\n <mat-form-field appearance="outline" class="no-padding">\n <mat-label>Columns</mat-label>\n <mat-select [formControl]="displayColumns" multiple (selectionChange)="columnsChange()">\n <mat-option *ngFor="let column of availableDisplayColumns" [value]="column.value">{{column.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n\n\n <section>\n <div class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="esUserList" matSort class="w-100 mt-1" multiTemplateDataRows\n id="email-subscription-user-table">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let esUser; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n <ng-container matColumnDef="user.name">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> User </th>\n <td mat-cell *matCellDef="let esUser;"> {{ esUser?.user?.name }} </td>\n </ng-container>\n\n <ng-container matColumnDef="email_type.title">\n <th mat-header-cell *matHeaderCellDef> Email Type </th>\n <td mat-cell *matCellDef="let esUser;"> {{ esUser?.email_type?.title }} </td>\n </ng-container>\n\n <ng-container matColumnDef="creator.name">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Creator</th>\n <td mat-cell *matCellDef="let esUser;">\n {{esUser?.creator?.name }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="created_at">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Created On</th>\n <td mat-cell *matCellDef="let esUser;">\n {{esUser?.created_at | date:\'medium\' }}\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let esUser">\n <button type="button" mat-icon-button (click)="deleteEmailSubscriptionUser($event,esUser)">\n <mat-icon>delete</mat-icon>\n </button>\n <button type="button" mat-icon-button (click)="editEmailSubscriptionUser($event,esUser)">\n <mat-icon>edit</mat-icon>\n </button>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef="displayedColumns;"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n\n </section>\n</div>',styles:[".scroll-container{max-height:800px;overflow-y:auto}"]}]}],t.ɵbf.ctorParameters=function(){return[{type:n.MatDialog},{type:vt},{type:y.Router}]},t.ɵbf.propDecorators={sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}]},t.ɵbf=B([r.UntilDestroy()],t.ɵbf);var fe={title:"Email Subscription Users",permissions:{only:["app_admin"],redirectTo:"/"}},he=[{path:"",component:t.ɵbf,canActivate:[Rt],data:fe}],ge=function(){};ge.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(he)],exports:[y.RouterModule]}]}];var ye=function(){};ye.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}],t.ɵbh=function(){function t(t){this.fb=t,this.valueChange=new e.EventEmitter,this.createForm()}return t.prototype.createForm=function(){this.esUserFilterForm=this.fb.group({user_id:[""],email_type_id:[""]})},t.prototype.ngOnInit=function(){var t=this;this.esUserFilterForm.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){t.valueChange.emit(e)}))},t.prototype.resetFieldValue=function(t){this.esUserFilterForm.get(t).setValue("")},t.prototype.getFieldValue=function(t){return this.esUserFilterForm.get(t).value},t.prototype.ngOnDestroy=function(){},t}(),t.ɵbh.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-user-list-filter",template:'<form [formGroup]="esUserFilterForm" fxLayout="row wrap" fxLayoutGap="1rem" fxLayoutAlign="start center">\n <mat-form-field class="ml-3">\n <mat-label>User</mat-label>\n <app-searchable-selector formControlName="user_id" apiUrl="api/users" titleField="name">\n </app-searchable-selector>\n <button mat-button *ngIf="getFieldValue(\'user_id\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'user_id\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field class="ml-3">\n <mat-label>Email Type</mat-label>\n <app-searchable-selector formControlName="email_type_id" apiUrl="api/email-subscription-types">\n </app-searchable-selector>\n <button mat-button *ngIf="getFieldValue(\'user_id\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'user_id\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n</form>',styles:[""]}]}],t.ɵbh.ctorParameters=function(){return[{type:l.FormBuilder}]},t.ɵbh.propDecorators={valueChange:[{type:e.Output}]},t.ɵbh=B([r.UntilDestroy()],t.ɵbh);var ve=function(){};ve.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbh],imports:[a.CommonModule,Bt,L.FlexLayoutModule,l.ReactiveFormsModule,ee,ye],exports:[t.ɵbh]}]}];var be=function(){};be.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbf],imports:[a.CommonModule,k.InfiniteScrollModule,Bt,L.FlexLayoutModule,l.ReactiveFormsModule,ge,pe,ve],exports:[t.ɵbf]}]}];var Ce=function(){};Ce.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var xe=function(){};xe.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,Ce]}]}];var Fe=function(){};Fe.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var Ie={title:{required:"Title is required"},code:{required:"Code is required"},frequency_id:{required:"Frequency is required"}};t.ɵbi=function(){function t(t,e,n,o,i,r){this.fb=t,this.formValidatorService=e,this.alertService=n,this.dialogRef=o,this.data=i,this.http=r,this.createForm()}return t.prototype.createForm=function(){this.emailSubscriptionTypeFormGroup=this.fb.group({id:[""],title:["",l.Validators.compose([l.Validators.required])],code:["",l.Validators.compose([l.Validators.required])],frequency_id:["",l.Validators.required],description:[""]})},t.prototype.ngOnInit=function(){var t,e,n;(null===(t=this.data.emailSubscriptionType)||void 0===t?void 0:t.id)&&(this.isLoading=!0,this.emailSubscriptionType=null===(e=this.data)||void 0===e?void 0:e.emailSubscriptionType,this.updateMode=!0,this.selectedFrequency=(null===(n=this.emailSubscriptionType)||void 0===n?void 0:n.frequency)||{},this.emailSubscriptionTypeFormGroup.patchValue(this.emailSubscriptionType))},t.prototype.submit=function(){var t=this;if(this.emailSubscriptionTypeFormGroup.markAllAsTouched(),this.emailSubscriptionTypeFormFirstAttempt=!0,this.emailSubscriptionTypeFormGroup.valid){this.isSubmitLoading=!0;var e=this.emailSubscriptionTypeFormGroup.value;(this.updateMode?this.http.put("api/email-subscription-types/"+(null==e?void 0:e.id),e):this.http.post("api/email-subscription-types",e)).pipe(u.finalize((function(){return t.isSubmitLoading=!1})),r.untilDestroyed(this)).subscribe((function(e){t.alertService.addAlert("Email Type saved successfully","success"),t.dialogRef.close(e)}))}},t.prototype.cancel=function(){this.dialogRef.close()},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.emailSubscriptionTypeFormGroup,this.emailSubscriptionTypeFormFirstAttempt)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.emailSubscriptionTypeFormGroup,Ie)},t.prototype.ngOnDestroy=function(){},t}(),t.ɵbi.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-type-form",template:'<form [formGroup]="emailSubscriptionTypeFormGroup" (ngSubmit)="submit()" class="mat-typography">\n <div fxLayout="column">\n <div mat-dialog-title class="text-center">\n <div>Email Subscription Type</div>\n </div>\n\n <div mat-dialog-content fxLayout="column">\n <div fxLayout="row wrap" fxLayoutAlign="space-between center">\n\n <mat-form-field fxFlex="100%" class="mt-1">\n <input matInput formControlName="title" placeholder="Title" autocomplete="off" required />\n <mat-error *ngIf="isFieldValid(\'title\')">{{getErrorMessage(\'title\')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%" class="mt-1">\n <input matInput formControlName="code" placeholder="Code" autocomplete="off" required />\n <mat-hint align="end">Unique Value</mat-hint>\n <mat-error *ngIf="isFieldValid(\'code\')">{{getErrorMessage(\'code\')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%" class="mt-1">\n <mat-label>Frequency</mat-label>\n <app-searchable-selector formControlName="frequency_id" apiUrl="api/email-subscription-frequencies"\n [(selectedValue)]="selectedFrequency" [enableSearch]="false" required>\n </app-searchable-selector>\n <mat-error *ngIf="isFieldValid(\'frequency_id\')">{{getErrorMessage(\'frequency_id\')}}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%" class="mt-1">\n <textarea matInput formControlName="description" placeholder="Description"\n autocomplete="off"></textarea>\n </mat-form-field>\n\n <div class="my-2" fxLayout="row" fxLayoutGap="30px" fxLayoutAlign="end" fxFlex="100%">\n <button mat-raised-button type="button" (click)="cancel()">Cancel</button>\n <button mat-raised-button type="submit" color="primary" [disabled]="isSubmitLoading">\n <app-loader class="inline-loader" [isLoading]="isSubmitLoading"></app-loader>\n Save\n </button>\n </div>\n </div>\n </div>\n\n\n </div>\n</form>',styles:[""]}]}],t.ɵbi.ctorParameters=function(){return[{type:l.FormBuilder},{type:Ct},{type:at},{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:vt}]},t.ɵbi=B([r.UntilDestroy()],t.ɵbi);var we=function(){};we.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbi],imports:[a.CommonModule,Bt,L.FlexLayoutModule,l.ReactiveFormsModule,ee,Fe,re],exports:[t.ɵbi],entryComponents:[t.ɵbi]}]}],t.ɵbj=function(){function e(t,e){this.dialog=t,this.http=e,this.emailSubscriptionTypeList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc",isLoadRelations:!0,relations:["frequency"]},this.search=new l.FormControl(""),this.displayColumns=new l.FormControl(["index","title","frequency.title","description","actions"]),this.displayedColumns=[],this.availableDisplayColumns=[{order:1,value:"index",name:"Index"},{order:2,value:"title",name:"Title"},{order:3,value:"code",name:"Code"},{order:4,value:"frequency.title",name:"Frequency"},{order:5,value:"description",name:"Description"},{order:6,value:"actions",name:"Actions"}]}return e.prototype.ngOnInit=function(){var t=this;this.displayedColumns=this.displayColumns.value,this.initializeData(),this.search.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){t.filters.search=e,t.reload()})),this.sort&&this.sort.sortChange.pipe(r.untilDestroyed(this)).subscribe((function(e){t.changeSort(e)}))},Object.defineProperty(e.prototype,"selectedColumns",{get:function(){var t=this;return this.availableDisplayColumns.filter((function(e){return t.displayColumns.value.some((function(t){return t===e.value}))})).sort((function(t,e){return t.order>e.order?1:e.order>t.order?-1:0})).map((function(t){return t.value}))},enumerable:!1,configurable:!0}),e.prototype.columnsChange=function(){this.displayedColumns=this.selectedColumns},e.prototype.initializeData=function(){var t=this;this.http.get("api/email-subscription-types",{params:Object.assign(Object.assign({},this.filters),this.pageEvent)}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.emailSubscriptionTypeList=t.emailSubscriptionTypeList.concat(e.data),t.pageEvent.page=e.current_page,t.pageEvent.lastPage=e.last_page}))},e.prototype.addEmailSubscriptionType=function(){var e=this;this.dialog.open(t.ɵbi,{width:"400px",autoFocus:!1,data:{}}).afterClosed().subscribe((function(t){t&&e.reload()}))},e.prototype.editEmailSubscriptionType=function(e,n){var o=this;e.stopPropagation(),this.dialog.open(t.ɵbi,{width:"400px",autoFocus:!1,data:{emailSubscriptionType:n}}).afterClosed().subscribe((function(t){t&&o.reload()}))},e.prototype.deleteEmailSubscriptionType=function(t,e){var n=this;t.stopPropagation(),this.dialog.open(H,{width:"400px",data:{title:"Delete Email Type",message:"Are you sure to proceed delete the Email Type "+e.title+"?"},autoFocus:!1}).afterClosed().subscribe((function(t){t&&n.http.delete("api/email-subscription-types/"+(null==e?void 0:e.id)).pipe(r.untilDestroyed(n)).subscribe((function(t){n.emailSubscriptionTypeList=n.emailSubscriptionTypeList.filter((function(t){return t.id!==e.id}))}))}))},e.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.initializeData())},e.prototype.changeSort=function(t){t.direction&&(this.filters.sort_by=t.active+"|"+t.direction,this.reload())},e.prototype.reload=function(){this.emailSubscriptionTypeList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.initializeData()},e.prototype.ngOnDestroy=function(){},e}(),t.ɵbj.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-type-list",template:'<div class="mat-typography m-4">\n <div fxLayout="row wrap" fxLayoutAlign="start center">\n <mat-form-field>\n <input matInput [formControl]="search" placeholder="Email Type" autocomplete="off" />\n <button mat-button matSuffix mat-icon-button>\n <mat-icon>search</mat-icon>\n </button>\n <button mat-button *ngIf="search.value" matSuffix mat-icon-button (click)="search.setValue(\'\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <div class="ml-2">\n <button mat-raised-button color="primary" type="button" (click)="addEmailSubscriptionType()">+ Email\n Type</button>\n </div>\n <span fxFlex></span>\n <mat-form-field appearance="outline" class="no-padding">\n <mat-label>Columns</mat-label>\n <mat-select [formControl]="displayColumns" multiple (selectionChange)="columnsChange()">\n <mat-option *ngFor="let column of availableDisplayColumns" [value]="column.value">{{column.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n <section>\n <div class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="emailSubscriptionTypeList" matSort class="w-100 mt-1" multiTemplateDataRows\n id="email-subscription-type-table">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let emailSubscriptionType; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n <ng-container matColumnDef="title">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Title </th>\n <td mat-cell *matCellDef="let emailSubscriptionType;"> {{ emailSubscriptionType?.title }} </td>\n </ng-container>\n <ng-container matColumnDef="code">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Code </th>\n <td mat-cell *matCellDef="let emailSubscriptionType;"> {{ emailSubscriptionType?.code }}\n </td>\n </ng-container>\n <ng-container matColumnDef="frequency.title">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Code </th>\n <td mat-cell *matCellDef="let emailSubscriptionType;"> {{ emailSubscriptionType?.frequency?.title }}\n </td>\n </ng-container>\n <ng-container matColumnDef="description">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef="let emailSubscriptionType;"> {{ emailSubscriptionType?.description }}\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let emailSubscriptionType">\n <button type="button" mat-icon-button\n (click)="deleteEmailSubscriptionType($event,emailSubscriptionType)">\n <mat-icon>delete</mat-icon>\n </button>\n <button type="button" mat-icon-button\n (click)="editEmailSubscriptionType($event,emailSubscriptionType)">\n <mat-icon>edit</mat-icon>\n </button>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n </section>\n</div>',styles:[".scroll-container{max-height:800px;overflow-y:auto}"]}]}],t.ɵbj.ctorParameters=function(){return[{type:n.MatDialog},{type:vt}]},t.ɵbj.propDecorators={sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}]},t.ɵbj=B([r.UntilDestroy()],t.ɵbj);var De={title:"Email Subscription Type",permissions:{only:["client_admin"],redirectTo:"/"}},Se=[{path:"",component:t.ɵbj,canActivate:[Rt],data:De}],Me=function(){};Me.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Se)],exports:[y.RouterModule]}]}];var Te=function(){};Te.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbj],imports:[a.CommonModule,Bt,L.FlexLayoutModule,l.ReactiveFormsModule,k.InfiniteScrollModule,we,Me],exports:[t.ɵbj]}]}],t.ɵbk=function(){function t(t){this.http=t,this.subscriptions=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc",isLoadRelations:!0,relations:"frequency,currentUserSubscription"}}return t.prototype.ngOnInit=function(){this.fetchSubscriptions()},t.prototype.fetchSubscriptions=function(){var t=this;this.http.get("api/email-subscription-types",{params:Object.assign(Object.assign({},this.filters),this.pageEvent)}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.subscriptions=t.subscriptions.concat(e.data),t.pageEvent.page=e.current_page,t.pageEvent.lastPage=e.last_page}))},t.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.fetchSubscriptions())},t.prototype.subscribe=function(t){this.http.post("api/email-subscription-for-user",{email_type_id:null==t?void 0:t.id}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.current_user_subscription=null==e?void 0:e.item}))},t.prototype.unsubscribe=function(t){var e;this.http.delete("api/email-subscription-users/"+(null===(e=null==t?void 0:t.current_user_subscription)||void 0===e?void 0:e.id)).pipe(r.untilDestroyed(this)).subscribe((function(e){t.current_user_subscription=null}))},t.prototype.reload=function(){this.subscriptions=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.fetchSubscriptions()},t.prototype.ngOnDestroy=function(){},t}(),t.ɵbk.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-for-user",template:'<div fxLayout="column" class="container my-4">\n\n <div class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <mat-list>\n <div mat-subheader>Available Subscriptions</div>\n <mat-list-item *ngFor="let sub of subscriptions">\n <mat-icon mat-list-icon>email</mat-icon>\n <div mat-line>{{sub?.title}} </div>\n <div mat-line class="text-secondary">{{sub?.frequency?.title}}</div>\n <div mat-line> {{sub?.description}} </div>\n <div fxLayout fxLayoutAlign="end">\n <button type="button" *ngIf="!sub?.current_user_subscription" mat-raised-button color="primary"\n (click)="subscribe(sub)">Subscribe</button>\n <button type="button" *ngIf="sub?.current_user_subscription" mat-stroked-button color="primary"\n (click)="unsubscribe(sub)">Unsubscribe</button>\n </div>\n <mat-divider></mat-divider>\n </mat-list-item>\n </mat-list>\n </div>\n\n</div>',styles:[".scroll-container{max-height:800px;overflow-y:auto}"]}]}],t.ɵbk.ctorParameters=function(){return[{type:vt}]},t.ɵbk=B([r.UntilDestroy()],t.ɵbk);var _e={permissions:{only:["client_admin"]}},Le=[{path:"",component:t.ɵbk,canActivate:[Rt],data:_e}],ke=function(){};ke.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Le)],exports:[y.RouterModule]}]}];var Ae=function(){};Ae.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbk],imports:[a.CommonModule,k.InfiniteScrollModule,Bt,L.FlexLayoutModule,ke],exports:[t.ɵbk]}]}];var Ee=function(){function t(t){this.http=t}return t.prototype.getTechlifyUpdates=function(t){return this.http.get("api/techlify-updates",{params:t}).toPromise()},t.prototype.createTechlifyUpdate=function(t){return this.http.post("api/techlify-updates",t).toPromise()},t.prototype.updateTechlifyUpdate=function(t){return this.http.put("api/techlify-updates/"+t.id,t).toPromise()},t.prototype.deleteTechlifyUpdate=function(t){return this.http.delete("api/techlify-updates/"+t).toPromise()},t.prototype.getTechlifyUpdate=function(t){return this.http.get("api/techlify-updates/"+t).toPromise()},t.prototype.getNewUpdateForCurrentUser=function(){return this.http.get("api/current-user-techlify-updates").toPromise()},t.prototype.createUpdateViewRecord=function(t){return this.http.post("api/techlify-update-views",t).toPromise()},t.prototype.updateCurrentUserUpdates=function(){return this.http.get("api/techlify-updates/update-view").toPromise()},t}();Ee.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ee(e.ɵɵinject(vt))},token:Ee,providedIn:"root"}),Ee.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ee.ctorParameters=function(){return[{type:vt}]};var Ue={title:{required:"Title is required"},released_on:{required:"Released On is required"},version:{required:"Version is required"},description:{required:"Description is required"},learn_more_link:{pattern:"Please enter valid link"}},Ve=function(){function t(t,n,o,i,r,a){this.dialogRef=t,this.data=n,this.fb=o,this.formValidatorService=i,this.alertService=r,this.techlifyUpdateService=a,this.onSave=new e.EventEmitter,this.isUpdateMode=!1,this.toolbar=[["bold","italic"],["bullet_list"]],this.createForm()}return t.prototype.createForm=function(){this.techlifyUpdateForm=this.fb.group({id:new l.FormControl(""),title:new l.FormControl("",l.Validators.required),description:new l.FormControl("",l.Validators.required),version:new l.FormControl("",l.Validators.required),released_on:new l.FormControl("",l.Validators.required),learn_more_link:new l.FormControl("",l.Validators.compose([l.Validators.pattern("(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?")]))}),this.data.techlifyUpdateDetails&&(this.isUpdateMode=!0,this.techlifyUpdateForm.patchValue(this.data.techlifyUpdateDetails))},t.prototype.ngOnInit=function(){this.editor=new E.Editor},t.prototype.submit=function(){return z(this,void 0,void 0,(function(){var t,e,n;return $(this,(function(o){switch(o.label){case 0:if(!this.techlifyUpdateForm.valid)return[3,8];t=void 0,e=this.techlifyUpdateForm.value,o.label=1;case 1:return o.trys.push([1,6,7,8]),this.isUpdateMode?[4,this.techlifyUpdateService.updateTechlifyUpdate(e)]:[3,3];case 2:return n=o.sent(),[3,5];case 3:return[4,this.techlifyUpdateService.createTechlifyUpdate(e)];case 4:n=o.sent(),o.label=5;case 5:return t=n,this.alertService.addAlert("Techlify app update saved successfully","success"),[3,8];case 6:return o.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,8];case 7:return t&&this.dialogRef.close(t),[7];case 8:return[2]}}))}))},t.prototype.resetFieldValue=function(t){this.techlifyUpdateForm.get(t).setValue("")},t.prototype.getFieldValue=function(t){return this.techlifyUpdateForm.get(t).value},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.techlifyUpdateForm,!0)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.techlifyUpdateForm,Ue)},t}();Ve.decorators=[{type:e.Component,args:[{selector:"app-techlify-update-form",template:'<form [formGroup]="techlifyUpdateForm" (ngSubmit)="submit()">\n <div fxLayout="column" class="mat-typography">\n <div mat-dialog-title class="text-center">\n <h2>\n App Update Form\n </h2>\n </div>\n <div mat-dialog-content fxLayout="column" fxLayoutGap="1rem">\n <mat-form-field fxFlex="100%">\n <mat-label>Title</mat-label>\n <input matInput formControlName="title" placeholder="Title" autocomplete="off" required />\n <button mat-button *ngIf="getFieldValue(\'title\')" matSuffix mat-icon-button (click)="resetFieldValue(\'title\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'title\')">\n {{getErrorMessage(\'title\')}}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%">\n <input matInput [matDatepicker]="released_on" formControlName="released_on" placeholder="Released on" readonly\n (click)="released_on.open()" required />\n <mat-datepicker-toggle matSuffix [for]="released_on"></mat-datepicker-toggle>\n <mat-datepicker #released_on></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(\'released_on\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'released_on\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'released_on\')">\n {{getErrorMessage(\'released_on\')}}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%">\n <mat-label>Version</mat-label>\n <input matInput formControlName="version" placeholder="Version" autocomplete="off" required />\n <button mat-button *ngIf="getFieldValue(\'version\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'version\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'version\')">\n {{getErrorMessage(\'version\')}}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%">\n <mat-label>Learn more link</mat-label>\n <input matInput formControlName="learn_more_link" placeholder="Learn More Link" autocomplete="off" />\n <button mat-button *ngIf="getFieldValue(\'learn_more_link\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'learn_more_link\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'learn_more_link\')">\n {{getErrorMessage(\'learn_more_link\')}}\n </mat-error>\n </mat-form-field>\n\n <div fxFlex="100%">\n <div class="NgxEditor__Wrapper">\n <ngx-editor-menu [toolbar]="toolbar" [editor]="editor"> </ngx-editor-menu>\n <ngx-editor formControlName="description" [editor]="editor" placeholder="Description">\n </ngx-editor>\n </div>\n <mat-error *ngIf="isFieldValid(\'description\')">\n {{getErrorMessage(\'description\')}}\n </mat-error>\n </div>\n </div>\n <div mat-dialog-actions fxFlex="100%" fxLayout fxLayoutAlign="end" fxLayoutGap="1rem">\n <button mat-button class="mt-2" type="button" (click)="dialogRef.close()">\n Cancel\n </button>\n <button mat-raised-button type="submit" class="btn-primary mt-2">\n Save\n </button>\n </div>\n </div>\n</form>',styles:[""]}]}],Ve.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:l.FormBuilder},{type:Ct},{type:at},{type:Ee}]},Ve.propDecorators={onSave:[{type:e.Output}]};var Pe=function(){};Pe.decorators=[{type:e.NgModule,args:[{declarations:[Ve],imports:[a.CommonModule,l.ReactiveFormsModule,Bt,L.FlexLayoutModule,E.NgxEditorModule],exports:[Ve],entryComponents:[Ve]}]}],t.ɵbl=function(){function t(t,e,n,o){this.dialog=t,this.alertService=e,this.techlifyUpdateService=n,this.fb=o,this.techlifyUpdates=[],this.displayedColumns=["index","title","version","released_on","learn_more_link","description","creator","actions"],this.page=1,this.perPage=25,this.isWorking=!1,this.filterFormGroup=this.fb.group({search:new l.FormControl(""),version:new l.FormControl(""),sort_by:new l.FormControl("released_on|DESC")})}return t.prototype.ngOnInit=function(){this.loadData(),this.listenChanges()},t.prototype.listenChanges=function(){var t=this;this.filterFormGroup.valueChanges.pipe(u.debounceTime(500),r.untilDestroyed(this)).subscribe((function(e){t.reload()}))},t.prototype.ngOnDestroy=function(){},t.prototype.loadData=function(){return z(this,void 0,void 0,(function(){var t,e;return $(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),this.isWorking=!0,(t=this.filterFormGroup.value).perPage=this.perPage,t.page=this.page,[4,this.techlifyUpdateService.getTechlifyUpdates(t)];case 1:return e=n.sent(),this.lastPage=e.last_page||this.page,this.techlifyUpdates=this.techlifyUpdates.concat(e.data),[3,4];case 2:return n.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,4];case 3:return this.isWorking=!1,[7];case 4:return[2]}}))}))},t.prototype.reload=function(){this.techlifyUpdates=[],this.page=1,this.isWorking||this.loadData()},t.prototype.onScroll=function(){!this.isWorking&&this.page<this.lastPage&&(this.page+=1,this.loadData())},t.prototype.modifyTechlifyUpdate=function(t){var e=this;this.dialog.open(Ve,{width:"600px",data:{techlifyUpdateDetails:t}}).afterClosed().subscribe((function(t){t&&e.reload()}))},t.prototype.deleteTechlifyUpdate=function(t){return z(this,void 0,void 0,(function(){var e=this;return $(this,(function(n){return this.dialog.open(H,{width:"400px",data:{title:"Delete Update",message:"Are you sure to delete this update?"},autoFocus:!1}).afterClosed().subscribe((function(n){return z(e,void 0,void 0,(function(){return $(this,(function(e){switch(e.label){case 0:if(!n)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.techlifyUpdateService.deleteTechlifyUpdate(t.id)];case 2:return e.sent(),this.alertService.addAlert("Successfully deleted the update","success"),this.reload(),[3,4];case 3:return e.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,4];case 4:return[2]}}))}))})),[2]}))}))},t.prototype.resetFieldValue=function(t){this.filterFormGroup.get(t).setValue("")},t.prototype.sortColumn=function(t){var e=t.direction.toString().toUpperCase();this.assignFilter(t.active,e)},t.prototype.assignFilter=function(t,e){switch(t){case"title":return this.filterFormGroup.get("sort_by").setValue("title|"+e);case"released_on":return this.filterFormGroup.get("sort_by").setValue("released_on|"+e);case"version":return this.filterFormGroup.get("sort_by").setValue("version|"+e);default:return this.filterFormGroup.get("sort_by").setValue("created_at|DESC")}},t}(),t.ɵbl.decorators=[{type:e.Component,args:[{selector:"app-techlify-updates-list",template:'<section class="p-4" fxLayout="column">\n <h3 class="primary-color text-center">\n App Updates\n <button mat-raised-button (click)="modifyTechlifyUpdate()" class="primary-bg text-white">\n <mat-icon>\n add\n </mat-icon>\n Create\n </button>\n </h3>\n <form [formGroup]="filterFormGroup" fxLayout="row wrap" fxLayoutGap="0.5rem" fxFlex="100%" style="font-size: 12px;">\n <mat-form-field fxFlex="0 1 calc(100% - 0.5rem)" fxFlex.gt-md="0 1 calc(15% - 0.5rem)" appearance="outline"\n fxFlex.gt-sm="0 1 calc(20% - 0.5rem)">\n <input type="text" matInput formControlName="search" placeholder="Title" autocomplete="off" />\n <button mat-button *ngIf="filterFormGroup.get(\'search\').value" matSuffix mat-icon-button\n (click)="resetFieldValue(\'search\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field fxFlex="0 1 calc(100% - 0.5rem)" fxFlex.gt-md="0 1 calc(15% - 0.5rem)" appearance="outline"\n fxFlex.gt-sm="0 1 calc(20% - 0.5rem)">\n <input type="text" matInput formControlName="version" placeholder="Version" autocomplete="off" />\n <button mat-button *ngIf="filterFormGroup.get(\'version\').value" matSuffix mat-icon-button\n (click)="resetFieldValue(\'version\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </form>\n\n <table mat-table [dataSource]="techlifyUpdates" class="mat-elevation-z8 w-100" matSort multiTemplateDataRows\n (matSortChange)="sortColumn($event)" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let element;let i=dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n \x3c!-- Course Column --\x3e\n <ng-container matColumnDef="title">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Title </th>\n <td mat-cell *matCellDef="let element"> {{element?.title}} </td>\n </ng-container>\n\n \x3c!-- Version Column --\x3e\n <ng-container matColumnDef="version">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Version </th>\n <td mat-cell *matCellDef="let element"> {{element?.version}} </td>\n </ng-container>\n\n \x3c!-- Released On Column --\x3e\n <ng-container matColumnDef="released_on">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Released On </th>\n <td mat-cell *matCellDef="let element"> {{element?.released_on | date:\'mediumDate\'}} </td>\n </ng-container>\n\n \x3c!-- Learn More Link Column --\x3e\n <ng-container matColumnDef="learn_more_link">\n <th mat-header-cell *matHeaderCellDef> Learn more link </th>\n <td mat-cell *matCellDef="let element">\n <a [href]="element?.learn_more_link" target="_blank">\n {{element?.learn_more_link}}\n </a>\n </td>\n </ng-container>\n\n \x3c!-- Description Column --\x3e\n <ng-container matColumnDef="description">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef="let element">\n <app-read-more [text]="element?.description" [maxLength]="50"></app-read-more>\n </td>\n </ng-container>\n\n \x3c!-- Creator Column --\x3e\n <ng-container matColumnDef="creator">\n <th mat-header-cell *matHeaderCellDef> Creator </th>\n <td mat-cell *matCellDef="let element">\n {{element?.creator?.name}}\n <div fxLayout class="small">\n {{element?.created_at | date : \'mediumDate\'}}\n </div>\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let element" class="secondary-color">\n <button type="button" class="secondary-color" mat-icon-button (click)="modifyTechlifyUpdate(element)">\n <mat-icon>edit</mat-icon>\n </button>\n\n <button type="button" class="secondary-color" mat-icon-button (click)="deleteTechlifyUpdate(element)">\n <mat-icon>delete</mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n</section>\n',styles:[""]}]}],t.ɵbl.ctorParameters=function(){return[{type:n.MatDialog},{type:at},{type:Ee},{type:l.FormBuilder}]},t.ɵbl=B([r.UntilDestroy()],t.ɵbl);var je=[{path:"",redirectTo:"all",pathMatch:"full"},{path:"all",component:t.ɵbl},{path:"**",redirectTo:"all",pathMatch:"full"}],Oe=function(){};Oe.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(je)],exports:[y.RouterModule]}]}];var Re=function(){};Re.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbl],imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,L.FlexLayoutModule,Bt,$t,Oe,Pe,Xt]}]}];var Ne=function(){function t(t,e,n){this.dialogRef=t,this.data=e,this.router=n}return t.prototype.ngOnInit=function(){this.techlifyUpdate=this.data.techlifyUpdate,this.rootNavUrl=this.data.rootNavUrl},t.prototype.close=function(){this.dialogRef.close()},t.prototype.openUpdateHistory=function(){this.close(),this.router.navigate([this.rootNavUrl+"/update-history"])},t}();Ne.decorators=[{type:e.Component,args:[{selector:"app-update-view",template:'<div fxLayout="column">\n <div mat-dialog-title class="text-center">\n <div fxLayout="row wrap" fxLayoutAlign="space-between">\n <div fxFlex="80%">\n <div fxLayout="row wrap" fxLayoutGap="1rem">\n <span fxFlex="calc(10%-1rem)" fxLayoutAlign="start center">\n <mat-icon class="large-icon primary-color">\n <span class="material-icons-outlined">\n grading\n </span>\n </mat-icon>\n </span>\n <div fxFlex="calc(90%-1rem)">\n <div fxLayout="column" fxLayoutAlign="start">\n <div fxLayout>\n <h5 class="primary-color" style="margin-bottom:0;text-align: left;">\n App Update: {{techlifyUpdate?.title}}\n </h5>\n </div>\n <div fxLayout="row" fxLayoutGap="1rem">\n <small class="text-muted">\n <b>Release On</b> : {{techlifyUpdate?.released_on | date: \'mediumDate\'}}\n </small>\n <small class="text-muted">\n <b>Version</b> : {{techlifyUpdate?.version}}\n </small>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div fxLayoutAlign="end center" class="text-muted">\n <button mat-icon-button type="button" (click)="close()">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n </div>\n </div>\n\n <div mat-dialog-content style="height: 500px;overflow: auto;">\n <div fxLayout="column" class="text-muted" style="margin-top: 1rem;" [innerHtml]="techlifyUpdate?.description">\n </div>\n </div>\n\n <div mat-dialog-actions fxLayout="row" [fxLayoutAlign]="!this.data?.isFromHistory ? \'space-between\' : \'end\'">\n <button type="button" mat-button class="primary-color" (click)="openUpdateHistory()"\n *ngIf="!this.data?.isFromHistory">\n <mat-icon>\n history\n </mat-icon>\n Update History\n </button>\n <a *ngIf="techlifyUpdate?.learn_more_link" [href]="techlifyUpdate?.learn_more_link" target="_blank"\n style="text-decoration: none;">\n <button type="button" mat-button class="text-muted">\n Learn More\n </button>\n </a>\n <button type="button" mat-stroked-button class="primary-color" (click)="close()">\n OK\n </button>\n </div>\n</div>\n',styles:[".large-icon{transform:scale(2.3)}.primary-color{color:#009fdd!important}.primary-bg{background-color:#009fdd!important}.text-muted,.text-white{color:#d3d3d3}"]}]}],Ne.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:y.Router}]},t.ɵbr=function(){function t(t,e,n,o){this.dialog=t,this.techlifyUpdateService=e,this.fb=n,this.alertService=o,this.techlifyUpdates=[],this.displayedColumns=["index","title","version","released_on","learn_more_link","description","creator","actions"],this.page=1,this.perPage=25,this.isWorking=!1,this.filterFormGroup=this.fb.group({search:new l.FormControl(""),version:new l.FormControl(""),sort_by:new l.FormControl("released_on|DESC")})}return t.prototype.ngOnInit=function(){this.loadData(),this.listenChanges(),this.updateCurrentUserUpdates()},t.prototype.listenChanges=function(){var t=this;this.filterFormGroup.valueChanges.pipe(u.debounceTime(500),r.untilDestroyed(this)).subscribe((function(e){t.reload()}))},t.prototype.ngOnDestroy=function(){},t.prototype.loadData=function(){return z(this,void 0,void 0,(function(){var t,e;return $(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),this.isWorking=!0,(t=this.filterFormGroup.value).perPage=this.perPage,t.page=this.page,[4,this.techlifyUpdateService.getTechlifyUpdates(t)];case 1:return e=n.sent(),this.lastPage=e.last_page||this.page,this.techlifyUpdates=this.techlifyUpdates.concat(e.data),[3,4];case 2:return n.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,4];case 3:return this.isWorking=!1,[7];case 4:return[2]}}))}))},t.prototype.reload=function(){this.techlifyUpdates=[],this.page=1,this.isWorking||this.loadData()},t.prototype.onScroll=function(){!this.isWorking&&this.page<this.lastPage&&(this.page+=1,this.loadData())},t.prototype.resetFieldValue=function(t){this.filterFormGroup.get(t).setValue("")},t.prototype.sortColumn=function(t){var e=t.direction.toString().toUpperCase();this.assignFilter(t.active,e)},t.prototype.assignFilter=function(t,e){switch(t){case"title":return this.filterFormGroup.get("sort_by").setValue("title|"+e);case"released_on":return this.filterFormGroup.get("sort_by").setValue("released_on|"+e);case"version":return this.filterFormGroup.get("sort_by").setValue("version|"+e);default:return this.filterFormGroup.get("sort_by").setValue("created_at|DESC")}},t.prototype.openUpdateView=function(t){this.dialog.open(Ne,{width:"800px",autoFocus:!1,data:{techlifyUpdate:t,isFromHistory:!0}})},t.prototype.updateCurrentUserUpdates=function(){return z(this,void 0,void 0,(function(){return $(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.techlifyUpdateService.updateCurrentUserUpdates()];case 1:return t.sent(),[3,3];case 2:return t.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,3];case 3:return[2]}}))}))},t}(),t.ɵbr.decorators=[{type:e.Component,args:[{selector:"app-techlify-update-history",template:'<section class="p-4" fxLayout="column">\n <h3 class="primary-color text-center">\n App Updates\n </h3>\n <form [formGroup]="filterFormGroup" fxLayout="row wrap" fxLayoutGap="0.5rem" fxFlex="100%" style="font-size: 12px;">\n <mat-form-field fxFlex="0 1 calc(100% - 0.5rem)" fxFlex.gt-md="0 1 calc(15% - 0.5rem)" appearance="outline"\n fxFlex.gt-sm="0 1 calc(20% - 0.5rem)">\n <input type="text" matInput formControlName="search" placeholder="Title" autocomplete="off" />\n <button mat-button *ngIf="filterFormGroup.get(\'search\').value" matSuffix mat-icon-button\n (click)="resetFieldValue(\'search\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field fxFlex="0 1 calc(100% - 0.5rem)" fxFlex.gt-md="0 1 calc(15% - 0.5rem)" appearance="outline"\n fxFlex.gt-sm="0 1 calc(20% - 0.5rem)">\n <input type="text" matInput formControlName="version" placeholder="Version" autocomplete="off" />\n <button mat-button *ngIf="filterFormGroup.get(\'version\').value" matSuffix mat-icon-button\n (click)="resetFieldValue(\'version\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </form>\n\n <table mat-table [dataSource]="techlifyUpdates" class="mat-elevation-z8 w-100" matSort multiTemplateDataRows\n (matSortChange)="sortColumn($event)" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let element;let i=dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n \x3c!-- Course Column --\x3e\n <ng-container matColumnDef="title">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Title </th>\n <td mat-cell *matCellDef="let element"> {{element?.title}} </td>\n </ng-container>\n\n \x3c!-- Version Column --\x3e\n <ng-container matColumnDef="version">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Version </th>\n <td mat-cell *matCellDef="let element"> {{element?.version}} </td>\n </ng-container>\n\n \x3c!-- Released On Column --\x3e\n <ng-container matColumnDef="released_on">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Released On </th>\n <td mat-cell *matCellDef="let element"> {{element?.released_on | date:\'mediumDate\'}} </td>\n </ng-container>\n\n \x3c!-- Learn More Link Column --\x3e\n <ng-container matColumnDef="learn_more_link">\n <th mat-header-cell *matHeaderCellDef> Learn more link </th>\n <td mat-cell *matCellDef="let element">\n <a [href]="element?.learn_more_link" target="_blank">\n {{element?.learn_more_link}}\n </a>\n </td>\n </ng-container>\n\n \x3c!-- Description Column --\x3e\n <ng-container matColumnDef="description">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef="let element">\n <app-read-more [text]="element?.description" [maxLength]="50"></app-read-more>\n </td>\n </ng-container>\n\n \x3c!-- Creator Column --\x3e\n <ng-container matColumnDef="creator">\n <th mat-header-cell *matHeaderCellDef> Creator </th>\n <td mat-cell *matCellDef="let element">\n {{element?.creator?.name}}\n <div fxLayout class="small">\n {{element?.created_at | date : \'mediumDate\'}}\n </div>\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let element" class="secondary-color">\n <button type="button" class="secondary-color" mat-icon-button (click)="openUpdateView(element)">\n <mat-icon>remove_red_eye</mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n</section>\n',styles:[""]}]}],t.ɵbr.ctorParameters=function(){return[{type:n.MatDialog},{type:Ee},{type:l.FormBuilder},{type:at}]},t.ɵbr=B([r.UntilDestroy()],t.ɵbr);var He=[{path:"",redirectTo:"update-history",pathMatch:"full"},{path:"update-history",component:t.ɵbr},{path:"**",redirectTo:"all",pathMatch:"full"}],Ge=function(){};Ge.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(He)],exports:[y.RouterModule]}]}];var qe=function(){};qe.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,L.FlexLayoutModule,Bt,$t,Xt,Ge],declarations:[t.ɵbr]}]}];var Be=function(){};Be.decorators=[{type:e.NgModule,args:[{declarations:[Ne],imports:[a.CommonModule,Bt,L.FlexLayoutModule],exports:[Ne],entryComponents:[Ne]}]}];var ze=function(){function t(t,e,n,o,i,r){this.data=t,this.snackBarRef=e,this.dialog=n,this.router=o,this.techlifyUpdateService=i,this.alertService=r,this.maxDescriptionLength=70,this.descriptionText=""}return t.prototype.ngOnInit=function(){var t;this.techlifyUpdate=this.data.techlifyUpdate,this.rootNavUrl=this.data.rootNavUrl,this.determineDescription(null===(t=this.techlifyUpdate)||void 0===t?void 0:t.description)},t.prototype.close=function(){this.createUpdateViewRecord(),this.snackBarRef.dismiss()},t.prototype.determineDescription=function(t){!t||t.length<=this.maxDescriptionLength?this.descriptionText=t:this.descriptionText=t.substring(0,this.maxDescriptionLength)+"..."},t.prototype.openUpdateView=function(){this.close();this.dialog.open(Ne,{width:"800px",autoFocus:!1,data:{techlifyUpdate:this.techlifyUpdate,rootNavUrl:this.data.rootNavUrl}})},t.prototype.openUpdateHistory=function(){this.close(),this.router.navigate([this.rootNavUrl+"/update-history"])},t.prototype.createUpdateViewRecord=function(){var t;return z(this,void 0,void 0,(function(){var e;return $(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e={update_id:null===(t=this.techlifyUpdate)||void 0===t?void 0:t.id},[4,this.techlifyUpdateService.createUpdateViewRecord(e)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,3];case 3:return[2]}}))}))},t}();ze.decorators=[{type:e.Component,args:[{selector:"app-update-notifier-snack",template:'<div fxLayout="column">\n <div fxLayout="row wrap" fxLayoutAlign="space-between">\n <div fxLayout="row wrap" fxLayoutGap="1rem">\n <span fxLayoutAlign="center center">\n <mat-icon class="large-icon primary-color">\n <span class="material-icons-outlined">\n grading\n </span>\n </mat-icon>\n </span>\n <div fxLayout="column">\n <h5 class="primary-color text-truncate" matTooltip="{{techlifyUpdate?.title}}" matTooltipPosition="below">\n App Update: {{techlifyUpdate?.title}}\n </h5>\n <small class="text-muted">\n Version : {{techlifyUpdate?.version}}\n </small>\n </div>\n </div>\n <div fxLayoutAlign="end center" class="text-muted">\n <button mat-icon-button type="button" (click)="close()">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout="row" class="text-muted" style="margin-top: 1rem;" [innerHtml]="descriptionText">\n </div>\n <div fxLayout="row" fxLayoutAlign="space-between">\n <button type="button" mat-button class="primary-color" (click)="openUpdateHistory()">\n <mat-icon>\n history\n </mat-icon>\n Update History\n </button>\n <button type="button" mat-raised-button class="primary-bg text-white" (click)="openUpdateView()">\n View\n </button>\n </div>\n</div>\n',styles:[".large-icon{transform:scale(1.5)}.primary-color{color:#009fdd!important}.primary-bg{background-color:#009fdd!important}.text-muted,.text-white{color:#d3d3d3}.text-truncate{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:400px}@media screen and (max-width:1440px){.text-truncate{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:350px}}@media screen and (max-width:1024px){.text-truncate{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:220px;width:190px}}"]}]}],ze.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[d.MAT_SNACK_BAR_DATA]}]},{type:d.MatSnackBarRef},{type:n.MatDialog},{type:y.Router},{type:Ee},{type:at}]};var $e=function(){function t(t,e,n){this.snackBar=t,this.techlifyUpdateService=e,this.alertService=n,this.rootNavUrl="/techlify-updates"}return t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(e){t.getNewUpdate()}),5e3)},t.prototype.getNewUpdate=function(){return z(this,void 0,void 0,(function(){var t;return $(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.techlifyUpdateService.getNewUpdateForCurrentUser()];case 1:return t=e.sent(),this.techlifyUpdate=t.item,this.techlifyUpdate&&this.showUpdate(),[3,3];case 2:return e.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,3];case 3:return[2]}}))}))},t.prototype.showUpdate=function(){this.snackBar.openFromComponent(ze,{data:{techlifyUpdate:this.techlifyUpdate,rootNavUrl:this.rootNavUrl},horizontalPosition:"right",verticalPosition:"top",panelClass:["white-bg"]})},t}();$e.decorators=[{type:e.Component,args:[{selector:"app-update-notifier",template:"",styles:["::ng-deep .white-bg{background-color:#fff}"]}]}],$e.ctorParameters=function(){return[{type:d.MatSnackBar},{type:Ee},{type:at}]},$e.propDecorators={rootNavUrl:[{type:e.Input}]};var Ye=function(){};Ye.decorators=[{type:e.NgModule,args:[{declarations:[$e,ze],imports:[a.CommonModule,Bt,Be,L.FlexLayoutModule,$t],exports:[$e],entryComponents:[ze]}]}];var We=function(){function t(){this.name="Export_Data",this.data=[]}return t.prototype.ngOnInit=function(){},t.prototype.exportExcel=function(){var t=this.name+"_"+(new Date).getTime()+".xlsx",e=U.utils.json_to_sheet(this.data),n=U.utils.book_new();U.utils.book_append_sheet(n,e,"Sheet1"),U.writeFile(n,t)},t}();We.decorators=[{type:e.Component,args:[{selector:"app-export-excel-button",template:'<button mat-raised-button color="accent" (click)="exportExcel()">Export Excel</button>',styles:[""]}]}],We.ctorParameters=function(){return[]},We.propDecorators={name:[{type:e.Input}],data:[{type:e.Input}]};var Ke=function(){};Ke.decorators=[{type:e.NgModule,args:[{declarations:[We],imports:[a.CommonModule,Bt],exports:[We]}]}],t.AuditLogViewModelComponent=function(){function t(t,e,n){this.dialogRef=t,this.data=e,this.http=n,this.showDeltaChanges=!1,this.changeList=[]}return t.prototype.ngOnInit=function(){var t,e,n=this;this.data&&this.http.get("api/recent-log-for-model",{params:{model_type:null===(t=this.data)||void 0===t?void 0:t.modelType,model_id:null===(e=this.data)||void 0===e?void 0:e.modelId}}).pipe(r.untilDestroyed(this)).subscribe((function(t){n.logInfo=null==t?void 0:t.item,n.getTransformedChanges()}))},t.prototype.getTransformedChanges=function(){var t,e,n,o,i=this;(null===(e=null===(t=this.logInfo)||void 0===t?void 0:t.data)||void 0===e?void 0:e.changes)&&(Object.keys(null===(o=null===(n=this.logInfo)||void 0===n?void 0:n.data)||void 0===o?void 0:o.changes)||[]).forEach((function(t){var e,n,o,r,a=t.split("_").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" ");i.changeList.push({displayAttribute:a,attribute:t,newValue:null!==(n=null===(e=i.logInfo)||void 0===e?void 0:e.object[t])&&void 0!==n?n:"",oldValue:null!==(r=null===(o=i.logInfo)||void 0===o?void 0:o.pre_object[t])&&void 0!==r?r:""})}))},t.prototype.close=function(){this.dialogRef.close()},t}(),t.AuditLogViewModelComponent.decorators=[{type:e.Component,args:[{selector:"app-audit-log-view",template:'<div fxLayout="column" class="m-4" fxLayoutGap="1.5rem">\n <h3 class="text-center">Audit Log</h3>\n <div fxLayout="column" fxLayoutGap="0.5rem" *ngIf="logInfo">\n <div>Object Type: {{logInfo?.object_type}}</div>\n <div>Object Id: {{logInfo?.object_id}}</div>\n <div>Action: {{logInfo?.action}}</div>\n <div>Created At: {{logInfo?.created_at | date:\'medium\'}}</div>\n <div>Created By: {{logInfo?.user?.email}}</div>\n </div>\n\n\n <div class="container" *ngIf="changeList.length > 0">\n <h4 class="font-weight-bold"> Changes in Attributes</h4>\n <table class="table table-striped table-sm border">\n <thead>\n <tr>\n <th scope="col">#</th>\n <th scope="col">Attribute</th>\n <th scope="col">Old Value</th>\n <th scope="col">New Value</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let change of changeList; let i= index;">\n <th scope="row">{{i+1}}</th>\n <td>{{change?.displayAttribute}}</td>\n <td>{{change?.oldValue}}</td>\n <td>{{change?.newValue}}</td>\n </tr>\n </tbody>\n </table>\n\n </div>\n\n <div>\n <button mat-raised-button (click)="close()">Close</button>\n </div>\n</div>',styles:[".scroll-container{max-height:400px;overflow:auto}"]}]}],t.AuditLogViewModelComponent.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:vt}]},t.AuditLogViewModelComponent=B([r.UntilDestroy()],t.AuditLogViewModelComponent),t.AuditLogsViewModelComponent=function(){function t(t,e,n){this.dialogRef=t,this.data=e,this.router=n}return t.prototype.ngOnInit=function(){var t=this;this.router.events.pipe(u.filter((function(t){return t instanceof y.NavigationEnd})),r.untilDestroyed(this)).subscribe((function(e){return t.dialogRef.close()}))},t}(),t.AuditLogsViewModelComponent.decorators=[{type:e.Component,args:[{selector:"app-audit-logs-view-model",template:'<div fxLayout="column" class="m-4" fxLayoutGap="1.5rem">\n <app-audit-log-list [objectId]="data?.modelId" [objectType]="data?.modelType" [showExportButtons]="false">\n </app-audit-log-list>\n</div>',styles:["::ng-deep app-audit-log-list .scroll-container{height:350px!important;overflow-y:scroll}"]}]}],t.AuditLogsViewModelComponent.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:y.Router}]},t.AuditLogsViewModelComponent=B([r.UntilDestroy()],t.AuditLogsViewModelComponent);var Je=function(){function e(t){this.dialog=t,this.logView="recent"}return e.prototype.ngOnInit=function(){},e.prototype.getLogView=function(){this.dialog.open(t.AuditLogViewModelComponent,{width:"800px",autoFocus:!1,data:{modelType:this.modelType,modelId:this.modelId}})},e.prototype.getLogsView=function(){this.dialog.open(t.AuditLogsViewModelComponent,{width:"95%",maxWidth:"unset",autoFocus:!1,data:{modelType:this.modelType,modelId:this.modelId}})},e}();Je.decorators=[{type:e.Component,args:[{selector:"app-audit-log-for-model",template:'<button type="button" *ngIf="logView===\'recent\'" mat-icon-button matTooltip="Recent Audit Log"\n (click)="$event.stopPropagation();getLogView()">\n <mat-icon>history</mat-icon>\n</button>\n\n<button type="button" *ngIf="logView===\'all\'" mat-icon-button matTooltip="All Audit Logs"\n (click)="$event.stopPropagation();getLogsView()">\n <mat-icon>history</mat-icon>\n</button>',styles:[""]}]}],Je.ctorParameters=function(){return[{type:n.MatDialog}]},Je.propDecorators={modelType:[{type:e.Input}],modelId:[{type:e.Input}],logView:[{type:e.Input}]};var Qe=function(){};Qe.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var Ze=function(){};Ze.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var Xe=function(){};Xe.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogViewModelComponent],imports:[a.CommonModule,Ze,L.FlexLayoutModule,Bt],exports:[t.AuditLogViewModelComponent]}]}];var tn=function(){};tn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var en=function(){};en.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}],t.AuditLogListComponent=function(){function t(t,e,n){this.dataManager=t,this.router=e,this.sanitizer=n,this.auditLogList=[],this.showFilter=!0,this.showExportButtons=!0,this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc"},this.displayedColumns=["index","id","object_type","object_id","action","changes","created_at","user.email"]}return t.prototype.ngOnInit=function(){var t=this;this.initializeData(),this.sort&&this.sort.sortChange.pipe(r.untilDestroyed(this)).subscribe((function(e){t.changeSort(e)}))},Object.defineProperty(t.prototype,"excelData",{get:function(){return this.auditLogList.length>0?this.auditLogList.map((function(t){var e;return{Type:null==t?void 0:t.object_type,Action:null==t?void 0:t.action,Data:JSON.stringify((null==t?void 0:t.data)||{}),Object:JSON.stringify((null==t?void 0:t.object)||{}),"Pre-Object":JSON.stringify((null==t?void 0:t.pre_object)||{}),"Created At":new Date(null==t?void 0:t.created_at).toDateString(),"Created By":null===(e=null==t?void 0:t.user)||void 0===e?void 0:e.email}})):[]},enumerable:!1,configurable:!0}),t.prototype.changeSort=function(t){t.direction&&(this.filters.sort_by=t.active+"|"+t.direction,this.reload())},t.prototype.logClicked=function(t){this.router.navigate(["/system/audit-logs/log-view",t.id])},t.prototype.initializeData=function(){return z(this,void 0,void 0,(function(){var t;return $(this,(function(e){switch(e.label){case 0:return this.objectType&&(this.filters=Object.assign(Object.assign({},this.filters),{object_type:this.objectType})),this.objectId&&(this.filters=Object.assign(Object.assign({},this.filters),{object_id:this.objectId})),this.userId&&(this.filters=Object.assign(Object.assign({},this.filters),{user_id:this.userId})),[4,this.dataManager.GET("api/audit-logs",Object.assign(Object.assign({},this.filters),this.pageEvent))];case 1:return t=e.sent(),this.auditLogList=this.auditLogList.concat(t.data),this.pageEvent.page=t.current_page,this.pageEvent.lastPage=t.last_page,[2]}}))}))},t.prototype.filterChange=function(t){this.showFilter&&(this.filters=Object.assign(Object.assign(Object.assign({},this.filters),t),{object_type:this.objectType||(null==t?void 0:t.object_type)||"",object_id:this.objectId||""}),this.reload())},t.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.initializeData())},t.prototype.reload=function(){this.auditLogList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.initializeData()},t.prototype.getTransformedChanges=function(t){var e,n;if(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.changes){var o=Object.keys(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.changes)||[],i="<div>";return o.forEach((function(e){var n,o,r=e.split("_").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" ");i=i+" <div><b>"+r+':</b> <span id="old-value">'+(null!==(n=null==t?void 0:t.pre_object[e])&&void 0!==n?n:"")+'</span><span id="new-value">'+(null!==(o=null==t?void 0:t.object[e])&&void 0!==o?o:"")+"</span></div>"})),i+=" </div>"}return""},t.prototype.ngOnDestroy=function(){},t}(),t.AuditLogListComponent.decorators=[{type:e.Component,args:[{selector:"app-audit-log-list",template:'<div fxLayout="column" fxLayoutAlign="start" class="mat-typography">\n\n <div fxLayout="column" fxLayoutAlign="start" fxLayoutGap="1.5rem" class="p-3">\n <h2 class="font-weight-bold">\n Audit Logs\n </h2>\n\n <div fxLayout="row wrap" fxLayoutAlign="start center">\n <app-audit-log-list-filter *ngIf="showFilter" (valueChange)="filterChange($event)" [objectType]="objectType"\n [objectId]="objectId"></app-audit-log-list-filter>\n <span fxFlex></span>\n\n <ng-container *ngIf="showExportButtons">\n <div class="ml-4">\n <app-export-excel-button elementId="audit-logs-table" name="AuditLogs" [data]="excelData">\n </app-export-excel-button>\n </div>\n </ng-container>\n </div>\n </div>\n\n <section class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="auditLogList" matSort class="w-100" multiTemplateDataRows id="audit-logs-table">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let auditLog; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n <ng-container matColumnDef="id">\n <th mat-header-cell *matHeaderCellDef> Log # </th>\n <td mat-cell *matCellDef="let auditLog">\n {{auditLog?.id}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="object_type">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Model </th>\n <td mat-cell *matCellDef="let auditLog;"> {{ auditLog.object_type }} </td>\n </ng-container>\n\n <ng-container matColumnDef="object_id">\n <th mat-header-cell *matHeaderCellDef> Model # </th>\n <td mat-cell *matCellDef="let auditLog">\n {{auditLog?.object_id}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="action">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Action </th>\n <td mat-cell *matCellDef="let auditLog;"> {{ auditLog?.action }} </td>\n </ng-container>\n\n <ng-container matColumnDef="created_at">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Created At </th>\n <td mat-cell *matCellDef="let auditLog">\n {{auditLog?.created_at | date:\'medium\'}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="user.email">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Created By </th>\n <td mat-cell *matCellDef="let auditLog">\n {{auditLog?.user?.email}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="changes">\n <th mat-header-cell *matHeaderCellDef> Changes</th>\n <td mat-cell *matCellDef="let auditLog">\n <div class="px-3" [innerHtml]="sanitizer.bypassSecurityTrustHtml(getTransformedChanges(auditLog))">\n\n </div>\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let auditLog">\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"\n (click)="logClicked(row);$event.stopPropagation();" class="hoverable row-hover"></tr>\n </table>\n </section>\n\n\n</div>',styles:["tr.row-hover:hover{background-color:#dcdcdc}.scroll-container{height:800px;overflow-y:auto}:host ::ng-deep #old-value{background-color:#f08080;margin-right:5px}:host ::ng-deep #new-value{background-color:#98fb98}"]}]}],t.AuditLogListComponent.ctorParameters=function(){return[{type:qt},{type:y.Router},{type:V.DomSanitizer}]},t.AuditLogListComponent.propDecorators={objectId:[{type:e.Input}],objectType:[{type:e.Input}],showFilter:[{type:e.Input}],showExportButtons:[{type:e.Input}],userId:[{type:e.Input}],sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}]},t.AuditLogListComponent=B([r.UntilDestroy()],t.AuditLogListComponent);var nn=function(){};function on(){return function(t){var e=new Date(t.value);return t.value&&"Invalid Date"==e?{invalidDate:!0}:null}}nn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}],t.AuditLogListFilterComponent=function(){function t(t,n){this.fb=t,this.formValidatorService=n,this.valueChange=new e.EventEmitter,this.createForm()}return Object.defineProperty(t.prototype,"showObjectFilter",{get:function(){return!(this.objectId||this.objectType)},enumerable:!1,configurable:!0}),t.prototype.createForm=function(){this.auditLogFilterForm=this.fb.group({object_type:[""],action:[""],data:[""],date_to:["",on()],date_from:["",on()]})},t.prototype.ngOnInit=function(){var t=this;this.auditLogFilterForm.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){e.date_from=e.date_from?e.date_from.toISOString():"",e.date_to=e.date_to?e.date_to.toISOString():"",t.valueChange.emit(e)}))},t.prototype.resetFieldValue=function(t){this.auditLogFilterForm.get(t).setValue("")},t.prototype.getFieldValue=function(t){return this.auditLogFilterForm.get(t).value},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.auditLogFilterForm,!0)},t.prototype.ngOnDestroy=function(){},t}(),t.AuditLogListFilterComponent.decorators=[{type:e.Component,args:[{selector:"app-audit-log-list-filter",template:'<form [formGroup]="auditLogFilterForm" fxLayout="row wrap" fxLayoutGap="1rem" fxLayoutAlign="start center">\n <mat-form-field *ngIf="showObjectFilter">\n <mat-label>Model</mat-label>\n <app-searchable-selector formControlName="object_type" apiUrl="api/audit-log-types" titleField="object_type"\n valueField="object_type" [sort]="false" [enableSearch]="false">\n </app-searchable-selector>\n <button mat-button *ngIf="getFieldValue(\'object_type\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'object_type\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Action</mat-label>\n <mat-select formControlName="action">\n <mat-option value="created">Created</mat-option>\n <mat-option value="updated">Updated</mat-option>\n <mat-option value="deleted">Deleted</mat-option>\n </mat-select>\n <button mat-button *ngIf="getFieldValue(\'action\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'action\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field>\n <input matInput formControlName="date_from" [matDatepicker]="fromPicker" (click)="fromPicker.open()"\n placeholder="From Date (MM/DD/YYYY)" />\n <mat-datepicker-toggle matSuffix [for]="fromPicker"></mat-datepicker-toggle>\n <mat-datepicker #fromPicker></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(\'date_from\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'date_from\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'date_from\')">Invalid Date</mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <input matInput formControlName="date_to" [matDatepicker]="toPicker" (click)="toPicker.open()"\n placeholder="To Date (MM/DD/YYYY)" />\n <mat-datepicker-toggle matSuffix [for]=""></mat-datepicker-toggle>\n <mat-datepicker #toPicker></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(\'date_to\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'date_to\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'date_to\')">Invalid Date</mat-error>\n </mat-form-field>\n</form>',styles:[""]}]}],t.AuditLogListFilterComponent.ctorParameters=function(){return[{type:l.FormBuilder},{type:Ct}]},t.AuditLogListFilterComponent.propDecorators={objectId:[{type:e.Input}],objectType:[{type:e.Input}],valueChange:[{type:e.Output}]},t.AuditLogListFilterComponent=B([r.UntilDestroy()],t.AuditLogListFilterComponent);var rn=function(){};rn.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogListFilterComponent],imports:[a.CommonModule,nn,L.FlexLayoutModule,l.ReactiveFormsModule,Bt,ee],exports:[t.AuditLogListFilterComponent]}]}];var an=function(){};an.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogListComponent],imports:[a.CommonModule,en,Ke,L.FlexLayoutModule,l.ReactiveFormsModule,Bt,k.InfiniteScrollModule,rn],exports:[t.AuditLogListComponent]}]}];var ln=function(){};ln.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogsViewModelComponent],imports:[a.CommonModule,tn,L.FlexLayoutModule,an],exports:[t.AuditLogsViewModelComponent]}]}];var sn=function(){};sn.decorators=[{type:e.NgModule,args:[{declarations:[Je],imports:[Xe,ln,a.CommonModule,Qe,L.FlexLayoutModule,Bt],exports:[Je]}]}];var cn=function(){function t(t,e,n){this.dataManager=t,this.route=e,this.location=n,this.showDeltaChanges=!1,this.changeList=[]}return t.prototype.ngOnInit=function(){var t=this;this.route.paramMap.subscribe((function(e){e.get("id")?t.fetchLogDetail(e.get("id")):t.location.back()}))},t.prototype.getTransformedChanges=function(){var t,e,n,o,i=this;(null===(e=null===(t=this.logInfo)||void 0===t?void 0:t.data)||void 0===e?void 0:e.changes)&&(Object.keys(null===(o=null===(n=this.logInfo)||void 0===n?void 0:n.data)||void 0===o?void 0:o.changes)||[]).forEach((function(t){var e,n,o,r,a=t.split("_").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" ");i.changeList.push({displayAttribute:a,attribute:t,newValue:null!==(n=null===(e=i.logInfo)||void 0===e?void 0:e.object[t])&&void 0!==n?n:"",oldValue:null!==(r=null===(o=i.logInfo)||void 0===o?void 0:o.pre_object[t])&&void 0!==r?r:""})}))},t.prototype.fetchLogDetail=function(t){return z(this,void 0,void 0,(function(){var e;return $(this,(function(n){switch(n.label){case 0:return[4,this.dataManager.GET("api/audit-logs/"+t)];case 1:return e=n.sent(),this.logInfo=e.item,this.getTransformedChanges(),this.patchDelta(),[2]}}))}))},t.prototype.patchDelta=function(){var t,e,n,o=P.diff(null===(t=this.logInfo)||void 0===t?void 0:t.pre_object,null===(e=this.logInfo)||void 0===e?void 0:e.object);document.getElementById("jsondiff").innerHTML=P.formatters.html.format(o,null===(n=this.logInfo)||void 0===n?void 0:n.pre_object)},t}();cn.decorators=[{type:e.Component,args:[{selector:"app-audit-log-view",template:'<div fxLayout="column" class="m-4" fxLayoutGap="1.5rem">\n <h3 class="text-center">Audit Log</h3>\n <div fxLayout="column" fxLayoutGap="0.5rem" *ngIf="logInfo">\n <div>Object Type: {{logInfo?.object_type}}</div>\n <div>Object Id: {{logInfo?.object_id}}</div>\n <div>Action: {{logInfo?.action}}</div>\n <div>Created At: {{logInfo?.created_at | date:\'medium\'}}</div>\n <div>Created By: {{logInfo?.user?.email}}</div>\n </div>\n\n\n <div fxLayout="column" *ngIf="logInfo?.action !== \'deleted\'">\n <div>\n <button mat-raised-button color="primary" (click)="showDeltaChanges = !showDeltaChanges">\n {{showDeltaChanges?\'Hide JSON Changes\': \'Show JSON Changes\'}}\n </button>\n </div>\n <div [hidden]="!showDeltaChanges">\n <h4 class="font-weight-bold" *ngIf="logInfo">Changes in JSON</h4>\n <div id="jsondiff"></div>\n </div>\n </div>\n\n <div class="container" *ngIf="changeList.length > 0">\n <h4 class="font-weight-bold"> Changes in Attributes</h4>\n <table class="table table-striped table-sm border">\n <thead>\n <tr>\n <th scope="col">#</th>\n <th scope="col">Attribute</th>\n <th scope="col">Old Value</th>\n <th scope="col">New Value</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let change of changeList; let i= index;">\n <th scope="row">{{i+1}}</th>\n <td>{{change?.displayAttribute}}</td>\n <td>{{change?.oldValue}}</td>\n <td>{{change?.newValue}}</td>\n </tr>\n </tbody>\n </table>\n\n </div>\n</div>',styles:[""]}]}],cn.ctorParameters=function(){return[{type:qt},{type:y.ActivatedRoute},{type:a.Location}]};var un=function(){};un.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var dn=function(){};dn.decorators=[{type:e.NgModule,args:[{declarations:[cn],imports:[a.CommonModule,un,L.FlexLayoutModule,Bt],exports:[cn]}]}];var pn=[{path:"log-list",component:t.AuditLogListComponent,canActivate:[Rt]},{path:"log-view/:id",component:cn,canActivate:[Rt]},{path:"**",redirectTo:"log-list",pathMatch:"full"}],mn=function(){};mn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(pn)],exports:[y.RouterModule]}]}];var fn=function(){};fn.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,mn,an,dn],exports:[]}]}];var hn=function(){};hn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}],t.ImportCsvComponent=function(){function t(t,e,n){this.alertService=t,this.http=e,this.location=n,this.filesList=[],this.fileData=[],this.failedItems=[],this.selectedFields=[],this.filesConfig={fileId:"file",containerId:"fileContainer",styles:{height:"600px"},acceptFile:".csv",multiple:!1,maxSize:100,acceptFileText:".csv"}}return t.prototype.ngOnInit=function(){},t.prototype.reset=function(){this.filesList=[],this.failedItems=[],this.selectedFields=[],this.fileData=[]},t.prototype.fileChanged=function(t){var e=this;this.filesList=t;var n=null,o=new FileReader,i=this.filesList[0];o.onload=function(t){var i=o.result,r=U.read(i,{type:"binary",cellDates:!0});n=r.SheetNames.reduce((function(t,e){var n=r.Sheets[e];return U.utils.sheet_to_json(n)}),[]),e.fileData=n},o.readAsBinaryString(i)},t.prototype.mappingProcessed=function(t){var e=this;this.selectedFields=t.fields;var n=JSON.parse(JSON.stringify(this.fileData));n.forEach((function(n){for(var o in n){var i=t.fields.find((function(t){return t.label==o}));i?("date"!=i.propertyType&&"dateTime"!=i.propertyType||!e.isValidDate(new Date(n[i.label]))?n[i.property]=n[i.label]:n[i.property]=new Date(n[i.label]).toISOString(),delete n[o]):delete n[o]}})),this.save(n)},t.prototype.save=function(t){var e,n=this;this.http.post(null===(e=this.importConfig)||void 0===e?void 0:e.postUrl,{data:t}).pipe(r.untilDestroyed(this)).subscribe((function(t){n.failedItems=(null==t?void 0:t.failed_items)||[],0===n.failedItems.length&&(n.alertService.addAlert("File Import Success","success"),n.location.back())}))},t.prototype.isValidDate=function(t){return t instanceof Date&&!isNaN(t.getTime())},t}(),t.ImportCsvComponent.decorators=[{type:e.Component,args:[{selector:"app-import-csv",template:'<div fxLayout="column" fx class="m-4">\n <h2 class="text-center">\n {{importConfig?.importType}} Import\n <span>\n <button type="button" *ngIf="failedItems.length > 0" mat-raised-button color="warn"\n (click)="reset()">Reset</button>\n </span>\n </h2>\n\n <ng-container *ngIf="failedItems.length === 0">\n <app-file-dropper *ngIf="fileData.length === 0" [config]="filesConfig" [fileArray]="filesList"\n (fileChanged)="fileChanged($event)">\n </app-file-dropper>\n\n <app-import-items class="w-100" *ngIf="fileData.length > 0" [data]="fileData" [importConfig]="importConfig"\n (onSave)="mappingProcessed($event)"></app-import-items>\n </ng-container>\n\n <app-failed-items class="w-100" *ngIf="failedItems.length > 0" [failedItems]="failedItems"\n [selectedFields]="selectedFields"></app-failed-items>\n\n</div>',styles:[""]}]}],t.ImportCsvComponent.ctorParameters=function(){return[{type:at},{type:vt},{type:a.Location}]},t.ImportCsvComponent.propDecorators={importConfig:[{type:e.Input}]},t.ImportCsvComponent=B([r.UntilDestroy()],t.ImportCsvComponent);var gn=function(){};gn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var yn={property:{required:"Property is required",unavailable:"Duplicate entry"}},vn=function(){function t(t,n,o){this.fb=t,this.formValidatorService=n,this.changeDetectorRef=o,this.firstDataArray=[],this.properties=[],this.onSave=new e.EventEmitter,this.createImportMappingForm()}return t.prototype.ngOnInit=function(){this.properties=this.importConfig.properties,this.mapOutDataColumns(this.data[0])},t.prototype.createImportMappingForm=function(){this.importMappingForm=this.fb.group({fields:this.fb.array([])})},Object.defineProperty(t.prototype,"fieldsArray",{get:function(){return this.importMappingForm.get("fields")},enumerable:!1,configurable:!0}),t.prototype.createField=function(t){return this.fb.group({id:new l.FormControl(t.id),label:new l.FormControl(t.label),value:new l.FormControl(t.value),property:new l.FormControl(t.property,l.Validators.compose([l.Validators.required])),propertyType:new l.FormControl(t.propertyType)})},t.prototype.mapOutDataColumns=function(t){var e=this;for(var n in t)if(t.hasOwnProperty(n)){var o={id:"",label:n,value:t[n],property:"",propertyType:""};this.firstDataArray.push(o)}this.firstDataArray.forEach((function(t,n){t.id=n,e.properties.find((function(e){if(e.label.toLowerCase().includes(t.label.toLowerCase()))return t.property=e.value,t.propertyType=e.type,t}))}))},t.prototype.submit=function(){this.importMappingForm.markAllAsTouched(),this.importMappingForm.valid&&this.onSave.emit(this.importMappingForm.value)},t.prototype.isFieldValid=function(t,e){return this.formValidatorService.isFieldValid(t,e)},t.prototype.getErrorMessage=function(t,e){return this.formValidatorService.getErrorMessage(t,e,yn)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(e){t.firstDataArray.forEach((function(e){t.fieldsArray.push(t.createField(e))})),t.changeDetectorRef.detectChanges()}),500)},t.prototype.updatePropertyType=function(t,e){var n=this.properties.find((function(e){return e.value==t.value}));n&&(this.fieldsArray.controls[e].get("propertyType").setValue(n.type),this.uniqueValidator())},t.prototype.uniqueValidator=function(){var t=this;this.fieldsArray.value.forEach((function(e,n){var o=t.fieldsArray.controls[n].get("property");!t.fieldsArray.value.find((function(e){return e.property===o.value&&e.id!=t.fieldsArray.controls[n].get("id").value}))?o.setErrors(null):o.setErrors({unavailable:!0})}))},t.prototype.removeField=function(t){-1!=t&&this.fieldsArray.removeAt(t)},t}();vn.decorators=[{type:e.Component,args:[{selector:"app-import-items",template:'<div fxLayout="column" class="mt-2">\n <p class="text-center secondary-color">Map your column headers in your file to our properties</p>\n <form [formGroup]="importMappingForm" (ngSubmit)="submit()" fxLayout="column">\n <table style="width: 100%;" class="table table-sm table-striped">\n <tr class="table-header-row">\n <th>Column Headers From File</th>\n <th>Preview Information</th>\n <th>Property</th>\n </tr>\n <ng-container formArrayName="fields">\n <tr *ngFor="let field of fieldsArray.controls; let i=index" [formGroupName]="i">\n <td>{{ field.get(\'label\').value }}</td>\n <td>{{ field.get(\'value\').value }}</td>\n <td>\n <mat-form-field fxFlex="100%" appearance="outline">\n <mat-label>Select Property</mat-label>\n <mat-select placeholder="Select Property" formControlName="property" required\n (selectionChange)="updatePropertyType($event, i)">\n <mat-option *ngFor="let property of properties" [value]="property.value">\n {{property.label}}\n </mat-option>\n </mat-select>\n <mat-error *ngIf="isFieldValid(\'property\', fieldsArray.controls[i])">\n {{getErrorMessage(\'property\', fieldsArray.controls[i])}}\n </mat-error>\n </mat-form-field>\n <button type="button" mat-icon-button (click)="removeField(i)" *ngIf="fieldsArray.length > 1"\n matTooltip="Remove column" matTooltipPosition="right">\n <mat-icon class="text-danger">remove_circle</mat-icon>\n </button>\n </td>\n </tr>\n </ng-container>\n </table>\n\n <div class="mt-1" fxFlex="100%" fxLayoutAlign="end">\n <button mat-stroked-button color="primary" class="mt-2" type="submit">\n Next\n <mat-icon>\n chevron_right\n </mat-icon>\n </button>\n </div>\n </form>\n</div>',styles:["table{width:100%}td,th{padding:1%}.table-header-row{background-color:#e6e4e4;color:#000;font-weight:bolder}"]}]}],vn.ctorParameters=function(){return[{type:l.FormBuilder},{type:Ct},{type:e.ChangeDetectorRef}]},vn.propDecorators={data:[{type:e.Input}],importConfig:[{type:e.Input}],onSave:[{type:e.Output}]};var bn=function(){};bn.decorators=[{type:e.NgModule,args:[{declarations:[vn],imports:[a.CommonModule,L.FlexLayoutModule,Bt,l.ReactiveFormsModule,gn],exports:[vn]}]}];var Cn=function(){};Cn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var xn=function(){function t(){}return t.prototype.ngOnInit=function(){},t.prototype.isValidDate=function(t){var e=new Date(t);return e instanceof Date&&!isNaN(e.getTime())},t}();xn.decorators=[{type:e.Component,args:[{selector:"app-failed-items",template:'<div *ngIf="failedItems.length" class="mt-4">\n <div fxLayout fxLayoutAlign="center">\n <h4>Failed Items</h4>\n </div>\n <div fxLayout="row wrap" fxLayoutAlign="center">\n <table class="table table-bordered table-striped table-hover table-sm" fxFlex="80%">\n <thead>\n <tr>\n <th>#</th>\n <th *ngFor="let field of selectedFields;">{{field?.label}}</th>\n <th class="text-danger">Error</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor="let timesheet of failedItems; let i=index">\n <tr>\n <td>{{i + 1}}</td>\n <td *ngFor="let field of selectedFields;">\n <ng-container *ngIf="(field.propertyType == \'date\' || field.propertyType == \'dateTime\')\n &&isValidDate(timesheet[field.property]);else elseProperty;">\n {{ timesheet[field.property] | date:\'mediumDate\' }}\n </ng-container>\n <ng-template #elseProperty>\n {{ timesheet[field.property] }}\n </ng-template>\n </td>\n <td class="text-danger">\n {{timesheet?.error}}\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n</div>',styles:[""]}]}],xn.ctorParameters=function(){return[]},xn.propDecorators={failedItems:[{type:e.Input}],selectedFields:[{type:e.Input}]};var Fn=function(){};Fn.decorators=[{type:e.NgModule,args:[{declarations:[xn],imports:[a.CommonModule,Bt,L.FlexLayoutModule,Cn],exports:[xn]}]}];var In=function(){};In.decorators=[{type:e.NgModule,args:[{declarations:[t.ImportCsvComponent],imports:[a.CommonModule,Bt,L.FlexLayoutModule,Kt,hn,bn,Fn],exports:[t.ImportCsvComponent]}]}];var wn=function(){};t.LoginHistoryForUserComponent=function(){function t(t,e){this.http=t,this.fb=e,this.loginHistoryList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc"},this.displayedColumns=["index","created_at"],this.historyFilterForm=this.fb.group({date_from:[""],date_to:[""]})}return t.prototype.ngOnInit=function(){var t=this;this.filters.user_id=this.userId,this.historyFilterForm.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){e.date_from=e.date_from?e.date_from.toISOString():"",e.date_to=e.date_to?e.date_to.toISOString():"",t.filterChange(e)})),this.initializeData()},t.prototype.initializeData=function(){var t=this;this.http.get("api/user-login-history",{params:Object.assign(Object.assign({},this.filters),this.pageEvent)}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.loginHistoryList=t.loginHistoryList.concat(e.data),t.pageEvent.page=e.current_page,t.pageEvent.lastPage=e.last_page}))},t.prototype.filterChange=function(t){this.filters=Object.assign(Object.assign({},this.filters),t),this.reload()},t.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.initializeData())},t.prototype.reload=function(){this.loginHistoryList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.initializeData()},t.prototype.ngOnDestroy=function(){},t}(),t.LoginHistoryForUserComponent.decorators=[{type:e.Component,args:[{selector:"app-login-history-for-user",template:'<div class="mat-typography m-4">\n <form fxLayoutAlign=" start center">\n <app-timeline-filter [form]="historyFilterForm"></app-timeline-filter>\n </form>\n\n\n\n <section>\n <div class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="loginHistoryList" matSort class="w-100 mt-1" multiTemplateDataRows\n id="login-history-table">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let loginHistory; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n <ng-container matColumnDef="created_at">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Last Login</th>\n <td mat-cell *matCellDef="let loginHistory;">\n {{loginHistory?.created_at | date:\'medium\' }}\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns;"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n\n </section>\n</div>',styles:[".scroll-container{max-height:800px;overflow-y:auto}"]}]}],t.LoginHistoryForUserComponent.ctorParameters=function(){return[{type:vt},{type:l.FormBuilder}]},t.LoginHistoryForUserComponent.propDecorators={userId:[{type:e.Input}]},t.LoginHistoryForUserComponent=B([r.UntilDestroy()],t.LoginHistoryForUserComponent);var Dn=[{path:"",component:t.LoginHistoryForUserComponent,canActivate:[Rt]}],Sn=function(){};Sn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Dn)],exports:[y.RouterModule]}]}];var Mn=function(){};Mn.decorators=[{type:e.NgModule,args:[{declarations:[t.LoginHistoryForUserComponent],imports:[a.CommonModule,Sn,k.InfiniteScrollModule,Bt,L.FlexLayoutModule,l.ReactiveFormsModule,ie],exports:[t.LoginHistoryForUserComponent]}]}];var Tn,_n=function(){this.selectable=!0,this.removable=!0,this.separatorKeysCodes=[j.ENTER,j.COMMA],this.placeholder="New Tag..",this.apiUrl="api/techlify-tagger-tags",this.createApiUrl="api/techlify-tagger-tags",this.isCreateable=!0,this.isCacheTags=!1,this.isSingle=!1};t.TechlifyTaggerTagFormFieldComponent=Tn=function(){function t(t,e,n,o,i){var r=this;this._focusMonitor=t,this._elementRef=e,this.httpService=n,this._formField=o,this.ngControl=i,this.stateChanges=new c.Subject,this.focused=!1,this.controlType="techlify-tagger-form-field",this.id="techlify-tagger-form-field-"+Tn.nextId++,this.onChange=function(t){},this.onTouched=function(){},this.tagInputCtrl=new l.FormControl,this.config=new _n,this._allTags=[],this.categories=[],this._required=!1,this._disabled=!1,this._value=[],this.tagInputCtrl.valueChanges.subscribe((function(t){r.filterString=t})),t.monitor(e,!0).subscribe((function(t){r.focused&&!t&&r.onTouched(),r.focused=!!t,r.stateChanges.next()})),null!=this.ngControl&&(this.ngControl.valueAccessor=this)}return Object.defineProperty(t.prototype,"allTags",{get:function(){return this._allTags},set:function(t){this._allTags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tags",{get:function(){var t=this;return this.allTags.filter((function(e){return t.value.some((function(t){return t==e.id}))}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0==this.value.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldLabelFloat",{get:function(){return this.focused||!this.empty||this.tagInputCtrl.value},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=m.coerceBooleanProperty(t),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=m.coerceBooleanProperty(t),this._disabled?this.tagInputCtrl.disable():this.tagInputCtrl.enable(),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t||[],this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errorState",{get:function(){return this.tagInputCtrl.dirty&&this.required&&0==this.value.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(t){this._placeholder=t,this.stateChanges.next()},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){var e=this;0==this.allTags.length&&this.httpService.cache(!this.config.isCacheTags).get(this.config.apiUrl,{params:{categories:this.categories.join(","),perPage:"1000"}}).pipe(u.debounceTime(500),r.untilDestroyed(this)).subscribe((function(t){e.allTags=t.data})),this.modelId&&0==this.value.length&&this.httpService.cache(!this.config.isCacheTags).get(this.config.apiUrl,{params:{categories:this.categories.join(","),model_type:this.modelType,model_id:this.modelId,perPage:"1000"}}).pipe(u.debounceTime(500),r.untilDestroyed(this)).subscribe((function(t){e.value=((null==t?void 0:t.data)||[]).map((function(t){return t.id})),e._handleInput()}))},t.prototype.init=function(){var t=this;this.modelId&&0==this.allTags.length&&this.httpService.cache(!this.config.isCacheTags).get(this.config.apiUrl,{params:{categories:this.categories.join(","),model_type:this.modelType,model_id:this.modelId}}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.allTags=e.data}))},Object.defineProperty(t.prototype,"filteredTags",{get:function(){return this._filter()},enumerable:!1,configurable:!0}),t.prototype.setDescribedByIds=function(t){},t.prototype.onContainerClick=function(){},t.prototype.add=function(t){return z(this,void 0,void 0,(function(){var e,n,o,i;return $(this,(function(r){switch(r.label){case 0:if(e=(t.value||"").trim(),this.config.isSingle&&0!==this.value.length)return[3,7];if(!e||!this.config.isCreateable)return[3,7];if(n=this.allTags,o=n.find((function(t){return t.title.toLowerCase()==e.toLowerCase()})))return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.httpService.post(this.config.createApiUrl,{title:e,description:e,category_title:this.categories.length>0?this.defaultCreateCategory?this.defaultCreateCategory:this.categories[0]:""}).toPromise()];case 2:return i=r.sent(),o=i.item,[3,4];case 3:return r.sent(),[2];case 4:return this.allTags.push(o),[3,6];case 5:this.remove(o),r.label=6;case 6:this.value.push(o.id),this._handleInput(),r.label=7;case 7:return t.input.value="",this.tagInputCtrl.setValue(null),[2]}}))}))},t.prototype.remove=function(t){this.value=this.value.filter((function(e){return e!==t.id})),this._handleInput()},t.prototype.selected=function(t){this.config.isSingle&&0!==this.value.length||(this.remove({id:t.option.value}),this.value.push(t.option.value),this._handleInput()),this.tagInput.nativeElement.value="",this.tagInputCtrl.setValue(null)},t.prototype._filter=function(){var t=this,e=this.filterString?this.filterString.toString().toLowerCase():null,n=this.allTags.filter((function(e){return!t.value.some((function(t){return t==e.id}))}));return e?n.filter((function(t){return t.title.toLowerCase().includes(e)})):n},t.prototype.writeValue=function(t){this.value=t||[]},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype._handleInput=function(){this.onChange(this.value)},t.prototype.ngOnDestroy=function(){this.stateChanges.complete(),this._focusMonitor.stopMonitoring(this._elementRef)},t}(),t.TechlifyTaggerTagFormFieldComponent.nextId=0,t.TechlifyTaggerTagFormFieldComponent.decorators=[{type:e.Component,args:[{selector:"app-techlify-tagger-tag-form-field",template:'<mat-chip-list #chipList aria-label="Tag Selection">\n <mat-chip *ngFor="let tag of tags" [selectable]="config.selectable" [removable]="config.removable"\n (removed)="remove(tag)">\n {{tag.title}}\n <button matChipRemove *ngIf="config.removable" class="border-0">\n <mat-icon class="mat-relative-icon">cancel</mat-icon>\n </button>\n </mat-chip>\n <input placeholder="{{config.isCreateable? config.placeholder:\'\'}}" #tagInput [formControl]="tagInputCtrl"\n [matAutocomplete]="auto" [matChipInputFor]="chipList"\n [matChipInputSeparatorKeyCodes]="config.separatorKeysCodes" (matChipInputTokenEnd)="add($event)"\n #trigger="matAutocompleteTrigger" (click)="trigger.openPanel()">\n</mat-chip-list>\n<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)">\n <mat-option *ngFor="let tag of filteredTags" [value]="tag.id">\n {{tag.title}}\n </mat-option>\n</mat-autocomplete>',providers:[{provide:f.MatFormFieldControl,useExisting:Tn}],styles:[".mat-relative-icon{font-size:20px;position:relative;right:7px;top:-3px}"]}]}],t.TechlifyTaggerTagFormFieldComponent.ctorParameters=function(){return[{type:p.FocusMonitor},{type:e.ElementRef},{type:vt},{type:f.MatFormField,decorators:[{type:e.Optional},{type:e.Inject,args:[f.MAT_FORM_FIELD]}]},{type:l.NgControl,decorators:[{type:e.Optional},{type:e.Self}]}]},t.TechlifyTaggerTagFormFieldComponent.propDecorators={tagInput:[{type:e.ViewChild,args:["tagInput"]}],config:[{type:e.Input}],modelType:[{type:e.Input}],modelId:[{type:e.Input}],allTags:[{type:e.Input}],categories:[{type:e.Input}],defaultCreateCategory:[{type:e.Input}],required:[{type:e.Input}],disabled:[{type:e.Input}],value:[{type:e.Input}],placeholder:[{type:e.Input}]},t.TechlifyTaggerTagFormFieldComponent=Tn=B([r.UntilDestroy()],t.TechlifyTaggerTagFormFieldComponent);var Ln,kn=function(){};kn.decorators=[{type:e.NgModule,args:[{declarations:[t.TechlifyTaggerTagFormFieldComponent],imports:[a.CommonModule,Bt,L.FlexLayoutModule,O.MatAutocompleteModule,l.ReactiveFormsModule],exports:[t.TechlifyTaggerTagFormFieldComponent]}]}],t.TechlifyTaggerTagSelectorComponent=Ln=function(){function t(t,e,n,o,i){var r=this;this._focusMonitor=t,this._elementRef=e,this.httpService=n,this._formField=o,this.ngControl=i,this.categories=[],this.multiple=!1,this.enableSearch=!0,this.tagSelectorCtrl=new l.FormControl,this.showAllTags=!1,this.useSelectButtonStyle=!1,this.tags=[],this.stateChanges=new c.Subject,this.focused=!1,this.controlType="techlify-tagger-selector",this.id="techlify-tagger-selector-"+Ln.nextId++,this.onChange=function(t){},this.onTouched=function(){},this._required=!1,this._disabled=!1,t.monitor(e,!0).subscribe((function(t){r.focused&&!t&&r.onTouched(),r.focused=!!t,r.stateChanges.next()})),null!=this.ngControl&&(this.ngControl.valueAccessor=this)}return Object.defineProperty(t.prototype,"apiUrl",{get:function(){var t;return this.showAllTags?"api/techlify-tagger-tags":(null===(t=this.categories)||void 0===t?void 0:t.length)>0?"api/techlify-tagger-tags?categories="+this.categories.join(","):""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0==this.value.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldLabelFloat",{get:function(){return this.focused||!this.empty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=m.coerceBooleanProperty(t),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=m.coerceBooleanProperty(t),this._disabled?this.tagSelectorCtrl.disable():this.tagSelectorCtrl.enable(),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t,this.tagSelectorCtrl.setValue(t),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errorState",{get:function(){return this.tagSelectorCtrl.dirty&&this.required&&0==this.value.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(t){this._placeholder=t,this.stateChanges.next()},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.useSelectButtonStyle&&this.httpService.get(this.apiUrl).pipe(r.untilDestroyed(this)).subscribe((function(e){t.tags=e.data}))},t.prototype.selectionChange=function(t){this.value=t,this._handleInput()},t.prototype.setDescribedByIds=function(t){},t.prototype.onContainerClick=function(){},t.prototype.writeValue=function(t){this.value=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype._handleInput=function(){this.onChange(this.value)},t.prototype.ngOnDestroy=function(){this.stateChanges.complete(),this._focusMonitor.stopMonitoring(this._elementRef)},t}(),t.TechlifyTaggerTagSelectorComponent.nextId=0,t.TechlifyTaggerTagSelectorComponent.decorators=[{type:e.Component,args:[{selector:"app-techlify-tagger-tag-selector",template:'<app-searchable-selector *ngIf="apiUrl && !useSelectButtonStyle" [formControl]="tagSelectorCtrl" [apiUrl]="apiUrl"\n [enableSearch]="enableSearch" [multiple]="multiple" (selectionChange)="selectionChange($event)">\n</app-searchable-selector>\n\n<mat-button-toggle-group *ngIf="apiUrl && useSelectButtonStyle" [formControl]="tagSelectorCtrl" [multiple]="multiple"\n (change)="selectionChange($event.value)">\n <mat-button-toggle *ngFor="let tag of tags" [value]="tag.id">{{tag.title}}</mat-button-toggle>\n</mat-button-toggle-group>',providers:[{provide:f.MatFormFieldControl,useExisting:Ln}],styles:[""]}]}],t.TechlifyTaggerTagSelectorComponent.ctorParameters=function(){return[{type:p.FocusMonitor},{type:e.ElementRef},{type:vt},{type:f.MatFormField,decorators:[{type:e.Optional},{type:e.Inject,args:[f.MAT_FORM_FIELD]}]},{type:l.NgControl,decorators:[{type:e.Optional},{type:e.Self}]}]},t.TechlifyTaggerTagSelectorComponent.propDecorators={categories:[{type:e.Input}],multiple:[{type:e.Input}],enableSearch:[{type:e.Input}],showAllTags:[{type:e.Input}],useSelectButtonStyle:[{type:e.Input}],required:[{type:e.Input}],disabled:[{type:e.Input}],value:[{type:e.Input}],placeholder:[{type:e.Input}]},t.TechlifyTaggerTagSelectorComponent=Ln=B([r.UntilDestroy()],t.TechlifyTaggerTagSelectorComponent);var An=function(){};An.decorators=[{type:e.NgModule,args:[{declarations:[t.TechlifyTaggerTagSelectorComponent],imports:[a.CommonModule,Bt,L.FlexLayoutModule,O.MatAutocompleteModule,l.ReactiveFormsModule,ee,R.MatButtonToggleModule],exports:[t.TechlifyTaggerTagSelectorComponent]}]}],t.ActionPopup=N,t.ActionPopupComponent=H,t.ActionPopupModule=$t,t.AlertService=at,t.ApiPrefixInterceptor=pt,t.AuditLogForModelComponent=Je,t.AuditLogForModelModule=sn,t.AuditLogForModelRoutingModule=Qe,t.AuditLogListFilterModule=rn,t.AuditLogListFilterRoutingModule=nn,t.AuditLogListModule=an,t.AuditLogListRoutingModule=en,t.AuditLogModule=fn,t.AuditLogRoutingModule=mn,t.AuditLogViewComponent=cn,t.AuditLogViewModelModule=Xe,t.AuditLogViewModelRoutingModule=Ze,t.AuditLogViewModule=dn,t.AuditLogViewRoutingModule=un,t.AuditLogsViewModelModule=ln,t.AuditLogsViewModelRoutingModule=tn,t.AuthenticationGuard=Rt,t.AuthenticationService=Nt,t.CacheInterceptor=dt,t.ConfigService=ot,t.CoreModule=zt,t.CredentialsService=mt,t.DataManager=qt,t.DataTable=J,t.DataTableComponent=t.ɵi,t.DataTableModule=Yt,t.DateUtils=At,t.DateValidator=on,t.DocumentViewerComponent=Z,t.DocumentViewerModule=Wt,t.EmailSubscriptionForUserComponent=t.ɵbk,t.EmailSubscriptionForUserModule=Ae,t.EmailSubscriptionForUserRoutingModule=ke,t.EmailSubscriptionModule=le,t.EmailSubscriptionRoutingModule=ae,t.EmailSubscriptionTypeFormComponent=t.ɵbi,t.EmailSubscriptionTypeFormModule=we,t.EmailSubscriptionTypeFormRoutingModule=Fe,t.EmailSubscriptionTypeListComponent=t.ɵbj,t.EmailSubscriptionTypeListModule=Te,t.EmailSubscriptionTypeListRoutingModule=Me,t.EmailSubscriptionTypeModule=xe,t.EmailSubscriptionTypeRoutingModule=Ce,t.EmailSubscriptionUserFormComponent=t.ɵbe,t.EmailSubscriptionUserFormModule=pe,t.EmailSubscriptionUserFormRoutingModule=ue,t.EmailSubscriptionUserListComponent=t.ɵbf,t.EmailSubscriptionUserListFilterComponent=t.ɵbh,t.EmailSubscriptionUserListFilterModule=ve,t.EmailSubscriptionUserListFilterRoutingModule=ye,t.EmailSubscriptionUserListModule=be,t.EmailSubscriptionUserListRoutingModule=ge,t.EmailSubscriptionUserModule=ce,t.EmailSubscriptionUserRoutingModule=se,t.EntityFileFormComponent=Ft,t.EntityFilesViewAllComponent=t.ɵo,t.EntityFilesViewAllModule=Jt,t.ErrorHandlerInterceptor=st,t.ErrorHandlerService=lt,t.ErrorSnackComponent=rt,t.ExportExcelButtonComponent=We,t.ExportExcelModule=Ke,t.FailedItemsComponent=xn,t.FailedItemsModule=Fn,t.FailedItemsRoutingModule=Cn,t.FileDropperComponent=It,t.FileDropperConfig=wt,t.FileDropperModule=Kt,t.FormValidatorService=Ct,t.HTTP_DYNAMIC_INTERCEPTORS=yt,t.HttpCacheService=ut,t.HttpService=vt,t.ImportConfig=wn,t.ImportCsvModule=In,t.ImportCsvRoutingModule=hn,t.ImportItemsComponent=vn,t.ImportItemsModule=bn,t.ImportItemsRoutingModule=gn,t.LoaderComponent=Pt,t.LoaderModule=re,t.Logger=et,t.LoginHistoryForUserModule=Mn,t.LoginHistoryForUserRoutingModule=Sn,t.MatSelectInfiniteScrollDirective=Lt,t.MaterialModule=Bt,t.NoteFormComponent=Mt,t.NoteListComponent=_t,t.NoteModule=te,t.NumItemsSelector=kt,t.NumberSelector=Et,t.PageEvent=Q,t.ReadMoreComponent=Zt,t.ReadMoreModule=Xt,t.RouteReusableStrategy=Ht,t.SearchableSelectorComponent=t.ɵx,t.SearchableSelectorModule=ee,t.SnackModule=jt,t.StorageService=Gt,t.SuccessSnackComponent=it,t.TechlifyConfig=nt,t.TechlifyTaggerTagFormConfigModel=_n,t.TechlifyTaggerTagFormFieldModule=kn,t.TechlifyTaggerTagSelectorModule=An,t.TechlifyUpdateHistoryModule=qe,t.TechlifyUpdateModule=Re,t.Timeline=Vt,t.TimelineFilterComponent=t.ɵbb,t.TimelineFilterModule=ie,t.TokenInterceptor=ft,t.UpdateNotifierComponent=$e,t.UpdateNotifierModule=Ye,t.UtilityModule=ne,t.ViewerConfig=tt,t.calculateTimeline=Ut,t.esfur=_e,t.estlr=De,t.esulr=fe,t.ɵa=jt,t.ɵb=it,t.ɵba=Et,t.ɵbc=oe,t.ɵbd=Pt,t.ɵbg=Rt,t.ɵbm=Ee,t.ɵbn=Oe,t.ɵbo=Pe,t.ɵbp=Ve,t.ɵbq=Ge,t.ɵbs=ze,t.ɵbt=Be,t.ɵbu=Ne,t.ɵbv=qt,t.ɵc=rt,t.ɵd=yt,t.ɵe=vt,t.ɵf=Ht,t.ɵg=H,t.ɵh=N,t.ɵj=Z,t.ɵk=Ft,t.ɵl=Ct,t.ɵm=bt,t.ɵn=at,t.ɵp=It,t.ɵq=_t,t.ɵr=Dt,t.ɵs=Mt,t.ɵt=Qt,t.ɵu=mt,t.ɵv=ot,t.ɵw=nt,t.ɵy=Lt,t.ɵz=kt,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
16
|
+
var q=function(t,e){return(q=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 B(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}q(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function z(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function $(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{s(o.next(t))}catch(t){r(t)}}function l(t){try{s(o.throw(t))}catch(t){r(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,l)}s((o=o.apply(t,e||[])).next())}))}function W(t,e){var n,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function l(r){return function(l){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,o=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(6===r[0]&&a.label<i[1]){a.label=i[1],i=r;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(t,a)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,l])}}}Object.create;function Y(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function K(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function J(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(K(arguments[e]));return t}var Q;Object.create;t.ɵi=Q=function(){function t(){this.dataSource=new o.MatTableDataSource([]),this.action=new e.EventEmitter,this.selctionChange=new e.EventEmitter,this.rowClick=new e.EventEmitter,this.tableScroll=new e.EventEmitter,this.sortChanged=new e.EventEmitter,this.elementId="data-table-"+Q.nextId++}return t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){var t=this;this.dataSource=new o.MatTableDataSource(this.data),this.selection&&this.selection.changed.pipe().subscribe((function(e){t.selection.selected&&t.selctionChange.emit(t.selection.selected)})),this.sort&&this.sort.sortChange.pipe(r.untilDestroyed(this)).subscribe((function(e){t.sortChanged.emit(e)}))},t.prototype.isAllSelected=function(){return this.selection.selected.length===this.dataSource.data.length},t.prototype.masterToggle=function(){var t=this;this.isAllSelected()?this.clearSelection():this.dataSource.data.forEach((function(e){return t.selection.select(e)}))},t.prototype.clearSelection=function(){this.selection.clear(),this.selctionChange.emit(this.selection.selected)},t.prototype.ngOnChanges=function(t){this.initializeConfig(t),t.data&&!t.data.isFirstChange()&&this.dataSource&&(this.dataSource.data=t.data.currentValue)},t.prototype.initializeConfig=function(t){t.config&&!t.config.isFirstChange()&&(this.config=t.config.currentValue),this.page=this.config.page||1,this.lastPage=this.config.lastPage||this.page,this.perPage=this.config.perPage||20},t.prototype.onScroll=function(){this.page<this.lastPage&&(this.page+=1,this.tableScroll.emit({page:this.page,lastPage:this.lastPage,perPage:this.perPage}))},t.prototype.editClicked=function(t,e){this.action.emit({action:"edit",value:e}),t.stopPropagation()},t.prototype.viewClicked=function(t,e){this.action.emit({action:"view",value:e}),t.stopPropagation()},t.prototype.deactivateClicked=function(t,e){this.action.emit({action:"deactivate",value:e}),t.stopPropagation()},t.prototype.downloadClicked=function(t,e){this.action.emit({action:"download",value:e}),t.stopPropagation()},t.prototype.printClicked=function(t,e){this.action.emit({action:"print",value:e}),t.stopPropagation()},t.prototype.rowClicked=function(t,e){this.rowClick.emit(e),t.stopPropagation()},t.prototype.actionMenuClick=function(t,e,n){this.action.emit({action:n,value:e}),this.trigger.closeMenu(),t.stopPropagation()},t.prototype.actionMenuTriggerClick=function(t,e){this.trigger=e,t.stopPropagation()},t.prototype.checkEdit=function(t){return!this.config.editDisableFunction||this.config.editDisableFunction(t)},t.prototype.checkView=function(t){return!this.config.viewDisableFunction||this.config.viewDisableFunction(t)},t.prototype.checkPrint=function(t){return!this.config.printDisableFunction||this.config.printDisableFunction(t)},t.prototype.checkActions=function(t){return!this.config.actionsMenuFunction||this.config.actionsMenuFunction(t)},t.prototype.checkActionButton=function(t,e){return!this.config.actionsMenuButtonFunction||this.config.actionsMenuButtonFunction(t,e)},t.prototype.getValue=function(t,e){for(var n=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),o=0,i=n.length;o<i;++o){var r=n[o];if(!t||!(r in t))return;t=t[r]}return t},t.prototype.ngOnDestroy=function(){},t}(),t.ɵi.nextId=0,t.ɵi.decorators=[{type:e.Component,args:[{selector:"app-data-table",template:'<div fxLayout="column" [ngClass]="{\n \'mat-elevation-z1\': !config.disableElevation\n }" class="scroll-container" infiniteScroll [infiniteScrollDistance]="1" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false" [ngStyle]="config.style">\n <table mat-table [dataSource]="dataSource" matSort [id]="elementId">\n \x3c!-- Checkbox Column --\x3e\n <ng-container matColumnDef="select">\n <th mat-header-cell *matHeaderCellDef style="width:60px">\n <mat-checkbox *ngIf="selection" (change)="$event ? masterToggle() : null"\n [checked]="selection.hasValue() && isAllSelected()"\n [indeterminate]="selection.hasValue() && !isAllSelected()">\n </mat-checkbox>\n </th>\n <td mat-cell *matCellDef="let row" style="width:60px">\n <mat-checkbox *ngIf="selection" (click)="$event.stopPropagation()"\n (change)="$event ? selection.toggle(row) : null" [checked]="selection.isSelected(row)">\n </mat-checkbox>\n </td>\n </ng-container>\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef="let index = index">\n {{ (index + 1) }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef class="action-width d-print-none">\n {{ config.customActionLabel }}\n </th>\n\n <td mat-cell *matCellDef="let element; let index = index" class="d-print-none">\n <div>\n <button *ngIf="\n config.actionsConfig.download && element[config.downloadLink]\n " type="button" mat-icon-button (click)="downloadClicked($event, element)">\n <mat-icon>vertical_align_bottom</mat-icon>\n </button>\n\n <button *ngIf="config.actionsConfig.edit" [disabled]="!this.checkEdit(element)" type="button"\n mat-icon-button (click)="editClicked($event, element)">\n <mat-icon>edit</mat-icon>\n </button>\n\n <button *ngIf="config.actionsConfig.print" [disabled]="!this.checkPrint(element)" type="button"\n mat-icon-button (click)="printClicked($event,element)">\n <mat-icon>print</mat-icon>\n </button>\n\n <button *ngIf="config.actionsConfig.view" [disabled]="!this.checkView(element)" type="button"\n mat-icon-button (click)="viewClicked($event, element)">\n <mat-icon>description</mat-icon>\n </button>\n\n <button *ngIf="config.actionsConfig.deactivate" type="button" mat-icon-button\n (click)="deactivateClicked($event, element)">\n <mat-icon>delete</mat-icon>\n </button>\n\n <button #menuTrigger="matMenuTrigger" *ngIf="\n config.actionsConfig.actionsMenu &&\n this.checkActions(element) &&\n config.actionsConfig.actionsMenu.length > 0\n " type="button" mat-icon-button [matMenuTriggerFor]="actionsMenu"\n (click)="actionMenuTriggerClick($event, menuTrigger)">\n <mat-icon>more_vert</mat-icon>\n </button>\n </div>\n\n <mat-menu #actionsMenu="matMenu">\n <div *ngFor="let item of config.actionsConfig.actionsMenu">\n <button *ngIf="this.checkActionButton(element, item.value)" mat-menu-item\n (click)="actionMenuClick($event, element, item.value)">\n <span>{{ item.name }}</span>\n </button>\n </div>\n </mat-menu>\n </td>\n </ng-container>\n\n \x3c!-- Actual Columns --\x3e\n <ng-container matColumnDef="{{ column.value }}" *ngFor="let column of config.columnsConfig">\n <ng-container *ngIf="column?.sort; else noSort">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>\n {{ column.title }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th mat-header-cell *matHeaderCellDef>\n {{ column.title }}\n </th>\n </ng-template>\n <ng-container *ngIf="column.dateField; else currencyField">\n <td mat-cell *matCellDef="let element">\n <div class="text-truncate" appToolTip>\n {{ getValue(element, column.value) | date:column.format? column.format: \'mediumDate\' }}\n </div>\n </td>\n </ng-container>\n\n <ng-template #currencyField>\n <div *ngIf="column.currencyField; else normalField">\n <td mat-cell *matCellDef="let element">\n <div class="text-truncate" appToolTip>\n {{ getValue(element, column.value) | currency: "$":\'symbol\' : \'1.0-0\' }}\n </div>\n </td>\n </div>\n </ng-template>\n\n <ng-template #normalField>\n <td mat-cell *matCellDef="let element">\n <div class="text-truncate" appToolTip>\n {{ getValue(element, column.value) }}\n </div>\n </td>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf="config.stickyHeader; else normalHeader">\n <tr class="font-weight-bold" mat-header-row *matHeaderRowDef="config.displayedColumns; sticky:true"></tr>\n </ng-container>\n <ng-template #normalHeader>\n <tr class="font-weight-bold" mat-header-row *matHeaderRowDef="config.displayedColumns;">\n </tr>\n </ng-template>\n\n <div *ngIf="!config.enableRowClick">\n <tr mat-row *matRowDef="let row; columns: config.displayedColumns"></tr>\n </div>\n\n <div *ngIf="config.enableRowClick">\n <tr mat-row *matRowDef="let row; columns: config.displayedColumns" (click)="rowClicked($event, row)"\n class="hoverable row-hover"></tr>\n </div>\n </table>\n</div>',styles:["table{width:100%}.mat-table{background:inherit}.mat-column-select{overflow:initial}td.mat-cell,td.mat-footer-cell,th.mat-header-cell{padding:0 2px}.action-width{min-width:175px;width:175px!important}.noOverFlow{overflow-x:auto;overflow-y:hidden}.scroll-container{max-height:400px;overflow:auto}.mat-header-row{background-color:inherit;position:sticky;top:0}tr.row-hover:hover{background-color:#dcdcdc}td.mat-cell:first-of-type,td.mat-footer-cell:first-of-type,th.mat-header-cell:first-of-type{padding-left:24px!important}"]}]}],t.ɵi.ctorParameters=function(){return[]},t.ɵi.propDecorators={data:[{type:e.Input}],config:[{type:e.Input}],selection:[{type:e.Input}],action:[{type:e.Output}],selctionChange:[{type:e.Output}],rowClick:[{type:e.Output}],tableScroll:[{type:e.Output}],sortChanged:[{type:e.Output}],sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}],elementId:[{type:e.Input}]},t.ɵi=Q=z([r.UntilDestroy()],t.ɵi);var Z=function(){},X=function(){},tt=function(){function t(){this.remove=new e.EventEmitter}return t.prototype.ngOnInit=function(){this.initData()},t.prototype.removeFile=function(){this.remove.emit()},t.prototype.initData=function(){if(this.file){var t=this.getFileExtension(this.file);this.viewerType="ppt"===t||"pptx"===t||"doc"===t||"docx"===t||"xls"===t||"xlsx"===t?"office":"jpg"===t||"jpeg"===t||"png"===t||"gif"===t?"image":"pdf"===t?"pdf":null}},Object.defineProperty(t.prototype,"fileName",{get:function(){if(this.file){var t=this.file.split("/");return 2===t.length?t[1]:t[0]}return""},enumerable:!1,configurable:!0}),t.prototype.getFileExtension=function(t){return t.split(".").pop()},t}();tt.decorators=[{type:e.Component,args:[{selector:"app-document-viewer",template:'<mat-card *ngIf="viewerType === \'image\'">\n <img [ngStyle]="config.imageStyle" mat-card-image [src]="fileUrl" />\n <mat-card-actions>\n <button type="button" mat-raised-button (click)="removeFile()" *ngIf="!disableEdit && !config.hideRemove">\n Remove\n </button>\n </mat-card-actions>\n</mat-card>\n\n<div class="mat-elevation-z1 p-4" *ngIf="viewerType !== \'image\'">\n <a [href]="fileUrl" target="_blank">{{fileName}}</a>\n <ngx-doc-viewer [ngStyle]="config.viewerStyle" *ngIf="viewerType !== null" [url]="fileUrl" [viewer]="viewerType">\n </ngx-doc-viewer>\n <div class="mt-2" *ngIf="!config.hideRemove">\n <button type="button" mat-raised-button (click)="removeFile()" *ngIf="!disableEdit">\n Remove\n </button>\n </div>\n</div>',styles:[".image-fit{height:100%;object-fit:cover;width:100%}"]}]}],tt.ctorParameters=function(){return[]},tt.propDecorators={config:[{type:e.Input}],file:[{type:e.Input}],fileUrl:[{type:e.Input}],disableEdit:[{type:e.Input}],remove:[{type:e.Output}]};var et,nt=function(){};(et=t.LogLevel||(t.LogLevel={}))[et.Off=0]="Off",et[et.Error=1]="Error",et[et.Warning=2]="Warning",et[et.Info=3]="Info",et[et.Debug=4]="Debug";var ot=function(){function e(t){this.source=t}return e.enableProductionMode=function(){e.level=t.LogLevel.Warning},e.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.log(console.log,t.LogLevel.Debug,e)},e.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.log(console.info,t.LogLevel.Info,e)},e.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.log(console.warn,t.LogLevel.Warning,e)},e.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.log(console.error,t.LogLevel.Error,e)},e.prototype.log=function(t,n,o){var i=this;if(n<=e.level){var r=this.source?["["+this.source+"]"].concat(o):o;t.apply(console,r),e.outputs.forEach((function(t){return t.apply(t,J([i.source,n],o))}))}},e}();ot.level=t.LogLevel.Debug,ot.outputs=[];var it=function(){function t(t){this.projectKey="",this.environment="",this.authClientSecret="",this.authGrantType="",this.apiUrl="",this.loadFromMap(t)}return t.prototype.loadFromMap=function(t){this.projectKey=t.projectKey,this.environment=t.environment,this.authClientSecret=t.authClientSecret,this.authGrantType=t.authGrantType,this.apiUrl=t.apiUrl,this.storage=null==t?void 0:t.storage,this.rawConfigs=t},t}(),rt=function(){function t(t){this.config=t}return t.prototype.getConfigsRaw=function(){return this.config.rawConfigs},t.prototype.getProjectKey=function(){return this.config.projectKey},t.prototype.getApiUrl=function(){return this.config.apiUrl},t.prototype.getAuthClientSecret=function(){return this.config.authClientSecret},t.prototype.getStorage=function(){return this.config.storage?this.config.storage:localStorage},t.prototype.getAuthGrantType=function(){return this.config.authGrantType},t.prototype.getCredentialsKey=function(){return this.config.projectKey+"_"+t.BASE_CREDENTIALS},t}();rt.BASE_CREDENTIALS="credentials",rt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new rt(e.ɵɵinject(it))},token:rt,providedIn:"root"}),rt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],rt.ctorParameters=function(){return[{type:it}]};var at=function(t){this.data=t};at.decorators=[{type:e.Component,args:[{selector:"snack-bar-component-example-snack",template:'<div class="row-container">\n <span class="icon-column">\n <mat-icon class="success"> check_circle_outline</mat-icon>\n </span>\n <span class="text-column">\n {{ data }}\n </span>\n</div>',styles:[".error{color:#dc3545}.success{color:#28a745}.row-container{display:flex}.icon-column{flex:5%;padding-right:5px}.text-column{color:#fff;flex:95%;text-align:center}"]}]}],at.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[d.MAT_SNACK_BAR_DATA]}]}]};var lt=function(t){this.data=t};lt.decorators=[{type:e.Component,args:[{selector:"snack-bar-component-example-snack",template:'<div class="row-container">\n <span class="icon-column">\n <mat-icon class="error"> cancel</mat-icon>\n </span>\n <span class="text-column">\n {{ data }}\n </span>\n</div>',styles:[".error{color:#dc3545}.success{color:#28a745}.row-container{display:flex}.icon-column{flex:5%;padding-right:5px}.text-column{color:#fff;flex:95%;text-align:center}"]}]}],lt.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[d.MAT_SNACK_BAR_DATA]}]}]};var st=function(){function t(t){this.snackBar=t}return t.prototype.addAlert=function(t,e,n){void 0===n&&(n=3),"success"==e?this.snackBar.openFromComponent(at,{duration:1e3*n,data:t}):this.snackBar.openFromComponent(lt,{duration:1e3*n,data:t})},t}();st.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new st(e.ɵɵinject(d.MatSnackBar))},token:st,providedIn:"root"}),st.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],st.ctorParameters=function(){return[{type:d.MatSnackBar}]};var ct=function(){function t(t){this.alerter=t}return t.prototype.handleError=function(t,e){var n,o,i,r;void 0===e&&(e="");var a=[];if(null==t?void 0:t.error){if(null===(n=null==t?void 0:t.error)||void 0===n?void 0:n.errors)for(var l in t.error.errors){if(null===(o=t.error.errors)||void 0===o?void 0:o.hasOwnProperty(l))(null===(i=null==t?void 0:t.error)||void 0===i?void 0:i.errors[l]).forEach((function(t){return a.push(t)}))}0===a.length&&a.push(t.error.message?t.error.message:null===(r=t.error)||void 0===r?void 0:r.error)}var s=a.length?a[0]:e;this.alerter.addAlert("Error: "+s,"warning")},t}();ct.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ct(e.ɵɵinject(st))},token:ct,providedIn:"root"}),ct.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ct.ctorParameters=function(){return[{type:st}]};new ot("ErrorHandlerInterceptor");var ut=function(){function t(t,e){this.configService=t,this.errorHandler=e}return t.prototype.intercept=function(t,e){var n=this;return e.handle(t).pipe(u.catchError((function(t){return n.handleError(t)})))},t.prototype.handleError=function(t){var e,n;if(t.error instanceof ErrorEvent)"Client Error: "+(null===(e=this.configService)||void 0===e?void 0:e.getProjectKey())+": "+t.error.message;else{"Server Error: "+(null===(n=this.configService)||void 0===n?void 0:n.getProjectKey());try{this.errorHandler.handleError(t,"Unexpected Server Error, try later or contact service team")}catch(t){console.log("Unable to handle server error",t)}}return c.throwError(t)},t}();ut.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ut(e.ɵɵinject(rt),e.ɵɵinject(ct))},token:ut,providedIn:"root"}),ut.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ut.ctorParameters=function(){return[{type:rt},{type:ct}]};var dt=new ot("HttpCacheService"),pt=function(){function t(t){this.configService=t,this.cachedData={},this.storage=this.configService.getStorage(),this.cachePersistenceKey=this.configService.getProjectKey()+"_HTTP_CACHE",this.loadCacheData()}return t.prototype.setCacheData=function(t,e,n){this.cachedData[t]={lastUpdated:n||new Date,data:e},dt.debug('Cache set for key: "'+t+'"'),this.saveCacheData()},t.prototype.getCacheData=function(t){var e=this.cachedData[t];return e?(dt.debug('Cache hit for key: "'+t+'"'),e.data):null},t.prototype.getHttpCacheEntry=function(t){return this.cachedData[t]||null},t.prototype.clearCache=function(t){delete this.cachedData[t],dt.debug('Cache cleared for key: "'+t+'"'),this.saveCacheData()},t.prototype.cleanCache=function(t){var e=this;t?Object(this.cachedData).keys.forEach((function(n){var o;t>=(null===(o=e.cachedData[n])||void 0===o?void 0:o.lastUpdated)&&delete e.cachedData[n]})):this.cachedData={},this.saveCacheData()},t.prototype.setPersistence=function(t){this.cleanCache(),this.storage="local"===t?localStorage:"session"===t?sessionStorage:null,this.loadCacheData()},t.prototype.saveCacheData=function(){this.storage&&(this.storage[this.cachePersistenceKey]=JSON.stringify(this.cachedData))},t.prototype.loadCacheData=function(){var t=this.storage?this.storage[this.cachePersistenceKey]:null;this.cachedData=t?JSON.parse(t):{}},t}();pt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new pt(e.ɵɵinject(rt))},token:pt,providedIn:"root"}),pt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],pt.ctorParameters=function(){return[{type:rt}]};var mt=function(){function t(t){this.httpCacheService=t,this.forceUpdate=!1}return t.prototype.configure=function(e){var n=new t(this.httpCacheService);return e&&e.update&&(n.forceUpdate=!0),n},t.prototype.intercept=function(t,e){var n=this;return"GET"!==t.method?e.handle(t):new c.Observable((function(o){var i=n.forceUpdate?null:n.httpCacheService.getCacheData(t.urlWithParams);null!==i?(o.next(new s.HttpResponse(i)),o.complete()):e.handle(t).subscribe((function(e){e instanceof s.HttpResponse&&n.httpCacheService.setCacheData(t.urlWithParams,e),o.next(e)}),(function(t){return o.error(t)}),(function(){return o.complete()}))}))},t}();mt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new mt(e.ɵɵinject(pt))},token:mt,providedIn:"root"}),mt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],mt.ctorParameters=function(){return[{type:pt}]};var ft=function(){function t(t){this.configService=t}return t.prototype.intercept=function(t,e){return/^(http|https):/i.test(t.url)||(t=t.clone({url:this.configService.getApiUrl()+t.url})),e.handle(t)},t}();ft.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ft(e.ɵɵinject(rt))},token:ft,providedIn:"root"}),ft.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ft.ctorParameters=function(){return[{type:rt}]};var ht=function(){function t(t){this.configService=t,this._credentials=null}return Object.defineProperty(t.prototype,"isAuthenticated",{get:function(){return!!this.credentials},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credentials",{get:function(){return this._credentials||(this._credentials=JSON.parse(sessionStorage.getItem(this.configService.getCredentialsKey())||localStorage.getItem(this.configService.getCredentialsKey()))),this._credentials},enumerable:!1,configurable:!0}),t.prototype.setCredentials=function(t,e){this._credentials=t||null,t?(e?localStorage:sessionStorage).setItem(this.configService.getCredentialsKey(),JSON.stringify(t)):(sessionStorage.clear(),localStorage.clear(),this._credentials=null)},t.prototype.getAccessToken=function(){var t,e,n,o,i=(null===(e=null===(t=this.credentials)||void 0===t?void 0:t.token)||void 0===e?void 0:e.expires_in)||"",r=(null===(o=null===(n=this.credentials)||void 0===n?void 0:n.token)||void 0===o?void 0:o.access_token)||"";return r&&i?Date.now()>parseInt(i)?(this.setCredentials(),null):r:null},t.prototype.getExpiration=function(){var t,e;return(null===(e=null===(t=this.credentials)||void 0===t?void 0:t.token)||void 0===e?void 0:e.expires_in)||""},t.prototype.getRefreshToken=function(){var t,e;return(null===(e=null===(t=this.credentials)||void 0===t?void 0:t.token)||void 0===e?void 0:e.refresh_token)||""},t.prototype.refresh=function(){return this._credentials=null,this},t}();ht.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ht(e.ɵɵinject(rt))},token:ht,providedIn:"root"}),ht.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ht.ctorParameters=function(){return[{type:rt}]};var gt=function(){function t(t){this.credentials=t}return t.prototype.intercept=function(t,e){return t=t.clone({setHeaders:{Authorization:"Bearer "+(this.credentials.getAccessToken()||"")}}),e.handle(t)},t}();gt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new gt(e.ɵɵinject(ht))},token:gt,providedIn:"root"}),gt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],gt.ctorParameters=function(){return[{type:ht}]};var yt=function(){function t(){}return t.prototype.intercept=function(t,e){return t=t.clone({setHeaders:{"Content-Type":t.headers.get("Content-Type")||"application/json"}}),e.handle(t)},t}();yt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new yt},token:yt,providedIn:"root"}),yt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var vt=function(){function t(t,e){this.next=t,this.interceptor=e}return t.prototype.handle=function(t){return this.interceptor.intercept(t,this.next)},t}(),bt=new e.InjectionToken("HTTP_DYNAMIC_INTERCEPTORS"),Ct=function(t){function e(e,n,o){void 0===o&&(o=[]);var i=t.call(this,e)||this;return i.httpHandler=e,i.injector=n,i.interceptors=o,i.interceptors||(i.interceptors=[i.injector.get(ft),i.injector.get(yt),i.injector.get(gt),i.injector.get(ut)]),i}return B(e,t),e.prototype.cache=function(t){var e=this.injector.get(mt).configure({update:t});return this.addInterceptor(e)},e.prototype.skipErrorHandler=function(){return this.removeInterceptor(ut)},e.prototype.skipApiPrefix=function(){return this.removeInterceptor(ft)},e.prototype.skipToken=function(){return this.removeInterceptor(gt)},e.prototype.skipHeader=function(){return this.removeInterceptor(yt)},e.prototype.request=function(t,e,n){var o=this.interceptors.reduceRight((function(t,e){return new vt(t,e)}),this.httpHandler);return new s.HttpClient(o).request(t,e,n)},e.prototype.removeInterceptor=function(t){return new e(this.httpHandler,this.injector,this.interceptors.filter((function(e){return!(e instanceof t)})))},e.prototype.addInterceptor=function(t){return new e(this.httpHandler,this.injector,this.interceptors.concat([t]))},e}(s.HttpClient);Ct.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ct(e.ɵɵinject(s.HttpHandler),e.ɵɵinject(e.INJECTOR),e.ɵɵinject(bt,8))},token:Ct,providedIn:"root"}),Ct.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ct.ctorParameters=function(){return[{type:s.HttpHandler},{type:e.Injector},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[bt]}]}]};var xt=function(){function t(t){this.http=t}return t.prototype.getEntityFiles=function(t){return this.http.get("api/entity-files",{params:t}).toPromise()},t.prototype.createEntityFile=function(t){return this.http.post("api/entity-files",t).toPromise()},t.prototype.updateEntityFile=function(t){return this.http.put("api/entity-files/"+t.id,t).toPromise()},t.prototype.deleteEntityFile=function(t){return this.http.delete("api/entity-files/"+t.id).toPromise()},t.prototype.uploadEntityFile=function(t){var e=new FormData;return e.append("fileData",t,t.name),this.http.skipHeader().post("api/entity-files-upload",e).toPromise()},t}();xt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new xt(e.ɵɵinject(Ct))},token:xt,providedIn:"root"}),xt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],xt.ctorParameters=function(){return[{type:Ct}]};var Ft=function(){function t(){}return t.prototype.isFieldValid=function(t,e,n){return!e.get(t).valid&&e.get(t).touched||!e.get(t).valid&&e.get(t).untouched&&n},t.prototype.getErrorMessage=function(t,e,n,o){var i=Object.keys(e.get(t).errors);return i.length>0&&n[o||t][i[0]]?n[o||t][i[0]]:""},t}();Ft.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ft},token:Ft,providedIn:"root"}),Ft.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ft.ctorParameters=function(){return[]};var It={url:{required:"File is required"}},wt=function(){function t(t,e,n,o,i,r){this.dialogRef=t,this.data=e,this.formValidatorService=n,this.fb=o,this.entityFileService=i,this.alertService=r,this.fileList=[],this.createForm()}return t.prototype.createForm=function(){this.entityFileGroup=this.fb.group({id:[""],title:[""],details:[""],entity_type:[""],entity_id:[],file:["",l.Validators.required],url:["",l.Validators.required]})},t.prototype.ngOnInit=function(){var t,e;this.data.entity&&(this.entityFileGroup.get("entity_type").setValue(this.data.entity.entity_type),this.entityFileGroup.get("entity_id").setValue(this.data.entity.entity_id)),this.data.file&&(this.updateMode=!0,this.entityFileGroup.patchValue(this.data.file)),(null===(t=this.data)||void 0===t?void 0:t.hideTitleAndDetails)&&(this.hideTitleAndDetails=null===(e=this.data)||void 0===e?void 0:e.hideTitleAndDetails),this.fileConfig={fileId:"subjectFile",containerId:"subjectFileContainer",styles:{height:"200px"},multiple:!1,acceptFile:"*",maxSize:10,acceptFileText:"All Files"},this.viewerConfig={viewerStyle:{height:"200px",width:"100%"}}},t.prototype.submit=function(){return $(this,void 0,void 0,(function(){var t,e,n;return W(this,(function(o){switch(o.label){case 0:return this.assignmentFileFirstAttempt=!0,this.entityFileGroup.valid?(t=this.entityFileGroup.value,this.hideTitleAndDetails&&(t.title=t.file),this.updateMode?[4,this.entityFileService.updateEntityFile(t)]:[3,2]):[2];case 1:return n=o.sent(),[3,4];case 2:return[4,this.entityFileService.createEntityFile(t)];case 3:n=o.sent(),o.label=4;case 4:return e=n,this.dialogRef.close(e.item),this.alertService.addAlert("File submitted successfully","success"),[2]}}))}))},t.prototype.fileChanged=function(t){return $(this,void 0,void 0,(function(){var e;return W(this,(function(n){switch(n.label){case 0:return this.fileList=t,this.fileList.length>0?[4,this.entityFileService.uploadEntityFile(this.fileList[0])]:[3,2];case 1:e=n.sent(),this.entityFileGroup.get("file").setValue(e.item.file),this.entityFileGroup.get("url").setValue(e.item.url),this.fileList=[],n.label=2;case 2:return[2]}}))}))},t.prototype.removeFile=function(){return $(this,void 0,void 0,(function(){return W(this,(function(t){if(this.entityFileGroup.value.file)try{this.entityFileGroup.patchValue({file:"",url:""})}catch(t){this.alertService.addAlert("Unable to remove file, try later","warn")}return[2]}))}))},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.entityFileGroup,this.assignmentFileFirstAttempt)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.entityFileGroup,It)},t}();wt.decorators=[{type:e.Component,args:[{selector:"entity-file-form",template:'<form [formGroup]="entityFileGroup" (ngSubmit)="submit()">\n <div fxLayout="column" class="mat-typography">\n <div mat-dialog-title class="text-center">\n <div>Entity File</div>\n </div>\n\n <div mat-dialog-content fxLayout="column" fxLayoutAlign.="start">\n <ng-container *ngIf="!hideTitleAndDetails">\n <mat-form-field>\n <input type="text" matInput formControlName="title" placeholder="Title" autocomplete="off">\n </mat-form-field>\n <mat-form-field>\n <textarea matInput formControlName="details" placeholder="Details" autocomplete="off"></textarea>\n </mat-form-field>\n </ng-container>\n\n <ng-template #fileUpload>\n <section fxFlex="100%">\n <div>Entity File*</div>\n <app-file-dropper [config]="fileConfig" (fileChanged)="fileChanged($event)" [fileArray]="fileList">\n </app-file-dropper>\n <div class="text-danger" *ngIf="isFieldValid(\'url\')">\n {{getErrorMessage("url")}}\n </div>\n </section>\n </ng-template>\n\n\n <div fxFlex="100%" class="mt-2" *ngIf="entityFileGroup.get(\'url\').value;else fileUpload;">\n <app-document-viewer [file]="entityFileGroup.get(\'file\').value"\n [fileUrl]="entityFileGroup.get(\'url\').value" [config]="this.viewerConfig" (remove)="removeFile()"\n [disableEdit]="updateMode">\n </app-document-viewer>\n\n </div>\n\n <div class="mt-4 mb-2" fxLayout="row" fxLayoutGap="30px" fxLayoutAlign="end" fxFlex="100%">\n <button mat-raised-button type="button" (click)="dialogRef.close()">\n Cancel\n </button>\n <button mat-raised-button type="submit" color="primary">Save</button>\n </div>\n </div>\n </div>\n</form>',styles:[""]}]}],wt.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:Ft},{type:l.FormBuilder},{type:xt},{type:st}]},t.ɵo=function(){function t(t,e,n,o){this.entityFileService=t,this.location=e,this.alertService=n,this.dialog=o,this.viewOnly=!1,this.filters={},this.entityFiles=[],this.displayedColumns=["index","title","details","file"],this.isWorking=!1,this.search=new l.FormControl(""),this.page=1,this.perPage=25,this.lastPage=0}return t.prototype.ngOnInit=function(){var t=this;this.viewerConfig={imageStyle:{height:"200px",width:"200px"},viewerStyle:{height:" 160px",width:"200px"},hideRemove:!0},this.hideTitleAndDetails&&(this.displayedColumns=this.displayedColumns.filter((function(t){return"details"!==t&&"title"!==t}))),this.filters={entity_type:this.entityType,entity_id:this.entityId,title:""},this.search.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){t.filters.title=e,t.reload()})),this.fetchEntityFilesDetails(),this.viewOnly||this.displayedColumns.push("actions")},t.prototype.fetchEntityFilesDetails=function(){return $(this,void 0,void 0,(function(){var t;return W(this,(function(e){switch(e.label){case 0:return this.filters.page=this.page,this.isWorking=!0,[4,this.entityFileService.getEntityFiles(this.filters)];case 1:return t=e.sent(),this.lastPage=t.last_page||this.page,this.entityFiles=this.entityFiles.concat(t.data),this.isWorking=!1,[2]}}))}))},t.prototype.addEntityFile=function(){var t=this;this.dialog.open(wt,{width:"700px",data:{entity:this.filters,hideTitleAndDetails:this.hideTitleAndDetails},autoFocus:!1,restoreFocus:!1}).afterClosed().subscribe((function(e){return $(t,void 0,void 0,(function(){var t;return W(this,(function(n){return e&&((t=J(this.entityFiles)).push(e),this.entityFiles=t),[2]}))}))}))},t.prototype.editEntityFile=function(t){var e=this;this.dialog.open(wt,{width:"700px",autoFocus:!1,data:{file:t,hideTitleAndDetails:this.hideTitleAndDetails}}).afterClosed().subscribe((function(t){t&&e.reload()}))},t.prototype.deleteEntityFile=function(t){var e=this;this.dialog.open(G,{width:"400px",data:{title:"Delete File",message:"Are you sure to proceed delete the file "+t.title+"?"},autoFocus:!1}).afterClosed().subscribe((function(n){return $(e,void 0,void 0,(function(){return W(this,(function(e){switch(e.label){case 0:return n?[4,this.entityFileService.deleteEntityFile(t)]:[3,2];case 1:e.sent(),this.alertService.addAlert("File successfully deleted","success"),this.reload(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.onScroll=function(){this.page<this.lastPage&&!this.isWorking&&(this.page+=1,this.fetchEntityFilesDetails())},t.prototype.reload=function(){this.entityFiles=[],this.page=1,this.isWorking||this.fetchEntityFilesDetails()},t.prototype.ngOnDestroy=function(){},t.prototype.resetFieldValue=function(){this.search.setValue("")},t}(),t.ɵo.decorators=[{type:e.Component,args:[{selector:"app-entity-files-view-all",template:'<div fxLayout="column" fxLayoutGap="1rem" class="mat-typography p-4" *ngIf="!displayMode">\n <div fxLayout="column" fxLayoutGap="0.25rem">\n <h3 class="font-weight-bold" fxLayoutAlign="center center"> Files\n <button type="button" class="mx-1" mat-mini-fab color="primary" (click)="addEntityFile()" *ngIf="!viewOnly">\n <mat-icon>add</mat-icon>\n </button>\n </h3>\n <div fxLayout="row wrap" fxLayoutAlign="start" *ngIf="!removeSearch">\n <mat-form-field class="mt-1">\n <input type="text" matInput [formControl]="search" placeholder="Title" name="title"\n autocomplete="off" />\n <button mat-button *ngIf="filters.title" matSuffix mat-icon-button (click)="resetFieldValue()">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </div>\n <table mat-table [dataSource]="entityFiles" class="w-100" matSort multiTemplateDataRows\n infiniteScrollContainer="body" infiniteScroll [infiniteScrollDistance]="1.5" [infiniteScrollThrottle]="50"\n [fromRoot]="true" (scrolled)="onScroll()">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let element; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n \x3c!-- Title Column --\x3e\n <ng-container matColumnDef="title">\n <th mat-header-cell *matHeaderCellDef> Title </th>\n <td mat-cell *matCellDef="let element"> {{element.title}} </td>\n </ng-container>\n\n \x3c!-- Details Column --\x3e\n <ng-container matColumnDef="details">\n <th mat-header-cell *matHeaderCellDef> Details </th>\n <td mat-cell *matCellDef="let element"> {{element.details}} </td>\n </ng-container>\n\n \x3c!-- File Column --\x3e\n <ng-container matColumnDef="file">\n <th mat-header-cell *matHeaderCellDef> File </th>\n <td mat-cell *matCellDef="let element">\n <a href="{{element.url}}" target="_blank">\n <button mat-button type="button">View</button>\n </a>\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let element" style="min-width:110px">\n <button type="button" mat-icon-button (click)="editEntityFile(element)">\n <mat-icon>edit</mat-icon>\n </button>\n <button type="button" mat-icon-button (click)="deleteEntityFile(element)">\n <mat-icon>delete</mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n</div>\n\n<div fxLayout="row wrap" fxLayoutGap="1rem" class="mat-typography p-4" *ngIf="displayMode">\n\n <div *ngFor="let efile of entityFiles">\n <app-document-viewer [file]="efile.file" [fileUrl]="efile.url" [config]="this.viewerConfig"\n [disableEdit]="true">\n </app-document-viewer>\n <a href="{{efile.url}}" target="_blank">\n <button mat-button type="button">View</button>\n </a>\n </div>\n\n</div>',styles:[""]}]}],t.ɵo.ctorParameters=function(){return[{type:xt},{type:a.Location},{type:st},{type:n.MatDialog}]},t.ɵo.propDecorators={entityId:[{type:e.Input}],entityType:[{type:e.Input}],viewOnly:[{type:e.Input}],removeSearch:[{type:e.Input}],hideTitleAndDetails:[{type:e.Input}],displayMode:[{type:e.Input}]},t.ɵo=z([r.UntilDestroy()],t.ɵo);var Dt=function(){function t(t){this.alertService=t,this.fileArray=[],this.fileChanged=new e.EventEmitter,this.border="1px dashed #989898"}return t.prototype.ngOnInit=function(){this.isSingleMode=!Boolean(this.config.multiple)},t.prototype.dragEnter=function(t){t.target.style.background=this.config.dragColor||"#c0c0c0",t.target.style.border="1px dashed black",t.preventDefault()},t.prototype.dragOver=function(t){t.preventDefault()},t.prototype.dragLeave=function(t){t.target.style.background="",t.target.style.border=this.border,t.preventDefault()},t.prototype.dropEvent=function(t){t.target.style.background="",t.target.style.border=this.border;var e=t.dataTransfer.files;if(e.length>0){var n=Array.from(e);this.addFiles(n)}t.preventDefault()},t.prototype.onFileChange=function(t){if(t.target.files&&t.target.files.length){var e=Array.from(t.target.files);this.addFiles(e),document.getElementById(this.config.fileId).value=""}},t.prototype.addFiles=function(t){var e=this;this.isSingleMode?0===this.fileArray.length&&this.fileSizeAllowed(t[0])&&(this.fileArray.push(t[0]),this.fileArray.sort(this.sortFiles),this.fileChanged.emit(this.fileArray)):(t.forEach((function(t){e.fileArray=e.fileArray.filter((function(e){return e.name!==t.name})),e.fileSizeAllowed(t)&&e.fileArray.push(t)})),this.fileArray.sort(this.sortFiles),this.fileChanged.emit(this.fileArray))},t.prototype.sortFiles=function(t,e){var n=t.name.toUpperCase(),o=e.name.toUpperCase();return n<o?-1:n>o?1:0},t.prototype.fileSizeAllowed=function(t){return!Boolean(this.config.maxSize)||(t.size/1048576<this.config.maxSize||(this.alertService.addAlert("The size of the file exceeds the limit "+this.config.maxSize+" MB, kindly upload a file with size "+this.config.maxSize+" MB or below","warn"),!1))},t.prototype.clickEvent=function(t){this.isSingleMode&&this.fileArray.length>0||document.getElementById(this.config.fileId).click(),t.preventDefault()},t}();Dt.decorators=[{type:e.Component,args:[{selector:"app-file-dropper",template:'<div\n id="{{ config.containerId }}"\n [ngStyle]="config.styles"\n class="file-border"\n (dragleave)="dragLeave($event)"\n (dragenter)="dragEnter($event)"\n (dragover)="dragOver($event)"\n (click)="clickEvent($event)"\n (drop)="dropEvent($event)"\n [ngClass]="{ \'disable-div\': isSingleMode && fileArray.length > 0 }"\n>\n <div fxFill fxLayout="column" fxLayoutAlign="center center">\n <div>\n <span>Drag and drop file</span>\n </div>\n\n <div class="mt-2">\n <span>or</span>\n </div>\n\n <div class="mt-2">\n <button mat-raised-button color="primary" type="button">Browse</button>\n </div>\n\n <div class="mt-4">\n <span>Supported files</span>\n </div>\n\n <div *ngIf="config.acceptFileText">\n <span>{{ config.acceptFileText }}</span>\n </div>\n </div>\n</div>\n<input\n type="file"\n id="{{ config.fileId }}"\n [accept]="config.acceptFile"\n (change)="onFileChange($event)"\n [multiple]="config.multiple === true"\n style="display:none"\n/>\n',styles:[".disable-div{cursor:not-allowed}.file-border{border:1px dashed #989898}"]}]}],Dt.ctorParameters=function(){return[{type:st}]},Dt.propDecorators={fileArray:[{type:e.Input}],config:[{type:e.Input}],fileChanged:[{type:e.Output}],styles:[{type:e.Input}]};var St=function(){},Mt=function(){function t(t){this.http=t}return t.prototype.getNotes=function(t){return this.http.get("api/notes",{params:t}).toPromise()},t.prototype.addNote=function(t){return this.http.post("api/notes",t).toPromise()},t.prototype.editNote=function(t){return this.http.put("api/notes/"+t.id,t).toPromise()},t.prototype.deleteNote=function(t){return this.http.delete("api/notes/"+t.id).toPromise()},t}();Mt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Mt(e.ɵɵinject(Ct))},token:Mt,providedIn:"root"}),Mt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Mt.ctorParameters=function(){return[{type:Ct}]};var _t={note:{required:"Note is required"}},Tt=function(){function t(t,e,n,o,i,r){this.dialogRef=t,this.data=e,this.fb=n,this.formValidatorService=o,this.alertService=i,this.noteService=r,this.createForm()}return t.prototype.createForm=function(){this.noteFormGroup=this.fb.group({id:[""],note:["",l.Validators.compose([l.Validators.required])],model_type:[""],related_model_id:[""]})},t.prototype.ngOnInit=function(){this.data.update&&(this.updateMode=!0),this.noteFormGroup.patchValue(this.data.note)},t.prototype.submit=function(){var t;return $(this,void 0,void 0,(function(){var e,n,o;return W(this,(function(i){switch(i.label){case 0:return this.noteFormFirstAttempt=!0,this.noteFormGroup.valid?(e=this.noteFormGroup.value,this.updateMode?[4,this.noteService.editNote(e)]:[3,2]):[3,5];case 1:return o=i.sent(),[3,4];case 2:return[4,this.noteService.addNote(e)];case 3:o=i.sent(),i.label=4;case 4:n=o,this.alertService.addAlert((null===(t=this.data)||void 0===t?void 0:t.labelText)+" saved successfully","success"),this.dialogRef.close(n),i.label=5;case 5:return[2]}}))}))},t.prototype.cancel=function(){this.dialogRef.close()},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.noteFormGroup,this.noteFormFirstAttempt)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.noteFormGroup,_t)},t}();Tt.decorators=[{type:e.Component,args:[{selector:"app-note-form",template:'<form [formGroup]="noteFormGroup" (ngSubmit)="submit()">\n <div fxLayout="column" class="mat-typography">\n <div mat-dialog-title class="text-center">\n <div>{{data?.labelText}}</div>\n </div>\n\n <div mat-dialog-content fxLayout="column">\n <div fxLayout="row wrap" fxLayoutAlign="space-between">\n <mat-form-field fxFlex="100%">\n <textarea matInput formControlName="note" placeholder="{{data?.labelText}}" autocomplete="off"\n required></textarea>\n <mat-error *ngIf="isFieldValid(\'note\')">{{\n getErrorMessage("note")\n }}</mat-error>\n </mat-form-field>\n\n <div class="my-2" fxLayout="row" fxLayoutGap="30px" fxLayoutAlign="end" fxFlex="100%">\n <button mat-raised-button type="button" (click)="cancel()">\n Cancel\n </button>\n <button mat-raised-button type="submit" color="primary">Save</button>\n </div>\n </div>\n </div>\n </div>\n</form>',styles:[""]}]}],Tt.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:l.FormBuilder},{type:Ft},{type:st},{type:Mt}]};var Lt=function(){function t(t,e){this.noteService=t,this.dialog=e,this.readonly=!1,this.labelText="Note",this.commentsView=!1,this.notes=[],this.displayedColumns=["index","note","actions"],this.page=1,this.lastPage=1,this.filters={},this.filters.sort_by="created_at|DESC"}return t.prototype.ngOnInit=function(){this.readonly&&(this.displayedColumns=this.displayedColumns.filter((function(t){return"actions"!==t}))),this.filters.related_model_id=this.relatedModelId,this.filters.model_type=this.modelType,this.loadData()},t.prototype.loadData=function(){return $(this,void 0,void 0,(function(){var t;return W(this,(function(e){switch(e.label){case 0:return[4,this.noteService.getNotes(Object.assign(Object.assign({},this.filters),{page:this.page}))];case 1:return t=e.sent(),this.notes=this.notes.concat(t.data),this.page=t.current_page,this.lastPage=t.last_page,[2]}}))}))},t.prototype.addNote=function(){var t=this;this.dialog.open(Tt,{width:"400px",data:{note:{related_model_id:this.relatedModelId,model_type:this.modelType},labelText:this.labelText},autoFocus:!1}).afterClosed().subscribe((function(e){e&&(t.resetScroll(),t.loadData())}))},t.prototype.editNote=function(t){var e=this;this.dialog.open(Tt,{width:"400px",data:{note:t,update:!0,labelText:this.labelText},autoFocus:!1}).afterClosed().subscribe((function(t){t&&(e.resetScroll(),e.loadData())}))},t.prototype.deleteNote=function(t){return $(this,void 0,void 0,(function(){var e=this;return W(this,(function(n){return this.dialog.open(G,{width:"400px",data:{title:"Delete "+this.labelText,message:"Are you sure to delete?"},autoFocus:!1}).afterClosed().subscribe((function(n){return $(e,void 0,void 0,(function(){return W(this,(function(e){switch(e.label){case 0:return n?[4,this.noteService.deleteNote(t)]:[3,2];case 1:e.sent(),this.notes=this.notes.filter((function(e){return e.id!==t.id})),e.label=2;case 2:return[2]}}))}))})),[2]}))}))},t.prototype.resetScroll=function(){this.page=1,this.lastPage=1,this.notes=[]},t.prototype.onScroll=function(){this.page<this.lastPage&&(this.page+=1,this.loadData())},t.prototype.commentAction=function(t){if("save"===t.type)return t.value.id?void this.editComment(t.value):void this.addComment(t.value);this.deleteNote(t.value)},t.prototype.editComment=function(t){return $(this,void 0,void 0,(function(){var e,n;return W(this,(function(o){switch(o.label){case 0:return[4,this.noteService.editNote(t)];case 1:return e=o.sent(),-1!==(n=this.notes.findIndex((function(e){return e.id===t.id})))&&(this.notes[n]=e.item),[2]}}))}))},t.prototype.addComment=function(t){return $(this,void 0,void 0,(function(){var e;return W(this,(function(n){switch(n.label){case 0:return t.related_model_id=this.relatedModelId,t.model_type=this.modelType,[4,this.noteService.addNote(t)];case 1:return e=n.sent(),this.notes.push(e.item),[2]}}))}))},t}();Lt.decorators=[{type:e.Component,args:[{selector:"app-note-list",template:'<div fxLayout="column" fxLayoutGap="1.5rem" class="m-4" *ngIf="!commentsView">\n\n <div fxLayout fxLayoutAlign="center center" fxLayoutGap="1rem">\n <h3 class="m-0 font-weight-bold mr-3">{{labelText}}s</h3>\n <button class="d-print-none" *ngIf="!readonly" mat-raised-button color="primary" type="button" (click)="addNote()">+\n Add</button>\n </div>\n\n <div class="w-100 scroll-container" infiniteScroll [infiniteScrollDistance]="1" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="notes" class="w-100" multiTemplateDataRows>\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let note; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n\n <ng-container matColumnDef="note">\n <th mat-header-cell *matHeaderCellDef> {{labelText}} </th>\n <td mat-cell *matCellDef="let note">\n {{note?.note}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef class="d-print-none"> Actions </th>\n <td mat-cell *matCellDef="let note" class="d-print-none">\n <button type="button" mat-icon-button (click)="editNote(note)">\n <mat-icon>edit</mat-icon>\n </button>\n <button type="button" mat-icon-button (click)="deleteNote(note)">\n <mat-icon>delete</mat-icon>\n </button>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n\n</div>\n\n<div fxLayout="column" fxLayoutGap="1.5rem" *ngIf="commentsView">\n <div fxLayout fxLayoutAlign="center center" fxLayoutGap="1rem">\n <h3 class="m-0 font-weight-bold mr-3">{{labelText}}s</h3>\n </div>\n\n <div fxLayout="column" fxLayoutAlign="start" fxFlex="100%">\n <div class="w-100 scroll-container jumbotron" infiniteScroll [infiniteScrollDistance]="1"\n [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false">\n <app-comment-form [commentData]="comment" (action)="commentAction($event)" *ngFor="let comment of notes">\n </app-comment-form>\n <app-comment-form (action)="commentAction($event)"></app-comment-form>\n </div>\n </div>\n</div>\n',styles:[".scroll-container{max-height:400px;overflow-y:auto}"]}]}],Lt.ctorParameters=function(){return[{type:Mt},{type:n.MatDialog}]},Lt.propDecorators={relatedModelId:[{type:e.Input}],modelType:[{type:e.Input}],readonly:[{type:e.Input}],labelText:[{type:e.Input}],commentsView:[{type:e.Input}]};var kt,At=function(){function t(t,n){this.fb=t,this.credentialService=n,this.action=new e.EventEmitter,this.createForm()}return Object.defineProperty(t.prototype,"commentData",{set:function(t){this.view=!!t,this._commentData=t,this.commentFormGroup.patchValue(t)},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},Object.defineProperty(t.prototype,"isLoggedIn",{get:function(){return this.credentialService.isAuthenticated},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentUser",{get:function(){return this.credentialService.credentials.user},enumerable:!1,configurable:!0}),t.prototype.createForm=function(){this.commentFormGroup=this.fb.group({id:[""],note:[""],model_type:[""],related_model_id:[""]})},t.prototype.submit=function(){this.commentFormGroup.get("note").value?(this._commentData&&(this.view=!this.view),this.action.emit({type:"save",value:this.commentFormGroup.value}),this.commentFormGroup.reset()):this.commentFormGroup.get("id").value&&this.deleteComment()},t.prototype.hideEdit=function(){this.commentFormGroup.get("id").value&&(this.view=!this.view)},t.prototype.editComment=function(){this.view=!this.view,this.commentFormGroup.patchValue(this._commentData)},t.prototype.deleteComment=function(){this.action.emit({type:"delete",value:this.commentFormGroup.value})},t.prototype.ngOnDestroy=function(){},t}();At.decorators=[{type:e.Component,args:[{selector:"app-comment-form",template:'<form (ngSubmit)="submit()" [formGroup]="commentFormGroup">\n <div fxLayout="column" class="my-2" [ngClass]="{ \'border border-primary shadow rounded \': view}">\n <div *ngIf="!view" fxLayout="column">\n <mat-form-field appearance="outline" style="background-color:white;">\n <mat-label>Comment</mat-label>\n <textarea matInput rows="5" placeholder="Add a comment..." formControlName="note" autocomplete="off"></textarea>\n </mat-form-field>\n\n <div fxLayout fxLayoutGap="1rem" class="mt-2">\n <span fxFlex></span>\n <button *ngIf="_commentData" mat-button type="button" (click)="view = !view">\n Cancel\n </button>\n <button mat-raised-button color="primary" type="submit">\n {{ _commentData ? "Update" : "Post comment" }}\n </button>\n </div>\n </div>\n\n <div fxLayout="column" *ngIf="view" class="p-2 m-2">\n <div fxLayout="row wrap" fxLayoutGap=".5rem">\n <div fxFlex="20%" fxLayoutAlign="start">\n <button mat-icon-button type="button" style="color:grey">\n <mat-icon style="font-size:60px">account_circle</mat-icon>\n </button>\n </div>\n <div fxFlex="75%">\n <div fxLayout="column" fxLayoutGap=".5rem">\n <div class="font-weight-bold">{{ _commentData?.creator?.name }}</div>\n <div class="text-muted">{{ _commentData.updated_at | date:\'medium\' }}</div>\n </div>\n </div>\n </div>\n <app-read-more class="mt-2" [text]="_commentData.note"></app-read-more>\n <div fxLayout class="mt-1" fxLayoutGap="1rem" *ngIf="isLoggedIn && currentUser.id === _commentData.creator_id">\n <a href="javascript:;" (click)="editComment()">\n Edit\n </a>\n <a href="javascript:;" (click)="deleteComment()">\n Delete\n </a>\n </div>\n </div>\n </div>\n</form>',styles:[":host ::ng-deep .mat-form-field-wrapper{margin:0!important;padding-bottom:0!important}"]}]}],At.ctorParameters=function(){return[{type:l.FormBuilder},{type:ht}]},At.propDecorators={commentData:[{type:e.Input}],action:[{type:e.Output}]},t.ɵx=kt=function(){function t(t,n,o,i,r,a){var l=this;this._focusMonitor=n,this.http=o,this._elementRef=i,this.dialog=r,this.ngControl=a,this.valueField="id",this.titleField="title",this.multiple=!1,this.selectedValueChange=new e.EventEmitter,this.enableSearch=!0,this.add=!1,this.edit=!1,this.sort=!0,this.items=[],this.selectionChange=new e.EventEmitter,this.itemsChange=new e.EventEmitter,this.isLoading=!1,this.onChange=function(){},this.onTouched=function(){},this.stateChanges=new c.Subject,this.focused=!1,this.controlType="searchable-selctor",this.id="searchable-selctor-"+kt.nextId++,this.describedBy="",this._required=!1,this._disabled=!1,this.selectorForm=t.group({select_value:[null],search:""}),n.monitor(i,!0).subscribe((function(t){l.focused&&!t&&l.onTouched(),l.focused=!!t,l.stateChanges.next()})),null!=this.ngControl&&(this.ngControl.valueAccessor=this)}return Object.defineProperty(t.prototype,"empty",{get:function(){return!this.selectorForm.value.select_value},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldLabelFloat",{get:function(){return this.focused||!this.empty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this.selectorForm.get("select_value").setValidators(l.Validators.required),this._required=m.coerceBooleanProperty(t),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=m.coerceBooleanProperty(t),this._disabled?this.selectorForm.disable():this.selectorForm.enable(),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.selectorForm.valid?this.selectorForm.value.select_value:""},set:function(t){this.selectorForm.patchValue({select_value:t||""}),this.stateChanges.next()},enumerable:!1,configurable:!0}),t.prototype.openedChange=function(t){0===this.dataItems.length&&this.selectorForm.get("search").value&&this.selectorForm.get("search").setValue("")},Object.defineProperty(t.prototype,"dataItems",{get:function(){var t=this,e=[];return e=(e=this.multiple&&this.selectedValue&&this.selectedValue.length>0?J(this.selectedValue,this.items):!this.multiple&&this.selectedValue?J([this.selectedValue],this.items):this.items).filter((function(e,n,o){return o.findIndex((function(e){return e[t.valueField]===o[n][t.valueField]}))===n})),this.itemsChange.emit(e),e},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.selectorForm.get("search").valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){t.enableSearch&&t.search(e)})),this.filters={perPage:25,search:"",page:1,lastPage:1},this.sort&&(this.filters.sort_by=this.sortBy||this.titleField+"|asc"),0===this.items.length&&this.fetchItemList()},t.prototype.fetchItemList=function(){var t=this;this.isLoading=!0,c.of().pipe(u.startWith(!0),u.switchMap((function(e){return c.from(t.http.get(t.apiUrl,{params:t.filters}))})),u.finalize((function(){return t.isLoading=!1})),r.untilDestroyed(this)).subscribe((function(e){t.items=t.items.concat(e.data),t.filters.page=e.current_page,t.filters.lastPage=e.last_page}))},t.prototype.setDescribedByIds=function(t){this.describedBy=t.join(" ")},t.prototype.onContainerClick=function(t){t.stopPropagation()},t.prototype.writeValue=function(t){this.value=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.getPropertyValue=function(t,e){for(var n=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),o=0,i=n.length;o<i;++o){var r=n[o];if(!t||!(r in t))return;t=t[r]}return t},t.prototype._handleInput=function(){var t=this;this.onChange(this.value),this.multiple?this.selectedValue=this.value.map((function(e){return t.dataItems.find((function(n){return n[t.valueField]===e}))})):this.selectedValue=this.dataItems.find((function(e){return e[t.valueField]===t.value})),this.selectedValueChange.emit(this.selectedValue),this.selectionChange.emit(this.value)},Object.defineProperty(t.prototype,"errorState",{get:function(){return this.ngControl&&this.ngControl.invalid&&(this.ngControl.touched||this.ngControl.dirty)},enumerable:!1,configurable:!0}),t.prototype.onScroll=function(){this.filters.lastPage>this.filters.page&&(this.filters.page+=1,this.fetchItemList())},t.prototype.reloadData=function(){this.items=[],this.filters.page=1,this.filters.lastPage=1,this.fetchItemList()},t.prototype.search=function(t){this.searchField?this.filters[this.searchField]=t:this.filters.search=t,this.reloadData()},t.prototype.addItem=function(t){var e=this;this.dialog.open(this.itemComponent,Object.assign({width:"400px",autoFocus:!1,data:{}},this.addConfig)).afterClosed().subscribe((function(t){t&&(e.items.push(t.item),e.selectorForm.get("select_value").setValue(t.item[e.valueField]),e._handleInput())})),t.stopPropagation()},t.prototype.editItem=function(t){var e=this;this.dialog.open(this.itemComponent,Object.assign({width:"400px",autoFocus:!1,data:{item:this.selectedValue}},this.editConfig)).afterClosed().subscribe((function(t){t&&(e.items=e.items.filter((function(t){return t[e.valueField]!==e.selectedValue[e.valueField]})),e.items.push(t.item),e.selectedValue=null,e.selectorForm.get("select_value").setValue(t.item[e.valueField]),e._handleInput())})),t.stopPropagation()},t.prototype.ngOnDestroy=function(){this.stateChanges.complete(),this._focusMonitor.stopMonitoring(this._elementRef)},t}(),t.ɵx.nextId=0,t.ɵx.decorators=[{type:e.Component,args:[{selector:"app-searchable-selector",template:'<div [formGroup]="selectorForm" class="searchable-selctor-container">\n <mat-select formControlName="select_value" focused="false" [multiple]="multiple" [required]="required"\n autocomplete="off" (selectionChange)="_handleInput()" msInfiniteScroll (infiniteScroll)="onScroll()"\n (openedChange)="openedChange($event)">\n <mat-form-field *ngIf="enableSearch" class="p-1 w-100">\n <input matInput formControlName="search" placeholder="Search..." (keydown)="$event.stopPropagation();"\n autocomplete="off">\n </mat-form-field>\n <div>\n \x3c!-- TODO:Implement scroll only for options and have search fixed --\x3e\n <mat-option *ngFor=" let item of dataItems" [value]="getPropertyValue(item,valueField)">\n {{getPropertyValue(item,titleField)}}\n </mat-option>\n </div>\n <div fxlayout="column" class="w-100" fxLayoutAlign="center center">\n <mat-spinner class="my-4" color="primary" diameter="30" *ngIf="isLoading"></mat-spinner>\n </div>\n </mat-select>\n <mat-icon *ngIf="add" class="relative-icon" matSuffix (click)="addItem($event)">add_circle_outline</mat-icon>\n <mat-icon *ngIf="edit && selectedValue" class="relative-icon" matSuffix (click)="editItem($event)">edit</mat-icon>\n</div>',providers:[{provide:f.MatFormFieldControl,useExisting:kt}],styles:[".searchable-selctor-container{display:flex}.relative-icon{position:relative;top:-4px}"]}]}],t.ɵx.ctorParameters=function(){return[{type:l.FormBuilder},{type:p.FocusMonitor},{type:Ct},{type:e.ElementRef},{type:n.MatDialog},{type:l.NgControl,decorators:[{type:e.Optional},{type:e.Self}]}]},t.ɵx.propDecorators={valueField:[{type:e.Input}],titleField:[{type:e.Input}],apiUrl:[{type:e.Input}],multiple:[{type:e.Input}],selectedValue:[{type:e.Input}],selectedValueChange:[{type:e.Output}],enableSearch:[{type:e.Input}],add:[{type:e.Input}],addConfig:[{type:e.Input}],edit:[{type:e.Input}],editConfig:[{type:e.Input}],sort:[{type:e.Input}],sortBy:[{type:e.Input}],searchField:[{type:e.Input}],itemComponent:[{type:e.Input}],items:[{type:e.Input}],selectionChange:[{type:e.Output}],itemsChange:[{type:e.Output}],required:[{type:e.Input}],disabled:[{type:e.Input}],value:[{type:e.Input}]},t.ɵx=kt=z([r.UntilDestroy()],t.ɵx);var Et=function(){function t(t,n){this.matSelect=t,this.ngZone=n,this.threshold="15%",this.debounceTime=150,this.infiniteScroll=new e.EventEmitter,this.thrPx=0,this.thrPc=0,this.singleOptionHeight=h.SELECT_ITEM_HEIGHT_EM,this.destroyed$=new c.Subject}return t.prototype.ngOnInit=function(){this.evaluateThreshold()},t.prototype.ngAfterViewInit=function(){var t=this;this.matSelect.openedChange.pipe(u.takeUntil(this.destroyed$)).subscribe((function(e){e&&(t.panel=t.matSelect.panel.nativeElement,t.singleOptionHeight=t.getSelectItemHeightPx(),t.registerScrollListener())}))},t.prototype.ngOnDestroy=function(){this.destroyed$.next(!0),this.destroyed$.complete()},t.prototype.evaluateThreshold=function(){this.threshold.lastIndexOf("%")>-1?(this.thrPx=0,this.thrPc=parseFloat(this.threshold)/100):(this.thrPx=parseFloat(this.threshold),this.thrPc=0)},t.prototype.registerScrollListener=function(){var t=this;c.fromEvent(this.panel,"scroll").pipe(u.takeUntil(this.destroyed$),u.debounceTime(this.debounceTime),u.tap((function(e){t.handleScrollEvent(e)}))).subscribe()},t.prototype.handleScrollEvent=function(t){var e=this;this.ngZone.runOutsideAngular((function(){if(!e.complete){var n=e.matSelect.options.length,o=e.singleOptionHeight*n,i=0!==e.thrPc?o*e.thrPc:e.thrPx;e.panel.clientHeight+t.target.scrollTop+i>=o&&e.ngZone.run((function(){return e.infiniteScroll.emit()}))}}))},t.prototype.getSelectItemHeightPx=function(){return parseFloat(getComputedStyle(this.panel).fontSize)*h.SELECT_ITEM_HEIGHT_EM},t}();Et.decorators=[{type:e.Directive,args:[{selector:"[msInfiniteScroll]"}]}],Et.ctorParameters=function(){return[{type:h.MatSelect},{type:e.NgZone}]},Et.propDecorators={threshold:[{type:e.Input}],debounceTime:[{type:e.Input}],complete:[{type:e.Input}],infiniteScroll:[{type:e.Output}]};var Vt=function(){function t(){this.numItemsChange=new e.EventEmitter}return t.prototype.numItemsChanged=function(){this.numItemsChange.emit(this.numItems)},t}();Vt.decorators=[{type:e.Component,args:[{selector:"num-items-selector",template:'<select [(ngModel)]="numItems" class="form-control" id="numItems" name="numItems" (change)="numItemsChanged()">\r\n <option value="25">25</option>\r\n <option value="50">50</option>\r\n <option value="100">100</option>\r\n <option value="250">250</option>\r\n <option value="500">500</option>\r\n <option value="1000">1000</option>\r\n <option value="2000">2000</option>\r\n <option value="3000">3000</option>\r\n <option value="4000">4000</option>\r\n <option value="5000">5000</option>\r\n <option value="5000000000">All</option>\r\n</select> '}]}],Vt.ctorParameters=function(){return[]},Vt.propDecorators={numItems:[{type:e.Input}],numItemsChange:[{type:e.Output}]};var Ut=function(){function t(){}return t.prototype.getYYYYMMDDString=function(t){return t.getFullYear()+"-"+(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-"+(t.getDate()<10?"0"+t.getDate():t.getDate())},t.prototype.getYYYY=function(t){return t.getFullYear()},t.prototype.getMM=function(t){return t.getMonth()+1},t.prototype.getDateTime=function(t){return t.getFullYear()+"-"+(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-"+(t.getDate()<10?"0"+t.getDate():t.getDate())+" "+t.toLocaleTimeString()},t}();Ut.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ut},token:Ut,providedIn:"root"}),Ut.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var Pt=function(){function t(){this.items=new Array,this.selectedValueChange=new e.EventEmitter}return t.prototype.numChanged=function(){this.selectedValueChange.emit(this.selectedValue)},t.prototype.ngOnInit=function(){for(var t=this.start_value;t<this.end_value+1;t++)this.items.push(t)},t}();function jt(t){var e=new Date,n={date_from:e,date_to:e,show_custom_field:!1};switch(t){case 1:n.show_custom_field=!0;break;case 2:n.date_from=e,n.date_to=e;break;case 3:var o=new Date(e);o.setDate(o.getDate()-1),n.date_from=o,n.date_to=o;break;case 4:var i=e.getDate()-e.getDay()+1,r=i+6;n.date_from=new Date(e.setDate(i)),n.date_to=new Date(e.setDate(r));break;case 5:var a=(s=new Date).setTime(s.getTime()-24*(s.getDay()?s.getDay():7)*60*60*1e3),l=s.setTime(s.getTime()-5184e5);n.date_from=new Date(l),n.date_to=new Date(a);break;case 6:n.date_from=new Date(e.getFullYear(),e.getMonth(),1),n.date_to=new Date(e.getFullYear(),e.getMonth()+1,0);break;case 7:var s;(s=new Date).setDate(1),s.setHours(-1),n.date_from=new Date(e.getFullYear(),e.getMonth()-1,1),n.date_to=s;break;case 8:var c=Math.floor(e.getMonth()/3),u=new Date(e.getFullYear(),3*c,1),d=new Date(u.getFullYear(),u.getMonth()+3,0);n.date_from=u,n.date_to=d;break;case 9:c=Math.floor(e.getMonth()/3),u=new Date(e.getFullYear(),3*c-3,1),d=new Date(u.getFullYear(),u.getMonth()+3,0);n.date_from=u,n.date_to=d;break;case 10:n.date_from=new Date("1/1/"+(new Date).getFullYear()),n.date_to=new Date("12/31/"+(new Date).getFullYear());break;case 11:n.date_from=new Date("1/1/"+((new Date).getFullYear()-1)),n.date_to=new Date("12/31/"+((new Date).getFullYear()-1));break;default:n.date_from="",n.date_to=""}return n}Pt.decorators=[{type:e.Component,args:[{selector:"number-selector",template:'<div class="number-selector-wrapper">\n <select name="selectedValue" [(ngModel)]="selectedValue" class="form-control" (change)="numChanged()">\n <option value="">-- Student Status --</option>\n <option *ngFor="let start_value of items;" value="{{start_value}}">{{start_value}}</option>\n </select>\n</div>'}]}],Pt.ctorParameters=function(){return[]},Pt.propDecorators={start_value:[{type:e.Input}],end_value:[{type:e.Input}],selectedValueChange:[{type:e.Output}],selectedValue:[{type:e.Input}]};var Ot,Rt=function(){};Rt.CUSTOM=1,Rt.TODAY=2,Rt.YESTERDAY=3,Rt.THIS_WEEK=4,Rt.LAST_WEEK=5,Rt.THIS_MONTH=6,Rt.LAST_MONTH=7,Rt.THIS_QUARTER=8,Rt.LAST_QUARTER=9,Rt.THIS_YEAR=10,Rt.LAST_YEAR=11,Rt.ALL=12,t.ɵbb=Ot=function(){function t(t,n,o){this.ngControl=n,this.datePipe=o,this.timelineValue=new l.FormControl(""),this.timelines=[{value:1,viewValue:"Custom"},{value:2,viewValue:"Today"},{value:3,viewValue:"Yesterday"},{value:4,viewValue:"This Week"},{value:5,viewValue:"Last Week"},{value:6,viewValue:"This Month"},{value:7,viewValue:"Last Month"},{value:8,viewValue:"This Quarter"},{value:9,viewValue:"Last Quarter"},{value:10,viewValue:"This Year"},{value:11,viewValue:"Last Year"},{value:12,viewValue:"All dates"}],this.dateFrom="date_from",this.dateTo="date_to",this.appearance="legacy",this.showClearbutton=!1,this.form=null,this.labelText="Select Timeline",this.touchUi=!0,this.selectedValueChange=new e.EventEmitter,this.selectionChange=new e.EventEmitter,this.onChange=function(){},this.onTouched=function(){},this.stateChanges=new c.Subject,this.controlType="timeline-filter",this.id="timeline-filter-"+Ot.nextId++,this.describedBy="",this.showCustomDateFields=!1,this._required=!1,this._disabled=!1,this.selectorForm=t.group({select_value:[null]}),null!=this.ngControl&&(this.ngControl.valueAccessor=this)}return Object.defineProperty(t.prototype,"defaultValue",{set:function(t){this.timelineValue.setValue(t),this.changeTimeline(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this.selectorForm.get("select_value").setValidators(l.Validators.required),this._required=m.coerceBooleanProperty(t),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=m.coerceBooleanProperty(t),this._disabled?this.selectorForm.disable():this.selectorForm.enable(),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.selectorForm.valid?this.selectorForm.value.select_value:""},set:function(t){this.selectorForm.patchValue({select_value:t||""}),this._handleInput(),this.stateChanges.next()},enumerable:!1,configurable:!0}),t.prototype.getDateRangeString=function(){var t,e,n,o,i,r,a,l="";return(null===(t=this.selectedRange)||void 0===t?void 0:t.show_custom_field)&&("Invalid Date"!=(null===(e=this.selectedRange)||void 0===e?void 0:e.date_from.toUTCString())&&(l+=" - "+this.datePipe.transform(null===(o=null===(n=this.selectedRange)||void 0===n?void 0:n.date_from)||void 0===o?void 0:o.toUTCString())),"Invalid Date"!=(null===(i=this.selectedRange)||void 0===i?void 0:i.date_to.toUTCString())&&(l+=" - "+this.datePipe.transform(null===(a=null===(r=this.selectedRange)||void 0===r?void 0:r.date_to)||void 0===a?void 0:a.toUTCString()))),l},t.prototype.resetFieldValue=function(t){this.form.get(t).setValue("")},t.prototype.getFieldValue=function(t){return this.form.get(t).value},t.prototype.setFieldValue=function(t,e){this.form.get(t).setValue(e)},t.prototype.changeTimeline=function(t){var e=jt(t);e&&(this.setFieldValue(this.dateFrom,e.date_from),this.setFieldValue(this.dateTo,e.date_to),this.showCustomDateFields=e.show_custom_field)},t.prototype._handleInput=function(){if(1!=this.value){var t=jt(this.value);this.selectedRange=t,this.onChange(this.value),this.selectedValueChange.emit(this.selectedValue),this.selectionChange.emit(t)}else this.picker.open()},t.prototype.dateRangeChange=function(t,e){var n={date_from:new Date(t.value),date_to:new Date(e.value),show_custom_field:!0};this.selectedRange=n,this.onChange(this.value),this.selectedValueChange.emit(this.selectedValue),this.selectionChange.emit(n)},t.prototype.onCustomDateChange=function(t){console.log(t)},t.prototype.setDescribedByIds=function(t){this.describedBy=t.join(" ")},t.prototype.onContainerClick=function(t){t.stopPropagation()},t.prototype.writeValue=function(t){this.value=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.ngOnInit=function(){var t=this;console.log(this.form),this.timelineValue.valueChanges.pipe(u.debounceTime(100),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){return t.changeTimeline(e)}))},t.prototype.ngOnDestroy=function(){this.stateChanges.complete()},t}(),t.ɵbb.nextId=0,t.ɵbb.decorators=[{type:e.Component,args:[{selector:"app-timeline-filter",template:'<ng-container *ngIf="form" [formGroup]="form">\n <mat-form-field [appearance]="appearance">\n <mat-label>{{labelText}}</mat-label>\n <mat-select [formControl]="timelineValue">\n <mat-option *ngFor="let timeline of timelines" [value]="timeline.value">\n {{timeline.viewValue}}\n </mat-option>\n </mat-select>\n <button mat-button *ngIf="showClearbutton && timelineValue.value" matSuffix mat-icon-button\n (click)="timelineValue.setValue(\'\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <ng-container *ngIf="showCustomDateFields">\n <mat-form-field [appearance]="appearance">\n <mat-label>From Date</mat-label>\n <input matInput formControlName="{{dateFrom}}" [matDatepicker]="fromPicker" (click)="fromPicker.open()"\n placeholder="From Date" readonly />\n <mat-datepicker-toggle matSuffix [for]="fromPicker"></mat-datepicker-toggle>\n <mat-datepicker #fromPicker></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(dateFrom)" matSuffix mat-icon-button\n (click)="resetFieldValue(dateFrom)">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field [appearance]="appearance">\n <mat-label>To Date</mat-label>\n <input matInput formControlName="{{dateTo}}" [matDatepicker]="toPicker" (click)="toPicker.open()"\n placeholder="To Date" readonly />\n <mat-datepicker-toggle matSuffix [for]=""></mat-datepicker-toggle>\n <mat-datepicker #toPicker></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(dateTo)" matSuffix mat-icon-button\n (click)="resetFieldValue(dateTo)">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n </ng-container>\n</ng-container>\n<div *ngIf="!form" [formGroup]="selectorForm">\n <mat-select formControlName="select_value" focused="false" [required]="required"\n autocomplete="off" (selectionChange)="_handleInput()">\n <mat-option *ngFor="let timeline of timelines" [value]="timeline?.value">\n {{ timeline?.viewValue }} {{ selectedRange?.show_custom_field && timeline?.value == 1 ? getDateRangeString() : \'\' }}\n </mat-option>\n </mat-select>\n <mat-date-range-input hidden (dateChange)="onCustomDateChange($event)" [rangePicker]="picker">\n <input matStartDate #customStartDate>\n <input matEndDate (dateChange)="dateRangeChange(customStartDate, customEndDate)" #customEndDate>\n </mat-date-range-input>\n <mat-date-range-picker #picker [touchUi]="touchUi"></mat-date-range-picker>\n</div>\n',providers:[{provide:f.MatFormFieldControl,useExisting:Ot}],styles:[""]}]}],t.ɵbb.ctorParameters=function(){return[{type:l.FormBuilder},{type:l.NgControl,decorators:[{type:e.Optional},{type:e.Self}]},{type:a.DatePipe}]},t.ɵbb.propDecorators={picker:[{type:e.ViewChild,args:["picker"]}],timelineValue:[{type:e.Input}],timelines:[{type:e.Input}],dateFrom:[{type:e.Input}],dateTo:[{type:e.Input}],appearance:[{type:e.Input}],showClearbutton:[{type:e.Input}],form:[{type:e.Input}],labelText:[{type:e.Input}],selectedValue:[{type:e.Input}],touchUi:[{type:e.Input}],selectedValueChange:[{type:e.Output}],selectionChange:[{type:e.Output}],defaultValue:[{type:e.Input}],required:[{type:e.Input}],disabled:[{type:e.Input}],value:[{type:e.Input}]},t.ɵbb=Ot=z([r.UntilDestroy()],t.ɵbb);var Nt=function(){function t(){this.isLoading=!1,this.size=.6}return t.prototype.ngOnInit=function(){},t}();Nt.decorators=[{type:e.Component,args:[{selector:"app-loader",template:'<div [hidden]="!isLoading">\n <mat-progress-spinner mode="indeterminate" [strokeWidth]="2" [diameter]="32 * size"></mat-progress-spinner>\n <span class="message">{{message}}</span>\n</div>\n',styles:[".mat-progress-spinner{display:inline-block;vertical-align:middle}.message{margin-left:.5em}"]}]}],Nt.ctorParameters=function(){return[]},Nt.propDecorators={isLoading:[{type:e.Input}],size:[{type:e.Input}],message:[{type:e.Input}]};var Ht=function(){};Ht.decorators=[{type:e.NgModule,args:[{declarations:[at,lt],imports:[a.CommonModule,d.MatSnackBarModule,g.MatIconModule],exports:[at,lt]}]}];var Gt=new ot("AuthenticationGuard"),qt=function(){function t(t,e){this.router=t,this.credentialsService=e}return t.prototype.canActivate=function(t,e){return this.isUserAuthenticated(t,e)},t.prototype.canLoad=function(t,e){return this.isUserAuthenticated(t,e)},t.prototype.isUserAuthenticated=function(t,e){return!!this.credentialsService.isAuthenticated||(Gt.debug("Not authenticated, redirecting and adding redirect url..."),this.router.navigate(["/login"],{queryParams:{redirect:e.url},replaceUrl:!0}),!1)},t}();qt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new qt(e.ɵɵinject(y.Router),e.ɵɵinject(ht))},token:qt,providedIn:"root"}),qt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],qt.ctorParameters=function(){return[{type:y.Router},{type:ht}]};var Bt=function(){function t(t,e){this.credentialsService=t,this.http=e}return t.prototype.login=function(t){var e=this,n={};return this.http.skipToken().post("oauth/token",t).pipe(u.concatMap((function(o){return $(e,void 0,void 0,(function(){var e;return W(this,(function(i){switch(i.label){case 0:return o.expires_in=Date.now()+1e3*o.expires_in,n.token=o,n.user={},this.credentialsService.setCredentials(n,t.remember),[4,this.http.get("api/user/current").toPromise()];case 1:return e=i.sent(),n.user=null==e?void 0:e.user,this.credentialsService.setCredentials(n,t.remember),[2,n]}}))}))})))},t.prototype.logout=function(){return this.credentialsService.setCredentials(),c.of(!0)},t}();Bt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Bt(e.ɵɵinject(ht),e.ɵɵinject(Ct))},token:Bt,providedIn:"root"}),Bt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Bt.ctorParameters=function(){return[{type:ht},{type:Ct}]};var zt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return B(e,t),e.prototype.shouldDetach=function(t){return!1},e.prototype.store=function(t,e){},e.prototype.shouldAttach=function(t){return!1},e.prototype.retrieve=function(t){return null},e.prototype.shouldReuseRoute=function(t,e){var n,o,i;return t.routeConfig===e.routeConfig||Boolean((null===(n=t.routeConfig)||void 0===n?void 0:n.component)&&(null===(o=t.routeConfig)||void 0===o?void 0:o.component)===(null===(i=e.routeConfig)||void 0===i?void 0:i.component))},e}(y.RouteReuseStrategy);zt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new zt},token:zt,providedIn:"root"}),zt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var $t=function(){function t(){this.storageSub=new c.Subject}return t.prototype.watch=function(){return this.storageSub.asObservable()},t.prototype.setItem=function(t,e){localStorage.setItem(t,e),this.storageSub.next({key:t,value:e})},t.prototype.getItem=function(t){return localStorage.getItem(t)},t.prototype.removeItem=function(t){var e=this.getItem(t);localStorage.removeItem(t),this.storageSub.next({key:t,value:e})},t}();$t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new $t},token:$t,providedIn:"root"}),$t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],$t.ctorParameters=function(){return[]};var Wt=function(){function t(t){this.http=t}return t.prototype.GET=function(t,e){return void 0===e&&(e={}),this.http.get(t,{params:e}).toPromise()},t.prototype.POST=function(t,e){return null==e&&(e={blank:"blank"}),this.http.post(t,e).toPromise()},t.prototype.POSTRAW=function(t,e){return null==e&&(e={blank:"blank"}),this.http.skipHeader().post(t,e).toPromise()},t.prototype.PUT=function(t,e){return null==e&&(e={blank:"blank"}),this.http.put(t,e).toPromise()},t.prototype.PATCH=function(t,e){return null==e&&(e={blank:"blank"}),this.http.patch(t,e).toPromise()},t.prototype.DELETE=function(t){return this.http.delete(t).toPromise()},t}();Wt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Wt(e.ɵɵinject(Ct))},token:Wt,providedIn:"root"}),Wt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Wt.ctorParameters=function(){return[{type:Ct}]};var Yt=function(){};Yt.decorators=[{type:e.NgModule,args:[{exports:[C.MatButtonModule,x.MatCheckboxModule,b.MatCommonModule,n.MatDialogModule,f.MatFormFieldModule,g.MatIconModule,F.MatInputModule,b.MatLineModule,I.MatMenuModule,b.MatNativeDateModule,b.MatOptionModule,w.MatProgressSpinnerModule,b.MatPseudoCheckboxModule,b.MatRippleModule,h.MatSelectModule,i.MatSortModule,o.MatTableModule,D.MatCardModule,S.MatDividerModule,M.MatChipsModule,_.MatDatepickerModule,T.MatListModule,v.MatTooltipModule]}]}];var Kt=function(t){if(t)throw new Error(t+" has already been loaded. Import Core module in the root module only.")};Kt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,s.HttpClientModule,y.RouterModule,Ht],providers:[{provide:s.HttpClient,useClass:Ct},{provide:y.RouteReuseStrategy,useClass:zt}],exports:[Ht]}]}],Kt.ctorParameters=function(){return[{type:Kt,decorators:[{type:e.Optional},{type:e.SkipSelf}]}]};var Jt=function(){};Jt.decorators=[{type:e.NgModule,args:[{imports:[L.FlexLayoutModule,a.CommonModule,Yt],declarations:[G],exports:[G],entryComponents:[G]}]}];var Qt=function(){};Qt.decorators=[{type:e.NgModule,args:[{imports:[L.FlexLayoutModule,a.CommonModule,k.InfiniteScrollModule,Yt],declarations:[t.ɵi],exports:[t.ɵi]}]}];var Zt=function(){};Zt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,L.FlexLayoutModule,A.NgxDocViewerModule,Yt],declarations:[tt],exports:[tt]}]}];var Xt=function(){};Xt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,L.FlexLayoutModule,Yt],declarations:[Dt],exports:[Dt]}]}];var te=function(){};te.decorators=[{type:e.NgModule,args:[{declarations:[wt,t.ɵo],imports:[a.CommonModule,l.FormsModule,l.ReactiveFormsModule,L.FlexLayoutModule,Xt,Zt,k.InfiniteScrollModule,Jt,Yt],exports:[t.ɵo],entryComponents:[wt]}]}];var ee=function(){function t(){this.maxLength=100,this.hideToggle=!0,this.isCollapsed=!0}return t.prototype.ngOnInit=function(){this.determineView()},t.prototype.toggleView=function(){this.isCollapsed=!this.isCollapsed,this.determineView()},t.prototype.determineView=function(){if(!this.text||this.text.length<=this.maxLength)return this.currentText=this.text,this.isCollapsed=!1,void(this.hideToggle=!0);this.hideToggle=!1,1==this.isCollapsed?this.currentText=this.text.substring(0,this.maxLength)+"...":0==this.isCollapsed&&(this.currentText=this.text)},t}();ee.decorators=[{type:e.Component,args:[{selector:"app-read-more",template:'<div [innerHTML]="currentText"></div>\n<a href="javascript:;" *ngIf="!hideToggle" class="primary-color hoverable" (click)="toggleView()">Read\n {{ isCollapsed ? "more" : "less" }}</a>',styles:["div.collapsed{height:250px;overflow:hidden}.primary-color{color:#009fdd!important}"]}]}],ee.ctorParameters=function(){return[]},ee.propDecorators={text:[{type:e.Input}],maxLength:[{type:e.Input}]};var ne=function(){};ne.decorators=[{type:e.NgModule,args:[{declarations:[ee],imports:[a.CommonModule,Yt,L.FlexLayoutModule],exports:[ee]}]}];var oe=function(){};oe.decorators=[{type:e.NgModule,args:[{declarations:[Lt,Tt,At],imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,L.FlexLayoutModule,Jt,Yt,ne],exports:[Lt],entryComponents:[Tt]}]}];var ie=function(){};ie.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.ReactiveFormsModule,L.FlexLayoutModule,Yt],declarations:[t.ɵx,Et],exports:[t.ɵx,Et]}]}];var re=function(){};re.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.FormsModule],declarations:[Vt,Pt],exports:[Vt,Pt]}]}];var ae=function(){};ae.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var le=function(){};le.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbb],imports:[a.CommonModule,ae,L.FlexLayoutModule,Yt,l.ReactiveFormsModule],exports:[t.ɵbb]}]}];var se=function(){};se.decorators=[{type:e.NgModule,args:[{declarations:[Nt],imports:[a.CommonModule,w.MatProgressSpinnerModule],exports:[Nt]}]}];var ce=function(){};ce.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var ue=function(){};ue.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,ce]}]}];var de=function(){};de.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var pe=function(){};pe.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,de]}]}];var me=function(){};me.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];new ot("EmailSubscriptionUser Form");var fe={user_id:{required:"User is required"},email_type_id:{required:"Email Type is required"}};t.ɵbe=function(){function t(t,e,n,o,i,r){this.fb=t,this.formValidatorService=e,this.alertService=n,this.dialogRef=o,this.data=i,this.http=r,this.createForm()}return t.prototype.createForm=function(){this.esUserFormGroup=this.fb.group({id:[""],user_id:["",l.Validators.required],email_type_id:["",l.Validators.required]})},t.prototype.ngOnInit=function(){var t,e,n,o;(null===(e=null===(t=this.data)||void 0===t?void 0:t.esUser)||void 0===e?void 0:e.id)&&(this.esUser=this.data.esUser,this.updateMode=!0,this.selectedType=null===(n=this.esUser)||void 0===n?void 0:n.email_type,this.selectedUser=null===(o=this.esUser)||void 0===o?void 0:o.user,this.esUserFormGroup.patchValue(this.esUser))},t.prototype.submit=function(){var t=this;if(this.esUserFormGroup.markAllAsTouched(),this.esUserFormFirstAttempt=!0,this.esUserFormGroup.valid){this.isSubmitLoading=!0;var e=this.esUserFormGroup.value;(this.updateMode?this.http.put("api/email-subscription-users/"+(null==e?void 0:e.id),e):this.http.post("api/email-subscription-users",e)).pipe(u.finalize((function(){return t.isSubmitLoading=!1})),r.untilDestroyed(this)).subscribe((function(e){t.alertService.addAlert("Subscription saved successfully","success"),t.dialogRef.close(e)}))}},t.prototype.cancel=function(){this.dialogRef.close()},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.esUserFormGroup,this.esUserFormFirstAttempt)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.esUserFormGroup,fe)},t.prototype.ngOnDestroy=function(){},t}(),t.ɵbe.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-user-form",template:'<form [formGroup]="esUserFormGroup" (ngSubmit)="submit()" class="mat-typography">\n <div fxLayout="column">\n <div mat-dialog-title class="text-center">\n <div>Email Subscription User</div>\n </div>\n\n <div mat-dialog-content fxLayout="column">\n <div fxLayout="row wrap" fxLayoutAlign="space-between center">\n\n <mat-form-field fxFlex="48%" class="mt-1">\n <mat-label>User</mat-label>\n <app-searchable-selector formControlName="user_id" apiUrl="api/users" titleField="name" required\n [selectedValue]="selectedUser">\n </app-searchable-selector>\n <mat-error *ngIf="isFieldValid(\'user_id\')">{{getErrorMessage(\'user_id\')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="48%" class="mt-1">\n <mat-label>Email Type</mat-label>\n <app-searchable-selector formControlName="email_type_id" apiUrl="api/email-subscription-types"\n required [selectedValue]="selectedType">\n </app-searchable-selector>\n <mat-error *ngIf="isFieldValid(\'email_type_id\')">{{getErrorMessage(\'email_type_id\')}}</mat-error>\n </mat-form-field>\n\n <div class="my-2" fxLayout="row" fxLayoutGap="30px" fxLayoutAlign="end" fxFlex="100%">\n <button mat-raised-button type="button" (click)="cancel()">Cancel</button>\n <button mat-raised-button type="submit" color="primary" [disabled]="isSubmitLoading">\n <app-loader class="inline-loader" [isLoading]="isSubmitLoading"></app-loader>\n Save\n </button>\n </div>\n </div>\n </div>\n\n\n </div>\n</form>',styles:[""]}]}],t.ɵbe.ctorParameters=function(){return[{type:l.FormBuilder},{type:Ft},{type:st},{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:Ct}]},t.ɵbe=z([r.UntilDestroy()],t.ɵbe);var he=function(){};he.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbe],imports:[a.CommonModule,Yt,L.FlexLayoutModule,l.ReactiveFormsModule,ie,me,se],entryComponents:[t.ɵbe]}]}];var ge=new ot("EmailSubscriptionUser list");t.ɵbf=function(){function e(t,e,n){this.dialog=t,this.http=e,this.router=n,this.esUserList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc"},this.displayColumns=new l.FormControl(["index","user.name","email_type.title","creator.name","created_at","actions"]),this.displayedColumns=[],this.availableDisplayColumns=[{order:1,value:"index",name:"Index"},{order:2,value:"user.name",name:"User"},{order:3,value:"email_type.title",name:"Email Type"},{order:4,value:"creator.name",name:"Creator"},{order:5,value:"actions",name:"Actions"}]}return e.prototype.ngOnInit=function(){var t=this;this.displayedColumns=this.displayColumns.value,this.initializeData(),this.sort&&this.sort.sortChange.pipe(r.untilDestroyed(this)).subscribe((function(e){t.changeSort(e)}))},Object.defineProperty(e.prototype,"selectedColumns",{get:function(){var t=this;return this.availableDisplayColumns.filter((function(e){return t.displayColumns.value.some((function(t){return t===e.value}))})).sort((function(t,e){return t.order>e.order?1:e.order>t.order?-1:0})).map((function(t){return t.value}))},enumerable:!1,configurable:!0}),e.prototype.columnsChange=function(){this.displayedColumns=this.selectedColumns},e.prototype.initializeData=function(){var t=this;this.http.get("api/email-subscription-users",{params:Object.assign(Object.assign({},this.filters),this.pageEvent)}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.esUserList=t.esUserList.concat(e.data),t.pageEvent.page=e.current_page,t.pageEvent.lastPage=e.last_page}))},e.prototype.filterChange=function(t){this.filters=Object.assign(Object.assign({},this.filters),t),this.reload()},e.prototype.addEmailSubscriptionUser=function(){var e=this;this.dialog.open(t.ɵbe,{width:"800px",autoFocus:!1,data:{}}).afterClosed().subscribe((function(t){t&&(ge.debug(t),e.reload())}))},e.prototype.editEmailSubscriptionUser=function(e,n){var o=this;e.stopPropagation(),this.dialog.open(t.ɵbe,{width:"800px",autoFocus:!1,data:{esUser:n}}).afterClosed().subscribe((function(t){t&&(ge.debug(t),o.reload())}))},e.prototype.deleteEmailSubscriptionUser=function(t,e){var n=this;t.stopPropagation(),this.dialog.open(G,{width:"400px",data:{title:"Delete Subscription",message:"Are you sure to proceed delete the esUser "+e.name+"?"},autoFocus:!1}).afterClosed().subscribe((function(t){t&&n.http.delete("api/email-subscription-users/"+(null==e?void 0:e.id)).pipe(r.untilDestroyed(n)).subscribe((function(t){n.esUserList=n.esUserList.filter((function(t){return t.id!==e.id}))}))}))},e.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.initializeData())},e.prototype.changeSort=function(t){t.direction&&(this.filters.sort_by=t.active+"|"+t.direction,this.reload())},e.prototype.reload=function(){this.esUserList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.initializeData()},e.prototype.ngOnDestroy=function(){},e}(),t.ɵbf.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-user-list",template:'<div class="mat-typography m-4">\n <div fxLayout="row" fxLayoutAlign="start center">\n <app-email-subscription-user-list-filter (valueChange)="filterChange($event)">\n </app-email-subscription-user-list-filter>\n <div class="ml-2">\n <button mat-raised-button color="primary" type="button" (click)="addEmailSubscriptionUser()">+\n User Subscription</button>\n </div>\n <span fxFlex></span>\n <mat-form-field appearance="outline" class="no-padding">\n <mat-label>Columns</mat-label>\n <mat-select [formControl]="displayColumns" multiple (selectionChange)="columnsChange()">\n <mat-option *ngFor="let column of availableDisplayColumns" [value]="column.value">{{column.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n\n\n <section>\n <div class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="esUserList" matSort class="w-100 mt-1" multiTemplateDataRows\n id="email-subscription-user-table">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let esUser; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n <ng-container matColumnDef="user.name">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> User </th>\n <td mat-cell *matCellDef="let esUser;"> {{ esUser?.user?.name }} </td>\n </ng-container>\n\n <ng-container matColumnDef="email_type.title">\n <th mat-header-cell *matHeaderCellDef> Email Type </th>\n <td mat-cell *matCellDef="let esUser;"> {{ esUser?.email_type?.title }} </td>\n </ng-container>\n\n <ng-container matColumnDef="creator.name">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Creator</th>\n <td mat-cell *matCellDef="let esUser;">\n {{esUser?.creator?.name }}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="created_at">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Created On</th>\n <td mat-cell *matCellDef="let esUser;">\n {{esUser?.created_at | date:\'medium\' }}\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let esUser">\n <button type="button" mat-icon-button (click)="deleteEmailSubscriptionUser($event,esUser)">\n <mat-icon>delete</mat-icon>\n </button>\n <button type="button" mat-icon-button (click)="editEmailSubscriptionUser($event,esUser)">\n <mat-icon>edit</mat-icon>\n </button>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef="displayedColumns;"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n\n </section>\n</div>',styles:[".scroll-container{max-height:800px;overflow-y:auto}"]}]}],t.ɵbf.ctorParameters=function(){return[{type:n.MatDialog},{type:Ct},{type:y.Router}]},t.ɵbf.propDecorators={sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}]},t.ɵbf=z([r.UntilDestroy()],t.ɵbf);var ye={title:"Email Subscription Users",permissions:{only:["app_admin"],redirectTo:"/"}},ve=[{path:"",component:t.ɵbf,canActivate:[qt],data:ye}],be=function(){};be.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(ve)],exports:[y.RouterModule]}]}];var Ce=function(){};Ce.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}],t.ɵbh=function(){function t(t){this.fb=t,this.valueChange=new e.EventEmitter,this.createForm()}return t.prototype.createForm=function(){this.esUserFilterForm=this.fb.group({user_id:[""],email_type_id:[""]})},t.prototype.ngOnInit=function(){var t=this;this.esUserFilterForm.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){t.valueChange.emit(e)}))},t.prototype.resetFieldValue=function(t){this.esUserFilterForm.get(t).setValue("")},t.prototype.getFieldValue=function(t){return this.esUserFilterForm.get(t).value},t.prototype.ngOnDestroy=function(){},t}(),t.ɵbh.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-user-list-filter",template:'<form [formGroup]="esUserFilterForm" fxLayout="row wrap" fxLayoutGap="1rem" fxLayoutAlign="start center">\n <mat-form-field class="ml-3">\n <mat-label>User</mat-label>\n <app-searchable-selector formControlName="user_id" apiUrl="api/users" titleField="name">\n </app-searchable-selector>\n <button mat-button *ngIf="getFieldValue(\'user_id\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'user_id\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field class="ml-3">\n <mat-label>Email Type</mat-label>\n <app-searchable-selector formControlName="email_type_id" apiUrl="api/email-subscription-types">\n </app-searchable-selector>\n <button mat-button *ngIf="getFieldValue(\'email_type_id\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'email_type_id\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n</form>',styles:[""]}]}],t.ɵbh.ctorParameters=function(){return[{type:l.FormBuilder}]},t.ɵbh.propDecorators={valueChange:[{type:e.Output}]},t.ɵbh=z([r.UntilDestroy()],t.ɵbh);var xe=function(){};xe.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbh],imports:[a.CommonModule,Yt,L.FlexLayoutModule,l.ReactiveFormsModule,ie,Ce],exports:[t.ɵbh]}]}];var Fe=function(){};Fe.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbf],imports:[a.CommonModule,k.InfiniteScrollModule,Yt,L.FlexLayoutModule,l.ReactiveFormsModule,be,he,xe],exports:[t.ɵbf]}]}];var Ie=function(){};Ie.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var we=function(){};we.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,Ie]}]}];var De=function(){};De.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var Se={title:{required:"Title is required"},code:{required:"Code is required"},frequency_id:{required:"Frequency is required"}};t.ɵbi=function(){function t(t,e,n,o,i,r){this.fb=t,this.formValidatorService=e,this.alertService=n,this.dialogRef=o,this.data=i,this.http=r,this.createForm()}return t.prototype.createForm=function(){this.emailSubscriptionTypeFormGroup=this.fb.group({id:[""],title:["",l.Validators.compose([l.Validators.required])],code:["",l.Validators.compose([l.Validators.required])],frequency_id:["",l.Validators.required],description:[""]})},t.prototype.ngOnInit=function(){var t,e,n;(null===(t=this.data.emailSubscriptionType)||void 0===t?void 0:t.id)&&(this.isLoading=!0,this.emailSubscriptionType=null===(e=this.data)||void 0===e?void 0:e.emailSubscriptionType,this.updateMode=!0,this.selectedFrequency=(null===(n=this.emailSubscriptionType)||void 0===n?void 0:n.frequency)||{},this.emailSubscriptionTypeFormGroup.patchValue(this.emailSubscriptionType))},t.prototype.submit=function(){var t=this;if(this.emailSubscriptionTypeFormGroup.markAllAsTouched(),this.emailSubscriptionTypeFormFirstAttempt=!0,this.emailSubscriptionTypeFormGroup.valid){this.isSubmitLoading=!0;var e=this.emailSubscriptionTypeFormGroup.value;(this.updateMode?this.http.put("api/email-subscription-types/"+(null==e?void 0:e.id),e):this.http.post("api/email-subscription-types",e)).pipe(u.finalize((function(){return t.isSubmitLoading=!1})),r.untilDestroyed(this)).subscribe((function(e){t.alertService.addAlert("Email Type saved successfully","success"),t.dialogRef.close(e)}))}},t.prototype.cancel=function(){this.dialogRef.close()},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.emailSubscriptionTypeFormGroup,this.emailSubscriptionTypeFormFirstAttempt)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.emailSubscriptionTypeFormGroup,Se)},t.prototype.ngOnDestroy=function(){},t}(),t.ɵbi.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-type-form",template:'<form [formGroup]="emailSubscriptionTypeFormGroup" (ngSubmit)="submit()" class="mat-typography">\n <div fxLayout="column">\n <div mat-dialog-title class="text-center">\n <div>Email Subscription Type</div>\n </div>\n\n <div mat-dialog-content fxLayout="column">\n <div fxLayout="row wrap" fxLayoutAlign="space-between center">\n\n <mat-form-field fxFlex="100%" class="mt-1">\n <input matInput formControlName="title" placeholder="Title" autocomplete="off" required />\n <mat-error *ngIf="isFieldValid(\'title\')">{{getErrorMessage(\'title\')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%" class="mt-1">\n <input matInput formControlName="code" placeholder="Code" autocomplete="off" required />\n <mat-hint align="end">Unique Value</mat-hint>\n <mat-error *ngIf="isFieldValid(\'code\')">{{getErrorMessage(\'code\')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%" class="mt-1">\n <mat-label>Frequency</mat-label>\n <app-searchable-selector formControlName="frequency_id" apiUrl="api/email-subscription-frequencies"\n [(selectedValue)]="selectedFrequency" [enableSearch]="false" required>\n </app-searchable-selector>\n <mat-error *ngIf="isFieldValid(\'frequency_id\')">{{getErrorMessage(\'frequency_id\')}}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%" class="mt-1">\n <textarea matInput formControlName="description" placeholder="Description"\n autocomplete="off"></textarea>\n </mat-form-field>\n\n <div class="my-2" fxLayout="row" fxLayoutGap="30px" fxLayoutAlign="end" fxFlex="100%">\n <button mat-raised-button type="button" (click)="cancel()">Cancel</button>\n <button mat-raised-button type="submit" color="primary" [disabled]="isSubmitLoading">\n <app-loader class="inline-loader" [isLoading]="isSubmitLoading"></app-loader>\n Save\n </button>\n </div>\n </div>\n </div>\n\n\n </div>\n</form>',styles:[""]}]}],t.ɵbi.ctorParameters=function(){return[{type:l.FormBuilder},{type:Ft},{type:st},{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:Ct}]},t.ɵbi=z([r.UntilDestroy()],t.ɵbi);var Me=function(){};Me.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbi],imports:[a.CommonModule,Yt,L.FlexLayoutModule,l.ReactiveFormsModule,ie,De,se],exports:[t.ɵbi],entryComponents:[t.ɵbi]}]}],t.ɵbj=function(){function e(t,e){this.dialog=t,this.http=e,this.emailSubscriptionTypeList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc",isLoadRelations:!0,relations:["frequency"]},this.search=new l.FormControl(""),this.displayColumns=new l.FormControl(["index","title","frequency.title","description","actions"]),this.displayedColumns=[],this.availableDisplayColumns=[{order:1,value:"index",name:"Index"},{order:2,value:"title",name:"Title"},{order:3,value:"code",name:"Code"},{order:4,value:"frequency.title",name:"Frequency"},{order:5,value:"description",name:"Description"},{order:6,value:"actions",name:"Actions"}]}return e.prototype.ngOnInit=function(){var t=this;this.displayedColumns=this.displayColumns.value,this.initializeData(),this.search.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){t.filters.search=e,t.reload()})),this.sort&&this.sort.sortChange.pipe(r.untilDestroyed(this)).subscribe((function(e){t.changeSort(e)}))},Object.defineProperty(e.prototype,"selectedColumns",{get:function(){var t=this;return this.availableDisplayColumns.filter((function(e){return t.displayColumns.value.some((function(t){return t===e.value}))})).sort((function(t,e){return t.order>e.order?1:e.order>t.order?-1:0})).map((function(t){return t.value}))},enumerable:!1,configurable:!0}),e.prototype.columnsChange=function(){this.displayedColumns=this.selectedColumns},e.prototype.initializeData=function(){var t=this;this.http.get("api/email-subscription-types",{params:Object.assign(Object.assign({},this.filters),this.pageEvent)}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.emailSubscriptionTypeList=t.emailSubscriptionTypeList.concat(e.data),t.pageEvent.page=e.current_page,t.pageEvent.lastPage=e.last_page}))},e.prototype.addEmailSubscriptionType=function(){var e=this;this.dialog.open(t.ɵbi,{width:"400px",autoFocus:!1,data:{}}).afterClosed().subscribe((function(t){t&&e.reload()}))},e.prototype.editEmailSubscriptionType=function(e,n){var o=this;e.stopPropagation(),this.dialog.open(t.ɵbi,{width:"400px",autoFocus:!1,data:{emailSubscriptionType:n}}).afterClosed().subscribe((function(t){t&&o.reload()}))},e.prototype.deleteEmailSubscriptionType=function(t,e){var n=this;t.stopPropagation(),this.dialog.open(G,{width:"400px",data:{title:"Delete Email Type",message:"Are you sure to proceed delete the Email Type "+e.title+"?"},autoFocus:!1}).afterClosed().subscribe((function(t){t&&n.http.delete("api/email-subscription-types/"+(null==e?void 0:e.id)).pipe(r.untilDestroyed(n)).subscribe((function(t){n.emailSubscriptionTypeList=n.emailSubscriptionTypeList.filter((function(t){return t.id!==e.id}))}))}))},e.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.initializeData())},e.prototype.changeSort=function(t){t.direction&&(this.filters.sort_by=t.active+"|"+t.direction,this.reload())},e.prototype.reload=function(){this.emailSubscriptionTypeList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.initializeData()},e.prototype.ngOnDestroy=function(){},e}(),t.ɵbj.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-type-list",template:'<div class="mat-typography m-4">\n <div fxLayout="row wrap" fxLayoutAlign="start center">\n <mat-form-field>\n <input matInput [formControl]="search" placeholder="Email Type" autocomplete="off" />\n <button mat-button matSuffix mat-icon-button>\n <mat-icon>search</mat-icon>\n </button>\n <button mat-button *ngIf="search.value" matSuffix mat-icon-button (click)="search.setValue(\'\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <div class="ml-2">\n <button mat-raised-button color="primary" type="button" (click)="addEmailSubscriptionType()">+ Email\n Type</button>\n </div>\n <span fxFlex></span>\n <mat-form-field appearance="outline" class="no-padding">\n <mat-label>Columns</mat-label>\n <mat-select [formControl]="displayColumns" multiple (selectionChange)="columnsChange()">\n <mat-option *ngFor="let column of availableDisplayColumns" [value]="column.value">{{column.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n <section>\n <div class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="emailSubscriptionTypeList" matSort class="w-100 mt-1" multiTemplateDataRows\n id="email-subscription-type-table">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let emailSubscriptionType; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n <ng-container matColumnDef="title">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Title </th>\n <td mat-cell *matCellDef="let emailSubscriptionType;"> {{ emailSubscriptionType?.title }} </td>\n </ng-container>\n <ng-container matColumnDef="code">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Code </th>\n <td mat-cell *matCellDef="let emailSubscriptionType;"> {{ emailSubscriptionType?.code }}\n </td>\n </ng-container>\n <ng-container matColumnDef="frequency.title">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Frequency </th>\n <td mat-cell *matCellDef="let emailSubscriptionType;"> {{ emailSubscriptionType?.frequency?.title }}\n </td>\n </ng-container>\n <ng-container matColumnDef="description">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef="let emailSubscriptionType;"> {{ emailSubscriptionType?.description }}\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let emailSubscriptionType">\n <button type="button" mat-icon-button\n (click)="deleteEmailSubscriptionType($event,emailSubscriptionType)">\n <mat-icon>delete</mat-icon>\n </button>\n <button type="button" mat-icon-button\n (click)="editEmailSubscriptionType($event,emailSubscriptionType)">\n <mat-icon>edit</mat-icon>\n </button>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n </section>\n</div>',styles:[".scroll-container{max-height:800px;overflow-y:auto}"]}]}],t.ɵbj.ctorParameters=function(){return[{type:n.MatDialog},{type:Ct}]},t.ɵbj.propDecorators={sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}]},t.ɵbj=z([r.UntilDestroy()],t.ɵbj);var _e={title:"Email Subscription Type",permissions:{only:["client_admin"],redirectTo:"/"}},Te=[{path:"",component:t.ɵbj,canActivate:[qt],data:_e}],Le=function(){};Le.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Te)],exports:[y.RouterModule]}]}];var ke=function(){};ke.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbj],imports:[a.CommonModule,Yt,L.FlexLayoutModule,l.ReactiveFormsModule,k.InfiniteScrollModule,Me,Le],exports:[t.ɵbj]}]}],t.ɵbk=function(){function t(t){this.http=t,this.subscriptions=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc",isLoadRelations:!0,relations:"frequency,currentUserSubscription"}}return t.prototype.ngOnInit=function(){this.fetchSubscriptions()},t.prototype.fetchSubscriptions=function(){var t=this;this.http.get("api/email-subscription-types",{params:Object.assign(Object.assign({},this.filters),this.pageEvent)}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.subscriptions=t.subscriptions.concat(e.data),t.pageEvent.page=e.current_page,t.pageEvent.lastPage=e.last_page}))},t.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.fetchSubscriptions())},t.prototype.subscribe=function(t){this.http.post("api/email-subscription-for-user",{email_type_id:null==t?void 0:t.id}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.current_user_subscription=null==e?void 0:e.item}))},t.prototype.unsubscribe=function(t){var e;this.http.delete("api/email-subscription-users/"+(null===(e=null==t?void 0:t.current_user_subscription)||void 0===e?void 0:e.id)).pipe(r.untilDestroyed(this)).subscribe((function(e){t.current_user_subscription=null}))},t.prototype.reload=function(){this.subscriptions=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.fetchSubscriptions()},t.prototype.ngOnDestroy=function(){},t}(),t.ɵbk.decorators=[{type:e.Component,args:[{selector:"app-email-subscription-for-user",template:'<div fxLayout="column" class="container my-4">\n\n <div class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <mat-list>\n <div mat-subheader>Available Subscriptions</div>\n <mat-list-item *ngFor="let sub of subscriptions">\n <mat-icon mat-list-icon>email</mat-icon>\n <div mat-line>{{sub?.title}} </div>\n <div mat-line class="text-secondary">{{sub?.frequency?.title}}</div>\n <div mat-line> {{sub?.description}} </div>\n <div fxLayout fxLayoutAlign="end">\n <button type="button" *ngIf="!sub?.current_user_subscription" mat-raised-button color="primary"\n (click)="subscribe(sub)">Subscribe</button>\n <button type="button" *ngIf="sub?.current_user_subscription" mat-stroked-button color="primary"\n (click)="unsubscribe(sub)">Unsubscribe</button>\n </div>\n <mat-divider></mat-divider>\n </mat-list-item>\n </mat-list>\n </div>\n\n</div>',styles:[".scroll-container{max-height:800px;overflow-y:auto}"]}]}],t.ɵbk.ctorParameters=function(){return[{type:Ct}]},t.ɵbk=z([r.UntilDestroy()],t.ɵbk);var Ae={permissions:{only:["client_admin"]}},Ee=[{path:"",component:t.ɵbk,canActivate:[qt],data:Ae}],Ve=function(){};Ve.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Ee)],exports:[y.RouterModule]}]}];var Ue=function(){};Ue.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbk],imports:[a.CommonModule,k.InfiniteScrollModule,Yt,L.FlexLayoutModule,Ve],exports:[t.ɵbk]}]}];var Pe=function(){function t(t){this.http=t}return t.prototype.getTechlifyUpdates=function(t){return this.http.get("api/techlify-updates",{params:t}).toPromise()},t.prototype.createTechlifyUpdate=function(t){return this.http.post("api/techlify-updates",t).toPromise()},t.prototype.updateTechlifyUpdate=function(t){return this.http.put("api/techlify-updates/"+t.id,t).toPromise()},t.prototype.deleteTechlifyUpdate=function(t){return this.http.delete("api/techlify-updates/"+t).toPromise()},t.prototype.getTechlifyUpdate=function(t){return this.http.get("api/techlify-updates/"+t).toPromise()},t.prototype.getNewUpdateForCurrentUser=function(){return this.http.get("api/current-user-techlify-updates").toPromise()},t.prototype.createUpdateViewRecord=function(t){return this.http.post("api/techlify-update-views",t).toPromise()},t.prototype.updateCurrentUserUpdates=function(){return this.http.get("api/techlify-updates/update-view").toPromise()},t}();Pe.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Pe(e.ɵɵinject(Ct))},token:Pe,providedIn:"root"}),Pe.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Pe.ctorParameters=function(){return[{type:Ct}]};var je={title:{required:"Title is required"},released_on:{required:"Released On is required"},version:{required:"Version is required"},description:{required:"Description is required"},learn_more_link:{pattern:"Please enter valid link"}},Oe=function(){function t(t,n,o,i,r,a){this.dialogRef=t,this.data=n,this.fb=o,this.formValidatorService=i,this.alertService=r,this.techlifyUpdateService=a,this.onSave=new e.EventEmitter,this.isUpdateMode=!1,this.toolbar=[["bold","italic"],["bullet_list"]],this.createForm()}return t.prototype.createForm=function(){this.techlifyUpdateForm=this.fb.group({id:new l.FormControl(""),title:new l.FormControl("",l.Validators.required),description:new l.FormControl("",l.Validators.required),version:new l.FormControl("",l.Validators.required),released_on:new l.FormControl("",l.Validators.required),learn_more_link:new l.FormControl("",l.Validators.compose([l.Validators.pattern("(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?")]))}),this.data.techlifyUpdateDetails&&(this.isUpdateMode=!0,this.techlifyUpdateForm.patchValue(this.data.techlifyUpdateDetails))},t.prototype.ngOnInit=function(){this.editor=new E.Editor},t.prototype.submit=function(){return $(this,void 0,void 0,(function(){var t,e,n;return W(this,(function(o){switch(o.label){case 0:if(!this.techlifyUpdateForm.valid)return[3,8];t=void 0,e=this.techlifyUpdateForm.value,o.label=1;case 1:return o.trys.push([1,6,7,8]),this.isUpdateMode?[4,this.techlifyUpdateService.updateTechlifyUpdate(e)]:[3,3];case 2:return n=o.sent(),[3,5];case 3:return[4,this.techlifyUpdateService.createTechlifyUpdate(e)];case 4:n=o.sent(),o.label=5;case 5:return t=n,this.alertService.addAlert("Techlify app update saved successfully","success"),[3,8];case 6:return o.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,8];case 7:return t&&this.dialogRef.close(t),[7];case 8:return[2]}}))}))},t.prototype.resetFieldValue=function(t){this.techlifyUpdateForm.get(t).setValue("")},t.prototype.getFieldValue=function(t){return this.techlifyUpdateForm.get(t).value},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.techlifyUpdateForm,!0)},t.prototype.getErrorMessage=function(t){return this.formValidatorService.getErrorMessage(t,this.techlifyUpdateForm,je)},t}();Oe.decorators=[{type:e.Component,args:[{selector:"app-techlify-update-form",template:'<form [formGroup]="techlifyUpdateForm" (ngSubmit)="submit()">\n <div fxLayout="column" class="mat-typography">\n <div mat-dialog-title class="text-center">\n <h2>\n App Update Form\n </h2>\n </div>\n <div mat-dialog-content fxLayout="column" fxLayoutGap="1rem">\n <mat-form-field fxFlex="100%">\n <mat-label>Title</mat-label>\n <input matInput formControlName="title" placeholder="Title" autocomplete="off" required />\n <button mat-button *ngIf="getFieldValue(\'title\')" matSuffix mat-icon-button (click)="resetFieldValue(\'title\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'title\')">\n {{getErrorMessage(\'title\')}}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%">\n <input matInput [matDatepicker]="released_on" formControlName="released_on" placeholder="Released on" readonly\n (click)="released_on.open()" required />\n <mat-datepicker-toggle matSuffix [for]="released_on"></mat-datepicker-toggle>\n <mat-datepicker #released_on></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(\'released_on\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'released_on\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'released_on\')">\n {{getErrorMessage(\'released_on\')}}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%">\n <mat-label>Version</mat-label>\n <input matInput formControlName="version" placeholder="Version" autocomplete="off" required />\n <button mat-button *ngIf="getFieldValue(\'version\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'version\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'version\')">\n {{getErrorMessage(\'version\')}}\n </mat-error>\n </mat-form-field>\n\n <mat-form-field fxFlex="100%">\n <mat-label>Learn more link</mat-label>\n <input matInput formControlName="learn_more_link" placeholder="Learn More Link" autocomplete="off" />\n <button mat-button *ngIf="getFieldValue(\'learn_more_link\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'learn_more_link\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'learn_more_link\')">\n {{getErrorMessage(\'learn_more_link\')}}\n </mat-error>\n </mat-form-field>\n\n <div fxFlex="100%">\n <div class="NgxEditor__Wrapper">\n <ngx-editor-menu [toolbar]="toolbar" [editor]="editor"> </ngx-editor-menu>\n <ngx-editor formControlName="description" [editor]="editor" placeholder="Description">\n </ngx-editor>\n </div>\n <mat-error *ngIf="isFieldValid(\'description\')">\n {{getErrorMessage(\'description\')}}\n </mat-error>\n </div>\n </div>\n <div mat-dialog-actions fxFlex="100%" fxLayout fxLayoutAlign="end" fxLayoutGap="1rem">\n <button mat-button class="mt-2" type="button" (click)="dialogRef.close()">\n Cancel\n </button>\n <button mat-raised-button type="submit" class="btn-primary mt-2">\n Save\n </button>\n </div>\n </div>\n</form>',styles:[""]}]}],Oe.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:l.FormBuilder},{type:Ft},{type:st},{type:Pe}]},Oe.propDecorators={onSave:[{type:e.Output}]};var Re=function(){};Re.decorators=[{type:e.NgModule,args:[{declarations:[Oe],imports:[a.CommonModule,l.ReactiveFormsModule,Yt,L.FlexLayoutModule,E.NgxEditorModule],exports:[Oe],entryComponents:[Oe]}]}],t.ɵbl=function(){function t(t,e,n,o){this.dialog=t,this.alertService=e,this.techlifyUpdateService=n,this.fb=o,this.techlifyUpdates=[],this.displayedColumns=["index","title","version","released_on","learn_more_link","description","creator","actions"],this.page=1,this.perPage=25,this.isWorking=!1,this.filterFormGroup=this.fb.group({search:new l.FormControl(""),version:new l.FormControl(""),sort_by:new l.FormControl("released_on|DESC")})}return t.prototype.ngOnInit=function(){this.loadData(),this.listenChanges()},t.prototype.listenChanges=function(){var t=this;this.filterFormGroup.valueChanges.pipe(u.debounceTime(500),r.untilDestroyed(this)).subscribe((function(e){t.reload()}))},t.prototype.ngOnDestroy=function(){},t.prototype.loadData=function(){return $(this,void 0,void 0,(function(){var t,e;return W(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),this.isWorking=!0,(t=this.filterFormGroup.value).perPage=this.perPage,t.page=this.page,[4,this.techlifyUpdateService.getTechlifyUpdates(t)];case 1:return e=n.sent(),this.lastPage=e.last_page||this.page,this.techlifyUpdates=this.techlifyUpdates.concat(e.data),[3,4];case 2:return n.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,4];case 3:return this.isWorking=!1,[7];case 4:return[2]}}))}))},t.prototype.reload=function(){this.techlifyUpdates=[],this.page=1,this.isWorking||this.loadData()},t.prototype.onScroll=function(){!this.isWorking&&this.page<this.lastPage&&(this.page+=1,this.loadData())},t.prototype.modifyTechlifyUpdate=function(t){var e=this;this.dialog.open(Oe,{width:"600px",data:{techlifyUpdateDetails:t}}).afterClosed().subscribe((function(t){t&&e.reload()}))},t.prototype.deleteTechlifyUpdate=function(t){return $(this,void 0,void 0,(function(){var e=this;return W(this,(function(n){return this.dialog.open(G,{width:"400px",data:{title:"Delete Update",message:"Are you sure to delete this update?"},autoFocus:!1}).afterClosed().subscribe((function(n){return $(e,void 0,void 0,(function(){return W(this,(function(e){switch(e.label){case 0:if(!n)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.techlifyUpdateService.deleteTechlifyUpdate(t.id)];case 2:return e.sent(),this.alertService.addAlert("Successfully deleted the update","success"),this.reload(),[3,4];case 3:return e.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,4];case 4:return[2]}}))}))})),[2]}))}))},t.prototype.resetFieldValue=function(t){this.filterFormGroup.get(t).setValue("")},t.prototype.sortColumn=function(t){var e=t.direction.toString().toUpperCase();this.assignFilter(t.active,e)},t.prototype.assignFilter=function(t,e){switch(t){case"title":return this.filterFormGroup.get("sort_by").setValue("title|"+e);case"released_on":return this.filterFormGroup.get("sort_by").setValue("released_on|"+e);case"version":return this.filterFormGroup.get("sort_by").setValue("version|"+e);default:return this.filterFormGroup.get("sort_by").setValue("created_at|DESC")}},t}(),t.ɵbl.decorators=[{type:e.Component,args:[{selector:"app-techlify-updates-list",template:'<section class="p-4" fxLayout="column">\n <h3 class="primary-color text-center">\n App Updates\n <button mat-raised-button (click)="modifyTechlifyUpdate()" class="primary-bg text-white">\n <mat-icon>\n add\n </mat-icon>\n Create\n </button>\n </h3>\n <form [formGroup]="filterFormGroup" fxLayout="row wrap" fxLayoutGap="0.5rem" fxFlex="100%" style="font-size: 12px;">\n <mat-form-field fxFlex="0 1 calc(100% - 0.5rem)" fxFlex.gt-md="0 1 calc(15% - 0.5rem)" appearance="outline"\n fxFlex.gt-sm="0 1 calc(20% - 0.5rem)">\n <input type="text" matInput formControlName="search" placeholder="Title" autocomplete="off" />\n <button mat-button *ngIf="filterFormGroup.get(\'search\').value" matSuffix mat-icon-button\n (click)="resetFieldValue(\'search\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field fxFlex="0 1 calc(100% - 0.5rem)" fxFlex.gt-md="0 1 calc(15% - 0.5rem)" appearance="outline"\n fxFlex.gt-sm="0 1 calc(20% - 0.5rem)">\n <input type="text" matInput formControlName="version" placeholder="Version" autocomplete="off" />\n <button mat-button *ngIf="filterFormGroup.get(\'version\').value" matSuffix mat-icon-button\n (click)="resetFieldValue(\'version\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </form>\n\n <table mat-table [dataSource]="techlifyUpdates" class="mat-elevation-z8 w-100" matSort multiTemplateDataRows\n (matSortChange)="sortColumn($event)" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let element;let i=dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n \x3c!-- Course Column --\x3e\n <ng-container matColumnDef="title">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Title </th>\n <td mat-cell *matCellDef="let element"> {{element?.title}} </td>\n </ng-container>\n\n \x3c!-- Version Column --\x3e\n <ng-container matColumnDef="version">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Version </th>\n <td mat-cell *matCellDef="let element"> {{element?.version}} </td>\n </ng-container>\n\n \x3c!-- Released On Column --\x3e\n <ng-container matColumnDef="released_on">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Released On </th>\n <td mat-cell *matCellDef="let element"> {{element?.released_on | date:\'mediumDate\'}} </td>\n </ng-container>\n\n \x3c!-- Learn More Link Column --\x3e\n <ng-container matColumnDef="learn_more_link">\n <th mat-header-cell *matHeaderCellDef> Learn more link </th>\n <td mat-cell *matCellDef="let element">\n <a [href]="element?.learn_more_link" target="_blank">\n {{element?.learn_more_link}}\n </a>\n </td>\n </ng-container>\n\n \x3c!-- Description Column --\x3e\n <ng-container matColumnDef="description">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef="let element">\n <app-read-more [text]="element?.description" [maxLength]="50"></app-read-more>\n </td>\n </ng-container>\n\n \x3c!-- Creator Column --\x3e\n <ng-container matColumnDef="creator">\n <th mat-header-cell *matHeaderCellDef> Creator </th>\n <td mat-cell *matCellDef="let element">\n {{element?.creator?.name}}\n <div fxLayout class="small">\n {{element?.created_at | date : \'mediumDate\'}}\n </div>\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let element" class="secondary-color">\n <button type="button" class="secondary-color" mat-icon-button (click)="modifyTechlifyUpdate(element)">\n <mat-icon>edit</mat-icon>\n </button>\n\n <button type="button" class="secondary-color" mat-icon-button (click)="deleteTechlifyUpdate(element)">\n <mat-icon>delete</mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n</section>\n',styles:[""]}]}],t.ɵbl.ctorParameters=function(){return[{type:n.MatDialog},{type:st},{type:Pe},{type:l.FormBuilder}]},t.ɵbl=z([r.UntilDestroy()],t.ɵbl);var Ne=[{path:"",redirectTo:"all",pathMatch:"full"},{path:"all",component:t.ɵbl},{path:"**",redirectTo:"all",pathMatch:"full"}],He=function(){};He.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Ne)],exports:[y.RouterModule]}]}];var Ge=function(){};Ge.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbl],imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,L.FlexLayoutModule,Yt,Jt,He,Re,ne]}]}];var qe=function(){function t(t,e,n){this.dialogRef=t,this.data=e,this.router=n}return t.prototype.ngOnInit=function(){this.techlifyUpdate=this.data.techlifyUpdate,this.rootNavUrl=this.data.rootNavUrl},t.prototype.close=function(){this.dialogRef.close()},t.prototype.openUpdateHistory=function(){this.close(),this.router.navigate([this.rootNavUrl+"/update-history"])},t}();qe.decorators=[{type:e.Component,args:[{selector:"app-update-view",template:'<div fxLayout="column">\n <div mat-dialog-title class="text-center">\n <div fxLayout="row wrap" fxLayoutAlign="space-between">\n <div fxFlex="80%">\n <div fxLayout="row wrap" fxLayoutGap="1rem">\n <span fxFlex="calc(10%-1rem)" fxLayoutAlign="start center">\n <mat-icon class="large-icon primary-color">\n <span class="material-icons-outlined">\n grading\n </span>\n </mat-icon>\n </span>\n <div fxFlex="calc(90%-1rem)">\n <div fxLayout="column" fxLayoutAlign="start">\n <div fxLayout>\n <h5 class="primary-color" style="margin-bottom:0;text-align: left;">\n App Update: {{techlifyUpdate?.title}}\n </h5>\n </div>\n <div fxLayout="row" fxLayoutGap="1rem">\n <small class="text-muted">\n <b>Release On</b> : {{techlifyUpdate?.released_on | date: \'mediumDate\'}}\n </small>\n <small class="text-muted">\n <b>Version</b> : {{techlifyUpdate?.version}}\n </small>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div fxLayoutAlign="end center" class="text-muted">\n <button mat-icon-button type="button" (click)="close()">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n </div>\n </div>\n\n <div mat-dialog-content style="height: 500px;overflow: auto;">\n <div fxLayout="column" class="text-muted" style="margin-top: 1rem;" [innerHtml]="techlifyUpdate?.description">\n </div>\n </div>\n\n <div mat-dialog-actions fxLayout="row" [fxLayoutAlign]="!this.data?.isFromHistory ? \'space-between\' : \'end\'">\n <button type="button" mat-button class="primary-color" (click)="openUpdateHistory()"\n *ngIf="!this.data?.isFromHistory">\n <mat-icon>\n history\n </mat-icon>\n Update History\n </button>\n <a *ngIf="techlifyUpdate?.learn_more_link" [href]="techlifyUpdate?.learn_more_link" target="_blank"\n style="text-decoration: none;">\n <button type="button" mat-button class="text-muted">\n Learn More\n </button>\n </a>\n <button type="button" mat-stroked-button class="primary-color" (click)="close()">\n OK\n </button>\n </div>\n</div>\n',styles:[".large-icon{transform:scale(2.3)}.primary-color{color:#009fdd!important}.primary-bg{background-color:#009fdd!important}.text-muted,.text-white{color:#d3d3d3}"]}]}],qe.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:y.Router}]},t.ɵbr=function(){function t(t,e,n,o){this.dialog=t,this.techlifyUpdateService=e,this.fb=n,this.alertService=o,this.techlifyUpdates=[],this.displayedColumns=["index","title","version","released_on","learn_more_link","description","creator","actions"],this.page=1,this.perPage=25,this.isWorking=!1,this.filterFormGroup=this.fb.group({search:new l.FormControl(""),version:new l.FormControl(""),sort_by:new l.FormControl("released_on|DESC")})}return t.prototype.ngOnInit=function(){this.loadData(),this.listenChanges(),this.updateCurrentUserUpdates()},t.prototype.listenChanges=function(){var t=this;this.filterFormGroup.valueChanges.pipe(u.debounceTime(500),r.untilDestroyed(this)).subscribe((function(e){t.reload()}))},t.prototype.ngOnDestroy=function(){},t.prototype.loadData=function(){return $(this,void 0,void 0,(function(){var t,e;return W(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),this.isWorking=!0,(t=this.filterFormGroup.value).perPage=this.perPage,t.page=this.page,[4,this.techlifyUpdateService.getTechlifyUpdates(t)];case 1:return e=n.sent(),this.lastPage=e.last_page||this.page,this.techlifyUpdates=this.techlifyUpdates.concat(e.data),[3,4];case 2:return n.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,4];case 3:return this.isWorking=!1,[7];case 4:return[2]}}))}))},t.prototype.reload=function(){this.techlifyUpdates=[],this.page=1,this.isWorking||this.loadData()},t.prototype.onScroll=function(){!this.isWorking&&this.page<this.lastPage&&(this.page+=1,this.loadData())},t.prototype.resetFieldValue=function(t){this.filterFormGroup.get(t).setValue("")},t.prototype.sortColumn=function(t){var e=t.direction.toString().toUpperCase();this.assignFilter(t.active,e)},t.prototype.assignFilter=function(t,e){switch(t){case"title":return this.filterFormGroup.get("sort_by").setValue("title|"+e);case"released_on":return this.filterFormGroup.get("sort_by").setValue("released_on|"+e);case"version":return this.filterFormGroup.get("sort_by").setValue("version|"+e);default:return this.filterFormGroup.get("sort_by").setValue("created_at|DESC")}},t.prototype.openUpdateView=function(t){this.dialog.open(qe,{width:"800px",autoFocus:!1,data:{techlifyUpdate:t,isFromHistory:!0}})},t.prototype.updateCurrentUserUpdates=function(){return $(this,void 0,void 0,(function(){return W(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.techlifyUpdateService.updateCurrentUserUpdates()];case 1:return t.sent(),[3,3];case 2:return t.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,3];case 3:return[2]}}))}))},t}(),t.ɵbr.decorators=[{type:e.Component,args:[{selector:"app-techlify-update-history",template:'<section class="p-4" fxLayout="column">\n <h3 class="primary-color text-center">\n App Updates\n </h3>\n <form [formGroup]="filterFormGroup" fxLayout="row wrap" fxLayoutGap="0.5rem" fxFlex="100%" style="font-size: 12px;">\n <mat-form-field fxFlex="0 1 calc(100% - 0.5rem)" fxFlex.gt-md="0 1 calc(15% - 0.5rem)" appearance="outline"\n fxFlex.gt-sm="0 1 calc(20% - 0.5rem)">\n <input type="text" matInput formControlName="search" placeholder="Title" autocomplete="off" />\n <button mat-button *ngIf="filterFormGroup.get(\'search\').value" matSuffix mat-icon-button\n (click)="resetFieldValue(\'search\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n <mat-form-field fxFlex="0 1 calc(100% - 0.5rem)" fxFlex.gt-md="0 1 calc(15% - 0.5rem)" appearance="outline"\n fxFlex.gt-sm="0 1 calc(20% - 0.5rem)">\n <input type="text" matInput formControlName="version" placeholder="Version" autocomplete="off" />\n <button mat-button *ngIf="filterFormGroup.get(\'version\').value" matSuffix mat-icon-button\n (click)="resetFieldValue(\'version\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </form>\n\n <table mat-table [dataSource]="techlifyUpdates" class="mat-elevation-z8 w-100" matSort multiTemplateDataRows\n (matSortChange)="sortColumn($event)" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let element;let i=dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n \x3c!-- Course Column --\x3e\n <ng-container matColumnDef="title">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Title </th>\n <td mat-cell *matCellDef="let element"> {{element?.title}} </td>\n </ng-container>\n\n \x3c!-- Version Column --\x3e\n <ng-container matColumnDef="version">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Version </th>\n <td mat-cell *matCellDef="let element"> {{element?.version}} </td>\n </ng-container>\n\n \x3c!-- Released On Column --\x3e\n <ng-container matColumnDef="released_on">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Released On </th>\n <td mat-cell *matCellDef="let element"> {{element?.released_on | date:\'mediumDate\'}} </td>\n </ng-container>\n\n \x3c!-- Learn More Link Column --\x3e\n <ng-container matColumnDef="learn_more_link">\n <th mat-header-cell *matHeaderCellDef> Learn more link </th>\n <td mat-cell *matCellDef="let element">\n <a [href]="element?.learn_more_link" target="_blank">\n {{element?.learn_more_link}}\n </a>\n </td>\n </ng-container>\n\n \x3c!-- Description Column --\x3e\n <ng-container matColumnDef="description">\n <th mat-header-cell *matHeaderCellDef> Description </th>\n <td mat-cell *matCellDef="let element">\n <app-read-more [text]="element?.description" [maxLength]="50"></app-read-more>\n </td>\n </ng-container>\n\n \x3c!-- Creator Column --\x3e\n <ng-container matColumnDef="creator">\n <th mat-header-cell *matHeaderCellDef> Creator </th>\n <td mat-cell *matCellDef="let element">\n {{element?.creator?.name}}\n <div fxLayout class="small">\n {{element?.created_at | date : \'mediumDate\'}}\n </div>\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let element" class="secondary-color">\n <button type="button" class="secondary-color" mat-icon-button (click)="openUpdateView(element)">\n <mat-icon>remove_red_eye</mat-icon>\n </button>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n</section>\n',styles:[""]}]}],t.ɵbr.ctorParameters=function(){return[{type:n.MatDialog},{type:Pe},{type:l.FormBuilder},{type:st}]},t.ɵbr=z([r.UntilDestroy()],t.ɵbr);var Be=[{path:"",redirectTo:"update-history",pathMatch:"full"},{path:"update-history",component:t.ɵbr},{path:"**",redirectTo:"all",pathMatch:"full"}],ze=function(){};ze.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Be)],exports:[y.RouterModule]}]}];var $e=function(){};$e.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,L.FlexLayoutModule,Yt,Jt,ne,ze],declarations:[t.ɵbr]}]}];var We=function(){};We.decorators=[{type:e.NgModule,args:[{declarations:[qe],imports:[a.CommonModule,Yt,L.FlexLayoutModule],exports:[qe],entryComponents:[qe]}]}];var Ye=function(){function t(t,e,n,o,i,r){this.data=t,this.snackBarRef=e,this.dialog=n,this.router=o,this.techlifyUpdateService=i,this.alertService=r,this.maxDescriptionLength=70,this.descriptionText=""}return t.prototype.ngOnInit=function(){var t;this.techlifyUpdate=this.data.techlifyUpdate,this.rootNavUrl=this.data.rootNavUrl,this.determineDescription(null===(t=this.techlifyUpdate)||void 0===t?void 0:t.description)},t.prototype.close=function(){this.createUpdateViewRecord(),this.snackBarRef.dismiss()},t.prototype.determineDescription=function(t){!t||t.length<=this.maxDescriptionLength?this.descriptionText=t:this.descriptionText=t.substring(0,this.maxDescriptionLength)+"..."},t.prototype.openUpdateView=function(){this.close();this.dialog.open(qe,{width:"800px",autoFocus:!1,data:{techlifyUpdate:this.techlifyUpdate,rootNavUrl:this.data.rootNavUrl}})},t.prototype.openUpdateHistory=function(){this.close(),this.router.navigate([this.rootNavUrl+"/update-history"])},t.prototype.createUpdateViewRecord=function(){var t;return $(this,void 0,void 0,(function(){var e;return W(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e={update_id:null===(t=this.techlifyUpdate)||void 0===t?void 0:t.id},[4,this.techlifyUpdateService.createUpdateViewRecord(e)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,3];case 3:return[2]}}))}))},t}();Ye.decorators=[{type:e.Component,args:[{selector:"app-update-notifier-snack",template:'<div fxLayout="column">\n <div fxLayout="row wrap" fxLayoutAlign="space-between">\n <div fxLayout="row wrap" fxLayoutGap="1rem">\n <span fxLayoutAlign="center center">\n <mat-icon class="large-icon primary-color">\n <span class="material-icons-outlined">\n grading\n </span>\n </mat-icon>\n </span>\n <div fxLayout="column">\n <h5 class="primary-color text-truncate" matTooltip="{{techlifyUpdate?.title}}" matTooltipPosition="below">\n App Update: {{techlifyUpdate?.title}}\n </h5>\n <small class="text-muted">\n Version : {{techlifyUpdate?.version}}\n </small>\n </div>\n </div>\n <div fxLayoutAlign="end center" class="text-muted">\n <button mat-icon-button type="button" (click)="close()">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout="row" class="text-muted" style="margin-top: 1rem;" [innerHtml]="descriptionText">\n </div>\n <div fxLayout="row" fxLayoutAlign="space-between">\n <button type="button" mat-button class="primary-color" (click)="openUpdateHistory()">\n <mat-icon>\n history\n </mat-icon>\n Update History\n </button>\n <button type="button" mat-raised-button class="primary-bg text-white" (click)="openUpdateView()">\n View\n </button>\n </div>\n</div>\n',styles:[".large-icon{transform:scale(1.5)}.primary-color{color:#009fdd!important}.primary-bg{background-color:#009fdd!important}.text-muted,.text-white{color:#d3d3d3}.text-truncate{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:400px}@media screen and (max-width:1440px){.text-truncate{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:350px}}@media screen and (max-width:1024px){.text-truncate{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:220px;width:190px}}"]}]}],Ye.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[d.MAT_SNACK_BAR_DATA]}]},{type:d.MatSnackBarRef},{type:n.MatDialog},{type:y.Router},{type:Pe},{type:st}]};var Ke=function(){function t(t,e,n){this.snackBar=t,this.techlifyUpdateService=e,this.alertService=n,this.rootNavUrl="/techlify-updates"}return t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(e){t.getNewUpdate()}),5e3)},t.prototype.getNewUpdate=function(){return $(this,void 0,void 0,(function(){var t;return W(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.techlifyUpdateService.getNewUpdateForCurrentUser()];case 1:return t=e.sent(),this.techlifyUpdate=t.item,this.techlifyUpdate&&this.showUpdate(),[3,3];case 2:return e.sent(),this.alertService.addAlert("Unable to process, try later","warn"),[3,3];case 3:return[2]}}))}))},t.prototype.showUpdate=function(){this.snackBar.openFromComponent(Ye,{data:{techlifyUpdate:this.techlifyUpdate,rootNavUrl:this.rootNavUrl},horizontalPosition:"right",verticalPosition:"top",panelClass:["white-bg"]})},t}();Ke.decorators=[{type:e.Component,args:[{selector:"app-update-notifier",template:"",styles:["::ng-deep .white-bg{background-color:#fff}"]}]}],Ke.ctorParameters=function(){return[{type:d.MatSnackBar},{type:Pe},{type:st}]},Ke.propDecorators={rootNavUrl:[{type:e.Input}]};var Je=function(){};Je.decorators=[{type:e.NgModule,args:[{declarations:[Ke,Ye],imports:[a.CommonModule,Yt,We,L.FlexLayoutModule,Jt],exports:[Ke],entryComponents:[Ye]}]}];var Qe=function(){function t(){this.name="Export_Data",this.data=[]}return t.prototype.ngOnInit=function(){},t.prototype.exportExcel=function(){var t=this.name+"_"+(new Date).getTime()+".xlsx",e=V.utils.json_to_sheet(this.data),n=V.utils.book_new();V.utils.book_append_sheet(n,e,"Sheet1"),V.writeFile(n,t)},t}();Qe.decorators=[{type:e.Component,args:[{selector:"app-export-excel-button",template:'<button mat-raised-button color="accent" (click)="exportExcel()">Export Excel</button>',styles:[""]}]}],Qe.ctorParameters=function(){return[]},Qe.propDecorators={name:[{type:e.Input}],data:[{type:e.Input}]};var Ze=function(){};Ze.decorators=[{type:e.NgModule,args:[{declarations:[Qe],imports:[a.CommonModule,Yt],exports:[Qe]}]}],t.AuditLogViewModelComponent=function(){function t(t,e,n){this.dialogRef=t,this.data=e,this.http=n,this.showDeltaChanges=!1,this.changeList=[]}return t.prototype.ngOnInit=function(){var t,e,n=this;this.data&&this.http.get("api/recent-log-for-model",{params:{model_type:null===(t=this.data)||void 0===t?void 0:t.modelType,model_id:null===(e=this.data)||void 0===e?void 0:e.modelId}}).pipe(r.untilDestroyed(this)).subscribe((function(t){n.logInfo=null==t?void 0:t.item,n.getTransformedChanges()}))},t.prototype.getTransformedChanges=function(){var t,e,n,o,i=this;(null===(e=null===(t=this.logInfo)||void 0===t?void 0:t.data)||void 0===e?void 0:e.changes)&&(Object.keys(null===(o=null===(n=this.logInfo)||void 0===n?void 0:n.data)||void 0===o?void 0:o.changes)||[]).forEach((function(t){var e,n,o,r,a=t.split("_").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" ");i.changeList.push({displayAttribute:a,attribute:t,newValue:null!==(n=null===(e=i.logInfo)||void 0===e?void 0:e.object[t])&&void 0!==n?n:"",oldValue:null!==(r=null===(o=i.logInfo)||void 0===o?void 0:o.pre_object[t])&&void 0!==r?r:""})}))},t.prototype.close=function(){this.dialogRef.close()},t}(),t.AuditLogViewModelComponent.decorators=[{type:e.Component,args:[{selector:"app-audit-log-view",template:'<div fxLayout="column" class="m-4" fxLayoutGap="1.5rem">\n <h3 class="text-center">Audit Log</h3>\n <div fxLayout="column" fxLayoutGap="0.5rem" *ngIf="logInfo">\n <div>Object Type: {{logInfo?.object_type}}</div>\n <div>Object Id: {{logInfo?.object_id}}</div>\n <div>Action: {{logInfo?.action}}</div>\n <div>Created At: {{logInfo?.created_at | date:\'medium\'}}</div>\n <div>Created By: {{logInfo?.user?.email}}</div>\n </div>\n\n\n <div class="container" *ngIf="changeList.length > 0">\n <h4 class="font-weight-bold"> Changes in Attributes</h4>\n <table class="table table-striped table-sm border">\n <thead>\n <tr>\n <th scope="col">#</th>\n <th scope="col">Attribute</th>\n <th scope="col">Old Value</th>\n <th scope="col">New Value</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let change of changeList; let i= index;">\n <th scope="row">{{i+1}}</th>\n <td>{{change?.displayAttribute}}</td>\n <td>{{change?.oldValue}}</td>\n <td>{{change?.newValue}}</td>\n </tr>\n </tbody>\n </table>\n\n </div>\n\n <div>\n <button mat-raised-button (click)="close()">Close</button>\n </div>\n</div>',styles:[".scroll-container{max-height:400px;overflow:auto}"]}]}],t.AuditLogViewModelComponent.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:Ct}]},t.AuditLogViewModelComponent=z([r.UntilDestroy()],t.AuditLogViewModelComponent),t.AuditLogsViewModelComponent=function(){function t(t,e,n){this.dialogRef=t,this.data=e,this.router=n}return t.prototype.ngOnInit=function(){var t=this;this.router.events.pipe(u.filter((function(t){return t instanceof y.NavigationEnd})),r.untilDestroyed(this)).subscribe((function(e){return t.dialogRef.close()}))},t}(),t.AuditLogsViewModelComponent.decorators=[{type:e.Component,args:[{selector:"app-audit-logs-view-model",template:'<div fxLayout="column" class="m-4" fxLayoutGap="1.5rem">\n <app-audit-log-list [objectId]="data?.modelId" [objectType]="data?.modelType" [showExportButtons]="false">\n </app-audit-log-list>\n</div>',styles:["::ng-deep app-audit-log-list .scroll-container{height:350px!important;overflow-y:scroll}"]}]}],t.AuditLogsViewModelComponent.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:y.Router}]},t.AuditLogsViewModelComponent=z([r.UntilDestroy()],t.AuditLogsViewModelComponent);var Xe=function(){function e(t){this.dialog=t,this.logView="recent"}return e.prototype.ngOnInit=function(){},e.prototype.getLogView=function(){this.dialog.open(t.AuditLogViewModelComponent,{width:"800px",autoFocus:!1,data:{modelType:this.modelType,modelId:this.modelId}})},e.prototype.getLogsView=function(){this.dialog.open(t.AuditLogsViewModelComponent,{width:"95%",maxWidth:"unset",autoFocus:!1,data:{modelType:this.modelType,modelId:this.modelId}})},e}();Xe.decorators=[{type:e.Component,args:[{selector:"app-audit-log-for-model",template:'<button type="button" *ngIf="logView===\'recent\'" mat-icon-button matTooltip="Recent Audit Log"\n (click)="$event.stopPropagation();getLogView()">\n <mat-icon>history</mat-icon>\n</button>\n\n<button type="button" *ngIf="logView===\'all\'" mat-icon-button matTooltip="All Audit Logs"\n (click)="$event.stopPropagation();getLogsView()">\n <mat-icon>history</mat-icon>\n</button>',styles:[""]}]}],Xe.ctorParameters=function(){return[{type:n.MatDialog}]},Xe.propDecorators={modelType:[{type:e.Input}],modelId:[{type:e.Input}],logView:[{type:e.Input}]};var tn=function(){};tn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var en=function(){};en.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var nn=function(){};nn.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogViewModelComponent],imports:[a.CommonModule,en,L.FlexLayoutModule,Yt],exports:[t.AuditLogViewModelComponent]}]}];var on=function(){};on.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var rn=function(){};rn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}],t.AuditLogListComponent=function(){function t(t,e,n){this.dataManager=t,this.router=e,this.sanitizer=n,this.auditLogList=[],this.showFilter=!0,this.showExportButtons=!0,this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc"},this.displayedColumns=["index","id","object_type","object_id","action","changes","created_at","user.email"]}return t.prototype.ngOnInit=function(){var t=this;this.initializeData(),this.sort&&this.sort.sortChange.pipe(r.untilDestroyed(this)).subscribe((function(e){t.changeSort(e)}))},Object.defineProperty(t.prototype,"excelData",{get:function(){return this.auditLogList.length>0?this.auditLogList.map((function(t){var e;return{Type:null==t?void 0:t.object_type,Action:null==t?void 0:t.action,Data:JSON.stringify((null==t?void 0:t.data)||{}),Object:JSON.stringify((null==t?void 0:t.object)||{}),"Pre-Object":JSON.stringify((null==t?void 0:t.pre_object)||{}),"Created At":new Date(null==t?void 0:t.created_at).toDateString(),"Created By":null===(e=null==t?void 0:t.user)||void 0===e?void 0:e.email}})):[]},enumerable:!1,configurable:!0}),t.prototype.changeSort=function(t){t.direction&&(this.filters.sort_by=t.active+"|"+t.direction,this.reload())},t.prototype.logClicked=function(t){this.router.navigate(["/system/audit-logs/log-view",t.id])},t.prototype.initializeData=function(){return $(this,void 0,void 0,(function(){var t;return W(this,(function(e){switch(e.label){case 0:return this.objectType&&(this.filters=Object.assign(Object.assign({},this.filters),{object_type:this.objectType})),this.objectId&&(this.filters=Object.assign(Object.assign({},this.filters),{object_id:this.objectId})),this.userId&&(this.filters=Object.assign(Object.assign({},this.filters),{user_id:this.userId})),[4,this.dataManager.GET("api/audit-logs",Object.assign(Object.assign({},this.filters),this.pageEvent))];case 1:return t=e.sent(),this.auditLogList=this.auditLogList.concat(t.data),this.pageEvent.page=t.current_page,this.pageEvent.lastPage=t.last_page,[2]}}))}))},t.prototype.filterChange=function(t){this.showFilter&&(this.filters=Object.assign(Object.assign(Object.assign({},this.filters),t),{object_type:this.objectType||(null==t?void 0:t.object_type)||"",object_id:this.objectId||""}),this.reload())},t.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.initializeData())},t.prototype.reload=function(){this.auditLogList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.initializeData()},t.prototype.getTransformedChanges=function(t){var e,n;if(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.changes){var o=Object.keys(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.changes)||[],i="<div>";return o.forEach((function(e){var n,o,r=e.split("_").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" ");i=i+" <div><b>"+r+':</b> <span id="old-value">'+(null!==(n=null==t?void 0:t.pre_object[e])&&void 0!==n?n:"")+'</span><span id="new-value">'+(null!==(o=null==t?void 0:t.object[e])&&void 0!==o?o:"")+"</span></div>"})),i+=" </div>"}return""},t.prototype.ngOnDestroy=function(){},t}(),t.AuditLogListComponent.decorators=[{type:e.Component,args:[{selector:"app-audit-log-list",template:'<div fxLayout="column" fxLayoutAlign="start" class="mat-typography">\n\n <div fxLayout="column" fxLayoutAlign="start" fxLayoutGap="1.5rem" class="p-3">\n <h2 class="font-weight-bold">\n Audit Logs\n </h2>\n\n <div fxLayout="row wrap" fxLayoutAlign="start center">\n <app-audit-log-list-filter *ngIf="showFilter" (valueChange)="filterChange($event)" [objectType]="objectType"\n [objectId]="objectId"></app-audit-log-list-filter>\n <span fxFlex></span>\n\n <ng-container *ngIf="showExportButtons">\n <div class="ml-4">\n <app-export-excel-button elementId="audit-logs-table" name="AuditLogs" [data]="excelData">\n </app-export-excel-button>\n </div>\n </ng-container>\n </div>\n </div>\n\n <section class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="auditLogList" matSort class="w-100" multiTemplateDataRows id="audit-logs-table">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let auditLog; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n <ng-container matColumnDef="id">\n <th mat-header-cell *matHeaderCellDef> Log # </th>\n <td mat-cell *matCellDef="let auditLog">\n {{auditLog?.id}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="object_type">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Model </th>\n <td mat-cell *matCellDef="let auditLog;"> {{ auditLog.object_type }} </td>\n </ng-container>\n\n <ng-container matColumnDef="object_id">\n <th mat-header-cell *matHeaderCellDef> Model # </th>\n <td mat-cell *matCellDef="let auditLog">\n {{auditLog?.object_id}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="action">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Action </th>\n <td mat-cell *matCellDef="let auditLog;"> {{ auditLog?.action }} </td>\n </ng-container>\n\n <ng-container matColumnDef="created_at">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Created At </th>\n <td mat-cell *matCellDef="let auditLog">\n {{auditLog?.created_at | date:\'medium\'}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="user.email">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Created By </th>\n <td mat-cell *matCellDef="let auditLog">\n {{auditLog?.user?.email}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef="changes">\n <th mat-header-cell *matHeaderCellDef> Changes</th>\n <td mat-cell *matCellDef="let auditLog">\n <div class="px-3" [innerHtml]="sanitizer.bypassSecurityTrustHtml(getTransformedChanges(auditLog))">\n\n </div>\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef> Actions </th>\n <td mat-cell *matCellDef="let auditLog">\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"\n (click)="logClicked(row);$event.stopPropagation();" class="hoverable row-hover"></tr>\n </table>\n </section>\n\n\n</div>',styles:["tr.row-hover:hover{background-color:#dcdcdc}.scroll-container{height:800px;overflow-y:auto}:host ::ng-deep #old-value{background-color:#f08080;margin-right:5px}:host ::ng-deep #new-value{background-color:#98fb98}"]}]}],t.AuditLogListComponent.ctorParameters=function(){return[{type:Wt},{type:y.Router},{type:U.DomSanitizer}]},t.AuditLogListComponent.propDecorators={objectId:[{type:e.Input}],objectType:[{type:e.Input}],showFilter:[{type:e.Input}],showExportButtons:[{type:e.Input}],userId:[{type:e.Input}],sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}]},t.AuditLogListComponent=z([r.UntilDestroy()],t.AuditLogListComponent);var an=function(){};function ln(){return function(t){var e=new Date(t.value);return t.value&&"Invalid Date"==e?{invalidDate:!0}:null}}an.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}],t.AuditLogListFilterComponent=function(){function t(t,n){this.fb=t,this.formValidatorService=n,this.valueChange=new e.EventEmitter,this.createForm()}return Object.defineProperty(t.prototype,"showObjectFilter",{get:function(){return!(this.objectId||this.objectType)},enumerable:!1,configurable:!0}),t.prototype.createForm=function(){this.auditLogFilterForm=this.fb.group({object_type:[""],action:[""],data:[""],date_to:["",ln()],date_from:["",ln()]})},t.prototype.ngOnInit=function(){var t=this;this.auditLogFilterForm.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){e.date_from=e.date_from?e.date_from.toISOString():"",e.date_to=e.date_to?e.date_to.toISOString():"",t.valueChange.emit(e)}))},t.prototype.resetFieldValue=function(t){this.auditLogFilterForm.get(t).setValue("")},t.prototype.getFieldValue=function(t){return this.auditLogFilterForm.get(t).value},t.prototype.isFieldValid=function(t){return this.formValidatorService.isFieldValid(t,this.auditLogFilterForm,!0)},t.prototype.ngOnDestroy=function(){},t}(),t.AuditLogListFilterComponent.decorators=[{type:e.Component,args:[{selector:"app-audit-log-list-filter",template:'<form [formGroup]="auditLogFilterForm" fxLayout="row wrap" fxLayoutGap="1rem" fxLayoutAlign="start center">\n <mat-form-field *ngIf="showObjectFilter">\n <mat-label>Model</mat-label>\n <app-searchable-selector formControlName="object_type" apiUrl="api/audit-log-types" titleField="object_type"\n valueField="object_type" [sort]="false" [enableSearch]="false">\n </app-searchable-selector>\n <button mat-button *ngIf="getFieldValue(\'object_type\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'object_type\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field>\n <mat-label>Action</mat-label>\n <mat-select formControlName="action">\n <mat-option value="created">Created</mat-option>\n <mat-option value="updated">Updated</mat-option>\n <mat-option value="deleted">Deleted</mat-option>\n </mat-select>\n <button mat-button *ngIf="getFieldValue(\'action\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'action\')">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field>\n <input matInput formControlName="date_from" [matDatepicker]="fromPicker" (click)="fromPicker.open()"\n placeholder="From Date (MM/DD/YYYY)" />\n <mat-datepicker-toggle matSuffix [for]="fromPicker"></mat-datepicker-toggle>\n <mat-datepicker #fromPicker></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(\'date_from\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'date_from\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'date_from\')">Invalid Date</mat-error>\n </mat-form-field>\n\n <mat-form-field>\n <input matInput formControlName="date_to" [matDatepicker]="toPicker" (click)="toPicker.open()"\n placeholder="To Date (MM/DD/YYYY)" />\n <mat-datepicker-toggle matSuffix [for]=""></mat-datepicker-toggle>\n <mat-datepicker #toPicker></mat-datepicker>\n <button mat-button *ngIf="getFieldValue(\'date_to\')" matSuffix mat-icon-button\n (click)="resetFieldValue(\'date_to\')">\n <mat-icon>close</mat-icon>\n </button>\n <mat-error *ngIf="isFieldValid(\'date_to\')">Invalid Date</mat-error>\n </mat-form-field>\n</form>',styles:[""]}]}],t.AuditLogListFilterComponent.ctorParameters=function(){return[{type:l.FormBuilder},{type:Ft}]},t.AuditLogListFilterComponent.propDecorators={objectId:[{type:e.Input}],objectType:[{type:e.Input}],valueChange:[{type:e.Output}]},t.AuditLogListFilterComponent=z([r.UntilDestroy()],t.AuditLogListFilterComponent);var sn=function(){};sn.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogListFilterComponent],imports:[a.CommonModule,an,L.FlexLayoutModule,l.ReactiveFormsModule,Yt,ie],exports:[t.AuditLogListFilterComponent]}]}];var cn=function(){};cn.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogListComponent],imports:[a.CommonModule,rn,Ze,L.FlexLayoutModule,l.ReactiveFormsModule,Yt,k.InfiniteScrollModule,sn],exports:[t.AuditLogListComponent]}]}];var un=function(){};un.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogsViewModelComponent],imports:[a.CommonModule,on,L.FlexLayoutModule,cn],exports:[t.AuditLogsViewModelComponent]}]}];var dn=function(){};dn.decorators=[{type:e.NgModule,args:[{declarations:[Xe],imports:[nn,un,a.CommonModule,tn,L.FlexLayoutModule,Yt],exports:[Xe]}]}];var pn=function(){function t(t,e,n){this.dataManager=t,this.route=e,this.location=n,this.showDeltaChanges=!1,this.changeList=[]}return t.prototype.ngOnInit=function(){var t=this;this.route.paramMap.subscribe((function(e){e.get("id")?t.fetchLogDetail(e.get("id")):t.location.back()}))},t.prototype.getTransformedChanges=function(){var t,e,n,o,i=this;(null===(e=null===(t=this.logInfo)||void 0===t?void 0:t.data)||void 0===e?void 0:e.changes)&&(Object.keys(null===(o=null===(n=this.logInfo)||void 0===n?void 0:n.data)||void 0===o?void 0:o.changes)||[]).forEach((function(t){var e,n,o,r,a=t.split("_").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" ");i.changeList.push({displayAttribute:a,attribute:t,newValue:null!==(n=null===(e=i.logInfo)||void 0===e?void 0:e.object[t])&&void 0!==n?n:"",oldValue:null!==(r=null===(o=i.logInfo)||void 0===o?void 0:o.pre_object[t])&&void 0!==r?r:""})}))},t.prototype.fetchLogDetail=function(t){return $(this,void 0,void 0,(function(){var e;return W(this,(function(n){switch(n.label){case 0:return[4,this.dataManager.GET("api/audit-logs/"+t)];case 1:return e=n.sent(),this.logInfo=e.item,this.getTransformedChanges(),this.patchDelta(),[2]}}))}))},t.prototype.patchDelta=function(){var t,e,n,o=P.diff(null===(t=this.logInfo)||void 0===t?void 0:t.pre_object,null===(e=this.logInfo)||void 0===e?void 0:e.object);document.getElementById("jsondiff").innerHTML=P.formatters.html.format(o,null===(n=this.logInfo)||void 0===n?void 0:n.pre_object)},t}();pn.decorators=[{type:e.Component,args:[{selector:"app-audit-log-view",template:'<div fxLayout="column" class="m-4" fxLayoutGap="1.5rem">\n <h3 class="text-center">Audit Log</h3>\n <div fxLayout="column" fxLayoutGap="0.5rem" *ngIf="logInfo">\n <div>Object Type: {{logInfo?.object_type}}</div>\n <div>Object Id: {{logInfo?.object_id}}</div>\n <div>Action: {{logInfo?.action}}</div>\n <div>Created At: {{logInfo?.created_at | date:\'medium\'}}</div>\n <div>Created By: {{logInfo?.user?.email}}</div>\n </div>\n\n\n <div fxLayout="column" *ngIf="logInfo?.action !== \'deleted\'">\n <div>\n <button mat-raised-button color="primary" (click)="showDeltaChanges = !showDeltaChanges">\n {{showDeltaChanges?\'Hide JSON Changes\': \'Show JSON Changes\'}}\n </button>\n </div>\n <div [hidden]="!showDeltaChanges">\n <h4 class="font-weight-bold" *ngIf="logInfo">Changes in JSON</h4>\n <div id="jsondiff"></div>\n </div>\n </div>\n\n <div class="container" *ngIf="changeList.length > 0">\n <h4 class="font-weight-bold"> Changes in Attributes</h4>\n <table class="table table-striped table-sm border">\n <thead>\n <tr>\n <th scope="col">#</th>\n <th scope="col">Attribute</th>\n <th scope="col">Old Value</th>\n <th scope="col">New Value</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let change of changeList; let i= index;">\n <th scope="row">{{i+1}}</th>\n <td>{{change?.displayAttribute}}</td>\n <td>{{change?.oldValue}}</td>\n <td>{{change?.newValue}}</td>\n </tr>\n </tbody>\n </table>\n\n </div>\n</div>',styles:[""]}]}],pn.ctorParameters=function(){return[{type:Wt},{type:y.ActivatedRoute},{type:a.Location}]};var mn=function(){};mn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var fn=function(){};fn.decorators=[{type:e.NgModule,args:[{declarations:[pn],imports:[a.CommonModule,mn,L.FlexLayoutModule,Yt],exports:[pn]}]}];var hn=[{path:"log-list",component:t.AuditLogListComponent,canActivate:[qt]},{path:"log-view/:id",component:pn,canActivate:[qt]},{path:"**",redirectTo:"log-list",pathMatch:"full"}],gn=function(){};gn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(hn)],exports:[y.RouterModule]}]}];var yn=function(){};yn.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,gn,cn,fn],exports:[]}]}];var vn=function(){};vn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}],t.ImportCsvComponent=function(){function t(t,e,n){this.alertService=t,this.http=e,this.location=n,this.filesList=[],this.fileData=[],this.failedItems=[],this.selectedFields=[],this.filesConfig={fileId:"file",containerId:"fileContainer",styles:{height:"600px"},acceptFile:".csv",multiple:!1,maxSize:100,acceptFileText:".csv"}}return t.prototype.ngOnInit=function(){},t.prototype.reset=function(){this.filesList=[],this.failedItems=[],this.selectedFields=[],this.fileData=[]},t.prototype.fileChanged=function(t){var e=this;this.filesList=t;var n=null,o=new FileReader,i=this.filesList[0];o.onload=function(t){var i=o.result,r=V.read(i,{type:"binary",cellDates:!0});n=r.SheetNames.reduce((function(t,e){var n=r.Sheets[e];return V.utils.sheet_to_json(n)}),[]),e.fileData=n},o.readAsBinaryString(i)},t.prototype.mappingProcessed=function(t){var e=this;this.selectedFields=t.fields;var n=JSON.parse(JSON.stringify(this.fileData));n.forEach((function(n){for(var o in n){var i=t.fields.find((function(t){return t.label==o}));i?("date"!=i.propertyType&&"dateTime"!=i.propertyType||!e.isValidDate(new Date(n[i.label]))?n[i.property]=n[i.label]:n[i.property]=new Date(n[i.label]).toISOString(),delete n[o]):delete n[o]}})),this.save(n)},t.prototype.save=function(t){var e,n=this;this.http.post(null===(e=this.importConfig)||void 0===e?void 0:e.postUrl,{data:t}).pipe(r.untilDestroyed(this)).subscribe((function(t){n.failedItems=(null==t?void 0:t.failed_items)||[],0===n.failedItems.length&&(n.alertService.addAlert("File Import Success","success"),n.location.back())}))},t.prototype.isValidDate=function(t){return t instanceof Date&&!isNaN(t.getTime())},t}(),t.ImportCsvComponent.decorators=[{type:e.Component,args:[{selector:"app-import-csv",template:'<div fxLayout="column" fx class="m-4">\n <h2 class="text-center">\n {{importConfig?.importType}} Import\n <span>\n <button type="button" *ngIf="failedItems.length > 0" mat-raised-button color="warn"\n (click)="reset()">Reset</button>\n </span>\n </h2>\n\n <ng-container *ngIf="failedItems.length === 0">\n <app-file-dropper *ngIf="fileData.length === 0" [config]="filesConfig" [fileArray]="filesList"\n (fileChanged)="fileChanged($event)">\n </app-file-dropper>\n\n <app-import-items class="w-100" *ngIf="fileData.length > 0" [data]="fileData" [importConfig]="importConfig"\n (onSave)="mappingProcessed($event)"></app-import-items>\n </ng-container>\n\n <app-failed-items class="w-100" *ngIf="failedItems.length > 0" [failedItems]="failedItems"\n [selectedFields]="selectedFields"></app-failed-items>\n\n</div>',styles:[""]}]}],t.ImportCsvComponent.ctorParameters=function(){return[{type:st},{type:Ct},{type:a.Location}]},t.ImportCsvComponent.propDecorators={importConfig:[{type:e.Input}]},t.ImportCsvComponent=z([r.UntilDestroy()],t.ImportCsvComponent);var bn=function(){};bn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var Cn={property:{required:"Property is required",unavailable:"Duplicate entry"}},xn=function(){function t(t,n,o){this.fb=t,this.formValidatorService=n,this.changeDetectorRef=o,this.firstDataArray=[],this.properties=[],this.onSave=new e.EventEmitter,this.createImportMappingForm()}return t.prototype.ngOnInit=function(){this.properties=this.importConfig.properties,this.mapOutDataColumns(this.data[0])},t.prototype.createImportMappingForm=function(){this.importMappingForm=this.fb.group({fields:this.fb.array([])})},Object.defineProperty(t.prototype,"fieldsArray",{get:function(){return this.importMappingForm.get("fields")},enumerable:!1,configurable:!0}),t.prototype.createField=function(t){return this.fb.group({id:new l.FormControl(t.id),label:new l.FormControl(t.label),value:new l.FormControl(t.value),property:new l.FormControl(t.property,l.Validators.compose([l.Validators.required])),propertyType:new l.FormControl(t.propertyType)})},t.prototype.mapOutDataColumns=function(t){var e=this;for(var n in t)if(t.hasOwnProperty(n)){var o={id:"",label:n,value:t[n],property:"",propertyType:""};this.firstDataArray.push(o)}this.firstDataArray.forEach((function(t,n){t.id=n,e.properties.find((function(e){if(e.label.toLowerCase().includes(t.label.toLowerCase()))return t.property=e.value,t.propertyType=e.type,t}))}))},t.prototype.submit=function(){this.importMappingForm.markAllAsTouched(),this.importMappingForm.valid&&this.onSave.emit(this.importMappingForm.value)},t.prototype.isFieldValid=function(t,e){return this.formValidatorService.isFieldValid(t,e)},t.prototype.getErrorMessage=function(t,e){return this.formValidatorService.getErrorMessage(t,e,Cn)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(e){t.firstDataArray.forEach((function(e){t.fieldsArray.push(t.createField(e))})),t.changeDetectorRef.detectChanges()}),500)},t.prototype.updatePropertyType=function(t,e){var n=this.properties.find((function(e){return e.value==t.value}));n&&(this.fieldsArray.controls[e].get("propertyType").setValue(n.type),this.uniqueValidator())},t.prototype.uniqueValidator=function(){var t=this;this.fieldsArray.value.forEach((function(e,n){var o=t.fieldsArray.controls[n].get("property");!t.fieldsArray.value.find((function(e){return e.property===o.value&&e.id!=t.fieldsArray.controls[n].get("id").value}))?o.setErrors(null):o.setErrors({unavailable:!0})}))},t.prototype.removeField=function(t){-1!=t&&this.fieldsArray.removeAt(t)},t}();xn.decorators=[{type:e.Component,args:[{selector:"app-import-items",template:'<div fxLayout="column" class="mt-2">\n <p class="text-center secondary-color">Map your column headers in your file to our properties</p>\n <form [formGroup]="importMappingForm" (ngSubmit)="submit()" fxLayout="column">\n <table style="width: 100%;" class="table table-sm table-striped">\n <tr class="table-header-row">\n <th>Column Headers From File</th>\n <th>Preview Information</th>\n <th>Property</th>\n </tr>\n <ng-container formArrayName="fields">\n <tr *ngFor="let field of fieldsArray.controls; let i=index" [formGroupName]="i">\n <td>{{ field.get(\'label\').value }}</td>\n <td>{{ field.get(\'value\').value }}</td>\n <td>\n <mat-form-field fxFlex="100%" appearance="outline">\n <mat-label>Select Property</mat-label>\n <mat-select placeholder="Select Property" formControlName="property" required\n (selectionChange)="updatePropertyType($event, i)">\n <mat-option *ngFor="let property of properties" [value]="property.value">\n {{property.label}}\n </mat-option>\n </mat-select>\n <mat-error *ngIf="isFieldValid(\'property\', fieldsArray.controls[i])">\n {{getErrorMessage(\'property\', fieldsArray.controls[i])}}\n </mat-error>\n </mat-form-field>\n <button type="button" mat-icon-button (click)="removeField(i)" *ngIf="fieldsArray.length > 1"\n matTooltip="Remove column" matTooltipPosition="right">\n <mat-icon class="text-danger">remove_circle</mat-icon>\n </button>\n </td>\n </tr>\n </ng-container>\n </table>\n\n <div class="mt-1" fxFlex="100%" fxLayoutAlign="end">\n <button mat-stroked-button color="primary" class="mt-2" type="submit">\n Next\n <mat-icon>\n chevron_right\n </mat-icon>\n </button>\n </div>\n </form>\n</div>',styles:["table{width:100%}td,th{padding:1%}.table-header-row{background-color:#e6e4e4;color:#000;font-weight:bolder}"]}]}],xn.ctorParameters=function(){return[{type:l.FormBuilder},{type:Ft},{type:e.ChangeDetectorRef}]},xn.propDecorators={data:[{type:e.Input}],importConfig:[{type:e.Input}],onSave:[{type:e.Output}]};var Fn=function(){};Fn.decorators=[{type:e.NgModule,args:[{declarations:[xn],imports:[a.CommonModule,L.FlexLayoutModule,Yt,l.ReactiveFormsModule,bn],exports:[xn]}]}];var In=function(){};In.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var wn=function(){function t(){}return t.prototype.ngOnInit=function(){},t.prototype.isValidDate=function(t){var e=new Date(t);return e instanceof Date&&!isNaN(e.getTime())},t}();wn.decorators=[{type:e.Component,args:[{selector:"app-failed-items",template:'<div *ngIf="failedItems.length" class="mt-4">\n <div fxLayout fxLayoutAlign="center">\n <h4>Failed Items</h4>\n </div>\n <div fxLayout="row wrap" fxLayoutAlign="center">\n <table class="table table-bordered table-striped table-hover table-sm" fxFlex="80%">\n <thead>\n <tr>\n <th>#</th>\n <th *ngFor="let field of selectedFields;">{{field?.label}}</th>\n <th class="text-danger">Error</th>\n </tr>\n </thead>\n <tbody>\n <ng-container *ngFor="let timesheet of failedItems; let i=index">\n <tr>\n <td>{{i + 1}}</td>\n <td *ngFor="let field of selectedFields;">\n <ng-container *ngIf="(field.propertyType == \'date\' || field.propertyType == \'dateTime\')\n &&isValidDate(timesheet[field.property]);else elseProperty;">\n {{ timesheet[field.property] | date:\'mediumDate\' }}\n </ng-container>\n <ng-template #elseProperty>\n {{ timesheet[field.property] }}\n </ng-template>\n </td>\n <td class="text-danger">\n {{timesheet?.error}}\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n</div>',styles:[""]}]}],wn.ctorParameters=function(){return[]},wn.propDecorators={failedItems:[{type:e.Input}],selectedFields:[{type:e.Input}]};var Dn=function(){};Dn.decorators=[{type:e.NgModule,args:[{declarations:[wn],imports:[a.CommonModule,Yt,L.FlexLayoutModule,In],exports:[wn]}]}];var Sn=function(){};Sn.decorators=[{type:e.NgModule,args:[{declarations:[t.ImportCsvComponent],imports:[a.CommonModule,Yt,L.FlexLayoutModule,Xt,vn,Fn,Dn],exports:[t.ImportCsvComponent]}]}];var Mn=function(){};t.LoginHistoryForUserComponent=function(){function t(t,e){this.http=t,this.fb=e,this.loginHistoryList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.filters={sort_by:"created_at|desc"},this.displayedColumns=["index","created_at"],this.historyFilterForm=this.fb.group({duration:[""],date_from:[""],date_to:[""]})}return t.prototype.ngOnInit=function(){var t=this;this.filters.user_id=this.userId,this.historyFilterForm.valueChanges.pipe(u.debounceTime(500),u.distinctUntilChanged(),r.untilDestroyed(this)).subscribe((function(e){e.date_from=e.date_from?e.date_from.toISOString():"",e.date_to=e.date_to?e.date_to.toISOString():"",t.filterChange(e)})),this.initializeData()},t.prototype.onTimelineChange=function(t){var e=(null==t?void 0:t.date_from)?new Date(t.date_from):"",n=(null==t?void 0:t.date_to)?new Date(t.date_to):"";this.historyFilterForm.patchValue({date_from:e,date_to:n})},t.prototype.initializeData=function(){var t=this;this.http.get("api/user-login-history",{params:Object.assign(Object.assign({},this.filters),this.pageEvent)}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.loginHistoryList=t.loginHistoryList.concat(e.data),t.pageEvent.page=e.current_page,t.pageEvent.lastPage=e.last_page}))},t.prototype.filterChange=function(t){this.filters=Object.assign(Object.assign({},this.filters),t),this.reload()},t.prototype.onScroll=function(){this.pageEvent.lastPage>this.pageEvent.page&&(this.pageEvent.page+=1,this.initializeData())},t.prototype.reload=function(){this.loginHistoryList=[],this.pageEvent={page:1,perPage:25,lastPage:1},this.initializeData()},t.prototype.ngOnDestroy=function(){},t}(),t.LoginHistoryForUserComponent.decorators=[{type:e.Component,args:[{selector:"app-login-history-for-user",template:'<div class="mat-typography m-4">\n <form [formGroup]="historyFilterForm" fxLayoutAlign=" start center">\n <app-timeline-filter formControlName="duration" (selectionChange)="onTimelineChange($event)"></app-timeline-filter>\n </form>\n\n <section>\n <div class="scroll-container" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [scrollWindow]="false">\n <table mat-table [dataSource]="loginHistoryList" matSort class="w-100 mt-1" multiTemplateDataRows\n id="login-history-table">\n\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef="let loginHistory; let i = dataIndex"> {{ i+1 }} </td>\n </ng-container>\n\n <ng-container matColumnDef="created_at">\n <th mat-header-cell *matHeaderCellDef mat-sort-header> Last Login</th>\n <td mat-cell *matCellDef="let loginHistory;">\n {{loginHistory?.created_at | date:\'medium\' }}\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns;"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>\n </table>\n </div>\n\n </section>\n</div>\n',styles:[".scroll-container{max-height:800px;overflow-y:auto}"]}]}],t.LoginHistoryForUserComponent.ctorParameters=function(){return[{type:Ct},{type:l.FormBuilder}]},t.LoginHistoryForUserComponent.propDecorators={userId:[{type:e.Input}]},t.LoginHistoryForUserComponent=z([r.UntilDestroy()],t.LoginHistoryForUserComponent);var _n=[{path:"",component:t.LoginHistoryForUserComponent,canActivate:[qt]}],Tn=function(){};Tn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(_n)],exports:[y.RouterModule]}]}];var Ln=function(){};Ln.decorators=[{type:e.NgModule,args:[{declarations:[t.LoginHistoryForUserComponent],imports:[a.CommonModule,Tn,k.InfiniteScrollModule,Yt,L.FlexLayoutModule,l.ReactiveFormsModule,le],exports:[t.LoginHistoryForUserComponent]}]}];var kn,An=function(){this.selectable=!0,this.removable=!0,this.separatorKeysCodes=[j.ENTER,j.COMMA],this.placeholder="New Tag..",this.apiUrl="api/techlify-tagger-tags",this.createApiUrl="api/techlify-tagger-tags",this.isCreateable=!0,this.isCacheTags=!1,this.isSingle=!1};t.TechlifyTaggerTagFormFieldComponent=kn=function(){function t(t,e,n,o,i){var r=this;this._focusMonitor=t,this._elementRef=e,this.httpService=n,this._formField=o,this.ngControl=i,this.stateChanges=new c.Subject,this.focused=!1,this.controlType="techlify-tagger-form-field",this.id="techlify-tagger-form-field-"+kn.nextId++,this.onChange=function(t){},this.onTouched=function(){},this.tagInputCtrl=new l.FormControl,this.config=new An,this._allTags=[],this.categories=[],this._required=!1,this._disabled=!1,this._value=[],this.tagInputCtrl.valueChanges.subscribe((function(t){r.filterString=t})),t.monitor(e,!0).subscribe((function(t){r.focused&&!t&&r.onTouched(),r.focused=!!t,r.stateChanges.next()})),null!=this.ngControl&&(this.ngControl.valueAccessor=this)}return Object.defineProperty(t.prototype,"allTags",{get:function(){return this._allTags},set:function(t){this._allTags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tags",{get:function(){var t=this;return this.allTags.filter((function(e){return t.value.some((function(t){return t==e.id}))}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0==this.value.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldLabelFloat",{get:function(){return this.focused||!this.empty||this.tagInputCtrl.value},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=m.coerceBooleanProperty(t),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=m.coerceBooleanProperty(t),this._disabled?this.tagInputCtrl.disable():this.tagInputCtrl.enable(),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t||[],this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errorState",{get:function(){return this.tagInputCtrl.dirty&&this.required&&0==this.value.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(t){this._placeholder=t,this.stateChanges.next()},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){var e=this;0==this.allTags.length&&this.httpService.cache(!this.config.isCacheTags).get(this.config.apiUrl,{params:{categories:this.categories.join(","),perPage:"1000"}}).pipe(u.debounceTime(500),r.untilDestroyed(this)).subscribe((function(t){e.allTags=t.data})),this.modelId&&0==this.value.length&&this.httpService.cache(!this.config.isCacheTags).get(this.config.apiUrl,{params:{categories:this.categories.join(","),model_type:this.modelType,model_id:this.modelId,perPage:"1000"}}).pipe(u.debounceTime(500),r.untilDestroyed(this)).subscribe((function(t){e.value=((null==t?void 0:t.data)||[]).map((function(t){return t.id})),e._handleInput()}))},t.prototype.init=function(){var t=this;this.modelId&&0==this.allTags.length&&this.httpService.cache(!this.config.isCacheTags).get(this.config.apiUrl,{params:{categories:this.categories.join(","),model_type:this.modelType,model_id:this.modelId}}).pipe(r.untilDestroyed(this)).subscribe((function(e){t.allTags=e.data}))},Object.defineProperty(t.prototype,"filteredTags",{get:function(){return this._filter()},enumerable:!1,configurable:!0}),t.prototype.setDescribedByIds=function(t){},t.prototype.onContainerClick=function(){},t.prototype.add=function(t){return $(this,void 0,void 0,(function(){var e,n,o,i;return W(this,(function(r){switch(r.label){case 0:if(e=(t.value||"").trim(),this.config.isSingle&&0!==this.value.length)return[3,7];if(!e||!this.config.isCreateable)return[3,7];if(n=this.allTags,o=n.find((function(t){return t.title.toLowerCase()==e.toLowerCase()})))return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.httpService.post(this.config.createApiUrl,{title:e,description:e,category_title:this.categories.length>0?this.defaultCreateCategory?this.defaultCreateCategory:this.categories[0]:""}).toPromise()];case 2:return i=r.sent(),o=i.item,[3,4];case 3:return r.sent(),[2];case 4:return this.allTags.push(o),[3,6];case 5:this.remove(o),r.label=6;case 6:this.value.push(o.id),this._handleInput(),r.label=7;case 7:return t.input.value="",this.tagInputCtrl.setValue(null),[2]}}))}))},t.prototype.remove=function(t){this.value=this.value.filter((function(e){return e!==t.id})),this._handleInput()},t.prototype.selected=function(t){this.config.isSingle&&0!==this.value.length||(this.remove({id:t.option.value}),this.value.push(t.option.value),this._handleInput()),this.tagInput.nativeElement.value="",this.tagInputCtrl.setValue(null)},t.prototype._filter=function(){var t=this,e=this.filterString?this.filterString.toString().toLowerCase():null,n=this.allTags.filter((function(e){return!t.value.some((function(t){return t==e.id}))}));return e?n.filter((function(t){return t.title.toLowerCase().includes(e)})):n},t.prototype.writeValue=function(t){this.value=t||[]},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype._handleInput=function(){this.onChange(this.value)},t.prototype.ngOnDestroy=function(){this.stateChanges.complete(),this._focusMonitor.stopMonitoring(this._elementRef)},t}(),t.TechlifyTaggerTagFormFieldComponent.nextId=0,t.TechlifyTaggerTagFormFieldComponent.decorators=[{type:e.Component,args:[{selector:"app-techlify-tagger-tag-form-field",template:'<mat-chip-list #chipList aria-label="Tag Selection">\n <mat-chip *ngFor="let tag of tags" [selectable]="config.selectable" [removable]="config.removable"\n (removed)="remove(tag)">\n {{tag.title}}\n <button matChipRemove *ngIf="config.removable" class="border-0">\n <mat-icon class="mat-relative-icon">cancel</mat-icon>\n </button>\n </mat-chip>\n <input placeholder="{{config.isCreateable? config.placeholder:\'\'}}" #tagInput [formControl]="tagInputCtrl"\n [matAutocomplete]="auto" [matChipInputFor]="chipList"\n [matChipInputSeparatorKeyCodes]="config.separatorKeysCodes" (matChipInputTokenEnd)="add($event)"\n #trigger="matAutocompleteTrigger" (click)="trigger.openPanel()">\n</mat-chip-list>\n<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)">\n <mat-option *ngFor="let tag of filteredTags" [value]="tag.id">\n {{tag.title}}\n </mat-option>\n</mat-autocomplete>',providers:[{provide:f.MatFormFieldControl,useExisting:kn}],styles:[".mat-relative-icon{font-size:20px;position:relative;right:7px;top:-3px}"]}]}],t.TechlifyTaggerTagFormFieldComponent.ctorParameters=function(){return[{type:p.FocusMonitor},{type:e.ElementRef},{type:Ct},{type:f.MatFormField,decorators:[{type:e.Optional},{type:e.Inject,args:[f.MAT_FORM_FIELD]}]},{type:l.NgControl,decorators:[{type:e.Optional},{type:e.Self}]}]},t.TechlifyTaggerTagFormFieldComponent.propDecorators={tagInput:[{type:e.ViewChild,args:["tagInput"]}],config:[{type:e.Input}],modelType:[{type:e.Input}],modelId:[{type:e.Input}],allTags:[{type:e.Input}],categories:[{type:e.Input}],defaultCreateCategory:[{type:e.Input}],required:[{type:e.Input}],disabled:[{type:e.Input}],value:[{type:e.Input}],placeholder:[{type:e.Input}]},t.TechlifyTaggerTagFormFieldComponent=kn=z([r.UntilDestroy()],t.TechlifyTaggerTagFormFieldComponent);var En,Vn=function(){};Vn.decorators=[{type:e.NgModule,args:[{declarations:[t.TechlifyTaggerTagFormFieldComponent],imports:[a.CommonModule,Yt,L.FlexLayoutModule,O.MatAutocompleteModule,l.ReactiveFormsModule],exports:[t.TechlifyTaggerTagFormFieldComponent]}]}],t.TechlifyTaggerTagSelectorComponent=En=function(){function t(t,e,n,o,i){var r=this;this._focusMonitor=t,this._elementRef=e,this.httpService=n,this._formField=o,this.ngControl=i,this.categories=[],this.multiple=!1,this.enableSearch=!0,this.tagSelectorCtrl=new l.FormControl,this.showAllTags=!1,this.useSelectButtonStyle=!1,this.tags=[],this.stateChanges=new c.Subject,this.focused=!1,this.controlType="techlify-tagger-selector",this.id="techlify-tagger-selector-"+En.nextId++,this.onChange=function(t){},this.onTouched=function(){},this._required=!1,this._disabled=!1,t.monitor(e,!0).subscribe((function(t){r.focused&&!t&&r.onTouched(),r.focused=!!t,r.stateChanges.next()})),null!=this.ngControl&&(this.ngControl.valueAccessor=this)}return Object.defineProperty(t.prototype,"apiUrl",{get:function(){var t;return this.showAllTags?"api/techlify-tagger-tags":(null===(t=this.categories)||void 0===t?void 0:t.length)>0?"api/techlify-tagger-tags?categories="+this.categories.join(","):""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0==this.value.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldLabelFloat",{get:function(){return this.focused||!this.empty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=m.coerceBooleanProperty(t),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=m.coerceBooleanProperty(t),this._disabled?this.tagSelectorCtrl.disable():this.tagSelectorCtrl.enable(),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t,this.tagSelectorCtrl.setValue(t),this.stateChanges.next()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"errorState",{get:function(){return this.tagSelectorCtrl.dirty&&this.required&&0==this.value.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(t){this._placeholder=t,this.stateChanges.next()},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.useSelectButtonStyle&&this.httpService.get(this.apiUrl).pipe(r.untilDestroyed(this)).subscribe((function(e){t.tags=e.data}))},t.prototype.selectionChange=function(t){this.value=t,this._handleInput()},t.prototype.setDescribedByIds=function(t){},t.prototype.onContainerClick=function(){},t.prototype.writeValue=function(t){this.value=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype._handleInput=function(){this.onChange(this.value)},t.prototype.ngOnDestroy=function(){this.stateChanges.complete(),this._focusMonitor.stopMonitoring(this._elementRef)},t}(),t.TechlifyTaggerTagSelectorComponent.nextId=0,t.TechlifyTaggerTagSelectorComponent.decorators=[{type:e.Component,args:[{selector:"app-techlify-tagger-tag-selector",template:'<app-searchable-selector *ngIf="apiUrl && !useSelectButtonStyle" [formControl]="tagSelectorCtrl" [apiUrl]="apiUrl"\n [enableSearch]="enableSearch" [multiple]="multiple" (selectionChange)="selectionChange($event)">\n</app-searchable-selector>\n\n<mat-button-toggle-group *ngIf="apiUrl && useSelectButtonStyle" [formControl]="tagSelectorCtrl" [multiple]="multiple"\n (change)="selectionChange($event.value)">\n <mat-button-toggle *ngFor="let tag of tags" [value]="tag.id">{{tag.title}}</mat-button-toggle>\n</mat-button-toggle-group>',providers:[{provide:f.MatFormFieldControl,useExisting:En}],styles:[""]}]}],t.TechlifyTaggerTagSelectorComponent.ctorParameters=function(){return[{type:p.FocusMonitor},{type:e.ElementRef},{type:Ct},{type:f.MatFormField,decorators:[{type:e.Optional},{type:e.Inject,args:[f.MAT_FORM_FIELD]}]},{type:l.NgControl,decorators:[{type:e.Optional},{type:e.Self}]}]},t.TechlifyTaggerTagSelectorComponent.propDecorators={categories:[{type:e.Input}],multiple:[{type:e.Input}],enableSearch:[{type:e.Input}],showAllTags:[{type:e.Input}],useSelectButtonStyle:[{type:e.Input}],required:[{type:e.Input}],disabled:[{type:e.Input}],value:[{type:e.Input}],placeholder:[{type:e.Input}]},t.TechlifyTaggerTagSelectorComponent=En=z([r.UntilDestroy()],t.TechlifyTaggerTagSelectorComponent);var Un=function(){};Un.decorators=[{type:e.NgModule,args:[{declarations:[t.TechlifyTaggerTagSelectorComponent],imports:[a.CommonModule,Yt,L.FlexLayoutModule,O.MatAutocompleteModule,l.ReactiveFormsModule,ie,R.MatButtonToggleModule],exports:[t.TechlifyTaggerTagSelectorComponent]}]}];var Pn=function(){function t(t){this.dataManager=t}return t.prototype.getFeatures=function(){return this.dataManager.GET("api/features")},t.prototype.disableFeature=function(t){return this.dataManager.GET("api/feature/"+t+"/disable")},t.prototype.enableFeature=function(t){return this.dataManager.GET("api/feature/"+t+"/enable")},t}();Pn.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Pn(e.ɵɵinject(Wt))},token:Pn,providedIn:"root"}),Pn.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Pn.ctorParameters=function(){return[{type:Wt}]},t.TechlifyFeatureListingComponent=function(){function t(t,e,n,i,r,a,l){this.dataManager=t,this.errorHandler=e,this.fb=n,this.alertService=i,this.dialog=r,this.storage=a,this.featureService=l,this.features=[],this.displayedColumns=["index","feature","description","actions"],this.dataSource=new o.MatTableDataSource,this.page=1,this.perPage=25,this.isWorking=!1,this.filterFormGroup=this.fb.group({num_items:[""]})}return t.prototype.ngOnInit=function(){this.loadData(),this.listenForChanges()},t.prototype.listenForChanges=function(){var t=this;this.filterFormGroup.valueChanges.pipe(u.debounceTime(500),r.untilDestroyed(this)).subscribe((function(e){t.reload()}))},t.prototype.loadData=function(){return $(this,void 0,void 0,(function(){var t,e,n;return W(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,3,4]),this.isWorking=!0,(e=this.filterFormGroup.value).page=this.page,e.perPage=this.perPage,[4,this.dataManager.GET("api/features",e)];case 1:return t=i.sent(),this.features=this.features.concat(t.data),this.dataSource=new o.MatTableDataSource(this.features),this.storage.getItem("features")||this.setStorage(this.features),this.isWorking=!1,[3,4];case 2:return n=i.sent(),this.errorHandler.handleError(n),[3,4];case 3:return this.isWorking=!1,[7];case 4:return[2]}}))}))},t.prototype.toggeleFeature=function(t,e){return $(this,void 0,void 0,(function(){var n,o=this;return W(this,(function(i){return n=t?"Off":"On",this.dialog.open(G,{width:"400px",data:{title:"Turn this feature "+n+"?",message:"Would you like to turn "+e.title+" feature "+n}}).afterClosed().subscribe((function(i){return $(o,void 0,void 0,(function(){var o,r;return W(this,(function(a){switch(a.label){case 0:if(!i)return[3,9];a.label=1;case 1:return a.trys.push([1,6,7,8]),t?[4,this.featureService.disableFeature(e.id)]:[3,3];case 2:return o=a.sent(),[3,5];case 3:return[4,this.featureService.enableFeature(e.id)];case 4:o=a.sent(),a.label=5;case 5:return o,[3,8];case 6:return r=a.sent(),this.errorHandler.handleError(r),[3,8];case 7:return this.alertService.addAlert("You have just turned "+n+" the feature "+e.title,"success"),this.reload(),this.storage.removeItem("features"),this.setStorage(this.features),this.isWorking=!1,[7];case 8:return[3,10];case 9:this.reload(),a.label=10;case 10:return[2]}}))}))})),[2]}))}))},t.prototype.setStorage=function(t){var e,n,o=[];try{for(var i=Y(t),r=i.next();!r.done;r=i.next()){var a=r.value;a.client_feature?a.client_feature.is_enabled&&o.push(a.code):a.is_enabled_default&&o.push(a.code)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}this.storage.setItem("features",o)},t.prototype.reload=function(){this.features=[],this.page=1,this.isWorking||this.loadData()},t.prototype.onScroll=function(){!this.isWorking&&this.page<this.lastPage&&(this.page+=1,this.loadData())},t.prototype.sortColumn=function(t){var e=t.direction.toString().toUpperCase();this.assignFilter(t.active,e),this.reload()},t.prototype.assignFilter=function(t,e){switch(t){case"name":return this.filterFormGroup.get("sort_by").setValue("first_name|"+e);case"added_on":return this.filterFormGroup.get("sort_by").setValue("created_at|"+e)}},t}(),t.TechlifyFeatureListingComponent.decorators=[{type:e.Component,args:[{selector:"app-techlify-listing-feature",template:'<div fxLayout="column" fxLayoutGap="3rem" class="p-3">\n <div fxLayout="column" fxLayoutAlign="center center" class="primary-color mt-3">\n <h3>Features Configuration</h3>\n <mat-hint>\n <i> Here you can specify which optional features you\'d like to have available to your team </i>\n </mat-hint>\n </div>\n\n\n <div>\n <mat-card>\n <mat-card-content fxlayout="column" style="overflow: auto; height: 700px" class="classifications-card">\n <table mat-table [dataSource]="dataSource" class="mat-elevation-z8 w-100" matSort multiTemplateDataRows\n (matSortChange)="sortColumn($event)" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50"\n (scrolled)="onScroll()" [fromRoot]="true" [infiniteScrollContainer]="\'.classifications-card\'">\n \x3c!-- Index Column --\x3e\n <ng-container matColumnDef="index">\n <th mat-header-cell *matHeaderCellDef>#</th>\n <td mat-cell *matCellDef="let element; let i = dataIndex">\n {{ i + 1 }}\n </td>\n </ng-container>\n\n \x3c!-- Title Column --\x3e\n <ng-container matColumnDef="feature">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear>\n Feature\n </th>\n <td mat-cell *matCellDef="let element">{{ element?.title }}</td>\n </ng-container>\n\n \x3c!-- Description Column --\x3e\n <ng-container matColumnDef="description">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear>\n Descriptions\n </th>\n <td mat-cell *matCellDef="let element">\n {{ element?.description }}\n </td>\n </ng-container>\n\n \x3c!-- Actions Column --\x3e\n <ng-container matColumnDef="actions">\n <th mat-header-cell *matHeaderCellDef mat-sort-header disableClear>\n Actions\n </th>\n <td mat-cell *matCellDef="let element">\n <div *ngIf="!element?.client_feature">\n <app-on-off-switch [value]="element?.is_enabled_default"\n (click)="toggeleFeature(element?.is_enabled_default, element)"></app-on-off-switch>\n </div>\n <div *ngIf="element?.client_feature">\n <app-on-off-switch [value]="element?.client_feature?.is_enabled"\n (click)="toggeleFeature(element?.client_feature?.is_enabled, element)"></app-on-off-switch>\n </div>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>\n <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>\n </table>\n </mat-card-content>\n </mat-card>\n </div>\n</div>\n',styles:[""]}]}],t.TechlifyFeatureListingComponent.ctorParameters=function(){return[{type:Wt},{type:ct},{type:l.FormBuilder},{type:st},{type:n.MatDialog},{type:$t},{type:Pn}]},t.TechlifyFeatureListingComponent=z([r.UntilDestroy()],t.TechlifyFeatureListingComponent);var jn=[{path:"",component:t.TechlifyFeatureListingComponent,canActivate:[qt]}],On=y.RouterModule.forChild(jn),Rn=function(){function t(t){this.fb=t,this.slideToggle=this.fb.group({toggle:[""]})}return t.prototype.ngOnInit=function(){this.slideToggle.get("toggle").setValue(this.value)},t}();Rn.decorators=[{type:e.Component,args:[{selector:"app-on-off-switch",template:'<form [formGroup]="slideToggle">\n <mat-slide-toggle formControlName="toggle">On / Off\n </mat-slide-toggle>\n</form>\n',styles:[""]}]}],Rn.ctorParameters=function(){return[{type:l.FormBuilder}]},Rn.propDecorators={value:[{type:e.Input}]};var Nn=function(){function t(t,e,n,o){this.el=t,this.featureService=e,this.errorHandler=n,this.storage=o,this.localFeatures=[]}return t.prototype.ngOnInit=function(){this.storage.getItem("features")?this.checkForFeatureEnabled():this.getFeatures()},t.prototype.getFeatures=function(){return $(this,void 0,void 0,(function(){var t,e,n,o,i,r,a;return W(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,3,4]),[4,this.featureService.getFeatures()];case 1:t=l.sent();try{for(e=Y(t.data),n=e.next();!n.done;n=e.next())(o=n.value).client_feature?o.client_feature.is_enabled&&this.localFeatures.push(o.code):o.is_enabled_default&&this.localFeatures.push(o.code)}catch(t){r={error:t}}finally{try{n&&!n.done&&(a=e.return)&&a.call(e)}finally{if(r)throw r.error}}return this.storage.setItem("features",this.localFeatures),[3,4];case 2:return i=l.sent(),this.errorHandler.handleError(i),[3,4];case 3:return this.checkForFeatureEnabled(),[7];case 4:return[2]}}))}))},t.prototype.checkForFeatureEnabled=function(){try{this.storage.getItem("features").split(",").includes(this.enabledFeature)?this.el.nativeElement.style.display="show":this.el.nativeElement.remove()}catch(t){this.errorHandler.handleError(t)}},t}();Nn.decorators=[{type:e.Directive,args:[{selector:"[techlifyFeatureEnabled]"}]}],Nn.ctorParameters=function(){return[{type:e.ElementRef},{type:Pn},{type:ct},{type:$t}]},Nn.propDecorators={enabledFeature:[{type:e.Input,args:["techlifyFeatureEnabled"]}]};var Hn=function(){};Hn.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,Yt,L.FlexLayoutModule,On,N.MatSlideToggleModule,l.FormsModule,l.ReactiveFormsModule,k.InfiniteScrollModule],declarations:[t.TechlifyFeatureListingComponent,Rn,Nn],exports:[t.TechlifyFeatureListingComponent,Nn]}]}],t.ActionPopup=H,t.ActionPopupComponent=G,t.ActionPopupModule=Jt,t.AlertService=st,t.ApiPrefixInterceptor=ft,t.AuditLogForModelComponent=Xe,t.AuditLogForModelModule=dn,t.AuditLogForModelRoutingModule=tn,t.AuditLogListFilterModule=sn,t.AuditLogListFilterRoutingModule=an,t.AuditLogListModule=cn,t.AuditLogListRoutingModule=rn,t.AuditLogModule=yn,t.AuditLogRoutingModule=gn,t.AuditLogViewComponent=pn,t.AuditLogViewModelModule=nn,t.AuditLogViewModelRoutingModule=en,t.AuditLogViewModule=fn,t.AuditLogViewRoutingModule=mn,t.AuditLogsViewModelModule=un,t.AuditLogsViewModelRoutingModule=on,t.AuthenticationGuard=qt,t.AuthenticationService=Bt,t.CacheInterceptor=mt,t.CommentFormComponent=At,t.ConfigService=rt,t.CoreModule=Kt,t.CredentialsService=ht,t.DataManager=Wt,t.DataTable=Z,t.DataTableComponent=t.ɵi,t.DataTableModule=Qt,t.DateUtils=Ut,t.DateValidator=ln,t.DocumentViewerComponent=tt,t.DocumentViewerModule=Zt,t.EmailSubscriptionForUserComponent=t.ɵbk,t.EmailSubscriptionForUserModule=Ue,t.EmailSubscriptionForUserRoutingModule=Ve,t.EmailSubscriptionModule=ue,t.EmailSubscriptionRoutingModule=ce,t.EmailSubscriptionTypeFormComponent=t.ɵbi,t.EmailSubscriptionTypeFormModule=Me,t.EmailSubscriptionTypeFormRoutingModule=De,t.EmailSubscriptionTypeListComponent=t.ɵbj,t.EmailSubscriptionTypeListModule=ke,t.EmailSubscriptionTypeListRoutingModule=Le,t.EmailSubscriptionTypeModule=we,t.EmailSubscriptionTypeRoutingModule=Ie,t.EmailSubscriptionUserFormComponent=t.ɵbe,t.EmailSubscriptionUserFormModule=he,t.EmailSubscriptionUserFormRoutingModule=me,t.EmailSubscriptionUserListComponent=t.ɵbf,t.EmailSubscriptionUserListFilterComponent=t.ɵbh,t.EmailSubscriptionUserListFilterModule=xe,t.EmailSubscriptionUserListFilterRoutingModule=Ce,t.EmailSubscriptionUserListModule=Fe,t.EmailSubscriptionUserListRoutingModule=be,t.EmailSubscriptionUserModule=pe,t.EmailSubscriptionUserRoutingModule=de,t.EntityFileFormComponent=wt,t.EntityFilesViewAllComponent=t.ɵo,t.EntityFilesViewAllModule=te,t.ErrorHandlerInterceptor=ut,t.ErrorHandlerService=ct,t.ErrorSnackComponent=lt,t.ExportExcelButtonComponent=Qe,t.ExportExcelModule=Ze,t.FailedItemsComponent=wn,t.FailedItemsModule=Dn,t.FailedItemsRoutingModule=In,t.FileDropperComponent=Dt,t.FileDropperConfig=St,t.FileDropperModule=Xt,t.FormValidatorService=Ft,t.HTTP_DYNAMIC_INTERCEPTORS=bt,t.HttpCacheService=pt,t.HttpService=Ct,t.ImportConfig=Mn,t.ImportCsvModule=Sn,t.ImportCsvRoutingModule=vn,t.ImportItemsComponent=xn,t.ImportItemsModule=Fn,t.ImportItemsRoutingModule=bn,t.LoaderComponent=Nt,t.LoaderModule=se,t.Logger=ot,t.LoginHistoryForUserModule=Ln,t.LoginHistoryForUserRoutingModule=Tn,t.MatSelectInfiniteScrollDirective=Et,t.MaterialModule=Yt,t.NoteFormComponent=Tt,t.NoteListComponent=Lt,t.NoteModule=oe,t.NumItemsSelector=Vt,t.NumberSelector=Pt,t.PageEvent=X,t.ReadMoreComponent=ee,t.ReadMoreModule=ne,t.RouteReusableStrategy=zt,t.SearchableSelectorComponent=t.ɵx,t.SearchableSelectorModule=ie,t.SnackModule=Ht,t.StorageService=$t,t.SuccessSnackComponent=at,t.TechlifyConfig=it,t.TechlifyFeatureEnabledDirective=Nn,t.TechlifyFeatureModule=Hn,t.TechlifyFeatureRoutes=On,t.TechlifyTaggerTagFormConfigModel=An,t.TechlifyTaggerTagFormFieldModule=Vn,t.TechlifyTaggerTagSelectorModule=Un,t.TechlifyUpdateHistoryModule=$e,t.TechlifyUpdateModule=Ge,t.Timeline=Rt,t.TimelineFilterComponent=t.ɵbb,t.TimelineFilterModule=le,t.TokenInterceptor=gt,t.UpdateNotifierComponent=Ke,t.UpdateNotifierModule=Je,t.UtilityModule=re,t.ViewerConfig=nt,t.calculateTimeline=jt,t.esfur=Ae,t.estlr=_e,t.esulr=ye,t.ɵa=Ht,t.ɵb=at,t.ɵba=Pt,t.ɵbc=ae,t.ɵbd=Nt,t.ɵbg=qt,t.ɵbm=Pe,t.ɵbn=He,t.ɵbo=Re,t.ɵbp=Oe,t.ɵbq=ze,t.ɵbs=Ye,t.ɵbt=We,t.ɵbu=qe,t.ɵbv=Wt,t.ɵbw=Wt,t.ɵbx=ct,t.ɵby=st,t.ɵbz=$t,t.ɵc=lt,t.ɵca=Pn,t.ɵcb=qt,t.ɵcc=Rn,t.ɵd=bt,t.ɵe=Ct,t.ɵf=zt,t.ɵg=G,t.ɵh=H,t.ɵj=tt,t.ɵk=wt,t.ɵl=Ft,t.ɵm=xt,t.ɵn=st,t.ɵp=Dt,t.ɵq=Lt,t.ɵr=Mt,t.ɵs=Tt,t.ɵt=At,t.ɵu=ht,t.ɵv=rt,t.ɵw=it,t.ɵy=Et,t.ɵz=Vt,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
17
17
|
//# sourceMappingURL=ngx-techlify-core.umd.min.js.map
|