ngx-techlify-core 11.3.2 → 11.3.6
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 +1302 -206
- 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/company-feature/company-feature.component.js +174 -0
- package/esm2015/lib/company-feature/company-feature.module.js +30 -0
- package/esm2015/lib/company-feature/company-feature.routing.js +12 -0
- package/esm2015/lib/company-feature/company-feature.service.js +28 -0
- package/esm2015/lib/company-feature/ngx-feature-enabled.directive.js +77 -0
- package/esm2015/lib/company-feature/on-off-switch/on-off-switch.component.js +27 -0
- package/esm2015/lib/note/comment-form/comment-form.component.js +73 -0
- package/esm2015/lib/note/index.js +2 -1
- package/esm2015/lib/note/note-list/note-list.component.js +33 -3
- package/esm2015/lib/note/note.module.js +7 -3
- package/esm2015/lib/read-more/read-more.component.js +43 -0
- package/esm2015/lib/read-more/read-more.module.js +21 -0
- package/esm2015/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-config.model.js +15 -0
- package/esm2015/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.component.js +269 -0
- package/esm2015/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.module.js +25 -0
- package/esm2015/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.component.js +168 -0
- package/esm2015/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.module.js +29 -0
- package/esm2015/lib/techlify-update/techlify-update-history/techlify-update-history.module.js +2 -2
- package/esm2015/lib/techlify-update/techlify-update.module.js +2 -2
- package/esm2015/ngx-techlify-core.js +32 -31
- package/esm2015/public-api.js +13 -1
- package/fesm2015/ngx-techlify-core.js +950 -64
- package/fesm2015/ngx-techlify-core.js.map +1 -1
- package/lib/company-feature/company-feature.component.d.ts +34 -0
- package/lib/company-feature/company-feature.module.d.ts +2 -0
- package/lib/company-feature/company-feature.routing.d.ts +2 -0
- package/lib/company-feature/company-feature.service.d.ts +8 -0
- package/lib/company-feature/ngx-feature-enabled.directive.d.ts +16 -0
- package/lib/company-feature/on-off-switch/on-off-switch.component.d.ts +9 -0
- package/lib/note/comment-form/comment-form.component.d.ts +22 -0
- package/lib/note/index.d.ts +1 -0
- package/lib/note/note-list/note-list.component.d.ts +4 -0
- package/lib/{techlify-update/read-more → read-more}/read-more.component.d.ts +0 -0
- package/lib/{techlify-update/read-more → read-more}/read-more.module.d.ts +0 -0
- package/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-config.model.d.ts +12 -0
- package/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.component.d.ts +76 -0
- package/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.module.d.ts +2 -0
- package/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.component.d.ts +58 -0
- package/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.module.d.ts +2 -0
- package/ngx-techlify-core.d.ts +31 -30
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +12 -0
- package/esm2015/lib/techlify-update/read-more/read-more.component.js +0 -43
- package/esm2015/lib/techlify-update/read-more/read-more.module.js +0 -21
|
@@ -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")):"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"],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)}(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,w,D,
|
|
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,w,I,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 O=function(t,e){return(O=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 N(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}O(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function H(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 G(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 q(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 B(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 z(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(B(arguments[e]));return t}var $;Object.create;t.ɵi=$=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-"+$.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=$=H([r.UntilDestroy()],t.ɵi);var Y=function(){},W=function(){},K=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}();K.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%}"]}]}],K.ctorParameters=function(){return[]},K.propDecorators={config:[{type:e.Input}],file:[{type:e.Input}],fileUrl:[{type:e.Input}],disableEdit:[{type:e.Input}],remove:[{type:e.Output}]};var J,Q=function(){};(J=t.LogLevel||(t.LogLevel={}))[J.Off=0]="Off",J[J.Error=1]="Error",J[J.Warning=2]="Warning",J[J.Info=3]="Info",J[J.Debug=4]="Debug";var Z=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,z([i.source,n],o))}))}},e}();Z.level=t.LogLevel.Debug,Z.outputs=[];var X=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}(),tt=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}();tt.BASE_CREDENTIALS="credentials",tt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new tt(e.ɵɵinject(X))},token:tt,providedIn:"root"}),tt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],tt.ctorParameters=function(){return[{type:X}]};var et=function(t){this.data=t};et.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}"]}]}],et.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[d.MAT_SNACK_BAR_DATA]}]}]};var nt=function(t){this.data=t};nt.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}"]}]}],nt.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[d.MAT_SNACK_BAR_DATA]}]}]};var ot=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(et,{duration:1e3*n,data:t}):this.snackBar.openFromComponent(nt,{duration:1e3*n,data:t})},t}();ot.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ot(e.ɵɵinject(d.MatSnackBar))},token:ot,providedIn:"root"}),ot.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ot.ctorParameters=function(){return[{type:d.MatSnackBar}]};var it=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}();it.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new it(e.ɵɵinject(ot))},token:it,providedIn:"root"}),it.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],it.ctorParameters=function(){return[{type:ot}]};new Z("ErrorHandlerInterceptor");var rt=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}();rt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new rt(e.ɵɵinject(tt),e.ɵɵinject(it))},token:rt,providedIn:"root"}),rt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],rt.ctorParameters=function(){return[{type:tt},{type:it}]};var at=new Z("HttpCacheService"),lt=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},at.debug('Cache set for key: "'+t+'"'),this.saveCacheData()},t.prototype.getCacheData=function(t){var e=this.cachedData[t];return e?(at.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],at.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}();lt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new lt(e.ɵɵinject(tt))},token:lt,providedIn:"root"}),lt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],lt.ctorParameters=function(){return[{type:tt}]};var st=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}();st.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new st(e.ɵɵinject(lt))},token:st,providedIn:"root"}),st.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],st.ctorParameters=function(){return[{type:lt}]};var ct=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}();ct.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ct(e.ɵɵinject(tt))},token:ct,providedIn:"root"}),ct.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ct.ctorParameters=function(){return[{type:tt}]};var ut=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}();ut.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ut(e.ɵɵinject(tt))},token:ut,providedIn:"root"}),ut.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ut.ctorParameters=function(){return[{type:tt}]};var dt=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}();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(){}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}();pt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new pt},token:pt,providedIn:"root"}),pt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var mt=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}(),ft=new e.InjectionToken("HTTP_DYNAMIC_INTERCEPTORS"),ht=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(ct),i.injector.get(pt),i.injector.get(dt),i.injector.get(rt)]),i}return N(e,t),e.prototype.cache=function(t){var e=this.injector.get(st).configure({update:t});return this.addInterceptor(e)},e.prototype.skipErrorHandler=function(){return this.removeInterceptor(rt)},e.prototype.skipApiPrefix=function(){return this.removeInterceptor(ct)},e.prototype.skipToken=function(){return this.removeInterceptor(dt)},e.prototype.skipHeader=function(){return this.removeInterceptor(pt)},e.prototype.request=function(t,e,n){var o=this.interceptors.reduceRight((function(t,e){return new mt(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);ht.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new ht(e.ɵɵinject(s.HttpHandler),e.ɵɵinject(e.INJECTOR),e.ɵɵinject(ft,8))},token:ht,providedIn:"root"}),ht.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],ht.ctorParameters=function(){return[{type:s.HttpHandler},{type:e.Injector},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[ft]}]}]};var gt=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}();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.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}();yt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new yt},token:yt,providedIn:"root"}),yt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],yt.ctorParameters=function(){return[]};var vt={url:{required:"File is required"}},bt=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 G(this,void 0,void 0,(function(){var t,e,n;return q(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 G(this,void 0,void 0,(function(){var e;return q(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 G(this,void 0,void 0,(function(){return q(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,vt)},t}();bt.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:[""]}]}],bt.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:yt},{type:l.FormBuilder},{type:gt},{type:ot}]},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 G(this,void 0,void 0,(function(){var t;return q(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(bt,{width:"700px",data:{entity:this.filters,hideTitleAndDetails:this.hideTitleAndDetails},autoFocus:!1,restoreFocus:!1}).afterClosed().subscribe((function(e){return G(t,void 0,void 0,(function(){var t;return q(this,(function(n){return e&&((t=z(this.entityFiles)).push(e),this.entityFiles=t),[2]}))}))}))},t.prototype.editEntityFile=function(t){var e=this;this.dialog.open(bt,{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(R,{width:"400px",data:{title:"Delete File",message:"Are you sure to proceed delete the file "+t.title+"?"},autoFocus:!1}).afterClosed().subscribe((function(n){return G(e,void 0,void 0,(function(){return q(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:gt},{type:a.Location},{type:ot},{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=H([r.UntilDestroy()],t.ɵo);var Ct=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}();Ct.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}"]}]}],Ct.ctorParameters=function(){return[{type:ot}]},Ct.propDecorators={fileArray:[{type:e.Input}],config:[{type:e.Input}],fileChanged:[{type:e.Output}],styles:[{type:e.Input}]};var xt=function(){},Ft=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}();Ft.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ft(e.ɵɵinject(ht))},token:Ft,providedIn:"root"}),Ft.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ft.ctorParameters=function(){return[{type:ht}]};var wt={note:{required:"Note is required"}},Dt=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 G(this,void 0,void 0,(function(){var e,n,o;return q(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,wt)},t}();Dt.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:[""]}]}],Dt.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:l.FormBuilder},{type:yt},{type:ot},{type:Ft}]};var It,St=function(){function t(t,e){this.noteService=t,this.dialog=e,this.readonly=!1,this.labelText="Note",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 G(this,void 0,void 0,(function(){var t;return q(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(Dt,{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(Dt,{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 G(this,void 0,void 0,(function(){var e=this;return q(this,(function(n){return this.dialog.open(R,{width:"400px",data:{title:"Delete "+this.labelText,message:"Are you sure to delete?"},autoFocus:!1}).afterClosed().subscribe((function(n){return G(e,void 0,void 0,(function(){return q(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}();St.decorators=[{type:e.Component,args:[{selector:"app-note-list",template:'<div fxLayout="column" fxLayoutGap="1.5rem" class="m-4">\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-00 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>',styles:[".scroll-container{max-height:400px;overflow-y:auto}"]}]}],St.ctorParameters=function(){return[{type:Ft},{type:n.MatDialog}]},St.propDecorators={relatedModelId:[{type:e.Input}],modelType:[{type:e.Input}],readonly:[{type:e.Input}],labelText:[{type:e.Input}]},t.ɵt=It=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-"+It.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?z(this.selectedValue,this.items):!this.multiple&&this.selectedValue?z([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.ɵt.nextId=0,t.ɵt.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:It}],styles:[".searchable-selctor-container{display:flex}.relative-icon{position:relative;top:-4px}"]}]}],t.ɵt.ctorParameters=function(){return[{type:l.FormBuilder},{type:p.FocusMonitor},{type:ht},{type:e.ElementRef},{type:n.MatDialog},{type:l.NgControl,decorators:[{type:e.Optional},{type:e.Self}]}]},t.ɵt.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.ɵt=It=H([r.UntilDestroy()],t.ɵt);var Mt=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}();Mt.decorators=[{type:e.Directive,args:[{selector:"[msInfiniteScroll]"}]}],Mt.ctorParameters=function(){return[{type:h.MatSelect},{type:e.NgZone}]},Mt.propDecorators={threshold:[{type:e.Input}],debounceTime:[{type:e.Input}],complete:[{type:e.Input}],infiniteScroll:[{type:e.Output}]};var Lt=function(){function t(){this.numItemsChange=new e.EventEmitter}return t.prototype.numItemsChanged=function(){this.numItemsChange.emit(this.numItems)},t}();Lt.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> '}]}],Lt.ctorParameters=function(){return[]},Lt.propDecorators={numItems:[{type:e.Input}],numItemsChange:[{type:e.Output}]};var _t=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}();_t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new _t},token:_t,providedIn:"root"}),_t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var Tt=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 kt(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}Tt.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>'}]}],Tt.ctorParameters=function(){return[]},Tt.propDecorators={start_value:[{type:e.Input}],end_value:[{type:e.Input}],selectedValueChange:[{type:e.Output}],selectedValue:[{type:e.Input}]};var At=function(){};At.CUSTOM=1,At.TODAY=2,At.YESTERDAY=3,At.THIS_WEEK=4,At.LAST_WEEK=5,At.THIS_MONTH=6,At.LAST_MONTH=7,At.THIS_QUARTER=8,At.LAST_QUARTER=9,At.THIS_YEAR=10,At.LAST_YEAR=11,At.ALL=12,t.ɵx=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=kt(t);e&&(this.setFieldValue(this.dateFrom,e.date_from),this.setFieldValue(this.dateTo,e.date_to),this.showCustomDateFields=e.show_custom_field)},t}(),t.ɵx.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.ɵx.ctorParameters=function(){return[]},t.ɵx.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.ɵx=H([r.UntilDestroy()],t.ɵx);var Et=function(){function t(){this.isLoading=!1,this.size=.6}return t.prototype.ngOnInit=function(){},t}();Et.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}"]}]}],Et.ctorParameters=function(){return[]},Et.propDecorators={isLoading:[{type:e.Input}],size:[{type:e.Input}],message:[{type:e.Input}]};var Vt=function(){};Vt.decorators=[{type:e.NgModule,args:[{declarations:[et,nt],imports:[a.CommonModule,d.MatSnackBarModule,g.MatIconModule],exports:[et,nt]}]}];var Ut=new Z("AuthenticationGuard"),Pt=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||(Ut.debug("Not authenticated, redirecting and adding redirect url..."),this.router.navigate(["/login"],{queryParams:{redirect:e.url},replaceUrl:!0}),!1)},t}();Pt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Pt(e.ɵɵinject(y.Router),e.ɵɵinject(ut))},token:Pt,providedIn:"root"}),Pt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Pt.ctorParameters=function(){return[{type:y.Router},{type:ut}]};var jt=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 G(e,void 0,void 0,(function(){var e;return q(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}();jt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new jt(e.ɵɵinject(ut),e.ɵɵinject(ht))},token:jt,providedIn:"root"}),jt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],jt.ctorParameters=function(){return[{type:ut},{type:ht}]};var Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(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);Rt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Rt},token:Rt,providedIn:"root"}),Rt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var Ot=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}();Ot.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ot},token:Ot,providedIn:"root"}),Ot.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ot.ctorParameters=function(){return[]};var Nt=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}();Nt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Nt(e.ɵɵinject(ht))},token:Nt,providedIn:"root"}),Nt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Nt.ctorParameters=function(){return[{type:ht}]};var Ht=function(){};Ht.decorators=[{type:e.NgModule,args:[{exports:[C.MatButtonModule,x.MatCheckboxModule,b.MatCommonModule,n.MatDialogModule,f.MatFormFieldModule,g.MatIconModule,F.MatInputModule,b.MatLineModule,w.MatMenuModule,b.MatNativeDateModule,b.MatOptionModule,D.MatProgressSpinnerModule,b.MatPseudoCheckboxModule,b.MatRippleModule,h.MatSelectModule,i.MatSortModule,o.MatTableModule,I.MatCardModule,S.MatDividerModule,M.MatChipsModule,L.MatDatepickerModule,_.MatListModule,v.MatTooltipModule]}]}];var Gt=function(t){if(t)throw new Error(t+" has already been loaded. Import Core module in the root module only.")};Gt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,s.HttpClientModule,y.RouterModule,Vt],providers:[{provide:s.HttpClient,useClass:ht},{provide:y.RouteReuseStrategy,useClass:Rt}],exports:[Vt]}]}],Gt.ctorParameters=function(){return[{type:Gt,decorators:[{type:e.Optional},{type:e.SkipSelf}]}]};var qt=function(){};qt.decorators=[{type:e.NgModule,args:[{imports:[T.FlexLayoutModule,a.CommonModule,Ht],declarations:[R],exports:[R],entryComponents:[R]}]}];var Bt=function(){};Bt.decorators=[{type:e.NgModule,args:[{imports:[T.FlexLayoutModule,a.CommonModule,k.InfiniteScrollModule,Ht],declarations:[t.ɵi],exports:[t.ɵi]}]}];var zt=function(){};zt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,T.FlexLayoutModule,A.NgxDocViewerModule,Ht],declarations:[K],exports:[K]}]}];var $t=function(){};$t.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,T.FlexLayoutModule,Ht],declarations:[Ct],exports:[Ct]}]}];var Yt=function(){};Yt.decorators=[{type:e.NgModule,args:[{declarations:[bt,t.ɵo],imports:[a.CommonModule,l.FormsModule,l.ReactiveFormsModule,T.FlexLayoutModule,$t,zt,k.InfiniteScrollModule,qt,Ht],exports:[t.ɵo],entryComponents:[bt]}]}];var Wt=function(){};Wt.decorators=[{type:e.NgModule,args:[{declarations:[St,Dt],imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,T.FlexLayoutModule,qt,Ht],exports:[St],entryComponents:[Dt]}]}];var Kt=function(){};Kt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.ReactiveFormsModule,T.FlexLayoutModule,Ht],declarations:[t.ɵt,Mt],exports:[t.ɵt,Mt]}]}];var Jt=function(){};Jt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.FormsModule],declarations:[Lt,Tt],exports:[Lt,Tt]}]}];var Qt=function(){};Qt.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var Zt=function(){};Zt.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵx],imports:[a.CommonModule,Qt,T.FlexLayoutModule,Ht,l.ReactiveFormsModule],exports:[t.ɵx]}]}];var Xt=function(){};Xt.decorators=[{type:e.NgModule,args:[{declarations:[Et],imports:[a.CommonModule,D.MatProgressSpinnerModule],exports:[Et]}]}];var te=function(){};te.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var ee=function(){};ee.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,te]}]}];var ne=function(){};ne.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var oe=function(){};oe.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,ne]}]}];var ie=function(){};ie.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];new Z("EmailSubscriptionUser Form");var re={user_id:{required:"User is required"},email_type_id:{required:"Email Type is required"}};t.ɵba=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,re)},t.prototype.ngOnDestroy=function(){},t}(),t.ɵba.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.ɵba.ctorParameters=function(){return[{type:l.FormBuilder},{type:yt},{type:ot},{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:ht}]},t.ɵba=H([r.UntilDestroy()],t.ɵba);var ae=function(){};ae.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵba],imports:[a.CommonModule,Ht,T.FlexLayoutModule,l.ReactiveFormsModule,Kt,ie,Xt],entryComponents:[t.ɵba]}]}];var le=new Z("EmailSubscriptionUser list");t.ɵbb=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.ɵba,{width:"800px",autoFocus:!1,data:{}}).afterClosed().subscribe((function(t){t&&(le.debug(t),e.reload())}))},e.prototype.editEmailSubscriptionUser=function(e,n){var o=this;e.stopPropagation(),this.dialog.open(t.ɵba,{width:"800px",autoFocus:!1,data:{esUser:n}}).afterClosed().subscribe((function(t){t&&(le.debug(t),o.reload())}))},e.prototype.deleteEmailSubscriptionUser=function(t,e){var n=this;t.stopPropagation(),this.dialog.open(R,{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.ɵbb.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.ɵbb.ctorParameters=function(){return[{type:n.MatDialog},{type:ht},{type:y.Router}]},t.ɵbb.propDecorators={sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}]},t.ɵbb=H([r.UntilDestroy()],t.ɵbb);var se={title:"Email Subscription Users",permissions:{only:["app_admin"],redirectTo:"/"}},ce=[{path:"",component:t.ɵbb,canActivate:[Pt],data:se}],ue=function(){};ue.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(ce)],exports:[y.RouterModule]}]}];var de=function(){};de.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}],t.ɵbg=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.ɵbg.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.ɵbg.ctorParameters=function(){return[{type:l.FormBuilder}]},t.ɵbg.propDecorators={valueChange:[{type:e.Output}]},t.ɵbg=H([r.UntilDestroy()],t.ɵbg);var pe=function(){};pe.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbg],imports:[a.CommonModule,Ht,T.FlexLayoutModule,l.ReactiveFormsModule,Kt,de],exports:[t.ɵbg]}]}];var me=function(){};me.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbb],imports:[a.CommonModule,k.InfiniteScrollModule,Ht,T.FlexLayoutModule,l.ReactiveFormsModule,ue,ae,pe],exports:[t.ɵbb]}]}];var fe=function(){};fe.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var he=function(){};he.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,fe]}]}];var ge=function(){};ge.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var ye={title:{required:"Title is required"},code:{required:"Code is required"},frequency_id:{required:"Frequency is required"}};t.ɵbh=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,ye)},t.prototype.ngOnDestroy=function(){},t}(),t.ɵbh.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.ɵbh.ctorParameters=function(){return[{type:l.FormBuilder},{type:yt},{type:ot},{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:ht}]},t.ɵbh=H([r.UntilDestroy()],t.ɵbh);var ve=function(){};ve.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbh],imports:[a.CommonModule,Ht,T.FlexLayoutModule,l.ReactiveFormsModule,Kt,ge,Xt],exports:[t.ɵbh],entryComponents:[t.ɵbh]}]}],t.ɵbi=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.ɵbh,{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.ɵbh,{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(R,{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.ɵbi.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.ɵbi.ctorParameters=function(){return[{type:n.MatDialog},{type:ht}]},t.ɵbi.propDecorators={sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}]},t.ɵbi=H([r.UntilDestroy()],t.ɵbi);var be={title:"Email Subscription Type",permissions:{only:["client_admin"],redirectTo:"/"}},Ce=[{path:"",component:t.ɵbi,canActivate:[Pt],data:be}],xe=function(){};xe.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Ce)],exports:[y.RouterModule]}]}];var Fe=function(){};Fe.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbi],imports:[a.CommonModule,Ht,T.FlexLayoutModule,l.ReactiveFormsModule,k.InfiniteScrollModule,ve,xe],exports:[t.ɵbi]}]}],t.ɵbj=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.ɵbj.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.ɵbj.ctorParameters=function(){return[{type:ht}]},t.ɵbj=H([r.UntilDestroy()],t.ɵbj);var we={permissions:{only:["client_admin"]}},De=[{path:"",component:t.ɵbj,canActivate:[Pt],data:we}],Ie=function(){};Ie.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(De)],exports:[y.RouterModule]}]}];var Se=function(){};Se.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbj],imports:[a.CommonModule,k.InfiniteScrollModule,Ht,T.FlexLayoutModule,Ie],exports:[t.ɵbj]}]}];var Me=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}();Me.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}"]}]}],Me.ctorParameters=function(){return[]},Me.propDecorators={text:[{type:e.Input}],maxLength:[{type:e.Input}]};var Le=function(){};Le.decorators=[{type:e.NgModule,args:[{declarations:[Me],imports:[a.CommonModule,Ht,T.FlexLayoutModule],exports:[Me]}]}];var _e=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}();_e.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new _e(e.ɵɵinject(ht))},token:_e,providedIn:"root"}),_e.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],_e.ctorParameters=function(){return[{type:ht}]};var Te={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"}},ke=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 G(this,void 0,void 0,(function(){var t,e,n;return q(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,Te)},t}();ke.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:[""]}]}],ke.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:l.FormBuilder},{type:yt},{type:ot},{type:_e}]},ke.propDecorators={onSave:[{type:e.Output}]};var Ae=function(){};Ae.decorators=[{type:e.NgModule,args:[{declarations:[ke],imports:[a.CommonModule,l.ReactiveFormsModule,Ht,T.FlexLayoutModule,E.NgxEditorModule],exports:[ke],entryComponents:[ke]}]}],t.ɵbk=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 G(this,void 0,void 0,(function(){var t,e;return q(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(ke,{width:"600px",data:{techlifyUpdateDetails:t}}).afterClosed().subscribe((function(t){t&&e.reload()}))},t.prototype.deleteTechlifyUpdate=function(t){return G(this,void 0,void 0,(function(){var e=this;return q(this,(function(n){return this.dialog.open(R,{width:"400px",data:{title:"Delete Update",message:"Are you sure to delete this update?"},autoFocus:!1}).afterClosed().subscribe((function(n){return G(e,void 0,void 0,(function(){return q(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.ɵbk.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.ɵbk.ctorParameters=function(){return[{type:n.MatDialog},{type:ot},{type:_e},{type:l.FormBuilder}]},t.ɵbk=H([r.UntilDestroy()],t.ɵbk);var Ee=[{path:"",redirectTo:"all",pathMatch:"full"},{path:"all",component:t.ɵbk},{path:"**",redirectTo:"all",pathMatch:"full"}],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,l.ReactiveFormsModule,k.InfiniteScrollModule,T.FlexLayoutModule,Ht,qt,Ve,Ae,Le]}]}];var Pe=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}();Pe.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}"]}]}],Pe.ctorParameters=function(){return[{type:n.MatDialogRef},{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:y.Router}]},t.ɵbs=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 G(this,void 0,void 0,(function(){var t,e;return q(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(Pe,{width:"800px",autoFocus:!1,data:{techlifyUpdate:t,isFromHistory:!0}})},t.prototype.updateCurrentUserUpdates=function(){return G(this,void 0,void 0,(function(){return q(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.ɵbs.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.ɵbs.ctorParameters=function(){return[{type:n.MatDialog},{type:_e},{type:l.FormBuilder},{type:ot}]},t.ɵbs=H([r.UntilDestroy()],t.ɵbs);var je=[{path:"",redirectTo:"update-history",pathMatch:"full"},{path:"update-history",component:t.ɵbs},{path:"**",redirectTo:"all",pathMatch:"full"}],Re=function(){};Re.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(je)],exports:[y.RouterModule]}]}];var Oe=function(){};Oe.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,T.FlexLayoutModule,Ht,qt,Le,Re],declarations:[t.ɵbs]}]}];var Ne=function(){};Ne.decorators=[{type:e.NgModule,args:[{declarations:[Pe],imports:[a.CommonModule,Ht,T.FlexLayoutModule],exports:[Pe],entryComponents:[Pe]}]}];var He=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(Pe,{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 G(this,void 0,void 0,(function(){var e;return q(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}();He.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}}"]}]}],He.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:_e},{type:ot}]};var Ge=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 G(this,void 0,void 0,(function(){var t;return q(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(He,{data:{techlifyUpdate:this.techlifyUpdate,rootNavUrl:this.rootNavUrl},horizontalPosition:"right",verticalPosition:"top",panelClass:["white-bg"]})},t}();Ge.decorators=[{type:e.Component,args:[{selector:"app-update-notifier",template:"",styles:["::ng-deep .white-bg{background-color:#fff}"]}]}],Ge.ctorParameters=function(){return[{type:d.MatSnackBar},{type:_e},{type:ot}]},Ge.propDecorators={rootNavUrl:[{type:e.Input}]};var qe=function(){};qe.decorators=[{type:e.NgModule,args:[{declarations:[Ge,He],imports:[a.CommonModule,Ht,Ne,T.FlexLayoutModule,qt],exports:[Ge],entryComponents:[He]}]}];var Be=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}();Be.decorators=[{type:e.Component,args:[{selector:"app-export-excel-button",template:'<button mat-raised-button color="accent" (click)="exportExcel()">Export Excel</button>',styles:[""]}]}],Be.ctorParameters=function(){return[]},Be.propDecorators={name:[{type:e.Input}],data:[{type:e.Input}]};var ze=function(){};ze.decorators=[{type:e.NgModule,args:[{declarations:[Be],imports:[a.CommonModule,Ht],exports:[Be]}]}],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:ht}]},t.AuditLogViewModelComponent=H([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=H([r.UntilDestroy()],t.AuditLogsViewModelComponent);var $e=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}();$e.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:[""]}]}],$e.ctorParameters=function(){return[{type:n.MatDialog}]},$e.propDecorators={modelType:[{type:e.Input}],modelId:[{type:e.Input}],logView:[{type:e.Input}]};var Ye=function(){};Ye.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var We=function(){};We.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var Ke=function(){};Ke.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogViewModelComponent],imports:[a.CommonModule,We,T.FlexLayoutModule,Ht],exports:[t.AuditLogViewModelComponent]}]}];var Je=function(){};Je.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var Qe=function(){};Qe.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 G(this,void 0,void 0,(function(){var t;return q(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:Nt},{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=H([r.UntilDestroy()],t.AuditLogListComponent);var Ze=function(){};function Xe(){return function(t){var e=new Date(t.value);return t.value&&"Invalid Date"==e?{invalidDate:!0}:null}}Ze.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:["",Xe()],date_from:["",Xe()]})},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:yt}]},t.AuditLogListFilterComponent.propDecorators={objectId:[{type:e.Input}],objectType:[{type:e.Input}],valueChange:[{type:e.Output}]},t.AuditLogListFilterComponent=H([r.UntilDestroy()],t.AuditLogListFilterComponent);var tn=function(){};tn.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogListFilterComponent],imports:[a.CommonModule,Ze,T.FlexLayoutModule,l.ReactiveFormsModule,Ht,Kt],exports:[t.AuditLogListFilterComponent]}]}];var en=function(){};en.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogListComponent],imports:[a.CommonModule,Qe,ze,T.FlexLayoutModule,l.ReactiveFormsModule,Ht,k.InfiniteScrollModule,tn],exports:[t.AuditLogListComponent]}]}];var nn=function(){};nn.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogsViewModelComponent],imports:[a.CommonModule,Je,T.FlexLayoutModule,en],exports:[t.AuditLogsViewModelComponent]}]}];var on=function(){};on.decorators=[{type:e.NgModule,args:[{declarations:[$e],imports:[Ke,nn,a.CommonModule,Ye,T.FlexLayoutModule,Ht],exports:[$e]}]}];var rn=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 G(this,void 0,void 0,(function(){var e;return q(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}();rn.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:[""]}]}],rn.ctorParameters=function(){return[{type:Nt},{type:y.ActivatedRoute},{type:a.Location}]};var an=function(){};an.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var ln=function(){};ln.decorators=[{type:e.NgModule,args:[{declarations:[rn],imports:[a.CommonModule,an,T.FlexLayoutModule,Ht],exports:[rn]}]}];var sn=[{path:"log-list",component:t.AuditLogListComponent,canActivate:[Pt]},{path:"log-view/:id",component:rn,canActivate:[Pt]},{path:"**",redirectTo:"log-list",pathMatch:"full"}],cn=function(){};cn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(sn)],exports:[y.RouterModule]}]}];var un=function(){};un.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,cn,en,ln],exports:[]}]}];var dn=function(){};dn.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:ot},{type:ht},{type:a.Location}]},t.ImportCsvComponent.propDecorators={importConfig:[{type:e.Input}]},t.ImportCsvComponent=H([r.UntilDestroy()],t.ImportCsvComponent);var pn=function(){};pn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var mn={property:{required:"Property is required",unavailable:"Duplicate entry"}},fn=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,mn)},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}();fn.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}"]}]}],fn.ctorParameters=function(){return[{type:l.FormBuilder},{type:yt},{type:e.ChangeDetectorRef}]},fn.propDecorators={data:[{type:e.Input}],importConfig:[{type:e.Input}],onSave:[{type:e.Output}]};var hn=function(){};hn.decorators=[{type:e.NgModule,args:[{declarations:[fn],imports:[a.CommonModule,T.FlexLayoutModule,Ht,l.ReactiveFormsModule,pn],exports:[fn]}]}];var gn=function(){};gn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var yn=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}();yn.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:[""]}]}],yn.ctorParameters=function(){return[]},yn.propDecorators={failedItems:[{type:e.Input}],selectedFields:[{type:e.Input}]};var vn=function(){};vn.decorators=[{type:e.NgModule,args:[{declarations:[yn],imports:[a.CommonModule,Ht,T.FlexLayoutModule,gn],exports:[yn]}]}];var bn=function(){};bn.decorators=[{type:e.NgModule,args:[{declarations:[t.ImportCsvComponent],imports:[a.CommonModule,Ht,T.FlexLayoutModule,$t,dn,hn,vn],exports:[t.ImportCsvComponent]}]}];var Cn=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:ht},{type:l.FormBuilder}]},t.LoginHistoryForUserComponent.propDecorators={userId:[{type:e.Input}]},t.LoginHistoryForUserComponent=H([r.UntilDestroy()],t.LoginHistoryForUserComponent);var xn=[{path:"",component:t.LoginHistoryForUserComponent,canActivate:[Pt]}],Fn=function(){};Fn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(xn)],exports:[y.RouterModule]}]}];var wn=function(){};wn.decorators=[{type:e.NgModule,args:[{declarations:[t.LoginHistoryForUserComponent],imports:[a.CommonModule,Fn,k.InfiniteScrollModule,Ht,T.FlexLayoutModule,l.ReactiveFormsModule,Zt],exports:[t.LoginHistoryForUserComponent]}]}],t.ActionPopup=j,t.ActionPopupComponent=R,t.ActionPopupModule=qt,t.AlertService=ot,t.ApiPrefixInterceptor=ct,t.AuditLogForModelComponent=$e,t.AuditLogForModelModule=on,t.AuditLogForModelRoutingModule=Ye,t.AuditLogListFilterModule=tn,t.AuditLogListFilterRoutingModule=Ze,t.AuditLogListModule=en,t.AuditLogListRoutingModule=Qe,t.AuditLogModule=un,t.AuditLogRoutingModule=cn,t.AuditLogViewComponent=rn,t.AuditLogViewModelModule=Ke,t.AuditLogViewModelRoutingModule=We,t.AuditLogViewModule=ln,t.AuditLogViewRoutingModule=an,t.AuditLogsViewModelModule=nn,t.AuditLogsViewModelRoutingModule=Je,t.AuthenticationGuard=Pt,t.AuthenticationService=jt,t.CacheInterceptor=st,t.ConfigService=tt,t.CoreModule=Gt,t.CredentialsService=ut,t.DataManager=Nt,t.DataTable=Y,t.DataTableComponent=t.ɵi,t.DataTableModule=Bt,t.DateUtils=_t,t.DateValidator=Xe,t.DocumentViewerComponent=K,t.DocumentViewerModule=zt,t.EmailSubscriptionForUserComponent=t.ɵbj,t.EmailSubscriptionForUserModule=Se,t.EmailSubscriptionForUserRoutingModule=Ie,t.EmailSubscriptionModule=ee,t.EmailSubscriptionRoutingModule=te,t.EmailSubscriptionTypeFormComponent=t.ɵbh,t.EmailSubscriptionTypeFormModule=ve,t.EmailSubscriptionTypeFormRoutingModule=ge,t.EmailSubscriptionTypeListComponent=t.ɵbi,t.EmailSubscriptionTypeListModule=Fe,t.EmailSubscriptionTypeListRoutingModule=xe,t.EmailSubscriptionTypeModule=he,t.EmailSubscriptionTypeRoutingModule=fe,t.EmailSubscriptionUserFormComponent=t.ɵba,t.EmailSubscriptionUserFormModule=ae,t.EmailSubscriptionUserFormRoutingModule=ie,t.EmailSubscriptionUserListComponent=t.ɵbb,t.EmailSubscriptionUserListFilterComponent=t.ɵbg,t.EmailSubscriptionUserListFilterModule=pe,t.EmailSubscriptionUserListFilterRoutingModule=de,t.EmailSubscriptionUserListModule=me,t.EmailSubscriptionUserListRoutingModule=ue,t.EmailSubscriptionUserModule=oe,t.EmailSubscriptionUserRoutingModule=ne,t.EntityFileFormComponent=bt,t.EntityFilesViewAllComponent=t.ɵo,t.EntityFilesViewAllModule=Yt,t.ErrorHandlerInterceptor=rt,t.ErrorHandlerService=it,t.ErrorSnackComponent=nt,t.ExportExcelButtonComponent=Be,t.ExportExcelModule=ze,t.FailedItemsComponent=yn,t.FailedItemsModule=vn,t.FailedItemsRoutingModule=gn,t.FileDropperComponent=Ct,t.FileDropperConfig=xt,t.FileDropperModule=$t,t.FormValidatorService=yt,t.HTTP_DYNAMIC_INTERCEPTORS=ft,t.HttpCacheService=lt,t.HttpService=ht,t.ImportConfig=Cn,t.ImportCsvModule=bn,t.ImportCsvRoutingModule=dn,t.ImportItemsComponent=fn,t.ImportItemsModule=hn,t.ImportItemsRoutingModule=pn,t.LoaderComponent=Et,t.LoaderModule=Xt,t.Logger=Z,t.LoginHistoryForUserModule=wn,t.LoginHistoryForUserRoutingModule=Fn,t.MatSelectInfiniteScrollDirective=Mt,t.MaterialModule=Ht,t.NoteFormComponent=Dt,t.NoteListComponent=St,t.NoteModule=Wt,t.NumItemsSelector=Lt,t.NumberSelector=Tt,t.PageEvent=W,t.RouteReusableStrategy=Rt,t.SearchableSelectorComponent=t.ɵt,t.SearchableSelectorModule=Kt,t.SnackModule=Vt,t.StorageService=Ot,t.SuccessSnackComponent=et,t.TechlifyConfig=X,t.TechlifyUpdateHistoryModule=Oe,t.TechlifyUpdateModule=Ue,t.Timeline=At,t.TimelineFilterComponent=t.ɵx,t.TimelineFilterModule=Zt,t.TokenInterceptor=dt,t.UpdateNotifierComponent=Ge,t.UpdateNotifierModule=qe,t.UtilityModule=Jt,t.ViewerConfig=Q,t.calculateTimeline=kt,t.esfur=we,t.estlr=be,t.esulr=se,t.ɵa=Vt,t.ɵb=et,t.ɵbc=Pt,t.ɵbd=ut,t.ɵbe=tt,t.ɵbf=X,t.ɵbl=_e,t.ɵbm=Ve,t.ɵbn=Ae,t.ɵbo=ke,t.ɵbp=Le,t.ɵbq=Me,t.ɵbr=Re,t.ɵbt=He,t.ɵbu=Ne,t.ɵbv=Pe,t.ɵbw=Nt,t.ɵc=nt,t.ɵd=ft,t.ɵe=ht,t.ɵf=Rt,t.ɵg=R,t.ɵh=j,t.ɵj=K,t.ɵk=bt,t.ɵl=yt,t.ɵm=gt,t.ɵn=ot,t.ɵp=Ct,t.ɵq=St,t.ɵr=Ft,t.ɵs=Dt,t.ɵu=Mt,t.ɵv=Lt,t.ɵw=Tt,t.ɵy=Qt,t.ɵz=Et,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 wt={url:{required:"File is required"}},It=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,wt)},t}();It.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:[""]}]}],It.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(It,{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(It,{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 Tt={note:{required:"Note is required"}},_t=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,Tt)},t}();_t.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:[""]}]}],_t.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(_t,{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(_t,{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=function(){};Ot.CUSTOM=1,Ot.TODAY=2,Ot.YESTERDAY=3,Ot.THIS_WEEK=4,Ot.LAST_WEEK=5,Ot.THIS_MONTH=6,Ot.LAST_MONTH=7,Ot.THIS_QUARTER=8,Ot.LAST_QUARTER=9,Ot.THIS_YEAR=10,Ot.LAST_YEAR=11,Ot.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=jt(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=z([r.UntilDestroy()],t.ɵbb);var Rt=function(){function t(){this.isLoading=!1,this.size=.6}return t.prototype.ngOnInit=function(){},t}();Rt.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}"]}]}],Rt.ctorParameters=function(){return[]},Rt.propDecorators={isLoading:[{type:e.Input}],size:[{type:e.Input}],message:[{type:e.Input}]};var Nt=function(){};Nt.decorators=[{type:e.NgModule,args:[{declarations:[at,lt],imports:[a.CommonModule,d.MatSnackBarModule,g.MatIconModule],exports:[at,lt]}]}];var Ht=new ot("AuthenticationGuard"),Gt=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||(Ht.debug("Not authenticated, redirecting and adding redirect url..."),this.router.navigate(["/login"],{queryParams:{redirect:e.url},replaceUrl:!0}),!1)},t}();Gt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Gt(e.ɵɵinject(y.Router),e.ɵɵinject(ht))},token:Gt,providedIn:"root"}),Gt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Gt.ctorParameters=function(){return[{type:y.Router},{type:ht}]};var qt=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}();qt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new qt(e.ɵɵinject(ht),e.ɵɵinject(Ct))},token:qt,providedIn:"root"}),qt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],qt.ctorParameters=function(){return[{type:ht},{type:Ct}]};var Bt=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);Bt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Bt},token:Bt,providedIn:"root"}),Bt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}];var zt=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}();zt.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new zt},token:zt,providedIn:"root"}),zt.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],zt.ctorParameters=function(){return[]};var $t=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}();$t.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new $t(e.ɵɵinject(Ct))},token:$t,providedIn:"root"}),$t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],$t.ctorParameters=function(){return[{type:Ct}]};var Wt=function(){};Wt.decorators=[{type:e.NgModule,args:[{exports:[C.MatButtonModule,x.MatCheckboxModule,b.MatCommonModule,n.MatDialogModule,f.MatFormFieldModule,g.MatIconModule,F.MatInputModule,b.MatLineModule,w.MatMenuModule,b.MatNativeDateModule,b.MatOptionModule,I.MatProgressSpinnerModule,b.MatPseudoCheckboxModule,b.MatRippleModule,h.MatSelectModule,i.MatSortModule,o.MatTableModule,D.MatCardModule,S.MatDividerModule,M.MatChipsModule,T.MatDatepickerModule,_.MatListModule,v.MatTooltipModule]}]}];var Yt=function(t){if(t)throw new Error(t+" has already been loaded. Import Core module in the root module only.")};Yt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,s.HttpClientModule,y.RouterModule,Nt],providers:[{provide:s.HttpClient,useClass:Ct},{provide:y.RouteReuseStrategy,useClass:Bt}],exports:[Nt]}]}],Yt.ctorParameters=function(){return[{type:Yt,decorators:[{type:e.Optional},{type:e.SkipSelf}]}]};var Kt=function(){};Kt.decorators=[{type:e.NgModule,args:[{imports:[L.FlexLayoutModule,a.CommonModule,Wt],declarations:[G],exports:[G],entryComponents:[G]}]}];var Jt=function(){};Jt.decorators=[{type:e.NgModule,args:[{imports:[L.FlexLayoutModule,a.CommonModule,k.InfiniteScrollModule,Wt],declarations:[t.ɵi],exports:[t.ɵi]}]}];var Qt=function(){};Qt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,L.FlexLayoutModule,A.NgxDocViewerModule,Wt],declarations:[tt],exports:[tt]}]}];var Zt=function(){};Zt.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,L.FlexLayoutModule,Wt],declarations:[Dt],exports:[Dt]}]}];var Xt=function(){};Xt.decorators=[{type:e.NgModule,args:[{declarations:[It,t.ɵo],imports:[a.CommonModule,l.FormsModule,l.ReactiveFormsModule,L.FlexLayoutModule,Zt,Qt,k.InfiniteScrollModule,Kt,Wt],exports:[t.ɵo],entryComponents:[It]}]}];var te=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}();te.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}"]}]}],te.ctorParameters=function(){return[]},te.propDecorators={text:[{type:e.Input}],maxLength:[{type:e.Input}]};var ee=function(){};ee.decorators=[{type:e.NgModule,args:[{declarations:[te],imports:[a.CommonModule,Wt,L.FlexLayoutModule],exports:[te]}]}];var ne=function(){};ne.decorators=[{type:e.NgModule,args:[{declarations:[Lt,_t,At],imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,L.FlexLayoutModule,Kt,Wt,ee],exports:[Lt],entryComponents:[_t]}]}];var oe=function(){};oe.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.ReactiveFormsModule,L.FlexLayoutModule,Wt],declarations:[t.ɵx,Et],exports:[t.ɵx,Et]}]}];var ie=function(){};ie.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.FormsModule],declarations:[Vt,Pt],exports:[Vt,Pt]}]}];var re=function(){};re.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var ae=function(){};ae.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbb],imports:[a.CommonModule,re,L.FlexLayoutModule,Wt,l.ReactiveFormsModule],exports:[t.ɵbb]}]}];var le=function(){};le.decorators=[{type:e.NgModule,args:[{declarations:[Rt],imports:[a.CommonModule,I.MatProgressSpinnerModule],exports:[Rt]}]}];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]}]}];var de=function(){};de.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,ue]}]}];var pe=function(){};pe.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];new ot("EmailSubscriptionUser Form");var me={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,me)},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 fe=function(){};fe.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbe],imports:[a.CommonModule,Wt,L.FlexLayoutModule,l.ReactiveFormsModule,oe,pe,le],entryComponents:[t.ɵbe]}]}];var he=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&&(he.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&&(he.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 ge={title:"Email Subscription Users",permissions:{only:["app_admin"],redirectTo:"/"}},ye=[{path:"",component:t.ɵbf,canActivate:[Gt],data:ge}],ve=function(){};ve.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(ye)],exports:[y.RouterModule]}]}];var be=function(){};be.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=z([r.UntilDestroy()],t.ɵbh);var Ce=function(){};Ce.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbh],imports:[a.CommonModule,Wt,L.FlexLayoutModule,l.ReactiveFormsModule,oe,be],exports:[t.ɵbh]}]}];var xe=function(){};xe.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbf],imports:[a.CommonModule,k.InfiniteScrollModule,Wt,L.FlexLayoutModule,l.ReactiveFormsModule,ve,fe,Ce],exports:[t.ɵbf]}]}];var Fe=function(){};Fe.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,Fe]}]}];var Ie=function(){};Ie.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var De={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,De)},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 Se=function(){};Se.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbi],imports:[a.CommonModule,Wt,L.FlexLayoutModule,l.ReactiveFormsModule,oe,Ie,le],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> 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:Ct}]},t.ɵbj.propDecorators={sort:[{type:e.ViewChild,args:[i.MatSort,{static:!0}]}]},t.ɵbj=z([r.UntilDestroy()],t.ɵbj);var Me={title:"Email Subscription Type",permissions:{only:["client_admin"],redirectTo:"/"}},Te=[{path:"",component:t.ɵbj,canActivate:[Gt],data:Me}],_e=function(){};_e.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Te)],exports:[y.RouterModule]}]}];var Le=function(){};Le.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbj],imports:[a.CommonModule,Wt,L.FlexLayoutModule,l.ReactiveFormsModule,k.InfiniteScrollModule,Se,_e],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 ke={permissions:{only:["client_admin"]}},Ae=[{path:"",component:t.ɵbk,canActivate:[Gt],data:ke}],Ee=function(){};Ee.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Ae)],exports:[y.RouterModule]}]}];var Ve=function(){};Ve.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbk],imports:[a.CommonModule,k.InfiniteScrollModule,Wt,L.FlexLayoutModule,Ee],exports:[t.ɵbk]}]}];var Ue=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}();Ue.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Ue(e.ɵɵinject(Ct))},token:Ue,providedIn:"root"}),Ue.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Ue.ctorParameters=function(){return[{type:Ct}]};var Pe={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"}},je=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,Pe)},t}();je.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:[""]}]}],je.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:Ue}]},je.propDecorators={onSave:[{type:e.Output}]};var Oe=function(){};Oe.decorators=[{type:e.NgModule,args:[{declarations:[je],imports:[a.CommonModule,l.ReactiveFormsModule,Wt,L.FlexLayoutModule,E.NgxEditorModule],exports:[je],entryComponents:[je]}]}],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(je,{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:Ue},{type:l.FormBuilder}]},t.ɵbl=z([r.UntilDestroy()],t.ɵbl);var Re=[{path:"",redirectTo:"all",pathMatch:"full"},{path:"all",component:t.ɵbl},{path:"**",redirectTo:"all",pathMatch:"full"}],Ne=function(){};Ne.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Re)],exports:[y.RouterModule]}]}];var He=function(){};He.decorators=[{type:e.NgModule,args:[{declarations:[t.ɵbl],imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,L.FlexLayoutModule,Wt,Kt,Ne,Oe,ee]}]}];var Ge=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}();Ge.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}"]}]}],Ge.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(Ge,{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:Ue},{type:l.FormBuilder},{type:st}]},t.ɵbr=z([r.UntilDestroy()],t.ɵbr);var qe=[{path:"",redirectTo:"update-history",pathMatch:"full"},{path:"update-history",component:t.ɵbr},{path:"**",redirectTo:"all",pathMatch:"full"}],Be=function(){};Be.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(qe)],exports:[y.RouterModule]}]}];var ze=function(){};ze.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,l.ReactiveFormsModule,k.InfiniteScrollModule,L.FlexLayoutModule,Wt,Kt,ee,Be],declarations:[t.ɵbr]}]}];var $e=function(){};$e.decorators=[{type:e.NgModule,args:[{declarations:[Ge],imports:[a.CommonModule,Wt,L.FlexLayoutModule],exports:[Ge],entryComponents:[Ge]}]}];var We=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(Ge,{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}();We.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}}"]}]}],We.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:Ue},{type:st}]};var Ye=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(We,{data:{techlifyUpdate:this.techlifyUpdate,rootNavUrl:this.rootNavUrl},horizontalPosition:"right",verticalPosition:"top",panelClass:["white-bg"]})},t}();Ye.decorators=[{type:e.Component,args:[{selector:"app-update-notifier",template:"",styles:["::ng-deep .white-bg{background-color:#fff}"]}]}],Ye.ctorParameters=function(){return[{type:d.MatSnackBar},{type:Ue},{type:st}]},Ye.propDecorators={rootNavUrl:[{type:e.Input}]};var Ke=function(){};Ke.decorators=[{type:e.NgModule,args:[{declarations:[Ye,We],imports:[a.CommonModule,Wt,$e,L.FlexLayoutModule,Kt],exports:[Ye],entryComponents:[We]}]}];var Je=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}();Je.decorators=[{type:e.Component,args:[{selector:"app-export-excel-button",template:'<button mat-raised-button color="accent" (click)="exportExcel()">Export Excel</button>',styles:[""]}]}],Je.ctorParameters=function(){return[]},Je.propDecorators={name:[{type:e.Input}],data:[{type:e.Input}]};var Qe=function(){};Qe.decorators=[{type:e.NgModule,args:[{declarations:[Je],imports:[a.CommonModule,Wt],exports:[Je]}]}],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 Ze=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}();Ze.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:[""]}]}],Ze.ctorParameters=function(){return[{type:n.MatDialog}]},Ze.propDecorators={modelType:[{type:e.Input}],modelId:[{type:e.Input}],logView:[{type:e.Input}]};var Xe=function(){};Xe.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];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:[{declarations:[t.AuditLogViewModelComponent],imports:[a.CommonModule,tn,L.FlexLayoutModule,Wt],exports:[t.AuditLogViewModelComponent]}]}];var nn=function(){};nn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var on=function(){};on.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:$t},{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 rn=function(){};function an(){return function(t){var e=new Date(t.value);return t.value&&"Invalid Date"==e?{invalidDate:!0}:null}}rn.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:["",an()],date_from:["",an()]})},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 ln=function(){};ln.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogListFilterComponent],imports:[a.CommonModule,rn,L.FlexLayoutModule,l.ReactiveFormsModule,Wt,oe],exports:[t.AuditLogListFilterComponent]}]}];var sn=function(){};sn.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogListComponent],imports:[a.CommonModule,on,Qe,L.FlexLayoutModule,l.ReactiveFormsModule,Wt,k.InfiniteScrollModule,ln],exports:[t.AuditLogListComponent]}]}];var cn=function(){};cn.decorators=[{type:e.NgModule,args:[{declarations:[t.AuditLogsViewModelComponent],imports:[a.CommonModule,nn,L.FlexLayoutModule,sn],exports:[t.AuditLogsViewModelComponent]}]}];var un=function(){};un.decorators=[{type:e.NgModule,args:[{declarations:[Ze],imports:[en,cn,a.CommonModule,Xe,L.FlexLayoutModule,Wt],exports:[Ze]}]}];var dn=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}();dn.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:[""]}]}],dn.ctorParameters=function(){return[{type:$t},{type:y.ActivatedRoute},{type:a.Location}]};var pn=function(){};pn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var mn=function(){};mn.decorators=[{type:e.NgModule,args:[{declarations:[dn],imports:[a.CommonModule,pn,L.FlexLayoutModule,Wt],exports:[dn]}]}];var fn=[{path:"log-list",component:t.AuditLogListComponent,canActivate:[Gt]},{path:"log-view/:id",component:dn,canActivate:[Gt]},{path:"**",redirectTo:"log-list",pathMatch:"full"}],hn=function(){};hn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(fn)],exports:[y.RouterModule]}]}];var gn=function(){};gn.decorators=[{type:e.NgModule,args:[{declarations:[],imports:[a.CommonModule,hn,sn,mn],exports:[]}]}];var yn=function(){};yn.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 vn=function(){};vn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild([])],exports:[y.RouterModule]}]}];var bn={property:{required:"Property is required",unavailable:"Duplicate entry"}},Cn=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,bn)},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}();Cn.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}"]}]}],Cn.ctorParameters=function(){return[{type:l.FormBuilder},{type:Ft},{type:e.ChangeDetectorRef}]},Cn.propDecorators={data:[{type:e.Input}],importConfig:[{type:e.Input}],onSave:[{type:e.Output}]};var xn=function(){};xn.decorators=[{type:e.NgModule,args:[{declarations:[Cn],imports:[a.CommonModule,L.FlexLayoutModule,Wt,l.ReactiveFormsModule,vn],exports:[Cn]}]}];var Fn=function(){};Fn.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 In=function(){};In.decorators=[{type:e.NgModule,args:[{declarations:[wn],imports:[a.CommonModule,Wt,L.FlexLayoutModule,Fn],exports:[wn]}]}];var Dn=function(){};Dn.decorators=[{type:e.NgModule,args:[{declarations:[t.ImportCsvComponent],imports:[a.CommonModule,Wt,L.FlexLayoutModule,Zt,yn,xn,In],exports:[t.ImportCsvComponent]}]}];var Sn=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:Ct},{type:l.FormBuilder}]},t.LoginHistoryForUserComponent.propDecorators={userId:[{type:e.Input}]},t.LoginHistoryForUserComponent=z([r.UntilDestroy()],t.LoginHistoryForUserComponent);var Mn=[{path:"",component:t.LoginHistoryForUserComponent,canActivate:[Gt]}],Tn=function(){};Tn.decorators=[{type:e.NgModule,args:[{imports:[y.RouterModule.forChild(Mn)],exports:[y.RouterModule]}]}];var _n=function(){};_n.decorators=[{type:e.NgModule,args:[{declarations:[t.LoginHistoryForUserComponent],imports:[a.CommonModule,Tn,k.InfiniteScrollModule,Wt,L.FlexLayoutModule,l.ReactiveFormsModule,ae],exports:[t.LoginHistoryForUserComponent]}]}];var Ln,kn=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=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.stateChanges=new c.Subject,this.focused=!1,this.controlType="techlify-tagger-form-field",this.id="techlify-tagger-form-field-"+Ln.nextId++,this.onChange=function(t){},this.onTouched=function(){},this.tagInputCtrl=new l.FormControl,this.config=new kn,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:Ln}],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=Ln=z([r.UntilDestroy()],t.TechlifyTaggerTagFormFieldComponent);var An,En=function(){};En.decorators=[{type:e.NgModule,args:[{declarations:[t.TechlifyTaggerTagFormFieldComponent],imports:[a.CommonModule,Wt,L.FlexLayoutModule,O.MatAutocompleteModule,l.ReactiveFormsModule],exports:[t.TechlifyTaggerTagFormFieldComponent]}]}],t.TechlifyTaggerTagSelectorComponent=An=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-"+An.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:An}],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=An=z([r.UntilDestroy()],t.TechlifyTaggerTagSelectorComponent);var Vn=function(){};Vn.decorators=[{type:e.NgModule,args:[{declarations:[t.TechlifyTaggerTagSelectorComponent],imports:[a.CommonModule,Wt,L.FlexLayoutModule,O.MatAutocompleteModule,l.ReactiveFormsModule,oe,R.MatButtonToggleModule],exports:[t.TechlifyTaggerTagSelectorComponent]}]}];var Un=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}();Un.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new Un(e.ɵɵinject($t))},token:Un,providedIn:"root"}),Un.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],Un.ctorParameters=function(){return[{type:$t}]},t.CompanyFeatureComponent=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.CompanyFeatureComponent.decorators=[{type:e.Component,args:[{selector:"app-company-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.CompanyFeatureComponent.ctorParameters=function(){return[{type:$t},{type:ct},{type:l.FormBuilder},{type:st},{type:n.MatDialog},{type:zt},{type:Un}]},t.CompanyFeatureComponent=z([r.UntilDestroy()],t.CompanyFeatureComponent);var Pn=[{path:"",component:t.CompanyFeatureComponent,canActivate:[Gt]}],jn=y.RouterModule.forChild(Pn),On=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}();On.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:[""]}]}],On.ctorParameters=function(){return[{type:l.FormBuilder}]},On.propDecorators={value:[{type:e.Input}]};var Rn=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}();Rn.decorators=[{type:e.Directive,args:[{selector:"[ngxFeatureEnabled]"}]}],Rn.ctorParameters=function(){return[{type:e.ElementRef},{type:Un},{type:ct},{type:zt}]},Rn.propDecorators={enabledFeature:[{type:e.Input,args:["ngxFeatureEnabled"]}]};var Nn=function(){};Nn.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,Wt,L.FlexLayoutModule,jn,N.MatSlideToggleModule,l.FormsModule,l.ReactiveFormsModule,k.InfiniteScrollModule],declarations:[t.CompanyFeatureComponent,On,Rn],exports:[t.CompanyFeatureComponent,Rn]}]}],t.ActionPopup=H,t.ActionPopupComponent=G,t.ActionPopupModule=Kt,t.AlertService=st,t.ApiPrefixInterceptor=ft,t.AuditLogForModelComponent=Ze,t.AuditLogForModelModule=un,t.AuditLogForModelRoutingModule=Xe,t.AuditLogListFilterModule=ln,t.AuditLogListFilterRoutingModule=rn,t.AuditLogListModule=sn,t.AuditLogListRoutingModule=on,t.AuditLogModule=gn,t.AuditLogRoutingModule=hn,t.AuditLogViewComponent=dn,t.AuditLogViewModelModule=en,t.AuditLogViewModelRoutingModule=tn,t.AuditLogViewModule=mn,t.AuditLogViewRoutingModule=pn,t.AuditLogsViewModelModule=cn,t.AuditLogsViewModelRoutingModule=nn,t.AuthenticationGuard=Gt,t.AuthenticationService=qt,t.CacheInterceptor=mt,t.CommentFormComponent=At,t.CompanyFeatureModule=Nn,t.CompanyFeatureRoutes=jn,t.ConfigService=rt,t.CoreModule=Yt,t.CredentialsService=ht,t.DataManager=$t,t.DataTable=Z,t.DataTableComponent=t.ɵi,t.DataTableModule=Jt,t.DateUtils=Ut,t.DateValidator=an,t.DocumentViewerComponent=tt,t.DocumentViewerModule=Qt,t.EmailSubscriptionForUserComponent=t.ɵbk,t.EmailSubscriptionForUserModule=Ve,t.EmailSubscriptionForUserRoutingModule=Ee,t.EmailSubscriptionModule=ce,t.EmailSubscriptionRoutingModule=se,t.EmailSubscriptionTypeFormComponent=t.ɵbi,t.EmailSubscriptionTypeFormModule=Se,t.EmailSubscriptionTypeFormRoutingModule=Ie,t.EmailSubscriptionTypeListComponent=t.ɵbj,t.EmailSubscriptionTypeListModule=Le,t.EmailSubscriptionTypeListRoutingModule=_e,t.EmailSubscriptionTypeModule=we,t.EmailSubscriptionTypeRoutingModule=Fe,t.EmailSubscriptionUserFormComponent=t.ɵbe,t.EmailSubscriptionUserFormModule=fe,t.EmailSubscriptionUserFormRoutingModule=pe,t.EmailSubscriptionUserListComponent=t.ɵbf,t.EmailSubscriptionUserListFilterComponent=t.ɵbh,t.EmailSubscriptionUserListFilterModule=Ce,t.EmailSubscriptionUserListFilterRoutingModule=be,t.EmailSubscriptionUserListModule=xe,t.EmailSubscriptionUserListRoutingModule=ve,t.EmailSubscriptionUserModule=de,t.EmailSubscriptionUserRoutingModule=ue,t.EntityFileFormComponent=It,t.EntityFilesViewAllComponent=t.ɵo,t.EntityFilesViewAllModule=Xt,t.ErrorHandlerInterceptor=ut,t.ErrorHandlerService=ct,t.ErrorSnackComponent=lt,t.ExportExcelButtonComponent=Je,t.ExportExcelModule=Qe,t.FailedItemsComponent=wn,t.FailedItemsModule=In,t.FailedItemsRoutingModule=Fn,t.FileDropperComponent=Dt,t.FileDropperConfig=St,t.FileDropperModule=Zt,t.FormValidatorService=Ft,t.HTTP_DYNAMIC_INTERCEPTORS=bt,t.HttpCacheService=pt,t.HttpService=Ct,t.ImportConfig=Sn,t.ImportCsvModule=Dn,t.ImportCsvRoutingModule=yn,t.ImportItemsComponent=Cn,t.ImportItemsModule=xn,t.ImportItemsRoutingModule=vn,t.LoaderComponent=Rt,t.LoaderModule=le,t.Logger=ot,t.LoginHistoryForUserModule=_n,t.LoginHistoryForUserRoutingModule=Tn,t.MatSelectInfiniteScrollDirective=Et,t.MaterialModule=Wt,t.NgxFeatureEnabledDirective=Rn,t.NoteFormComponent=_t,t.NoteListComponent=Lt,t.NoteModule=ne,t.NumItemsSelector=Vt,t.NumberSelector=Pt,t.OnOffSwitchComponent=On,t.PageEvent=X,t.ReadMoreComponent=te,t.ReadMoreModule=ee,t.RouteReusableStrategy=Bt,t.SearchableSelectorComponent=t.ɵx,t.SearchableSelectorModule=oe,t.SnackModule=Nt,t.StorageService=zt,t.SuccessSnackComponent=at,t.TechlifyConfig=it,t.TechlifyTaggerTagFormConfigModel=kn,t.TechlifyTaggerTagFormFieldModule=En,t.TechlifyTaggerTagSelectorModule=Vn,t.TechlifyUpdateHistoryModule=ze,t.TechlifyUpdateModule=He,t.Timeline=Ot,t.TimelineFilterComponent=t.ɵbb,t.TimelineFilterModule=ae,t.TokenInterceptor=gt,t.UpdateNotifierComponent=Ye,t.UpdateNotifierModule=Ke,t.UtilityModule=ie,t.ViewerConfig=nt,t.calculateTimeline=jt,t.esfur=ke,t.estlr=Me,t.esulr=ge,t.ɵa=Nt,t.ɵb=at,t.ɵba=Pt,t.ɵbc=re,t.ɵbd=Rt,t.ɵbg=Gt,t.ɵbm=Ue,t.ɵbn=Ne,t.ɵbo=Oe,t.ɵbp=je,t.ɵbq=Be,t.ɵbs=We,t.ɵbt=$e,t.ɵbu=Ge,t.ɵbv=$t,t.ɵbw=$t,t.ɵbx=ct,t.ɵby=st,t.ɵbz=zt,t.ɵc=lt,t.ɵca=Un,t.ɵcb=Gt,t.ɵd=bt,t.ɵe=Ct,t.ɵf=Bt,t.ɵg=G,t.ɵh=H,t.ɵj=tt,t.ɵk=It,t.ɵl=Ft,t.ɵm=xt,t.ɵn=st,t.ɵp=Dt,t.ɵq=Lt,t.ɵr=Mt,t.ɵs=_t,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
|