1 line
39 KiB
JavaScript
1 line
39 KiB
JavaScript
"use strict";(self.webpackChunkstaffdb=self.webpackChunkstaffdb||[]).push([[426],{21009:(v,T,l)=>{l.d(T,{n:()=>ce});var g=l(10467),e=l(54438),h=l(67336),u=l(89417),y=l(33514),E=l(37712),x=l(94753),k=l(96354),p=l(86600),m=l(15311),f=l(60177),a=l(18406),r=l(19664),_=l(12748),I=l(85956),S=l(99213),C=l(44613),F=l(224),R=l(83269),L=l(1776),M=l(43684),O=l(87283),b=l(31837);const w=["cbInput"],B=["hs_panel"],G=["hs_toolbar"],A=["hs_matformfield"],N=["grid_hensel"],H=["hensel_selection"],j=o=>({exportAll:o}),V=o=>({value:o});function W(o,c){if(1&o){const t=e.RV6();e.j41(0,"div")(1,"div",34),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.clickArrow())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()()}if(2&o){const t=c.$implicit,s=e.XpG(2);e.R7$(),e.HbH("hs_grid_header"+(s.disabled?"":" hs_pointer")),e.R7$(),e.SpI(" ",e.bMT(3,3,t.column.caption)," ")}}function $(o,c){1&o&&e.nrm(0,"mat-spinner",35)}function K(o,c){if(1&o){const t=e.RV6();e.j41(0,"dx-data-grid",23,6),e.nI1(2,"translate"),e.bIt("onKeyDown",function(i){return e.eBV(t),e.Njj(i.handled="Escape"===i.event.key)})("onExporting",function(i){e.eBV(t);const n=e.XpG();return e.Njj(n.clickArrow(i))}),e.nrm(3,"dxo-export",24)(4,"dxo-header-filter",25)(5,"dxo-filter-row",26)(6,"dxo-paging",27)(7,"dxo-scrolling",28)(8,"dxo-load-panel",27)(9,"dxo-sorting",29)(10,"dxo-selection",30),e.j41(11,"dxi-column",31),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.clickArrow())}),e.k0s(),e.DNE(12,W,4,5,"div",32)(13,$,1,0,"mat-spinner",33),e.k0s()}if(2&o){const t=e.XpG();e.HbH("hs_grid withexport"+(t.requiredError()?" hs_required":"")),e.FS9("noDataText",e.bMT(2,26,"core.grid.nodata")),e.Y8G("width",t.width)("height",t.height)("title",t.title)("dataSource",t.selectedItemsGrid)("keyExpr",t.keyExpr)("focusedRowEnabled",!1)("autoNavigateToFocusedRow",!0)("showBorders",!0)("showRowLines",!1)("allowColumnResizing",!1)("columnAutoWidth",!1)("columnMinWidth",30),e.R7$(3),e.Y8G("enabled",!t.disabled)("texts",e.eq3(28,j,t.translate.instant("core.hensel-selection.processlist"))),e.R7$(),e.Y8G("visible",!1),e.R7$(),e.Y8G("visible",!1)("applyFilter",!0),e.R7$(),e.Y8G("enabled",!1),e.R7$(2),e.Y8G("enabled",!0),e.R7$(3),e.Y8G("caption",t.placeholder+(t._selectedItemIds.length===t._dataSource.length?" ("+t.translate.instant("core.caption.all")+")":"")+(t.requiredError()?" *":""))("dataField",t.displayExpr),e.R7$(),e.Y8G("dxTemplateOf","headerWithArrow"),e.R7$(),e.Y8G("ngIf",t.showSpinner)}}function U(o,c){if(1&o&&(e.j41(0,"mat-hint")(1,"div"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.Aen("color: red; background-color:"+t.backgroundColor4Grid+";"),e.R7$(),e.JRh(e.bMT(3,3,"core.hensel-selection.nohits"))}}function Y(o,c){if(1&o&&(e.j41(0,"mat-hint")(1,"div"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.Aen("color: red; background-color:"+t.backgroundColor4Grid+";"),e.R7$(),e.SpI(" ",e.i5U(3,3,"core.hensel-selection.inputminsybols",e.eq3(6,V,t.minFilterLength4Search))," ")}}function X(o,c){}function z(o,c){if(1&o&&(e.j41(0,"span",36),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.JRh(t.getIcon4Selected())}}function Q(o,c){1&o&&e.nrm(0,"mat-spinner",37)}function J(o,c){if(1&o&&(e.j41(0,"div",38),e.nrm(1,"div",39),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Aen(t.disabled?"color: rgba(0, 0, 0, 0.26)":"")}}function Z(o,c){if(1&o){const t=e.RV6();e.j41(0,"button",40),e.bIt("click",function(i){e.eBV(t);const n=e.XpG();return e.Njj(n.clickClear(i))})("blur",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.leaveFocus())})("focus",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.startLeaveFocus=!1)}),e.j41(1,"mat-icon"),e.EFF(2,"close"),e.k0s()()}if(2&o){const t=e.XpG();e.Y8G("disabled",t.disabled)}}function q(o,c){if(1&o){const t=e.RV6();e.j41(0,"mat-checkbox",49),e.mxI("ngModelChange",function(i){e.eBV(t);const n=e.XpG(2);return e.DH7(n.selectedFirst,i)||(n.selectedFirst=i),e.Njj(i)}),e.k0s()}if(2&o){const t=e.XpG(2);e.R50("ngModel",t.selectedFirst)}}function ee(o,c){1&o&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"core.hensel-selection.selectedfirst")))}function te(o,c){1&o&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"core.btn.apply")))}function ie(o,c){if(1&o){const t=e.RV6();e.j41(0,"dx-button",50),e.bIt("click",function(){e.eBV(t);const i=e.XpG(2);return e.Njj(i.autocompleteTrigger.closePanel())}),e.k0s()}}function se(o,c){1&o&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"core.btn.cancel")))}function ne(o,c){if(1&o){const t=e.RV6();e.j41(0,"div",41,7)(2,"mat-checkbox",42,8),e.bIt("change",function(i){e.eBV(t);const n=e.XpG();return e.Njj(n.setAll(i.checked))}),e.j41(4,"div"),e.EFF(5),e.nI1(6,"translate"),e.k0s()(),e.DNE(7,q,1,1,"mat-checkbox",43),e.j41(8,"dx-tooltip",44,9),e.DNE(10,ee,3,3,"div",32),e.k0s(),e.j41(11,"dx-button",45),e.bIt("click",function(){e.eBV(t);const i=e.sdS(13);return e.XpG().selectionDone(),e.Njj(i.instance.hide())}),e.k0s(),e.j41(12,"dx-tooltip",46,10),e.DNE(14,te,3,3,"div",32),e.k0s(),e.DNE(15,ie,1,0,"dx-button",47),e.j41(16,"dx-tooltip",48,11),e.DNE(18,se,3,3,"div",32),e.k0s()()}if(2&o){const t=e.XpG();e.R7$(2),e.Y8G("checked",1===t.selectedAllNonePart)("indeterminate",0===t.selectedAllNonePart),e.R7$(3),e.JRh(e.bMT(6,14,"core.caption.all")),e.R7$(2),e.Y8G("ngIf",t.useSelFirstButton),e.R7$(),e.Y8G("target","#cbCheckedFirst"),e.R7$(2),e.Y8G("dxTemplateOf","content"),e.R7$(),e.Aen(t.useSelFirstButton?"":"margin-left: auto"),e.Y8G("disabled",t.lastSelection===t.getSelection(t.selectedItems)||!t.canClear&&t.isEmpty()),e.R7$(),e.Y8G("target","#buttonLayoutOk"),e.R7$(2),e.Y8G("dxTemplateOf","content"),e.R7$(),e.Y8G("ngIf",t.useCloseButton),e.R7$(),e.Y8G("target","#buttonLayoutCancel"),e.R7$(2),e.Y8G("dxTemplateOf","content")}}function oe(o,c){if(1&o&&(e.j41(0,"mat-icon"),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit,s=e.XpG();e.R7$(),e.SpI(" ",s.displayIconFn(t.link),"")}}function le(o,c){if(1&o){const t=e.RV6();e.j41(0,"mat-checkbox",54),e.bIt("change",function(){e.eBV(t);const i=e.XpG().$implicit,n=e.XpG();return e.Njj(n.toggleSelection(i))})("click",function(i){return e.eBV(t),e.Njj(i.stopPropagation())}),e.DNE(1,oe,2,1,"mat-icon",55),e.j41(2,"span",56),e.EFF(3),e.k0s()()}if(2&o){const t=e.XpG().$implicit,s=e.XpG();e.Y8G("checked",s.checkInSelected(t))("disabled",t.disabled),e.R7$(),e.Y8G("ngIf",s.displayIconFn),e.R7$(2),e.JRh(t[s.displayExpr])}}function re(o,c){if(1&o&&(e.j41(0,"mat-icon"),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit,s=e.XpG();e.R7$(),e.SpI(" ",s.displayIconFn(t.link),"")}}function ae(o,c){if(1&o&&(e.j41(0,"div",56),e.DNE(1,re,2,1,"mat-icon",55),e.EFF(2),e.k0s()),2&o){const t=e.XpG().$implicit,s=e.XpG();e.R7$(),e.Y8G("ngIf",s.displayIconFn),e.R7$(),e.SpI(" ",t[s.displayExpr]," ")}}function de(o,c){if(1&o){const t=e.RV6();e.j41(0,"mat-option",51),e.bIt("onSelectionChange",function(i){e.eBV(t);const n=e.XpG();return e.Njj(n.itemSelectedByKeyboard(i))}),e.j41(1,"div",34),e.bIt("click",function(i){const n=e.eBV(t).$implicit,d=e.XpG();return e.Njj(d.itemClicked(i,n))}),e.DNE(2,le,4,4,"mat-checkbox",52)(3,ae,3,2,"div",53),e.k0s()()}if(2&o){const t=c.$implicit,s=e.XpG();e.HbH((s.useCBChangedColor?"changedCBColor":"")+" "+(s.useLabelChangedColor?"changedLabelColor":"")+" "+(s.checkInSelected(t)?s.multiSelect?"multi_selected":"selected":"not_selected")+" "+(s.multiSelect&&s.checkChanged(t)?"changed":"")),e.Y8G("disabled",t.disabled),e.R7$(2),e.Y8G("ngIf",s.multiSelect),e.R7$(),e.Y8G("ngIf",!s.multiSelect)}}let ce=(()=>{class o{set dataSource(t){this._origDataSource=t,this.applyCustomFilterAsync()}set reprepareImmedeately(t){t&&(this.applyCustomFilterAsync(),setTimeout(()=>{this.reprepareImmedeatelyChange.emit(this.reprepareImmedeately)}))}get reprepareImmedeately(){return!1}get keyExpr(){return this._keyExpr}set keyExpr(t){this._keyExpr=t,this.applyCustomFilterAsync()}get displayExpr(){return this._displayExpr}set displayExpr(t){this._displayExpr=t,this.applyCustomFilterAsync()}get required(){return this._required}set required(t){"string"==typeof t&&(t="false"!==t),this.setRequired(t),console.log("**** - Hensel-Sel: "+this.placeholder+" set required",t),this.updateParent()}get disabled(){return this._disabled}set disabled(t){t="string"==typeof t?"false"!==t:t,this.showSpinner||this.setDisable(t),this.lastDisabled=t}get selectedFirst(){return!(this._dataSource&&this._dataSource.length>200||!this.multiSelect)&&this._selectedFirst}set selectedFirst(t){this._selectedFirst=t,this.itemsControl.setValue(this.lastFilter)}set customFilter(t){this._customFilter=t?t.split(","):[],this.applyCustomFilterAsync()}get customFilterFn(){return this._customFilterFn}set customFilterFn(t){this._customFilterFn=t,this.applyCustomFilterAsync()}set selectedItems(t){this.setValueInternally(t instanceof Array?t.slice():t,!0),this.lastSelection=this._selectedItemIds}get selectedItems(){return this._selectedItemIds}get useResultGrid(){return this._useResultGrid}set useResultGrid(t){this._useResultGrid=t}get minFilterLength4Search(){let t=0;return 0===this._minFilterLength4Search?t=this.getMinFilterLength4Search(this._dataSource.length):this._minFilterLength4Search>0&&(t=this._minFilterLength4Search),0!==this._customFilter.length||this._customFilterFn?Math.min(this.getMinFilterLength4Search(this._dataSource.length),t):t}set minFilterLength4Search(t){this._minFilterLength4Search=t}set sortField(t){this._sortField=t,this._sortField&&"-"===this._sortField.slice(0,1)?(this.sortDirection=-1,this._sortField=this._sortField.slice(1)):this.sortDirection=1,this.applyCustomFilterAsync()}get sortField(){return this._sortField}get formControlName(){return"henselSelectionControl_"+this.name}get parent(){return this._parent}set parent(t){this._parent=t??this._parentForm,this.hsRequiredsubscription?.unsubscribe(),this.hsRequiredsubscription=this.parent?.valueChanges.subscribe(()=>this.checkRequired()),this.markAsTouchedDirty()}get openWithFilter(){return this._newfilter}set openWithFilter(t){this._newfilter=t,!this.showSpinner&&this.initialised&&this._origDataSource&&0!==this._origDataSource.length&&void 0!==t&&setTimeout(()=>{this.itemsControl.setValue(t),t&&this.cbInput?.nativeElement?.focus()})}get canClear(){return this._canClear}set canClear(t){this._canClear=t}get title(){let t=this._title;return!t&&this.cbInput&&this.cbInput.nativeElement&&this.cbInput.nativeElement.clientWidth<this.cbInput.nativeElement.scrollWidth&&(t=this.displayFn(this._selectedItemIds)),t}set title(t){this._title=t}get showSpinner(){return this._showSpinner}set showSpinner(t){this.setShowSpinner(t),this.lastShowSpinner=t,this.openWithFilter=this.openWithFilter}get disabledItems(){return this._disabledItems}set disabledItems(t){this._disabledItems=t,this.applyCustomFilterAsync()}get displayLength(){return this.displayFn(this._selectedItemIds)?.length}get dropDownState(){return this._dropDownState}set dropDownState(t){0===t&&this._dropDownState!==t&&this.dropDownClosed.emit(),this._dropDownState=t}get lastSelection(){return this._lastSelectionString}set lastSelection(t){this.lastSelectedItemIds=t.slice(),this._lastSelectionString=this.getSelection(t)}get formGroup(){return this.parent?.control}constructor(t,s){this.translate=t,this._parentForm=s,this.EN_DropDownStateClosed=0,this._dataSource=[],this.currentScrollTop=0,this.reprepareImmedeatelyChange=new e.bkB,this._disabled=!1,this._selectedFirst=!0,this._customFilter=[],this._customFilterFn=null,this._selectedItemIds=[],this.selectedItemsChange=new e.bkB,this.selectedItemsDisplayChange=new e.bkB,this.dropDownClosed=new e.bkB,this.multiSelect=!0,this.separator=",",this.width="100%",this.height="200px",this.displayTemplate="",this.id="",this.name="",this.useCloseButton=!0,this.useMarkFiltered=!0,this.useSelFirstButton=!1,this.useCBChangedColor=!0,this._useResultGrid=!1,this.useLabelChangedColor=!0,this.backgroundColor="inherit",this._minFilterLength4Search=-1,this._sortField=null,this.sortDirection=1,this._parent=null,this.hsClass="",this.autofocus=!1,this._canClear=!0,this.focus=new e.bkB,this.tabindex=0,this._title="",this._showSpinner=!1,this._disabledItems=[],this.itemsControl=new u.MJ,this.hasFocus=!1,this.filteredItems=[],this.selectedItemsGrid=[],this.selectedAllNonePart=0,this._dropDownState=0,this.lastFilter="",this._lastSelectionString="",this.lastSelectedItemIds="",this.startLeaveFocus=!1,this.showInputField=!0,this.initialised=!1,this.onKeyDown=i=>i.keyCode!==h.Fm||!this.multiSelect||(this.selectionDone(),i.stopPropagation(),!1),this.displayFn=i=>{let n="";return Array.isArray(i)?(this._dataSource&&i.forEach(d=>{const D=this._dataSource.find(P=>P[this.keyExpr]===d);D?n+=this.separator+" "+this.displayItem(D):this.selectionNotFound&&(n+=this.separator+" "+this.selectionNotFound(d))}),n=n.slice(this.separator.length+1)):n=i,n},this.compare2items=(i,n)=>i[this._sortField]?"number"==typeof i[this._sortField]?(i[this._sortField]-n[this._sortField])*this.sortDirection:i[this._sortField].localeCompare(n[this._sortField])*this.sortDirection:0,this.openDropDown=()=>{this.disabled||(0===this.dropDownState&&(this.multiSelect&&window.addEventListener("keydown",this.onKeyDown,{once:!0}),this.orgRequired=this.required,this.isEmpty()||this.setRequired(!1),this.lastSelection=this._selectedItemIds,!this.multiSelect&&this._selectedItemIds.length>0&&setTimeout(()=>{this.lastActiveItemIndex=this._dataSource.findIndex(i=>i[this.keyExpr]===this._selectedItemIds[0]),this.autocompleteTrigger.autocomplete._keyManager.setActiveItem(this.lastActiveItemIndex),this.scrollToOption()},0)),this.filteredItems.length>0?this.dropDownState=1:(1===this.dropDownState&&this.autocompleteTrigger.panelOpen&&this.autocompleteTrigger.closePanel(),this.dropDownState=2),this.itemsControl.setValue(this.lastFilter))},this.closeDropDown=()=>{this.currentScrollTop=0,(!this.hasFocus||2!==this.dropDownState)&&(setTimeout(()=>{this.lastFilter=""}),this.setValueInternally(this.lastSelectedItemIds),this.dropDownState=0,this.setRequired(this.orgRequired),this.multiSelect&&window.removeEventListener("keydown",this.onKeyDown,{once:!0}))},this.takeFocus=()=>{this.startLeaveFocus=!1,this.hasFocus=!0,this.openDropDown(),this.focus.emit(this)},this.leaveFocus=()=>{this.hasFocus=!1,2===this.dropDownState&&(this.startLeaveFocus=!0,setTimeout(()=>{this.startLeaveFocus&&this.closeDropDown(),this.startLeaveFocus=!1}))},this.applyCustomFilterAsync=this.applyCustomFilterAsync.bind(this),t.onLangChange.subscribe(()=>this.applyCustomFilterAsync())}ngOnInit(){this.items2filter=this.itemsControl.valueChanges.pipe((0,k.T)(t=>"string"==typeof t?t:this.lastFilter),(0,k.T)(t=>this.applyFilter(t))),this.items2filter.subscribe(()=>setTimeout(()=>{this.applyMarkFiltered(this.lastFilter)})),this.showInputField=!this.useResultGrid,setTimeout(()=>{this.parent||(this.parent=this._parent)},0)}ngAfterViewInit(){void 0===this.lastShowSpinner&&this.setShowSpinner(!0),setTimeout(()=>{this.initialised=!0,this.applyCustomFilterAsync(),this.backgroundColor4Grid=this.getBackgroundColor(this.hsElementRef.nativeElement)},0)}getMinFilterLength4Search(t){return t>5e3?4:t>1e3?3:t>300?2:0}setShowSpinner(t){setTimeout(()=>{this._showSpinner=t,this.setDisable(!!t||this.lastDisabled),this.openWithFilter=this.openWithFilter},0)}setDisable(t){this._disabled=t,this.disabled?(this.autocompleteTrigger?.closePanel(),this.itemsControl.disable()):this.itemsControl.enable()}setRequired(t){this._required=t}setValueInternally(t,s=!1){this._selectedItemIds||(this._selectedItemIds=[]),t instanceof Array?this._selectedItemIds.splice(0,this._selectedItemIds.length,...t):(this._selectedItemIds.splice(0),t&&this._selectedItemIds.push(t)),this.updateGrid(),this.itemsControl.setValue(this._selectedItemIds),console.log("**** - Hensel-Sel: "+this.placeholder+" set value internaly",t),s&&this.updateParent()}getBackgroundColor(t){const s=window.getComputedStyle(t,null).getPropertyValue("background-color");return"rgba(0, 0, 0, 0)"===s&&t?.parentElement?this.getBackgroundColor(t.parentElement):s}checkInSelected(t){return this._selectedItemIds.indexOf(t[this.keyExpr])>=0}checkChanged(t){return this.checkInSelected(t)^this.lastSelectedItemIds.indexOf(t[this.keyExpr])>=0}inputFilter(t){return t.keyCode===h.Fm||t.keyCode===h.wn&&!this.multiSelect?(1===this.filteredItems.length&&this.toggleSelection(this.filteredItems[0]),this.multiSelect||this.cbInput.nativeElement.blur(),t.keyCode!==h.Fm||(t.stopPropagation(),!1)):t.keyCode===h.i7||t.keyCode===h.n6?(this.multiSelect?this.autocompleteTrigger.autocomplete._keyManager.setActiveItem(null):(void 0!==this.lastActiveItemIndex&&this.autocompleteTrigger.autocomplete._keyManager.setActiveItem((this.lastActiveItemIndex+(t.keyCode===h.i7?-1:1)+this._dataSource.length)%this._dataSource.length),this.lastActiveItemIndex=void 0,this.scrollToOption()),t.stopPropagation(),!1):((t.keyCode!==h.wn&&t.keyCode!==h._f&&!this.lastFilter||t.keyCode===h._f&&this.lastFilter)&&this.itemsControl.setValue(""),!0)}itemSelectedByKeyboard(t){t.isUserInput&&this.autocompleteTrigger.autocomplete._keyManager.activeItem&&this.toggleSelection(this.filteredItems[this.autocompleteTrigger.autocomplete._keyManager.activeItemIndex])}displayItem(t,s=!1){if(s){const i=this.translate.instant(t[this.displayExpr]);return this.displayTemplate?this.displayTemplate.replace(/\${(.*?)}/g,(n,d)=>t[d]??"").replace("<key>",t[this.keyExpr]??"").replace("<name>",i):i}return t[this.displayExpr]}checkRequired(){this.requiredError()&&this.formGroup?.setErrors({required:!0})}requiredError(){let t=this.required;return 0!==this.dropDownState&&(t=this.orgRequired),!this.disabled&&void 0!==t&&!1!==t&&this.isEmpty()}applyFilter(t){if(this.lastFilter=t,0!==this.dropDownState){if(t.length<this.minFilterLength4Search)this.filteredItems.splice(0);else if(t.length>0){const i=t.toLowerCase();this.filteredItems=this._dataSource.filter(n=>this.displayItem(n).toLowerCase().indexOf(i)>=0)}else this.filteredItems=this._dataSource.slice();this.selectedFirst&&this.filteredItems.sort((i,n)=>{let d=0;return this.selectedFirst&&(d=this.checkInSelected(n)-this.checkInSelected(i)),0===d&&this._sortField&&(d=i[this._sortField]?this.compare2items(i,n):-1),d});const s=this.isEmpty()?0:this.filteredItems.filter(i=>this._selectedItemIds.indexOf(i[this.keyExpr])>=0).length;this.selectedAllNonePart=0===s?-1:s===this.filteredItems.length?1:0,1===this.dropDownState&&0===this.filteredItems.length&&(this.dropDownState=2)}return this.filteredItems}prepareDataSource(){this._dataSource=this._customFilter.length>0?this._origDataSource.filter(t=>!this._customFilter.some(s=>{let i=s.split("!=");return 2===i.length?" "===i[1]?null===t[i[0]]:""+t[i[0]]===i[1]:(i=s.split("="),2===i.length?""+t[i[0]]!==i[1]:(i=s.split("<"),2===i.length?Number.isNaN(Number(t[i[0]]))||Number.isNaN(Number(i[1]))?!(""+t[i[0]]<i[1]):!(Number(t[i[0]])<Number(i[1])):(i=s.split(">"),2===i.length?Number.isNaN(Number(t[i[0]]))||Number.isNaN(Number(i[1]))?!(""+t[i[0]]>i[1]):!(Number(t[i[0]])>Number(i[1])):(i=s.split("<="),2===i.length?Number.isNaN(Number(t[i[0]]))||Number.isNaN(Number(i[1]))?!(""+t[i[0]]<=i[1]):!(Number(t[i[0]])<=Number(i[1])):(i=s.split(">="),!(2!==i.length||(Number.isNaN(Number(t[i[0]]))||Number.isNaN(Number(i[1]))?""+t[i[0]]>=i[1]:Number(t[i[0]])>=Number(i[1]))))))))})):this._origDataSource.slice(),this.customFilterFn&&(this._dataSource=this._dataSource.filter(t=>this.customFilterFn(t)))}applyCustomFilterAsync(){var t=this;return(0,g.A)(function*(){if(!t.initialised||!t._origDataSource)return;const s=!t._dataSource?.length;t.prepareDataSource(),t.displayExpr||(t._displayExpr="display"),"*"===t._sortField&&(t._sortField=t.displayExpr),t._dataSource=t._dataSource.map((n,d,D)=>Object(t._sortField&&t._sortField!==t.displayExpr&&t._sortField!==t.keyExpr?{[t.keyExpr]:n[t.keyExpr],[t.displayExpr]:t.displayItem(n,!0),[t.sortField]:t._sortField?n[t._sortField]:"",link:n,disabled:t.disabledItems.indexOf(n[t.keyExpr])>-1}:{[t.keyExpr]:n[t.keyExpr],[t.displayExpr]:t.displayItem(n,!0),link:n,disabled:t.disabledItems.indexOf(n[t.keyExpr])>-1}));let i=!1;if(t._dataSource.length>0||!s){const n=t._dataSource.map(d=>d[t.keyExpr]);for(let d=t._selectedItemIds.length-1;d>=0;d--)-1===n.indexOf(t._selectedItemIds[d])&&(t.selectionNotFound||(t._selectedItemIds.splice(d,1),i=!0))}t._sortField&&t._dataSource.sort((n,d)=>t.compare2items(n,d)),console.log("**** - Hensel-Sel: "+t.placeholder+" current id=",t._selectedItemIds,"lenght=",t._dataSource.length," wasempty=",!s,"waschanged=",i),t.itemsControl.setValue(t._selectedItemIds),t.updateGrid(),t._origDataSource.length>0&&void 0===t.lastShowSpinner?t.setShowSpinner(!1):t.openWithFilter=t.openWithFilter,i&&(console.log("**** - Hensel-mark "+t.placeholder+" indirect changed"),setTimeout(()=>t.updateParent())),t.markAsTouchedDirty()})()}updateGrid(){this.useResultGrid&&(this.selectedItemsGrid=this._dataSource&&this._selectedItemIds&&this._selectedItemIds.length>0?this._dataSource.filter(t=>this._selectedItemIds.indexOf(t[this.keyExpr])>=0):[])}applyMarkFiltered(t){if(!this.useMarkFiltered||1!==this.dropDownState)return;const s=this.autocompleteScrollPanel.nativeElement.getElementsByClassName("item");if(s)for(let i=0;i<Math.min(this.filteredItems.length,s.length);i++){const n=s[i].innerHTML.indexOf("</mat-icon>"),d=n<0?"":s[i].innerHTML.slice(0,n+11);s[i].innerHTML=""===t?d+this.displayItem(this.filteredItems[i]):d+this.displayItem(this.filteredItems[i]).replace(new RegExp(t+"(?!([^<]+)?<)","gi"),'<b class="hs_marked">$&</b>')}}itemClicked(t,s){t.stopPropagation(),this.toggleSelection(s)}toggleSelection(t){if(!t.disabled){if(this.multiSelect||(this._selectedItemIds=[]),this.checkInSelected(t)){const s=this._selectedItemIds.indexOf(t[this.keyExpr]);this._selectedItemIds.splice(s,1)}else this._selectedItemIds.push(t[this.keyExpr]);this.minFilterLength4Search||(this.lastFilter="",this.itemsControl.setValue(this.lastFilter)),this.multiSelect?this.itemsControl.setValue(this._selectedItemIds):(this.itemsControl.setValue(this.displayFn(this._selectedItemIds)),this.selectionDone())}}isEmpty(){return 0===this._selectedItemIds.length}scrollToOption(){const t=this.autocompleteTrigger.autocomplete,s=t._keyManager.activeItemIndex||0,i=(0,p.jb)(s,t.options,t.optionGroups);if(0===s&&1===i)t._setScrollTop(0);else if(s>-1&&t.panel){const n=t.panel.nativeElement.offsetHeight-(this.autocompleteToolbar?.nativeElement.offsetHeight||0),d=t.options.first?._element?.nativeElement?.offsetHeight||30;this.currentScrollTop=(0,p.TL)((s+i)*d,d,this.currentScrollTop,n),t._setScrollTop(this.currentScrollTop)}}setAll(t){t?this.selectAll():this.deselectAll()}selectAll(){this.setValueInternally(this._selectedItemIds.concat(this.filteredItems.map(t=>t[this.keyExpr]).filter(t=>-1===this._selectedItemIds.indexOf(t))))}deselectAll(){const t=this.filteredItems.map(s=>s[this.keyExpr]);this.setValueInternally(this._selectedItemIds.filter(s=>-1===t.indexOf(s)))}getSelection(t){return t.sort((s,i)=>s-i).join()}updateParent(){this.formGroup?.updateValueAndValidity()}selectionDone(){const t=this.getSelection(this._selectedItemIds);if(this.lastSelection!==t){if(this.validate&&!this.validate(this._selectedItemIds))return;this.lastSelection=this._selectedItemIds,console.log("**** - Hensel-Sel: "+this.placeholder+" selection done"),this.updateParent(),this.selectedItemsChange.emit(this.multiSelect?this._selectedItemIds.slice():this._selectedItemIds.length>0?this._selectedItemIds[0]:null),this.selectedItemsDisplayChange.emit(this.displayFn(this._selectedItemIds))}this.autocompleteTrigger.closePanel()}clickClear(t){t.stopPropagation(),this.lastFilter?setTimeout(()=>{this.itemsControl.setValue(""),this.cbInput?.nativeElement?.focus()},300):(this.lastSelection=this._selectedItemIds,this.setValueInternally(null!=this.defaultValue?[this.defaultValue]:[]),this.selectionDone())}clickArrow(t){this.disabled||(this.showInputField=!0,setTimeout(()=>{this.cbInput?.nativeElement?.focus()},0),t&&(t.cancel=!0))}ngOnDestroy(){this.hsRequiredsubscription&&this.hsRequiredsubscription.unsubscribe()}getIcon4Selected(){return this.displayIconFn?this.displayIconFn(this._dataSource.find(t=>t[this.keyExpr]===this._selectedItemIds[0])?.link):null}markAsDirty(){this.hsMatFormField?._control?.ngControl?.control&&(this.hsMatFormField._control.ngControl.control.markAsDirty(),console.log("**** - Hensel-mark "+this.placeholder+" as dirty"),this.updateParent())}markAsTouched(){this.hsMatFormField?._control?.ngControl?.control&&(this.hsMatFormField._control.ngControl.control.markAsTouched(),console.log("**** - Hensel-mark "+this.placeholder+" as touched"),this.updateParent())}markAsTouchedDirty(){this.hsMatFormField?._control?.ngControl?.control&&this.required&&this.isEmpty()&&(this.hsMatFormField._control.ngControl.control.markAsTouched(),this.hsMatFormField._control.ngControl.control.markAsDirty(),console.log("**** - Hensel-mark "+this.placeholder+" as touched/dirty"),this.updateParent())}static#e=this.\u0275fac=function(s){return new(s||o)(e.rXU(_.X),e.rXU(u.cV,8))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["hensel-selection"]],viewQuery:function(s,i){if(1&s&&(e.GBs(m.cm,5),e.GBs(w,5),e.GBs(B,5),e.GBs(G,5),e.GBs(A,5),e.GBs(N,5),e.GBs(H,5)),2&s){let n;e.mGM(n=e.lsd())&&(i.autocompleteTrigger=n.first),e.mGM(n=e.lsd())&&(i.cbInput=n.first),e.mGM(n=e.lsd())&&(i.autocompleteScrollPanel=n.first),e.mGM(n=e.lsd())&&(i.autocompleteToolbar=n.first),e.mGM(n=e.lsd())&&(i.hsMatFormField=n.first),e.mGM(n=e.lsd())&&(i.grid_hensel=n.first),e.mGM(n=e.lsd())&&(i.hsElementRef=n.first)}},hostBindings:function(s,i){1&s&&e.bIt("keydown",function(d){return i.inputFilter(d)})},inputs:{dataSource:"dataSource",reprepareImmedeately:"reprepareImmedeately",keyExpr:"keyExpr",displayExpr:"displayExpr",required:"required",disabled:"disabled",selectedFirst:"selectedFirst",validate:"validate",customFilter:"customFilter",customFilterFn:"customFilterFn",selectedItems:"selectedItems",placeholder:"placeholder",multiSelect:"multiSelect",separator:"separator",width:"width",height:"height",displayTemplate:"displayTemplate",displayIconFn:"displayIconFn",id:"id",name:"name",useCloseButton:"useCloseButton",useMarkFiltered:"useMarkFiltered",useSelFirstButton:"useSelFirstButton",useCBChangedColor:"useCBChangedColor",useResultGrid:"useResultGrid",useLabelChangedColor:"useLabelChangedColor",backgroundColor:"backgroundColor",minFilterLength4Search:"minFilterLength4Search",sortField:"sortField",parent:"parent",openWithFilter:"openWithFilter",hsClass:"hsClass",selectionNotFound:"selectionNotFound",autofocus:"autofocus",canClear:"canClear",defaultValue:"defaultValue",tabindex:"tabindex",title:"title",showSpinner:"showSpinner",disabledItems:"disabledItems"},outputs:{reprepareImmedeatelyChange:"reprepareImmedeatelyChange",selectedItemsChange:"selectedItemsChange",selectedItemsDisplayChange:"selectedItemsDisplayChange",dropDownClosed:"dropDownClosed",focus:"focus"},standalone:!0,features:[e.aNF],decls:24,vars:47,consts:[["hensel_selection",""],["hs_matformfield",""],["nomatch",""],["cbInput",""],["auto","matAutocomplete"],["hs_panel",""],["grid_hensel",""],["hs_toolbar",""],["chkBx",""],["hintCB",""],["hintOk",""],["hintCancel",""],["tabindex","-1",1,"hs_div",3,"title"],["id","hs_grid","columnResizingMode","widget",3,"class","width","height","title","dataSource","keyExpr","focusedRowEnabled","autoNavigateToFocusedRow","showBorders","showRowLines","allowColumnResizing","columnAutoWidth","columnMinWidth","noDataText","onKeyDown","onExporting",4,"ngIf"],[4,"ngIf","ngIfElse"],["class","material-icons",4,"ngIf"],["matInput","","type","search",1,"mat-select-value-text",3,"blur","focus","placeholder","matAutocomplete","formControl","required","name","id","tabindex","autofocus"],["class","hrd-mat-spinner zoom",4,"ngIf"],["class","mat-select-arrow-wrapper","style","cursor: pointer;",4,"ngIf"],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear","tabindex","-1",3,"disabled","click","blur","focus",4,"ngIf"],["id","dropdown","tabindex","-1",1,"hs_autocomplete",3,"opened","closed","displayWith"],["id","hs_toolbar","style","display: flex; background-color: rgba(0, 0, 0, .12); height: 40px",4,"ngIf"],[3,"class","disabled","onSelectionChange",4,"ngFor","ngForOf"],["id","hs_grid","columnResizingMode","widget",3,"onKeyDown","onExporting","width","height","title","dataSource","keyExpr","focusedRowEnabled","autoNavigateToFocusedRow","showBorders","showRowLines","allowColumnResizing","columnAutoWidth","columnMinWidth","noDataText"],[3,"enabled","texts"],[3,"visible"],[3,"visible","applyFilter"],[3,"enabled"],["mode","virtual"],["mode","none"],["mode","single"],["width","100%","headerCellTemplate","headerWithArrow",3,"click","caption","dataField"],[4,"dxTemplate","dxTemplateOf"],["class","hrd-mat-spinner",4,"ngIf"],[3,"click"],[1,"hrd-mat-spinner"],[1,"material-icons"],[1,"hrd-mat-spinner","zoom"],[1,"mat-select-arrow-wrapper",2,"cursor","pointer"],[1,"mat-select-arrow","hs_arrow"],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear","tabindex","-1",3,"click","blur","focus","disabled"],["id","hs_toolbar",2,"display","flex","background-color","rgba(0, 0, 0, .12)","height","40px"],[1,"mat-option",2,"padding-left","5px","margin-top","5px",3,"change","checked","indeterminate"],["class","cbCheckedFirst","id","cbCheckedFirst",3,"ngModel","ngModelChange",4,"ngIf"],["showEvent","dxhoverstart","hideEvent","dxhoverend",3,"target"],["id","buttonLayoutOk","icon","check",1,"buttonLayoutOk",3,"click","disabled"],["showEvent","dxhoverstart","hideEvent","click dxhoverend","tabindex","-1",3,"target"],["class","buttonLayoutCancel","id","buttonLayoutCancel","icon","clear","tabindex","-1",3,"click",4,"ngIf"],["showEvent","dxhoverstart","hideEvent","click dxhoverend",3,"target"],["id","cbCheckedFirst",1,"cbCheckedFirst",3,"ngModelChange","ngModel"],["id","buttonLayoutCancel","icon","clear","tabindex","-1",1,"buttonLayoutCancel",3,"click"],[3,"onSelectionChange","disabled"],[3,"checked","disabled","change","click",4,"ngIf"],["class","item",4,"ngIf"],[3,"change","click","checked","disabled"],[4,"ngIf"],[1,"item"]],template:function(s,i){if(1&s){const n=e.RV6();e.j41(0,"span",12,0),e.DNE(2,K,14,30,"dx-data-grid",13),e.j41(3,"mat-form-field",null,1),e.DNE(5,U,4,5,"mat-hint",14),e.nI1(6,"async"),e.DNE(7,Y,4,8,"mat-hint",14),e.nI1(8,"async"),e.DNE(9,X,0,0,"ng-template",null,2,e.C5r)(11,z,2,1,"span",15),e.j41(12,"input",16,3),e.bIt("blur",function(){return e.eBV(n),e.Njj(i.leaveFocus())})("focus",function(){return e.eBV(n),e.Njj(i.takeFocus())}),e.k0s(),e.DNE(14,Q,1,0,"mat-spinner",17)(15,J,2,2,"div",18)(16,Z,3,1,"button",19),e.j41(17,"mat-autocomplete",20,4),e.bIt("opened",function(){return e.eBV(n),e.Njj(i.openDropDown())})("closed",function(){return e.eBV(n),i.closeDropDown(),e.Njj(i.showInputField=!i.useResultGrid)}),e.DNE(19,ne,19,16,"div",21),e.j41(20,"div",null,5),e.DNE(22,de,4,5,"mat-option",22),e.nI1(23,"async"),e.k0s()()()()}if(2&s){let n,d;const D=e.sdS(10),P=e.sdS(18);e.xc7("pointer-events",i.disabled&&!i.useResultGrid?"none":void 0)("height",i.useResultGrid?i.height:"unset")("width",i.width),e.Y8G("title",i.title),e.R7$(2),e.Y8G("ngIf",i.useResultGrid),e.R7$(),e.HbH("hs_form"+(i.placeholder?"":" no-placeholder")+" "+i.hsClass),e.xc7("background-color",i.useResultGrid?i.backgroundColor4Grid:i.backgroundColor)("width",i.useResultGrid?"calc("+i.width+" - 2px)":i.width)("top",i.useResultGrid?"calc(-100% + 1px)":0)("left",i.useResultGrid?1:0,"px")("visibility",i.showInputField?"visible":"hidden"),e.R7$(2),e.Y8G("ngIf",!(null!=(n=e.bMT(6,41,i.items2filter))&&n.length)&&i.lastFilter&&i.lastFilter.length>=i.minFilterLength4Search)("ngIfElse",D),e.R7$(2),e.Y8G("ngIf",2===i.dropDownState&&!(null!=(d=e.bMT(8,43,i.items2filter))&&d.length)&&i.lastFilter.length<i.minFilterLength4Search)("ngIfElse",D),e.R7$(4),e.Y8G("ngIf",!i.multiSelect&&i.displayIconFn&&(null==i.selectedItems?null:i.selectedItems.length)>0&&i.dropDownState===i.EN_DropDownStateClosed),e.R7$(),e.Y8G("placeholder",i.placeholder)("matAutocomplete",P)("formControl",i.itemsControl)("required",i.required)("name",i.name)("id",i.id)("tabindex",i.showInputField?i.tabindex:-1)("autofocus",i.autofocus||""===i.autofocus),e.R7$(2),e.Y8G("ngIf",i.showSpinner),e.R7$(),e.Y8G("ngIf",!i.useResultGrid),e.R7$(),e.Y8G("ngIf",i.canClear),e.R7$(),e.Y8G("displayWith",i.displayFn),e.R7$(2),e.Y8G("ngIf",i.multiSelect),e.R7$(),e.Aen("overflow: auto;"+(i.multiSelect?"height: calc(100% - 40px);":"")),e.R7$(2),e.Y8G("ngForOf",e.bMT(23,45,i.items2filter))}},dependencies:[f.MD,f.Sq,f.bT,f.Jj,a.e,I.iV,S.An,C.Ky,C.V3,C.xZ,F.aL,R.d1,L.wS,M.NZ,m.G7,m.cm,u.YN,u.me,u.BC,u.YS,u.vS,u.X1,u.l_,y.L,y.e,O.eC,E.U,E.b,r.h,r.D9,x.N,x.s,b.hVU,b.nj_,b.gtJ,b.ZJU,b.FTx,b.xzc,b.PVd,b.eA9,b.Z6T],styles:['.cell_positive_balance{color:#76b82a} .cell_negative_balance{color:#b22222}.buttonLayoutOk[_ngcontent-%COMP%]{cursor:pointer!important;top:5px;right:5px;margin-left:5px;border-width:0}.buttonLayoutCancel[_ngcontent-%COMP%]{cursor:pointer!important;top:5px;right:5px;margin-left:5px!important;border-width:0}.cbCheckedFirst[_ngcontent-%COMP%]{cursor:pointer!important;margin-top:12px;right:20px;margin-left:auto!important;border-width:0;font-size:smaller;position:relative}.hs_arrow[_ngcontent-%COMP%]{position:relative;top:50%;transform:translateY(-50%)!important}.hs_arrowheader[_ngcontent-%COMP%]{cursor:pointer;float:right;top:-5px}.selected[_ngcontent-%COMP%]{background-color:#0000001f!important;color:#78b7e5!important} .hs_form .mat-form-field-subscript-wrapper{z-index:2} .hs_form .mat-form-field-infix{display:flex}.hs_autocomplete[_ngcontent-%COMP%]{padding-right:0;max-height:300px!important} .hs_autocomplete .cbCheckedFirst .mat-checkbox-inner-container{order:1} .hs_autocomplete .buttonLayoutOk .dx-icon-check{font-size:18px!important;font-weight:700!important;color:green!important} .hs_autocomplete .mat-option{font-size:inherit} .hs_autocomplete .dx-button-content{padding:0!important} .hs_autocomplete .mat-option.multi_selected:not(.mat-option-disabled):not(.changedLabelColor){color:#78b7e5!important} .hs_autocomplete .mat-option.multi_selected.changedLabelColor:not(.mat-option-disabled):not(.changed){color:#78b7e5!important} .hs_autocomplete .mat-option.changed.changedLabelColor:not(.mat-option-disabled){color:#76b82a!important} .hs_autocomplete .mat-option.changed.changedCBColor .mat-checkbox-checked.mat-accent .mat-checkbox-background{background-color:#76b82a!important} .hs_autocomplete .mat-option.changed.changedCBColor:not(.mat-option-disabled) .mat-checkbox-frame{border-color:#76b82a} .hs_autocomplete .hs_marked{background-color:#00000038} .hs_grid .dx-datagrid-export-button .dx-icon-export-excel-button:before{content:"\\f001"!important} .hs_grid .dx-datagrid-export-button .dx-icon-export-excel-button{font-size:25px!important;color:#00000073!important} .hs_grid .dx-datagrid-export-button .dx-icon-xlsxfile:before{content:"\\f001"!important} .hs_grid .dx-datagrid-export-button .dx-icon-xlsxfile{font-size:25px!important;color:#00000073!important} .hs_grid .dx-button .dx-button-content{left:0}.hs_grid_header[_ngcontent-%COMP%]{font-size:14px;font-weight:400}.hs_required[_ngcontent-%COMP%] .hs_grid_header[_ngcontent-%COMP%]{color:red} .hs_required .dx-datagrid-nodata{color:red}.hs_pointer[_ngcontent-%COMP%]{cursor:pointer}.hs_div[_ngcontent-%COMP%]{outline:none;pointer-events:auto}.zoom[_ngcontent-%COMP%]{transform:scale(.2)} .hs_form:has(.material-icons.ng-star-inserted) .mat-form-field-suffix{bottom:8px} .hs_form.no-placeholder .mat-form-field-infix{border-top-width:0px}']})}return o})()},27938:(v,T,l)=>{l.d(T,{q:()=>k});var g=l(10467),e=l(19057),h=l(54438),u=l(18498),y=l(62560),E=l(76461),x=l(66664);let k=(()=>{class p{constructor(f,a,r,_,I){this.router=f,this.authService=a,this.globals=r,this.pageLoadingService=_,this.appLogsService=I}canLoad(f,a){return!0}canActivate(f,a){var r=this;return(0,g.A)(function*(){let _=!0;const I=a.url.slice(1).split("/");if(r.authService.useJWT&&!r.authService.checkJWT(0)&&r.authService.isLoggedIn()){if(r.authService.expiredJWTLogout=!0,yield r.authService.tryRenewJWTAsync(!1))return!0}else{const S=I[0].split("?")[0],C=r.globals.getPage(S);if(r.globals.isTheLoginPage(a.url)||r.authService.isLoggedIn()){if(C&&C.hidden&&!C.allowRedirect)return!1;let F=null;return I.length>1&&(F=I[I.length-1]),r.globals.currentPage===S&&C.dontAllowEmptyURL&&!F&&r.globals.urlParam&&(F=r.globals.urlParam,a.url+="/"+F,_=!1),r.globals.currentPage=S,r.globals.urlParam=F,r.pageLoadingService.pageActive$.next(r.globals.urlParam),r.appLogsService.dlog("!! Goto",a.url),_}}if(!r.globals.isTheLoginPage(a.url)){const S={queryParams:{returnUrl:a.url}};r.globals.currentPage=e.m0.path,r.appLogsService.dlog("!! Goto "+e.m0.path,a.url),r.router.navigate(["/"+e.m0.path],S)}return!1})()}static#e=this.\u0275fac=function(a){return new(a||p)(h.KVO(u.Ix),h.KVO(y.V),h.KVO(e.RV),h.KVO(E.V),h.KVO(x.w))};static#t=this.\u0275prov=h.jDH({token:p,factory:p.\u0275fac,providedIn:"root"})}return p})()},76461:(v,T,l)=>{l.d(T,{V:()=>p});var g=l(54438),e=l(33570),h=l(84412),u=l(21413),y=l(12748),E=l(19057),x=l(66664),k=l(36554);let p=(()=>{class m{static#e=this.delayBackgroundPageLoaded=750;get noOfHttpQueries4Page(){return this._noOfHttpQueries4Page}set noOfHttpQueries4Page(a){a.forEach((r,_)=>{this._noOfHttpQueries4Page[_]>-1&&(this._noOfHttpQueries4Page[_]=r)})}get onPageLoagingWaitBackgroundLoadingFinished(){return this._onPageLoagingWaitBackgroundLoadingFinished}set onPageLoagingWaitBackgroundLoadingFinished(a){this._onPageLoagingWaitBackgroundLoadingFinished=a,this.waitBackgroundLoadingFinished=a}constructor(a,r,_){this.globals=a,this.appLogsservice=r,this.spinnerService=_,this.spinnerVisible=0,this.forgroundLoading$=new h.t(null),this.backgroundLoading$=new h.t(null),this.pageActive$=new u.B,this._noOfHttpQueries4Page=[],this.startBackgroundLoading=!1,this.waitBackgroundLoadingFinished=!1,this.arLoadedCompletedCallBacks=[],this.translationService=(0,g.WQX)(y.X),this._onPageLoagingWaitBackgroundLoadingFinished=!1,this.startBackgroundLoadingAfterPageIsLoaded=!0,this.globals.appPages.forEach(I=>this.noOfHttpQueries4Page.push(-1))}startSpinner(a=!0,r){this.startBackgroundLoading=a||this.startBackgroundLoading,r&&this.arLoadedCompletedCallBacks.push(r),this.showSpinner()}showSpinner(){0==this.spinnerVisible++&&(this.appLogsservice.dlog("%cshow spinner",{guid:"spinner"},"color:"+e.W1.hideSpinnerColor),this.spinnerService.show())}allData4PageAreLoaded(a=-1){return a>-1&&a<this.noOfHttpQueries4Page.length?this.noOfHttpQueries4Page[a]<=0:this.noOfHttpQueries4Page.every(r=>r<=0)}updatePageLoadedCounters(a){if(null!==a){const r=this.globals.isTheLoginPage(this.globals.appPages[a].path)?a:this.globals.getPageIndex(this.globals.currentPage);this.noOfHttpQueries4Page[a]>0&&this.noOfHttpQueries4Page[a]--,a<this.noOfHttpQueries4Page.length&&0===this.noOfHttpQueries4Page[a]&&this.appLogsservice.dlog("%c"+this.translationService.instant(this.globals.appPages[a].messageCaption)+" data are loaded","color:brown"),r===a&&!this.startBackgroundLoadingAfterPageIsLoaded&&this.doBackgroundLoading(),this.allData4PageAreLoaded(this.waitBackgroundLoadingFinished?-1:r)&&setTimeout(()=>{this.hideSpinner(),this.doCallBacks(),this.waitBackgroundLoadingFinished=this.onPageLoagingWaitBackgroundLoadingFinished,r===a&&this.startBackgroundLoadingAfterPageIsLoaded&&(this.spinnerVisible+=1,this.waitBackgroundLoadingFinished=!0,this.doBackgroundLoading(),this.spinnerVisible-=1)},m.delayBackgroundPageLoaded)}}doBackgroundLoading(){this.startBackgroundLoading&&(this.startBackgroundLoading=!1,this.backgroundLoading$.next())}hideSpinner(){this.spinnerVisible>0&&0==--this.spinnerVisible&&(this.appLogsservice.dlog("%chide spinner",{guid:"spinner"},"color:"+e.W1.hideSpinnerColor),this.spinnerService.hide())}doCallBacks(){const a=this.arLoadedCompletedCallBacks;this.arLoadedCompletedCallBacks=[],a.forEach(r=>{r&&r()})}static#t=this.\u0275fac=function(r){return new(r||m)(g.KVO(E.RV),g.KVO(x.w),g.KVO(k.ex))};static#i=this.\u0275prov=g.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}return m})()}}]); |