1"use strict";(self.webpackChunksuivo_web=self.webpackChunksuivo_web||[]).push([[837],{1863:(dt,X,u)=>{u.d(X,{m:()=>U});var p=u(73664),y=u(87531);let U=(()=>{class A{set alignRight(R){this.classes+=R?" float-end":" float-start"}constructor(R,_){this.elementRef=R,this.translation=_,this.classes="",this.element=R.nativeElement,this.element.innerText="("+this.translation.get("allpages.optional")+")",this.element.style.marginLeft="5px",this.element.style.fontSize="11px",this.element.style.textTransform="lowercase",this.element.style.fontStyle="italic"}static{this.\u0275fac=function(_){return new(_||A)(p.rXU(p.aKT),p.rXU(y.L))}}static{this.\u0275dir=p.FsC({type:A,selectors:[["","field-optional",""]],hostVars:2,hostBindings:function(_,M){2&_&&p.HbH(M.classes)},inputs:{alignRight:"alignRight"},standalone:!1})}}return A})()},10837:(dt,X,u)=>{u.r(X),u.d(X,{AssetsModule:()=>Br});var p=u(72200),y=u(13711),U=u(72872),A=u(38132),w=u(70152),R=u(23294),_=u(27208),M=u(67022),v=u(31163),m=u(60516),E=u(11514),t=u(73664),l=u(2615),k=u(17705),x=u(15697),I=u(83350),O=u(21189),f=u(87531),C=u(87788),j=u(58469),it=u(32146),Zt=u(80098),Wt=u(54027),_t=u(21264),kt=u(75409),mt=u(66046);function qt(n,s){if(1&n&&t.nrm(0,"highcharts-chart",1),2&n){const e=t.XpG();t.Y8G("Highcharts",e.Highcharts)("options",e.assetStatusChartOptions)}}function Qt(n,s){if(1&n&&t.nrm(0,"highcharts-chart",1),2&n){const e=t.XpG();t.Y8G("Highcharts",e.Highcharts)("options",e.locationsChartOptions)}}
1function te(n,s){if(1&n&&t.nrm(0,"highcharts-chart",1),2&n){const e=t.XpG();t.Y8G("Highcharts",e.Highcharts)("options",e.licensesChartOptions)}}function ee(n,s){if(1&n&&t.nrm(0,"highcharts-chart",1),2&n){const e=t.XpG();t.Y8G("Highcharts",e.Highcharts)("options",e.assetTypesChartOptions)}}u(98504)(_t);let ne=(()=>{class n{constructor(e,i,o){this.assetsService=e,this.translation=i,this.chartHelper=o,this.labelConfig={assets:"permission.ITEM_VEHICLES",trackers:"assets.dashboard.trackers",tags:"assets.dashboard.tags",codes:"assets.dashboard.qrCodes",consumables:"permission.PAGE_CONSUMABLES"},this.Highcharts=_t}ngOnInit(){this.assetsService.getDashboardData().subscribe(e=>{this.buildAssetStatusChart(e.statuses,e.amounts),this.buildLicensesChart(e.licenses),this.buildLocationsChart(e.costLocationAssetAmount,e.stockLocationAssetAmount,e.unknownAssetAmount),this.buildAssetTypesChart(e.assetTypeAmounts)})}buildAssetTypesChart(e){let i=[];for(let o in e)i.push({name:this.translation.get(this.labelConfig[o]),y:e[o]});this.assetTypesChartOptions=this.chartHelper.createChartConfig(this.getDonutChartConfig(i,"support.myTickets.type.HARDWARE"))}buildLicensesChart(e){if(e){let i=[],o=[],a=0,r=[];for(let h in e){r.push(this.translation.get(this.labelConfig[h])),i.push(e[h].used),o.push(e[h].max-e[h].used);let g=e[h].used+e[h].max;g>a&&(a=g)}let d=[{name:this.translation.get("assets.licenses.inUse"),data:i},{name:this.translation.get("assets.licenses.available"),data:o}];this.licensesChartOptions=this.chartHelper.createChartConfig(this.getRadialBarChartOptions(d,r,"assets.licenses.title",a))}else this.licensesChartOptions=null}buildAssetStatusChart(e,i){if(i){let o=[];
1Object.keys(i).forEach(a=>{(e[a]||-1==+a)&&o.push({name:-1!=+a?e[a].name:this.translation.get("allpages.none"),y:i[a],color:-1!=+a?e[a].color:null})}),this.assetStatusChartOptions=this.chartHelper.createChartConfig(this.getDonutChartConfig(o,"settings.account.unitStatuses"))}else this.assetStatusChartOptions=null}buildLocationsChart(e,i,o){this.locationsChartOptions=this.chartHelper.createChartConfig(this.getDonutChartConfig([{name:this.translation.get("permission.PAGE_COST_LOCATIONS"),y:e},{name:this.translation.get("permission.PAGE_STOCK_LOCATIONS"),y:i},{name:this.translation.get("detail.sensorReadings.noQualifier"),y:o}],"allpages.locations"))}getRadialBarChartOptions(e,i,o,a){return{colors:["#00D189","#C0C0C0"],chart:{type:"column",inverted:!0,polar:!0,height:240},exporting:{enabled:!1},credits:{enabled:!1},legend:{align:"left",verticalAlign:"top",layout:"vertical",padding:35,y:15,labelFormatter:function(){let r=this.yData.reduce((d,h)=>d+h,0);return this.name+'<br /><span style="font-size: 14px;">'+r+"</span>"}},title:{text:this.translation.get(o),align:"left",verticalAlign:"top"},tooltip:{outside:!0},pane:{size:"85%",innerSize:"20%",endAngle:270},xAxis:{tickInterval:1,labels:{align:"right",useHTML:!0,allowOverlap:!0,step:1,y:3,style:{fontSize:"11px"},max:a},lineWidth:0,categories:i},yAxis:{crosshair:{enabled:!0,color:"#333"},lineWidth:0,tickInterval:10,reversedStacks:!1,showLastLabel:!0},plotOptions:{column:{stacking:"normal",borderWidth:0,pointPadding:0,groupPadding:.15}},series:e}}
1getDonutChartConfig(e,i){return{chart:{type:"pie",plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1,height:240},exporting:{enabled:!1},credits:{enabled:!1},legend:{align:"left",verticalAlign:"top",layout:"vertical",labelFormat:"{name}",padding:35,y:15},title:{text:this.translation.get(i),align:"left",verticalAlign:"top"},tooltip:{pointFormat:"<b>{point.y}</b>"},plotOptions:{pie:{allowPointSelect:!1,cursor:"pointer",dataLabels:{enabled:!1},showInLegend:!0,innerSize:"75%"}},series:[{name:"data",data:e}]}}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(x.T),t.rXU(f.L),t.rXU(kt.q))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["asset-dashboard"]],standalone:!1,decls:5,vars:4,consts:[[1,"dashboardsContainer"],[1,"float-start",3,"Highcharts","options"]],template:function(i,o){1&i&&(t.j41(0,"div",0),t.nVh(1,qt,1,2,"highcharts-chart",1),t.nVh(2,Qt,1,2,"highcharts-chart",1),t.nVh(3,te,1,2,"highcharts-chart",1),t.nVh(4,ee,1,2,"highcharts-chart",1),t.k0s()),2&i&&(t.R7$(),t.vxM(o.assetStatusChartOptions?1:-1),t.R7$(),t.vxM(o.locationsChartOptions?2:-1),t.R7$(),t.vxM(o.licensesChartOptions?3:-1),t.R7$(),t.vxM(o.assetTypesChartOptions?4:-1))},dependencies:[mt.H],styles:["[_nghost-%COMP%]{flex:1;margin-top:15px}.dashboardsContainer[_ngcontent-%COMP%]{display:grid;grid-gap:25px;grid-auto-flow:column;grid-auto-columns:1fr}"]})}}return n})();var L=u(30646),q=u(73807),$=u(6697),ht=u(19106),ie=u(32986),ot=u(38652),st=u(86907),c=u(89417),D=u(87822),oe=u(29824),at=u(86806),b=u(77120);const se=n=>[n];function ae(n,s){1&n&&(t.j41(0,"div",9),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"allpages.none")," "))}function le(n,s){1&n&&(t.j41(0,"div",19),t.nrm(1,"input",20)(2,"div",21),t.k0s())}function re(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",10),t.DNE(1,le,3,0,"div",14),t.j41(2,"div",15)(3,"input",16),t.bIt("change",function(){const o=l.eBV(e).$implicit,a=t.XpG();return l.Njj(a.removeColumn(o))}),t.k0s(),t.EFF(4,"\xa0 "),t.j41(5,"div",17),t.nrm(6,"i",18),t.EFF(7),t.k0s()()()}if(2&n){const e=s.$implicit,i=t.XpG();t.R7$(7),t.SpI("",i.definitions[e]," ")}}function ce(n,s){1&n&&(t.j41(0,"div",9),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"allpages.none")," "))}function pe(n,s){1&n&&(t.j41(0,"div",19),t.nrm(1,"input",23)(2,"div",21),t.k0s())}function ue(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",10),t.DNE(1,pe,3,0,"div",14),t.j41(2,"div",15)(3,"input",22),t.bIt("change",function(){const o=l.eBV(e).$implicit,a=t.XpG();return l.Njj(a.addColumn(o))}),t.k0s(),t.j41(4,"div",17),t.nrm(5,"i",18),t.EFF(6),t.k0s()()()}if(2&n){const e=s.$implicit,i=t.XpG();t.R7$(3),t.Y8G("checked",!1),t.R7$(3),t.SpI("",i.definitions[e]," ")}}let de=(()=>{class n{constructor(e,i){this.sortService=e,this.cdRef=i,this.closeConfig=new t.bkB,this.allColumns=[]}ngOnInit(){this.selectedIds=Object.assign([],this.currentIds),this.availableIds.forEach(e=>{this.allColumns.push(new _e(e,this.definitions[e]))}),this.fixUnusedColumns()}onCloseConfig(){this.closeConfig.emit()}addColumn(e){this.selectedIds.push(e),this.fixUnusedColumns()}removeColumn(e){this.selectedIds=this.selectedIds.filter(i=>i!=e),this.fixUnusedColumns()}onSaveConfig(){this.closeConfig.emit(this.selectedIds)}drop(e,i){let o=i?this.selectedIds:this.unusedIds;e.previousContainer===e.container?(0,D.HD)(o,e.previousIndex,e.currentIndex):(0,D.eg)(i?this.unusedIds:this.selectedIds,o,e.previousIndex,e.currentIndex),this.fixUnusedColumns()}fixUnusedColumns(){let e=this.sortService.sort(this.allColumns.filter(i=>!this.selectedIds.find(o=>o==i.id)),"name",!1,!0);this.unusedIds=e.map(i=>i.id),this.cdRef.markForCheck()}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(C.a),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["column-config"]],inputs:{availableIds:"availableIds",height:"height",currentIds:"currentIds",definitions:"definitions"},outputs:{closeConfig:"closeConfig"},standalone:!1,decls:26,vars:19,consts:[["usedList","cdkDropList"],["unusedList","cdkDropList"],[1,"optionsPopup","configPopup"],[1,"popupContent"],[1,"optionForm"],[1,"mb-0"],["type","button",1,"btn-close","float-end",3,"click"],["cdk-scrollable","",1,"configOptions"],["cdkDropList","",3,"cdkDropListDropped","cdkDropListConnectedTo"],[1,"emptyList"],["cdkDrag","","cdkDragBoundary",".configOptions"],["cdkDropList","",3,"cdkDropListDropped","cdkDropListConnectedTo","cdkDropListSortingDisabled"],[1,"buttonsContainer"],[3,"onButtonClick","alignRight"],["class","dragPlaceholder",4,"cdkDragPlaceholder"],[1,"columnItem"],["type","checkbox","checked","",3,"change"],[1,"columnLabel"],[1,"fas","fa-grip-vertical"],[1,"dragPlaceholder"],["type","checkbox","checked",""],[1,"placeholderElement"],["type","checkbox",3,"change","checked"],["type","checkbox"]],template:function(i,o){if(1&i){const a=t.RV6();t.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"h3",5),t.EFF(4),t.nI1(5,"translate"),t.j41(6,"button",6),t.bIt("click",function(){return l.eBV(a),l.Njj(o.onCloseConfig())}),t.k0s()(),t.j41(7,"div",7)(8,"h4"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.j41(11,"ul",8,0),t.bIt("cdkDropListDropped",function(d){return l.eBV(a),l.Njj(o.drop(d,!0))}),t.nVh(13,ae,3,3,"div",9),t.Z7z(14,re,8,1,"li",10,t.fX1),t.k0s(),t.j41(16,"h4"),t.EFF(17),t.nI1(18,"translate"),t.k0s(),t.j41(19,"ul",11,1),t.bIt("cdkDropListDropped",function(d){return l.eBV(a),l.Njj(o.drop(d,!1))}),t.nVh(21,ce,3,3,"div",9),t.Z7z(22,ue,7,2,"li",10,t.fX1),t.k0s()(),t.j41(24,"div",12)(25,"success-submit-button",13),t.bIt("onButtonClick",function(){return l.eBV(a),l.Njj(o.onSaveConfig())}),t.k0s()()()()()}if(2&i){const a=t.sdS(12),r=t.sdS(20);t.R7$(2),t.xc7("height",o.height+"px"),t.R7$(2),t.SpI(" ",t.bMT(5,11,"permission.PAGE_LIST")," "),t.R7$(5),t.JRh(t.bMT(10,13,"allpages.list.edit.columnsToBeShown")),t.R7$(2),t.Y8G("cdkDropListConnectedTo",t.eq3(17,se,r)),t.R7$(2),t.vxM(0===o.selectedIds.length?13:-1),t.R7$(),t.Dyx(o.selectedIds),t.R7$(3),t.JRh(t.bMT(18,15,"allpages.list.edit.columnsToBeHidden")),t.R7$(2),t.Y8G("cdkDropListConnectedTo",a)("cdkDropListSortingDisabled",!0),t.R7$(2),t.vxM(0===o.unusedIds.length?21:-1),t.R7$(),t.Dyx(o.unusedIds),t.R7$(3),t.Y8G("alignRight",!0)}},dependencies:[oe.uv,D.O7,D.T1,D.EM,at.l,b.D],styles:[".configPopup[_ngcontent-%COMP%]{display:inline-block;min-width:300px;top:35px;right:0}.configPopup[_ngcontent-%COMP%] .optionForm[_ngcontent-%COMP%]{padding:10px 0;display:flex;flex-direction:column}.configPopup[_ngcontent-%COMP%] .optionForm[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:0 10px 10px}.configPopup[_ngcontent-%COMP%] .optionForm[_ngcontent-%COMP%] .configOptions[_ngcontent-%COMP%]{padding:15px;overflow-y:auto}.configPopup[_ngcontent-%COMP%] .optionForm[_ngcontent-%COMP%] .configOptions[_ngcontent-%COMP%] .emptyList[_ngcontent-%COMP%]{width:100%;height:30px;background:var(--colors-general-background-grey);border:1px dashed var(--colors-general-soft-grey);display:flex;padding:10px;color:var(--colors-general-medium-grey);align-items:center;text-transform:capitalize}.configPopup[_ngcontent-%COMP%] .optionForm[_ngcontent-%COMP%] .configOptions[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:400}hr[_ngcontent-%COMP%]{margin-top:8px}[_nghost-%COMP%] success-submit-button button{margin-top:5px!important}.buttonsContainer[_ngcontent-%COMP%]{padding:5px 8px 0;border-top:1px solid var(--colors-general-soft-grey)}.fa-grip-vertical[_ngcontent-%COMP%]{margin-right:8px;color:var(--colors-general-soft-grey)}.cdk-drag-preview[_ngcontent-%COMP%]{background-color:transparent;list-style:none;height:auto!important;width:100%;padding-left:30px}.cdk-drag-preview[_ngcontent-%COMP%] .columnItem[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;background-color:var(--colors-attention-light);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview[_ngcontent-%COMP%] .columnItem[_ngcontent-%COMP%] .columnLabel[_ngcontent-%COMP%]{border:none}.cdk-drag-preview[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:none}li[_ngcontent-%COMP%] > *[_ngcontent-%COMP%], .cdk-drag-preview[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{cursor:move!important}.dragPlaceholder[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1);display:flex;margin-bottom:6px}.dragPlaceholder[_ngcontent-%COMP%] .placeholderElement[_ngcontent-%COMP%]{min-height:30px;margin-left:8px;width:calc(100% - 25px);border:dashed 1px var(--colors-general-soft-grey)}h4[_ngcontent-%COMP%]{margin-top:10px}.columnItem[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:4px}.columnItem[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{margin-top:0!important;margin-right:8px}.columnItem[_ngcontent-%COMP%] .columnLabel[_ngcontent-%COMP%]{flex:1;padding:6px;border:solid var(--colors-general-soft-grey) 1px}"],changeDetection:0})}}return n})();class _e{constructor(s,e){this.id=s,this.name=e}}var gt=u(65106),Y=u(9206),Q=u(86820),me=u(41233),lt=u(20936),Ft=u(99210),he=u(23717),ge=u(61967);const Ct=n=>({warning:n});
1function Ce(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG().$implicit;t.R7$(),t.SpI(" (",e.status,")")}}function fe(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"distanceUnitLabel"),t.k0s()),2&n){const e=t.XpG().$implicit;t.R7$(),t.Lme("",e.lastDone.mileage," ",t.bMT(2,2,"short"))}}function ve(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n){const e=t.XpG().$implicit;t.R7$(),t.Lme("",e.lastDone.operatingHours," ",t.bMT(2,2,"allpages.hours"))}}function be(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&n){const e=t.XpG().$implicit;t.R7$(),t.JRh(e.lastDone.date.date)}}function Te(n,s){1&n&&(t.j41(0,"div"),t.EFF(1,"-"),t.k0s())}function Oe(n,s){if(1&n&&(t.j41(0,"div")(1,"i",2),t.EFF(2,"\xa0"),t.k0s(),t.nrm(3,"attachment-link",3),t.k0s()),2&n){const e=s.$implicit,i=t.XpG(2).$implicit;t.R7$(3),t.Y8G("filename",i.lastDone.attachments[e])("guid",e)}}function Me(n,s){if(1&n&&t.Z7z(0,Oe,4,2,"div",null,t.fX1),2&n){const e=t.XpG().$implicit;t.Dyx(e.lastDone.attachments)}}function xe(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"distance"),t.nI1(3,"translate"),t.k0s()),2&n){const e=t.XpG(3).$implicit;t.R7$(),t.Lme(" (",t.bMT(2,2,e.nextDue.mileagePassed)," ",t.bMT(3,4,"maintenance.nextDue.kmAgo"),") ")}}
1function Pe(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.nI1(3,"distance"),t.k0s()),2&n){const e=t.XpG(3).$implicit;t.R7$(),t.Lme(" (",t.bMT(2,2,"maintenance.nextDue.inKm")," ",t.bMT(3,4,e.nextDue.mileage),") ")}}function ye(n,s){if(1&n&&(t.j41(0,"span",4),t.EFF(1),t.nI1(2,"distanceUnitLabel"),t.k0s(),t.nVh(3,xe,4,6,"div"),t.nVh(4,Pe,4,6,"div")),2&n){const e=t.XpG(2).$implicit;t.Y8G("ngClass",t.eq3(7,Ct,e.nextDue.mileagePassed)),t.R7$(),t.Lme("",e.nextDue.nextMileage," ",t.bMT(2,5,"short")),t.R7$(2),t.vxM(e.nextDue.mileagePassed?3:-1),t.R7$(),t.vxM(e.nextDue.mileage?4:-1)}}function ke(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n){const e=t.XpG(3).$implicit;t.R7$(),t.SpI(" ",t.i5U(2,1,"maintenance.nextDue.hrsOverdue","-"+e.nextDue.operatingHoursPassed)," ")}}function Fe(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n){const e=t.XpG(3).$implicit;t.R7$(),t.Lme(" (",e.nextDue.operatingHours," ",t.bMT(2,2,"allpages.hours"),") ")}}function Se(n,s){if(1&n&&(t.j41(0,"div")(1,"span",4),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,ke,3,4,"div"),t.nVh(5,Fe,3,4,"div"),t.k0s()),2&n){const e=t.XpG(2).$implicit;t.R7$(),t.Y8G("ngClass",t.eq3(7,Ct,e.nextDue.timePassed)),t.R7$(),t.Lme("",e.nextDue.nextOperatingHours," ",t.bMT(3,5,"allpages.hours")),t.R7$(2),t.vxM(e.nextDue.operatingHoursPassed?4:-1),t.R7$(),t.vxM(e.nextDue.operatingHours?5:-1)}}function Ie(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n){const e=t.XpG(3).$implicit;t.R7$(),t.SpI(" (",t.i5U(2,1,"maintenance.nextDue.daysAgo",e.nextDue.timePassed),") ")}}function Re(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n){const e=t.XpG(3).$implicit;t.R7$(),t.SpI(" (",t.i5U(2,1,"maintenance.nextDue.inDays",e.nextDue.time),") ")}}function Le(n,s){1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.SpI(" (",t.bMT(2,1,"periodReports.template.period.TODAY"),") "))}function Ae(n,s){1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.SpI(" (",t.bMT(2,1,"maintenance.nextDue.tomorrow"),") "))}function Ee(n,s){if(1&n&&(t.j41(0,"div")(1,"span",4),t.EFF(2),t.k0s(),t.nVh(3,Ie,3,4,"div"),t.nVh(4,Re,3,4,"div"),t.nVh(5,Le,3,3,"div"),t.nVh(6,Ae,3,3,"div"),t.k0s()),2&n){const e=t.XpG(2).$implicit;t.R7$(),t.Y8G("ngClass",t.eq3(6,Ct,e.nextDue.timePassed)),t.R7$(),t.JRh(e.nextDue.nextDate.date),t.R7$(),t.vxM(e.nextDue.timePassed?3:-1),t.R7$(),t.vxM(e.nextDue.time?4:-1),t.R7$(),t.vxM(e.nextDue.timeToday?5:-1),t.R7$(),t.vxM(e.nextDue.timeTomorrow?6:-1)}}function je(n,s){if(1&n&&(t.nVh(0,ye,5,9),t.nVh(1,Se,6,9,"div"),t.nVh(2,Ee,7,8,"div")),2&n){const e=t.XpG().$implicit;t.vxM(e.nextDue.nextMileage?0:-1),t.R7$(),t.vxM(e.nextDue.nextOperatingHours?1:-1),t.R7$(),t.vxM(e.nextDue.nextDate?2:-1)}}function De(n,s){if(1&n&&(t.j41(0,"tr")(1,"td",1),t.EFF(2),t.nVh(3,Ce,2,1,"span"),t.k0s(),t.j41(4,"td"),t.nVh(5,fe,3,4,"div"),t.nVh(6,ve,3,4,"div"),t.nVh(7,be,2,1,"div"),t.nVh(8,Te,2,0,"div"),t.nVh(9,Me,2,0),t.k0s(),t.j41(10,"td"),t.nVh(11,je,3,3),t.k0s()()),2&n){const e=s.$implicit;t.R7$(2),t.SpI(" ",e.description," "),t.R7$(),t.vxM(e.status?3:-1),t.R7$(2),t.vxM(e.lastDone&&e.lastDone.mileage?5:-1),t.R7$(),t.vxM(e.lastDone&&e.lastDone.operatingHours?6:-1),t.R7$(),t.vxM(e.lastDone&&e.lastDone.date?7:-1),t.R7$(),t.vxM(e.lastDone&&(e.lastDone.mileage||e.lastDone.operatingHours||e.lastDone.date)?-1:8),t.R7$(),t.vxM(e.lastDone&&e.lastDone.attachments?9:-1),t.R7$(2),t.vxM(e.nextDue?11:-1)}}function we(n,s){if(1&n&&(t.j41(0,"table",0)(1,"thead")(2,"tr")(3,"th"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"th"),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.j41(9,"th"),t.EFF(10),t.nI1(11,"translate"),t.k0s()()(),t.j41(12,"tbody"),t.Z7z(13,De,12,8,"tr",null,t.fX1),t.k0s()()),2&n){const e=t.XpG();t.R7$(4),t.JRh(t.bMT(5,3,"maintenance.maintenanceSchedule")),t.R7$(3),t.JRh(t.bMT(8,5,"maintenance.maintenanceSchedule.lastDone")),t.R7$(3),t.JRh(t.bMT(11,7,"maintenance.maintenanceSchedule.nextDue")),t.R7$(3),t.Dyx(e.eventSchedules)}}let Ge=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["event-schedules-summary"]],inputs:{eventSchedules:"eventSchedules"},standalone:!1,decls:1,vars:1,consts:[[1,"table","table-hover"],[1,"description"],[1,"fas","fa-paperclip","float-start"],[3,"filename","guid"],[3,"ngClass"]],template:function(i,o){1&i&&t.nVh(0,we,15,9,"table",0),2&i&&t.vxM(o.eventSchedules?0:-1)},dependencies:[p.YU,Ft.$,b.D,he.O,ge.i],styles:[".warning[_ngcontent-%COMP%]{font-weight:700;color:var(---colors-error-general, #DA1E27)}"]})}}return n})();var H=u(4545),K=u(87054),ft=u(97542),tt=u(81189),et=u(42892);
1function $e(n,s){if(1&n){const e=t.RV6();t.j41(0,"a",5),t.nI1(1,"translate"),t.bIt("click",function(){l.eBV(e);const o=t.XpG().data,a=t.XpG();return l.Njj(a.showDetail(o.id))}),t.nrm(2,"i",6),t.k0s()}2&n&&t.Y8G("title",t.bMT(1,1,"alerts.form.country.viewDetail"))}function Ve(n,s){1&n&&t.nVh(0,$e,3,3,"a",4),2&n&&t.vxM(s.highlighted?0:-1)}let Ne=(()=>{class n{constructor(e,i,o){this.fb=e,this.globalHelper=i,this.changeDetector=o,this.onTransferOpen=new t.bkB,this.listKey=H.y4.ASSET_TRANSFERS,this.GroupType=_.MH,this.periodFilterPresets=[1,7,30,60,90]}ngOnInit(){this.initialPeriod={beginDate:new Date(new Date((new Date).setDate((new Date).getDate()-89)).setHours(0,0,0,0)),endDate:new Date((new Date).setHours(23,59,59,59))},this.transfersFilterForm=this.fb.group({period:new c.MJ(this.initialPeriod)}),this.setListFilter(this.initialPeriod),this.periodSubscription=this.period.valueChanges.subscribe(e=>{this.setListFilter(e)})}ngOnDestroy(){this.periodSubscription.unsubscribe()}showDetail(e){this.onTransferOpen.emit(e)}setListFilter(e){this.listFilter={filterIds:[this.assetId],periodFilter:this.globalHelper.formatDate(e.beginDate,!1)+"|"+this.globalHelper.formatDate(e.endDate,!1)},this.changeDetector.markForCheck()}get period(){return this.transfersFilterForm.get("period")}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(c.ok),t.rXU(K.$),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["asset-transfers"]],inputs:{assetId:"assetId"},outputs:{onTransferOpen:"onTransferOpen"},standalone:!1,decls:5,vars:8,consts:[[1,"filterContainer",3,"formGroup"],["formControlName","period",3,"label","maxDays","presets"],[3,"externalFilter","listKey"],["cellTemplate","ASSET_TRANSFER_ACTIONS"],[1,"listAction",3,"title"],[1,"listAction",3,"click","title"],[1,"fa-solid","fa-magnifying-glass","action","fa-lg"]],template:function(i,o){1&i&&(t.j41(0,"form",0),t.nrm(1,"period-filter",1),t.nI1(2,"translate"),t.k0s(),t.nrm(3,"divided-list",2),t.DNE(4,Ve,1,1,"ng-template",3)),2&i&&(t.Y8G("formGroup",o.transfersFilterForm),t.R7$(),t.Y8G("label",t.bMT(2,6,"allpages.period"))("maxDays",90)("presets",o.periodFilterPresets),t.R7$(2),t.Y8G("externalFilter",o.listFilter)("listKey",o.listKey))},dependencies:[ft.p,tt.i,c.qT,c.BC,c.cb,c.j4,c.JD,et.v,b.D],styles:["[_nghost-%COMP%]{height:100%;display:flex;flex-direction:column;padding-top:10px}divided-list[_ngcontent-%COMP%]{border-top:1px solid var(--colors-general-soft-grey);margin:10px 0;flex:1;min-height:0;padding-top:10px}"]})}}return n})();var vt=u(13693),bt=u(29330);let Tt=(()=>{class n extends vt.S{static{this.transferDetailUrl="../protected/transfer/detail.json"}static{this.transferSaveUrl="../protected/transfer/create.json"}static{this.transferEntitySelectionUrl="../protected/assetManagement/transfers/entitySelection.json"}static{this.transferEntitySelectAllUrl="../protected/assetManagement/transfers/entitySelection/selectAll.json"}static{this.transferOptionsUrl="../protected/transfer/transferOptions.json"}constructor(e){super(n),this.http=e}getTransferDetail(e){return this.http.get(n.transferDetailUrl,{params:{id:e}})}createTransfer(e){return this.http.post(n.transferSaveUrl,e)}getSelectionEntities(e){return this.http.post(n.transferEntitySelectionUrl,e)}getAllEntityIds(e){return this.http.post(n.transferEntitySelectAllUrl,e)}getTransferOptions(){return this.http.get(n.transferOptionsUrl)}static{this.\u0275fac=function(i){return new(i||n)(l.KVO(bt.Qq))}}static{this.\u0275prov=l.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Xe=u(10772);function Be(n,s){if(1&n&&(t.j41(0,"div",4),t.nrm(1,"suivo-avatar",8),t.EFF(2),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.Y8G("format",e.AvatarFormat.SMALL)("fileName",e.locations.from.avatar?e.locations.from.avatar[e.AvatarFormat.MEDIUM]:null)("type",e.GroupType[e.locations.from.groupType])("hoverFormat",e.AvatarFormat.LARGE)("hoverFileName",e.locations.from.avatar?e.locations.from.avatar[e.AvatarFormat.LARGE]:null),t.R7$(),t.SpI(" ",e.locations.from.label," ")}}function Ue(n,s){if(1&n&&t.nrm(0,"entity-search-box",7),2&n){const e=t.XpG(2);t.Y8G("options",e.locationOptions)}}
1function Ye(n,s){if(1&n&&(t.j41(0,"div",1),t.nrm(1,"span",6),t.j41(2,"div",3)(3,"label"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nVh(6,Be,3,6,"div",4),t.nVh(7,Ue,1,1,"entity-search-box",7),t.k0s()()),2&n){const e=t.XpG();t.R7$(4),t.SpI("",t.bMT(5,3,"assets.transfer.from"),":"),t.R7$(2),t.vxM(e.locations&&e.locations.from?6:-1),t.R7$(),t.vxM(e.locations?-1:7)}}function He(n,s){if(1&n&&(t.j41(0,"div",4),t.nrm(1,"suivo-avatar",8),t.EFF(2),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.Y8G("format",e.AvatarFormat.SMALL)("fileName",e.locations.to.avatar?e.locations.to.avatar[e.AvatarFormat.MEDIUM]:null)("type",e.GroupType[e.locations.to.groupType])("hoverFormat",e.AvatarFormat.LARGE)("hoverFileName",e.locations.to.avatar?e.locations.to.avatar[e.AvatarFormat.LARGE]:null),t.R7$(),t.SpI(" ",e.locations.to.label," ")}}function ze(n,s){if(1&n&&t.nrm(0,"entity-search-box",5),2&n){const e=t.XpG();t.Y8G("options",e.locationOptions)}}let St=(()=>{class n{constructor(){this.AvatarFormat=L.Z,this.GroupType=_.MH,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this.locationForm=new c.gE({from:new c.MJ(null,c.k0.required),to:new c.MJ(null,c.k0.required)}),this.locationOptions={entityType:_.cm.COST_STOCK_LOCATIONS},this.formSubscription=this.locationForm.valueChanges.subscribe(e=>{this.onChange(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}validate(e){return this.locationForm.valid?this.from.value==this.to.value?{invalid:{value:this.to,message:"assets.transfer.location.invalid"}}:null:{invalid:{message:"allpages.error.general"}}}writeValue(e){e&&this.locationForm.reset({from:e.from,to:e.to})}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}get from(){return this.locationForm.get("from")}get to(){return this.locationForm.get("to")}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["transfer-location-form"]],inputs:{locations:"locations"},standalone:!1,features:[t.Jv_([{provide:c.kq,useExisting:(0,l.Rfq)(()=>n),multi:!0},{provide:c.cz,useExisting:(0,l.Rfq)(()=>n),multi:!0}])],decls:10,vars:9,consts:[[3,"formGroup"],[1,"location"],[1,"dot"],[1,"d-flex","flex-column","w-100"],[1,"bold"],["formControlName","to",3,"options"],[1,"dot","connected"],["formControlName","from",3,"options"],[1,"float-start",3,"format","fileName","type","hoverFormat","hoverFileName"]],template:function(i,o){1&i&&(t.j41(0,"form",0),t.nVh(1,Ye,8,5,"div",1),t.j41(2,"div",1),t.nrm(3,"span",2),t.j41(4,"div",3)(5,"label"),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.nVh(8,He,3,6,"div",4),t.nVh(9,ze,1,1,"entity-search-box",5),t.k0s()()()),2&i&&(t.AVh("view",null!=o.locations),t.Y8G("formGroup",o.locationForm),t.R7$(),t.vxM(!o.locations||o.locations.from?1:-1),t.R7$(5),t.SpI("",t.bMT(7,7,"assets.transfer.to"),":"),t.R7$(2),t.vxM(o.locations&&o.locations.to?8:-1),t.R7$(),t.vxM(o.locations?-1:9))},dependencies:[$.F,Xe.s,c.qT,c.BC,c.cb,c.j4,c.JD,b.D],styles:['.location[_ngcontent-%COMP%]:first-child{margin-bottom:20px}.location[_ngcontent-%COMP%]{width:100%;display:flex;align-items:baseline}.location[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{background-color:var(--colors-attention-primary);width:8px;height:8px;border-radius:50%;display:inline-block;position:relative;margin-right:10px}.location[_ngcontent-%COMP%] .dot.connected[_ngcontent-%COMP%]:after{content:"";border-left:1px dashed var(--colors-general-soft-grey);position:absolute;left:50%;top:100%;height:75px}.view[_ngcontent-%COMP%] .connected[_ngcontent-%COMP%]:after{height:55px!important}'],changeDetection:0})}}return n})();const Je=n=>({warning:n}),Ke=(n,s)=>({"fa-info-circle":n,"fa-triangle-exclamation":s});function Ze(n,s){if(1&n&&t.nrm(0,"suivo-avatar",1),2&n){const e=t.XpG();t.Y8G("format",e.AvatarFormat.SMALL)("fileName",e.entity.avatar?e.entity.avatar[e.AvatarFormat.MEDIUM]:null)("type",e.GroupType[e.entity.groupType])("hoverFormat",e.AvatarFormat.LARGE)("hoverFileName",e.entity.avatar?e.entity.avatar[e.AvatarFormat.LARGE]:null)}}function We(n,s){if(1&n&&(t.j41(0,"div",3),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.Lme(" ",t.bMT(2,2,"assets.transfer.tagnumber"),": ",e.entity.tagNumber," ")}}
1function qe(n,s){if(1&n&&(t.j41(0,"div",4),t.nrm(1,"i",6),t.EFF(2),t.nI1(3,"translate"),t.k0s()),2&n){const e=t.XpG();t.Y8G("ngClass",t.eq3(6,Je,e.selectable)),t.R7$(),t.Y8G("ngClass",t.l_i(8,Ke,!e.selectable,e.selectable)),t.R7$(),t.Lme(" ",t.bMT(3,4,"assets.transfer.atLocation"),' "',e.locations[e.entity.currentLocation].label,'" ')}}function Qe(n,s){if(1&n&&t.EFF(0),2&n){const e=t.XpG().$implicit,i=t.XpG(3);t.SpI(" ",i.skus[e.skuId],": ")}}function tn(n,s){1&n&&(t.EFF(0),t.nI1(1,"translate")),2&n&&t.SpI(" ",t.bMT(1,1,"assets.transfer.consumable.pieces")," ")}function en(n,s){if(1&n&&(t.j41(0,"div"),t.nVh(1,Qe,1,1),t.nVh(2,tn,2,3),t.j41(3,"b"),t.EFF(4),t.k0s()()),2&n){const e=s.$implicit,i=t.XpG(3);t.R7$(),t.vxM(i.skus[e.skuId]?1:-1),t.R7$(),t.vxM(i.skus[e.skuId]?-1:2),t.R7$(2),t.Lme("",e.confirmedAmount,"/",e.initialAmount)}}function nn(n,s){if(1&n&&t.Z7z(0,en,5,4,"div",null,t.fX1),2&n){const e=t.XpG(2);t.Dyx(e.entity.skus)}}function on(n,s){if(1&n&&(t.j41(0,"div",9),t.nrm(1,"input",10),t.EFF(2),t.k0s()),2&n){const e=s.$index,i=t.XpG(3);t.Y8G("formGroupName",e)("title",i.skuValues.controls[e].get("label").value),t.R7$(2),t.SpI(" ",i.skuValues.controls[e].get("label").value," ")}}function sn(n,s){if(1&n&&(t.j41(0,"form",7),t.qex(1,8),t.Z7z(2,on,3,3,"div",9,t.fX1),t.bVm(),t.k0s()),2&n){const e=t.XpG(2);t.Y8G("formGroup",e.consumableForm),t.R7$(2),t.Dyx(e.skuValues.controls)}}function an(n,s){if(1&n&&(t.j41(0,"div",5),t.nVh(1,nn,2,0),t.nVh(2,sn,4,1,"form",7),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.vxM(e.editable?-1:1),t.R7$(),t.vxM(e.editable?2:-1)}}let It=(()=>{class n{constructor(e,i){this.fb=e,this.translation=i,this.classes="w-100",this.GroupType=_.MH,this.AvatarFormat=L.Z,this.numericValidator=c.k0.pattern("^[1-9]+[0-9]*$"),this.objectKeys=Object.keys,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this.editable&&(this.consumableForm=this.fb.group({skuValues:this.fb.array([])}),this.formSubscription=this.skuValues.valueChanges.subscribe(e=>{let i=this.entity;i.groupType===_.MH.CONSUMABLE&&(i.skus=e.filter(o=>!(0,m.hX)(o.value)&&""!==o.value.trim()).map(o=>({skuId:o.id,initialAmount:o.value}))),this.onChange(i)}))}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){if(this.entity=e,e.skus){if(0!==this.skuValues.controls.length)for(;this.skuValues.controls.length;)this.skuValues.removeAt(this.skuValues.controls.length-1,{emitEvent:!1});this.skuValues.hasValidator(this.skuValidator())||this.skuValues.addValidators(this.skuValidator()),e.skus.forEach(i=>{this.skuValues.push(this.fb.group({id:i.skuId,value:[i.initialAmount,[this.numericValidator,c.k0.min(1)]],label:(0,m.hX)(this.skus)||(0,m.hX)(this.skus[i.skuId])?this.translation.get("assets.transfer.consumable.pieces"):this.skus[i.skuId]}),{emitEvent:!1})}),this.skuValues.updateValueAndValidity()}}validate(){return this.skuValues.valid?null:{invalid:!0}}skuValidator(){return e=>e?e.controls.some(o=>!(0,m.hX)(o.get("value").value)&&""!==o.get("value").value.trim())?null:{required:!0}:null}get skuValues(){return this.consumableForm.get("skuValues")}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(c.ok),t.rXU(f.L))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["transfer-entity-item"]],hostVars:2,hostBindings:function(i,o){2&i&&t.HbH(o.classes)},inputs:{entity:"entity",locations:"locations",skus:"skus",editable:"editable",selectable:"selectable"},standalone:!1,features:[t.Jv_([{provide:c.kq,useExisting:(0,l.Rfq)(()=>n),multi:!0},{provide:c.cz,useExisting:(0,l.Rfq)(()=>n),multi:!0}])],decls:8,vars:5,consts:[[1,"itemContainer","d-flex","w-100"],[1,"float-start",3,"format","fileName","type","hoverFormat","hoverFileName"],[1,"d-flex","flex-column"],[1,"tagNumber"],[1,"assetLocation",3,"ngClass"],[1,"ms-auto"],[1,"fas","fa-info-circle",3,"ngClass"],[3,"formGroup"],["formArrayName","skuValues"],[1,"skuContainer","float-end","mb-1",3,"formGroupName","title"],["type","text","formControlName","value",1,"form-control","skuInput"]],template:function(i,o){1&i&&(t.j41(0,"div",0),t.nVh(1,Ze,1,5,"suivo-avatar",1),t.j41(2,"div",2)(3,"span"),t.EFF(4),t.k0s(),t.nVh(5,We,3,4,"div",3),t.nVh(6,qe,4,11,"div",4),t.k0s(),t.nVh(7,an,3,2,"div",5),t.k0s()),2&i&&(t.R7$(),t.vxM(o.entity.groupType?1:-1),t.R7$(3),t.JRh(o.entity.label),t.R7$(),t.vxM(o.entity.tagNumber?5:-1),t.R7$(),t.vxM(o.locations&&o.locations[o.entity.currentLocation]?6:-1),t.R7$(),t.vxM(o.entity.groupType==o.GroupType.CONSUMABLE&&o.entity.skus?7:-1))},dependencies:[p.YU,$.F,c.qT,c.me,c.BC,c.cb,c.j4,c.JD,c.$R,c.v8,b.D],styles:[".itemContainer[_ngcontent-%COMP%] .assetLocation[_ngcontent-%COMP%]{margin-top:6px}.itemContainer[_ngcontent-%COMP%] .assetLocation[_ngcontent-%COMP%], .itemContainer[_ngcontent-%COMP%] .assetLocation[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:var(--colors-attention-primary)}.itemContainer[_ngcontent-%COMP%] .assetLocation.warning[_ngcontent-%COMP%], .itemContainer[_ngcontent-%COMP%] .assetLocation[_ngcontent-%COMP%] i.warning[_ngcontent-%COMP%]{color:var(--colors-warning-text)}.itemContainer[_ngcontent-%COMP%] .assetLocation.warning[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .itemContainer[_ngcontent-%COMP%] .assetLocation[_ngcontent-%COMP%] i.warning[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:var(--colors-warning-general)}.itemContainer[_ngcontent-%COMP%] .tagNumber[_ngcontent-%COMP%]{color:var(--colors-general-medium-grey)}.itemContainer[_ngcontent-%COMP%] .skuContainer[_ngcontent-%COMP%]{width:90px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:inline-block;margin-left:25px;min-width:80px}.itemContainer[_ngcontent-%COMP%] .skuContainer[_ngcontent-%COMP%] .skuInput[_ngcontent-%COMP%]{height:24px;padding:3px 5px;min-height:auto;width:50px;text-align:right;display:inline-block}"],changeDetection:0})}}return n})();const ln=(n,s)=>({from:n,to:s});function rn(n,s){if(1&n&&t.nrm(0,"suivo-entity",6),2&n){const e=t.XpG(2);t.Y8G("flexLayout",!0)("entityType",e.GroupType.USER)("entity",e.transfer.users[e.transfer.creationUser])}}function cn(n,s){if(1&n&&(t.j41(0,"div",9)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"span"),t.EFF(5),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,2,"allpages.comment")),t.R7$(3),t.SpI('"',e.transfer.comment,'"')}}function pn(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(3);t.R7$(),t.JRh(e.transfer.confirmationDate.date)}}function un(n,s){if(1&n&&t.nrm(0,"suivo-entity",6),2&n){const e=t.XpG(3);t.Y8G("flexLayout",!0)("entityType",e.GroupType.USER)("entity",e.transfer.users[e.transfer.confirmationUser])}}function dn(n,s){if(1&n&&(t.j41(0,"div",9)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,pn,2,1,"span"),t.j41(5,"div"),t.nVh(6,un,1,3,"suivo-entity",6),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,3,"assets.transfer.deliveryConfirmation")),t.R7$(2),t.vxM(e.transfer.confirmationDate?4:-1),t.R7$(2),t.vxM(e.transfer.users&&e.transfer.users[e.transfer.confirmationUser]?6:-1)}}function _n(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",13)(1,"label",17)(2,"input",18),t.bIt("change",function(o){l.eBV(e);const a=t.XpG(2);return l.Njj(a.toggleAll(o.target.checked))}),t.k0s(),t.EFF(3),t.nI1(4,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.R7$(2),t.Y8G("checked",e.transfer.presentAssets.length==e.selectedAssets.length),t.R7$(),t.SpI(" ",t.bMT(4,2,"allpages.selectAll")," ")}}function mn(n,s){if(1&n){const e=t.RV6();t.j41(0,"label",14)(1,"input",18),t.bIt("change",function(){const o=l.eBV(e).$index,a=t.XpG(2);return l.Njj(a.toggleAsset(o))}),t.k0s(),t.nrm(2,"transfer-entity-item",19),t.k0s()}if(2&n){const e=s.$implicit,i=s.$index,o=t.XpG(2);t.R7$(),t.Y8G("checked",o.selectedAssets.indexOf(i)>-1),t.R7$(),t.Y8G("entity",e)("skus",o.transfer.stockKeepingUnits)}}function hn(n,s){if(1&n&&(t.j41(0,"label",21),t.nrm(1,"transfer-entity-item",22),t.k0s()),2&n){const e=s.$implicit,i=t.XpG(3);t.R7$(),t.Y8G("entity",e)("skus",i.transfer.stockKeepingUnits)("locations",i.transfer.locations)}}function gn(n,s){if(1&n&&(t.j41(0,"div",20),t.EFF(1),t.nI1(2,"translate"),t.k0s(),t.Z7z(3,hn,2,3,"label",21,t.fX1)),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",t.bMT(2,1,"assets.transfer.noLongerOnLocation")," "),t.R7$(2),t.Dyx(e.transfer.absentAssets)}}function Cn(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",1)(1,"div",2)(2,"div",3),t.EFF(3),t.nI1(4,"translate"),t.j41(5,"div",4)(6,"span",5),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.nVh(9,rn,1,3,"suivo-entity",6),t.k0s()(),t.j41(10,"div",7),t.nrm(11,"transfer-location-form",8),t.k0s(),t.nVh(12,cn,6,4,"div",9),t.nVh(13,dn,7,5,"div",9),t.k0s(),t.j41(14,"div",10)(15,"span",11),t.EFF(16),t.nI1(17,"translate"),t.k0s(),t.j41(18,"div",12),t.nVh(19,_n,5,4,"div",13),t.Z7z(20,mn,3,3,"label",14,t.fX1),t.nVh(22,gn,5,3),t.k0s(),t.j41(23,"div",15)(24,"button",16),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.onCreate())}),t.EFF(25),t.nI1(26,"translate"),t.k0s()()()()}if(2&n){const e=t.XpG();t.R7$(3),t.Lme(" ",t.bMT(4,12,"allReports.createdOn")," ",e.transfer.creationDate.date," "),t.R7$(4),t.JRh(t.bMT(8,14,"allpages.by")),t.R7$(2),t.vxM(e.transfer.users&&e.transfer.users[e.transfer.creationUser]?9:-1),t.R7$(2),t.Y8G("locations",t.l_i(20,ln,e.transfer.locations[e.transfer.fromLocation],e.transfer.locations[e.transfer.toLocation])),t.R7$(),t.vxM(e.transfer.comment?12:-1),t.R7$(),t.vxM(e.transfer.confirmationUser||e.transfer.confirmationDate?13:-1),t.R7$(3),t.SpI(" ",t.bMT(17,16,"assets.transfer.assets")," "),t.R7$(3),t.vxM(e.transfer.presentAssets&&e.transfer.presentAssets.length>0?19:-1),t.R7$(),t.Dyx(e.transfer.presentAssets),t.R7$(2),t.vxM(e.transfer.absentAssets&&e.transfer.absentAssets.length>0?22:-1),t.R7$(2),t.Y8G("disabled",0==e.selectedAssets.length),t.R7$(),t.SpI(" ",t.bMT(26,18,"assets.transfer.newTransferSelection")," ")}}let fn=(()=>{class n{constructor(e,i){this.transferService=e,this.cdRef=i,this.onClosePopup=new t.bkB,this.onCreateTransfer=new t.bkB,this.selectedAssets=[],this.GroupType=_.MH,this.AvatarFormat=L.Z}ngOnInit(){this.transferService.getTransferDetail(this.transferId).subscribe(e=>{this.transfer=e,this.cdRef.markForCheck()})}toggleAsset(e){this.selectedAssets.indexOf(e)>-1?this.selectedAssets=this.selectedAssets.filter(i=>i!=e):this.selectedAssets.push(e)}toggleAll(e){if(this.selectedAssets=[],e&&(0==this.selectedAssets.length||this.selectedAssets.length<this.transfer.presentAssets.length))for(let i=0;i<this.transfer.presentAssets.length;i++)this.selectedAssets.push(i)}onCreate(){let e=this.selectedAssets.map(i=>{let o=this.transfer.presentAssets[i];return{id:o.entityId,groupType:o.groupType}});this.onCreateTransfer.emit({selectedAssets:e,location:this.transfer.toLocation})}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(Tt),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["transfer-detail"]],inputs:{transferId:"transferId"},outputs:{onClosePopup:"onClosePopup",onCreateTransfer:"onCreateTransfer"},standalone:!1,decls:2,vars:5,consts:[[3,"loading","size","margin","center"],[1,"transferContainer","d-flex"],[1,"leftPanel"],[1,"bold"],[1,"bold","d-flex"],[1,"me-1"],[3,"flexLayout","entityType","entity"],[1,"locations"],[3,"locations"],[1,"d-flex","flex-column"],[1,"rightPanel"],[1,"bold","mb-3"],[1,"transferList"],[1,"selectAll","transferItem"],[1,"d-flex","align-items-baseline","transferItem"],[1,"buttonContainer"],[1,"btn","btn-md","btn-primary","submit","float-end",3,"click","disabled"],[1,"bold","d-flex","align-items-center"],["type","checkbox",3,"change","checked"],[3,"entity","skus"],[1,"absentAssetsTitle"],[1,"d-flex","align-items-baseline","transferItem","absentAsset"],[3,"entity","skus","locations"]],template:function(i,o){1&i&&(t.nrm(0,"progress-indicator",0),t.nVh(1,Cn,27,23,"div",1)),2&i&&(t.Y8G("loading",!o.transfer)("size",25)("margin",10)("center",!0),t.R7$(),t.vxM(o.transfer?1:-1))},dependencies:[ot.Z,st.E,St,It,b.D],styles:['.transferContainer[_ngcontent-%COMP%]{height:calc(100% - 15px)}.leftPanel[_ngcontent-%COMP%], .rightPanel[_ngcontent-%COMP%]{height:100%;padding:15px;overflow-y:auto}.leftPanel[_ngcontent-%COMP%]{min-width:270px;width:20%;max-width:400px;margin-left:-10px;display:flex;flex-direction:column;gap:25px}.leftPanel[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{color:var(--colors-general-hard-grey);margin-bottom:0}.leftPanel[_ngcontent-%COMP%] .location[_ngcontent-%COMP%]:first-child{margin-bottom:20px}.leftPanel[_ngcontent-%COMP%] .location[_ngcontent-%COMP%]{width:100%;display:flex;align-items:baseline}.leftPanel[_ngcontent-%COMP%] .location[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{background-color:var(--colors-attention-primary);width:8px;height:8px;border-radius:50%;display:inline-block;position:relative;margin-right:10px}.leftPanel[_ngcontent-%COMP%] .location[_ngcontent-%COMP%] .dot.connected[_ngcontent-%COMP%]:after{content:"";border-left:1px dashed var(--colors-general-soft-grey);position:absolute;
1left:50%;top:100%;height:50px}.rightPanel[_ngcontent-%COMP%]{flex:1;margin-right:-10px;display:flex;flex-direction:column;height:100%;min-width:0}.rightPanel[_ngcontent-%COMP%] .transferList[_ngcontent-%COMP%]{border:solid 1px var(--colors-general-soft-grey);flex:1}.rightPanel[_ngcontent-%COMP%] .transferList[_ngcontent-%COMP%] .absentAssetsTitle[_ngcontent-%COMP%]{padding:8px 15px;font-weight:700;margin-top:15px}.rightPanel[_ngcontent-%COMP%] .transferList[_ngcontent-%COMP%] .transferItem[_ngcontent-%COMP%]{padding:15px;margin-bottom:0}.rightPanel[_ngcontent-%COMP%] .transferList[_ngcontent-%COMP%] .transferItem.absentAsset[_ngcontent-%COMP%]{background-color:var(--colors-general-background-grey)}.rightPanel[_ngcontent-%COMP%] .transferList[_ngcontent-%COMP%] .transferItem[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{margin-top:0;margin-right:8px}.rightPanel[_ngcontent-%COMP%] .transferList[_ngcontent-%COMP%] .selectAll[_ngcontent-%COMP%]{border-bottom:solid 1px var(--colors-general-soft-grey)}.rightPanel[_ngcontent-%COMP%] .transferList[_ngcontent-%COMP%] .selectAll[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:700}'],changeDetection:0})}}return n})();class vn{}class bn{}var Rt=function(n){return n.ALWAYS="ALWAYS",n.NEVER="NEVER",n.ASK="ASK",n}(Rt||{}),Ot=u(13755),rt=u(30859),Lt=u(48926),Tn=u(1863),At=u(72396),On=u(12673),Mn=u(34254);const xn=n=>({active:n}),Pn=(n,s,e)=>({selected:n,loading:s,unavailable:e}),yn=(n,s)=>({selected:n,loading:s});function kn(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",6)(1,"a",15),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(2);return l.Njj(a.setActiveGroupType(o))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=s.$implicit,i=t.XpG(2);t.Y8G("ngClass",t.eq3(4,xn,e===i.activeType)),t.R7$(2),t.JRh(t.bMT(3,2,i.availableEntityTypes[e]))}}function Fn(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",11)(1,"button",16),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.selectAll())}),t.EFF(2),t.nI1(3,"translate"),t.nrm(4,"i",17),t.k0s()()}if(2&n){const e=t.XpG(2);t.R7$(),t.Y8G("disabled",0===e.availableItems.totalItems),t.R7$(),t.Lme(" ",t.bMT(3,3,"allpages.selectAll"),"\xa0(",e.availableItems.totalItems,") ")}}function Sn(n,s){if(1&n){const e=t.RV6();t.j41(0,"a",18),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.searchOutsideLocation(!1))}),t.nrm(1,"i",19),t.EFF(2),t.nI1(3,"translate"),t.k0s()}2&n&&(t.R7$(2),t.SpI("\xa0 ",t.bMT(3,1,"assets.transfer.assets.searchInsideLocation")," "))}function In(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",21),t.bIt("mouseenter",function(){const o=l.eBV(e),a=o.$implicit,r=o.$index,d=t.XpG(3);return l.Njj(d.addToSelection(a.key,r,!0))})("mousedown",function(){const o=l.eBV(e),a=o.$implicit,r=o.$index,d=t.XpG(3);return d.setupSelection(!0),l.Njj(d.addToSelection(a.key,r,!0))})("mouseup",function(){l.eBV(e);const o=t.XpG(3);return l.Njj(o.confirmSelection())}),t.nrm(1,"transfer-entity-item",22),t.k0s()}if(2&n){const e=s.$implicit,i=t.XpG(3);t.Aen("--bgStatusColor:"+(e.statusColor?e.statusColor:"transparent")),t.Y8G("ngClass",t.sMw(7,Pn,i.itemsToAdd&&void 0!==i.itemsToAdd[e.key]&&e.available,i.availableItems.loading,!e.available)),t.R7$(),t.Y8G("entity",e)("skus",e.entitySkus)("locations",i.locations)("selectable",!0)}}function Rn(n,s){if(1&n&&(t.j41(0,"ul"),t.Z7z(1,In,2,11,"li",20,t.fX1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.Dyx(e.availableItems.items)}}function Ln(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",14),t.EFF(1),t.nI1(2,"translate"),t.nrm(3,"br"),t.j41(4,"a",23),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.searchOutsideLocation(!0))}),t.nrm(5,"i",24),t.EFF(6),t.nI1(7,"translate"),t.k0s()()}2&n&&(t.R7$(),t.SpI(" ",t.bMT(2,2,"assets.transfer.assets.notFound")),t.R7$(5),t.SpI("\xa0 ",t.bMT(7,4,"assets.transfer.assets.searchOutsideLocation")," "))}function An(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",1)(1,"div",3)(2,"div",4)(3,"ul",5),t.Z7z(4,kn,4,6,"li",6,t.fX1),t.k0s()()(),t.j41(6,"div",3)(7,"div",7)(8,"entity-selection-filter",8),t.bIt("applyFilter",function(o){l.eBV(e);const a=t.XpG();return l.Njj(a.applyFilter(!0,o))}),t.k0s()()(),t.j41(9,"div",9),t.bIt("mouseleave",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.setupSelectionFallback())}),t.j41(10,"div",10),t.bIt("scrolled",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.addMoreItems(!0,!1))}),t.nVh(11,Fn,5,5,"div",11),t.nVh(12,Sn,4,3,"a",12),t.nVh(13,Rn,3,0,"ul"),t.nrm(14,"progress-indicator",13),t.nVh(15,Ln,8,6,"div",14),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(4),t.Dyx(e.objectKeys(e.availableEntityTypes)),t.R7$(4),t.Y8G("filterData",e.filterData),t.R7$(2),t.Y8G("scrollWindow",!1),t.R7$(),t.vxM(e.activeType===e.groupType.UNIT&&e.atLocation&&null!=e.availableItems&&e.availableItems.items&&0!==(null==e.availableItems?null:e.availableItems.items.length)&&null!=e.availableItems&&e.availableItems.items[0].available?11:-1),t.R7$(),t.vxM(e.atLocation||e.activeType!==e.groupType.UNIT?-1:12),t.R7$(),t.vxM(e.availableItems.items?13:-1),t.R7$(),t.Y8G("loading",e.availableItems.loading)("size",20)("center",!0),t.R7$(),t.vxM(e.atLocation&&e.activeType===e.groupType.UNIT?15:-1)}}function En(n,s){1&n&&(t.j41(0,"div",25),t.nrm(1,"i",28),t.j41(2,"div"),t.EFF(3),t.nI1(4,"translate"),t.k0s()()),2&n&&(t.R7$(3),t.JRh(t.bMT(4,1,"assets.transfer.selectAssets")))}function jn(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",29)(1,"div",30)(2,"div",31),t.nrm(3,"transfer-entity-item",32),t.k0s(),t.j41(4,"div",33)(5,"i",34),t.bIt("mouseenter",function(){const o=l.eBV(e),a=o.$implicit,r=o.$index,d=t.XpG(3);return l.Njj(d.addToSelection(a.value.key,r,!1))})("mousedown",function(){const o=l.eBV(e),a=o.$implicit,r=o.$index,d=t.XpG(3);return d.setupSelection(!1),l.Njj(d.addToSelection(a.value.key,r,!1))})("mouseup",function(){l.eBV(e);const o=t.XpG(3);return l.Njj(o.confirmSelection())}),t.k0s()()()()}if(2&n){const e=s.$implicit,i=s.$index,o=t.XpG(3);t.Aen("--bgStatusColor:"+(e.value.statusColor?e.value.statusColor:"transparent")),t.Y8G("ngClass",t.l_i(8,yn,o.itemsToRemove&&void 0!==o.itemsToRemove[e.value.key],o.selectedItems.loading)),t.R7$(3),t.Y8G("skus",e.value.entitySkus)("locations",o.locations)("editable",!0)("selectable",!0)("formControlName",i)}}function Dn(n,s){if(1&n&&(t.j41(0,"ul",27),t.Z7z(1,jn,6,11,"li",20,t.fX1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.Dyx(e.selection.controls)}}function wn(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"b"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.EFF(6),t.k0s()(),t.j41(7,"div",9),t.bIt("mouseleave",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.setupSelectionFallback())}),t.j41(8,"div",10),t.bIt("scrolled",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.addMoreItems(!1,!0))}),t.nVh(9,En,5,3,"div",25),t.j41(10,"form",26),t.nVh(11,Dn,3,0,"ul",27),t.nrm(12,"progress-indicator",13),t.k0s()()()()}if(2&n){const e=t.XpG();t.R7$(4),t.JRh(t.bMT(5,9,"entitySelection.selection.title")),t.R7$(2),t.SpI("\xa0(",e.value?e.value.length:0,") "),t.R7$(2),t.Y8G("scrollWindow",!1),t.R7$(),t.vxM(e.selectedItems.items&&0!==e.selectedItems.items.length?-1:9),t.R7$(),t.Y8G("formGroup",e.entitySelectionForm),t.R7$(),t.vxM(e.selectedItems.items?11:-1),t.R7$(),t.Y8G("loading",e.selectedItems.loading)("size",20)("center",!0)}}let Gn=(()=>{class n{static{this.REQUEST_ITEMS_AMOUNT=20}onMouseUp(){!(0,m.hX)(this.selectionMode)&&this.selectionFallbackEnabled&&(this.selectionFallbackEnabled=!1,this.confirmSelection())}set locationId(e){let i=!(0,m.hX)(this._locationId)&&this._locationId!==e;if(this._locationId=e,i){this.value=null;let o=this.selection.controls.length;for(;o--;)this.selection.removeAt(o,{emitEvent:!1});this.initEntitySelection()}}set selectedAssets(e){(0,m.hX)(e)||(this.value=e.map(i=>i.groupType+"_"+i.id))}constructor(e,i,o,a){this.fb=e,this.transferService=i,this.entitySelectionService=o,this.changeDetector=a,this.avatarFormat=L.Z,this.category=_.SB,this.groupType=_.MH,this.entitySelectionMode=G,this.availableEntityTypes={UNIT:"allpages.units",CONSUMABLE:"permission.ITEM_CONSUMABLES"},this.atLocation=!0,this.objectKeys=Object.keys,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this.entitySelectionForm=this.fb.group({selection:this.fb.array([])}),this.selectionSubscription=this.selection.valueChanges.subscribe(e=>{let i=e.map(o=>{let a={entityId:o.entityId,groupType:o.groupType};return o.groupType===_.MH.CONSUMABLE&&(a.skus=o.skus),a});this.onChange(i)})}ngOnDestroy(){this.selectionSubscription&&this.selectionSubscription.unsubscribe()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}writeValue(e){(0,m.hX)(this.locationId)||this.initEntitySelection()}
1validate(){return this.selection.valid?null:{invalid:!0}}applyFilter(e,i){e?this.availableItemsFilter=i:this.selectedItemsFilter=i,this.requestEntities(e,!e,!0)}selectAll(){let e={type:this.activeType,locationId:this.locationId,atLocation:this.atLocation,selection:this.value};(0,m.hX)(this.availableItemsFilter)||(e.query=this.availableItemsFilter.search,(0,m.hX)(this.availableItemsFilter.filter)||(e.groups=this.availableItemsFilter.filter.groupFilter,e.types=this.availableItemsFilter.filter.typeFilter)),this.transferService.getAllEntityIds(e).subscribe(i=>{this.value=(0,m.hX)(this.value)?i:this.value.concat(i),this.requestEntities(!1,!0,!0)}),this.availableItems=this.getEntitiesSelectionState({items:[],totalItems:0},this.availableItems,!0),this.changeDetector.markForCheck()}addMoreItems(e,i){e?this.availableItems.totalItems>this.availableItems.items.length&&this.requestEntities(!0,!1,!1):i&&this.selectedItems.totalItems>this.selectedItems.items.length&&this.requestEntities(!1,!0,!1)}setupSelection(e){this.selectionMode=e?G.ADD:G.REMOVE}searchOutsideLocation(e){this.atLocation=!e,this.requestEntities(!0,!1,!0)}addToSelection(e,i,o){if((!o||this.atLocation||!(0,m.hX)(this.availableItems)&&0!==this.availableItems.items.length&&this.availableItems.items[0].available)&&!(0,m.hX)(this.selectionMode)&&(o&&this.selectionMode===G.ADD||!o&&this.selectionMode===G.REMOVE)&&
1!this.availableItems.loading&&!this.selectedItems.loading){this.selectionMode===G.ADD&&(0,m.hX)(this.itemsToAdd)?this.itemsToAdd={}:this.selectionMode===G.REMOVE&&(0,m.hX)(this.itemsToRemove)&&(this.itemsToRemove={});let r=this.selectionMode===G.ADD?this.itemsToAdd:this.itemsToRemove;(0,m.hX)(r[e])?r[e]=i:delete r[e];let d=Math.min(...Object.values(r).map(P=>+P)),g=Math.max(...Object.values(r).map(P=>+P))-d+1;if(g>Object.values(r).length){let P=this.selectionMode===G.ADD?this.availableItems.items:this.selectedItems.items;for(;g--;){let N=d+g;(0,m.hX)(r[P[N].key])&&(r[P[N].key]=N)}}}}confirmSelection(){if(!(0,m.hX)(this.selectionMode)){delete this.selectionMode;let e=!1;if(this.itemsToAdd&&0!==Object.keys(this.itemsToAdd).length){let i=Object.keys(this.itemsToAdd).map(o=>o);this.value=(0,m.hX)(this.value)?i:this.value.concat(i),this.itemsToAdd&&delete this.itemsToAdd,e=!0}else this.itemsToRemove&&0!==Object.keys(this.itemsToRemove).length&&(this.value=this.value.filter(i=>(0,m.hX)(this.itemsToRemove[i])),this.itemsToRemove&&delete this.itemsToRemove,e=!0);e&&this.requestEntities(!0,!0,!0)}}setupSelectionFallback(){this.selectionFallbackEnabled=!0}toggleFilter(e){this.filterVisible=!e&&!this.filterVisible,(0,m.hX)(this.filterData)&&this.entitySelectionService.getFilterData(At._u.TRANSFER_ENTITIES,this.activeType).subscribe(i=>{this.filterData=i,this.changeDetector.markForCheck()})}setActiveGroupType(e){this.activeType=_.MH[e],this.getFilterData(),this.requestEntities(!0,!1,!0)}getFilterData(){this.entitySelectionService.getFilterData(At._u.TRANSFER_ENTITIES,this.activeType).subscribe(e=>{this.filterData=e,this.changeDetector.markForCheck()})}requestEntities(e,i,o){let a=new bn;a.selection=this.value,a.locationId=this.locationId,a.atLocation=this.atLocation,e&&(o||(0,m.hX)(this.availableItems.items)?(this.availableItems.offset=0,o=!0):this.availableItems.offset+=n.REQUEST_ITEMS_AMOUNT,a.availableItems={type:this.activeType,amount:n.REQUEST_ITEMS_AMOUNT,offset:this.availableItems.offset},this.availableItems.loading=!0,(0,m.hX)(this.availableItemsFilter)||(a.availableItems.query=this.availableItemsFilter.search,(0,m.hX)(this.availableItemsFilter.filter)||(a.availableItems.groups=this.availableItemsFilter.filter.groupFilter,a.availableItems.types=this.availableItemsFilter.filter.typeFilter))),i&&(o||(0,m.hX)(this.selectedItems.items)?(this.selectedItems.offset=0,o=!0):this.selectedItems.offset+=n.REQUEST_ITEMS_AMOUNT,this.selectedItems.loading=!0,a.selectedItems={amount:n.REQUEST_ITEMS_AMOUNT,offset:this.selectedItems.offset}),this.changeDetector.markForCheck(),this.transferService.getSelectionEntities(a).subscribe(r=>{if((0,m.hX)(r.availableItems)||(this.availableItems=this.getEntitiesSelectionState(r.availableItems,this.availableItems,o)),(0,m.hX)(r.selectedItems)||(this.setupSelectionForm(r,o),this.selectedItems=this.getEntitiesSelectionState(r.selectedItems,this.selectedItems,o)),!(0,m.hX)(r.locations)){let d=Object.keys(r.locations).reduce((h,g)=>(h[g]={id:g,label:r.locations[g]},h),{});this.locations=(0,m.hX)(this.locations)?d:Object.assign(this.locations,d)}this.changeDetector.markForCheck()})}getEntitiesSelectionState(e,i,o){return i.totalItems=e.totalItems,i.items=o?e.items:i.items.concat(e.items),i.loading=!1,i}setupSelectionForm(e,i){if(i&&0!==this.selection.controls.length){let o=this.selection.controls.length;for(;o--;)((0,m.hX)(this.value)||-1===this.value.indexOf(this.selection.controls[o].value.key))&&this.selection.removeAt(o,{emitEvent:!1})}e.selectedItems.items&&(e.selectedItems.items=e.selectedItems.items.map(o=>(o.groupType===_.MH.CONSUMABLE&&(o.skus=o.entitySkus?Object.keys(o.entitySkus).map(a=>({skuId:+a,initialAmount:null,confirmedAmount:null})):[],o.skus.push({skuId:null,initialAmount:null,confirmedAmount:null})),o)),e.selectedItems.items.forEach((o,a)=>{this.selection.controls.some(d=>d.value.key===o.key)||this.selection.insert(a,this.fb.control(o),{emitEvent:!1})}),setTimeout(()=>{this.selection.updateValueAndValidity()}))}initEntitySelection(){this.availableItems=new Et,this.availableItems.totalItems=0,this.selectedItems=new Et,this.selectedItems.totalItems=0,(0,m.hX)(this.activeType)&&(this.activeType=_.MH.UNIT),this.requestEntities(!0,!0),(0,m.hX)(this.filterData)&&this.getFilterData(),this.changeDetector.markForCheck()}get locationId(){return this._locationId}get selection(){return this.entitySelectionForm.get("selection")}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(c.ok),t.rXU(Tt),t.rXU(On.f),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["transfer-entity-selection"]],hostBindings:function(i,o){1&i&&t.bIt("mouseup",function(){return o.onMouseUp()},t.EBC)},inputs:{locationId:"locationId",selectedAssets:"selectedAssets"},standalone:!1,features:[t.Jv_([{provide:c.kq,useExisting:(0,l.Rfq)(()=>n),multi:!0},{provide:c.cz,useExisting:(0,l.Rfq)(()=>n),multi:!0}])],decls:3,vars:2,consts:[[1,"row","full-height"],[1,"col-5","full-height","columnContainer"],[1,"col-7","full-height","columnContainer"],[1,"row","mb-2"],[1,"col-12"],[1,"nav","nav-tabs"],[1,"nav-item",3,"ngClass"],[1,"col-12","searchContainer"],[3,"applyFilter","filterData"],[1,"scrollC
1ontainer",3,"mouseleave"],["infiniteScroll","",1,"scrollContent",3,"scrolled","scrollWindow"],[1,"d-grid"],[1,"locationSearchLink","backLink"],[3,"loading","size","center"],[1,"locationSearchLinkContainer"],[1,"nav-link",3,"click"],["type","button",1,"btn","btn-secondary",3,"click","disabled"],[1,"fa-solid","fa-arrow-right","float-end","fa-lg"],[1,"locationSearchLink","backLink",3,"click"],[1,"fa-solid","fa-arrow-left"],[3,"ngClass","style"],[3,"mouseenter","mousedown","mouseup","ngClass"],[3,"entity","skus","locations","selectable"],[1,"locationSearchLink",3,"click"],[1,"fa-solid","fa-magnifying-glass"],[1,"emptyState"],[3,"formGroup"],["formArrayName","selection"],[1,"fa-solid","fa-box-open"],[3,"ngClass"],[1,"row"],[1,"col-11"],[3,"skus","locations","editable","selectable","formControlName"],[1,"col-1"],[1,"fa-solid","fa-trash-alt","action","float-end",3,"mouseenter","mousedown","mouseup"]],template:function(i,o){1&i&&(t.j41(0,"div",0),t.nVh(1,An,16,9,"div",1),t.nVh(2,wn,13,11,"div",2),t.k0s()),2&i&&(t.R7$(),t.vxM(o.availableItems?1:-1),t.R7$(),t.vxM(o.selectedItems?2:-1))},dependencies:[p.YU,st.E,Mn.F,c.qT,c.BC,c.cb,c.j4,c.JD,c.v8,Q.D,It,b.D],styles:['.columnContainer.full-height[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding-bottom:10px}.emptyState[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%}.emptyState[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{margin-bottom:8px;font-size:5em;color:var(--colors-general-soft-grey)}.locationSearchLinkContainer[_ngcontent-%COMP%]{padding:10px 20px 10px 40px}.locationSearchLink[_ngcontent-%COMP%], .locationSearchLink[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{color:var(--colors-attention-primary);cursor:pointer}.locationSearchLink.backLink[_ngcontent-%COMP%], .locationSearchLink[_ngcontent-%COMP%] .fa-solid.backLink[_ngcontent-%COMP%]{margin:15px;display:block}.searchContainer[_ngcontent-%COMP%]{position:relative}.scrollContainer[_ngcontent-%COMP%]{border:1px solid var(--colors-general-soft-grey);flex:1;min-height:0}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%]{height:100%;overflow:auto;overflow-x:hidden}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%] .d-grid[_ngcontent-%COMP%]{padding:10px 10px 5px}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%] .d-grid[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%] .fa-solid[_ngcontent-%COMP%]{margin-top:7px}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;padding:5px 15px;cursor:pointer;position:relative;margin-bottom:5px}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:before{content:"";width:3px;display:block;position:absolute;top:0;bottom:0;left:0;background:var(--bgStatusColor)}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover{background:var(--colors-attention-soft)}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li.selected[_ngcontent-%COMP%]{background:var(--colors-attention-primary);color:var(--colors-general-white)}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li.unavailable[_ngcontent-%COMP%]{background:var(--colors-general-background-grey)}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li.loading[_ngcontent-%COMP%]{color:var(--colors-general-medium-grey);cursor:unset}.scrollContainer[_ngcontent-%COMP%] .scrollContent[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .fa-trash-alt[_ngcontent-%COMP%]{margin-top:6px}'],changeDetection:0})}}return n})();class Et{}var G=function(n){return n[n.ADD=0]="ADD",n[n.REMOVE=1]="REMOVE",n}(G||{});function $n(n,s){1&n&&(t.j41(0,"label"),t.nrm(1,"input",13),t.EFF(2),t.nI1(3,"translate"),t.k0s()),2&n&&(t.R7$(2),t.SpI(" ",t.bMT(3,1,"assets.transfer.confirmDelivery")," "))}function Vn(n,s){1&n&&(t.j41(0,"div",11),t.nrm(1,"i",14),t.j41(2,"div"),t.EFF(3),t.nI1(4,"translate"),t.k0s()()),2&n&&(t.R7$(3),t.SpI(" ",t.bMT(4,1,"assets.transfer.selectLocation")," "))}function Nn(n,s){if(1&n&&(t.j41(0,"div",12),t.nrm(1,"transfer-entity-selection",15)(2,"show-errors",4),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.Y8G("locationId",null==e.locations.value?null:e.locations.value.from)("selectedAssets",e.selectedAssets),t.R7$(),t.Y8G("control",e.assetSelection)}}
1let Xn=(()=>{class n{constructor(e,i,o){this.transferService=e,this.listDataHelper=i,this.cdRef=o,this.onClosePopup=new t.bkB,this.ConfirmationPolicy=Rt}ngOnInit(){this.transferForm=new c.gE({locations:new c.MJ({from:this.location,to:null}),comment:new c.MJ(""),confirmDelivery:new c.MJ(!1),assetSelection:new c.MJ(null)}),this.transferService.getTransferOptions().subscribe(e=>{this.confirmationPolicy=e.confirmationPolicy,!this.location&&e.transferLocation&&this.locations.setValue({from:e.transferLocation,to:null},{emitEvent:!1}),this.cdRef.markForCheck()})}saveTransfer(){if(this.transferForm.valid){let e=new vn;e.fromLocation=this.locations.value.from,e.toLocation=this.locations.value.to,this.comment.value&&this.comment.value.length>0&&(e.comment=this.comment.value),e.deliveryConfirm=this.confirmDelivery.value,e.assets=this.assetSelection.value,!e.deliveryConfirm&&e.assets&&e.assets.forEach(i=>{i.skus&&i.skus.forEach(o=>o.confirmedAmount=o.initialAmount)}),this.saving=!0,this.transferService.createTransfer(e).subscribe(i=>{i.errors&&Object.keys(i.errors).length>0?(this.saving=!1,Object.keys(i.errors).forEach(o=>{"assets"==o?(this.assetSelection.setErrors({server:{message:i.errors[o]}}),this.assetSelection.markAsDirty()):(this.transferForm.get(o).setErrors({server:{message:i.errors[o]}}),this.transferForm.get(o).markAsDirty())})):setTimeout(()=>{this.listDataHelper.triggerListAction(H.y4.TRANSFERS,{action:Ot.fo.REFRESH,keepParameters:!0}),this.onClosePopup.emit()},3e3),this.cdRef.markForCheck()})}}get locations(){return this.transferForm.get("locations")}get comment(){return this.transferForm.get("comment")}get confirmDelivery(){return this.transferForm.get("confirmDelivery")}get assetSelection(){return this.transferForm.get("assetSelection")}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(Tt),t.rXU(rt.T),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["transfer-create"]],inputs:{selectedAssets:"selectedAssets",location:"location"},outputs:{onClosePopup:"onClosePopup"},standalone:!1,decls:22,vars:13,consts:[[1,"transferContainer","d-flex",3,"formGroup"],[1,"leftPanel"],[1,"locationInfo"],["formControlName","locations"],[3,"control"],["field-optional",""],["rows","4","formControlName","comment",1,"form-control"],[1,"buttonContainer"],[1,"btn","float-start",3,"click"],[3,"onButtonClick","alignRight","buttonDisabled"],[1,"rightPanel"],[1,"emptyState"],[1,"full-height"],["type","checkbox","formControlName","confirmDelivery"],[1,"fas","fa-warehouse"],["formControlName","assetSelection",3,"locationId","selectedAssets"]],template:function(i,o){1&i&&(t.j41(0,"form",0)(1,"div",1)(2,"div",2)(3,"div"),t.nrm(4,"transfer-location-form",3)(5,"show-errors",4),t.k0s(),t.j41(6,"div")(7,"label"),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.nrm(10,"span",5),t.j41(11,"textarea",6),t.EFF(12," "),t.k0s()(),t.nVh(13,$n,4,3,"label"),t.k0s(),t.j41(14,"div",7)(15,"button",8),t.bIt("click",function(){return o.onClosePopup.emit()}),t.EFF(16),t.nI1(17,"translate"),t.k0s(),t.j41(18,"success-submit-button",9),t.bIt("onButtonClick",function(){return o.saveTransfer()}),t.k0s()()(),t.j41(19,"div",10),t.nVh(20,Vn,5,3,"div",11),t.nVh(21,Nn,3,3,"div",12),t.k0s()()),2&i&&(t.Y8G("formGroup",o.transferForm),t.R7$(5),t.Y8G("control",o.locations),t.R7$(3),t.JRh(t.bMT(9,9,"allpages.comment")),t.R7$(5),t.vxM(o.confirmationPolicy==o.ConfirmationPolicy.ASK?13:-1),t.R7$(3),t.SpI(" ",t.bMT(17,11,"allpages.button.cancel")," "),t.R7$(2),t.Y8G("alignRight",!0)("buttonDisabled",o.transferForm.invali
1d||o.saving),t.R7$(2),t.vxM(null!=o.locations&&null!=o.locations.value&&o.locations.value.from?-1:20),t.R7$(),t.vxM(null!=o.locations&&null!=o.locations.value&&o.locations.value.from?21:-1))},dependencies:[Lt.w,at.l,Tn.m,c.qT,c.me,c.Zm,c.BC,c.cb,c.j4,c.JD,St,Gn,b.D],styles:[".transferContainer[_ngcontent-%COMP%]{height:calc(100% - 15px)}.leftPanel[_ngcontent-%COMP%], .rightPanel[_ngcontent-%COMP%]{height:100%;padding:15px;display:flex;flex-direction:column}.leftPanel[_ngcontent-%COMP%]{min-width:270px;max-width:400px;width:20%;margin-left:-10px;background-color:var(--colors-general-background-grey);border-right:1px solid var(--colors-general-soft-grey)}.locationInfo[_ngcontent-%COMP%]{gap:25px;flex:1;display:flex;flex-direction:column}.rightPanel[_ngcontent-%COMP%]{flex:1;margin-right:-10px;min-width:0}.emptyState[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%}.emptyState[_ngcontent-%COMP%] .fa-warehouse[_ngcontent-%COMP%]{margin-bottom:8px;font-size:5em;color:var(--colors-general-soft-grey)}"],changeDetection:0})}}return n})();const Bn=n=>({create:n});function Un(n,s){if(1&n){const e=t.RV6();t.j41(0,"transfer-detail",8),t.bIt("onCreateTransfer",function(o){l.eBV(e);const a=t.XpG();return l.Njj(a.onCreateTransfer(o))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("transferId",e.transferId)}}function Yn(n,s){if(1&n){const e=t.RV6();t.j41(0,"transfer-create",9),t.bIt("onClosePopup",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.onClosePopup.emit())}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("location",e.location)("selectedAssets",e.selectedAssets)}}let Mt=(()=>{class n{constructor(){this.onClosePopup=new t.bkB}ngOnInit(){null==this.transferId&&(this.showCreate=!0)}onCreateTransfer(e){this.selectedAssets=e.selectedAssets,this.location=e.location,this.showCreate=!0}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["transfer-popup"]],inputs:{transferId:"transferId"},outputs:{onClosePopup:"onClosePopup"},standalone:!1,decls:10,vars:8,consts:[[1,"popupBackgroundOverlay"],[1,"optionsPopup",3,"ngClass"],[1,"popupContent","empty","full-height"],[1,"optionForm","full-height"],["type","button",1,"btn-close","float-end",3,"click"],[1,"mb-0"],[3,"transferId"],[3,"location","selectedAssets"],[3,"onCreateTransfer","transferId"],[3,"onClosePopup","location","selectedAssets"]],template:function(i,o){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"button",4),t.bIt("click",function(){return o.onClosePopup.emit()}),t.k0s(),t.j41(5,"h1",5),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.nVh(8,Un,1,1,"transfer-detail",6),t.nVh(9,Yn,1,2,"transfer-create",7),t.k0s()()()()),2&i&&(t.R7$(),t.Y8G("ngClass",t.eq3(6,Bn,o.showCreate)),t.R7$(5),t.JRh(t.bMT(7,4,o.showCreate?"assets.transfer.create":"assets.transfer.detail")),t.R7$(2),t.vxM(o.showCreate?-1:8),t.R7$(),t.vxM(o.showCreate?9:-1))},dependencies:[p.YU,fn,Xn,b.D],styles:[".optionsPopup[_ngcontent-%COMP%]{margin:0 auto;left:0;right:0;width:1000px}.optionsPopup.create[_ngcontent-%COMP%]{width:80%}"],changeDetection:0})}}return n})();const z=n=>({active:n}),Hn=(n,s)=>({id:n,name:s});function zn(n,s){if(1&n){const e=t.RV6();t.j41(0,"i",11),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.closeDetail.emit())}),t.k0s()}}function Jn(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",3)(1,"a",12),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.setAttributes())}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,z,"CUSTOM_FIELDS"===e.activeTab)),t.R7$(2),t.JRh(t.bMT(3,2,"permission.ITEM_CUSTOM_FIELDS"))}}function Kn(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",3)(1,"a",4),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.activeTab="EVENTS")}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,z,"EVENTS"===e.activeTab)),t.R7$(2),t.JRh(t.bMT(3,2,"allpages.events"))}}function Zn(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",3)(1,"a",4),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.activeTab="TRANSFERS")}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,z,"TRANSFERS"===e.activeTab)),t.R7$(2),t.JRh(t.bMT(3,2,"permission.ITEM_TRANSFERS"))}}function Wn(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",3)(1,"a",4),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.activeTab="INVENTORIES")}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,z,"INVENTORIES"===e.activeTab)),t.R7$(2),t.JRh(t.bMT(3,2,"settings.account.asset.management.inventory"))}}function qn(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",3)(1,"a",4),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.activeTab="DAMAGES")}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,z,"DAMAGES"===e.activeTab)),t.R7$(2),t.JRh(t.bMT(3,2,"permission.ITEM_DAMAGE"))}}function Qn(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",3)(1,"a",4),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.activeTab="RESPONSIBLE_CONTACT")}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,z,"RESPONSIBLE_CONTACT"===e.activeTab)),t.R7$(2),t.SpI(" ",t.bMT(3,2,"settings.person.contact")," ")}}function ti(n,s){if(1&n&&t.nrm(0,"suivo-entity",18),2&n){const e=t.XpG(4);t.Y8G("entityType",e.groupType[e.locations[e.assetData.location].group])("entity",e.locations[e.assetData.location])}}function ei(n,s){if(1&n&&t.EFF(0),2&n){const e=t.XpG(4);t.SpI(" ",e.locations[e.assetData.location].name," ")}}function ni(n,s){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"b"),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"td"),t.nVh(6,ti,1,2,"suivo-entity",18),t.nVh(7,ei,1,1),t.k0s()()),2&n){const e=t.XpG(3);t.R7$(3),t.JRh(t.bMT(4,3,"COST_LOCATION"==e.locations[e.assetData.location].group?"assets.costLocation":"assets.stockLocation")),t.R7$(3),t.vxM(e.costStockLocation?-1:6),t.R7$(),t.vxM(e.costStockLocation?7:-1)}}function ii(n,s){if(1&n&&(t.nrm(0,"br"),t.EFF(1)),2&n){const e=t.XpG(3);t.R7$(),t.SpI("@ ",e.locationTimestamp.date," ")}}function oi(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n){const e=t.XpG(3);t.R7$(),t.Lme("",t.bMT(2,2,"allpages.form.address"),": ",e.assetData.address.address)}}function si(n,s){if(1&n&&t.nrm(0,"suivo-entity",18),2&n){const e=s.$implicit,i=t.XpG(4);
1t.Y8G("entityType",i.groupType.LOCATION)("entity",i.fences[e])}}function ai(n,s){if(1&n&&t.Z7z(0,si,1,2,"suivo-entity",18,t.fX1),2&n){const e=t.XpG(3);t.Dyx(e.assetData.fences)}}function li(n,s){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"b"),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"td"),t.nrm(6,"suivo-icon",19),t.k0s()()),2&n){const e=t.XpG(3);t.R7$(3),t.JRh(t.bMT(4,3,"trailer.list.accuStatus")),t.R7$(3),t.Y8G("icon",e.accuIcon)("size",26)}}function ri(n,s){if(1&n&&t.nrm(0,"img",17),2&n){const e=t.XpG(3);t.Y8G("src","../protected/common/code/view.png?code="+e.assetData.code,t.B4B)}}function ci(n,s){if(1&n&&(t.j41(0,"div",5)(1,"div",13),t.nrm(2,"suivo-avatar",14),t.k0s(),t.j41(3,"div",15)(4,"div",16)(5,"table")(6,"tr")(7,"td")(8,"b"),t.EFF(9),t.nI1(10,"translate"),t.k0s()(),t.j41(11,"td"),t.EFF(12),t.k0s()(),t.nVh(13,ni,8,5,"tr"),t.j41(14,"tr")(15,"td")(16,"b"),t.EFF(17),t.nI1(18,"translate"),t.k0s(),t.nVh(19,ii,2,1),t.k0s(),t.j41(20,"td"),t.nVh(21,oi,3,4,"span"),t.nVh(22,ai,2,0),t.k0s()(),t.nVh(23,li,7,5,"tr"),t.k0s()()(),t.j41(24,"div",13),t.nVh(25,ri,1,1,"img",17),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(2),t.Y8G("format",e.avatarFormat.MEDIUM)("fileName",e.avatarUrls[e.avatarFormat.MEDIUM])("category",e.unitCategory[e.assetData.category])("type",e.groupType.UNIT)("hoverFormat",e.avatarFormat.LARGE)("hoverFileName",e.avatarUrls[e.avatarFormat.LARGE]),t.R7$(7),t.JRh(t.bMT(10,15,"allpages.type")),t.R7$(3),t.JRh(e.assetData.entityType),t.R7$(),t.vxM(e.assetData.location&&e.locations[e.assetData.location]?13:-1),t.R7$(4),t.JRh(t.bMT(18,17,"allpages.location")),t.R7$(2),t.vxM(e.locationTimestamp?19:-1),t.R7$(2),t.vxM(e.assetData.address&&!e.assetData.fences?21:-1),t.R7$(),t.vxM(e.assetData.fences?22:-1),t.R7$(),t.vxM(e.assetData.batteryVisualisation?23:-1),t.R7$(2),t.vxM(e.assetData.code?25:-1)}}function pi(n,s){1&n&&(t.j41(0,"span"),t.EFF(1,"?"),t.k0s())}function ui(n,s){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"b"),t.EFF(3),t.nVh(4,pi,2,0,"span"),t.k0s()(),t.j41(5,"td"),t.nrm(6,"attribute-value",20),t.k0s()()),2&n){const e=s.$implicit;t.R7$(3),t.JRh(e.name),t.R7$(),t.vxM("BOOLEAN"===e.type?4:-1),t.R7$(2),t.Y8G("data",e.value)("customFieldType",e.type)}}function di(n,s){if(1&n&&(t.j41(0,"div",6)(1,"div",16)(2,"table"),t.Z7z(3,ui,7,4,"tr",null,t.fX1),t.k0s()()()),2&n){const e=t.XpG(2);t.R7$(3),t.Dyx(e.attributes)}}function _i(n,s){if(1&n&&t.nrm(0,"event-schedules-summary",7),2&n){const e=t.XpG(2);t.Y8G("eventSchedules",e.assetData.eventSchedules)}}function mi(n,s){if(1&n){const e=t.RV6();t.j41(0,"asset-transfers",21),t.bIt("onTransferOpen",function(o){l.eBV(e);const a=t.XpG(2);return l.Njj(a.toggleTransferPopup(o))}),t.k0s()}if(2&n){const e=t.XpG(2);t.Y8G("assetId",e.unitId)}}function hi(n,s){if(1&n&&t.nrm(0,"suivo-entity",18),2&n){const e=t.XpG().$implicit,i=t.XpG(3);t.Y8G("entityType",i.groupType[i.locations[e.costStockLocation].group])("entity",i.locations[e.costStockLocation])}}function gi(n,s){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td"),t.nVh(6,hi,1,2,"suivo-entity",18),t.k0s(),t.j41(7,"td"),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.j41(10,"td"),t.EFF(11),t.k0s()()),2&n){const e=s.$implicit,i=t.XpG(3);t.R7$(2),t.JRh(e.timeIndicator.date),t.R7$(2),t.JRh(e.user),t.R7$(2),t.vxM(i.assetData.location?6:-1),t.R7$(2),t.JRh(t.bMT(9,5,"assets.inventory."+e.state.toLowerCase())),t.R7$(3),t.JRh(e.comment)}}function Ci(n,s){if(1&n&&(t.j41(0,"table",9)(1,"thead")(2,"tr")(3,"th"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"th"),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.j41(9,"th"),t.EFF(10),t.nI1(11,"translate"),t.k0s(),t.j41(12,"th"),t.EFF(13),t.nI1(14,"translate"),t.k0s(),t.j41(15,"th"),t.EFF(16),t.nI1(17,"translate"),t.k0s()()(),t.j41(18,"tbody"),t.Z7z(19,gi,12,7,"tr",null,t.fX1),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(4),t.JRh(t.bMT(5,5,"allpages.date")),t.R7$(3),t.JRh(t.bMT(8,7,"settings.userManagement.user")),t.R7$(3),t.JRh(t.bMT(11,9,"assets.inventory.location")),t.R7$(3),t.JRh(t.bMT(14,11,"allpages.comment")),t.R7$(3),t.JRh(t.bMT(17,13,"allpages.state")),t.R7$(3),t.Dyx(e.assetData.inventories)}}function fi(n,s){1&n&&t.nrm(0,"i",22)}function vi(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG().$implicit;t.R7$(),t.JRh(null==e.dateResolved?null:e.dateResolved.date)}}function bi(n,s){if(1&n&&t.nrm(0,"attachment-link",23),2&n){const e=s.$implicit,i=t.XpG(2).$implicit;t.Y8G("filename",i.attachments[e])("guid",e)}}function Ti(n,s){if(1&n&&t.Z7z(0,bi,1,2,"attachment-link",23,t.fX1),2&n){const e=t.XpG().$implicit,i=t.XpG(3);t.Dyx(i.objectKeys(e.attachments))}}function Oi(n,s){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td"),t.EFF(6),t.k0s(),t.j41(7,"td"),t.nVh(8,fi,1,0,"i",22),t.nVh(9,vi,2,1,"span"),t.k0s(),t.j41(10,"td"),t.nVh(11,Ti,2,0),t.k0s()()),2&n){const e=s.$implicit;t.R7$(2),t.JRh(e.description),t.R7$(2),t.JRh(e.timeIndicator.date),t.R7$(2),t.JRh(e.cost),t.R7$(2),t.vxM(e.resolved?-1:8),t.R7$(),t.vxM(e.resolved?9:-1),t.R7$(2),t.vxM(e.attachments?11:-1)}}function Mi(n,s){if(1&n&&(t.j41(0,"table",10)(1,"thead")(2,"tr")(3,"th"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"th"),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.j41(9,"th"),t.EFF(10),t.nI1(11,"translate"),t.k0s(),t.j41(12,"th"),t.EFF(13),t.nI1(14,"translate"),t.k0s(),t.j41(15,"th"),t.EFF(16),t.nI1(17,"translate"),t.k0s()()(),t.j41(18,"tbody"),t.Z7z(19,Oi,12,6,"tr",null,t.fX1),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(4),t.JRh(t.bMT(5,5,"allpages.description")),t.R7$(3),t.JRh(t.bMT(8,7,"allpages.date")),t.R7$(3),t.JRh(t.bMT(11,9,"fuelEconomy.chart.cost")),t.R7$(3),t.JRh(t.bMT(14,11,"assets.damage.resolved")),t.R7$(3),t.JRh(t.bMT(17,13,"support.attachments")),t.R7$(3),t.Dyx(e.assetData.damages)}}function xi(n,s){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"b"),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"td"),t.nrm(6,"suivo-entity",24),t.k0s()()),2&n){const e=t.XpG(4);t.R7$(3),t.JRh(t.bMT(4,4,"allpages.contact")),t.R7$(3),t.Y8G("entityType",e.groupType.PERSON)("requestSummaryOnClick",!0)("entity",t.l_i(6,Hn,e.assetData.contactId,e.assetData.contactName))}}function Pi(n,s){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"b"),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"td"),t.EFF(6),t.k0s()()),2&n){const e=t.XpG(4);t.R7$(3),t.JRh(t.bMT(4,2,"allpages.name")),t.R7$(3),t.JRh(e.assetData.contactName)}}function yi(n,s){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"b"),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"td"),t.EFF(6),t.k0s()()),2&n){const e=t.XpG(4);t.R7$(3),t.JRh(t.bMT(4,2,"allpages.form.email")),t.R7$(3),t.JRh(e.assetData.contactEmail)}}function ki(n,s){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"b"),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"td"),t.EFF(6),t.k0s()()),2&n){const e=t.XpG(4);t.R7$(3),t.JRh(t.bMT(4,2,"allpages.form.telephone")),t.R7$(3),t.JRh(e.assetData.contactTelephone)}}function Fi(n,s){if(1&n&&(t.j41(0,"div",16)(1,"table"),t.nVh(2,xi,7,9,"tr"),t.nVh(3,Pi,7,4,"tr"),t.nVh(4,yi,7,4,"tr"),t.nVh(5,ki,7,4,"tr"),t.k0s()()),2&n){const e=t.XpG(3);t.R7$(2),t.vxM(e.assetData.contactId?2:-1),t.R7$(),t.vxM(e.assetData.contactName&&!e.assetData.contactId?3:-1),t.R7$(),t.vxM(e.assetData.contactEmail?4:-1),t.R7$(),t.vxM(e.assetData.contactTelephone?5:-1)}}function Si(n,s){if(1&n&&t.nVh(0,Fi,6,4,"div",16),2&n){const e=t.XpG(2);t.vxM(e.assetData.contactName||e.assetData.contactEmail||e.assetData.contactTelephone||e.assetData.contactId?0:-1)}}function Ii(n,s){if(1&n){const e=t.RV6();t.j41(0,"h3"),t.EFF(1),t.nVh(2,zn,1,0,"i",1),t.k0s(),t.j41(3,"ul",2)(4,"li",3)(5,"a",4),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.activeTab="GENERAL")}),t.EFF(6),t.nI1(7,"translate"),t.k0s()(),t.nVh(8,Jn,4,6,"li",3),t.nVh(9,Kn,4,6,"li",3),t.nVh(10,Zn,4,6,"li",3),t.nVh(11,Wn,4,6,"li",3),t.nVh(12,qn,4,6,"li",3),t.nVh(13,Qn,4,6,"li",3),t.k0s(),t.nVh(14,ci,26,19,"div",5),t.nVh(15,di,5,0,"div",6),t.nVh(16,_i,1,1,"event-schedules-summary",7),t.nVh(17,mi,1,1,"asset-transfers",8),t.nVh(18,Ci,21,15,"table",9),t.nVh(19,Mi,21,15,"table",10),t.nVh(20,Si,1,1)}if(2&n){const e=t.XpG();t.R7$(),t.SpI(" ",e.assetData.name," "),t.R7$(),t.vxM(e.hideCloseButton?-1:2),t.R7$(2),t.Y8G("ngClass",t.eq3(19,z,"GENERAL"===e.activeTab)),t.R7$(2),t.JRh(t.bMT(7,17,"allpages.general")),t.R7$(2),t.vxM(e.assetData.customFields&&0!=e.objectKeys(e.assetData.customFields).length?8:-1),t.R7$(),t.vxM(e.assetData.eventSchedules?9:-1),t.R7$(),t.vxM(e.assetData.hasTransfers?10:-1),t.R7$(),t.vxM(e.assetData.inventories?11:-1),t.R7$(),t.vxM(e.assetData.damages?12:-1),t.R7$(),t.vxM(e.assetData.contactName||e.assetData.contactEmail||e.assetData.contactTelephone||e.assetData.contactId?13:-1),t.R7$(),t.vxM("GENERAL"===e.activeTab?14:-1),t.R7$(),t.vxM(e.assetData.customFields&&0!=e.objectKeys(e.assetData.customFields).length&&"CUSTOM_FIELDS"===e.activeTab?15:-1),t.R7$(),t.vxM(e.assetData.eventSchedules&&"EVENTS"===e.activeTab?16:-1),t.R7$(),t.vxM(e.assetData.hasTransfers&&"TRANSFERS"===e.activeTab?17:-1),t.R7$(),t.vxM(e.assetData.inventories&&"INVENTORIES"===e.activeTab?18:-1),t.R7$(),t.vxM("DAMAGES"===e.activeTab?19:-1),t.R7$(),t.vxM("RESPONSIBLE_CONTACT"===e.activeTab?20:-1)}}function Ri(n,s){if(1&n){const e=t.RV6();t.j41(0,"transfer-popup",25),t.bIt("onClosePopup",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.toggleTransferPopup())}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("transferId",e.transferPopup.transfer)}}let jt=(()=>{class n{set unitId(e){this._unitId=e,(0,m.hX)(e)||this.getUnitData(e)}constructor(e,i){this.assetsService=e,this.attributesService=i,this.closeDetail=new t.bkB,this.objectKeys=Object.keys,this.avatarFormat=L.Z,this.groupType=_.MH,this.unitCategory=_.SB,this.avatarUrls={},this.transferPopup={show:!1,transfer:null}}setAttributes(){this.activeTab="CUSTOM_FIELDS";let e=[];for(let i in this.assetData.customFields)e.push({name:this.definitions[i].name,order:this.definitions[i].order,type:this.definitions[i].type,value:this.assetData.customFields[i]});this.attributes=this.attributesService.sortAttributes(e)}toggleTransferPopup(e){null!=e?(this.transferPopup.transfer=e,this.transferPopup.show=!0):(this.transferPopup.transfer=null,this.transferPopup.show=!1)}getAvatarUrl(e){return this.assetData&&this.assetData.avatars?this.assetData.avatars[L.Z[e]]:null}getAccuIcon(){return"accu-"+this.assetData.batteryVisualisation.toLowerCase().replace("_","-")}getUnitData(e){this.assetsService.getAssetDetail(e).subscribe(i=>{this.activeTab="GENERAL",this.assetData=i.asset,this.fences=i.fences,this.locations=i.locations,this.definitions=i.definitions,this.users=i.users,this.locationTimestamp=i.locationTimestamp,this.assetData.batteryVisualisation&&(this.accuIcon=this.getAccuIcon());for(let o in L.Z)this.avatarUrls[o]=this.getAvatarUrl(L.Z[o])})}get unitId(){return this._unitId}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(x.T),t.rXU(me.x))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["asset-detail"]],inputs:{unitId:"unitId",hideCloseButton:"hideCloseButton",costStockLocation:"costStockLocation"},outputs:{closeDetail:"closeDetail"},standalone:!1,decls:2,vars:2,consts:[[3,"transferId"],[1,"float-end","fas","fa-times","action"],[1,"nav","nav-tabs"],[1,"nav-item",3,"ngClass"],[1,"nav-link",3,"click"],[1,"row","customTableContainer"],[1,"customTableContainer"],[3,"eventSchedules"],[3,"assetId"],[1,"table"],[1,"table","table-hover"],[1,"float-end","fas","fa-times","action",3,"click"],[3,"click"],[1,"col-md-3","col-sm-12"],[1,"float-start",3,"format","fileName","category","type","hoverFormat","hoverFileName"],[1,"col-md-6","col-sm-12"],[1,"customTable"],["width","100",1,"float-end",3,"src"],[3,"entityType","entity"],[3,"icon","size"],[3,"data","customFieldType"],[3,"onTransferOpen","assetId"],[1,"fas","fa-times"],[3,"filename","guid"],[3,"entityType","requestSummaryOnClick","entity"],[3,"onClosePopup","transferId"]],template:function(i,o){1&i&&(t.nVh(0,Ii,21,21),t.nVh(1,Ri,1,1,"transfer-popup",0)),2&i&&(t.vxM(o.assetData?0:-1),t.R7$(),t.vxM(o.transferPopup.show?1:-1))},dependencies:[p.YU,$.F,lt.T,Ft.$,ht.T,Ge,ot.Z,Ne,Mt,b.D],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--colors-general-white);padding:10px;margin-top:10px}[_nghost-%COMP%] .fa-times[_ngcontent-%COMP%]{color:var(--colors-general-soft-grey);cursor:default}
1[_nghost-%COMP%] suivo-avatar[_ngcontent-%COMP%]{margin-top:10px}[_nghost-%COMP%] table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none!important}[_nghost-%COMP%] > [_ngcontent-%COMP%]:last-child{min-height:0;flex:1;overflow:auto}[_nghost-%COMP%] .customTable[_ngcontent-%COMP%]{margin-top:10px;display:block;height:calc(100% - 10px);overflow-y:auto}[_nghost-%COMP%] .customTable[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:2px 10px 2px 0;vertical-align:top}[_nghost-%COMP%] .customTable[_ngcontent-%COMP%] td[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{padding-right:20px}[_nghost-%COMP%] .nav[_ngcontent-%COMP%]{margin:10px 0 0}[_nghost-%COMP%] .nav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:block}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-top:0}[_nghost-%COMP%] h3[_ngcontent-%COMP%] .fa-times[_ngcontent-%COMP%]{cursor:pointer;padding:5px}"]})}}return n})();var V=u(76050);const Li=["columnConfigButton"],Dt=n=>({active:n});function Ai(n,s){1&n&&t.nrm(0,"li")}function Ei(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",8),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(2);return l.Njj(a.onTypeSelect(+o))}),t.j41(1,"a",9),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=s.$implicit,i=t.XpG(2);t.Y8G("ngClass",t.eq3(4,Dt,i.selectedType==+e)),t.R7$(2),t.JRh(0!=+e?i.entityTypes[+e]:t.bMT(3,2,"allpages.none"))}}function ji(n,s){if(1&n&&t.Z7z(0,Ei,4,6,"li",7,t.fX1),2&n){const e=t.XpG();t.Dyx(e.objectKeys(e.assets))}}function Di(n,s){if(1&n){const e=t.RV6();t.j41(0,"column-config",19),t.bIt("clickOutside",function(){l.eBV(e);const o=t.XpG(3);return l.Njj(o.onConfigClose())})("closeConfig",function(o){l.eBV(e);const a=t.XpG(3);return l.Njj(a.onConfigClose(o))}),t.k0s()}if(2&n){const e=t.XpG(3);t.Y8G("height",e.columnConfigHeight)("currentIds",e.currentDefinitions[e.selectedType])("availableIds",e.availableDefinitions[e.selectedType])("definitions",e.stringDefinitions)("delayClickOutsideInit",!0)}}function wi(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",13)(1,"button",17,0),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.onColumnConfig())}),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.nVh(5,Di,1,5,"column-config",18),t.k0s()}if(2&n){const e=t.XpG(2);t.R7$(3),t.SpI(" ",t.bMT(4,2,"periodReports.form.design.columns")," "),t.R7$(2),t.vxM(e.showConfig?5:-1)}}function Gi(n,s){if(1&n&&(t.j41(0,"th"),t.EFF(1),t.k0s()),2&n){const e=s.$implicit,i=t.XpG(2);t.R7$(),t.SpI(" ",i.definitions[e].name," ")}}function $i(n,s){if(1&n&&t.nrm(0,"attribute-value",22),2&n){const e=t.XpG().$implicit,i=t.XpG(2).$implicit,o=t.XpG(2);t.Y8G("data",i.customFields[e])("customFieldType",o.definitions[e].type)}}function Vi(n,s){if(1&n&&(t.j41(0,"td"),t.nVh(1,$i,1,2,"attribute-value",22),t.k0s()),2&n){const e=s.$implicit,i=t.XpG(2).$implicit;t.R7$(),t.vxM(i.customFields&&i.customFields[e]?1:-1)}}function Ni(n,s){if(1&n){const e=t.RV6();t.j41(0,"tr",20),t.bIt("click",function(){l.eBV(e);const o=t.XpG().$implicit,a=t.XpG(2);return l.Njj(a.openAssetDetail(o.unit))}),t.j41(1,"td"),t.nrm(2,"span",21),t.nI1(3,"highlight"),t.k0s(),t.j41(4,"td")(5,"span"),t.EFF(6),t.k0s()(),t.Z7z(7,Vi,2,1,"td",null,t.fX1),t.k0s()}if(2&n){const e=t.XpG().$implicit,i=t.XpG(2);t.R7$(2),t.Y8G("innerHTML",t.i5U(3,2,e.name,i.searchTerm&&i.searchTerm.length>=3?i.searchTerm:null),t.npT),t.R7$(4),t.JRh(null==i.assetStatuses[e.status]?null:i.assetStatuses[e.status].name),t.R7$(),t.Dyx(i.currentDefinitions[i.selectedType])}}function Xi(n,s){if(1&n&&t.nVh(0,Ni,9,5,"tr"),2&n){const e=s.$implicit,i=s.$index,o=t.XpG(2);t.vxM(o.isVisible(e.name)&&o.visibleEntities>=i?0:-1)}}function Bi(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",4)(1,"div",10)(2,"form",11),t.nrm(3,"search-field",12),t.k0s(),t.nVh(4,wi,6,4,"div",13),t.k0s(),t.j41(5,"div",14),t.bIt("scrolled",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.addMoreEntities())}),t.j41(6,"table",15)(7,"thead")(8,"tr",16)(9,"th"),t.EFF(10),t.nI1(11,"translate"),t.k0s(),t.j41(12,"th"),t.EFF(13),t.nI1(14,"translate"),t.k0s(),t.Z7z(15,Gi,2,1,"th",null,t.fX1),t.k0s()(),t.j41(17,"tbody"),t.Z7z(18,Xi,1,1,null,null,t.fX1),t.k0s()()()()}if(2&n){const e=t.XpG();t.R7$(2),t.Y8G("formGroup",e.searchForm),t.R7$(2),t.vxM(e.assets&&!e.selectedAsset?4:-1),t.R7$(),t.Y8G("scrollWindow",!1),t.R7$(5),t.JRh(t.bMT(11,5,"allpages.name")),t.R7$(3),t.JRh(t.bMT(14,7,"allpages.status")),t.R7$(2),t.Dyx(e.currentDefinitions[e.selectedType]),t.R7$(3),t.Dyx(e.assets[e.selectedType])}}function Ui(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",8),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(2);return l.Njj(a.openAssetDetail(o.unit))}),t.j41(1,"a",9),t.EFF(2),t.k0s()()}if(2&n){const e=s.$implicit,i=t.XpG(2);t.Y8G("ngClass",t.eq3(2,Dt,i.selectedAsset==e.unit)),t.R7$(2),t.JRh(e.name)}}function Yi(n,s){if(1&n&&(t.j41(0,"div",2)(1,"ul",3),t.Z7z(2,Ui,3,4,"li",7,t.fX1),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.Dyx(e.assets[e.selectedType])}}function Hi(n,s){if(1&n){const e=t.RV6();t.j41(0,"asset-detail",23),t.bIt("closeDetail",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.closeAssetDetail())}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("unitId",e.selectedAsset)("costStockLocation",e.costStockLocation)}}let zi=(()=>{class n{set definitions(e){this._definitions=e,this.stringDefinitions=this.getDefinitions()}set assets(e){this._assets=e,this.selectedAsset=null,this.assets&&(this.selectedType=+Object.keys(this.assets)[0],this.onTypeSelection.emit(this.selectedType))}constructor(e){this.assetsService=e,this.visibleEntities=20,this.objectKeys=Object.keys,this.onAssetSelection=new t.bkB,this.onTypeSelection=new t.bkB}ngOnInit(){this.searchForm=new c.J3({searchTerm:new c.hs})}openAssetDetail(e){this.selectedAsset=e,this.onAssetSelection.emit(e)}closeAssetDetail(){this.selectedAsset=null,this.onAssetSelection.emit(null)}onColumnConfig(){this.showConfig=!0,this.columnConfigHeight=window.innerHeight-this.columnConfigBtn.nativeElement.getBoundingClientRect().top-60}onConfigClose(e){e&&this.assetsService.saveAssetColumnConfig(this.selectedType,e).subscribe(i=>{i&&(this.currentDefinitions[this.selectedType]=e)}),this.showConfig=!1}getDefinitions(){let e={};for(let i in this.definitions)e[i]=this.definitions[i].name;return e}isVisible(e){return!(this.searchTerm&&this.searchTerm.length>=3)||e.toLowerCase().includes(this.searchTerm.toLowerCase())}onTypeSelect(e){this.selectedType=e,this.selectedAsset=null,this.onTypeSelection.emit(e)}addMoreEntities(){this.visibleEntities<this.assets[this.selectedType].length&&(this.visibleEntities+=5
1)}get assets(){return this._assets}get searchTerm(){return this.searchForm.get("searchTerm").value}get definitions(){return this._definitions}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(x.T))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["asset-list"]],viewQuery:function(i,o){if(1&i&&t.GBs(Li,5),2&i){let a;t.mGM(a=t.lsd())&&(o.columnConfigBtn=a.first)}},inputs:{assetStatuses:"assetStatuses",entityTypes:"entityTypes",currentDefinitions:"currentDefinitions",availableDefinitions:"availableDefinitions",definitions:"definitions",costStockLocation:"costStockLocation",assets:"assets"},outputs:{onAssetSelection:"onAssetSelection",onTypeSelection:"onTypeSelection"},standalone:!1,decls:9,vars:7,consts:[["columnConfigButton",""],[1,"row","overview"],[1,"col-2","list-container"],[1,"nav","nav-pills","flex-column"],[1,"col-10","assetListTable"],[1,"col-8","list-container"],[3,"unitId","costStockLocation"],[3,"ngClass"],[3,"click","ngClass"],[1,"nav-link"],[1,"d-flex","justify-content-end","mb-3"],[1,"me-2",3,"formGroup"],["formControlName","searchTerm"],[1,"float-end","position-relative"],["infiniteScroll","",1,"table-scroll",3,"scrolled","scrollWindow"],[1,"table","table-hover","main-table"],[1,"listHeader"],[1,"btn","btn-sm",2,"margin","0",3,"click"],[3,"height","currentIds","availableIds","definitions","delayClickOutsideInit"],[3,"clickOutside","closeConfig","height","currentIds","availableIds","definitions","delayClickOutsideInit"],[3,"click"],[3,"innerHTML"],[3,"data","customFieldType"],[3,"closeDetail","unitId","costStockLocation"]],template:function(i,o){1&i&&(t.j41(0,"div",1)(1,"div",2)(2,"ul",3),t.nVh(3,Ai,1,0,"li"),t.nVh(4,ji,2,0),t.k0s()(),t.nVh(5,Bi,20,9,"div",4),t.nVh(6,Yi,4,0,"div",2),t.j41(7,"div",5),t.nVh(8,Hi,1,2,"asset-detail",6),t.k0s()()),2&i&&(t.AVh("noList",o.selectedAsset),t.R7$(3),t.vxM(o.entityTypes?-1:3),t.R7$(),t.vxM(o.entityTypes?4:-1),t.R7$(),t.vxM(o.selectedAsset?-1:5),t.R7$(),t.vxM(o.selectedAsset?6:-1),t.R7$(2),t.vxM(o.selectedAsset?8:-1))},dependencies:[p.YU,ht.T,de,gt.z,Y.q,c.qT,c.BC,c.cb,c.j4,c.JD,Q.D,jt,b.D,V.v],styles:[".assetList[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{cursor:pointer}.nav[_ngcontent-%COMP%]{margin-top:10px}.nav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{cursor:pointer}.overview.noList[_ngcontent-%COMP%]{height:100%}.overview[_ngcontent-%COMP%] .list-container[_ngcontent-%COMP%]{height:100%;overflow-y:auto}.assetListTable[_ngcontent-%COMP%]{height:100%;margin-top:10px}.assetListTable[_ngcontent-%COMP%] .table-scroll[_ngcontent-%COMP%]{position:relative;width:100%;height:100%;z-index:1;margin:auto;overflow:auto}.assetListTable[_ngcontent-%COMP%] .table-scroll[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{border-spacing:0}.assetListTable[_ngcontent-%COMP%] .table-scroll[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-bottom:1px solid var(--colors-general-soft-grey);position:sticky;top:0}.assetListTable[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:var(--colors-general-white);min-width:75px;z-index:2;border-top:none}.assetListTable[_ngcontent-%COMP%] .table-hover[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{cursor:pointer}asset-detail[_ngcontent-%COMP%]{border-left:1px solid var(--colors-general-soft-grey);height:100%;margin-top:0;padding-top:15px;padding-left:15px}"]})}}return n})();var B=function(n){return n.OPEN="OPEN",n.DONE="DONE",n}(B||{}),ct=function(n){return n.EXPECTED="EXPECTED",n.NOT_EXPECTED="NOT_EXPECTED",n.NOT_FOUND="NOT_FOUND",n}(ct||{});let wt=(()=>{class n extends vt.S{static{this.auditDetailUrl="../protected/audit/detail.json"}static{this.auditSaveStateUrl="../protected/audit/saveAuditState.json"}static{this.auditExportUrl="../protected/audit/export.do"}constructor(e,i){super(n),this.http=e,this.globalHelper=i}getAuditDetail(e){return this.http.get(n.auditDetailUrl,{params:{id:e}})}saveAuditState(e,i){return this.http.post(n.auditSaveStateUrl,{auditId:e,auditStatus:i})}exportAudit(e){this.http.post(n.auditExportUrl,e,{observe:"response",responseType:"blob"}).subscribe(i=>{this.globalHelper.downloadFile(i.body,i.status,i.headers)})}static{this.\u0275fac=function(i){return new(i||n)(l.KVO(bt.Qq),l.KVO(K.$))}}static{this.\u0275prov=l.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),Gt=(()=>{class n{constructor(){this.color="var(--colors-attention-primary)"}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["progress-icon"]],inputs:{percentage:"percentage",color:"color"},standalone:!1,decls:2,vars:2,consts:[["width","12","height","12","viewBox","0 0 120 120"],["cx","60","cy","60","r","54","fill","none","stroke-width","20","pathLength","100",1,"percent"]],template:function(i,o){1&i&&(l.qSk(),t.j41(0,"svg",0),t.nrm(1,"circle",1),t.k0s()),2&i&&(t.R7$(),t.BMQ("stroke-dashoffset","calc(100 - "+o.percentage+")")("stroke",o.color))},styles:["svg[_ngcontent-%COMP%]{transform:rotate(-90deg)}.percent[_ngcontent-%COMP%]{stroke-dasharray:100}"]})}}return n})();function Ji(n,s){if(1&n&&(t.nrm(0,"span",9),t.nI1(1,"highlight")),2&n){const e=s.data;t.Y8G("innerHTML",t.i5U(1,1,null==e.startDate?null:e.startDate.date,
1s.highlightValue),t.npT)}}function Ki(n,s){1&n&&(t.nrm(0,"span",9),t.nI1(1,"highlight")),2&n&&t.Y8G("innerHTML",t.i5U(1,1,s.data.name,s.highlightValue),t.npT)}function Zi(n,s){1&n&&(t.nrm(0,"span",9),t.nI1(1,"highlight")),2&n&&t.Y8G("innerHTML",t.i5U(1,1,s.data.expectedItems,s.highlightValue),t.npT)}function Wi(n,s){1&n&&(t.nrm(0,"span",9),t.nI1(1,"highlight")),2&n&&t.Y8G("innerHTML",t.i5U(1,1,s.data.unexpectedItems,s.highlightValue),t.npT)}function qi(n,s){1&n&&(t.nrm(0,"span",9),t.nI1(1,"highlight")),2&n&&t.Y8G("innerHTML",t.i5U(1,1,s.data.confirmedItems,s.highlightValue),t.npT)}function Qi(n,s){if(1&n&&(t.nrm(0,"span",9),t.nI1(1,"highlight")),2&n){const e=s.data,i=s.highlightValue,o=t.XpG();t.AVh("itemsWarning",e.status==o.AuditStatus.DONE&&e.unconfirmedItems>0),t.Y8G("innerHTML",t.i5U(1,3,e.unconfirmedItems,i),t.npT)}}function to(n,s){1&n&&(t.EFF(0),t.nI1(1,"translate")),2&n&&t.SpI(" ",t.bMT(1,1,"reservations.status.DONE")," ")}function eo(n,s){if(1&n&&(t.j41(0,"div",10),t.nrm(1,"progress-icon",11),t.j41(2,"span",12),t.EFF(3),t.k0s()()),2&n){const e=t.XpG().data;t.R7$(),t.Y8G("percentage",e.auditPercentage),t.R7$(2),t.SpI("",e.auditPercentage,"%")}}function no(n,s){if(1&n&&(t.j41(0,"span"),t.nVh(1,to,2,3),t.nVh(2,eo,4,2,"div",10),t.k0s()),2&n){const e=s.data,i=t.XpG();t.HbH(t.VkB("cellContent auditStatus ",e.status)),t.R7$(),t.vxM(e.status==i.AuditStatus.DONE?1:-1),t.R7$(),t.vxM(e.status==i.AuditStatus.OPEN?2:-1)}}function io(n,s){if(1&n){const e=t.RV6();t.j41(0,"a",20),t.nI1(1,"translate"),t.bIt("click",function(){l.eBV(e);const o=t.XpG().data,a=t.XpG();return l.Njj(a.showDetail(o.id))}),t.nrm(2,"i",21),t.k0s()}2&n&&t.Y8G("title",t.bMT(1,1,"alerts.form.country.viewDetail"))}function oo(n,s){if(1&n){const e=t.RV6();t.j41(0,"a",19),t.bIt("click",function(){l.eBV(e);const o=t.XpG().data,a=t.XpG();return l.Njj(a.toggleAuditState(o.status==a.AuditStatus.OPEN?a.AuditStatus.DONE:a.AuditStatus.OPEN,o.id))}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&n){const e=t.XpG().data,i=t.XpG();t.R7$(),t.SpI(" ",t.bMT(2,1,e.status==i.AuditStatus.OPEN?"assets.costStockLocation.closeAudit":"assets.costStockLocation.audit.reopen")," ")}}function so(n,s){if(1&n){const e=t.RV6();t.nVh(0,io,3,3,"a",13),t.j41(1,"div",14)(2,"a",15),t.nI1(3,"translate"),t.nrm(4,"i",16),t.k0s(),t.j41(5,"ul",17)(6,"li"),t.nVh(7,oo,3,3,"a",18),t.k0s(),t.j41(8,"li")(9,"a",19),t.bIt("click",function(){const o=l.eBV(e).data,a=t.XpG();return l.Njj(a.exportAudit(o.id))}),t.EFF(10),t.nI1(11,"translate"),t.k0s()()()()}if(2&n){const e=s.data,i=s.highlighted,o=t.XpG();t.vxM(i?0:-1),t.R7$(2),t.Y8G("id",t.VkB("auditActions_",e.id))("title",t.bMT(3,7,"allpages.actions")),t.R7$(3),t.BMQ("aria-labelledby","auditActions_"+e.id),t.R7$(2),t.vxM(o.permissions.INVENTORY_MODIFY?7:-1),t.R7$(3),t.SpI(" ",t.bMT(11,9,"assets.costStockLocation.audit.export")," ")}}let ao=(()=>{class n{constructor(e,i,o,a){this.translation=e,this.auditService=i,this.listDataHelper=o,this.permissionService=a,this.onShowDetail=new t.bkB,this.listKey=H.y4.AUDIT_OVERVIEW,this.AuditStatus=B,this.permissions={INVENTORY_MODIFY:this.permissionService.get("RESERVATION_MODULE_MANAGEMENT_ACCESS")}}ngOnInit(){this.listFilter={filterIds:[this.locationId]}}showDetail(e){this.onShowDetail.emit(e)}toggleAuditState(e,i){confirm(this.translation.get(e==B.DONE?"assets.costStockLocation.audit.close.confirm":"assets.costStockLocation.audit.reopen.confirm"))&&this.auditService.saveAuditState(i,e).subscribe(o=>{this.listDataHelper.triggerListAction(this.listKey,{action:Ot.fo.REFRESH,keepParameters:!0})})}exportAudit(e){this.auditService.exportAudit(e)}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(f.L),t.rXU(wt),t.rXU(rt.T),t.rXU(q.n))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["audit-list"]],inputs:{locationId:"locationId"},outputs:{onShowDetail:"onShowDetail"},standalone:!1,decls:9,vars:2,consts:[[1,"p-2",3,"externalFilter","listKey"],["cellTemplate","AUDIT_STARTED_ON"],["cellTemplate","AUDIT_NAME"],["cellTemplate","AUDIT_EXPECTED_ITEMS"],["cellTemplate","AUDIT_UNEXPECTED_ITEMS"],["cellTemplate","AUDIT_CONFIRMED_ITEMS"],["cellTemplate","AUDIT_UNCONFIRMED_ITEMS"],["cellTemplate","AUDIT_STATUS"],["cellTemplate","AUDIT_ACTIONS"],[1,"cell
1Content",3,"innerHTML"],[1,"d-flex"],[3,"percentage"],[1,"ms-1"],[1,"listAction",3,"title"],[1,"dropdown","float-end"],["data-bs-toggle","dropdown","aria-haspopup","true","aria-expanded","true",1,"listAction","float-end",3,"id","title"],["area-hidden","true",1,"fas","fa-ellipsis-v","fa-lg","action"],["role","menu",1,"dropdown-menu","dropdown-menu-end"],["role","menuitem","tabindex","-1",1,"dropdown-item"],["role","menuitem","tabindex","-1",1,"dropdown-item",3,"click"],[1,"listAction",3,"click","title"],[1,"fa-solid","fa-magnifying-glass","action","fa-lg"]],template:function(i,o){1&i&&(t.nrm(0,"divided-list",0),t.DNE(1,Ji,2,4,"ng-template",1)(2,Ki,2,4,"ng-template",2)(3,Zi,2,4,"ng-template",3)(4,Wi,2,4,"ng-template",4)(5,qi,2,4,"ng-template",5)(6,Qi,2,6,"ng-template",6)(7,no,3,5,"ng-template",7)(8,so,12,11,"ng-template",8)),2&i&&t.Y8G("externalFilter",o.listFilter)("listKey",o.listKey)},dependencies:[tt.i,Gt,et.v,b.D,V.v],styles:[".auditStatus.OPEN[_ngcontent-%COMP%]{color:var(--colors-attention-primary)}.auditStatus.DONE[_ngcontent-%COMP%]{color:var(--colors-success-text)}.itemsWarning[_ngcontent-%COMP%]{color:var(--colors-error-text)}"],changeDetection:0})}}return n})();var lo=u(51696);const xt=n=>({active:n});let ro=(()=>{class n{constructor(e){this.listDataHelper=e,this.listKey=H.y4.AUDIT_ITEMS,this.status=ct.NOT_FOUND,this.AuditItemStatus=ct}ngOnInit(){this.onStatusChange(ct.NOT_FOUND)}onStatusChange(e){this.listDataHelper.resetDataCache(this.listKey),this.status=e,this.listFilter={additionalFilter:e,filterIds:[this.auditId]}}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(rt.T))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["audit-unit-list"]],viewQuery:function(i,o){if(1&i&&t.GBs(lo.f,5),2&i){let a;t.mGM(a=t.lsd())&&(o.wizardTabs=a.first)}},inputs:{auditId:"auditId"},standalone:!1,decls:15,vars:20,consts:[[1,"nav","nav-tabs","mx-0","mb-3"],[1,"nav-item",3,"ngClass"],[1,"nav-link",3,"click"],[1,"unitList"],[3,"externalFilter","listKey"]],template:function(i,o){1&i&&(t.j41(0,"ul",0)(1,"li",1)(2,"a",2),t.bIt("click",function(){return o.onStatusChange(o.AuditItemStatus.NOT_FOUND)}),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"li",1)(6,"a",2),t.bIt("click",function(){return o.onStatusChange(o.AuditItemStatus.NOT_EXPECTED)}),t.EFF(7),t.nI1(8,"translate"),t.k0s()(),t.j41(9,"li",1)(10,"a",2),t.bIt("click",function(){return o.onStatusChange(o.AuditItemStatus.EXPECTED)}),t.EFF(11),t.nI1(12,"translate"),t.k0s()()(),t.j41(13,"div",3),t.nrm(14,"divided-list",4),t.k0s()),2&i&&(t.R7$(),t.Y8G("ngClass",t.eq3(14,xt,o.status===o.AuditItemStatus.NOT_FOUND)),t.R7$(2),t.SpI(" ",t.bMT(4,8,"assets.costStockLocation.audit.unconfirmed")," "),t.R7$(2),t.Y8G("ngClass",t.eq3(16,xt,o.status===o.AuditItemStatus.NOT_EXPECTED)),t.R7$(2),t.SpI(" ",t.bMT(8,10,"assets.costStockLocation.audit.unexpected")," "),t.R7$(2),t.Y8G("ngClass",t.eq3(18,xt,o.status===o.AuditItemStatus.EXPECTED)),t.R7$(2),t.SpI(" ",t.bMT(12,12,"assets.costStockLocation.audit.confirmed")," "),t.R7$(3),t.Y8G("externalFilter",o.listFilter)("listKey",o.listKey))},dependencies:[p.YU,et.v,b.D],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;min-width:0}[_nghost-%COMP%] .unitList[_ngcontent-%COMP%]{height:100%;min-height:0}"],changeDetection:0})}}return n})();function co(n,s){if(1&n&&t.nrm(0,"suivo-avatar",14),2&n){const e=t.XpG(2);t.Y8G("format",e.AvatarFormat.SMALL)("fileName",e.audit.auditLocation.avatar?e.audit.auditLocation.avatar[e.AvatarFormat.MEDIUM]:null)("type",e.GroupType[e.audit.auditLocation.groupType])("hoverFormat",e.AvatarFormat.LARGE)("hoverFileName",e.audit.auditLocation.avatar?e.audit.auditLocation.avatar[e.AvatarFormat.LARGE]:null)}}function po(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.j41(3,"div",15),t.EFF(4),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",t.bMT(2,2,"allReports.createdBy")," "),t.R7$(3),t.JRh(e.users[e.audit.createdBy])}}function uo(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.j41(3,"div",15),t.EFF(4),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",t.bMT(2,2,"assets.costStockLocation.audit.startedOn")," "),t.R7$(3),t.JRh(e.audit.startDate.date)}}function _o(n,s){if(1&n&&(t.j41(0,"li",15),t.EFF(1),t.k0s()),2&n){const e=s.$implicit,i=t.XpG(3);t.R7$(),t.SpI(" ",i.users[e]," ")}}function mo(n,s){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.nI1(2,"translate"),t.j41(3,"ul"),t.Z7z(4,_o,2,1,"li",15,t.fX1),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",t.bMT(2,1,"assets.costStockLocation.audit.executedBy")," "),t.R7$(3),t.Dyx(e.audit.executedBy)}}function ho(n,s){if(1&n&&t.nrm(0,"progress-icon",17),2&n){const e=t.XpG(2);t.Y8G("percentage",e.audit.auditPercentage)}}function go(n,s){if(1&n){const e=t.RV6();t.j41(0,"button",23),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.toggleAuditState())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",t.bMT(2,1,e.audit.status==e.AuditStatus.OPEN?"assets.costStockLocation.closeAudit":"assets.costStockLocation.audit.reopen")," ")}}function Co(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",7)(1,"div",8)(2,"div",9)(3,"h2",10),t.EFF(4),t.k0s(),t.j41(5,"button",11),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.exportAudit())}),t.nrm(6,"i",12),t.k0s()(),t.j41(7,"div")(8,"div"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.j41(11,"div",13),t.nVh(12,co,1,5,"suivo-avatar",14),t.j41(13,"div",15),t.EFF(14),t.k0s()()(),t.nVh(15,po,5,4,"div"),t.nVh(16,uo,5,4,"div"),t.nVh(17,mo,6,3,"div"),t.j41(18,"div")(19,"div",16),t.nVh(20,ho,1,1,"progress-icon",17),t.j41(21,"span",15),t.EFF(22),t.nI1(23,"translate"),t.k0s(),t.EFF(24),t.k0s(),t.j41(25,"div",18)(26,"span"),t.EFF(27),t.nI1(28,"translate"),t.k0s(),t.j41(29,"span"),t.EFF(30),t.k0s()(),t.j41(31,"div",19)(32,"span"),t.EFF(33),t.nI1(34,"translate"),t.k0s(),t.j41(35,"span"),t.EFF(36),t.k0s()(),t.j41(37,"div",19)(38,"span"),t.EFF(39),t.nI1(40,"translate"),t.k0s(),t.j41(41,"span"),t.EFF(42),t.k0s()(),t.j41(43,"div",19)(44,"span"),t.EFF(45),t.nI1(46,"translate"),t.k0s(),t.j41(47,"span"),t.EFF(48),t.k0s()(),t.nVh(49,go,3,3,"button",20),t.k0s()(),t.j41(50,"div",21),t.nrm(51,"audit-unit-list",22),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(4),t.JRh(e.audit.name),t.R7$(5),t.JRh(t.bMT(10,23,e.audit.auditLocation.groupType==e.GroupType.COST_LOCATION?"assets.costLocation":"assets.stockLocation")),t.R7$(3),t.vxM(e.audit.auditLocation.groupType?12:-1),t.R7$(2),t.JRh(e.audit.auditLocation.location),t.R7$(),t.vxM(e.users&&null!=e.audit&&e.audit.createdBy?15:-1),t.R7$(),t.vxM(e.audit.startDate?16:-1),t.R7$(),t.vxM(e.users&&(null==e.audit.executedBy?null:e.audit.executedBy.length)>0?17:-1),t.R7$(),t.HbH(t.VkB("progressContainer ",e.audit.status)),t.R7$(2),t.vxM(e.audit.status==e.AuditStatus.OPEN&&e.audit.auditPercentage>0?20:-1),t.R7$(2),t.JRh(t.bMT(23,25,e.audit.status==e.AuditStatus.OPEN?"configurableTransfersReport.Status.IN_PROGRESS":"scheduling.execution.finished")),t.R7$(2),t.SpI(" (",e.audit.auditPercentage,"%) "),t.R7$(3),t.JRh(t.bMT(28,27,"assets.costStockLocation.audit.expectedAssets")),t.R7$(3),t.JRh(e.audit.expectedItems),t.R7$(3),t.JRh(t.bMT(34,29,"assets.costStockLocation.audit.confirmed")),t.R7$(3),t.JRh(e.audit.confirmedItems),t.R7$(3),t.JRh(t.bMT(40,31,"assets.costStockLocation.audit.unconfirmed")),t.R7$(3),t.JRh(e.audit.unconfirmedItems),t.R7$(3),t.JRh(t.bMT(46,33,"assets.costStockLocation.audit.unexpected")),t.R7$(3),t.JRh(e.audit.unexpectedItems),t.R7$(),t.vxM(e.permissions.INVENTORY_MODIFY?49:-1),t.R7$(2),t.Y8G("auditId",e.auditId)}}let fo=(()=>{class n{constructor(e,i,o,a,r){this.auditService=e,this.cdRef=i,this.translation=o,this.listHelper=a,this.permissionService=r,this.onClosePopup=new t.bkB,this.AvatarFormat=L.Z,this.GroupType=_.MH,this.AuditStatus=B,this.permissions={INVENTORY_MODIFY:this.permissionService.get("INVENTORY_MODIFY")}}ngOnInit(){this.loading=!0,this.auditService.getAuditDetail(this.auditId).subscribe(e=>{this.audit=e.audit,this.users=e.users,this.loading=!1,this.cdRef.markForCheck()})}toggleAuditState(){let e=B.DONE;this.audit.status==B.DONE&&(e=B.OPEN),confirm(this.translation.get(e==B.DONE?"assets.costStockLocation.audit.close.confirm":"assets.costStockLocation.audit.reopen.confirm"))&&(this.loading=!0,this.auditService.saveAuditState(this.auditId,e).subscribe(i=>{this.audit=i.audit,this.users=i.users,this.loading=!1,this.listHelper.triggerListAction(H.y4.AUDIT_OVERVIEW,{action:Ot.fo.REFRESH,keepParameters:!0}),this.cdRef.markForCheck()}))}exportAudit(){this.auditService.exportAudit(this.auditId)}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(wt),t.rXU(k.gRc),t.rXU(f.L),t.rXU(rt.T),t.rXU(q.n))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["audit-detail"]],inputs:{auditId:"auditId"},outputs:{onClosePopup:"onClosePopup"}
1,standalone:!1,decls:10,vars:8,consts:[[1,"popupBackgroundOverlay"],[1,"optionsPopup"],[1,"popupContent","empty","full-height"],[1,"optionForm","full-height"],["type","button",1,"btn-close","float-end",3,"click"],[1,"mb-0"],[3,"loading","size","margin","center"],[1,"auditContainer","d-flex"],[1,"leftPanel"],[1,"bold","d-flex","align-items-center","mb-3"],[1,"flex-grow-1"],[1,"btn",3,"click"],[1,"fas","fa-lg","fa-file-download"],[1,"d-flex"],[3,"format","fileName","type","hoverFormat","hoverFileName"],[1,"bold"],[1,"pb-2","progressTitle"],[1,"me-1",3,"percentage"],[1,"expectedAssets","assetCount"],[1,"assetCount","bold"],[1,"btn","auditBtn"],[1,"rightPanel"],[3,"auditId"],[1,"btn","auditBtn",3,"click"]],template:function(i,o){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"button",4),t.bIt("click",function(){return o.onClosePopup.emit()}),t.k0s(),t.j41(5,"h1",5),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.nrm(8,"progress-indicator",6),t.nVh(9,Co,52,35,"div",7),t.k0s()()()()),2&i&&(t.R7$(6),t.JRh(t.bMT(7,6,"assets.costStockLocation.inventoryAudit")),t.R7$(2),t.Y8G("loading",o.loading)("size",25)("margin",10)("center",!0),t.R7$(),t.vxM(o.audit&&!o.loading?9:-1))},dependencies:[$.F,st.E,Gt,ro,b.D],styles:[".popupBackgroundOverlay[_ngcontent-%COMP%] .optionsPopup[_ngcontent-%COMP%]{overflow:hidden}.auditContainer[_ngcontent-%COMP%]{height:calc(100% - 15px)}.leftPanel[_ngcontent-%COMP%], .rightPanel[_ngcontent-%COMP%]{height:100%;padding:15px}.leftPanel[_ngcontent-%COMP%]{overflow-y:auto;min-width:270px;width:20%;max-width:400px;margin-left:-10px;border-right:1px solid var(--colors-general-soft-grey);display:flex;flex-direction:column;gap:20px}.leftPanel[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{padding-left:12px}.leftPanel[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{list-style:disc}.leftPanel[_ngcontent-%COMP%] .progressContainer[_ngcontent-%COMP%]{padding:18px}.leftPanel[_ngcontent-%COMP%] .progressContainer[_ngcontent-%COMP%] .progressTitle[_ngcontent-%COMP%], .leftPanel[_ngcontent-%COMP%] .progressContainer[_ngcontent-%COMP%] .expectedAssets[_ngcontent-%COMP%]{padding-bottom:8px;margin-bottom:8px}.leftPanel[_ngcontent-%COMP%] .progressContainer[_ngcontent-%COMP%] .auditBtn[_ngcontent-%COMP%]{width:100%}.leftPanel[_ngcontent-%COMP%] .progressContainer[_ngcontent-%COMP%] .assetCount[_ngcontent-%COMP%]{padding-bottom:8px;display:flex;justify-content:space-between}.leftPanel[_ngcontent-%COMP%] .progressContainer[_ngcontent-%COMP%] .expectedAssets[_ngcontent-%COMP%]{border-bottom:1px solid var(--colors-general-soft-grey)}.leftPanel[_ngcontent-%COMP%] .progressContainer.OPEN[_ngcontent-%COMP%]{background-color:var(--colors-attention-soft)}.leftPanel[_ngcontent-%COMP%] .progressContainer.OPEN[_ngcontent-%COMP%] .progressTitle[_ngcontent-%COMP%]{color:var(--colors-attention-primary)}.leftPanel[_ngcontent-%COMP%] .progressContainer.DONE[_ngcontent-%COMP%]{background-color:var(--colors-success-background)}.leftPanel[_ngcontent-%COMP%] .progressContainer.DONE[_ngcontent-%COMP%] .progressTitle[_ngcontent-%COMP%]{color:var(--colors-success-text)}.rightPanel[_ngcontent-%COMP%]{flex:1;margin-right:-10px;display:flex;height:100%;min-width:0}"],changeDetection:0})}}return n})();function vo(n,s){if(1&n){const e=t.RV6();t.j41(0,"audit-detail",2),t.bIt("onClosePopup",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.toggleDetailPopup(!1))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("auditId",e.auditDetailPopup.id)}}let bo=(()=>{class n{constructor(e){this.cdRef=e,this.auditDetailPopup={show:!1}}toggleDetailPopup(e,i){this.auditDetailPopup={show:e,id:i},this.cdRef.markForCheck()}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["audit-overview"]],inputs:{location:"location"},standalone:!1,decls:2,vars:2,consts:[[3,"onShowDetail","locationId"],[3,"auditId"],[3,"onClosePopup","auditId"]],template:function(i,o){1&i&&(t.j41(0,"audit-list",0),t.bIt("onShowDetail",function(r){return o.toggleDetailPopup(!0,r)}),t.k0s(),t.nVh(1,vo,1,1,"audit-detail",1)),2&i&&(t.Y8G("locationId",o.location),t.R7$(),t.vxM(o.auditDetailPo
1pup.show?1:-1))},dependencies:[ao,fo],encapsulation:2,changeDetection:0})}}return n})();function To(n,s){if(1&n&&(t.nrm(0,"i",5)(1,"span",6),t.nI1(2,"translate"),t.nI1(3,"highlight")),2&n){const e=s.data,i=s.highlightValue;t.Y8G("ngClass",e.outgoing?"fa-arrow-left":"fa-arrow-right"),t.R7$(),t.Y8G("innerHTML",t.i5U(3,4,t.bMT(2,2,e.outgoing?"communication.messages.list.box.OUTBOX":"communication.messages.list.box.INBOX"),i),t.npT)}}function Oo(n,s){if(1&n){const e=t.RV6();t.j41(0,"a",8),t.nI1(1,"translate"),t.bIt("click",function(){l.eBV(e);const o=t.XpG().data,a=t.XpG();return l.Njj(a.showDetail(o.id))}),t.nrm(2,"i",9),t.k0s()}2&n&&t.Y8G("title",t.bMT(1,1,"alerts.form.country.viewDetail"))}function Mo(n,s){1&n&&t.nVh(0,Oo,3,3,"a",7),2&n&&t.vxM(s.highlighted?0:-1)}let xo=(()=>{class n{constructor(e,i,o){this.fb=e,this.globalHelper=i,this.changeDetector=o,this.onTransferOpen=new t.bkB,this.listKey=H.y4.LOCATION_TRANSFERS,this.periodFilterPresets=[1,7,30,60,90]}ngOnInit(){this.initialPeriod={beginDate:new Date(new Date((new Date).setDate((new Date).getDate()-89)).setHours(0,0,0,0)),endDate:new Date((new Date).setHours(23,59,59,59))},this.transfersFilterForm=this.fb.group({period:new c.MJ(this.initialPeriod)}),this.setListFilter(this.initialPeriod),this.periodSubscription=this.period.valueChanges.subscribe(e=>{this.setListFilter(e)})}setListFilter(e){this.listFilter={filterIds:[this.locationId],periodFilter:this.globalHelper.formatDate(e.beginDate,!1)+"|"+this.globalHelper.formatDate(e.endDate,!1)},this.changeDetector.markForCheck()}get period(){return this.transfersFilterForm.get("period")}showDetail(e){this.onTransferOpen.emit(e)}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(c.ok),t.rXU(K.$),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["location-transfers-list"]],inputs:{locationId:"locationId"},outputs:{onTransferOpen:"onTransferOpen"},standalone:!1,decls:6,vars:8,consts:[[1,"filterContainer",3,"formGroup"],["formControlName","period",3,"label","maxDays","presets"],[1,"p-2",3,"externalFilter","listKey"],["cellTemplate","TRANSFER_DIRECTION"],["cellTemplate","LOCATION_TRANSFER_ACTIONS"],[1,"fa","me-2",3,"ngClass"],[1,"cellContent",3,"innerHTML"],[1,"listAction",3,"title"],[1,"listAction",3,"click","title"],[1,"fa-solid","fa-magnifying-glass","action","fa-lg"]],template:function(i,o){1&i&&(t.j41(0,"form",0),t.nrm(1,"period-filter",1),t.nI1(2,"translate"),t.k0s(),t.nrm(3,"divided-list",2),t.DNE(4,To,4,7,"ng-template",3)(5,Mo,1,1,"ng-template",4)),2&i&&(t.Y8G("formGroup",o.transfersFilterForm),t.R7$(),t.Y8G("label",t.bMT(2,6,"allpages.period"))("maxDays",90)("presets",o.periodFilterPresets),t.R7$(2),t.Y8G("externalFilter",o.listFilter)("listKey",o.listKey))},dependencies:[p.YU,ft.p,tt.i,c.qT,c.BC,c.cb,c.j4,c.JD,et.v,b.D,V.v],styles:["[_nghost-%COMP%]{height:100%;display:flex;flex-direction:column;padding-top:10px}divided-list[_ngcontent-%COMP%]{border-top:1px solid var(--colors-general-soft-grey);margin:10px 0;flex:1;min-height:0}.fa-arrow-right[_ngcontent-%COMP%]{color:var(--colors-attention-primary)}.fa-arrow-left[_ngcontent-%COMP%]{color:var(--colors-warning-general)}"]})}}return n})();const Z=n=>({active:n}),Po=n=>({"scrollable-list":n});function yo(n,s){if(1&n&&t.nrm(0,"suivo-avatar",3),2&n){const e=t.XpG(2);t.Y8G("format",e.avatarFormat.MEDIUM)("fileName",e.data.avatar?e.data.avatar[e.avatarFormat.MEDIUM]:null)("type",e.groupType[e.data.groupType])("hoverFormat",e.avatarFormat.LARGE)("hoverFileName",e.data.avatar?e.data.avatar[e.avatarFormat.LARGE]:null)}}function ko(n,s){if(1&n&&(t.j41(0,"h2"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.JRh(e.data.description)}}function Fo(n,s){if(1&n&&(t.j41(0,"label"),t.EFF(1),t.nI1(2,"translate"),t.k0s(),t.EFF(3),t.nrm(4,"br")),2&n){const e=t.XpG(2);t.R7$(),t.SpI("",t.bMT(2,2,"allpages.type"),":"),t.R7$(2),t.SpI(" ",e.data.entityType," ")}}function So(n,s){if(1&n&&(t.j41(0,"span",5),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",t.bMT(2,1,"COST_LOCATION"==e.data.groupType?"assets.costLocation":"assets.stockLocation"),",\xa0 ")}}function Io(n,s){1&n&&(t.j41(0,"label",5),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"assets.costStockLocation.linkedTo"),":\xa0"))}function Ro(n,s){if(1&n&&t.nrm(0,"suivo-entity",6),2&n){const e=t.XpG(2);t.Y8G("flexLayout",!0)("entityType",e.groupType.UNIT)("entity",e.data.unit)}}function Lo(n,s){if(1&n&&t.nrm(0,"suivo-entity",6),2&n){const e=t.XpG(2);
1t.Y8G("flexLayout",!0)("entityType",e.groupType.LOCATION)("entity",e.data.fence)}}function Ao(n,s){if(1&n&&t.nrm(0,"img",7),2&n){const e=t.XpG(2);t.Y8G("src",e.codeUrl,t.B4B)}}function Eo(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",11)(1,"a",21),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.onTabChange("TRANSFERS"))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,Z,"TRANSFERS"===e.activeTab)),t.R7$(2),t.SpI(" ",t.bMT(3,2,"permission.ITEM_TRANSFERS")," ")}}function jo(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",11)(1,"a",21),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.onTabChange("AUDITS"))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,Z,"AUDITS"===e.activeTab)),t.R7$(2),t.SpI(" ",t.bMT(3,2,"assets.costStockLocation.inventoryAudits")," ")}}function Do(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",11)(1,"a",21),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.onTabChange("INVENTORIES"))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,Z,"INVENTORIES"===e.activeTab)),t.R7$(2),t.SpI(" ",t.bMT(3,2,"settings.account.asset.management.inventory")," ")}}function wo(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",11)(1,"a",21),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.onTabChange("CONSUMABLES"))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,Z,"CONSUMABLES"===e.activeTab)),t.R7$(2),t.SpI(" ",t.bMT(3,2,"permission.PAGE_CONSUMABLES")," ")}}function Go(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",11)(1,"a",21),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.onTabChange("ATTRIBUTES"))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(4,Z,"ATTRIBUTES"===e.activeTab)),t.R7$(2),t.SpI(" ",t.bMT(3,2,"permission.ITEM_CUSTOM_FIELDS")," ")}}function $o(n,s){if(1&n&&t.nrm(0,"highcharts-chart",22),2&n){const e=t.XpG(3);t.Y8G("Highcharts",e.Highcharts)("options",e.chartOptions)}}function Vo(n,s){if(1&n&&t.nrm(0,"div",27),2&n){const e=t.XpG(2).$implicit,i=t.XpG(3);t.xc7("background-color",i.assetStatuses[e].color)}}function No(n,s){if(1&n&&(t.j41(0,"td")(1,"div",24),t.nVh(2,Vo,1,2,"div",25),t.j41(3,"div"),t.EFF(4),t.k0s()()(),t.j41(5,"td",26),t.EFF(6),t.k0s()),2&n){const e=t.XpG().$implicit,i=t.XpG(3);t.R7$(2),t.vxM(i.assetStatuses[e].color?2:-1),t.R7$(2),t.JRh(i.assetStatuses[e].name),t.R7$(2),t.JRh(i.data.statusCount[e])}}function Xo(n,s){if(1&n&&(t.j41(0,"tr"),t.nVh(1,No,7,3),t.k0s()),2&n){const e=s.$implicit,i=t.XpG(3);t.R7$(),t.vxM(i.assetStatuses[e]?1:-1)}}function Bo(n,s){if(1&n&&(t.j41(0,"div",14),t.nVh(1,$o,1,2,"highcharts-chart",22),t.j41(2,"div",23)(3,"table",5),t.Z7z(4,Xo,2,1,"tr",null,t.fX1),t.k0s()()()),2&n){const e=t.XpG(2);t.R7$(),t.vxM(e.chartOptions?1:-1),t.R7$(3),t.Dyx(e.objectKeys(e.data.statusCount))}}function Uo(n,s){if(1&n){const e=t.RV6();t.j41(0,"asset-list",30),t.bIt("onTypeSelection",function(o){l.eBV(e);const a=t.XpG(3);return l.Njj(a.selectedType=o)})("onAssetSelection",function(o){l.eBV(e);const a=t.XpG(3);return l.Njj(a.selectedAsset=o)}),t.k0s()}if(2&n){const e=t.XpG(3);t.Y8G("entityTypes",e.data.entityTypes)("assetStatuses",e.assetStatuses)("assets",e.data.assets)("currentDefinitions",e.data.currentDefinitions)("availableDefinitions",e.data.availableDefinitions)("definitions",e.data.definitions)("costStockLocation",e.locationId)}}function Yo(n,s){1&n&&(t.j41(0,"table",29)(1,"thead")(2,"tr")(3,"th"),t.EFF(4),t.nI1(5,"translate"),t.k0s()()()()),2&n&&(t.R7$(4),t.JRh(t.bMT(5,1,"assets.costStockLocation.noAssets")))}function Ho(n,s){if(1&n&&(t.nVh(0,Uo,1,7,"asset-list",28),t.nVh(1,Yo,6,3,"table",29)),2&n){const e=t.XpG(2);t.vxM(e.data.assets?0:-1),t.R7$(),t.vxM(e.data.assets?-1:1)}}function zo(n,s){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td"),t.EFF(6),t.k0s(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td"),t.EFF(10),t.k0s(),t.j41(11,"td"),t.EFF(12),t.k0s()()),2&n){const e=s.$implicit;t.R7$(2),t.JRh(e.timeIndicator.date),t.R7$(2),t.JRh(e.user),t.R7$(2),t.JRh(e.present),t.R7$(2),t.JRh(e.missing),t.R7$(2),t.JRh(e.additional),t.R7$(2),t.JRh(e.comment)}}function Jo(n,s){if(1&n&&(t.j41(0,"div",17)(1,"div",31)(2,"table",29)(3,"thead")(4,"tr")(
15,"th"),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.j41(8,"th"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.j41(11,"th"),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"th"),t.EFF(15),t.nI1(16,"translate"),t.k0s(),t.j41(17,"th"),t.EFF(18),t.nI1(19,"translate"),t.k0s(),t.j41(20,"th"),t.EFF(21),t.nI1(22,"translate"),t.k0s()()(),t.j41(23,"tbody"),t.Z7z(24,zo,13,6,"tr",null,t.fX1),t.k0s()()()()),2&n){const e=t.XpG(2);t.R7$(6),t.JRh(t.bMT(7,6,"allpages.date")),t.R7$(3),t.JRh(t.bMT(10,8,"settings.userManagement.user")),t.R7$(3),t.JRh(t.bMT(13,10,"assets.inventory.present")),t.R7$(3),t.JRh(t.bMT(16,12,"assets.inventory.missing")),t.R7$(3),t.JRh(t.bMT(19,14,"assets.inventory.additional")),t.R7$(3),t.JRh(t.bMT(22,16,"allpages.comment")),t.R7$(3),t.Dyx(e.data.inventories)}}function Ko(n,s){if(1&n){const e=t.RV6();t.j41(0,"location-transfers-list",32),t.bIt("onTransferOpen",function(o){l.eBV(e);const a=t.XpG(2);return l.Njj(a.toggleTransferPopup(o))}),t.k0s()}if(2&n){const e=t.XpG(2);t.Y8G("locationId",e.locationId)}}function Zo(n,s){1&n&&(t.j41(0,"span"),t.EFF(1,"?"),t.k0s())}function Wo(n,s){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"b"),t.EFF(3),t.nVh(4,Zo,2,0,"span"),t.k0s()(),t.j41(5,"td"),t.nrm(6,"attribute-value",34),t.k0s()()),2&n){const e=s.$implicit;t.R7$(3),t.JRh(e.label),t.R7$(),t.vxM("BOOLEAN"===e.type?4:-1),t.R7$(2),t.Y8G("customFieldType",e.type)("data",e.value)}}function qo(n,s){if(1&n&&(t.j41(0,"div",19)(1,"table",33),t.Z7z(2,Wo,7,4,"tr",null,t.fX1),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(2),t.Dyx(e.attributes)}}function Qo(n,s){if(1&n){const e=t.RV6();t.j41(0,"i",37),t.bIt("click",function(o){l.eBV(e);
1const a=t.XpG().$implicit,r=t.XpG(3);return l.Njj(r.showQrCode(o,a.code))}),t.k0s()}}function ts(n,s){if(1&n){const e=t.RV6();t.j41(0,"qr-code-popup",38),t.bIt("onClose",function(){l.eBV(e);const o=t.XpG(4);return l.Njj(o.codePopup.visible=!1)}),t.k0s()}if(2&n){const e=t.XpG(4);t.xc7("bottom",e.codePopupBottom+"px")("left",e.codePopupLeft+"px"),t.Y8G("qrCode",e.codePopup.code)("arrowLeft",!0)("shownAboveContent",!0)}}function es(n,s){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td"),t.nVh(6,Qo,1,0,"i",35),t.nVh(7,ts,1,7,"qr-code-popup",36),t.k0s()()),2&n){const e=s.$implicit,i=t.XpG(3);t.R7$(2),t.JRh(e.description),t.R7$(2),t.JRh(e.amount),t.R7$(2),t.vxM(e.code?6:-1),t.R7$(),t.vxM(i.codePopup.visible&&e.code===i.codePopup.code?7:-1)}}function ns(n,s){if(1&n&&(t.j41(0,"div",17)(1,"div",31)(2,"table",29)(3,"thead")(4,"tr")(5,"th"),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.j41(8,"th"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.j41(11,"th"),t.EFF(12),t.nI1(13,"translate"),t.k0s()()(),t.j41(14,"tbody"),t.Z7z(15,es,8,4,"tr",null,t.fX1),t.k0s()()()()),2&n){const e=t.XpG(2);t.R7$(6),t.JRh(t.bMT(7,3,"allpages.description")),t.R7$(3),t.JRh(t.bMT(10,5,"consumables.amount")),t.R7$(3),t.JRh(t.bMT(13,7,"settings.person.QR_CODE")),t.R7$(3),t.Dyx(e.data.consumables)}}function is(n,s){if(1&n&&t.nrm(0,"audit-overview",20),2&n){const e=t.XpG(2);t.Y8G("location",e.locationId)}}function os(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",2),t.nVh(1,yo,1,5,"suivo-avatar",3),t.j41(2,"div",4),t.nVh(3,ko,2,1,"h2"),t.nVh(4,Fo,5,4),t.nVh(5,So,3,3,"span",5),t.nVh(6,Io,3,3,"label",5),t.nVh(7,Ro,1,3,"suivo-entity",6),t.nVh(8,Lo,1,3,"suivo-entity",6),t.k0s(),t.nVh(9,Ao,1,1,"img",7),t.k0s(),t.j41(10,"div",8)(11,"div",9)(12,"ul",10)(13,"li",11)(14,"a",12),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.onTabChange("ASSETS"))}),t.EFF(15),t.nI1(16,"translate"),t.k0s()(),t.nVh(17,Eo,4,6,"li",11),t.nVh(18,jo,4,6,"li",11),t.nVh(19,Do,4,6,"li",11),t.nVh(20,wo,4,6,"li",11),t.nVh(21,Go,4,6,"li",11),t.k0s()()(),t.j41(22,"div",13),t.nVh(23,Bo,6,1,"div",14),t.j41(24,"div",15)(25,"div",16),t.nVh(26,Ho,2,2)(27,Jo,26,18,"div",17)(28,Ko,1,1,"location-transfers-list",18)(29,qo,4,0,"div",19)(30,ns,17,9,"div",17)(31,is,1,1,"audit-overview",20),t.k0s()()()}if(2&n){let e;const i=t.XpG();t.R7$(),t.vxM(i.data.groupType?1:-1),t.R7$(2),t.vxM(i.data.description?3:-1),t.R7$(),t.vxM(i.data.entityType?4:-1),t.R7$(),t.vxM(i.data.groupType?5:-1),t.R7$(),t.vxM(i.data.unit||i.data.fence?6:-1),t.R7$(),t.vxM(i.data.unit?7:-1),t.R7$(),t.vxM(i.data.fence?8:-1),t.R7$(),t.vxM(i.data.code&&!i.selectedAsset?9:-1),t.R7$(4),t.Y8G("ngClass",t.eq3(21,Z,"ASSETS"===i.activeTab)),t.R7$(2),t.Lme("",t.bMT(16,19,"allpages.units")," (",i.statusTotal,")"),t.R7$(2),t.vxM(i.data.hasTransfers?17:-1),t.R7$(),t.vxM(i.permissions.INVENTORY_VIEW&&i.data.useAudits?18:-1),t.R7$(),t.vxM(i.data.inventories&&!i.data.useAudits?19:-1),t.R7$(),t.vxM(i.data.consumables?20:-1),t.R7$(),t.vxM(i.data.customFields&&0!=i.objectKeys(i.data.customFields).length?21:-1),t.R7$(2),t.vxM(!i.selectedAsset&&"ASSETS"==i.activeTab&&i.data.statusCount?23:-1),t.R7$(2),t.Y8G("ngClass",t.eq3(23,Po,"ASSETS"==i.activeTab||"TRANSFERS"==i.activeTab||"ATTRIBUTES"==i.activeTab||"CONSUMABLES"==i.activeTab)),t.R7$(),t.vxM("ASSETS"===(e=i.activeTab)?26:"INVENTORIES"===e?27:"TRANSFERS"===e?28:"ATTRIBUTES"===e?29:"CONSUMABLES"===e?30:"AUDITS"===e?31:-1)}}function ss(n,s){if(1&n){const e=t.RV6();t.j41(0,"transfer-popup",39),t.bIt("onClosePopup",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.toggleTransferPopup())}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("transferId",e.transferPopup.transfer)}}let as=(()=>{class n{set locationId(e){this._locationId=e,(0,m.hX)(e)||this.getLocationDetail(e)}set clusterId(e){this._clusterId=e,(0,m.hX)(e)||this.getClusterDetail(e)}constructor(e,i,o,a,r,d,h){this.assetsService=e,this.sortService=i,this.assetsFilterService=o,this.stylesService=a,this.chartHelper=r,this.translation=d,this.permissionService=h,this.Highcharts=_t,this.avatarFormat=L.Z,this.groupType=_.MH,this.objectKeys=Object.keys,this.codePopup={visible:!1},this.statusTotal=0,this.transferPopup={show:!1,transfer:null},this.assetsFilterService.assetFilterChanges$.pipe((0,w.B)(500),(0,R.F)()).subscribe(g=>{this.assetFilter=g,this.locationId&&this.getLocationDetail(this.locationId)}),this.permissions={INVENTORY_VIEW:this.permissionService.get("INVENTORY_VIEW")}}
1showQrCode(e,i){this.codePopup.code=i,this.codePopup.visible=!0,this.codePopupBottom=window.innerHeight-e.target.getBoundingClientRect().top+15,this.codePopupLeft=e.target.getBoundingClientRect().left-20}onTabChange(e){this.activeTab!=e&&(this.activeTab=e,this.selectedAsset=null)}toggleTransferPopup(e){null!=e?(this.transferPopup.transfer=e,this.transferPopup.show=!0):(this.transferPopup.transfer=null,this.transferPopup.show=!1)}getLocationDetail(e){this.assetFilter||(this.assetFilter=this.assetsFilterService.getFilter()),this.assetsService.getLocation(e,this.assetFilter).subscribe(i=>{this.activeTab="ASSETS",this.data=i,this.definitions=this.getDefinitions(),this.data.code&&(this.codeUrl="../protected/common/code/view.png?code="+this.data.code),this.attributes=this.getAttributes(i.customFields),this.data.consumables&&(this.data.consumables=this.sortService.sort(this.data.consumables,"description",!1,!0)),this.data.statusCount&&(this.statusTotal=this.getStatusTotal(this.data.statusCount),this.buildChart())})}getAttributes(e){let i=[];return e&&Object.keys(e).forEach(o=>{i.push({label:this.data.definitions[o].name,value:e[o],type:this.data.definitions[o].type})}),this.sortService.sort(i,"label",!1,!0)}getClusterDetail(e){this.assetsService.getCluster(e).subscribe(i=>{this.activeTab="ASSETS",this.data=i,this.attributes=this.getAttributes(i.customFields),this.definitions=this.getDefinitions(),this.data.statusCount&&(this.statusTotal=this.getStatusTotal(this.data.statusCount),this.buildChart())})}getDefinitions(){if(this.data.definitions){let e={};for(let i in this.data.definitions)e[i]=this.data.definitions[i].name;return e}return null}getStatusTotal(e){return Object.values(e).reduce(function i(o,a){return o+a},0)}buildChart(){let e=null,i=[];Object.keys(this.data.statusCount).forEach(o=>{-1!=+o&&(e=this.assetStatuses[o]&&this.assetStatuses[o].color?this.assetStatuses[o].color:"#ffffff"),(this.assetStatuses[o]||-1==+o)&&i.push({name:-1!=+o?this.assetStatuses[o].name:this.translation.get("allpages.none"),y:this.data.statusCount[o],color:e,dataLabels:{enabled:!1},borderColor:"#ffffff"===e?"var(--colors-general-soft-grey)":e})}),this.chartOptions=this.chartHelper.createChartConfig({chart:{type:"pie",plotBackgroun
1dColor:null,plotBorderWidth:null,plotShadow:!1,height:125,spacing:[0,0,0,0]},exporting:{enabled:!1},credits:{enabled:!1},legend:{enabled:!1},title:{text:null},tooltip:{pointFormat:"<b>{point.y}</b>"},plotOptions:{pie:{allowPointSelect:!1,cursor:"pointer",dataLabels:{enabled:!0,format:"{point.y}"},innerSize:"75%"}},series:[{name:"data",data:i}]})}get locationId(){return this._locationId}get clusterId(){return this._clusterId}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(x.T),t.rXU(C.a),t.rXU(I.N),t.rXU(it.Y),t.rXU(kt.q),t.rXU(f.L),t.rXU(q.n))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["location-detail"]],inputs:{locationId:"locationId",clusterId:"clusterId",assetStatuses:"assetStatuses"},standalone:!1,decls:3,vars:4,consts:[[1,"mx-auto","mt-5",3,"loading","size"],[3,"transferId"],[1,"d-flex","align-items-center","mt-2","mb-3"],[1,"float-start",3,"format","fileName","type","hoverFormat","hoverFileName"],[1,"ms-2","me-auto"],[1,"float-start"],[1,"float-start",3,"flexLayout","entityType","entity"],["width","75",1,"float-end",3,"src"],[1,"row"],[1,"col-12"],[1,"nav","nav-tabs"],[1,"nav-item",3,"ngClass"],[3,"click"],[1,"locationContainer"],[1,"chartContainer"],[1,"row","contentRow"],[1,"col-12","px-4",3,"ngClass"],[1,"tableContainer"],[3,"locationId"],[1,"attribute-list"],[3,"location"],[1,"nav-link",3,"click"],[1,"float-start",2,"width","195px","display","block",3,"Highcharts","options"],[1,"chartLegend"],[1,"status"],[1,"statusDot",3,"background-color"],[1,"float-end"],[1,"statusDot"],[3,"entityTypes","assetStatuses","assets","currentDefinitions","availableDefinitions","definitions","costStockLocation"],[1,"table"],[3,"onTypeSelection","onAssetSelection","entityTypes","assetStatuses","assets","currentDefinitions","availableDefinitions","definitions","costStockLocation"],[1,"table-scroll"],[3,"onTransferOpen","locationId"],[1,"customTable"],[3,"customFieldType","data"],[1,"fas","fa-qrcode","action"],[3,"bottom","left","qrCode","arrowLeft","shownAboveContent"],[1,"fas","fa-qrcode","action",3,"click"],[3,"onClose","qrCode","arrowLeft","shownAboveContent"],[3,"onClosePopup","transferId"]],template:function(i,o){1&i&&(t.nrm(0,"progress-indicator",0),t.nVh(1,os,32,25),t.nVh(2,ss,1,1,"transfer-popup",1)),2&i&&(t.Y8G("loading",!o.data)("size",40),t.R7$(),t.vxM(o.data?1:-1),t.R7$(),t.vxM(o.transferPopup.show?2:-1))},dependencies:[p.YU,$.F,ht.T,ie.C,ot.Z,st.E,mt.H,zi,bo,xo,Mt,b.D],styles:["[_nghost-%COMP%]{display:flex;flex-flow:column;height:100%}[_nghost-%COMP%] .contentRow[_ngcontent-%COMP%]{flex-grow:1;overflow:auto}[_nghost-%COMP%] suivo-entity[_ngcontent-%COMP%]{max-width:70%}[_nghost-%COMP%] .scrollable-list[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .scrollable-list[_ngcontent-%COMP%] .attribute-list[_ngcontent-%COMP%]{margin:0 10px;height:100%;overflow-y:auto}[_nghost-%COMP%] .scrollable-list[_ngcontent-%COMP%] asset-list[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] suivo-avatar[_ngcontent-%COMP%]{transform:scale(.75)}[_nghost-%COMP%] .nav[_ngcontent-%COMP%]{margin:10px 10px 0}[_nghost-%COMP%] .nav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{cursor:pointer;display:block}[_nghost-%COMP%] .nav[_ngcontent-%COMP%] li.listForm[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%] table.customTable[_ngcontent-%COMP%]{margin-top:10px}[_nghost-%COMP%] table.customTable[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:2px 0}[_nghost-%COMP%] table.customTable[_ngcontent-%COMP%] td[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{padding-right:20px}[_nghost-%COMP%] table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none!important}[_nghost-%COMP%] qr-code-popup[_ngcontent-%COMP%]{top:unset;right:unset;position:fixed}[_nghost-%COMP%] .tableContainer[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .tableContainer[_ngcontent-%COMP%] .table-scroll[_ngcontent-%COMP%]{position:relative;width:100%;height:100%;z-index:1;margin:auto;overflow:auto}[_nghost-%COMP%] .tableContainer[_ngcontent-%COMP%] .table-scroll[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{border-spacing:0}[_nghost-%COMP%] .tableContainer[_ngcontent-%COMP%] .table-scroll[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-bottom:1px solid var(--colors-general-soft-grey);position:sticky;top:0}[_nghost-%COMP%] .tableContainer[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:var(--colors-general-white);min-width:75px;z-index:2}[_nghost-%COMP%] [tooltip][_ngcontent-%COMP%]:after{white-space:unset;width:max-content;
1max-width:200px;padding:5px 10px;text-align:left}[_nghost-%COMP%] .locationContainer[_ngcontent-%COMP%]{display:flex;flex:1;min-height:0}[_nghost-%COMP%] .locationContainer[_ngcontent-%COMP%] .chartLegend[_ngcontent-%COMP%]{max-height:calc(100% - 120px);overflow-y:auto}[_nghost-%COMP%] .locationContainer[_ngcontent-%COMP%] .chartLegend[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .locationContainer[_ngcontent-%COMP%] .chartContainer[_ngcontent-%COMP%]{padding-right:12px;padding-top:12px;display:flex;flex-direction:column;min-width:215px;border-right:1px solid var(--colors-general-soft-grey)}[_nghost-%COMP%] .locationContainer[_ngcontent-%COMP%] .chartContainer[_ngcontent-%COMP%] table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{background-color:transparent;padding:6px 0}"]})}}return n})();var ls=u(70246);const rs=(n,s)=>({"fa-caret-down":n,"fa-caret-right":s}),$t=n=>({selected:n}),cs=(n,s)=>({"fa-chevron-right":n,"fa-chevron-down":s});function ps(n,s){if(1&n&&(t.nrm(0,"span",1),t.nI1(1,"translate"),t.nI1(2,"highlight")),2&n){const e=t.XpG(2);t.Y8G("innerHTML",t.i5U(2,3,t.bMT(1,1,"assets.overview.types.assets"),e.filterSearch),t.npT)}}function us(n,s){if(1&n&&(t.nrm(0,"span",1),t.nI1(1,"translate"),t.nI1(2,"highlight")),2&n){const e=t.XpG(2);t.Y8G("innerHTML",t.i5U(2,3,t.bMT(1,1,"assets.overview.types.costLocations"),e.filterSearch),t.npT)}}function ds(n,s){if(1&n&&(t.nrm(0,"span",1),t.nI1(1,"translate"),t.nI1(2,"highlight")),2&n){const e=t.XpG(2);t.Y8G("innerHTML",t.i5U(2,3,t.bMT(1,1,"assets.overview.types.stockLocations"),e.filterSearch),t.npT)}}function _s(n,s){if(1&n){const e=t.RV6();t.j41(0,"h3",0),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.treeHidden=!o.treeHidden)}),t.nVh(1,ps,3,6,"span",1)(2,us,3,6,"span",1)(3,ds,3,6,"span",1),t.nrm(4,"i",2),t.k0s()}if(2&n){let e;const i=t.XpG();t.R7$(),t.vxM((e=i.groupType)===i.groupTypeType.UNIT?1:e===i.groupTypeType.COST_LOCATION?2:e===i.groupTypeType.STOCK_LOCATION?3:-1),t.R7$(3),t.Y8G("ngClass",t.l_i(2,rs,!i.treeHidden&&i.hasVisibleItems,i.treeHidden||!i.hasVisibleItems))}}function ms(n,s){if(1&n){const e=t.RV6();t.j41(0,"li")(1,"div",3),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.selectEntityType(null))}),t.nrm(2,"suivo-avatar",4),t.j41(3,"span",5),t.EFF(4),t.nI1(5,"translate"),t.k0s()()()}if(2&n){const e=t.XpG(2);t.R7$(),t.Y8G("ngClass",t.eq3(8,$t,!e.selectedTypeId)),t.R7$(),t.Y8G("type",e.groupType)("category",e.groupType===e.groupTypeType.UNIT?e.unitCategory.ASSET:null)("format",e.avatarFormat.SMALL)("fileName",null),t.R7$(2),t.JRh(t.bMT(5,6,"allpages.all"))}}function hs(n,s){if(1&n){const e=t.RV6();t.j41(0,"i",10),t.bIt("click",function(){l.eBV(e);const o=t.XpG().$implicit,a=t.XpG(2);return l.Njj(a.toggleSubTypes(o))}),t.k0s()}if(2&n){const e=t.XpG().$implicit,i=t.XpG(2);t.Y8G("ngClass",t.l_i(1,cs,i.expandedType!==e.id,i.expandedType===e.id))}}function gs(n,s){if(1&n&&t.nrm(0,"entity-type-selector",9),2&n){const e=t.XpG().$implicit,i=t.XpG(2);t.Y8G("types",e.subTypes)("groupType",i.groupType)}}function Cs(n,s){if(1&n){const e=t.RV6();t.j41(0,"li")(1,"div",6)(2,"div",7),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(2);return l.Njj(a.selectEntityType(o))}),t.nrm(3,"suivo-avatar",4)(4,"span",8),t.nI1(5,"highlight"),t.k0s(),t.nVh(6,hs,1,4,"i",2),t.k0s(),t.nVh(7,gs,1,2,"entity-type-selector",9),t.k0s()}if(2&n){const e=s.$implicit,i=t.XpG(2);t.R7$(),t.Y8G("ngClass",t.eq3(11,$t,i.selectedTypeId==e.id)),t.R7$(2),t.Y8G("type",i.groupType)("category",i.unitCategory.ASSET)("format",i.avatarFormat.SMALL)("fileName",e.avatars?e.avatars[i.avatarFormat[i.avatarFormat.SMALL]]:null),t.R7$(),t.Y8G("innerHTML",t.i5U(5,8,e.description,i.filterSearch),t.npT),t.R7$(2),t.vxM(e.subTypes&&0!=e.subTypes.length?6:-1),t.R7$(),t.vxM(i.expandedType===e.id&&e.subTypes&&0!=e.subTypes.length?7:-1)}}function fs(n,s){if(1&n&&(t.j41(0,"ul"),t.nVh(1,ms,6,10,"li"),t.Z7z(2,Cs,8,13,"li",null,t.fX1),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.vxM(e.root?1:-1),t.R7$(),t.Dyx(e.types)}}let vs=(()=>{class n{set visible(e){this.treeHidden=!e}set types(e){this.selectedType=null,this._types=e?this.sortService.sort(e,"description",!1,!0):e}constructor(e,i){this.assetsFilterService=e,this.sortService=i,this.classes="container-fluid",this.unitCategory=_.SB,this.avatarFormat=L.Z,this.groupTypeType=_.MH,this.hasVisibleItems=!0,this.assetsFilterService.assetFilterChanges$.subscribe(o=>{switch(this.groupType){case _.MH.UNIT:this.selectedTypeId=o.assetType;break;case _.MH.COST_LOCATION:this.selectedTypeId=o.costLocationType;break;case _.MH.STOCK_LOCATION:this.selectedTypeId=o.stockLocationType}this.filter=o}),this.assetsFilterService.assetFilterSearch$.subscribe(o=>{this.filterSearch=o,this.hasVisibleItems=!1;let a=this.filterSearch?this.filterSearch.toLowerCase().trim():null;a&&a.length>
11?this.types.forEach(r=>{(-1!=r.description.toLowerCase().indexOf(a)||this.hasMatchingSubType(r,a))&&(this.hasVisibleItems=!0)}):this.hasVisibleItems=!0})}selectEntityType(e){switch(this.selectedType=e,this.filter||(this.filter=this.assetsFilterService.getFilter()),this.groupType){case _.MH.UNIT:this.filter.assetType=e?e.id:null;break;case _.MH.COST_LOCATION:this.filter.costLocationType=e?e.id:null;break;case _.MH.STOCK_LOCATION:this.filter.stockLocationType=e?e.id:null}this.assetsFilterService.setFilterChanged(this.filter),this.toggleSubTypes(e)}hasMatchingSubType(e,i){if(e.subTypes&&0!=e.subTypes.length)for(let o of e.subTypes)if(-1!=o.description.toLowerCase().indexOf(i)||this.hasMatchingSubType(o,i))return!0;return!1}subTypesVisible(e,i){return(this.hasMatchingSubType(e,i)||this.selectedType&&this.selectedType.id===e.id)&&e.subTypes&&0!=e.subTypes.length}toggleSubTypes(e){this.expandedType=(0,m.hX)(e)||this.expandedType===e.id?null:e.id}get types(){return this._types}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(I.N),t.rXU(C.a))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["entity-type-selector"]],hostVars:2,hostBindings:function(i,o){2&i&&t.HbH(o.classes)},inputs:{groupType:"groupType",root:"root",visible:"visible",types:"types"},standalone:!1,decls:2,vars:2,consts:[[3,"click"],[3,"innerHTML"],[1,"fas","action","float-end",3,"ngClass"],[1,"itemContainer",3,"click","ngClass"],[1,"float-start",3,"type","category","format","fileName"],[1,"description"],[1,"itemContainer",3,"ngClass"],[1,"float-start",2,"width","calc(100% - 20px)",3,"click"],[1,"description",3,"innerHTML"],[3,"types","groupType"],[1,"fas","action","float-end",3,"click","ngClass"]],template:function(i,o){1&i&&(t.nVh(0,_s,5,5,"h3"),t.nVh(1,fs,4,1,"ul")),2&i&&(t.vxM(o.root?0:-1),t.R7$(),t.vxM(!o.treeHidden&&o.hasVisibleItems?1:-1))},dependencies:[p.YU,$.F,n,b.D,V.v],styles:["[_nghost-%COMP%]{display:inline-block;width:100%}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;cursor:pointer}[_nghost-%COMP%] h3[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] ul[_ngcontent-%COMP%]{margin:0;padding:10px}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:2px 0;min-height:20px}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{padding:5px 0 5px 5px}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding-left:5px;padding-right:0}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .itemContainer[_ngcontent-%COMP%]{cursor:pointer;height:22px;display:inline-block;width:100%}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .itemContainer[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{display:inline-block;height:22px;line-height:20px;padding-left:5px;width:calc(100% - 20px)}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .itemContainer[_ngcontent-%COMP%]:hover .description[_ngcontent-%COMP%]{text-decoration:underline}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .itemContainer.selected[_ngcontent-%COMP%]{font-weight:700;font-size:12px}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .itemContainer.selected[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{text-decoration:none!important}[_nghost-%COMP%] .iconColumn[_ngcontent-%COMP%]{width:30px;padding:5px 8px}"]})}}return n})();var T=u(80154),S=u(19125),Vt=u(40028),bs=u(44977);const Pt=n=>({"filter-checked":n}),Ts=n=>({action:n});function Os(n,s){if(1&n){const e=t.RV6();t.j41(0,"form",0)(1,"div",3)(2,"div",4),t.nrm(3,"input",5),t.k0s(),t.j41(4,"div",6),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"div",4),t.nrm(8,"input",7),t.k0s(),t.j41(9,"div",8)(10,"i",9),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.submitNumericForm())}),t.k0s()()()()}if(2&n){const e=t.XpG();t.Y8G("formGroup",e.filterForm),t.R7$(5),t.SpI(" ",t.bMT(6,2,"allpages.to")," ")}}function Ms(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",10)(1,"label",11)(2,"input",12),t.bIt("change",function(){l.eBV(e);const o=t.XpG(3);return l.Njj(o.submitSelectionForm())}),t.k0s(),t.nrm(3,"span",13),t.nI1(4,"highlight"),t.k0s()()}if(2&n){const e=s.$implicit,i=s.$index,o=t.XpG(3);t.Y8G("ngClass",t.eq3(6,Pt,e.value.active)),t.R7$(),t.Y8G("formGroupName",i),t.R7$(2),t.Y8G("innerHTML",t.i5U(4,3,o.selection.controls[i].get("label").value,o.filterSearch),t.npT)}}function xs(n,s){if(1&n&&(t.j41(0,"ul"),t.Z7z(1,Ms,5,8,"li",10,t.fX1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.Dyx(e.selection.controls)}}function Ps(n,s){if(1&n&&(t.j41(0,"li",31)(1,"label",11),t.nrm(2,"input",32),t.EFF(3),t.k0s()()),2&n){const e=t.XpG().$index,i=t.XpG(5);t.R7$(),t.Y8G("formGroupName",e),t.R7$(2),t.SpI("",i.values[e].label," ")}}function ys(n,s){if(1&n&&t.nVh(0,Ps,4,2,"li",31),2&n){const e=s.$index,i=t.XpG(5);t.vxM(i.isVisibleValue(i.values[e].label)?0:-1)}}function ks(n,s){if(1&n&&(t.j41(0,"ul"),t.Z7z(1,ys,1,1,null,null,t.fX1),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.Dyx(e.valuesSelection.controls)}}function Fs(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",16)(1,"div",17)(2,"div",18)(3,"div",19)(4,"button",20),t.bIt("click",function(){l.eBV(e);const o=t.XpG(3);return l.Njj(o.toggleOptionsPopup())}),t.k0s(),t.j41(5,"h3"),t.EFF(6),t.k0s(),t.j41(7,"div",21)(8,"div",22)(9,"span",23),t.nrm(10,"i",24),t.k0s(),t.nrm(11,"input",25),t.nI1(12,"translate"),t.k0s(),t.j41(13,"i",26),t.bIt("click",function(){l.eBV(e);const o=t.XpG(3);return l.Njj(o.searchValue.setValue(""))}),t.k0s()(),t.j41(14,"div",27),t.nVh(15,ks,3,0,"ul"),t.k0s(),t.nrm(16,"hr"),t.j41(17,"div",28)(18,"div",29)(19,"button",30),t.bIt("click",function(){l.eBV(e);const o=t.XpG(3);return l.Njj(o.toggleOptionsPopup(!0))}),t.EFF(20),t.nI1(21,"translate"),t.k0s()()()()()()()}if(2&n){const e=t.XpG(3);t.R7$(6),t.JRh(e.definition.description),t.R7$(5),t.Y8G("placeholder",t.mNQ(t.bMT(12,6,"allpages.button.search"))),t.R7$(2),t.Y8G("ngClass",t.eq3(10,Ts,e.searchValue.value&&""!=e.searchValue.value)),t.R7$(2),t.vxM(e.valuesSelection?15:-1),t.R7$(5),t.SpI(" ",t.bMT(21,8,"allpages.button.submit")," ")}}function Ss(n,s){if(1&n){const e=t.RV6();t.j41(0,"a",14),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.toggleOptionsPopup())}),t.nrm(1,"i",15),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,Fs,22,12,"div",16)}if(2&n){const e=t.XpG(2);t.R7$(2),t.SpI("\xa0",t.bMT(3,2,"allpages.showMore")," "),t.R7$(2),t.vxM(e.optionsPopupVisible?4:-1)}}function Is(n,s){if(1&n&&(t.j41(0,"form",1),t.nVh(1,xs,3,0,"ul"),t.nVh(2,Ss,5,4),t.k0s()),2&n){const e=t.XpG();t.Y8G("formGroup",e.filterForm),t.R7$(),t.vxM(e.selection?1:-1),t.R7$(),t.vxM(e.values.length>e.selectionLimit?2:-1)}}function Rs(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",34)(1,"label")(2,"input",35),t.bIt("change",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.submitBooleanForm())}),t.k0s(),t.EFF(3),t.k0s()()}if(2&n){const e=s.$implicit,i=t.XpG(2);t.Y8G("ngClass",t.eq3(3,Pt,i.value.value==e.value)),t.R7$(2),t.Y8G("value",e.value),t.R7$(),t.SpI(" ",e.label," ")}}function Ls(n,s){if(1&n){const e=t.RV6();t.j41(0,"form",0)(1,"div",33)(2,"div",29)(3,"ul",28)(4,"li",34)(5,"label")(6,"input",35),t.bIt("change",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.submitBooleanForm())}),t.k0s(),t.EFF(7),t.nI1(8,"translate"),t.k0s()(),t.Z7z(9,Rs,4,5,"li",34,t.fX1),t.k0s()()()()}if(2&n){const e=t.XpG();t.Y8G("formGroup",e.filterForm),t.R7$(4),t.Y8G("ngClass",t.eq3(6,Pt,null==e.value.value)),t.R7$(2),t.Y8G("value",null),t.R7$(),t.SpI(" ",t.bMT(8,4,"allpages.showAll")," "),t.R7$(2),t.Dyx(e.values)}}function As(n,s){if(1&n&&(t.j41(0,"option",38),t.EFF(1),t.k0s()),2&n){const e=s.$implicit;t.Y8G("value",e.type),t.R7$(),t.SpI(" ",e.label," ")}}function Es(n,s){if(1&n){const e=t.RV6();t.j41(0,"form",2)(1,"input",36),t.bIt("change",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.submitDateForm())}),t.k0s(),t.j41(2,"select",37),t.bIt("change",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.submitDateForm())}),t.Z7z(3,As,2,2,"option",38,t.fX1),t.k0s(),t.j41(5,"date-input",39),t.bIt("change",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.submitDateForm())}),t.k0s()()}if(2&n){const e=t.XpG();t.Y8G("formGroup",e.filterForm),t.R7$(3),t.Dyx(e.dateConditions),t.R7$(2),t.Y8G("hidePreviousNext",!0)}}let Nt=(()=>{class n{constructor(e,i,o,a,r,d){this.fb=e,this.customFieldsHelperService=i,this.translation=o,this.assetsFilterService=a,this.sortService=r,this.globalHelper=d,this.selectionLimit=5,this.filterTypeType=M.RJ,this.filterForm=this.fb.group([]),this.filterChangesSubscription=this.assetsFilterService.assetFilterChanges$.subscribe(h=>{this.filter=h})}ngOnInit(){this.filter=this.assetsFilterService.getFilter();let e=T.Zj[this.definition.type];e==T.Zj.NUMERIC?(this.filterType=M.RJ.NUMERIC,this.initNumericForm()):e===T.Zj.SELECT||e===T.Zj.MULTI_SELECT||"ASSET_STATUS"===this.definition.type||"ASSET_GROUP"===this.definition.type||"COST_LOCATION_GROUP"===this.definition.type||"STOCK_LOCATION_GROUP"===this.definition.type?(this.filterType=M.RJ.VALUES,this.values=Object.keys(this.definition.values).map(i=>({value:i,label:this.definition.values[i]})),this.initSelectionForm()):e==T.Zj.UNIT||e==T.Zj.PERSON||e==T.Zj.LOCATION?(this.filterType=M.RJ.VALUES,this.values=this.sortService.sort(Object.keys(this.definition.entities).map(i=>({value:i,label:this.definition.entities[i]})),"label",!1,!0),this.initSelectionForm()):e==T.Zj.DATE?(this.filterType=M.RJ.DATE,this.dateConditions=[this.customFieldsHelperService.getCondition(S.K.EQUALS),this.customFieldsHelperService.getCondition(S.K.BEFORE),this.customFieldsHelperService.getCondition(S.K.AFTER)],this.initDateForm()):e==T.Zj.BOOLEAN&&(this.filterType=M.RJ.BOOLEAN,this.values=[{value:!0,label:this.translation.get("allpages.yes")},{value:!1,label:this.translation.get("allpages.no")}],this.initBooleanForm()),"ASSET_GROUP"===this.definition.type||"COST_LOCATION_GROUP"===this.definition.type||"STOCK_LOCATION_GROUP"===this.definition.type?this.resetSubscription=this.assetsFilterService.groupFilterValueReset$.subscribe(i=>{this.fixGroups(i)}):"ASSET_STATUS"!==this.definition.type&&(this.resetSubscription=this.assetsFilterService.customFieldFilterValueReset$.subscribe(i=>{this.fixValues(i)}))}ngOnDestroy(){this.filterChangesSubscription&&this.filterChangesSubscription.unsubscribe(),this.resetSubscription&&this.resetSubscription.unsubscribe()}initNumericForm(){let e=this.definition.min,i=this.definition.max;if(this.filter.filters)for(let o of this.filter.filters)o.customFieldDefinitionId===this.definition.id&&(o.condition===S.K[S.K.GREATER_THAN]?e=+o.compareValue+1:o.condition===S.K[S.K.LESS_THAN]&&(i=+o.compareValue-1));this.filterForm=this.fb.group({greaterThan:[e,[c.k0.required]],lessThan:[i,[c.k0.required]]})}initSelectionForm(){this.filterForm=this.fb.group({selection:this.fb.array(this.getSelectionValues(this.selectionLimit))})}initDateForm(){let e=null,i=!1,o=this.dateConditions[0].type;if(this.filter.filters)for(let a of this.filter.filters)a.customFieldDefinitionId===this.definition.id&&(i=!(0,m.hX)(a.compareValue),e=this.globalHelper.parseDate(a.compareValue),o=S.K[a.condition]);this.filterForm=this.fb.group({active:i,condition:o,date:e}),(0,m.hX)(e)&&(this.condition.disable(),this.date.disable())}initBooleanForm(){let e=null;if(this.filter.filters)for(let i of this.filter.filters)i.customFieldDefinitionId===this.definition.id&&(e=i.compareValue);this.filterForm=this.fb.group({value:e})}submitSelectionForm(){let e=this.filterType==M.RJ.VALUES?S.K.IS_ONE_OF:S.K.EQUALS,i=[];
1this.selection.controls.forEach((o,a)=>{if("ASSET_STATUS"===this.definition.type?this.assetsFilterService.setAssetStatusFilter(+o.get("value").value,o.get("active").value):"ASSET_GROUP"===this.definition.type?this.assetsFilterService.setGroupFilter(+o.get("value").value,o.get("active").value,_.MH.UNIT):"COST_LOCATION_GROUP"===this.definition.type?this.assetsFilterService.setGroupFilter(+o.get("value").value,o.get("active").value,_.MH.COST_LOCATION):"STOCK_LOCATION_GROUP"===this.definition.type?this.assetsFilterService.setGroupFilter(+o.get("value").value,o.get("active").value,_.MH.STOCK_LOCATION):this.assetsFilterService.setCustomFieldsFilterItem(this.definition.id,e,o.get("value").value,this.filterType,!o.get("active").value,T.Zj[this.definition.type]),!o.get("active").value&&a>=this.selectionLimit&&i.push(a),this.valuesSelection){let r=this.valuesSelection.controls.find((d,h)=>{if(o.get("value").value==d.get("value").value)return!0});r&&r.get("active").setValue(o.get("active").value)}}),this.removeSelectionControls(i)}submitNumericForm(){this.greaterThan.value<this.definition.min&&this.greaterThan.setValue(this.definition.min),this.lessThan.value>this.definition.max&&this.lessThan.setValue(this.definition.max);let e=this.greaterThan.value===this.definition.min&&this.lessThan.value===this.definition.max;this.assetsFilterService.setCustomFieldsFilterItem(this.definition.id,S.K.GREATER_THAN,this.greaterThan.value-1,M.RJ.NUMERIC,e),this.assetsFilterService.setCustomFieldsFilterItem(this.definition.id,S.K.LESS_THAN,this.lessThan.value+1,M.RJ.NUMERIC,e)}submitDateForm(){this.active.value?(this.condition.enable(),this.date.enable(),this.date.value||this.date.setValue(new Date)):(this.date.disable(),this.date.setValue(null),this.condition.disable());const e=this.date.value?this.globalHelper.formatDate(this.date.value,!1):null;this.assetsFilterService.setCustomFieldsFilterItem(this.definition.id,this.condition.value,e,this.filterType)}submitBooleanForm(){this.assetsFilterService.setCustomFieldsFilterItem(this.definition.id,S.K.EQUALS,this.value.value,this.filterType,(0,m.hX)(this.value.value))}toggleOptionsPopup(e){if(this.optionsPopupVisible=!this.optionsPopupVisible,this.optionsPopupVisible)this.valuesSelection?this.searchValue.setValue(null):(this.filterForm.addControl("searchValue",this.fb.control(null)),this.filterForm.addControl("valuesSelection",this.fb.array(this.getSelectionValues())));else if(e){let i=[];this.valuesSelection.controls.forEach(o=>{let r,a=o.get("active").value,d=this.selection.controls.find((h,g)=>{if(h.get("value").value==o.get("value").value)return r=g,!0});d?!(0,m.hX)(r)&&r<this.selectionLimit?d.get("active").setValue(a):a||i.push(r):a&&this.selection.push(this.fb.group({value:o.get("value").value,active:a,label:o.get("label").value}))}),this.removeSelectionControls(i),this.submitSelectionForm()}}isVisibleValue(e){let i=this.searchValue.value?this.searchValue.value.trim().toLowerCase():null;return!(i&&-1==e.toLowerCase().indexOf(i))}getSelectionValues(e){let i=[];return this.values.forEach((o,a)=>{let r=!1;if("ASSET_STATUS"===this.definition.type)r=this.filter.statuses&&-1!=this.filter.statuses.indexOf(+o.value);else if("ASSET_GROUP"===this.definition.type)r=this.filter.assetGroups&&-1!=this.filter.assetGroups.indexOf(+o.value);else if("COST_LOCATION_GROUP"===this.definition.type)r=this.filter.costLocationGroups&&-1!=this.filter.costLocationGroups.indexOf(+o.value);else if("STOCK_LOCATION_GROUP"===this.definition.type)r=this.filter.stockLocationGroups&&-1!=this.filter.stockLocationGroups.indexOf(+o.value);else if(this.filter.filters)for(let d of this.filter.filters)d.customFieldDefinitionId===this.definition.id&&(r=d.compareValue===o.value);(!e||a<e||r)&&i.push(this.fb.group({value:o.value,active:r,label:o.label}))}),i}removeSelectionControls(e){if(0!=e.length){let i=e.length;for(;i--;)this.selection.controls.splice(e[i],1)}}fixValues(e){if(e.definitionId===this.definition.id){let i=T.Zj[this.definition.type];i==T.Zj.NUMERIC?(this.greaterThan.setValue(this.definition.min),this.lessThan.setValue(this.definition.max),this.submitNumericForm()):i===T.Zj.SELECT||i===T.Zj.MULTI_SELECT||i==T.Zj.UNIT||i==T.Zj.PERSON||i==T.Zj.LOCATION?(this.fixSelection(e.compareValue,e.entityId,this.selection),this.fixSelection(e.compareValue,e.entityId,this.valuesSelection)):i==T.Zj.DATE?(this.active.setValue(null),this.submitDateForm()):i==T.Zj.BOOLEAN&&(this.value.setValue(null),this.submitBooleanForm())}}fixGroups(e){("ASSET_GROUP"===this.definition.type&&e.type===_.MH.UNIT||"COST_LOCATION_GROUP"===this.definition.type&&e.type===_.MH.COST_LOCATION||"STOCK_LOCATION_GROUP"===this.definition.type&&e.type===_.MH.STOCK_LOCATION)&&(this.fixSelection(e.groupId,null,this.selection),this.fixSelection(e.groupId,null,this.valuesSelection))}fixSelection(e,i,o){if(o){let a=o.controls.find((r,d)=>(0,m.hX)(i)?e==r.get("value").value:i==r.get("value").value);a&&(a.get("active").setValue(!1),this.submitSelectionForm())}}get searchValue(){return this.filterForm.get("searchValue")}get greaterThan(){return this.filterForm.get("greaterThan")}get lessThan(){return this.filterForm.get("lessThan")}get selection(){return this.filterForm.get("selection")}get valuesSelection(){return this.filterForm.get("valuesSelection")}get active(){return this.filterForm.get("active")}get condition(){return this.filterForm.get("condition")}get date(){return this.filterForm.get("date")}
1get entityId(){return this.filterForm.get("entityId")}get value(){return this.filterForm.get("value")}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(c.ze),t.rXU(Vt.q),t.rXU(f.L),t.rXU(I.N),t.rXU(C.a),t.rXU(K.$))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["custom-fields-filter-item"]],inputs:{definition:"definition",filterSearch:"filterSearch"},standalone:!1,decls:4,vars:1,consts:[[3,"formGroup"],[1,"row",3,"formGroup"],[1,"dateSelectionForm",3,"formGroup"],[1,"row","numericForm"],[1,"col-4"],["type","number","formControlName","greaterThan",1,"form-control","form-control-sm","float-start"],[1,"col-1","toLabel"],["type","number","formControlName","lessThan",1,"form-control","form-control-sm","float-start"],[1,"col-3"],[1,"fas","fa-chevron-right","action","float-start",3,"click"],["formArrayName","selection",1,"col-md-12","filterItem",3,"ngClass"],[3,"formGroupName"],["type","checkbox","formControlName","active",3,"change"],[3,"innerHTML"],[3,"click"],[1,"fas","fa-search","action","float-start"],[1,"popupBackgroundOverlay"],[1,"optionsPopup"],[1,"popupContent","empty"],[1,"optionForm"],["type","button","data-dismiss","alert","aria-label","Close",1,"btn-close","float-end",3,"click"],[1,"has-feedback","form-group"],[1,"input-group","input-group-sm"],[1,"input-group-text"],[1,"fas","fa-search"],["type","text","formControlName","searchValue",1,"form-control-sm","form-control",3,"placeholder"],[1,"fas","fa-times","form-control-feedback",3,"click","ngClass"],[1,"selectionListContainer"],[1,"row"],[1,"col-12"],["type","button",1,"btn","btn-sm","submit",3,"click"],["formArrayName","valuesSelection"],["type","checkbox","formControlName","active"],[1,"row","dateSelectionForm"],[1,"filterItem","col-md-12",3,"ngClass"],["type","radio","formControlName","value",3,"change","value"],["type","checkbox","formControlName","active",1,"m-0",3,"change"],["formControlName","condition",1,"form-select",3,"change"],[3,"value"],["formControlName","date",3,"change","hidePreviousNext"]],template:function(i,o){if(1&i&&t.nVh(0,Os,11,4,"form",0)(1,Is,3,3,"form",1)(2,Ls,11,8,"form",0)(3,Es,6,2,"form",2),2&i){let a;t.vxM((a=o.filterType)===o.filterTypeType.NUMERIC?0:a===o.filterTypeType.VALUES?1:a===o.filterTypeType.BOOLEAN?2:a===o.filterTypeType.DATE?3:-1)}},dependencies:[p.YU,bs.G,c.qT,c.xH,c.y7,c.me,c.Q0,c.Zm,c.wz,c.Fm,c.BC,c.cb,c.j4,c.JD,c.$R,c.v8,b.D,V.v],styles:["[_nghost-%COMP%]{width:100%;padding:10px}[_nghost-%COMP%] label[_ngcontent-%COMP%]{font-weight:400}[_nghost-%COMP%] ul[_ngcontent-%COMP%]{margin-bottom:0}[_nghost-%COMP%] .filterItem[_ngcontent-%COMP%]{border:1px solid transparent;transition:.15s}[_nghost-%COMP%] .filterItem[_ngcontent-%COMP%]:hover{background-color:var(--colors-attention-light);border:1px solid var(--colors-general-soft-grey)}[_nghost-%COMP%] .filter-checked[_ngcontent-%COMP%]{background-color:var(--colors-attention-light);border:1px solid transparent}[_nghost-%COMP%] .filter-checked[_ngcontent-%COMP%]:hover{background-color:var(--colors-attention-soft);border:1px solid var(--colors-attention-primary)}[_nghost-%COMP%] input[type=checkbox][_ngcontent-%COMP%], [_nghost-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-right:5px}[_nghost-%COMP%] input[type=checkbox].float-start[_ngcontent-%COMP%], [_nghost-%COMP%] input[type=radio].float-start[_ngcontent-%COMP%]{margin-top:8px}[_nghost-%COMP%] a[_ngcontent-%COMP%]{margin-top:5px;margin-left:10px;display:inline-block;cursor:pointer}[_nghost-%COMP%] a[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%]{margin-right:5px}[_nghost-%COMP%] .numericForm[_ngcontent-%COMP%] .toLabel[_ngcontent-%COMP%]{line-height:30px;padding:0;text-align:center;text-transform:lowercase}[_nghost-%COMP%] .numericForm[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%]{line-height:24px}[_nghost-%COMP%] .dateSelectionForm[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center}[_nghost-%COMP%] .dateSelectionForm[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:85px}[_nghost-%COMP%] .dateForm[_ngcontent-%COMP%]{line-height:28px}[_nghost-%COMP%] .dateForm[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{margin:2px 0}
1[_nghost-%COMP%] .popupBackgroundOverlay[_ngcontent-%COMP%] .optionsPopup[_ngcontent-%COMP%]{max-width:500px;left:calc(50% - 250px);right:calc(50% - 250px);top:calc(var(--navigation-tabs-height) + 10px)}[_nghost-%COMP%] .popupBackgroundOverlay[_ngcontent-%COMP%] .optionsPopup[_ngcontent-%COMP%] .selectionListContainer[_ngcontent-%COMP%]{max-height:calc(100vh - var(--navigation-header-height) - 250px);overflow:auto;overflow-x:hidden}[_nghost-%COMP%] .popupBackgroundOverlay[_ngcontent-%COMP%] .has-feedback[_ngcontent-%COMP%] i.fas[_ngcontent-%COMP%]{top:0}"]})}}return n})();const js=(n,s)=>({"fa-caret-down":n,"fa-caret-right":s}),Ds=n=>({display:n});function ws(n,s){1&n&&t.nrm(0,"hr")}function Gs(n,s){if(1&n){const e=t.RV6();t.nVh(0,ws,1,0,"hr"),t.j41(1,"h3",0),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG();return l.Njj(a.toggleDefinition(o))}),t.nrm(2,"span",1),t.nI1(3,"highlight"),t.nrm(4,"i",2),t.k0s(),t.nrm(5,"custom-fields-filter-item",3)}if(2&n){const e=s.$implicit,i=s.$index,o=t.XpG();t.vxM(0!=i?0:-1),t.R7$(2),t.Y8G("innerHTML",t.i5U(3,6,e.description,o.filterSearch),t.npT),t.R7$(2),t.Y8G("ngClass",t.l_i(9,js,!o.hiddenDefinitions[e.id],o.hiddenDefinitions[e.id])),t.R7$(),t.Y8G("definition",e)("filterSearch",o.filterSearch)("ngStyle",t.eq3(12,Ds,o.hiddenDefinitions[e.id]?"none":"inline-block"))}}let $s=(()=>{class n{set allVisible(e){e?this.hiddenDefinitions={}:this.definitions.forEach(i=>{this.hiddenDefinitions[i.id]=!0})}set definitions(e){e&&(this._definitions=e,this.ready=!0,this.addAssetStatuses())}set assetStatuses(e){this._statuses=e,this.ready&&this.addAssetStatuses()}constructor(e,i,o){this.assetsService=e,this.translation=i,this.assetsFilterService=o,this.hiddenDefinitions={},this.assetsFilterService.assetFilterSearch$.subscribe(r=>{this.filterSearch=r,this.definitions.forEach(d=>{this.hiddenDefinitions[d.id]=!(!r||""==r.trim()||function a(r,d){let h=-1!=r.description.toLowerCase().indexOf(d.toLowerCase());if(!h){let g;if(r.values&&0!=r.values.length?g=r.values:r.entities&&0!=r.entities.length&&(g=r.entities),g)for(let P in g)-1!=g[P].toLowerCase().indexOf(d.toLowerCase())&&(h=!0)}return h}(d,r))})})}toggleDefinition(e){this.hiddenDefinitions[e.id]=!this.hiddenDefinitions[e.id]||!this.hiddenDefinitions[e.id]}addAssetStatuses(){if(this.assetStatuses){let e=new M.Bi;e.description=this.translation.get("allPages.unitStatus"),e.type="ASSET_STATUS",e.values=Object.keys(this.assetStatuses).reduce((o,a)=>(o[a]=this.assetStatuses[a].name,o),{}),this.definitions.splice(0,this.definitions[0]&&this.definitions[0].description==e.description?1:0,e)}}get assetStatuses(){return this._statuses}get definitions(){return this._definitions}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(x.T),t.rXU(f.L),t.rXU(I.N))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["custom-fields-filter"]],inputs:{allVisible:"allVisible",definitions:"definitions",assetStatuses:"assetStatuses"},standalone:!1,decls:2,vars:0,consts:[[3,"click"],[3,"innerHTML"],[1,"fas","action","float-end",3,"ngClass"],[3,"definition","filterSearch","ngStyle"]],template:function(i,o){1&i&&t.Z7z(0,Gs,6,14,null,null,t.fX1),2&i&&t.Dyx(o.definitions)},dependencies:[p.YU,p.B3,Nt,V.v],styles:["[_nghost-%COMP%]{padding-bottom:15px;display:inline-block;min-width:280px;width:100%}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;cursor:pointer}[_nghost-%COMP%] h3[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] hr[_ngcontent-%COMP%]{margin:10px 0 5px}"]})}}return n})();function Vs(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",5)(1,"div",6),t.EFF(2),t.nI1(3,"translate"),t.j41(4,"b",7),t.EFF(5),t.k0s()(),t.j41(6,"i",8),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.removeTypeFilter(o.groupType.UNIT))}),t.k0s()()}if(2&n){const e=t.XpG(2);t.R7$(2),t.SpI(" ",t.bMT(3,3,"assets.overview.types.assets"),":\xa0 "),t.R7$(2),t.Y8G("title",e.assetTypeFilter.description),t.R7$(),t.JRh(e.assetTypeFilter.description)}}function Ns(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",5)(1,"div",6),t.EFF(2),t.nI1(3,"translate"),t.j41(4,"b",7),t.EFF(5),t.k0s()(),t.j41(6,"i",8),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(3);return l.Njj(a.removeGroupsFilter(+o.key,a.groupType.UNIT))}),t.k0s()()}if(2&n){const e=s.$implicit;t.R7$(2),t.SpI(" ",t.bMT(3,3,"settings.groups.unit.fullTitle"),": "),t.R7$(2),t.Y8G("title",e.label),t.R7$(),t.JRh(e.label)}}function Xs(n,s){if(1&n&&t.Z7z(0,Ns,7,5,"li",5,t.fX1),2&n){const e=t.XpG(2);t.Dyx(e.assetGroupFilter)}}function Bs(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",5)(1,"div",6),t.EFF(2),t.nI1(3,"translate"),t.j41(4,"b",7),t.EFF(5),t.k0s()(),t.j41(6,"i",8),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.removeTypeFilter(o.groupType.COST_LOCATION))}),t.k0s()()}if(2&n){const e=t.XpG(2);t.R7$(2),t.SpI(" ",t.bMT(3,3,"assets.overview.types.costLocations"),":\xa0 "),t.R7$(2),t.Y8G("title",e.costLocationTypeFilter.description),t.R7$(),t.JRh(e.costLocationTypeFilter.description)}}function Us(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",5)(1,"div",6),t.EFF(2),t.nI1(3,"translate"),t.j41(4,"b",7),t.EFF(5),t.k0s()(),t.j41(6,"i",8),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(3);return l.Njj(a.removeGroupsFilter(+o.key,a.groupType.COST_LOCATION))}),t.k0s()()}if(2&n){const e=s.$implicit;t.R7$(2),t.SpI(" ",t.bMT(3,3,"assets.costLocation.groups"),": "),t.R7$(2),t.Y8G("title",e.label),t.R7$(),t.JRh(e.label)}}function Ys(n,s){if(1&n&&t.Z7z(0,Us,7,5,"li",5,t.fX1),2&n){const e=t.XpG(2);t.Dyx(e.costLocationGroupFilter)}}function Hs(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",5)(1,"div",6),t.EFF(2),t.nI1(3,"translate"),t.j41(4,"b",7),t.EFF(5),t.k0s()(),t.j41(6,"i",8),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.removeTypeFilter(o.groupType.STOCK_LOCATION))}),t.k0s()()}if(2&n){const e=t.XpG(2);t.R7$(2),t.SpI(" ",t.bMT(3,3,"assets.overview.types.stockLocations"),":\xa0 "),t.R7$(2),t.Y8G("title",e.stockLocationTypeFilter.description),t.R7$(),t.JRh(e.stockLocationTypeFilter.description)}}function zs(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",5)(1,"div",6),t.EFF(2),t.nI1(3,"translate"),t.j41(4,"b",7),t.EFF(5),t.k0s()(),t.j41(6,"i",8),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(3);return l.Njj(a.removeGroupsFilter(+o.key,a.groupType.STOCK_LOCATION))}),t.k0s()()}if(2&n){const e=s.$implicit;t.R7$(2),t.SpI(" ",t.bMT(3,3,"assets.stockLocation.groups"),": "),t.R7$(2),t.Y8G("title",e.label),t.R7$(),t.JRh(e.label)}}function Js(n,s){if(1&n&&t.Z7z(0,zs,7,5,"li",5,t.fX1),2&n){const e=t.XpG(2);t.Dyx(e.stockLocationGroupFilter)}}function Ks(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",5)(1,"div",6),t.EFF(2),t.nI1(3,"translate"),t.j41(4,"b",7),t.EFF(5),t.k0s()(),t.j41(6,"i",8),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(3);return l.Njj(a.removeStatusFilter(o))}),t.k0s()()}if(2&n){const e=s.$implicit;t.R7$(2),t.SpI(" ",t.bMT(3,3,"allPages.unitStatus"),":\xa0 "),t.R7$(2),t.Y8G("title",e.name),t.R7$(),t.JRh(e.name)}}function Zs(n,s){if(1&n&&t.Z7z(0,Ks,7,5,"li",5,t.fX1),2&n){const e=t.XpG(2);t.Dyx(e.statusFilter)}}function Ws(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",5)(1,"div",6),t.EFF(2),t.j41(3,"b",7),t.EFF(4),t.k0s()(),t.j41(5,"i",8),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(3);return l.Njj(a.removeCustomFieldFilter(o))}),t.k0s()()}if(2&n){const e=s.$implicit;t.R7$(2),t.SpI(" ",e.name,":\xa0 "),t.R7$(),t.Y8G("title",e.value),t.R7$(),t.JRh(e.value)}}function qs(n,s){if(1&n&&t.Z7z(0,Ws,6,3,"li",5,t.fX1),2&n){const e=t.XpG(2);t.Dyx(e.customFieldFilter)}}function Qs(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"a",4),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.removeAll())}),t.EFF(7),t.nI1(8,"translate"),t.k0s()()(),t.j41(9,"ul"),t.nVh(10,Vs,7,5,"li",5),t.nVh(11,Xs,2,0),t.nVh(12,Bs,7,5,"li",5),t.nVh(13,Ys,2,0),t.nVh(14,Hs,7,5,"li",5),t.nVh(15,Js,2,0),t.nVh(16,Zs,2,0),t.nVh(17,qs,2,0),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(4),t.JRh(t.bMT(5,10,"allpages.filter.current")),t.R7$(3),t.JRh(t.bMT(8,12,"allpages.filter.reset")),t.R7$(3),t.vxM(e.assetTypeFilter?10:-1),t.R7$(),t.vxM(e.assetGroupFilter?11:-1),t.R7$(),t.vxM(e.costLocationTypeFilter?12:-1),t.R7$(),t.vxM(e.costLocationGroupFilter?13:-1),t.R7$(),t.vxM(e.stockLocationTypeFilter?14:-1),t.R7$(),t.vxM(e.stockLocationGroupFilter?15:-1),t.R7$(),t.vxM(e.statusFilter?16:-1),t.R7$(),t.vxM(e.customFieldFilter?17:-1)}}let ta=(()=>{class n{constructor(e,i,o,a,r){this.assetsFilterService=e,this.sortService=i,this.assetsService=o,this.translation=a,this.customFieldsHelper=r,this.groupType=_.MH,this.assetsFilterService.assetFilterChanges$.subscribe(d=>{this.filter=d,this.setupSummary(d)})}ngOnInit(){this.filter=this.assetsFilterService.getFilter(),this.setupSummary(this.filter)}removeAll(){if(this.removeTypeFilter(_.MH.UNIT),this.removeTypeFilter(_.MH.COST_LOCATION),this.removeTypeFilter(_.MH.STOCK_LOCATION),this.assetGroupFilter)for(let e of this.assetGroupFilter)this.removeGroupsFilter(+e.ke
1y,_.MH.UNIT);if(this.costLocationGroupFilter)for(let e of this.costLocationGroupFilter)this.removeGroupsFilter(+e.key,_.MH.COST_LOCATION);if(this.stockLocationGroupFilter)for(let e of this.stockLocationGroupFilter)this.removeGroupsFilter(+e.key,_.MH.STOCK_LOCATION);if(this.statusFilter)for(let e of this.statusFilter)this.removeStatusFilter(e);if(this.customFieldFilter)for(let e of this.customFieldFilter)this.removeCustomFieldFilter(e)}removeTypeFilter(e){switch(e){case _.MH.UNIT:this.filter.assetType=null;break;case _.MH.COST_LOCATION:this.filter.costLocationType=null;break;case _.MH.STOCK_LOCATION:this.filter.stockLocationType=null}this.assetsFilterService.setFilterChanged(this.filter)}removeGroupsFilter(e,i){switch(i){case _.MH.UNIT:this.filter.assetGroups=null;break;case _.MH.COST_LOCATION:this.filter.costLocationGroups=null;break;case _.MH.STOCK_LOCATION:this.filter.stockLocationGroups=null}this.assetsFilterService.setGroupFilter(e,!1,i,!0)}removeStatusFilter(e){this.assetsFilterService.setAssetStatusFilter(e.id,!1)}removeCustomFieldFilter(e){this.assetsFilterService.resetFilterValue(e)}setupSummary(e){let i=this;function o(d,h){if(!(0,m.hX)(d)){let g;for(let P of h)g||(P.id===d?g=P:P.subTypes&&0!=P.subTypes.length&&(g=o(d,P.subTypes)));return g}return null}function r(d,h){return!(0,m.hX)(d)&&0!=d.length&&h?i.sortService.sort(d.map(g=>({key:g,label:h[g]}))):null}this.assetTypeFilter=o(e.assetType,this.assetTypes),this.costLocationTypeFilter=o(e.costLocationType,this.costLocationTypes),this.stockLocationTypeFilter=o(e.stockLocationType,this.stockLocationTypes),this.assetGroupFilter=r(e.assetGroups,this.assetGroups),this.costLocationGroupFilter=r(e.costLocationGroups,this.costLocationGroups),this.stockLocationGroupFilter=r(e.stockLocationGroups,this.stockLocationGroups),this.statusFilter=function a(d,h){return(0,m.hX)(e.statuses)||0==e.statuses.length?null:i.sortService.sort(d.map(g=>{let P=h[g];return P.id=g,P}),"name",!1,!0)}(e.statuses,this.assetStatuses),this.customFieldFilter=(0,m.hX)(e.filters)||0==e.filters.length?null:this.getCustomFieldFilter(e.filters)}getCustomFieldFilter(e){let i=this.assetsService.getLastFilter().definitions,o=[];for(let r of e){let d=i.find(h=>h.id==r.customFieldDefinitionId);if(d){let h=r.compareValue;if(d.type===T.Zj[T.Zj.BOOLEAN])h=this.translation.get(h?"allpages.yes":"allpages.no");else if(d.type===T.Zj[T.Zj.DATE])h=this.customFieldsHelper.getCondition(S.K[r.condition]).label+" "+h;else if(d.type===T.Zj[T.Zj.NUMERIC])if(r.condition===S.K[S.K.GREATER_THAN]){let g=e.find(P=>r.customFieldDefinitionId===P.customFieldDefinitionId&&P.condition===S.K[S.K.LESS_THAN]);h=g?+r.compareValue+1+" "+this.translation.get("allpages.to")+" "+(+g.compareValue-1):null}else h=null;else if(d.type===T.Zj[T.Zj.UNIT]||d.type===T.Zj[T.Zj.PERSON]||d.type===T.Zj[T.Zj.LOCATION]){for(let g of r.compareValue.split("|"))d.entities[+g]&&a(d,d.entities[+g],r.compareValue,+g);h=null}(0,m.hX)(h)||a(d,h,r.compareValue)}}return o;function a(r,d,h,g){o.push({definitionId:r.id,name:r.description,compareValue:h,value:d,entityId:g,definitionType:"string"==typeof r.type?T.Zj[r.type]:r.type})}}get hasFilter(){return!((0,m.hX)(this.assetTypeFilter)&&(0,m.hX)(this.costLocationTypeFilter)&&(0,m.hX)(this.stockLocationTypeFilter)&&(0,m.hX)(this.assetGroupFilter)&&(0,m.hX)(this.costLocationGroupFilter)&&(0,m.hX)(this.stockLocationGroupFilter)&&(0,m.hX)(this.statusFilter)&&(0,m.hX)(this.customFieldFilter))}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(I.N),t.rXU(C.a),t.rXU(x.T),t.rXU(f.L),t.rXU(Vt.q))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["asset-filter-summary"]],inputs:{assetStatuses:"assetStatuses",assetTypes:"assetTypes",costLocationTypes:"costLocationTypes",stockLocationTypes:"stockLocationTypes",assetGroups:"assetGroups",costLocationGroups:"costLocationGroups",stockLocationGroups:"stockLocationGroups"},standalone:!1,decls:1,vars:1,consts:[[1,"assetFilterSummaryContainer"],[1,"px-2","py-1","mb-2"],[1,"d-flex","align-items-center","justify-content-between"],[1,"float-start","m-0"],[1,"link","float-end",3,"click"],[1,"filterContainer","px-2","py-1"],[1,"col-11","filterName"],[3,"title"],[1,"fas","fa-times","col-1","float-end","action",3,"click"]],template:function(i,o){1&i&&t.nVh(0,Qs,18,14,"div",0),2&i&&t.vxM(o.hasFilter?0:-1)},dependencies:[b.D],styles:[".assetFilterSummaryContainer[_ngcontent-%COMP%]{background-color:var(--colors-attention-light);padding:10px;margin-top:15px}
1ul[_ngcontent-%COMP%]{margin:0;padding:0}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{border:1px solid transparent;overflow:hidden;background-color:var(--colors-attention-light)}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover{background-color:var(--colors-attention-soft);border:1px solid var(--colors-attention-primary)}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--colors-attention-primary)}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%]{margin:3px 0}.filterName[_ngcontent-%COMP%]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.filterContainer[_ngcontent-%COMP%]{display:flex}.filterContainer[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{text-align:end}"]})}}return n})();const ea=n=>({collapsed:n}),na=(n,s)=>({"fa-angles-left":n,"fa-angles-right":s}),yt=(n,s)=>({"fa-caret-down":n,"fa-caret-right":s});function ia(n,s){if(1&n){const e=t.RV6();t.j41(0,"button",9),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.toggleSidePanel.emit())}),t.nrm(1,"i",10),t.EFF(2),t.nI1(3,"translate"),t.k0s()}2&n&&(t.R7$(2),t.SpI(" \xa0",t.bMT(3,1,"permission.PAGE_DASHBOARD")," "))}function oa(n,s){1&n&&(t.EFF(0),t.nI1(1,"translate")),2&n&&t.SpI(" ",t.bMT(1,1,"allpages.expandAll")," ")}function sa(n,s){1&n&&(t.EFF(0),t.nI1(1,"translate")),2&n&&t.SpI(" ",t.bMT(1,1,"allpages.collapseAll")," ")}function aa(n,s){if(1&n){const e=t.RV6();t.j41(0,"i",20),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.clearSearch())}),t.k0s()}}function la(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",6)(1,"div",2)(2,"h2",11),t.nrm(3,"i",12),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"a",13),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.toggleAll())}),t.nVh(7,oa,2,3),t.nVh(8,sa,2,3),t.k0s()(),t.j41(9,"div",14)(10,"div",15)(11,"div",16),t.nrm(12,"i",17),t.k0s(),t.j41(13,"input",18),t.nI1(14,"translate"),t.mxI("ngModelChange",function(o){l.eBV(e);const a=t.XpG();return t.DH7(a.filterSearch,o)||(a.filterSearch=o),l.Njj(o)}),t.bIt("ngModelChange",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.setFilterSearch())}),t.k0s(),t.nVh(15,aa,1,0,"i",19),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(4),t.SpI(" ",t.bMT(5,7,"allpages.filter")," "),t.R7$(3),t.vxM(e.allVisible?-1:7),t.R7$(),t.vxM(e.allVisible?8:-1),t.R7$(5),t.Y8G("placeholder",t.mNQ(t.bMT(14,9,"assets.overview.search.filter"))),t.R50("ngModel",e.filterSearch),t.R7$(2),t.vxM(e.filterSearch&&""!=e.filterSearch?15:-1)}}function ra(n,s){if(1&n&&t.nrm(0,"asset-filter-summary",7),2&n){const e=t.XpG();t.Y8G("assetTypes",e.assetTypes)("costLocationTypes",e.costLocationTypes)("stockLocationTypes",e.stockLocationTypes)("assetGroups",e.assetGroups)("costLocationGroups",e.costLocationGroups)("stockLocationGroups",e.stockLocationGroups)("assetStatuses",e.assetStatuses)}}function ca(n,s){if(1&n&&(t.j41(0,"div",21),t.nrm(1,"entity-type-selector",23),t.k0s(),t.nrm(2,"hr")),2&n){const e=t.XpG(2);t.R7$(),t.Y8G("types",e.assetTypes)("groupType",e.groupType.UNIT)("root",!0)("visible",e.allVisible)}}function pa(n,s){if(1&n&&t.nrm(0,"custom-fields-filter-item",28),2&n){const e=t.XpG(3);t.Y8G("definition",e.groupOptions.UNIT.definition)("filterSearch",e.filterSearch)}}function ua(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",21)(1,"div",24)(2,"h3",25),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.groupOptions.UNIT.visible=!o.groupOptions.UNIT.visible)}),t.nrm(3,"span",26),t.nI1(4,"highlight"),t.nrm(5,"i",27),t.k0s(),t.nVh(6,pa,1,2,"custom-fields-filter-item",28),t.k0s()(),t.nrm(7,"hr")}if(2&n){const e=t.XpG(2);t.R7$(3),t.Y8G("innerHTML",t.i5U(4,3,e.groupOptions.UNIT.definition.description,e.filterSearch),t.npT),t.R7$(2),t.Y8G("ngClass",t.l_i(6,yt,e.groupOptions.UNIT.visible,!e.groupOptions.UNIT.visible)),t.R7$(),t.vxM(e.groupOptions.UNIT.visible?6:-1)}}function da(n,s){if(1&n&&(t.j41(0,"div",21),t.nrm(1,"entity-type-selector",23),t.k0s(),t.nrm(2,"hr")),2&n){const e=t.XpG(2);t.R7$(),t.Y8G("types",e.costLocationTypes)("groupType",e.groupType.COST_LOCATION)("root",!0)("visible",e.allVisible)}}function _a(n,s){if(1&n&&t.nrm(0,"custom-fields-filter-item",28),2&n){const e=t.XpG(3);t.Y8G("definition",e.groupOptions.COST_LOCATION.definition)("filterSearch",e.filterSearch)}}function ma(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",21)(1,"div",24)(2,"h3",25),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.groupOptions.COST_LOCATION.visible=!o.groupOptions.COST_LOCATION.visible)}),t.nrm(3,"span",26),t.nI1(4,"highlight"),t.nrm(5,"i",27),t.k0s(),t.nVh(6,_a,1,2,"custom-fields-filter-item",28),t.k0s()(),t.nrm(7,"hr")}if(2&n){const e=t.XpG(2);t.R7$(3),t.Y8G("innerHTML",t.i5U(4,3,e.groupOptions.COST_LOCATION.definition.description,e.filterSearch),t.npT),t.R7$(2),t.Y8G("ngClass",t.l_i(6,yt,e.groupOptions.COST_LOCATION.visible,!e.groupOptions.COST_LOCATION.visible)),t.R7$(),t.vxM(e.groupOptions.COST_LOCATION.visible?6:-1)}}function ha(n,s){if(1&n&&(t.j41(0,"div",21),t.nrm(1,"entity-type-selector",23),t.k0s(),t.nrm(2,"hr")),2&n){const e=t.XpG(2);
1t.R7$(),t.Y8G("types",e.stockLocationTypes)("groupType",e.groupType.STOCK_LOCATION)("root",!0)("visible",e.allVisible)}}function ga(n,s){if(1&n&&t.nrm(0,"custom-fields-filter-item",28),2&n){const e=t.XpG(3);t.Y8G("definition",e.groupOptions.STOCK_LOCATION.definition)("filterSearch",e.filterSearch)}}function Ca(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",21)(1,"div",24)(2,"h3",25),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.groupOptions.STOCK_LOCATION.visible=!o.groupOptions.STOCK_LOCATION.visible)}),t.nrm(3,"span",26),t.nI1(4,"highlight"),t.nrm(5,"i",27),t.k0s(),t.nVh(6,ga,1,2,"custom-fields-filter-item",28),t.k0s()(),t.nrm(7,"hr")}if(2&n){const e=t.XpG(2);t.R7$(3),t.Y8G("innerHTML",t.i5U(4,3,e.groupOptions.STOCK_LOCATION.definition.description,e.filterSearch),t.npT),t.R7$(2),t.Y8G("ngClass",t.l_i(6,yt,e.groupOptions.STOCK_LOCATION.visible,!e.groupOptions.STOCK_LOCATION.visible)),t.R7$(),t.vxM(e.groupOptions.STOCK_LOCATION.visible?6:-1)}}function fa(n,s){if(1&n&&(t.j41(0,"div",8),t.nVh(1,ca,3,4),t.nVh(2,ua,8,9),t.nVh(3,da,3,4),t.nVh(4,ma,8,9),t.nVh(5,ha,3,4),t.nVh(6,Ca,8,9),t.j41(7,"div",21),t.nrm(8,"custom-fields-filter",22),t.k0s()()),2&n){const e=t.XpG();t.R7$(),t.vxM(e.assetTypes?1:-1),t.R7$(),t.vxM(e.groupOptions&&e.groupOptions.UNIT?2:-1),t.R7$(),t.vxM(e.costLocationTypes?3:-1),t.R7$(),t.vxM(e.groupOptions&&e.groupOptions.COST_LOCATION?4:-1),t.R7$(),t.vxM(e.stockLocationTypes?5:-1),t.R7$(),t.vxM(e.groupOptions&&e.groupOptions.STOCK_LOCATION?6:-1),t.R7$(2),t.Y8G("assetStatuses",e.assetStatuses)("definitions",e.definitions)("allVisible",e.allVisible)}}let va=(()=>{class n{constructor(e,i,o,a){this.typesService=e,this.assetsService=i,this.assetsFilterService=o,this.translation=a,this.toggleSidePanel=new t.bkB,this.collapseSidePanel=new t.bkB,this.groupType=_.MH,this.allVisible=!0,this.assetsFilterService.assetFilterChanges$.subscribe(r=>{let d=this.filter?this.filter.assetType:null;this.filter=JSON.parse(JSON.stringify(r)),r.assetType!==d&&this.getFilter(r.assetType,!1)})}ngOnInit(){this.filter||(this.filter=JSON.parse(JSON.stringify(this.assetsFilterService.getFilter()))),this.getFilter(null,!0)}collapse(){this.collapseSidePanel.emit()}toggleAll(){this.allVisible=!this.allVisible,Object.keys(this.groupOptions).forEach(e=>{this.groupOptions[e].visible=this.allVisible})}setFilterSearch(){this.assetsFilterService.setFilterSearch(this.filterSearch);for(let e in this.groupOptions)if(this.groupOptions[e].definition.values){let i=this.filterSearch?this.filterSearch.toLowerCase().trim():null;i&&i.length>0?(this.groupOptions[e].visible=!1,Object.values(this.groupOptions[e].definition.values).forEach(o=>{-1!=o.toLowerCase().indexOf(i)&&(this.groupOptions[e].visible=!0)})):this.groupOptions[e].visible=!0}}clearSearch(){this.filterSearch="",this.setFilterSearch()}getFilter(e,i){this.fetchingFilter=!0,this.assetsService.getFilter(e,i).subscribe(o=>{this.definitions=o.definitions,o.costLocationTypes&&(this.costLocationTypes=o.costLocationTypes),o.stockLocationTypes&&(this.stockLocationTypes=o.stockLocationTypes),o.assetTypes&&(this.assetTypes=o.assetTypes),(o.assetGroups||o.costLocationGroups||o.stockLocationGroups)&&(this.assetGroups=o.assetGroups,this.costLocationGroups=o.costLocationGroups,this.stockLocationGroups=o.stockLocationGroups,this.initGroupOptions()),this.fetchingFilter=!1})}initGroupOptions(){function e(i,o,a){let r=new M.Bi;return r.description=a,r.type=o,r.values=i,r}this.groupOptions={},this.assetGroups&&(this.groupOptions.UNIT={visible:!0,definition:e(this.assetGroups,"ASSET_GROUP",this.translation.get("settings.groups.unit.fullTitle"))}),this.costLocationGroups&&(this.groupOptions.COST_LOCATION={visible:!0,definition:e(this.costLocationGroups,"COST_LOCATION_GROUP",this.translation.get("assets.costLocation.groups"))}),this.stockLocationGroups&&(this.groupOptions.STOCK_LOCATION={visible:!0,definition:e(this.stockLocationGroups,"STOCK_LOCATION_GROUP",this.translation.get("assets.stockLocation.groups"))})}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(ls.V),t.rXU(x.T),t.rXU(I.N),t.rXU(f.L))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["asset-filter-panel"]],inputs:{assetStatuses:"assetStatuses",filterVisible:"filterVisible"},outputs:{toggleSidePanel:"toggleSidePanel",collapseSidePanel:"collapseSidePanel"},standalone:!1,decls:9,vars:11,consts:[[1,"containerContent"],[1,"filterHeader"],[1,"d-flex","align-items-center","justify-content-between"],[1,"btn","btn-secondary","dashboardToggle"],[1,"headerItem",3,"click","ngClass"],[1,"fa-solid","fa-lg","action","fa-sm",3,"ngClass"],[1,"headerItem"],[3,"assetTypes","costLocationTypes","stockLocationTypes","assetGroups","costLocationGroups","stockLocationGroups","assetStatuses"],[1,"overflow-auto"],[1,"btn","btn-secondary","dashboardToggle",3,"click"],[1,"fa-solid","fa-angle-left","action"],[1,"mt-0","pt-2"],[1,"fa-solid","fa-filter","fa-fw"],[1,"link","me-1",3,"click"],[1,"filterSection","quickSearch"],[1,"has-feedback","input-group","input-group-sm"],[1,"input-group-text","form-control-sm"],[1,"fas","fa-search"],["type","text",1,"form-control","form-control-sm",3,"ngModelChange","placeholder","ngModel"],[1,"fas","fa-times","form-control-feedback","action"],[1,"fas","fa-times","form-control-feedback","action",3,"click"],[1,"filterSection"],[1,"container-fluid",3,"assetStatuses","definitions","allVisible"],[3,"types","groupType","root","visible"],[1,"container-fluid"],[3,"click"],[3,"innerHTML"],[1,"fas","action","float-end",3,"ngClass"],[3,"definition","filterSearch"]],template:function(i,o){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2),t.nVh(3,ia,4,3,"button",3),t.j41(4,"div",4),t.bIt("click",function(){return o.collapse()}),t.nrm(5,"i",5),t.k0s()(),t.nVh(6,la,16,11,"div",6),t.nVh(7,ra,1,7,"asset-filter-summary",7),t.k0s(),t.nVh(8,fa,9,9,"div",8),t.k0s()),2&i&&(t.R7$(3),t.vxM(o.filterVisible?3:-1),t.R7$(),t.Y8G("ngClass",t.eq3(6,ea,!o.filterVisible)),t.R7$(),t.Y8G("ngClass",t.l_i(8,na,o.filterVisible,!o.filterVisible)),t.R7$(),t.vxM(o.filterVisible?6:-1),t.R7$(),t.vxM(o.fetchingFilter?-1:7),t.R7$(),t.vxM(o.filterVisible?8:-1))},dependencies:[p.YU,c.me,c.BC,c.vS,vs,$s,Nt,ta,b.D,V.v],styles:["[_nghost-%COMP%]{display:block;height:100%;overflow:hidden}[_nghost-%COMP%] h2[_ngcontent-%COMP%]{font-size:13px}[_nghost-%COMP%] .containerContent[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column}[_nghost-%COMP%] hr[_ngcontent-%COMP%]{margin:10px 12px 5px}[_nghost-%COMP%] .filterSection.quickSearch[_ngcontent-%COMP%] a[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%]{margin-right:5px}[_nghost-%COMP%] .filterSection.quickSearch[_ngcontent-%COMP%] .has-feedback[_ngcontent-%COMP%]{margin-top:5px}[_nghost-%COMP%] .filterSection.quickSearch[_ngcontent-%COMP%] .has-feedback[_ngcontent-%COMP%] .form-control-feedback[_ngcontent-%COMP%]{top:0;z-index:5}[_nghost-%COMP%] .filterSection[_ngcontent-%COMP%] .container-fluid[_ngcontent-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] .filterSection[_ngcontent-%COMP%] .container-fluid[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;cursor:pointer}[_nghost-%COMP%] .filterSection[_ngcontent-%COMP%] .container-fluid[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.filterHeader[_ngcontent-%COMP%]{background-color:var(--colors-general-white);border-bottom:1px solid var(--colors-general-soft-grey)}.headerItem[_ngcontent-%COMP%]{padding:10px;margin:5px;cursor:pointer}.dashboardToggle[_ngcontent-%COMP%]{margin:15px;border-color:var(--colors-general-soft-grey);font-weight:400;font-size:12px}"]})}}return n})();const ba=n=>({docked:n}),Ta=(n,s)=>({"fa-warehouse":n,"fa-person-digging":s});function Oa(n,s){if(1&n&&(t.j41(0,"div",4)(1,"div",7),t.nrm(2,"search-field",8),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.Y8G("formControl",e.locationQuery)}}function Ma(n,s){if(1&n){const e=t.RV6();t.j41(0,"tr",9),t.bIt("click",function(){l.eBV(e);const o=t.XpG().$implicit,a=t.XpG();return l.Njj(a.showDetail(o.id))}),t.j41(1,"td",10),t.nrm(2,"i",11),t.k0s(),t.nrm(3,"td",12),t.nI1(4,"highlight"),t.j41(5,"td")(6,"span",13),t.EFF(7),t.k0s()()()}if(2&n){const e=t.XpG().$implicit,i=t.XpG();t.R7$(2),t.Y8G("ngClass",t.l_i(6,Ta,"STOCK_LOCATION"===e.group,"COST_LOCATION"===e.group)),t.R7$(),t.Y8G("innerHTML",t.i5U(4,3,e.name,null==i.locationQuery?null:i.locationQuery.value),t.npT),t.R7$(4),t.JRh(e.amount||0)}}function xa(n,s){if(1&n&&t.nVh(0,Ma,8,9,"tr"),2&n){const e=s.$index,i=t.XpG();t.vxM(e<i.visibleItems?0:-1)}}let Pa=(()=>{class n{set locations(e){this._locations=e,this.prepareSearchForm(),this.filterCostStockLocations(),this.changeDetector.markForCheck()}constructor(e,i,o){this.assetsFilterService=e,this.fb=i,this.changeDetector=o,this.toggleDocking=new t.bkB,this.visibleItems=20}ngOnDestroy(){this.locationQuerySubscription&&this.locationQuerySubscription.unsubscribe()}
1showDetail(e){this.assetsFilterService.performAction({action:"LOCATION_DETAIL",data:e})}addMoreItems(){this.visibleItems+=20,this.changeDetector.markForCheck()}prepareSearchForm(){(0,m.hX)(this.locationQuery)&&this.locations.length>10&&(this.locationQuery=this.fb.control(null),this.locationQuerySubscription=this.locationQuery.valueChanges.pipe((0,R.F)(),(0,w.B)(500)).subscribe(e=>{this.filterCostStockLocations()}))}filterCostStockLocations(){if(this.locations){this.visibleItems=20;let e=JSON.parse(JSON.stringify(this.locations));!(0,m.hX)(this.locationQuery)&&!(0,m.hX)(this.locationQuery.value)&&this.locationQuery.value.length>=3&&(e=e.filter(i=>-1!==i.name.toLowerCase().indexOf(this.locationQuery.value.toLowerCase()))),this.visibleLocations=e}else this.visibleLocations=[];this.changeDetector.markForCheck()}get locations(){return this._locations}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(I.N),t.rXU(c.ok),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["asset-mobile-locations"]],inputs:{locations:"locations",docked:"docked"},outputs:{toggleDocking:"toggleDocking"},standalone:!1,decls:13,vars:12,consts:[[1,"fixedContent"],[1,"mobileLocationsAmount","float-start"],[1,"amount"],[1,"float-end",3,"click","icon","size","action"],[1,"row","mt-1","mb-1"],["infiniteScroll","",1,"scrollableContent",3,"scrolled","scrollWindow","ngClass"],[1,"table","table-hover"],[1,"col-12"],[3,"formControl"],[3,"click"],[1,"iconColumn"],[1,"fa-solid","fa-lg",3,"ngClass"],[3,"innerHTML"],[1,"badge","rounded-pill","float-end"]],template:function(i,o){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"span",2),t.EFF(3),t.k0s()(),t.EFF(4),t.nI1(5,"translate"),t.j41(6,"suivo-icon",3),t.bIt("click",function(){return o.toggleDocking.emit(!o.docked)}),t.k0s(),t.nVh(7,Oa,3,1,"div",4),t.k0s(),t.j41(8,"div",5),t.bIt("scrolled",function(){return o.addMoreItems()}),t.j41(9,"table",6)(10,"tbody"),t.Z7z(11,xa,1,1,null,null,t.fX1),t.k0s()()()),2&i&&(t.R7$(3),t.SpI("(",o.locations.length,")"),t.R7$(),t.SpI(" ",t.bMT(5,8,"assets.costStockLocation.mobile")," "),t.R7$(2),t.Y8G("icon",o.docked?"UNDOCK":"DOCK")("size",16)("action",!0),t.R7$(),t.vxM(o.locationQuery?7:-1),t.R7$(),t.Y8G("scrollWindow",!1)("ngClass",t.eq3(10,ba,o.docked)),t.R7$(3),t.Dyx(o.visibleLocations))},dependencies:[p.YU,lt.T,Y.q,c.BC,c.l_,Q.D,b.D,V.v],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .table[_ngcontent-%COMP%]{margin:0}[_nghost-%COMP%] .table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] th[_ngcontent-%COMP%]{line-height:40px!important}[_nghost-%COMP%] .fixedContent[_ngcontent-%COMP%]{line-height:40px;padding:5px 10px 5px 5px;min-width:150px;max-width:200px}[_nghost-%COMP%] .fixedContent[_ngcontent-%COMP%] .mobileLocationsAmount[_ngcontent-%COMP%]{width:40px;height:40px;line-height:40px;text-align:center;margin-right:10px;position:relative}[_nghost-%COMP%] .fixedContent[_ngcontent-%COMP%] .mobileLocationsAmount[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{position:absolute;width:100%;left:0;top:1px}[_nghost-%COMP%] .scrollableContent[_ngcontent-%COMP%]{max-height:200px;overflow:auto}[_nghost-%COMP%] .scrollableContent.docked[_ngcontent-%COMP%]{height:100%;max-height:calc(100% - 50px)}[_nghost-%COMP%] .scrollableContent[_ngcontent-%COMP%] .iconColumn[_ngcontent-%COMP%]{width:30px;padding:6px 2px 6px 8px}[_nghost-%COMP%] .scrollableContent[_ngcontent-%COMP%] .iconColumn[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%]{font-size:30px}[_nghost-%COMP%] .scrollableContent[_ngcontent-%COMP%] .iconColumn[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%] .assetAmount[_ngcontent-%COMP%]{position:absolute;left:12px;font-size:12px;top:5px;font-family:Arial,MS Trebuchet,sans-serif;font-weight:700}"],changeDetection:0})}}return n})();const ya=n=>({hidden:n}),ka=(n,s)=>({expanded:n,collapsed:s}),Xt=n=>({active:n}),Fa=n=>({height:n}),Sa=(n,s)=>({value:n,params:s}),Ia=(n,s)=>({expanded:n,big:s}),Ra=n=>({fixedSidePanelContainer:n});function La(n,s){1&n&&t.nrm(0,"asset-dashboard")}function Aa(n,s){if(1&n){const e=t.RV6();t.j41(0,"asset-filter-panel",19),t.bIt("toggleSidePanel",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.toggleSidePanel())})("collapseSidePanel",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.collapseSidePanel())}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("assetStatuses",e.assetStatuses)("filterVisible",!e.sidePanelCollapsed)}}function Ea(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",13)(1,"asset-mobile-locations",20),t.bIt("toggleDocking",function(o){l.eBV(e);const a=t.XpG();return l.Njj(a.mobileAssetsContainerDocked=o)}),t.k0s()()}if(2&n){const e=t.XpG();t.Y8G("ngClass",t.eq3(3,Ra,e.mobileAssetsContainerDocked)),t.R7$(),t.Y8G("locations",e.mobileLocations)("docked",e.mobileAssetsContainerDocked)}}function ja(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",21),t.bIt("mouseup",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.getBottomPanelHeight())}),t.nrm(1,"i",22),t.j41(2,"i",23),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.toggleBottomPanel())}),t.k0s()()}if(2&n){const e=t.XpG();t.Y8G("animationLength",e.animationLength)}}function Da(n,s){if(1&n&&t.nrm(0,"location-detail",17),2&n){const e=t.XpG();
1t.Y8G("locationId",e.selectedLocation)("clusterId",e.selectedCluster)("assetStatuses",e.assetStatuses)}}function wa(n,s){if(1&n&&t.nrm(0,"asset-detail",18),2&n){const e=t.XpG();t.Y8G("unitId",e.selectedUnit)("hideCloseButton",!0)}}let Ga=(()=>{class n{constructor(e,i,o,a,r,d,h,g,P){this.assetsService=e,this.assetsFilterService=i,this.mapEventsHelper=o,this.translation=a,this.sortService=r,this.mapConfigService=d,this.elementRef=h,this.cdRef=g,this.stylesService=P,this.dashboardVisible=!1,this.sidePanelVisible=!0,this.sidePanelCollapsed=!1,this.bottomPanelVisible=!1,this.mobileAssetsContainerDocked=!1,this.groupByType=_.MH.LOCATION,this.groupType=_.MH,this.mapKey="assetOverview",this.bottomPanelHeight=500,this.animationLength=350,this.element=h.nativeElement,this.mapInfo=new M.pc,this.mapConfigService.getMapConfig().subscribe(F=>{this.setClusterThreshold(F.disableClustering),(0,m.hX)(this.filter)||(this.boundsChangesEnabled=!1,this.doSearch()),this.mapConfigReady=!0}),this.mapConfigService.mapConfigChanges$.subscribe(F=>{"disable-clustering"==F.type&&(this.setClusterThreshold(F.value),this.boundsChangesEnabled=!1,this.doSearch())}),this.mapEventsHelper.mapBoundsResult$.pipe((0,w.B)(1e3),(0,R.F)()).subscribe(F=>{F.mapKey===this.mapKey&&this.handleMap(F.bounds)}),this.assetsFilterService.assetFilterChanges$.pipe((0,w.B)(500)).subscribe(F=>{this.filter=F,this.mapInfo.bounds=null,this.boundsChangesEnabled=!1,this.mapInitialized&&this.mapConfigReady&&this.doSearch()}),this.assetsFilterService.assetActionChanges$.subscribe(F=>{"LOCATION_DETAIL"===F.action?this.viewLocationDetail(F.data):"ASSET_DETAIL"===F.action?this.viewAssetDetail(F.data):"CLUSTER_DETAIL"===F.action&&this.viewClusterDetail(F.data)}),this.locationFilterSubscription=this.mapEventsHelper.locationFilterChanges$.subscribe(()=>{this.doSearch()});let N=new M.nl;N.view=this.groupByType==_.MH.LOCATION?M.jh.COST_STOCK_LOCATIONS:M.jh.ASSETS,this.assetsFilterService.setFilterChanged(N)}ngOnDestroy(){this.locationFilterSubscription&&this.locationFilterSubscription.unsubscribe()}autoZoom(e){this.mapInfo.bounds=e||null,this.assetsFilterService.setMapInfo(this.mapInfo),this.boundsChangesEnabled=!1,this.doSearch(e,!0)}doSearch(e,i){this.filter&&this.filter.mapInfo&&this.assetsService.search(this.filter).subscribe(o=>{this.processLocationsData(o),this.processAssetsData(o),this.assetStatuses=o.statuses,o.boundingBox?this.zoomBounds=o.boundingBox:e&&i?this.zoomBounds=e:delete this.zoomBounds,this.prepareMapData(o),this.cdRef.detectChanges()})}toggleSidePanel(){this.sidePanelVisible=!this.sidePanelVisible,this.dashboardVisible=!this.dashboardVisible,this.sidePanelVisible||(this.bottomPanelVisible=!1)}collapseSidePanel(){this.sidePanelCollapsed=!this.sidePanelCollapsed}toggleBottomPanel(e){this.bottomPanelVisible=e||!this.bottomPanelVisible,this.bottomPanelVisible||(this.selectedLocation=null,this.selectedUnit=null,this.selectedCluster=null)}getBottomPanelHeight(){this.bottomPanelHeight=document.getElementsByClassName("bottomPanelContainer")[0].offsetHeight}viewLocationDetail(e){this.selectedUnit=null,this.selectedLocation=e,this.selectedCluster=null,this.toggleBottomPanel(!0)}viewAssetDetail(e){this.selectedUnit=e,this.selectedLocation=null,this.selectedCluster=null,this.toggleBottomPanel(!0)}viewClusterDetail(e){this.selectedUnit=null,this.selectedLocation=null,this.selectedCluster=e,this.toggleBottomPanel(!0)}setGroupBy(e){this.groupByType=e,this.filter.view=this.groupByType==_.MH.LOCATION?M.jh.COST_STOCK_LOCATIONS:M.jh.ASSET_CLUSTERS,this.assetsFilterService.setFilterChanged(this.filter)}getColor(e){return this.stylesService.getCssProperty(e?"--colors-general-medium-black":"--colors-general-white")}prepareMapData(e){let i=[];switch(this.filter.view){case M.jh.COST_STOCK_LOCATIONS:if(this.locationClusters)for(let o of this.locationClusters)o.id=o.hash,o.clusterType=v.Lz.COST_STOCK_LOCATIONS,o.mapClusterType=_.dx.ASSET_OVERVIEW,i.push(this.getMapDataItem(v.$j.CLUSTER,o));if(this.fixedLocations)for(let o of this.fixedLocations)o.showAmount=!0,i.push(this.getMapDataItem(v.$j[o.group],o));break;
1case M.jh.ASSET_CLUSTERS:if(this.clusters)for(let o of this.clusters)o.id=o.hash,o.clusterType=v.Lz.UNIT,o.mapClusterType=_.dx.ASSET_OVERVIEW,i.push(this.getMapDataItem(v.$j.CLUSTER,o));if(this.unclusteredAssets)for(let o of this.unclusteredAssets)o.active=!0,i.push(this.getMapDataItem(v.$j.UNIT,o))}if(e.fenceClusters)for(let o of e.fenceClusters)o.id=o.hash,o.clusterType=v.Lz.LOCATION,o.mapClusterType=_.dx.ASSET_OVERVIEW,i.push(this.getMapDataItem(v.$j.CLUSTER,o));if(e.fences)for(let o of e.fences)i.push(this.getMapDataItem(v.$j.LOCATION,o));if(this.mapData&&0!=this.mapData.length)for(let o of this.mapData)if(!o.remove){let a=Object.assign({},o);a.remove=!0,i.push(a)}this.mapData=i}getMapDataItem(e,i){let o=this.mapData?this.mapData.find((a,r)=>{let d=a.type===e&&a.data.id===i.id;return d&&this.mapData.splice(r,1),d}):null;return o?(o.data=i,o.remove=!1,o):new v.q1(e,i,!1)}handleMap(e){let i=this.element.getElementsByClassName("assetMapContainer")[0];if(this.mapInfo.width=i.offsetWidth,this.mapInfo.height=i.offsetHeight,!this.boundsChangesEnabled||this.filter.view!=M.jh.ASSET_CLUSTERS&&this.filter.view!=M.jh.COST_STOCK_LOCATIONS)!this.mapInitialized&&this.filter&&(this.assetsFilterService.setMapInfo(this.mapInfo),this.filter.mapInfo=this.mapInfo,this.mapInitialized=!0,this.doSearch());else{let o={maxLat:e.getNorthEast().lat(),maxLon:e.getNorthEast().lng(),minLat:e.getSouthWest
1().lat(),minLon:e.getSouthWest().lng()};this.mapInfo.bounds=o,this.assetsFilterService.setMapInfo(this.mapInfo),this.filter.mapInfo=this.mapInfo,this.doSearch(o)}this.boundsChangesEnabled=!0}processLocationsData(e){let i=[],o=[];if(this.locationClusters=e.locationClusters,e.locations)for(let a of e.locations)a.mobile?(e.amounts&&e.amounts[a.id]&&(a.amount=Object.values(e.amounts[a.id]).reduce(this.getSum,0)),i.push(a)):(this.setItemStatus(a,e.amounts?e.amounts[a.id]:null,e.statuses),o.push(a));this.mobileLocations=this.sortService.sort(i,"name",!1,!0),this.fixedLocations=o}setItemStatus(e,i,o){i&&(e.status=Object.keys(i).reduce((a,r)=>((-1==+r||o[r])&&(a[r]={name:-1!=+r?o[r].name:this.translation.get("allpages.none"),amount:i[r],color:-1!=+r?o[r].color:null}),a),{}),e.amount=Object.values(i).reduce(this.getSum,0))}getSum(e,i){return e+i}processAssetsData(e){if(e.clusters)for(let i of e.clusters)this.setItemStatus(i,i.statusCounts,e.statuses);if(this.clusters=e.clusters,e.unclusteredAssets)for(let i of e.unclusteredAssets)i.unitStatus&&e.statuses[i.unitStatus]&&(i.color=e.statuses[i.unitStatus].color);this.unclusteredAssets=e.unclusteredAssets}setClusterThreshold(e){this.mapInfo.clusterThreshold=e?0:30}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(x.T),t.rXU(I.N),t.rXU(O.r),t.rXU(f.L),t.rXU(C.a),t.rXU(j.W),t.rXU(t.aKT),t.rXU(k.gRc),t.rXU(it.Y))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["asset-overview"]],standalone:!1,decls:30,vars:50,consts:[[1,"dashboardContainer",3,"ngClass"],[1,"containerContent","generalContent"],[1,"btn","btn-secondary","dashboardToggle","me-auto",3,"click"],[1,"fas","fa-angle-left","fa-sm","action"],[1,"fixedContentContainer","generalContent"],[1,"sidePanelContainer","generalContent",3,"ngClass"],[3,"assetStatuses","filterVisible"],[1,"overviewContentContainer"],[1,"assetMapContainer"],[1,"groupToggle"],[1,"toggleButton","left","float-start",3,"click","ngClass","title"],[1,"toggleButton","right","float-start",3,"click","ngClass","title"],[3,"autozoomTrigger","entityClicked","mapKey","zoomBounds","entities","legendRightPosition"],[1,"mobileLocationsContainer",3,"ngClass"],[1,"bottomPanelContainer","generalContent","resizable",3,"ngClass"],["resizer","",1,"dropdown","popupOptions",3,"animationLength"],[1,"container-fluid","overflow-hidden","flex-grow-1"],[3,"locationId","clusterId","assetStatuses"],[3,"unitId","hideCloseButton"],[3,"toggleSidePanel","collapseSidePanel","assetStatuses","filterVisible"],[3,"toggleDocking","locations","docked"],["resizer","",1,"dropdown","popupOptions",3,"mouseup","animationLength"],[1,"fa-xl","fa-solid","fa-grip-lines","p-3"],[1,"fa-solid","fa-xmark","action","fa-xl","m-2","p-3",3,"click"]],template:function(i,o){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"button",2),t.bIt("click",function(){return o.toggleSidePanel()}),t.nrm(3,"i",3),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nVh(6,La,1,0,"asset-dashboard"),t.k0s()(),t.j41(7,"div",4)(8,"div",5),t.nVh(9,Aa,1,2,"asset-filter-panel",6),t.k0s(),t.j41(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10),t.nI1(14,"translate"),t.bIt("click",function(){return o.setGroupBy(o.groupType.LOCATION)}),t.j41(15,"span"),t.EFF(16),t.nI1(17,"translate"),t.k0s()(),t.j41(18,"div",11),t.nI1(19,"translate"),t.bIt("click",function(){return o.setGroupBy(o.groupType.UNIT)}),t.j41(20,"span"),t.EFF(21),t.nI1(22,"translate"),t.k0s()()(),t.j41(23,"suivo-live-map",12),t.bIt("autozoomTrigger",function(r){return o.autoZoom(r)})("entityClicked",function(r){return o.viewAssetDetail(r.id)}),t.k0s()(),t.nVh(24,Ea,2,5,"div",13),t.j41(25,"div",14),t.nVh(26,ja,3,1,"div",15),t.j41(27,"div",16),t.nVh(28,Da,1,3,"location-detail",17),t.nVh(29,wa,1,2,"asset-detail",18),t.k0s()()()()),2&i&&(t.Y8G("ngClass",t.eq3(33,ya,!o.dashboardVisible)),t.R7$(4),t.SpI(" \xa0",t.bMT(5,23,"allpages.filter")," "),t.R7$(2),t.vxM(o.dashboardVisible?6:-1),t.R7$(2),t.Y8G("ngClass",t.l_i(35,ka,o.sidePanelVisible,o.sidePanelCollapsed)),t.R7$(),t.vxM(o.sidePanelVisible?9:-1),t.R7$(4),t.Y8G("title",t.mNQ(t.bMT(14,25,"permission.ITEM_COST_STOCK_LOCATIONS")))("ngClass",t.eq3(38,Xt,o.groupByType==o.groupType.LO
1CATION)),t.R7$(3),t.JRh(t.bMT(17,27,"permission.ITEM_COST_STOCK_LOCATIONS")),t.R7$(2),t.Y8G("title",t.mNQ(t.bMT(19,29,"allpages.units")))("ngClass",t.eq3(40,Xt,o.groupByType==o.groupType.UNIT)),t.R7$(3),t.JRh(t.bMT(22,31,"allpages.units")),t.R7$(2),t.Y8G("mapKey",o.mapKey)("zoomBounds",o.zoomBounds)("entities",o.mapData)("legendRightPosition",o.mobileAssetsContainerDocked?null:220),t.R7$(),t.vxM(o.mobileLocations&&0!=o.mobileLocations.length?24:-1),t.R7$(),t.Y8G("@animation",t.l_i(44,Sa,o.bottomPanelVisible?"visible":"invisible",t.eq3(42,Fa,o.bottomPanelHeight)))("ngClass",t.l_i(47,Ia,o.bottomPanelVisible,!o.sidePanelVisible)),t.R7$(),t.vxM(o.bottomPanelVisible?26:-1),t.R7$(2),t.vxM(o.bottomPanelVisible&&(o.selectedLocation||o.selectedCluster)?28:-1),t.R7$(),t.vxM(o.bottomPanelVisible&&o.selectedUnit?29:-1))},dependencies:[p.YU,Zt.k,Wt.G,ne,as,va,Pa,jt,b.D],styles:["[_nghost-%COMP%]{width:auto;display:flex;flex-direction:column;height:100%}[_nghost-%COMP%] .dashboardToggle[_ngcontent-%COMP%]{margin:0;border-color:var(--colors-general-soft-grey);font-weight:400;font-size:12px}[_nghost-%COMP%] .dashboardContainer[_ngcontent-%COMP%]{width:100%;transition:height .3s,visibility .3s;transition-timing-function:ease-out}[_nghost-%COMP%] .dashboardContainer[_ngcontent-%COMP%] .containerContent[_ngcontent-%COMP%]{visibility:visible;position:relative;padding:15px;height:100%;display:flex;flex-direction:column}[_nghost-%COMP%] .dashboardContainer.hidden[_ngcontent-%COMP%]{height:0;visibility:hidden}[_nghost-%COMP%] .dashboardContainer.hidden[_ngcontent-%COMP%] .containerContent[_ngcontent-%COMP%]{visibility:hidden}[_nghost-%COMP%] .sidePanelContainer[_ngcontent-%COMP%]{flex-grow:0;background:var(--colors-general-white, #ffffff);visibility:hidden;height:100%;width:0;z-index:9;max-width:360px;position:relative;transition:flex-grow 1s,visibility 1s;transition-timing-function:ease-out}[_nghost-%COMP%] .sidePanelContainer[_ngcontent-%COMP%] .containerContent[_ngcontent-%COMP%]{visibility:hidden}[_nghost-%COMP%] .sidePanelContainer.expanded[_ngcontent-%COMP%]{flex-grow:1;visibility:visible;width:auto}[_nghost-%COMP%] .sidePanelContainer.expanded[_ngcontent-%COMP%] .containerContent[_ngcontent-%COMP%]{visibility:visible}[_nghost-%COMP%] .sidePanelContainer.collapsed[_ngcontent-%COMP%]{flex-grow:0!important;max-width:45px}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%]{display:flex;border:none;z-index:11;height:100%}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%]{flex-grow:8;position:relative;display:flex}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .mobileLocationsContainer[_ngcontent-%COMP%]{position:absolute;right:10px;top:10px;max-width:200px;z-index:1;background:var(--colors-general-white, #ffffff);border-radius:2px}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .assetMapContainer[_ngcontent-%COMP%]{flex-grow:9;bottom:0;right:0;position:relative;z-index:0;transition:height .3s,visibility .3s;transition-timing-function:ease-out}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .assetMapContainer[_ngcontent-%COMP%] .groupToggle[_ngcontent-%COMP%]{position:absolute;top:10px;left:50%;transform:translate(-50%);height:40px;z-index:10}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .assetMapContainer[_ngcontent-%COMP%] .groupToggle[_ngcontent-%COMP%] .toggleButton[_ngcontent-%COMP%]{height:40px;min-width:100px;color:var(--colors-general-medium-black, #1c669b);background:var(--colors-general-white, #ffffff);text-align:center;padding:8px 15px;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;box-shadow:0 2px 4px -3px var(--colors-general-medium-black)}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .assetMapContainer[_ngcontent-%COMP%] .groupToggle[_ngcontent-%COMP%] .toggleButton[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-transform:lowercase}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .assetMapContainer[_ngcontent-%COMP%] .groupToggle[_ngcontent-%COMP%] .toggleButton[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-letter{text-transform:uppercase}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .assetMapContainer[_ngcontent-%COMP%] .groupToggle[_ngcontent-%COMP%] .toggleButton.left[_ngcontent-%COMP%]{border-top-left-radius:2px;border-bottom-left-radius:2px}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .assetMapContainer[_ngcontent-%COMP%] .groupToggle[_ngcontent-%COMP%] .toggleButton.right[_ngcontent-%COMP%]{border-top-right-radius:2px;border-bottom-right-radius:2px}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .assetMapContainer[_ngcontent-%COMP%] .groupToggle[_ngcontent-%COMP%] .toggleButton.active[_ngcontent-%COMP%]{background:var(--colors-general-medium-black, #1c669b);color:var(--colors-general-white, #ffffff);cursor:default}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .assetMapContainer[_ngcontent-%COMP%] .groupToggle[_ngcontent-%COMP%] .toggleButton.active[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:var(--colors-general-white, #ffffff)}[_nghost-%COMP%] .fixedContentContainer[_ngcontent-%COMP%] .overviewContentContainer[_ngcontent-%COMP%] .fixedSidePanelContainer[_ngcontent-%COMP%]{flex-grow:1;background:var(--colors-general-white, #ffffff);
1width:200px;position:static;border-radius:0}[_nghost-%COMP%] .bottomPanelContainer[_ngcontent-%COMP%]{position:absolute;bottom:0;right:0;left:0;z-index:9;display:flex;flex-direction:column}[_nghost-%COMP%] .bottomPanelContainer[_ngcontent-%COMP%] .popupOptions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:center;cursor:row-resize}[_nghost-%COMP%] .bottomPanelContainer[_ngcontent-%COMP%] .popupOptions[_ngcontent-%COMP%] .fa-xmark[_ngcontent-%COMP%]{position:absolute;right:0;top:0;cursor:pointer}[_nghost-%COMP%] .bottomPanelContainer.expanded[_ngcontent-%COMP%]{overflow:hidden;max-height:calc(100vh - var(--navigation-header-height) - var(--navigation-tabs-height) - 23px);min-height:140px;height:500px}[_nghost-%COMP%] .bottomPanelContainer.big[_ngcontent-%COMP%]{width:100%}"],data:{animation:[(0,E.hZ)("animation",[(0,E.wk)("invisible",(0,E.iF)({height:"0px"})),(0,E.wk)("visible",(0,E.iF)({height:"{{height}}px"}),{params:{height:500}}),(0,E.kY)("invisible => visible",(0,E.i0)("300ms")),(0,E.kY)("visible => invisible",(0,E.i0)("300ms"))])]}})}}return n})();var pt=u(77530),$a=u(69021);function Va(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",0),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG().$implicit,r=t.XpG
1(2);return l.Njj(r.selectValue(o.key,r.groupType[a]))}),t.EFF(1),t.k0s()}if(2&n){const e=s.$implicit;t.R7$(),t.SpI(" ",e.label," ")}}function Na(n,s){if(1&n&&(t.j41(0,"h3"),t.EFF(1),t.k0s(),t.j41(2,"ul"),t.Z7z(3,Va,2,1,"li",null,t.fX1),t.k0s()),2&n){const e=s.$implicit,i=t.XpG(2);t.R7$(),t.JRh(i.result[e].title),t.R7$(2),t.Dyx(i.result[e].items)}}function Xa(n,s){1&n&&(t.j41(0,"h3"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.JRh(t.bMT(2,1,"allpages.table.noData")))}function Ba(n,s){if(1&n&&(t.Z7z(0,Na,5,1,null,null,t.fX1),t.nVh(2,Xa,3,3,"h3")),2&n){const e=t.XpG();t.Dyx(e.objectKeys(e.result)),t.R7$(2),t.vxM(0===e.objectKeys(e.result).length?2:-1)}}let Ua=(()=>{class n{constructor(e,i,o,a){this.assetsFilterService=e,this.assetsService=i,this.translation=o,this.sortService=a,this.displayStyle="none",this.itemClicked=new t.bkB,this.objectKeys=Object.keys,this.groupType=_.MH}ngOnInit(){this.assetsFilterService.quickSearchChanges$.pipe((0,w.B)(500),(0,R.F)()).subscribe(e=>{e&&""!=e.trim()&&e.trim().length>=3?this.doQuickSearch(e):(this.result=null,this.displayStyle="none")})}doQuickSearch(e){this.assetsService.quickSearch(e).subscribe(i=>{this.result={},i.assets&&0!=i.assets.length&&(this.result[_.MH[_.MH.UNIT]]={title:this.translation.get("allpages.units"),items:this.sortService.sort(i.assets,"label",!1,!0)}),i.costLocations&&0!=i.costLocations.length&&(this.result[_.MH[_.MH.COST_LOCATION]]={title:this.translation.get("permission.PAGE_COST_LOCATIONS"),items:this.sortService.sort(i.costLocations,"label",!1,!0)}),i.stockLocations&&0!=i.stockLocations.length&&(this.result[_.MH[_.MH.STOCK_LOCATION]]={title:this.translation.get("permission.PAGE_STOCK_LOCATIONS"),items:this.sortService.sort(i.stockLocations,"label",!1,!0)}),this.displayStyle="block"})}selectValue(e,i){this.assetsFilterService.performAction({action:i===_.MH.UNIT?"ASSET_DETAIL":"LOCATION_DETAIL",data:e}),this.itemClicked.emit()}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(I.N),t.rXU(x.T),t.rXU(f.L),t.rXU(C.a))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["quick-search-result"]],hostVars:2,hostBindings:function(i,o){2&i&&t.xc7("display",o.displayStyle)},outputs:{itemClicked:"itemClicked"},standalone:!1,decls:1,vars:1,consts:[[3,"click"]],template:function(i,o){1&i&&t.nVh(0,Ba,3,1),2&i&&t.vxM(o.result?0:-1)},dependencies:[b.D],styles:["[_nghost-%COMP%]{background-color:var(--colors-general-white);position:absolute;z-index:15;left:0;right:0;max-height:400px;border:1px solid var(--colors-general-soft-grey);min-width:150px;overflow:auto;overflow-x:hidden}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{padding:3px 10px}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{padding:2px 10px;cursor:pointer;color:var(--colors-general-black)}[_nghost-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover{background-color:var(--colors-attention-primary);color:var(--colors-general-white)}"]})}}return n})();const Ya=n=>({action:n});function Ha(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",3)(1,"i",12),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.refresh())}),t.k0s(),t.j41(2,"div",13)(3,"input",14),t.nI1(4,"translate"),t.mxI("ngModelChange",function(o){l.eBV(e);const a=t.XpG();return t.DH7(a.quickSearch,o)||(a.quickSearch=o),l.Njj(o)}),t.bIt("ngModelChange",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.doQuickSearch())}),t.k0s(),t.j41(5,"i",15),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.doQuickSearch(!0))}),t.k0s(),t.j41(6,"quick-search-result",16),t.bIt("itemClicked",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.doQuickSearch(!0))}),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(3),t.Y8G("placeholder",t.bMT(4,3,"allpages.button.search")),t.R50("ngModel",e.quickSearch),t.R7$(2),t.Y8G("ngClass",t.eq3(5,Ya,e.quickSearch&&""!=e.quickSearch))}}function za(n,s){if(1&n&&(t.j41(0,"div",20),t.EFF(1),t.k0s()),2&n){const e=s.$implicit;t.R7$(),t.SpI(" ",e," ")}}function Ja(n,s){if(1&n&&(t.j41(0,"div",17)(1,"div",18)(2,"div",19),t.Z7z(3,za,2,1,"div",20,t.fX1),t.k0s()()()),2&n){const e=t.XpG();t.Aen(e.assetPopup.position),t.R7$(),t.AVh("bottom",e.assetPopup.bottom),t.R7$(2),t.Dyx(e.assetPopup.assets)}}function Ka(n,s){if(1&n){const e=t.RV6();t.j41(0,"span",23),t.bIt("mouseenter",function(o){l.eBV(e);const a=t.XpG(2).data,r=t.XpG();return l.Njj(r.togglePopup(o,a.assets))})("mouseleave",function(){l.eBV(e);const o=t.XpG(3);return l.Njj(o.togglePopup())}),t.EFF(1),t.k0s()}if(2&n){const e=t.XpG(2).data;t.R7$(),t.SpI(" ",e.assetsLabel," ")}}function Za(n,s){if(1&n&&(t.j41(0,"span",22),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2).data;t.R7$(),t.JRh(e.assetsLabel)}}function Wa(n,s){if(1&n&&t.nVh(0,Ka,2,1,"span",21)(1,Za,2,1,"span",22),2&n){const e=t.XpG().data;t.vxM(e.assets.length?0:1)}}function qa(n,s){1&n&&t.nVh(0,Wa,2,1),2&n&&t.vxM(s.data.assets?0:-1)}function Qa(n,s){if(1&n&&(t.nrm(0,"span",24),t.nI1(1,"highlight")),2&n){const e=t.XpG();t.Y8G("innerHTML",t.i5U(1,1,e.data.deliveryConfirmationDate.date,e.highlightValue),t.npT)}}function tl(n,s){1&n&&(t.j41(0,"span",25),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"assets.transfer.instant")," "))}
1function el(n,s){if(1&n&&(t.nVh(0,Qa,2,4,"span",24),t.nVh(1,tl,3,3,"span",25)),2&n){const e=s.data;t.vxM(e.deliveryConfirmationDate?0:-1),t.R7$(),t.vxM(e.confirmationRequired?-1:1)}}function nl(n,s){if(1&n&&(t.nrm(0,"span",24),t.nI1(1,"highlight")),2&n){const e=t.XpG();t.Y8G("innerHTML",t.i5U(1,1,e.data.confirmedByUser,e.highlightValue),t.npT)}}function il(n,s){1&n&&t.nVh(0,nl,2,4,"span",24),2&n&&t.vxM(null!=s.data.confirmedBy?0:-1)}function ol(n,s){if(1&n&&t.nrm(0,"suivo-icon",26)(1,"suivo-entity",27),2&n){const e=t.XpG(),i=e.data,o=e.highlightValue;t.Y8G("icon",i.fromLocation.group)("size",16),t.R7$(),t.Y8G("entityType",i.fromLocation.group)("entity",i.fromLocation)("highlightValue",o)}}function sl(n,s){1&n&&t.nVh(0,ol,2,5),2&n&&t.vxM(s.data.fromLocation?0:-1)}function al(n,s){if(1&n&&t.nrm(0,"suivo-icon",26)(1,"suivo-entity",27),2&n){const e=t.XpG(),i=e.data,o=e.highlightValue;t.Y8G("icon",i.toLocation.group)("size",16),t.R7$(),t.Y8G("entityType",i.toLocation.group)("entity",i.toLocation)("highlightValue",o)}}function ll(n,s){1&n&&t.nVh(0,al,2,5),2&n&&t.vxM(s.data.toLocation?0:-1)}let rl=(()=>{class n{constructor(e,i,o){this.router=e,this.assetsFilterService=i,this.stylesService=o,this.groupType=_.MH,this.assetPopup={visible:!1},this.overview=-1!=this.router.routerState.snapshot.url.indexOf("overview")}ngOnInit(){this.router.events.subscribe(e=>{e instanceof pt.wF&&(this.overview=-1!=e.url.indexOf("overview"))})}refresh(){this.assetsFilterService.setFilterChanged(this.assetsFilterService.getFilter())}doQuickSearch(e){e&&(this.quickSearch=""),this.assetsFilterService.setQuickSearch(this.quickSearch)}togglePopup(e,i){if(!this.assetPopup.visible&&e){this.assetPopup={assets:i};let o=this.stylesService.getCssProperty("--navigation-header-height").replace("px",""),a=e.target.getBoundingClientRect().top-+o,r=20*i.length+20;e.screenY+100+r>screen.height?(a-=r,this.assetPopup.bottom=!0):(this.assetPopup.bottom=!1,a+=20),this.assetPopup.position={top:a+"px",left:e.target.getBoundingClientRect().left+"px",right:"auto"}}this.assetPopup.visible=!this.assetPopup.visible}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(pt.Ix),t.rXU(I.N),t.rXU(it.Y))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["assets"]],standalone:!1,decls:14,vars:2,consts:[[1,"container-fluid"],[1,"content-container","includeHeader"],[1,"header"],[1,"float-end","header-element"],[1,"main-height"],[1,"assetOverviewContainer"],[1,"optionsPopup",3,"style"],["cellTemplate","NUMBER_OF_ASSETS"],["cellTemplate","DELIVERY_CONFIRMATION_DATE"],["cellTemplate","CONFIRMED_BY"],["cellTemplate","START_LOCATION"],["cellTemplate","END_LOCATION"],[1,"fas","fa-sync-alt","action",3,"click"],[1,"has-feedback"],["type","text",1,"form-control","form-control-sm",3,"ngModelChange","placeholder","ngModel"],[1,"fas","fa-times","form-control-feedback",3,"click","ngClass"],[3,"itemClicked"],[1,"optionsPopup"],[1,"popupContent","left"],[1,"optionForm"],[2,"white-space","nowrap"],[1,"entityLink"],[1,"cellContent"],[1,"entityLink",3,"mouseenter","mouseleave"],[1,"cellContent",3,"innerHTML"],[1,"cellContent","instantTransfer"],[1,"me-1",3,"icon","size"],[2,"max-width","calc(100% - 20px)",3,"entityType","entity","highlightValue"]],template:function(i,o){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2),t.nrm(3,"sub-navigation"),t.nVh(4,Ha,7,7,"div",3),t.k0s(),t.j41(5,"div",4)(6,"div",5),t.nrm(7,"router-outlet"),t.k0s()()()(),t.nVh(8,Ja,5,4,"div",6),t.DNE(9,qa,1,1,"ng-template",7)(10,el,2,2,"ng-template",8)(11,il,1,1,"ng-template",9)(12,sl,1,1,"ng-template",10)(13,ll,1,1,"ng-template",11)),2&i&&(t.R7$(4),t.vxM(o.overview?4:-1),t.R7$(4),t.vxM(o.assetPopup.visible?8:-1))},dependencies:[p.YU,lt.T,$a.s,ot.Z,tt.i,c.me,c.BC,c.vS,pt.n3,Ua,b.D,V.v],styles:[".has-feedback[_ngcontent-%COMP%]{margin-left:15px;right:1px;top:1px;position:relative;width:100%}.has-feedback[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%]{border:1px solid #3271A6}.has-feedback[_ngcontent-%COMP%] .form-control-feedback[_ngcontent-%COMP%]{top:0}.main-height[_ngcontent-%COMP%]{z-index:1}.main-height[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{height:100%}@media screen and (max-width: 720px){.header[_ngcontent-%COMP%]{padding-left:15px}}.header-element[_ngcontent-%COMP%]{justify-content:flex-end;width:100%;max-width:380px}.header-element[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin:0}.assetOverviewContainer[_ngcontent-%COMP%]{height:100%}.instantTransfer[_ngcontent-%COMP%]{color:var(--colors-general-medium-grey)}"]})}}return n})(),J=(()=>{class n extends vt.S{static{this.getConsumableOverviewUrl="../protected/assetManagement/consumables/filterTypes.json"}static{this.getConsumablesCountUrl="../protected/assetManagement/consumables/count.json"}static{this.getLocationStockOverviewUrl="../protected/assetManagement/consumables/stock.json"}static{this.getConsumableLocationInfoUrl="../protected/assetManagement/consumables/locations.json"}static{this.getAllLocationsUrl="../protected/assetManagement/consumables/allLocations.json"}static{this.savePresetUrl="../protected/assetManagement/consumables/savePreset.json"}static{this.deletePresetUrl="../protected/assetManagement/consumables/deletePreset.json"}static{this.exportUrl="../protected/assetManagement/consumables/export.json"}static{this.updateStockUlr="../protected/assetManagement/consumables/updateStock.json"}constructor(e,i){super(n),this.http=e,this.globalHelper=i}getConsumableOverview(){return this.http.get(n.getConsumableOverviewUrl)}getConsumablesCount(e){return this.http.get(n.getConsumablesCountUrl,{params:{entityTypes:e}})}
1getLocationStockOverview(e){return this.http.post(n.getLocationStockOverviewUrl,e)}getConsumableLocationInfo(e){return this.http.get(n.getConsumableLocationInfoUrl,{params:e})}getAllLocations(){return this.http.get(n.getAllLocationsUrl)}savePreset(e){return this.http.post(n.savePresetUrl,{guid:e.guid,name:e.name,selectedLocations:e.selectedLocations,active:!0})}deletePreset(e){return this.http.post(n.deletePresetUrl,{guid:e})}exportStock(e){this.http.post(n.exportUrl,e,{observe:"response",responseType:"blob"}).subscribe(i=>{this.globalHelper.downloadFile(i.body,i.status,i.headers)})}updateStock(e){return this.http.post(n.updateStockUlr,e)}static{this.\u0275fac=function(i){return new(i||n)(l.KVO(bt.Qq),l.KVO(K.$))}}static{this.\u0275prov=l.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const Bt=n=>({type:n}),cl=n=>[n];function pl(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",9)(1,"div",10),t.EFF(2),t.k0s(),t.j41(3,"i",11),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(2);return l.Njj(a.removeType(o))}),t.k0s()()}if(2&n){const e=s.$implicit,i=t.XpG(2);t.Y8G("title",i.entityTypeNames[e]),t.R7$(),t.Y8G("title",i.entityTypeNames[e]),t.R7$(),t.JRh(i.entityTypeNames[e])}}function ul(n,s){if(1&n&&(t.j41(0,"div",5),t.Z7z(1,pl,4,3,"div",9,t.fX1),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.Dyx(e.selectedTypes)}}function dl(n,s){if(1&n&&t.eu8(0,8),2&n){const e=s.$implicit;t.XpG();const i=t.sdS(14);t.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",t.eq3(2,Bt,e))}}function _l(n,s){if(1&n){const e=t.RV6();t.j41(0,"i",19),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2).type,a=t.XpG();return l.Njj(a.toggleShowSubtypes(o.id))}),t.k0s()}if(2&n){const e=t.XpG(2).type,i=t.XpG();t.Y8G("ngClass",t.eq3(1,cl,-1==i.expandedSubtypes.indexOf(e.id)?"fa-chevron-right":"fa-chevron-down"))}}function ml(n,s){1&n&&t.nrm(0,"span",15)}function hl(n,s){if(1&n&&t.eu8(0,8),2&n){const e=s.$implicit;t.XpG(3);const i=t.sdS(14);t.Y8G("ngTemplateOutlet",i)("ngTemplateOutletContext",t.eq3(2,Bt,e))}}function gl(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",12)(1,"div",13),t.nVh(2,_l,1,3,"i",14),t.nVh(3,ml,1,0,"span",15),t.j41(4,"label")(5,"input",16),t.bIt("change",function(o){l.eBV(e);const a=t.XpG().type,r=t.XpG();return l.Njj(r.onTypeSelection(a.id,o.target.checked,a.subTypes))}),t.k0s(),t.j41(6,"span",17),t.EFF(7),t.k0s()()(),t.j41(8,"div",18),t.Z7z(9,hl,1,4,"ng-container",8,t.fX1),t.k0s()()}if(2&n){const e=t.XpG().type,i=t.XpG();t.R7$(2),t.vxM((null==e.subTypes?null:e.subTypes.length)>0?2:-1),t.R7$(),t.vxM(e.subTypes&&0!=e.subTypes.length?-1:3),t.R7$(2),t.Y8G("checked",-1!=i.selectedTypes.indexOf(e.id)),t.R7$(),t.Y8G("title",e.description),t.R7$(),t.JRh(e.description),t.R7$(),t.AVh("hidden",!e.subTypes||0==e.subTypes.length||-1==i.expandedSubtypes.indexOf(e.id)),t.R7$(),t.Dyx(e.subTypes)}}function Cl(n,s){if(1&n&&t.nVh(0,gl,11,7,"div",12),2&n){const e=s.type,i=t.XpG();t.vxM(-1!=i.visibleTypes.indexOf(e.id)?0:-1)}}let fl=(()=>{class n{constructor(e,i,o){this.consumableService=e,this.cdRef=i,this.sortService=o,this.onSelectionChange=new t.bkB,this.visibleTypes=[],this.expandedSubtypes=[],this.selectedTypes=[],this.entityTypeNames={},this.fetchData(),this.initSearch()}ngOnDestroy(){this.searchSubscription&&this.searchSubscription.unsubscribe()}toggleShowSubtypes(e){this.expandedSubtypes.indexOf(e)>-1?this.expandedSubtypes=this.expandedSubtypes.filter(i=>i!=e):this.expandedSubtypes.push(e)}onTypeSelection(e,i,o){i?(-1==this.selectedTypes.indexOf(e)&&this.selectedTypes.push(e),this.showSubTypes(e)):this.removeType(e),o&&o.forEach(a=>{this.onTypeSelection(a.id,i,a.subTypes),i&&this.showSubTypes(a.id)}),this.onSelectionChange.emit(this.selectedTypes)}removeType(e){this.selectedTypes=this.selectedTypes.filter(i=>i!=e),this.onSelectionChange.emit(this.selectedTypes)}onCollapseChange(){function e(i,o){i.subTypes&&i.subTypes.length>0&&(o.push(i.id),i.subTypes.forEach(a=>e(a,o)))}this.expandedSubtypes.length>0?this.expandedSubtypes=[]:this.entityTypes.forEach(i=>e(i,this.expandedSubtypes))}showSubTypes(e){-1==this.expandedSubtypes.indexOf(e)&&this.expandedSubtypes.push(e)}fetchData(){this.consumableService.getConsumableOverview().subscribe(e=>{this.entityTypes=this.sortTypes(e.entityTypes),this.initVisibleTypes(),this.initTypeNames(),this.cdRef.markForCheck()})}initTypeNames(){function e(i,o){o[i.id]=i.description,i.subTypes&&i.subTypes.length>
10&&i.subTypes.forEach(a=>{o[a.id]=a.description,e(a,o)})}this.entityTypes.forEach(i=>e(i,this.entityTypeNames))}initSearch(){this.searchForm=new c.J3({query:new c.hs}),this.searchSubscription=this.query.valueChanges.subscribe(e=>{this.initVisibleTypes(),this.cdRef.markForCheck()})}initVisibleTypes(){this.visibleTypes=[],this.entityTypes.forEach(e=>{this.determineTypeVisibility(e,this.query.value)})}determineTypeVisibility(e,i){let o=!1,a=!1;return this.inDescription(e,i)&&(o=!0),e.subTypes&&e.subTypes.length>0&&e.subTypes.forEach(r=>{this.determineTypeVisibility(r,i)&&(a=!0)}),i&&i.length>=3&&a&&-1==this.expandedSubtypes.indexOf(e.id)&&this.expandedSubtypes.push(e.id),(o||a)&&this.visibleTypes.push(e.id),o||a}inDescription(e,i){return!(i&&i.length>=3)||e.description.toLowerCase().includes(i.toLowerCase())}sortTypes(e){return(e=this.sortService.sort(e,"description",!1,!0)).forEach(i=>{i.subTypes&&i.subTypes.length>0&&(i.subTypes=this.sortTypes(i.subTypes))}),e}get query(){return this.searchForm.get("query")}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(J),t.rXU(k.gRc),t.rXU(C.a))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["consumables-filter"]],outputs:{onSelectionChange:"onSelectionChange"},standalone:!1,decls:15,vars:8,consts:[["ENTITY_TYPE",""],[1,"stickyContainer"],[1,"filterTitle"],[1,"searchField",3,"formGroup"],["formControlName","query"],[1,"selectionContainer"],[1,"collapseBtn",3,"click"],[1,"scrollableContainer"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"selectionChip",3,"title"],[1,"chipName",3,"title"],[1,"fas","fa-times",3,"click"],[1,"typeContainer"],[1,"typeDescription"],[1,"fas",3,"ngClass"],[1,"spacer"],["type","checkbox",3,"change","checked"],[3,"title"],[1,"subTypeContainer"],[1,"fas",3,"click","ngClass"]],template:function(i,o){if(1&i){const a=t.RV6();t.j41(0,"div",1)(1,"div",2),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"form",3),t.nrm(5,"search-field",4),t.k0s(),t.nVh(6,ul,3,0,"div",5),t.j41(7,"div",6),t.bIt("click",function(){return l.eBV(a),l.Njj(o.onCollapseChange())}),t.EFF(8),t.nI1(9,"translate"),t.k0s()(),t.j41(10,"div",7),t.Z7z(11,dl,1,4,"ng-container",8,t.fX1),t.k0s(),t.DNE(13,Cl,1,1,"ng-template",null,0,t.C5r)}2&i&&(t.R7$(2),t.SpI(" ",t.bMT(3,4,"assets.overview.consumables.filter.title")," "),t.R7$(2),t.Y8G("formGroup",o.searchForm),t.R7$(2),t.vxM(o.selectedTypes.length>0?6:-1),t.R7$(2),t.SpI(" ",t.bMT(9,6,0==o.expandedSubtypes.length?"allpages.expandAll":"allpages.collapseAll")," "),t.R7$(3),t.Dyx(o.entityTypes))},dependencies:[p.YU,p.T3,Y.q,c.qT,c.BC,c.cb,c.j4,c.JD,b.D],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%}[_nghost-%COMP%] .scrollableContainer[_ngcontent-%COMP%], [_nghost-%COMP%] .stickyContainer[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px}[_nghost-%COMP%] .stickyContainer[_ngcontent-%COMP%]{padding-top:10px}[_nghost-%COMP%] .stickyContainer[_ngcontent-%COMP%] .selectionContainer[_ngcontent-%COMP%], [_nghost-%COMP%] .stickyContainer[_ngcontent-%COMP%] .collapseBtn[_ngcontent-%COMP%], [_nghost-%COMP%] .stickyContainer[_ngcontent-%COMP%] .searchField[_ngcontent-%COMP%], [_nghost-%COMP%] .stickyContainer[_ngcontent-%COMP%] .filterTitle[_ngcontent-%COMP%]{margin-bottom:15px}[_nghost-%COMP%] .scrollableContainer[_ngcontent-%COMP%]{overflow-y:auto}.selectionContainer[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-self:baseline;max-height:200px;overflow-y:auto}.selectionContainer[_ngcontent-%COMP%] .selectionChip[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;margin-right:5px;padding:5px 8px;border:1px solid var(--colors-general-soft-grey);background-color:var(--colors-general-background-grey);display:flex;align-items:center;margin-bottom:5px;text-overflow:ellipsis}.selectionContainer[_ngcontent-%COMP%] .selectionChip[_ngcontent-%COMP%] .fa-times[_ngcontent-%COMP%]{cursor:pointer;margin-left:5px}.selectionContainer[_ngcontent-%COMP%] .selectionChip[_ngcontent-%COMP%] .chipName[_ngcontent-%COMP%]{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.collapseBtn[_ngcontent-%COMP%]{text-decoration:underline;cursor:pointer}.subType[_ngcontent-%COMP%]{margin-left:10px}.typeContainer[_ngcontent-%COMP%]{padding-bottom:5px}.typeContainer[_ngcontent-%COMP%] .typeDescription[_ngcontent-%COMP%]{display:flex}.typeContainer[_ngcontent-%COMP%] .typeDescription[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{width:100%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.typeContainer[_ngcontent-%COMP%] .typeDescription[_ngcontent-%COMP%] .spacer[_ngcontent-%COMP%], .typeContainer[_ngcontent-%COMP%] .typeDescription[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{width:20px;height:20px}.typeContainer[_ngcontent-%COMP%] .typeDescription[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center}.typeContainer[_ngcontent-%COMP%] .subTypeContainer[_ngcontent-%COMP%]{padding-left:20px}.typeContainer[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{visibility:hidden;height:0}"],changeDetection:0})}}return n})();var W=function(n){return n.ADD="ADD",n.REMOVE="REMOVE",n.UPDATE="UPDATE",n}(W||{}),vl=u(6369);
1function bl(n,s){if(1&n&&t.EFF(0),2&n){const e=t.XpG(2);t.SpI(" ",e.currentAmount+e.amount.value," ")}}function Tl(n,s){if(1&n&&t.EFF(0),2&n){const e=t.XpG(2);t.SpI(" ",e.currentAmount-e.amount.value," ")}}function Ol(n,s){if(1&n&&(t.j41(0,"div",8)(1,"div",6),t.EFF(2),t.nI1(3,"translate"),t.nVh(4,bl,1,1),t.nVh(5,Tl,1,1),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",t.bMT(3,3,"assets.overview.consumables.stock.total"),": "),t.R7$(2),t.vxM(e.type===e.StockUpdateType.ADD?4:-1),t.R7$(),t.vxM(e.type===e.StockUpdateType.REMOVE?5:-1)}}class nt{static{this.numericValidator=c.k0.pattern("^[0-9]+[0-9]*$")}constructor(s,e,i){this.fb=s,this.consumableService=e,this.changeDetector=i,this.onClose=new t.bkB,this.StockUpdateType=W}ngOnInit(){this.form=this.fb.group({amount:[this.type===W.UPDATE?this.currentAmount:null,[nt.numericValidator,c.k0.required,c.k0.min(1)]]})}save(){if(this.form.valid){let s=this.amount.value;this.type===W.ADD?s+=this.currentAmount:this.type===W.REMOVE&&(s=this.currentAmount-s),this.consumableService.updateStock({consumableId:this.consumableId,locationId:this.locationId,amount:s}).subscribe(i=>{this.success=!0,this.changeDetector.markForCheck(),setTimeout(()=>{this.onClose.emit(!0)},1e3)})}}cancel(){this.onClose.emit(!1)}get amount(){return this.form.get("amount")}static{this.\u0275fac=function(e){return new(e||nt)(t.rXU(c.ok),t.rXU(J),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:nt,selectors:[["consumable-stock-update-popup"]],inputs:{consumableId:"consumableId",locationId:"locationId",currentAmount:"currentAmount",position:"position",type:"type"},outputs:{onClose:"onClose"},standalone:!1,decls:17,vars:16,consts:[[1,"optionsPopup"],[1,"popupContent","empty",3,"clickOutside","delayClickOutsideInit","clickOutsideEnabled"],[1,"optionForm"],[1,"mt-1"],[3,"formGroup"],[1,"row"],[1,"col-12"],["type","number","formControlName","amount","step","1",1,"form-control",3,"inputFocus"],[1,"row","mt-2"],[1,"row","mt-4"],["type","button",1,"btn","btn-primary","float-start",3,"click"],[3,"onButtonClick","alignRight","buttonDisabled","success"]],template:function(e,i){1&e&&(t.j41(0,"div",0)(1,"div",1),t.bIt("clickOutside",function(){return i.cancel()}),t.j41(2,"div",2)(3,"h4",3),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"form",4)(7,"div",5)(8,"div",6),t.nrm(9,"input",7),t.k0s()(),t.nVh(10,Ol,6,5,"div",8),t.k0s(),t.j41(11,"div",9)(12,"div",6)(13,"button",10),t.bIt("click",function(){return i.cancel()}),t.EFF(14),t.nI1(15,"translate"),t.k0s(),t.j41(16,"success-submit-button",11),t.bIt("onButtonClick",function(){return i.save()}),t.k0s()()()()()()),2&e&&(t.Aen(i.position),t.R7$(),t.Y8G("delayClickOutsideInit",!0)("clickOutsideEnabled",!0),t.R7$(3),t.SpI("",t.bMT(5,12,"assets.overview.consumables.stock."+i.type.toLowerCase()),":"),t.R7$(2),t.Y8G("formGroup",i.form),t.R7$(3),t.Y8G("inputFocus",!0),t.R7$(),t.vxM(i.type!==i.StockUpdateType.UPDATE?10:-1),t.R7$(4),t.JRh(t.bMT(15,14,"allpages.button.cancel")),t.R7$(2),t.Y8G("alignRight",!0)("buttonDisabled",!i.form.valid||i.buttonDisabled)("success",i.success))},dependencies:[at.l,gt.z,vl.i,c.qT,c.me,c.Q0,c.BC,c.cb,c.j4,c.JD,b.D],styles:[".popupContent[_ngcontent-%COMP%]{width:200px}"],changeDetection:0})}}const ut=n=>({active:n}),Ml=()=>({column:"name"}),xl=()=>({column:"count"});
1function Pl(n,s){if(1&n&&t.nrm(0,"suivo-avatar",2),2&n){const e=t.XpG();t.Y8G("fileName",e.consumable.avatars.SMALL)("hoverFileName",e.consumable.avatars.LARGE)("hoverFormat",e.AvatarFormat.LARGE)("format",e.AvatarFormat.SMALL)}}function yl(n,s){1&n&&t.nrm(0,"th")}function kl(n,s){if(1&n){const e=t.RV6();t.j41(0,"th",20)(1,"div",21)(2,"a",22),t.nI1(3,"translate"),t.bIt("click",function(o){l.eBV(e);const a=t.XpG().$implicit,r=t.XpG();return l.Njj(r.addStockLevel(o,r.StockUpdateType.ADD,a.id,a.count))}),t.nrm(4,"i",23),t.k0s(),t.j41(5,"a",22),t.nI1(6,"translate"),t.bIt("click",function(o){l.eBV(e);const a=t.XpG().$implicit,r=t.XpG();return l.Njj(r.addStockLevel(o,r.StockUpdateType.REMOVE,a.id,a.count))}),t.nrm(7,"i",24),t.k0s(),t.j41(8,"a",22),t.nI1(9,"translate"),t.bIt("click",function(o){l.eBV(e);const a=t.XpG().$implicit,r=t.XpG();return l.Njj(r.addStockLevel(o,r.StockUpdateType.UPDATE,a.id,a.count))}),t.nrm(10,"i",25),t.k0s()()()}2&n&&(t.R7$(2),t.Y8G("title",t.mNQ(t.bMT(3,6,"assets.overview.consumables.stock.add"))),t.R7$(3),t.Y8G("title",t.mNQ(t.bMT(6,8,"assets.overview.consumables.stock.remove"))),t.R7$(3),t.Y8G("title",t.mNQ(t.bMT(9,10,"assets.overview.consumables.stock.update"))))}function Fl(n,s){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td",18),t.EFF(4),t.k0s(),t.nVh(5,kl,11,12,"th",20),t.k0s()),2&n){const e=s.$implicit,i=t.XpG();t.R7$(2),t.JRh(e.name),t.R7$(2),t.JRh(e.count),t.R7$(),t.vxM(i.canEditStockLevel?5:-1)}}function Sl(n,s){if(1&n){const e=t.RV6();t.j41(0,"consumable-stock-update-popup",26),t.bIt("onClose",function(o){l.eBV(e);const a=t.XpG();return l.Njj(a.closeStockLevelPopup(o))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("type",e.stockLevelPopup.type)("position",e.stockLevelPopup.position)("consumableId",e.stockLevelPopup.consumableId)("locationId",e.stockLevelPopup.locationId)("currentAmount",e.stockLevelPopup.amount)}}function Il(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",27)(1,"i",28),t.bIt("click",function(){const o=l.eBV(e).column,a=t.XpG();return l.Njj(a.performColumnSort(o,!1))}),t.k0s(),t.j41(2,"i",29),t.bIt("click",function(){const o=l.eBV(e).column,a=t.XpG();return l.Njj(a.performColumnSort(o,!0))}),t.k0s()()}if(2&n){const e=s.column,i=t.XpG();t.R7$(),t.Y8G("ngClass",t.eq3(2,ut,i.sort.column==e&&!i.sort.ascending)),t.R7$(),t.Y8G("ngClass",t.eq3(4,ut,i.sort.column==e&&i.sort.ascending))}}let Rl=(()=>{class n{set consumable(e){this._consumable=e,this.initSearchForm(),this.fetchData(!0)}constructor(e,i,o,a,r){this.fb=e,this.consumableService=i,this.permissionService=o,this.cdRef=a,this.sortService=r,this.onUpdate=new t.bkB,this.activeTab=_.MH.STOCK_LOCATION,this.sort={column:"name",ascending:!0},this.AvatarFormat=L.Z,this.StockUpdateType=W,this.GroupType=_.MH}ngOnInit(){this.canEditStockLevel=this.permissionService.get("CONSUMABLE_MODIFY"),this.initSearchForm()}ngOnDestroy(){this.searchSubscription&&this.searchSubscription.unsubscribe(),this.hideSubscription&&this.hideSubscription.unsubscribe()}addStockLevel(e,i,o,a){this.stockLevelPopup={consumableId:this.consumable.consumableId,locationId:o,amount:a,type:i,position:{top:e.target.getBoundingClientRect().top-90+"px",left:e.target.getBoundingClientRect().left-200+"px",right:"auto"}}}closeStockLevelPopup(e){delete this.stockLevelPopup,e&&(this.fetchData(!0),this.onUpdate.emit())}toggleActiveTab(e){this.activeTab=e,this.fetchData(!0)}performColumnSort(e,i,o){o||(this.sort.ascending=this.sort.column==e?!this.sort.ascending:i),this.sort.column=e,this.fetchData(!0)}addMoreItems(){this.hasMoreItems&&this.fetchData()}fetchData(e){let i={consumableId:this.consumable.consumableId,type:this.activeTab,offset:e?0:this.locationsList.length,amount:50,ascending:this.sort.ascending,sortOnAmount:"amount"==this.sort.column,includeEmpty:!this.hideEmpty.value};!(0,m.hX)(this.query.value)&&(0===this.query.value.trim().length||this.query.value.trim().length>=3)&&(i.query=this.query.value.trim()),this.consumableService.getConsumableLocationInfo(i).subscribe(o=>{let a;this.consumableLocation=o,a=e?o.locations:this.locationsList.concat(o.locations),this.locationsList=a,this.hasMoreItems=o.total>this.locationsList.length,this.cdRef.markForCheck()})}initSearchForm(){(0,m.hX)(this.searchForm)&&(this.searchForm=this.fb.group({query:null,hideEmpty:!0}),this.searchSubscription=this.query.valueChanges.subscribe(e=>{!(0,m.hX)(this.query.value)&&(0===this.query.value.trim().length||this.query.value.trim().length>=3)&&this.fetchData(!0)}),this.hideSubscription=this.hideEmpty.valueChanges.subscribe(e=>{this.fetchData(!0)}))}get consumable(){return this._consumable}get query(){return this.searchForm.get("query")}get hideEmpty(){return this.searchForm.get("hideEmpty")}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(c.ok),t.rXU(J),t.rXU(q.n),t.rXU(k.gRc),t.rXU(C.a))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["consumable-stock-detail"]],inputs:{consumable:"consumable"},outputs:{onUpdate:"onUpdate"},standalone:!1,decls:41,vars:33,consts:[["sortIcons",""],[1,"mt-0"],[3,"fileName","hoverFileName","hoverFormat","format"],[3,"formGroup"],[1,"nav","nav-tabs"],[1,"nav-item",3,"ngClass"],[1,"nav-link",3,"click"],[1,"mt-1","py-2","d-flex","gap-3","align-items-center"],[1,"flex-grow-1"],["formControlName","query"],[1,"float-end"],[1,"switch","small","float-start","me-2"],["type","checkbox","formControlName","hideEmpty","id","suivoCustomResponsibleContact"],[1,"slider","round"],["infiniteScroll","",1,"locations","listWithActions",3,"scrolled","scrollWindow"],[1,"table","table-condensed","table-responsive","table-hover"],[1,"fixedHeader"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"stockCount"],[3,"type","position","consumableId","locationId","currentAmount"],[1,"pt-2"],[1,"actionIcons","float-end"],[1,"listAction","float-end",3,"click","title"],[1,"fa-solid","fa-plus","fa-lg","action"],[1,"fa-solid","fa-minus","fa-lg","action"],[1,"fa-solid","fa-pen","fa-lg","action"],[3,"onClose","type","position","consumableId","locationId","currentAmount"],[1,"sortIcons"],[1,"fas","fa-sort-up",3,"click","ngClass"],[1,"fas","fa-sort-down",3,"click","ngClass"]],template:function(i,o){if(1&i){const a=t.RV6();t.j41(0,"h2",1),t.nVh(1,Pl,1,4,"suivo-avatar",2),t.EFF(2),t.k0s(),t.j41(3,"form",3)(4,"ul",4)(5,"li",5)(6,"a",6),t.bIt("click",function(){return l.eBV(a),l.Njj(o.toggleActiveTab(o.GroupType.STOCK_LOCATION))}),t.EFF(7),t.nI1(8,"translate"),t.k0s()(),t.j41(9,"li",5)(10,"a",6),t.bIt("click",function(){return l.eBV(a),l.Njj(o.toggleActiveTab(o.GroupType.COST_LOCATION))}),t.EFF(11),t.nI1(12,"translate"),t.k0s()()(),t.j41(13,"div",7)(14,"div",8),t.nrm(15,"search-field",9),t.k0s(),t.j41(16,"div",10)(17,"label",11),t.nrm(18,"input",12)(19,"span",13),t.k0s(),t.EFF(20),t.nI1(21,"translate"),t.k0s()()(),t.j41(22,"div",14),t.bIt("scrolled",function(){return l.eBV(a),l.Njj(o.addMoreItems())}),t.j41(23,"table",15)(24,"thead",16)(25,"tr")(26,"th"),t.EFF(27),t.nI1(28,"translate"),t.eu8(29,17),t.k0s(),t.j41(30,"th",18),t.EFF(31),t.nI1(32,"translate"),t.eu8(33,17),t.k0s(),t.nVh(34,yl,1,0,"th"),t.k0s()(),t.j41(35,"tbody"),t.Z7z(36,Fl,6,3,"tr",null,t.fX1),t.k0s()()(),t.nVh(38,Sl,1,5,"consumable-stock-update-popup",19),t.DNE(39,Il,3,6,"ng-template",null,0,t.C5r)}if(2&i){const a=t.sdS(40);t.R7$(),t.vxM(null!=o.consumable.avatars&&null!=o.consumable.avatars.SMALL?1:-1),t.R7$(),t.SpI(" ",o.consumable.consumableName,"\n"),t.R7$(),t.Y8G("formGroup",o.searchForm),t.R7$(2),t.Y8G("ngClass",t.eq3(27,ut,o.activeTab===o.GroupType.STOCK_LOCATION)),t.R7$(2),t.SpI("",t.bMT(8,17,"permission.PAGE_STOCK_LOCATIONS")," "),t.R7$(2),t.Y8G("ngClass",t.eq3(29,ut,o.activeTab===o.GroupType.COST_LOCATION)),t.R7$(2),t.SpI("",t.bMT(12,19,"permission.PAGE_COST_LOCATIONS")," "),t.R7$(9),t.SpI(" ",t.bMT(21,21,"assets.overview.consumables.stock.hide")," "),t.R7$(2),t.Y8G("scrollWindow",!1),t.R7$(5),t.SpI(" ",t.bMT(28,23,"allpages.location")," "),t.R7$(2),t.Y8G("ngTemplateOutlet",a)("ngTemplateOutletContext",t.lJ4(31,Ml)),t.R7$(2),t.SpI(" ",t.bMT(32,25,"assets.overview.consumables.stock")," "),t.R7$(2),t.Y8G("ngTemplateOutlet",a)("ngTemplateOutletContext",t.lJ4(32,xl)),t.R7$(),t.vxM(o.canEditStockLevel?34:-1),t.R7$(2),t.Dyx(null==o.consumableLocation?null:o.consumableLocation.locations),t.R7$(2),t.vxM(o.stockLevelPopup?38:-1)}},dependencies:[p.YU,p.T3,$.F,Y.q,c.qT,c.Zm,c.BC,c.cb,c.j4,c.JD,Q.D,nt,b.D],styles:[".locations[_ngcontent-%COMP%]{height:calc(100% - 120px);overflow-y:auto}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:8px 0}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding-top:12px;border-top:none!important}table[_ngcontent-%COMP%] .stockCount[_ngcontent-%COMP%]{text-align:end;padding-right:10px}.nav-tabs.nav-tabs.nav-tabs[_ngcontent-%COMP%]{margin:0}.sortIcons[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;
1cursor:pointer}.sortIcons[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%]{color:var(--colors-general-soft-grey);height:3px}.sortIcons[_ngcontent-%COMP%] .fas.active[_ngcontent-%COMP%]{color:var(--colors-attention-primary)}suivo-avatar[_ngcontent-%COMP%]{padding-right:5px}"],changeDetection:0})}}return n})();function Ll(n,s){1&n&&(t.j41(0,"div",5),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"allpages.table.noData")," "))}function Al(n,s){if(1&n&&t.nrm(0,"suivo-avatar",13),2&n){const e=t.XpG().$implicit,i=t.XpG(2);t.Y8G("fileName",e.avatars.SMALL)("hoverFileName",e.avatars.LARGE)("hoverFormat",i.AvatarFormat.LARGE)("format",i.AvatarFormat.SMALL)}}function El(n,s){if(1&n){const e=t.RV6();t.j41(0,"tr",11),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(2);return l.Njj(a.onConsumableSelect(o))}),t.j41(1,"td",12),t.nVh(2,Al,1,4,"suivo-avatar",13),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td",14),t.EFF(6),t.k0s()()}if(2&n){const e=s.$implicit,i=t.XpG(2);t.AVh("selected",i.selectedConsumable.consumableId==e.consumableId),t.R7$(2),t.vxM(null!=e.avatars&&null!=e.avatars.SMALL?2:-1),t.R7$(2),t.JRh(e.consumableName),t.R7$(2),t.JRh(e.count)}}function jl(n,s){if(1&n&&(t.j41(0,"table",7)(1,"tbody"),t.Z7z(2,El,7,5,"tr",10,t.fX1),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.Dyx(e.visibleConsumables)}}function Dl(n,s){if(1&n){const e=t.RV6();t.j41(0,"consumable-stock-detail",15),t.bIt("onUpdate",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.fetchData(!0))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("consumable",e.selectedConsumable)}}let wl=(()=>{class n{set typesFilter(e){this._typesFilter=e,this.fetchData()}constructor(e,i,o){this.consumablesService=e,this.cdRef=i,this.sortService=o,this.AvatarFormat=L.Z,this.initSearch()}ngOnDestroy(){this.searchSubscription&&this.searchSubscription.unsubscribe()}onConsumableSelect(e){this.selectedConsumable=e}fetchData(e){this.consumablesService.getConsumablesCount(this.typesFilter?this.typesFilter:[]).subscribe(i=>{this.consumables=this.sortService.sort(i,"consumableName",!1,!0),this.visibleConsumables=this.consumables,e||(this.selectedConsumable=i[0]),this.cdRef.markForCheck()})}initSearch(){this.searchForm=new c.J3({query:new c.hs}),this.searchSubscription=this.query.valueChanges.subscribe(e=>{this.visibleConsumables=e&&e.length>=3&&this.consumables?this.consumables.filter(i=>i.consumableName.toLowerCase().includes(e.toLowerCase())):this.consumables})}get typesFilter(){return this._typesFilter}get query(){return this.searchForm.get("query")}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(J),t.rXU(k.gRc),t.rXU(C.a))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["consumables-stock-overview"]],inputs:{typesFilter:"typesFilter"},standalone:!1,decls:13,vars:7,consts:[[1,"tableHeader"],[1,"leftPanel"],[3,"formGroup"],["formControlName","query"],[1,"totalTitle","pull-right"],[1,"emptystate"],[1,"overviewContainer"],[1,"table"],[1,"rightPanel","consumableDetail"],[3,"consumable"],[3,"selected"],[3,"click"],[1,"consumableAvatar"],[3,"fileName","hoverFileName","hoverFormat","format"],[1,"consumableCount"],[3,"onUpdate","consumable"]],template:function(i,o){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"form",2),t.nrm(3,"search-field",3),t.k0s(),t.j41(4,"div",4),t.EFF(5),t.nI1(6,"translate"),t.k0s()()(),t.nVh(7,Ll,3,3,"div",5),t.j41(8,"div",6)(9,"div",1),t.nVh(10,jl,4,0,"table",7),t.k0s(),t.j41(11,"div",8),t.nVh(12,Dl,1,1,"consumable-stock-detail",9),t.k0s()()),2&i&&(t.R7$(2),t.Y8G("formGroup",o.searchForm),t.R7$(3),t.SpI(" ",t.bMT(6,5,"assets.overview.consumables.totalInStock")," "),t.R7$(2),t.vxM(o.consumables&&0!=o.consumables.length?-1:7),t.R7$(3),t.vxM(o.consumables?10:-1),t.R7$(2),t.vxM(o.selectedConsumable?12:-1))},dependencies:[$.F,Y.q,c.qT,c.BC,c.cb,c.j4,c.JD,Rl,b.D],styles:["[_nghost-%COMP%]{height:calc(100% - 40px);margin:0 -10px;display:block;max-width:1500px}.leftPanel[_ngcontent-%COMP%]{width:60%}.rightPanel[_ngcontent-%COMP%]{width:40%}.tableHeader[_ngcontent-%COMP%]{padding-bottom:10px;border-bottom:solid 1px var(--colors-general-soft-grey)}.tableHeader[_ngcontent-%COMP%] .leftPanel[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-end}.tableHeader[_ngcontent-%COMP%] .leftPanel[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{width:60%}.tableHeader[_ngcontent-%COMP%] .leftPanel[_ngcontent-%COMP%] .totalTitle[_ngcontent-%COMP%]{font-weight:700;padding-right:10px}.overviewContainer[_ngcontent-%COMP%]{height:calc(100% - 42px);display:flex}.overviewContainer[_ngcontent-%COMP%] .leftPanel[_ngcontent-%COMP%]{height:calc(100% - 15px);overflow:auto}.overviewContainer[_ngcontent-%COMP%] .consumableDetail[_ngcontent-%COMP%]{padding:20px 0 20px 20px}.overviewContainer[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%}.overviewContainer[_ngcontent-%COMP%] table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:10px}.overviewContainer[_ngcontent-%COMP%] table[_ngcontent-%COMP%] td.consumableAvatar[_ng
1content-%COMP%]{padding-top:7px;padding-bottom:7px;padding-right:0}.overviewContainer[_ngcontent-%COMP%] table[_ngcontent-%COMP%] .consumableCount[_ngcontent-%COMP%]{text-align:right;font-weight:700}.overviewContainer[_ngcontent-%COMP%] .selected[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{background-color:var(--colors-general-background-grey);font-weight:700}.overviewContainer[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{cursor:pointer}.emptystate[_ngcontent-%COMP%]{padding-top:10px;width:100%}"],changeDetection:0})}}return n})();var Gl=u(65027),$l=u(34098);const Vl=n=>({"has-error":n}),Ut=n=>({active:n}),Yt=n=>[n];function Nl(n,s){1&n&&(t.j41(0,"div",33),t.nrm(1,"input",34)(2,"div",30),t.k0s())}function Xl(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",20),t.DNE(1,Nl,3,0,"div",28),t.j41(2,"input",29),t.bIt("change",function(){const o=l.eBV(e).$implicit,a=t.XpG();return l.Njj(a.addLocation(o))}),t.k0s(),t.j41(3,"div",30)(4,"label",31),t.nrm(5,"i",32),t.EFF(6),t.k0s()()()}if(2&n){const e=s.$implicit;t.R7$(2),t.Y8G("id",t.VkB("unusedLocationItem",e.name)),t.R7$(2),t.Y8G("for",t.VkB("unusedLocationItem",e.name))("title",t.mNQ(e.name)),t.R7$(2),t.SpI(" \xa0",e.name)}}function Bl(n,s){1&n&&(t.j41(0,"div",33),t.nrm(1,"input",34)(2,"div",30),t.k0s())}function Ul(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",35),t.bIt("cdkDragStarted",function(){const o=l.eBV(e).$index,a=t.XpG();return l.Njj(a.onDrag(o))}),t.DNE(1,Bl,3,0,"div",28),t.j41(2,"input",36),t.bIt("change",function(){const o=l.eBV(e).$implicit,a=t.XpG();return l.Njj(a.removeLocation(o))}),t.k0s(),t.j41(3,"div",30)(4,"div",37)(5,"label",31),t.nrm(6,"i",32),t.EFF(7),t.k0s()()()()}if(2&n){const e=s.$implicit;t.R7$(2),t.Y8G("id",t.VkB("usedLocationItem",e.name)),t.R7$(3),t.Y8G("for",t.VkB("usedLocationItem",e.name))("title",t.mNQ(e.name)),t.R7$(2),t.SpI(" \xa0",e.name)}}let Yl=(()=>{class n{set selectedPreset(e){this._selectedPreset=e,this.locationSelectionChanged=!1,e?(this.initFormValues(),(0,m.hX)(this.allLocations)||this.setPresetLocations(this._selectedPreset)):this.allLocations&&this.allLocations.length>0&&this.resetForm()}constructor(e,i,o,a){this.fb=e,this.consumableService=i,this.cdRef=o,this.sortService=a,this.stockLocationActive=!0,this.onSave=new t.bkB,this.getAllLocations(),this.locationForm=this.fb.group({presetName:["",c.k0.required],query:""}),this.initSearchField()}ngOnDestroy(){this.saveSubscription&&this.saveSubscription.unsubscribe(),this.searchSubscription&&this.searchSubscription.unsubscribe()}initSearchField(){this.searchSubscription=this.query.valueChanges.subscribe(e=>{e&&e.length>=3?this.unusedStockLocations&&this.stockLocationActive?this.unusedStockLocations=this.unusedStockLocations.filter(i=>i.name.toLowerCase().includes(e.toLowerCase())):this.unusedCostLocations=this.unusedCostLocations.filter(i=>i.name.toLowerCase().includes(e.toLowerCase())):this.unusedStockLocations&&this.stockLocationActive?this.unusedStockLocations=this.sortByName(this.stockLocations):this.unusedCostLocations=this.sortByName(this.costLocations)})}setPresetLocations(e){let i=this.allLocations.reduce((o,a)=>(o[a.id]=a,o),{});this.usedLocations=e.selectedLocations.filter(o=>!(0,m.hX)(i[o])).map(o=>i[o]),this.unusedCostLocations=this.sortByName(this.costLocations.filter(o=>!e.selectedLocations.includes(o.id))),this.unusedStockLocations=this.sortByName(this.stockLocations.filter(o=>!e.selectedLocations.includes(o.id))),this.cdRef.markForCheck()}toggleTabs(e){this.stockLocationActive=e,this.cdRef.markForCheck()}addLocation(e){let o,i=null;o=e.groupType===_.MH.STOCK_LOCATION?this.unusedStockLocations:this.unusedCostLocations,o.find((a,r)=>(a&&a.name===e.name&&(i=r),a&&a.name===e.name)),null!=i&&(e.groupType===_.MH.STOCK_LOCATION?this.unusedStockLocations.splice(i,1):this.unusedCostLocations.splice(i,1)),this.usedLocations.push(e),this.locationSelectionChanged=!0,this.cdRef.markForCheck()}removeLocation(e){let i=null;this.usedLocations.find((o,a)=>(o&&o.name===e.name&&(i=a),o&&o.name===e.name)),null!=i&&this.usedLocations.splice(i,1),e.groupType===_.MH.STOCK_LOCATION?(this.unusedStockLocations.push(e),this.unusedStockLocations=this.sortByName(this.unusedStockLocations)):(this.unusedCostLocations.push(e),this.unusedCostLocations=this.sortByName(this.unusedCostLocations)),this.locationSelectionChanged=!0,this.cdRef.markForCheck()}moveLocation(e,i){let o=null;this.usedLocations.find((d,h)=>(d&&d.name===e.name&&(o=h),d&&d.name===e.name));const r=this.usedLocations.splice(o+i,1,this.usedLocations[o])[0];this.usedLocations.splice(o,1,r),this.locationSelectionChanged=!0,this.cdRef.markForCheck()}resetForm(){this.stockLocationActive=!0,this.initFormValues(),this.selectedPreset?this.setPresetLocations(this.selectedPreset):this.initLocationLists(),this.locationSelectionChanged=!1}savePreset(){let e;this.buttonDisabled=!0,e=null!==this._selectedPreset?this._selectedPreset.guid:this.generateGuid();let i={guid:e,name:this.presetName.value,selectedLocations:this.usedLocations.map(o=>o.id),active:!0};this.consumableService.savePreset(i).subscribe(o=>{this.success=!0,this.onSave.emit(o),this.cdRef.markForCheck(),setTimeout(()=>{this.success=!1},2e3)})}hasError(e){return e&&e.errors&&(e.dirty||e.touched)}drop(e,i){let o=i?this.usedLocations:this.stockLocationActive?this.unusedStockLocations:this.unusedCostLocations;e.previousContainer===e.container?(0,D.HD)(o,e.previousIndex,e.currentIndex):((0,D.eg)(i?this.stockLocationActive?this.unusedStockLocations:this.unusedCostLocations:this.usedLocations,o,e.previousIndex,e.currentIndex),i||(this.stockLocationActive?this.unusedStockLocations=this.sortByName(this.unusedStockLocations):this.unusedCostLocations=this.sortByName(this.unusedCostLocations))),this.locationSelectionChanged=!0,this.cdRef.markForCheck()}onDragEntered(){let e=this.usedLocations.at(this.dragElemPreviousIndex).groupType;this.stockLocationActive=e==_.MH.STOCK_LOCATION,this.cdRef.markForCheck()}onDrag(e){this.dragElemPreviousIndex=e}initFormValues(){this.locationForm.reset({presetName:this.selectedPreset?this.selectedPreset.name:"",query:null})}getAllLocations(){this.consumableService.getAllLocations().subscribe(e=>{this.stockLocations=e.stockLocations,this.costLocations=e.costLocations,this.allLocations=[...this.stockLocations,...this.costLocations],this.initLocationLists(),this._selectedPreset&&this.setPresetLocations(this._selectedPreset),this.cdRef.markForCheck()})}initLocationLists(){this.unusedStockLocations=this.sortByName(JSON.parse(JSON.stringify(this.stockLocations))),this.unusedCostLocations=this.sortByName(JSON.parse(JSON.stringify(this.costLocations))),this.usedLocations=[],this.cdRef.markForCheck()}generateGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var i=16*Math.random()|0;return("x"==e?i:3&i|8).toString(16)})}sortByName(e){return this.sortService.sort(e,"name",!1,!0)}get presetName(){return this.locationForm.get("presetName")}get query(){return this.locationForm.get("query")}get selectedPreset(){return this._selectedPreset}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(c.ze),t.rXU(J),t.rXU(k.gRc),t.rXU(C.a))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["consumables-location-management-config"]],inputs:{selectedPreset:"selectedPreset",presets:"presets"},outputs:{onSave:"onSave"},standalone:!1,decls:49,vars:35,consts:[["unusedList","cdkDropList"],["usedList","cdkDropList"],[1,"viewContainer"],[1,"view"],[1,"d-flex","flex-column","h-100",3,"formGroup"],[1,"col-12","presetNameContainer",3,"ngClass"],[1,"col-12"],["field-required",""],["type","text","formControlName","presetName",1,"form-control"],[3,"control"],[1,"subtitleContainer"],[1,"nav","nav-tabs"],[1,"nav-item",3,"click","ngClass"],[1,"nav-link"],[1,"locationWrapper","flex-grow-1"],[1,"locationContainer","availableLocations"],[1,"unusedLocationList"],[1,"has-feedback"],["formControlName","query"],["cdkDropList","","cdkDropListSortingDisabled","",1,"unusedLocationsList",3,"cdkDropListDropped","cdkDropListConnectedTo"],["cdkDrag",""],[1,"locationContainer","selectedLocations"],[1,"usedLocationList"],["cdkDropList","",3,"cdkDropListExited","cdkDropListDropped","cdkDropListConnectedTo"],[1,"viewButtons"],[1,"row","buttonContainer"],["type","button",1,"btn","btn-md","float-start",3,"click"],[3,"onButtonClick","alignRight","success","buttonDisabled"],["class","locationItemPlaceholder",4,"cdkDragPlaceholder"],["type","checkbox",3,"change","id"],[1,"locationItem"],[1,"locationName",3,"for","title"],[1,"fas","fa-grip-vertical"],[1,"locationItemPlaceholder"],["type","checkbox"],["cdkDrag","",3,"cdkDragStarted"],["type","checkbox","checked","",3,"change","id"],[1,"d-flex","justify-content-between","align-items-center"]],template:function(i,o){if(1&i){const a=t.RV6();t.j41(0,"div",2)(1,"div",3)(2,"form",4),t.qex(3),t.j41(4,"div",5)(5,"div",6)(6,"label"),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.nrm(9,"span",7)(10,"input",8)(11,"show-errors",9),t.k0s()(),t.nrm(12,"hr"),t.bVm(),t.j41(13,"div",10)(14,"ul",11)(15,"li",12),t.bIt("click",function(){return l.eBV(a),l.Njj(o.toggleTabs(!0))}),t.j41(16,"a",13),t.EFF(17),t.nI1(18,"translate"),t.k0s()(),t.j41(19,"li",12),t.bIt("click",function(){return l.eBV(a),l.Njj(o.toggleTabs(!1))}),t.j41(20,"a",13),t.EFF(21),t.nI1(22,"translate"),t.k0s()()(),t.j41(23,"label")(24,"b"),t.EFF(25),t.nI1(26,"translate"),t.k0s()()(),t.j41(27,"div",14)(28,"div",15)(29,"div",16)(30,"div",17),t.nrm(31,"search-field",18),t.k0s(),t.j41(32,"ul",19,0),t.bIt("cdkDropListDropped",function(d){return l.eBV(a),l.Njj(o.drop(d,!1))}),t.Z7z(34,Xl,7,7,"li",20,t.fX1),t.k0s()()(),t.j41(36,"div",21)(37,"div",22)(38,"ul",23,1),t.bIt("cdkDropListExited",function(){return l.eBV(a),l.Njj(o.onDragEntered())})("cdkDropListDropped",function(d){return l.eBV(a),l.Njj(o.drop(d,!0))}),t.Z7z(40,Ul,8,7,"li",20,t.fX1),t.k0s()()()()()(),t.j41(42,"div",24)(43,"div",25)(44,"div",6)(45,"button",26),t.bIt("click",function(){return l.eBV(a),l.Njj(o.resetForm())}),t.EFF(46),t.nI1(47,"translate"),t.k0s(),t.j41(48,"success-submit-button",27),t.bIt("onButtonClick",function(){return l.eBV(a),l.Njj(o.savePreset())}),t.k0s()()()()()}if(2&i){const a=t.sdS(33),r=t.sdS(39);t.R7$(2),t.Y8G("formGroup",o.locationForm),t.R7$(2),t.Y8G("ngClass",t.eq3(25,Vl,o.hasError(o.presetName))),t.R7$(3),t.JRh(t.bMT(8,15,"allpages.list.edit.presetName")),t.R7$(4),t.Y8G("control",o.presetName),t.R7$(4),t.Y8G("ngClass",t.eq3(27,Ut,o.stockLocationActive)),t.R7$(2),t.JRh(t.bMT(18,17,"permission.PAGE_STOCK_LOCATIONS")),t.R7$(2),t.Y8G("ngClass",t.eq3(29,Ut,!o.stockLocationActive)),t.R7$(2),t.JRh(t.bMT(22,19,"permission.PAGE_COST_LOCATIONS")),t.R7$(4),t.JRh(t.bMT(26,21,"assets.overview.consumables.selectedLocations")),t.R7$(7),t.Y8G("cdkDropListConnectedTo",t.eq3(31,Yt,r)),t.R7$(2),t.Dyx(o.stockLocationActive?o.unusedStockLocations:o.unusedCostLocations),t.R7$(4),t.Y8G("cdkDropListConnectedTo",t.eq3(33,Yt,a)),t.R7$(2),t.Dyx(o.usedLocations),t.R7$(6),t.JRh(t.bMT(47,23,"allpages.button.reset")),t.R7$(2),t.Y8G("alignRight",!0)("success",o.success)("buttonDisabled",o.locationForm.invali
1d||!(o.presetName.dirty||o.locationSelectionChanged)||o.buttonDisabled)}},dependencies:[p.YU,Lt.w,at.l,$l.T,Y.q,c.qT,c.me,c.BC,c.cb,c.j4,c.JD,D.O7,D.T1,D.EM,b.D],styles:["hr[_ngcontent-%COMP%]{margin:10px 0}.viewAction[_ngcontent-%COMP%]{padding:6px 0 6px 6px;cursor:pointer}.btn-group[_ngcontent-%COMP%]{margin:0}.btn-group[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%]{font-size:15px}.has-feedback[_ngcontent-%COMP%]{padding:10px;border-bottom:1px solid var(--colors-general-soft-grey);background-color:var(--colors-general-background-grey)}.has-feedback[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%]{top:0;right:10px}.nav-tabs[_ngcontent-%COMP%]{border-bottom-width:0;position:relative;top:1px;margin:0!important}.locationWrapper[_ngcontent-%COMP%]{display:flex;display:-ms-flex;align-items:flex-end;-ms-flex-align:end;border:1px solid var(--colors-general-soft-grey);height:35vh}.locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%]{width:50%;height:100%;flex:1 1 auto;-ms-flex:1 1 auto}.locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .unusedLocationList[_ngcontent-%COMP%], .locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .usedLocationList[_ngcontent-%COMP%]{height:100%;padding:1px 1px 0 0;border-radius:4px;display:flex;display:-ms-flex;flex-direction:column}.locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .unusedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .usedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{flex:1 1 auto;-ms-flex:1 1 auto;overflow-y:auto;overflow-x:hidden;margin-bottom:0;padding:5px 5px 5px 3px}.locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .unusedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .usedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:3px 10px 5px}.locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .unusedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:first-of-type, .locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .usedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:first-of-type{padding-top:10px}.locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .unusedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-of-type, .locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .usedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-of-type{padding-bottom:10px}.locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .unusedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .locationItem[_ngcontent-%COMP%], .locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .usedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .locationItem[_ngcontent-%COMP%]{margin-left:10px;cursor:move}.locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .unusedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .locationItem[_ngcontent-%COMP%] .locationName[_ngcontent-%COMP%], .locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .usedLocationList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .locationItem[_ngcontent-%COMP%] .locationName[_ngcontent-%COMP%]{cursor:move;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .unusedLocationList[_ngcontent-%COMP%] label[_ngcontent-%COMP%], .locationWrapper[_ngcontent-%COMP%] .locationContainer[_ngcontent-%COMP%] .usedLocationList[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:400;margin-bottom:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.availableLocations[_ngcontent-%COMP%]{border-right:1px solid var(--colors-general-soft-grey)}.viewContainer[_ngcontent-%COMP%]{display:flex;display:-ms-flex;flex-direction:column;height:100%}.viewContainer[_ngcontent-%COMP%] .view[_ngcontent-%COMP%]{flex:1 1 auto;-ms-flex:1 1 auto;overflow-y:auto;overflow-x:hidden;padding:20px}.viewContainer[_ngcontent-%COMP%] .view[_ngcontent-%COMP%] .presetNameContainer[_ngcontent-%COMP%]{padding:0}.viewContainer[_ngcontent-%COMP%] .view[_ngcontent-%COMP%] .presetNameContainer[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:700}.viewContainer[_ngcontent-%COMP%] .view[_ngcontent-%COMP%] .subtitleContainer[_ngcontent-%COMP%]{display:flex;margin-top:8px}.viewContainer[_ngcontent-%COMP%] .view[_ngcontent-%COMP%] .subtitleContainer[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{width:50%;margin-bottom:0;display:flex;align-items:center}.viewContainer[_ngcontent-%COMP%] .view[_ngcontent-%COMP%] .viewButtons[_ngcontent-%COMP%]{flex:0 0 auto;-ms-flex:0 0 auto;padding:5px 20px 15px;border-top:1px solid var(--colors-general-soft-grey)}i[_ngcontent-%COMP%]{margin-right:5px}.labelContainer[_ngcontent-%COMP%]{font-weight:400;margin-bottom:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}success-submit-button[_ngcontent-%COMP%]{margin-bottom:5px}.buttonContainer[_ngcontent-%COMP%]{margin-left:0;margin-right:0;padding:5px 10px 15px;border-top:1px solid var(--colors-general-soft-grey)}.locationItem[_ngcontent-%COMP%]{border:1px solid var(--colors-general-soft-grey);padding:8px 15px;position:relative;width:100%}.cdk-drag-preview[_ngcontent-%COMP%]{background-color:transparent;list-style:none;height:auto!important;left:10px}.cdk-drag-preview[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:none}.cdk-drag-preview[_ngcontent-%COMP%] .locationItem[_ngcontent-%COMP%]{height:37px;width:calc(100% - 40px);box-sizing:border-box;background-color:var(--colors-attention-light);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-preview[_ngcontent-%COMP%] .locationItem[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{margin-bottom:0;font-weight:400!important}.locationItemPlaceholder[_ngcontent-%COMP%]{position:relative;
1left:10px;display:flex;align-items:center;padding:3px 20px 5px 0}.locationItemPlaceholder[_ngcontent-%COMP%] .locationItem[_ngcontent-%COMP%]{height:37px;margin-left:10px;border:dashed 1px var(--colors-general-medium-grey)}.fa-grip-vertical[_ngcontent-%COMP%]{color:var(--colors-general-soft-grey)!important}"],changeDetection:0})}}return n})();const Hl=n=>({active:n});function zl(n,s){if(1&n){const e=t.RV6();t.j41(0,"li",13),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG();return l.Njj(a.selectPreset(o))}),t.j41(1,"span",14),t.EFF(2),t.k0s(),t.j41(3,"div",15)(4,"i",16),t.nI1(5,"translate"),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG();return l.Njj(a.deletePreset(o))}),t.k0s()()()}if(2&n){const e=s.$implicit,i=t.XpG();t.Y8G("ngClass",t.eq3(7,Hl,i.selectedPreset===e)),t.R7$(),t.Y8G("title",e.name),t.R7$(),t.JRh(e.name),t.R7$(2),t.Y8G("title",t.mNQ(t.bMT(5,5,"allpages.button.delete")))}}function Jl(n,s){1&n&&(t.j41(0,"li",9),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"allpages.list.view.presets.new")," "))}function Kl(n,s){if(1&n){const e=t.RV6();t.j41(0,"a",17),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.addNewPreset())}),t.nrm(1,"i",18),t.EFF(2),t.nI1(3,"translate"),t.k0s()}2&n&&(t.R7$(2),t.SpI("\xa0\xa0",t.bMT(3,1,"assets.overview.consumables.addPreset")," "))}let Zl=(()=>{class n{constructor(e,i,o){this.consumableService=e,this.translationService=i,this.cdRef=o,this.closePopup=new t.bkB,this.onPresetsSave=new t.bkB}ngOnInit(){this.create?this.selectedPreset=null:this.editGuid?this.selectedPreset=this.presets.find(e=>e.guid==this.editGuid):this.presets&&this.presets.length>0&&(this.selectedPreset=this.presets.find(e=>e.active))}onSave(e){this.presets=e,this.selectedPreset=this.presets.find(i=>i.active),this.onPresetsSave.emit(this.presets),this.cdRef.markForCheck()}deletePreset(e){confirm(this.translationService.get("fuel.delete.confirm"))&&this.consumableService.deletePreset(e.guid).subscribe(i=>{this.presets=i,this.onPresetsSave.emit(this.presets),this.cdRef.markForCheck()})}close(){this.closePopup.emit(!1)}addNewPreset(){this.create=!0,this.selectedPreset=null}selectPreset(e){this.create=!1,this.selectedPreset=e}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(J),t.rXU(f.L),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["consumables-location-management"]],inputs:{presets:"presets",editGuid:"editGuid",create:"create"},outputs:{selectedPreset:"selectedPreset",closePopup:"closePopup",onPresetsSave:"onPresetsSave"},standalone:!1,decls:21,vars:10,consts:[[1,"popupBackgroundOverlay"],[1,"optionsPopup"],[1,"popupContent","empty","full-height"],[1,"optionForm","full-height"],["type","button",1,"btn-close","float-end",3,"click"],[1,"manageLocationContainer"],[1,"presetContainer"],[1,"presetItemsList"],[3,"ngClass"],[1,"active"],[1,"newPresetLink"],[1,"configForm"],[3,"onSave","selectedPreset","presets"],[3,"click","ngClass"],[3,"title"],[1,"itemActions","float-end"],[1,"actionIcon","fas","fa-trash-alt","fa-lg","action","fa-pull-right",3,"click","title"],[1,"newPresetLink",3,"click"],[1,"fas","fa-plus"]],template:function(i,o){1&i&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"button",4),t.bIt("click",function(){return o.close()}),t.k0s(),t.j41(5,"h1"),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.j41(8,"div",5)(9,"div",6)(10,"h3"),t.EFF(11),t.nI1(12,"translate"),t.k0s(),t.j41(13,"div",7)(14,"ul"),t.Z7z(15,zl,6,9,"li",8,t.fX1),t.nVh(17,Jl,3,3,"li",9),t.k0s()(),t.nVh(18,Kl,4,3,"a",10),t.k0s(),t.j41(19,"div",11)(20,"consumables-location-management-config",12),t.bIt("onSave",function(r){return o.onSave(r)}),t.k0s()()()()()()()),2&i&&(t.R7$(6),t.JRh(t.bMT(7,6,"assets.overview.consumables.manageLocations")),t.R7$(5),t.JRh(t.bMT(12,8,"allpages.list.view.presets")),t.R7$(4),t.Dyx(o.presets),t.R7$(2),t.vxM(o.create?17:-1),t.R7$(),t.vxM(o.create?-1:18),t.R7$(2),t.Y8G("selectedPreset",o.selectedPreset)("presets",o.presets))},dependencies:[p.YU,Yl,b.D],styles:['[_ngcontent-%COMP%]:root{--font-family: Arial, "MS Trebuchet", sans-serif;--colors-general-black: #042231;--colors-general-medium-black: #2C404C;--colors-general-soft-black: #364C59;--colors-general-hard-grey: #4C6472;--colors-general-medium-grey: #748B99;--colors-general-soft-grey: #D8E0E5;--colors-general-background-grey: #F8F9FA;--colors-general-white: #ffffff;--colors-attention-active: #0039AB;--colors-attention-hover: #296CDB;--colors-attention-primary: #4285F4;--colors-attention-soft: #EBF3FE;--colors-attention-light: #F5F9FF;--colors-navigation-highlight: #EC192E;--colors-error-text: #BA000C;--colors-error-general: #DA1E27;--colors-error-background: #FEF3F4;--colors-success-text: #005702;--colors-success-general: #24A047;--colors-success-background: #F3FAF5;--colors-warning-text: #7A4D05;--colors-warning-general: #FDD03A;--colors-warning-background: #FeF9E7;--colors-eco-green: #24A047;--colors-eco-yellow: #FDD03A;--colors-eco-orange: #F59803;--colors-eco-red: #DA1E27;--colors-eco-dark-red: #ba1f1f;--colors-moment-drive: #4285F4;--colors-moment-stop: #748b99;--colors-moment-idle: #FDD03A;--colors-moment-privacy: #D8E0E5;--navigation-sub-highlight-color: #EC192E;--colors-interpreted-work: #49B048;--colors-interpreted-rest: #748B9A;--colors-interpreted-mobility: #FD9B3B;--colors-password-strong: #24A047;--colors-password-good: #FDD03A;--colors-password-moderate: #F59803;--colors-password-poor: #DA1E27;--colors-partially-validated-background: #fff9bc;
1--colors-validated-background: #ccf9dc;--colors-timesheet-selected: #d5e5fd;--colors-ciao-in: #296cdb;--colors-ciao-out: #c6d9f7;--colors-anomaly-blocking: #910008;--colors-timesheet-surcharge: #b98804;--colors-anomaly-moderate-text: #ee7b11;--button-border-radius: 4px;--navigation-header-height: 54px;--navigation-tabs-height: 42px;--list-row-odd-background-color: #f7f7f7;--list-row-even-background-color: #ffffff;--form-control-border-radius: 4px;--form-control-border-width: 1px;--navigation-background-color: #ffffff;--navigation-width: 66px;--navigation-text-color: #ffffff;--headings-line-height: 1.1}.optionsPopup[_ngcontent-%COMP%]{margin:0 auto;left:0!important;right:0;width:1200px}.manageLocationContainer[_ngcontent-%COMP%]{overflow-x:hidden;overflow-y:auto;display:flex;flex-direction:row;height:100%;margin-top:-10px;margin-bottom:-10px}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%]{width:235px;border-right:1px solid var(--colors-general-soft-grey);padding:15px}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .newPresetLink[_ngcontent-%COMP%]{cursor:pointer;display:inline-block;color:var(--colors-general-hard-grey);border:1px dashed var(--colors-general-soft-grey);padding:8px 12px;width:100%}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .newPresetLink[_ngcontent-%COMP%]:hover{background-color:var(--colors-attention-light)}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%]{overflow:auto;overflow-x:hidden;max-height:calc(100% - 75px);margin:0 -15px}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:4px 0}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:1px 0;padding:10px 10px 10px 20px;position:relative;display:flex;align-items:center}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .itemActions[_ngcontent-%COMP%]{display:none;position:absolute;right:0;padding:0 12px;transform:translateY(-50%);top:50%;background-color:inherit}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden;display:block;max-width:100%;white-space:nowrap}@media (hover: none){.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .itemActions[_ngcontent-%COMP%]{padding:0;min-width:20%;display:flex;align-items:center;justify-content:flex-end;position:unset;transform:unset}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .itemActions[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin:0 6px;font-size:14px}}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover{background:var(--colors-attention-light)}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover .itemActions[_ngcontent-%COMP%]{display:block}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(.active){cursor:pointer}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li.active[_ngcontent-%COMP%]{background:var(--colors-attention-soft);font-weight:700}.manageLocationContainer[_ngcontent-%COMP%] .presetContainer[_ngcontent-%COMP%] .presetItemsList[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li.active[_ngcontent-%COMP%]:before{position:absolute;width:6px;top:0;left:0;height:100%;content:"";background:var(--colors-attention-primary)}.manageLocationContainer[_ngcontent-%COMP%] .configForm[_ngcontent-%COMP%]{flex-grow:1;display:flex;flex-direction:column}.manageLocationContainer[_ngcontent-%COMP%] .configForm[_ngcontent-%COMP%] consumables-location-management-config[_ngcontent-%COMP%]{height:100%}
1.popupBackgroundOverlay[_ngcontent-%COMP%] .optionForm[_ngcontent-%COMP%]{display:flex;display:-ms-flex;flex-direction:column;height:100%;padding:10px 0}.popupBackgroundOverlay[_ngcontent-%COMP%] .optionForm[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.popupBackgroundOverlay[_ngcontent-%COMP%] .optionForm[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{border-bottom:unset!important;margin:5px 0 10px 5px;padding-bottom:10px;padding-top:5px}.popupBackgroundOverlay[_ngcontent-%COMP%] .optionForm[_ngcontent-%COMP%] .btn-close[_ngcontent-%COMP%]{position:absolute;right:10px}'],changeDetection:0})}}return n})();const Wl=n=>({active:n});function ql(n,s){if(1&n){const e=t.RV6();t.j41(0,"button",9),t.bIt("click",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.onExport())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&n&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"allpages.button.export")," "))}function Ql(n,s){1&n&&t.nrm(0,"i",18)}function tr(n,s){1&n&&t.nrm(0,"span",19)}function er(n,s){if(1&n){const e=t.RV6();t.j41(0,"li")(1,"div",17),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(3);return l.Njj(a.switchPreset(o))}),t.nVh(2,Ql,1,0,"i",18),t.nVh(3,tr,1,0,"span",19),t.j41(4,"span",20),t.EFF(5),t.k0s()(),t.j41(6,"div",21)(7,"i",22),t.nI1(8,"translate"),t.bIt("click",function(){const o=l.eBV(e).$implicit,a=t.XpG(3);return l.Njj(a.onEditPreset(o.guid))}),t.k0s()()()}if(2&n){const e=s.$implicit;t.R7$(2),t.vxM(e.active?2:-1),t.R7$(),t.vxM(e.active?-1:3),t.R7$(),t.Y8G("ngClass",t.eq3(8,Wl,e.active)),t.R7$(),t.JRh(e.name),t.R7$(2),t.Y8G("title",t.mNQ(t.bMT(8,6,"allpages.button.edit")))}}function nr(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",13),t.bIt("click",function(o){return l.eBV(e),l.Njj(o.stopPropagation())}),t.j41(1,"div",14),t.bIt("clickOutside",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.closePresetsPopup())}),t.j41(2,"ul"),t.Z7z(3,er,9,10,"li",null,t.fX1),t.k0s(),t.j41(5,"a",15),t.bIt("click",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.onEditPreset(null,!0))}),t.nrm(6,"i",16),t.EFF(7),t.nI1(8,"translate"),t.k0s()()()}if(2&n){const e=t.XpG(2);t.R7$(),t.Y8G("clickOutsideEnabled",!e.popupConfig)("delayClickOutsideInit",!0)("exclude",".presetViewBtn"),t.R7$(2),t.Dyx(e.presets),t.R7$(4),t.SpI("\xa0 ",t.bMT(8,4,"allpages.filter.create"),"... ")}}function ir(n,s){if(1&n&&(t.j41(0,"button",10)(1,"span",11),t.EFF(2),t.k0s()(),t.nVh(3,nr,9,6,"div",12)),2&n){const e=t.XpG();t.Y8G("title",null==e.activePreset?null:e.activePreset.name),t.R7$(2),t.SpI("",null==e.activePreset?null:e.activePreset.name,"\xa0"),t.R7$(),t.vxM(e.popupConfig?-1:3)}}function or(n,s){1&n&&(t.j41(0,"th",28)(1,"div",29),t.EFF(2),t.nI1(3,"translate"),t.j41(4,"span",30),t.nI1(5,"translate"),t.nrm(6,"i",31),t.k0s()()()),2&n&&(t.R7$(2),t.SpI(" ",t.bMT(3,4,"permission.LOCATION_ADD"),"... \xa0 "),t.R7$(2),t.Y8G("tooltipContent",t.bMT(5,6,"assets.overview.consumables.locations.tooltip"))("tooltipPosition","bottom")("tooltipSize","small"))}function sr(n,s){1&n&&t.nrm(0,"i",34)}function ar(n,s){1&n&&t.nrm(0,"suivo-icon",35),2&n&&t.Y8G("icon","COST_LOCATION")("size",16)}function lr(n,s){if(1&n&&(t.j41(0,"th",32)(1,"div",33),t.nVh(2,sr,1,0,"i",34),t.nVh(3,ar,1,2,"suivo-icon",35),t.j41(4,"div",36),t.EFF(5),t.k0s()()()),2&n){const e=t.XpG(),i=e.$implicit,o=e.$index,a=t.XpG(3);t.Y8G("title",null==a.locations[i]?null:a.locations[i].name),t.R7$(),t.AVh("firstLabel",0===o),t.R7$(),t.vxM((null==a.locations[i]?null:a.locations[i].groupType)==a.groupType.STOCK_LOCATION?2:-1),t.R7$(),t.vxM((null==a.locations[i]?null:a.locations[i].groupType)==a.groupType.COST_LOCATION?3:-1),t.R7$(),t.Y8G("title",null==a.locations[i]?null:a.locations[i].name),t.R7$(),t.SpI(" ",null==a.locations[i]?null:a.locations[i].name," ")}}function rr(n,s){if(1&n&&t.nVh(0,lr,6,7,"th",32),2&n){const e=s.$implicit,i=t.XpG(3);t.vxM(i.locations[e]?0:-1)}}function cr(n,s){if(1&n&&t.Z7z(0,rr,1,1,null,null,t.fX1),2&n){const e=t.XpG(2);t.Dyx(e.activePreset.selectedLocations)}}function pr(n,s){if(1&n&&t.nrm(0,"suivo-avatar",38),2&n){const e=t.XpG().$implicit,i=t.XpG(2);t.Y8G("fileName",i.avatars[e.id].SMALL)("hoverFileName",i.avatars[e.id].LARGE)("hoverFormat",i.AvatarFormat.LARGE)("format",i.AvatarFormat.SMALL)}}function ur(n,s){1&n&&t.nrm(0,"td")}
1function dr(n,s){if(1&n&&(t.j41(0,"div",42),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2).$implicit,i=t.XpG(2).$implicit,o=t.XpG(2);t.R7$(),t.SpI(" ",o.stockInfo.consumablesLocationsCount[i.id][e]," ")}}function _r(n,s){1&n&&(t.j41(0,"div",42),t.EFF(1," 0 "),t.k0s())}function mr(n,s){if(1&n&&(t.j41(0,"td",41),t.nVh(1,dr,2,1,"div",42),t.nVh(2,_r,2,0,"div",42),t.k0s()),2&n){const e=t.XpG().$implicit,i=t.XpG(2).$implicit,o=t.XpG(2);t.AVh("noItems",!o.stockInfo.consumablesLocationsCount[i.id]||!o.stockInfo.consumablesLocationsCount[i.id][e]||o.stockInfo.consumablesLocationsCount[i.id][e]<=0),t.R7$(),t.vxM(o.stockInfo.consumablesLocationsCount[i.id]&&o.stockInfo.consumablesLocationsCount[i.id][e]>0?1:-1),t.R7$(),t.vxM(!o.stockInfo.consumablesLocationsCount[i.id]||!o.stockInfo.consumablesLocationsCount[i.id][e]||o.stockInfo.consumablesLocationsCount[i.id][e]<1?2:-1)}}function hr(n,s){if(1&n&&t.nVh(0,mr,3,4,"td",40),2&n){const e=s.$implicit,i=t.XpG(4);t.vxM(i.locations[e]?0:-1)}}function gr(n,s){if(1&n&&t.Z7z(0,hr,1,1,null,null,t.fX1),2&n){const e=t.XpG(3);t.Dyx(e.activePreset.selectedLocations)}}function Cr(n,s){if(1&n&&(t.j41(0,"tr")(1,"td",37),t.nVh(2,pr,1,4,"suivo-avatar",38),t.k0s(),t.j41(3,"td",28)(4,"div",39),t.EFF(5),t.k0s()(),t.nVh(6,ur,1,0,"td"),t.nVh(7,gr,2,0),t.k0s()),2&n){const e=s.$implicit,i=t.XpG(2);t.R7$(2),t.vxM(i.avatars&&i.avatars[e.id]&&i.avatars[e.id].SMALL?2:-1),t.R7$(2),t.Y8G("title",e.label),t.R7$(),t.JRh(e.label),t.R7$(),t.vxM(i.activePreset&&0!=(null==i.activePreset.selectedLocations?null:i.activePreset.selectedLocations.length)?-1:6),t.R7$(),t.vxM(i.activePreset?7:-1)}}function fr(n,s){if(1&n&&(t.j41(0,"tr")(1,"td",43),t.EFF(2),t.nI1(3,"translate"),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(),t.Y8G("colSpan",e.activePreset?3+e.activePreset.selectedLocations.length:4),t.R7$(),t.SpI(" ",t.bMT(3,2,"allpages.table.noData")," ")}}function vr(n,s){if(1&n){const e=t.RV6();t.j41(0,"table",7)(1,"thead")(2,"tr",23),t.nrm(3,"th",24),t.j41(4,"th",25)(5,"div",26)(6,"search-field",27),t.mxI("ngModelChange",function(o){l.eBV(e);const a=t.XpG();return t.DH7(a.query,o)||(a.query=o),l.Njj(o)}),t.bIt("ngModelChange",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.initVisibleItems())}),t.k0s()()(),t.nVh(7,or,7,8,"th",28),t.nVh(8,cr,2,0),t.k0s()(),t.j41(9,"tbody"),t.Z7z(10,Cr,8,5,"tr",null,t.fX1),t.nVh(12,fr,4,4,"tr"),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(6),t.R50("ngModel",e.query),t.R7$(),t.vxM(e.activePreset&&0!=(null==e.activePreset.selectedLocations?null:e.activePreset.selectedLocations.length)?-1:7),t.R7$(),t.vxM(e.activePreset?8:-1),t.R7$(2),t.Dyx(e.visibleConsumables),t.R7$(2),t.vxM(e.visibleConsumables&&0!=e.visibleConsumables.length?-1:12)}}function br(n,s){if(1&n){const e=t.RV6();t.j41(0,"consumables-location-management",44),t.bIt("closePopup",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.onClosePresetConfig())})("onPresetsSave",function(o){l.eBV(e);const a=t.XpG();return l.Njj(a.onPresetsSaved(o))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("create",e.create)("editGuid",e.editGuid)("presets",e.presets)}}let Tr=(()=>{class n{set filter(e){this._filter=e,this.loadData()}constructor(e,i,o){this.consumableService=e,this.cdRef=i,this.sortService=o,this.visibleConsumables=[],this.objectKeys=Object.keys,this.groupType=_.MH,this.AvatarFormat=L.Z}openPopup(){this.create=!this.presets||0==this.presets.length,this.showPopup=!0}initVisibleItems(){if(this.stockInfo){this.visibleConsumables=[];for(let e in this.stockInfo.consumables)(!this.query||this.query.length<3||this.stockInfo.consumables[e].toLowerCase().includes(this.query.toLowerCase()))&&this.visibleConsumables.push({id:+e,label:this.stockInfo.consumables[e]});this.visibleConsumables=this.sortService.sort(this.visibleConsumables,"label",!1,!0)}this.cdRef.markForCheck()}closePresetsPopup(){this.popupConfig=null,this.cdRef.markForCheck()}onClosePresetConfig(){this.showPopup=!1,this.editGuid=null,this.create=!1}switchPreset(e){this.activePreset.active=!1,e.active=!0,this.activePreset=e,this.loadData()}onEditPreset(e,i){this.editGuid=e,this.showPopup=!0,this.create=i,this.closePresetsPopup()}onPresetsSaved(e){this.presets=e,this.activePreset=this.presets.find(i=>i.active),this.loadData()}onExport(){this.consumableService.exportStock({entityTypes:this.filter,preset:this.activePreset?this.activePreset.guid:null})}loadData(){this.consumableService.getLocationStockOverview({entityTypes:this.filter,preset:this.activePreset?this.activePreset.guid:null}).subscribe(e=>{this.presets=e.presets,this.stockInfo=e.stockInfo,this.locations=e.locations,this.avatars=e.avatars,this.stockInfo&&this.initVisibleItems(),this.presets&&this.presets.length>0&&(this.activePreset=this.presets.find(i=>i.active)),this.determineTableWidth(),this.cdRef.markForCheck()})}determineTableWidth(){let e=document.getElementsByTagName("consumables-location-stock")[0].clientWidth+30;this.scrollableTable=!this.activePreset||!this.activePreset.selectedLocations||0==this.activePreset.selectedLocations.length||e<500+100*Object.keys(this.locations).length}get filter(){return this._filter}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(J),t.rXU(k.gRc),t.rXU(C.a))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["consumables-location-stock"]],inputs:{filter:"filter"},standalone:!1,decls:14,vars:14,consts:[[1,"consumableLocationStockOverview"],[1,"btn","btn-md"],[1,"float-end","presetsContainer"],[1,"btn-group","dropdown","float-end"],["type","button",1,"btn","btn-sm","presetVie
1wBtn",3,"click","title"],[1,"fas","fa-sliders-h"],[1,"stockOverview"],[1,"table"],[3,"create","editGuid","presets"],[1,"btn","btn-md",3,"click"],["type","button","data-bs-toggle","dropdown",1,"btn","btn-md","dropdown-toggle",3,"title"],[1,"presetViewBtnText"],[1,"dropdown-menu"],[1,"dropdown-menu",3,"click"],[1,"optionForm",3,"clickOutside","clickOutsideEnabled","delayClickOutsideInit","exclude"],[1,"popupActions",3,"click"],[1,"fas","fa-plus"],[1,"radio-title",3,"click"],[1,"attention","fas","fa-check-circle"],[1,"radio-unchecked"],[1,"presetTitle",3,"ngClass"],[1,"actions"],[1,"fas","fa-pen","fa-pull-right","action","actionIcon",3,"click","title"],[1,"fixedHeader"],[1,"avatarHeader"],[1,"searchField"],[1,"searchContainer"],[3,"ngModelChange","ngModel"],[1,"labelCell"],[1,"locationPlaceholder"],["tooltip","",3,"tooltipContent","tooltipPosition","tooltipSize"],[1,"fas","fa-info-circle"],[1,"labelCell","locationLabelCell",3,"title"],[1,"locationLabel"],[1,"fas","fa-warehouse"],[3,"icon","size"],[1,"location",3,"title"],[1,"consumableIcon"],[3,"fileName","hoverFileName","hoverFormat","format"],[1,"consumable",3,"title"],[1,"locationCount",3,"noItems"],[1,"locationCount"],[1,"count"],[1,"emptystate",3,"colSpan"],[3,"closePopup","onPresetsSave","create","editGuid","presets"]],template:function(i,o){1&i&&(t.j41(0,"div",0),t.nVh(1,ql,3,3,"button",1),t.j41(2,"div",2)(3,"span"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"div",3)(7,"button",4),t.nI1(8,"translate"),t.bIt("click",function(){return o.openPopup()}),t.nrm(9,"i",5),t.k0s(),t.nVh(10,ir,4,3),t.k0s()(),t.j41(11,"div",6),t.nVh(12,vr,13,4,"table",7),t.k0s()(),t.nVh(13,br,1,3,"consumables-location-management",8)),2&i&&(t.AVh("noLocations",!o.activePreset||!o.activePreset.selectedLocations||0==o.activePreset.selectedLocations.length)("tableFullWidth",o.scrollableTable),t.R7$(),t.vxM((null==o.presets?null:o.presets.length)>0&&o.activePreset&&(null==o.activePreset.selectedLocations?null:o.activePreset.selectedLocations.length)>0?1:-1),t.R7$(3),t.SpI("",t.bMT(5,10,"assets.overview.consumables.manageLocations"),":"),t.R7$(3),t.Y8G("title",t.bMT(8,12,"allpages.list.view.options")),t.R7$(3),t.vxM((null==o.presets?null:o.presets.length)>0?10:-1),t.R7$(2),t.vxM(o.stockInfo?12:-1),t.R7$(),t.vxM(o.showPopup?13:-1))},dependencies:[p.YU,$.F,lt.T,gt.z,Gl.d,Y.q,c.BC,c.vS,Zl,b.D],styles:['[_nghost-%COMP%]{display:block;width:100%;height:100%}.consumableLocationStockOverview[_ngcontent-%COMP%]{width:fit-content;height:100%}.consumableLocationStockOverview.tableFullWidth[_ngcontent-%COMP%]{width:100%}.consumableLocationStockOverview.tableFullWidth[_ngcontent-%COMP%] .stockOverview[_ngcontent-%COMP%]{width:100%;overflow-x:auto}.consumableLocationStockOverview.tableFullWidth[_ngcontent-%COMP%] .stockOverview[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%}.consumableLocationStockOverview.noLocations[_ngcontent-%COMP%]{max-width:1000px}.stockOverview[_ngcontent-%COMP%]{height:calc(100% - 85px);overflow-y:auto;width:fit-content;overflow-x:hidden}td.labelCell[_ngcontent-%COMP%]{border-right:solid 2px var(--colors-general-soft-grey)}td.labelCell[_ngcontent-%COMP%] .consumable[_ngcontent-%COMP%]{width:20vw}.labelCell[_ngcontent-%COMP%]{background-color:var(--colors-general-background-grey)!important}.labelCell[_ngcontent-%COMP%] .locationPlaceholder[_ngcontent-%COMP%]{color:var(--colors-general-medium-grey)}.labelCell[_ngcontent-%COMP%] .locationLabel[_ngcontent-%COMP%]{border-left:1px solid var(--colors-general-soft-grey);width:100%}.labelCell[_ngcontent-%COMP%] .locationLabel[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%], .labelCell[_ngcontent-%COMP%] .locationLabel[_ngcontent-%COMP%] suivo-icon[_ngcontent-%COMP%]{margin-right:5px}.labelCell[_ngcontent-%COMP%] .locationLabel[_ngcontent-%COMP%], .labelCell[_ngcontent-%COMP%] .locationPlaceholder[_ngcontent-%COMP%]{display:flex;position:absolute;height:100%;top:0;align-items:center;left:-1px;padding-left:8px}.labelCell[_ngcontent-%COMP%] .locationLabel[_ngcontent-%COMP%] .location[_ngcontent-%COMP%], .labelCell[_ngcontent-%COMP%] .locationPlaceholder[_ngcontent-%COMP%] .location[_ngcontent-%COMP%]{max-width:calc(100% - 45px)}.location[_ngcontent-%COMP%], .consumable[_ngcontent-%COMP%]{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}td[_ngcontent-%COMP%]{padding-top:10px;padding-bottom:10px}td.locationCount[_ngcontent-%COMP%]{padding:0}td.locationCount[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{text-align:end;border-right:1px solid var(--colors-general-soft-grey);padding:8px}td.noItems[_ngcontent-%COMP%]{background-color:var(--colors-error-background)}th.searchField[_ngcontent-%COMP%], th.avatarHeader[_ngcontent-%COMP%]{padding-left:0;border-top:none!important;z-index:3!important}th.searchField[_ngcontent-%COMP%]:before, th.avatarHeader[_ngcontent-%COMP%]:before{background-color:var(--colors-general-white)!important}th.labelCell[_ngcontent-%COMP%]{z-index:2}table[_ngcontent-%COMP%]{table-layout:fixed;width:auto}table[_ngcontent-%COMP%] th.searchField[_ngcontent-%COMP%]{width:20vw}table[_ngcontent-%COMP%] th.locationLabelCell[_ngcontent-%COMP%]{width:150px}.presetsContainer[_ngcontent-%COMP%]{margin-left:20px;margin-bottom:8px;display:flex;align-items:center}.presetsContainer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], .presetsContainer[_ngcontent-%COMP%] .btn-group[_ngcontent-%COMP%]{margin:0}.presetsContainer[_ngcontent-%COMP%] .btn.float-end[_ngcontent-%COMP%], .presetsContainer[_ngcontent-%COMP%] .btn-group.float-end[_ngcontent-%COMP%]{margin-left:10px}.presetsContainer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding-left:8px;padding-right:8px}.presetsContainer[_ngcontent-%COMP%] .btn.dropdown-toggle[_ngcontent-%COMP%]{display:flex;align-items:center}
1.presetsContainer[_ngcontent-%COMP%] .presetViewBtnText[_ngcontent-%COMP%]{max-width:10vw;overflow:hidden;text-overflow:ellipsis}@media screen and (min-width: 2000px){.presetsContainer[_ngcontent-%COMP%] .presetViewBtnText[_ngcontent-%COMP%]{max-width:250px}}.presetsContainer[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{transform:translateY(32.5px)!important;min-width:200px;padding-bottom:0}ul[_ngcontent-%COMP%]{max-height:calc(100vh - var(--navigation-header-height) - 250px);overflow-y:auto;position:relative;margin-bottom:0;font-size:12px}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;align-items:center}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .radio-unchecked[_ngcontent-%COMP%]{border-radius:15px;height:15px;width:15px;margin-bottom:1px;border:1px solid var(--colors-general-medium-grey);opacity:.7;position:absolute}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .fa-check-circle[_ngcontent-%COMP%]{font-size:15px}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .presetTitle[_ngcontent-%COMP%]{color:var(--colors-general-soft-black);margin-left:25px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:225px;flex:1}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .presetTitle.active[_ngcontent-%COMP%]{color:var(--colors-general-black);font-weight:700;margin-left:10px}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .actionIcon[_ngcontent-%COMP%]{margin-left:5px;cursor:pointer;width:32px;height:32px;font-size:13px;border-radius:var(--button-border-radius);display:flex;align-items:center;justify-content:center;border:1px solid transparent}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .actionIcon[_ngcontent-%COMP%]:hover{background:var(--colors-general-white)!important;border:1px solid var(--colors-general-soft-grey)}@media (hover: none){ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .actions.actions[_ngcontent-%COMP%]{display:block}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .radio-title[_ngcontent-%COMP%]{max-width:85%}}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover{background:var(--colors-general-background-grey);cursor:pointer}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover .actions[_ngcontent-%COMP%]{display:block}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:hover .viewTitle[_ngcontent-%COMP%]{color:var(--colors-general-black)}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .radio-title[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1;padding:8px 10px}ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{position:absolute;display:none;right:0;background-color:inherit;border:none!important;margin:0!important;padding-right:5px}[tooltip][_ngcontent-%COMP%]:after{width:250px;text-align:justify;white-space:normal;padding:10px;z-index:10}td.labelCell[_ngcontent-%COMP%]:before, .searchField[_ngcontent-%COMP%]:before{content:"";width:100%;position:absolute;background-color:var(--colors-general-soft-grey)}.consumableIcon[_ngcontent-%COMP%]{background-color:var(--colors-general-background-grey)!important;padding-top:7px!important;padding-bottom:7px!important}td.labelCell[_ngcontent-%COMP%], .searchField[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff;z-index:1;padding:0;border-right:none}td.labelCell[_ngcontent-%COMP%] .searchContainer[_ngcontent-%COMP%], td.labelCell[_ngcontent-%COMP%] .consumable[_ngcontent-%COMP%], .searchField[_ngcontent-%COMP%] .searchContainer[_ngcontent-%COMP%], .searchField[_ngcontent-%COMP%] .consumable[_ngcontent-%COMP%]{padding:8px;border-right:2px solid var(--colors-general-soft-grey)}.popupActions[_ngcontent-%COMP%]{display:block;border-top:1px solid var(--colors-general-soft-grey);padding:12px;font-size:12px;margin-top:5px;color:var(--colors-general-soft-black);cursor:pointer}.popupActions[_ngcontent-%COMP%]:hover{color:var(--colors-general-black);background:var(--colors-general-background-grey)}'],changeDetection:0})}}return n})();const Ht=n=>({active:n});function Or(n,s){if(1&n&&t.nrm(0,"consumables-stock-overview",6),2&n){const e=t.XpG();t.Y8G("typesFilter",e.selectedTypes)}}
1function Mr(n,s){if(1&n&&t.nrm(0,"consumables-location-stock",7),2&n){const e=t.XpG();t.Y8G("filter",e.selectedTypes)}}let xr=(()=>{class n{constructor(){this.activeTab="totalStock"}onTypeFilter(e){this.selectedTypes=JSON.parse(JSON.stringify(e))}toggleActiveTab(e){this.activeTab=e}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["consumables-overview"]],standalone:!1,decls:14,vars:14,consts:[[1,"consumablesFilter","overviewComponent"],[3,"onSelectionChange"],[1,"consumablesOverview","overviewComponent"],[1,"nav","nav-tabs"],[1,"nav-item",3,"ngClass"],[1,"nav-link",3,"click"],[3,"typesFilter"],[3,"filter"]],template:function(i,o){1&i&&(t.j41(0,"div",0)(1,"consumables-filter",1),t.bIt("onSelectionChange",function(r){return o.onTypeFilter(r)}),t.k0s()(),t.j41(2,"div",2)(3,"ul",3)(4,"li",4)(5,"a",5),t.bIt("click",function(){return o.toggleActiveTab("totalStock")}),t.EFF(6),t.nI1(7,"translate"),t.k0s()(),t.j41(8,"li",4)(9,"a",5),t.bIt("click",function(){return o.toggleActiveTab("locationStock")}),t.EFF(10),t.nI1(11,"translate"),t.k0s()()(),t.nVh(12,Or,1,1,"consumables-stock-overview",6),t.nVh(13,Mr,1,1,"consumables-location-stock",7),t.k0s()),2&i&&(t.R7$(4),t.Y8G("ngClass",t.eq3(10,Ht,"totalStock"===o.activeTab)),t.R7$(2),t.SpI("",t.bMT(7,6,"assets.overview.consumables.totalStock")," "),t.R7$(2),t.Y8G("ngClass",t.eq3(12,Ht,"locationStock"===o.activeTab)),t.R7$(2),t.SpI("",t.bMT(11,8,"assets.overview.consumables.locationStock")," "),t.R7$(2),t.vxM("totalStock"===o.activeTab?12:-1),t.R7$(),t.vxM("locationStock"===o.activeTab?13:-1))},dependencies:[p.YU,fl,wl,Tr,b.D],styles:["[_nghost-%COMP%]{display:flex;height:100%}.overviewComponent[_ngcontent-%COMP%]{background-color:var(--colors-general-white);height:100%;border:1px solid var(--colors-general-soft-grey)}.consumablesFilter[_ngcontent-%COMP%]{display:flex;width:20%;overflow-y:auto;border-right:none}.consumablesOverview[_ngcontent-%COMP%]{width:80%;overflow-y:hidden;padding:15px 30px}.nav-tabs[_ngcontent-%COMP%]{margin-bottom:16px!important}"],changeDetection:0})}}return n})(),zt=(()=>{class n{constructor(e,i){this.router=e,this.permissions=i}canActivate(e,i){if(this.permissions&&this.permissions.hasPermissions())return this.checkAccess();this.interval=setInterval(()=>{clearInterval(this.interval),this.canActivate(e,i)},500)}checkAccess(){return!(!this.permissions.get("LOCATION_INFO_VIEW")||!this.permissions.get("COST_STOCK_LOCATION_VIEW"))||(this.permissions.get("CONSUMABLE_VIEW")&&this.router.navigate(["assets","consumables"]),!1)}static{this.\u0275fac=function(i){return new(i||n)(l.KVO(pt.Ix),l.KVO(q.n))}}static{this.\u0275prov=l.jDH({token:n,factory:n.\u0275fac})}}return n})();const Pr=["consumablesPopupContext"],yr=(n,s)=>s.consumable;function kr(n,s){if(1&n){const e=t.RV6();t.j41(0,"divided-list",10),t.bIt("externalAction",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.togglePopup(!0))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("externalFilter",e.listFilter)("listKey",e.listKey)}}function Fr(n,s){if(1&n){const e=t.RV6();t.j41(0,"transfer-popup",11),t.bIt("onClosePopup",function(){l.eBV(e);const o=t.XpG();return l.Njj(o.togglePopup(!1))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("transferId",e.transferPopup.id)}}function Sr(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=s.$implicit;t.R7$(),t.JRh(e)}}function Ir(n,s){if(1&n&&(t.j41(0,"div",15),t.EFF(1),t.k0s(),t.j41(2,"div",16),t.Z7z(3,Sr,2,1,"span",null,t.Vm6),t.k0s()),2&n){const e=s.$implicit;t.R7$(),t.JRh(e.name),t.R7$(2),t.Dyx(e.amounts)}}
1function Rr(n,s){if(1&n&&(t.j41(0,"div",12)(1,"div",13)(2,"div",14),t.Z7z(3,Ir,5,1,null,null,yr),t.k0s()()()),2&n){const e=t.XpG();t.Aen(e.consumablesPopup.position),t.R7$(),t.AVh("left",!e.consumablesPopup.rightAligned)("bottom",e.consumablesPopup.bottom),t.R7$(2),t.Dyx(e.consumablesPopup.consumables)}}function Lr(n,s){if(1&n){const e=t.RV6();t.j41(0,"span",18),t.bIt("mouseenter",function(o){l.eBV(e);const a=t.XpG().data,r=t.XpG();return l.Njj(r.toggleConsumablesPopup(o,a.consumableLines))})("mouseleave",function(){l.eBV(e);const o=t.XpG(2);return l.Njj(o.toggleConsumablesPopup())}),t.EFF(1),t.k0s()}if(2&n){const e=t.XpG().data;t.R7$(),t.SpI(" ",e.consumablesLabel," ")}}function Ar(n,s){if(1&n&&t.nVh(0,Lr,2,1,"span",17),2&n){const e=s.data;t.vxM(null!=e.consumableLines&&e.consumableLines.length?0:-1)}}function Er(n,s){if(1&n){const e=t.RV6();t.j41(0,"a",20),t.nI1(1,"translate"),t.bIt("click",function(){l.eBV(e);const o=t.XpG().data,a=t.XpG();return l.Njj(a.togglePopup(!0,o.id))}),t.nrm(2,"i",21),t.k0s()}2&n&&t.Y8G("title",t.bMT(1,1,"alerts.form.country.viewDetail"))}function jr(n,s){1&n&&t.nVh(0,Er,3,3,"a",19),2&n&&t.vxM(s.highlighted?0:-1)}const $r=[{path:"",component:rl,children:[{path:"",pathMatch:"full",redirectTo:"overview"},{path:"overview",component:Ga,canActivate:[zt]},{path:"consumables",component:xr},{path:"transfers",component:(()=>{class n{constructor(e,i,o){this.fb=e,this.globalHelper=i,this.changeDetector=o,this.listKey=H.y4.TRANSFERS,this.transferPopup={show:!1},this.consumablesPopup={visible:!1},this.periodFilterPresets=[1,7,30,60,90]}ngOnInit(){this.initialPeriod={beginDate:new Date(new Date((new Date).setDate((new Date).getDate()-89)).setHours(0,0,0,0)),endDate:new Date((new Date).setHours(23,59,59,59))},this.transfersFilterForm=this.fb.group({period:new c.MJ(this.initialPeriod)}),this.setListFilter(this.initialPeriod),this.periodSubscription=this.period.valueChanges.subscribe(e=>{this.setListFilter(e)})}ngOnDestroy(){this.periodSubscription.unsubscribe()}togglePopup(e,i){this.transferPopup={show:e,id:i}}toggleConsumablesPopup(e,i){if(!this.consumablesPopup.visible&&e){this.consumablesPopup={visible:!1,consumables:i};const o=e.target.getBoundingClientRect(),a=this.popupContextRect(),d=document.documentElement.clientWidth,h=document.documentElement.clientHeight,g=o.bottom+(2*i.length*20+20)+10>h,P=d-o.left,N=o.right,F=N>P;this.consumablesPopup.bottom=g,this.consumablesPopup.rightAligned=F,this.consumablesPopup.position={top:g?"auto":o.bottom-a.top+4+"px",bottom:g?a.bottom-o.top+4+"px":"auto",left:F?"auto":o.left-a.left+"px",right:F?a.right-o.right+"px":"auto",maxWidth:Math.max(N,P)-10+"px"}}this.consumablesPopup.visible=!this.consumablesPopup.visible,this.changeDetector.markForCheck()}popupContextRect(){const e=this.consumablesPopupContext?.nativeElement?.offsetParent;return e?e.getBoundingClientRect():new DOMRect(0,0,document.documentElement.clientWidth,document.documentElement.clientHeight)}setListFilter(e){this.listFilter={periodFilter:this.globalHelper.formatDate(e.beginDate,!1)+"|"+this.globalHelper.formatDate(e.endDate,!1)},this.changeDetector.markForCheck()}get period(){return this.transfersFilterForm.get("period")}static{this.\u0275fac=function(i){return new(i||n)(t.rXU(c.ok),t.rXU(K.$),t.rXU(k.gRc))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["transfer-overview"]],viewQuery:function(i,o){if(1&i&&t.GBs(Pr,5),2&i){let a;t.mGM(a=t.lsd())&&(o.consumablesPopupContext=a.first)}},standalone:!1,decls:12,vars:9,consts:[["consumablesPopupContext",""],[1,"main-height","d-flex","flex-column"],[1,"filterContainer",3,"formGroup"],["formControlName","period",3,"label","maxDays","presets"],[1,"container-fluid","generalContent","listContainer"],[3,"externalFilter","listKey"],[3,"transferId"],[1,"optionsPopup",3,"style"],["cellTemplate","NUMBER_OF_CONSUMABLES"],["cellTemplate","TRANSFER_ACTIONS"],[3,"externalAction","externalFilter","listKey"],[3,"onClosePopup","transferId"],[1,"optionsPopup"],[1,"popupContent"],[1,"optionForm","consumablesPopup"],[1,"consumableName"],[1,"consumableAmou
1nts"],[1,"entityLink"],[1,"entityLink",3,"mouseenter","mouseleave"],[1,"listAction",3,"title"],[1,"listAction",3,"click","title"],[1,"fa-solid","fa-magnifying-glass","action","fa-lg"]],template:function(i,o){1&i&&(t.j41(0,"div",1)(1,"form",2),t.nrm(2,"period-filter",3),t.nI1(3,"translate"),t.k0s(),t.j41(4,"div",4),t.nVh(5,kr,1,2,"divided-list",5),t.k0s()(),t.nVh(6,Fr,1,1,"transfer-popup",6),t.j41(7,"div",null,0),t.nVh(9,Rr,5,6,"div",7),t.k0s(),t.DNE(10,Ar,1,1,"ng-template",8)(11,jr,1,1,"ng-template",9)),2&i&&(t.R7$(),t.Y8G("formGroup",o.transfersFilterForm),t.R7$(),t.Y8G("label",t.bMT(3,7,"allpages.period"))("maxDays",90)("presets",o.periodFilterPresets),t.R7$(3),t.vxM(o.listFilter?5:-1),t.R7$(),t.vxM(o.transferPopup.show?6:-1),t.R7$(3),t.vxM(o.consumablesPopup.visible?9:-1))},dependencies:[ft.p,tt.i,c.qT,c.BC,c.cb,c.j4,c.JD,et.v,Mt,b.D],styles:[".listContainer[_ngcontent-%COMP%]{flex-grow:1;padding-top:12px;padding-bottom:12px;overflow:auto}.filterContainer[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:15px}.consumablesPopup[_ngcontent-%COMP%] .consumableName[_ngcontent-%COMP%]{font-weight:700;overflow-wrap:anywhere}
1.consumablesPopup[_ngcontent-%COMP%] .consumableAmounts[_ngcontent-%COMP%]{padding-left:10px;padding-bottom:4px}.consumablesPopup[_ngcontent-%COMP%] .consumableAmounts[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-block;overflow-wrap:anywhere}.consumablesPopup[_ngcontent-%COMP%] .consumableAmounts[_ngcontent-%COMP%]:last-child{padding-bottom:0}"],changeDetection:0})}}return n})()}]}];var Vr=u(49205),Nr=u(44825),Xr=u(39801);let Br=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=t.$C({type:n})}static{this.\u0275inj=l.G2t({providers:[zt],imports:[p.MD,y.K,U.u,Vr.x,c.YN,c.X1,Nr.q,mt._,Q.e,A.iI.forChild($r),D.ad,Xr.b]})}}return n})()},40028:(dt,X,u)=>{u.d(X,{q:()=>R});var p=u(19125),y=u(80154),U=u(13693),A=u(2615),w=u(87531);let R=(()=>{class _ extends U.S{constructor(v){super(_),this.translation=v}getConditions(v){let m=[];switch(v){case y.Zj.BOOLEAN:case y.Zj.PERSON:case y.Zj.UNIT:case y.Zj.LOCATION:m.push(this.getCondition(p.K.EQUALS)),m.push(this.getCondition(p.K.NOT_EQUALS));break;case y.Zj.NUMERIC:m.push(this.getCondition(p.K.GREATER_THAN)),m.push(this.getCondition(p.K.LESS_THAN)),m.push(this.getCondition(p.K.EQUALS)),m.push(this.getCondition(p.K.NOT_EQUALS));break;case y.Zj.TEXT:case y.Zj.RICH_TEXT:m.push(this.getCondition(p.K.EQUALS)),m.push(this.getCondition(p.K.NOT_EQUALS)),m.push(this.getCondition(p.K.CONTAINS));break;case y.Zj.SELECT:case y.Zj.MULTI_SELECT:m.push(this.getCondition(p.K.IS_ONE_OF)),m.push(this.getCondition(p.K.IS_NOT_ONE_OF)),m.push(this.getCondition(p.K.ALL_MATCH)),m.push(this.getCondition(p.K.NONE_MATCH))}return m}getCondition(v){switch(v){case p.K.EQUALS:return{type:v,label:this.translation.get("allpages.filter.criteria.EQUALS")};case p.K.NOT_EQUALS:return{type:v,label:this.translation.get("allpages.filter.criteria.NOT_EQUALS")};case p.K.CONTAINS:return{type:v,label:this.translation.get("allpages.filter.criteria.CONTAINS")};case p.K.GREATER_THAN:return{type:v,label:this.translation.get("allpages.filter.criteria.ABOVE")};case p.K.LESS_THAN:return{type:v,label:this.translation.get("allpages.filter.criteria.BELOW")};case p.K.IS_ONE_OF:return{type:v,label:this.translation.get("allpages.filter.criteria.IS_ONE_OF")};case p.K.IS_NOT_ONE_OF:return{type:v,label:this.translation.get("allpages.filter.criteria.IS_NOT_ONE_OF")};case p.K.ALL_MATCH:return{type:v,label:this.translation.get("allpages.filter.criteria.ALL_MATCH")};case p.K.NONE_MATCH:return{type:v,label:this.translation.get("allpages.filter.criteria.NONE_MATCH")};case p.K.BEFORE:return{type:v,label:this.translation.get("allpages.filter.criteria.BEFORE")};case p.K.AFTER:return{type:v,label:this.translation.get("allpages.filter.criteria.AFTER")};case p.K.IN_MORE_THAN_X_DAYS:return{type:v,label:this.translation.get("allpages.filter.criteria.IN_MORE_THAN_X_DAYS")};case p.K.IN_LESS_THAN_X_DAYS:return{type:v,label:this.translation.get("allpages.filter.criteria.IN_LESS_THAN_X_DAYS")};case p.K.MORE_THAN_X_DAYS_AGO:return{type:v,label:this.translation.get("allpages.filter.criteria.MORE_THAN_X_DAYS_AGO")};case p.K.LESS_THAN_X_DAYS_AGO:return{type:v,label:this.translation.get("allpages.filter.criteria.LESS_THAN_X_DAYS_AGO")}}}static{this.\u0275fac=function(m){return new(m||_)(A.KVO(w.L))}}static{this.\u0275prov=A.jDH({token:_,factory:_.\u0275fac,providedIn:"root"})}}return _})()},51696:(dt,X,u)=>{u.d(X,{f:()=>k});var p=u(73664),y=u(2615),U=u(17705),A=u(87531),w=u(72200),R=u(77120);const _=["wizardFlowItemsContainer"],M=["flowContainer"],v=(x,I,O)=>({left:x,width:I,display:O}),m=x=>({active:x});function E(x,I){if(1&x){const O=p.RV6();p.j41(0,"div",8),p.bIt("click",function(){y.eBV(O);const C=p.XpG();return y.Njj(C.scrollFlow(!0))}),p.nrm(1,"i",9),p.k0s()}}function t(x,I){if(1&x){const O=p.RV6();p.j41(0,"div",5)(1,"div",10),p.bIt("click",function(){const C=y.eBV(O).$implicit,j=p.XpG();return y.Njj(j.setFlow(C))}),p.j41(2,"span",11),p.nI1(3,"translate"),p.EFF(4),p.nI1(5,"translate"),p.k0s()()()}if(2&x){const O=I.$implicit,f=p.XpG();p.Y8G("ngClass",p.eq3(7,m,f.currentFlow.index==O.index)),p.R7$(2),p.Y8G("title",null!=O.customTitle?O.customTitle:p.bMT(3,3,O.title)),p.R7$(2),p.SpI(" ",null!=O.customTitle?O.customTitle:p.bMT(5,5,O.title)," ")}}function l(x,I){if(1&x){const O=p.RV6();p.j41(0,"div",12),p.bIt("click",function(){y.eBV(O);const C=p.XpG();return y.Njj(C.scrollFlow(!1))}),p.nrm(1,"i",13),p.k0s()}}let k=(()=>{class x{onResize(){this.checkOverflowing()}set currentFlow(O){this._currentFlow=O,this.changeDetector.markForCheck()}constructor(O,f){this.translationService=O,this.changeDetector=f,this.onFlowChanged=new p.bkB,this.onCancel=ne
1w p.bkB,this.onSubmit=new p.bkB}ngAfterContentInit(){this.slideToActiveStep(),this.checkOverflowing()}checkOverflowing(){this.isOverflowing=this.itemsContainer?.nativeElement.scrollWidth>this.flowContainer?.nativeElement.clientWidth,this.checkPosition()}checkPosition(){this.showRightArrow=!0,this.showLeftArrow=!0,0===this.flowContainer?.nativeElement.scrollLeft?this.showLeftArrow=!1:this.flowContainer?.nativeElement.scrollWidth-this.flowContainer?.nativeElement.scrollLeft-this.flowContainer?.nativeElement.clientWidth<35&&(this.showRightArrow=!1)}scrollFlow(O){this.flowContainer.nativeElement.scrollLeft+=(this.itemsContainer?.nativeElement.clientWidth-35)*(O?-1:1)}slideToActiveStep(){setTimeout(()=>{const f=Array.from(document.getElementsByClassName("wizardFlowItem")).find(C=>C.classList.contains("active"));typeof f<"u"&&f&&(this.sliderLeft=f.offsetLeft+"px",this.sliderWidth=f.clientWidth+"px",this.sliderDisplay="block"),this.flowContainer.nativeElement.scrollTo({left:f.offsetLeft,behaviour:"smooth"}),this.changeDetector.markForCheck()},0)}setFlow(O){O.index!=this.currentFlow.index&&this.onFlowChanged.emit(O)}closeFlow(){confirm(this.translationService.get("myLocations.cancel.confirm"))&&(this.currentFlow=this.tabs[0],this.onCancel.emit(!0),this.onFlowChanged.emit(this.currentFlow))}get currentFlow(){return this._currentFlow}static{this.\u0275fac=function(f){return new(f||x)(p.rXU(A.L),p.rXU(U.gRc))}}static{this.\u0275cmp=p.VBU({type:x,selectors:[["wizard-tabs"]],viewQuery:function(f,C){if(1&f&&(p.GBs(_,5),p.GBs(M,5)),2&f){let j;p.mGM(j=p.lsd())&&(C.itemsContainer=j.first),p.mGM(j=p.lsd())&&(C.flowContainer=j.first)}},hostBindings:function(f,C){1&f&&p.bIt("resize",function(){return C.onResize()},p.tSv)},inputs:{tabs:"tabs",currentFlow:"currentFlow"},outputs:{onFlowChanged:"onFlowChanged",onCancel:"onCancel",onSubmit:"onSubmit"},standalone:!1,decls:9,vars:7,consts:[["flowContainer",""],["wizardFlowItemsContainer",""],[1,"scrollButton"],[1,"flowContainer","wizardFlowContainer",3,"scroll"],[1,"wizardFlowItemsContainer"],[1,"float-start","wizardFlowItem",3,"ngClass"],[1,"slider",3,"ngStyle"],[1,"scrollButton","end-0"],[1,"scrollButton",3,"click"],[1,"fas","fa-xl","fa-chevron-left","action"],[1,"flowItemContent",3,"click"],[1,"flowTitle","float-start",3,"title"],[1,"scrollButton","end-0",3,"click"],[1,"fas","fa-xl","fa-chevron-right","action"]],template:function(f,C){if(1&f){const j=p.RV6();p.nVh(0,E,2,0,"div",2),p.j41(1,"div",3,0),p.bIt("scroll",function(){return y.eBV(j),y.Njj(C.isOverflowing&&C.checkPosition())}),p.j41(3,"div",4,1),p.Z7z(5,t,6,9,"div",5,p.fX1),p.k0s(),p.nrm(7,"div",6),p.k0s(),p.nVh(8,l,2,0,"div",7)}2&f&&(p.vxM(C.isOverflowing&&C.showLeftArrow?0:-1),p.R7$(5),p.Dyx(C.tabs),p.R7$(2),p.Y8G("ngStyle",p.sMw(3,v,C.sliderLeft,C.sliderWidth,C.sliderDisplay)),p.R7$(),p.vxM(C.isOverflowing&&C.showRightArrow?8:-1))},dependencies:[w.YU,w.B3,R.D],styles:['[_ngcontent-%COMP%]:root{--font-family: Arial, "MS Trebuchet", sans-serif;--colors-general-black: #042231;--colors-general-medium-black: #2C404C;--colors-general-soft-black: #364C59;--colors-general-hard-grey: #4C6472;--colors-general-medium-grey: #748B99;--colors-general-soft-grey: #D8E0E5;--colors-general-background-grey: #F8F9FA;--colors-general-white: #ffffff;--colors-attention-active: #0039AB;--colors-attention-hover: #296CDB;--colors-attention-primary: #4285F4;--colors-attention-soft: #EBF3FE;--colors-attention-light: #F5F9FF;--colors-navigation-highlight: #EC192E;--colors-error-text: #BA000C;--colors-error-general: #DA1E27;--colors-error-background: #FEF3F4;--colors-success-text: #005702;--colors-success-general: #24A047;--colors-success-background: #F3FAF5;--colors-warning-text: #7A4D05;--colors-warning-general: #FDD03A;--colors-warning-background: #FeF9E7;--colors-eco-green: #24A047;--colors-eco-yellow: #FDD03A;--colors-eco-orange: #F59803;--colors-eco-red: #DA1E27;--colors-eco-dark-red: #ba1f1f;--colors-moment-drive: #4285F4;--colors-moment-stop: #748b99;--colors-moment-idle: #FDD03A;--colors-moment-privacy: #D8E0E5;--navigation-sub-highlight-color: #EC192E;--colors-interpreted-work: #49B048;--colors-interpreted-rest: #748B9A;--colors-interpreted-mobility: #FD9B3B;--colors-password-strong: #24A047;--colors-password-good: #FDD03A;--colors-password-moderate: #F59803;--colors-password-poor: #DA1E27;--colors-partially-validated-background: #fff9bc;
1--colors-validated-background: #ccf9dc;--colors-timesheet-selected: #d5e5fd;--colors-ciao-in: #296cdb;--colors-ciao-out: #c6d9f7;--colors-anomaly-blocking: #910008;--colors-timesheet-surcharge: #b98804;--colors-anomaly-moderate-text: #ee7b11;--button-border-radius: 4px;--navigation-header-height: 54px;--navigation-tabs-height: 42px;--list-row-odd-background-color: #f7f7f7;--list-row-even-background-color: #ffffff;--form-control-border-radius: 4px;--form-control-border-width: 1px;--navigation-background-color: #ffffff;--navigation-width: 66px;--navigation-text-color: #ffffff;--headings-line-height: 1.1}[_nghost-%COMP%]{position:relative;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--colors-general-soft-grey)}.scrollButton[_ngcontent-%COMP%]{margin:5px 5px 8px;padding:5px}.flowContainer[_ngcontent-%COMP%]{margin-bottom:10px;padding-left:calc(20px + .5%);position:relative}.flowContainer.wizardFlowContainer[_ngcontent-%COMP%]{flex:1;padding-left:0;margin:0 5px;overflow:auto;-ms-overflow-style:none;scrollbar-width:none;scroll-behavior:smooth}.flowContainer.wizardFlowContainer[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.flowContainer[_ngcontent-%COMP%] .flowItemsContainer[_ngcontent-%COMP%]{height:25px}.flowContainer[_ngcontent-%COMP%] .flowItem[_ngcontent-%COMP%]{height:25px;border:1px solid var(--colors-general-soft-grey);background:var(--colors-general-background-grey);margin-right:.5%;position:relative}.flowContainer[_ngcontent-%COMP%] .flowItem[_ngcontent-%COMP%] .flowTitle[_ngcontent-%COMP%]{height:23px}.flowContainer[_ngcontent-%COMP%] .flowItem[_ngcontent-%COMP%] .flowItemContent[_ngcontent-%COMP%]{position:absolute;inset:0;overflow:hidden}.flowContainer[_ngcontent-%COMP%] .flowItem[_ngcontent-%COMP%] .flowTitle[_ngcontent-%COMP%]{line-height:24px;position:absolute;white-space:nowrap;left:20px;right:0;overflow:hidden;-ms-text-overflow:ellipsis;text-overflow:ellipsis}.flowContainer[_ngcontent-%COMP%] .flowItem[_ngcontent-%COMP%] .fas[_ngcontent-%COMP%]{color:var(--colors-general-white);font-size:14px}.flowContainer[_ngcontent-%COMP%] .flowItem.cancel[_ngcontent-%COMP%]{position:absolute;left:0;top:0;text-align:center;line-height:27px;margin-left:0;cursor:pointer}.flowContainer[_ngcontent-%COMP%] .flowItem.active[_ngcontent-%COMP%]{background-image:linear-gradient(to bottom,#3373a7,#16427d);color:var(--colors-general-white);font-weight:700;cursor:default}.flowContainer[_ngcontent-%COMP%] .flowItem.active[_ngcontent-%COMP%] .flowItemContent[_ngcontent-%COMP%]{right:25px}.flowContainer[_ngcontent-%COMP%] .flowItem.cancel[_ngcontent-%COMP%]{border-top-left-radius:3px;border-bottom-left-radius:3px;background-image:linear-gradient(to bottom,#e8adad,#c11f1f);border:1px solid #1c4076;width:20px}.wizardFlowContainer[_ngcontent-%COMP%]{position:relative;display:flex;justify-content:space-between;align-items:center}.wizardFlowContainer[_ngcontent-%COMP%] .flowItemsContainer[_ngcontent-%COMP%]{justify-content:space-between;max-width:90%}.wizardFlowContainer[_ngcontent-%COMP%] .flowItemsContainer[_ngcontent-%COMP%], .wizardFlowContainer[_ngcontent-%COMP%] .wizardFlowItemsContainer[_ngcontent-%COMP%]{display:flex;width:100%}.wizardFlowContainer[_ngcontent-%COMP%] .cancel[_ngcontent-%COMP%]{margin:0 10px 5px 0}.wizardFlowItem[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-right:1.6%;border-bottom:3px solid transparent;position:relative}.wizardFlowItem[_ngcontent-%COMP%]:first-child{padding-left:5px;margin-left:0}.wizardFlowItem.active[_ngcontent-%COMP%]{font-weight:700}.wizardFlowItem[_ngcontent-%COMP%]:not(.active){color:var(--colors-general-medium-grey)}.wizardFlowItem[_ngcontent-%COMP%]:hover{cursor:pointer}.wizardFlowItem[_ngcontent-%COMP%] .flowItemContent[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:13px;padding:10px}.wizardFlowItem[_ngcontent-%COMP%] .flowTitle[_ngcontent-%COMP%]{white-space:nowrap}.slider[_ngcontent-%COMP%]{display:none;position:absolute;bottom:0;height:3px;background-color:var(--colors-attention-primary);transition:left .25s ease-in-out,width .25s ease-in-out}'],changeDetection:0})}}return x})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.