frontend-roadreport-main/frontend-roadreport-deploy/dist/road-report/919.7d209c0e25a4d47f.js
2024-12-31 10:28:36 +07:00

1 line
47 KiB
JavaScript

"use strict";(self.webpackChunkroad_report=self.webpackChunkroad_report||[]).push([[919],{6919:(St,R,c)=>{c.r(R),c.d(R,{RekapitulasiModule:()=>xt});var m=c(177),w=c(8185),x=c(2665),f=c(8244),A=c(7374),p=c(9417),t=c(8699),I=c(1626);let P=(()=>{class i{constructor(e){this.http=e}getJsonData(){return this.http.get("assets/graf-tes.json")}static{this.\u0275fac=function(a){return new(a||i)(t.KVO(I.Qq))}}static{this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var $=c(1200),B=c(4576),j=c(5211),l=c(6803),G=c(1991),D=c(7110);let M=(()=>{class i extends G.G{constructor(e,a){super(e,a),this.http=e,this.helpers=a}static{this.\u0275fac=function(a){return new(a||i)(t.KVO(I.Qq),t.KVO(D.V))}}static{this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var S=c(2423),N=c(467),Y=c(6780);let C,U=1;const v={};function E(i){return i in v&&(delete v[i],!0)}const X={setImmediate(i){const o=U++;return v[o]=!0,C||(C=Promise.resolve()),C.then(()=>E(o)&&i()),o},clearImmediate(i){E(i)}},{setImmediate:V,clearImmediate:J}=X,_={setImmediate(...i){const{delegate:o}=_;return(o?.setImmediate||V)(...i)},clearImmediate(i){const{delegate:o}=_;return(o?.clearImmediate||J)(i)},delegate:void 0};var Z=c(3604);const K=new class H extends Z.q{flush(o){this._active=!0;const e=this._scheduled;this._scheduled=void 0;const{actions:a}=this;let n;o=o||a.shift();do{if(n=o.execute(o.state,o.delay))break}while((o=a[0])&&o.id===e&&a.shift());if(this._active=!1,n){for(;(o=a[0])&&o.id===e&&a.shift();)o.unsubscribe();throw n}}}(class z extends Y.R{constructor(o,e){super(o,e),this.scheduler=o,this.work=e}requestAsyncId(o,e,a=0){return null!==a&&a>0?super.requestAsyncId(o,e,a):(o.actions.push(this),o._scheduled||(o._scheduled=_.setImmediate(o.flush.bind(o,void 0))))}recycleAsyncId(o,e,a=0){var n;if(null!=a?a>0:this.delay>0)return super.recycleAsyncId(o,e,a);const{actions:s}=o;null!=e&&(null===(n=s[s.length-1])||void 0===n?void 0:n.id)!==e&&(_.clearImmediate(e),o._scheduled===e&&(o._scheduled=void 0))}}),q=["chart"];let O=(()=>{class i{constructor(){this.autoUpdateSeries=!0,this.chartReady=new t.bkB,this.chartInstance=(0,t.vPA)(null),this.ngZone=(0,t.WQX)(t.SKi),this.isBrowser=(0,m.UE)((0,t.WQX)(t.Agw))}ngOnChanges(e){this.isBrowser&&this.ngZone.runOutsideAngular(()=>{K.schedule(()=>this.hydrate(e))})}ngOnDestroy(){this.destroy()}hydrate(e){this.autoUpdateSeries&&0===Object.keys(e).filter(n=>"series"!==n).length?this.updateSeries(this.series,!0):this.createElement()}createElement(){var e=this;return(0,N.A)(function*(){const{default:a}=yield c.e(550).then(c.t.bind(c,4550,19));window.ApexCharts||=a;const n={};e.annotations&&(n.annotations=e.annotations),e.chart&&(n.chart=e.chart),e.colors&&(n.colors=e.colors),e.dataLabels&&(n.dataLabels=e.dataLabels),e.series&&(n.series=e.series),e.stroke&&(n.stroke=e.stroke),e.labels&&(n.labels=e.labels),e.legend&&(n.legend=e.legend),e.fill&&(n.fill=e.fill),e.tooltip&&(n.tooltip=e.tooltip),e.plotOptions&&(n.plotOptions=e.plotOptions),e.responsive&&(n.responsive=e.responsive),e.markers&&(n.markers=e.markers),e.noData&&(n.noData=e.noData),e.xaxis&&(n.xaxis=e.xaxis),e.yaxis&&(n.yaxis=e.yaxis),e.forecastDataPoints&&(n.forecastDataPoints=e.forecastDataPoints),e.grid&&(n.grid=e.grid),e.states&&(n.states=e.states),e.title&&(n.title=e.title),e.subtitle&&(n.subtitle=e.subtitle),e.theme&&(n.theme=e.theme),e.destroy();const s=e.ngZone.runOutsideAngular(()=>new a(e.chartElement.nativeElement,n));e.chartInstance.set(s),e.render(),e.chartReady.emit({chartObj:s})})()}render(){return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.render())}updateOptions(e,a,n,s){return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.updateOptions(e,a,n,s))}updateSeries(e,a){return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.updateSeries(e,a))}appendSeries(e,a){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.appendSeries(e,a))}appendData(e){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.appendData(e))}highlightSeries(e){return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.highlightSeries(e))}toggleSeries(e){return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.toggleSeries(e))}showSeries(e){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.showSeries(e))}hideSeries(e){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.hideSeries(e))}resetSeries(){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.resetSeries())}zoomX(e,a){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.zoomX(e,a))}toggleDataPointSelection(e,a){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.toggleDataPointSelection(e,a))}destroy(){this.chartInstance()?.destroy(),this.chartInstance.set(null)}setLocale(e){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.setLocale(e))}paper(){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.paper())}addXaxisAnnotation(e,a,n){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.addXaxisAnnotation(e,a,n))}addYaxisAnnotation(e,a,n){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.addYaxisAnnotation(e,a,n))}addPointAnnotation(e,a,n){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.addPointAnnotation(e,a,n))}removeAnnotation(e,a){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.removeAnnotation(e,a))}clearAnnotations(e){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.clearAnnotations(e))}dataURI(e){return this.chartInstance()?.dataURI(e)}static{this.\u0275fac=function(a){return new(a||i)}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["apx-chart"]],viewQuery:function(a,n){if(1&a&&t.GBs(q,7),2&a){let s;t.mGM(s=t.lsd())&&(n.chartElement=s.first)}},inputs:{chart:"chart",annotations:"annotations",colors:"colors",dataLabels:"dataLabels",series:"series",stroke:"stroke",labels:"labels",legend:"legend",markers:"markers",noData:"noData",fill:"fill",tooltip:"tooltip",plotOptions:"plotOptions",responsive:"responsive",xaxis:"xaxis",yaxis:"yaxis",forecastDataPoints:"forecastDataPoints",grid:"grid",states:"states",title:"title",subtitle:"subtitle",theme:"theme",autoUpdateSeries:"autoUpdateSeries"},outputs:{chartReady:"chartReady"},standalone:!0,features:[t.OA$,t.aNF],decls:2,vars:0,consts:[["chart",""]],template:function(a,n){1&a&&t.nrm(0,"div",null,0)},encapsulation:2,changeDetection:0})}}return i})(),L=(()=>{class i{static{this.\u0275fac=function(a){return new(a||i)}}static{this.\u0275mod=t.$C({type:i})}static{this.\u0275inj=t.G2t({})}}return i})();var T=c(5946);function Q(i,o){if(1&i&&(t.j41(0,"option",41),t.EFF(1),t.k0s()),2&i){const e=o.$implicit;t.Y8G("value",e),t.R7$(1),t.SpI(" ",e," ")}}function W(i,o){1&i&&(t.j41(0,"p",42),t.nrm(1,"i",43),t.EFF(2," Belum ada data. "),t.k0s())}function tt(i,o){if(1&i&&(t.j41(0,"div",44)(1,"div",45)(2,"div",46)(3,"div",47)(4,"h4",48),t.EFF(5,"Total Laporan"),t.k0s(),t.j41(6,"h6",49),t.EFF(7),t.k0s()(),t.j41(8,"span",50),t.nrm(9,"i",51),t.k0s()()(),t.j41(10,"div",45)(11,"div",46)(12,"div",47)(13,"h4",48),t.EFF(14,"Dalam Proses"),t.k0s(),t.j41(15,"h6",49),t.EFF(16),t.k0s()(),t.j41(17,"span",52),t.nrm(18,"i",53),t.k0s()()(),t.j41(19,"div",45)(20,"div",46)(21,"div",47)(22,"h4",48),t.EFF(23,"Ditindak Lanjuti"),t.k0s(),t.j41(24,"h6",49),t.EFF(25),t.k0s()(),t.j41(26,"span",54),t.nrm(27,"img",55),t.k0s()()(),t.j41(28,"div",45)(29,"div",46)(30,"div",47)(31,"h4",48),t.EFF(32,"Perbaikan"),t.k0s(),t.j41(33,"h6",49),t.EFF(34),t.k0s()(),t.j41(35,"span",56),t.nrm(36,"i",57),t.k0s()()(),t.j41(37,"div",45)(38,"div",46)(39,"div",47)(40,"h4",48),t.EFF(41,"Tertolak"),t.k0s(),t.j41(42,"h6",49),t.EFF(43),t.k0s()(),t.j41(44,"span",58),t.nrm(45,"i",59),t.k0s()()(),t.j41(46,"div",45)(47,"div",46)(48,"div",47)(49,"h4",48),t.EFF(50,"Selesai"),t.k0s(),t.j41(51,"h6",49),t.EFF(52),t.k0s()(),t.j41(53,"span",60),t.nrm(54,"i",61),t.k0s()()()()),2&i){const e=t.XpG();t.R7$(7),t.SpI(" ",e.count["Semua Laporan"]?e.count["Semua Laporan"]:"-"," "),t.R7$(9),t.SpI(" ",e.count["Dalam Proses"]?e.count["Dalam Proses"]:"-"," "),t.R7$(9),t.SpI(" ",e.count["Ditindak Lanjuti"]?e.count["Ditindak Lanjuti"]:"-"," "),t.R7$(9),t.SpI(" ",e.count.Perbaikan?e.count.Perbaikan:"-"," "),t.R7$(9),t.SpI(" ",e.count.Ditolak?e.count.Ditolak:"-"," "),t.R7$(9),t.SpI(" ",e.count["Laporan Selesai & Sudah Divalidasi"]?e.count["Laporan Selesai & Sudah Divalidasi"]:"-"," ")}}function et(i,o){if(1&i&&(t.j41(0,"li",65),t.nrm(1,"span",66),t.j41(2,"span",67),t.EFF(3),t.k0s()()),2&i){const e=o.$implicit,a=t.XpG(2);t.R7$(1),t.xc7("background-color","DSS"===a.selectedOption?a.getColorByStatusDss(e.status):a.getColorByStatusTitikLaporan(e.status)),t.R7$(1),t.Y8G("ngClass","DSS"===a.selectedOption?a.getColorByStatusDss(e.status):a.getColorByStatusTitikLaporan(e.status)),t.R7$(1),t.SpI(" ",e.status,"")}}function nt(i,o){if(1&i){const e=t.RV6();t.j41(0,"ul",62,63),t.bIt("ngbCollapseChange",function(n){t.eBV(e);const s=t.XpG();return t.Njj(s.isCollapsed=n)}),t.DNE(2,et,4,4,"li",64),t.k0s()}if(2&i){const e=t.XpG();t.xc7("width","DSS"===e.selectedOption?220:190,"px"),t.Y8G("ngbCollapse",e.isCollapsed),t.R7$(2),t.Y8G("ngForOf","DSS"===e.selectedOption?e.statusDss:e.statusTitikLaporan)}}function at(i,o){if(1&i){const e=t.RV6();t.j41(0,"div",68)(1,"button",69),t.EFF(2),t.k0s(),t.j41(3,"div",70)(4,"button",71),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.onOptionChange("DSS"))}),t.EFF(5," DSS "),t.k0s(),t.j41(6,"button",71),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.onOptionChange("Titik Laporan"))}),t.EFF(7," Titik Laporan "),t.k0s()()()}if(2&i){const e=t.XpG();t.R7$(2),t.SpI(" ",e.selectedOption," ")}}let st=(()=>{class i extends x.v{getJsonData(){this.tes.getJsonData().subscribe(e=>{this.jsonData=e,console.log(this.jsonData);const n=[];for(const s in this.jsonData.data){const r=Object.prototype.hasOwnProperty.call(this.jsonData.data,s)&&"object"==typeof this.jsonData.data[s],h=!r&&"Semua Laporan"!==s;r&&n.push(s),h&&console.log("month Date","Object"===this.jsonData.data[s])}console.log("Isi Categories",n),console.log("Isi Series Data",[])})}constructor(e,a,n,s,r,u,h,g,d,k,b){super(d,b,k,g),this.tes=e,this.formBuilder=a,this.reportSegmens=n,this.subDistrict=s,this.report=r,this.calendar=u,this.rekapitulasi=h,this.modal=g,this.helpers=d,this.api=k,this.loading=b,this.hoveredDate=null,this.toDate=null,this.showDatePicker=!1,this.formYears={},this.form={},this.selectedFilter="Filter",this.years=[],this.showOption=!0,this.isExpand=!0,this.isCollapsed=!1,this.selectedOption="DSS",this.selectedData=[],this.statusDss=[],this.statusTitikLaporan=[],this.polylineLayer=new f.FeatureGroup,this.polygonLayer=new f.FeatureGroup,this.pointLayer=new f.FeatureGroup,this.mapOptions={layers:[(0,f.tileLayer)("http://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:22,minZoom:11})],scrollWheelZoom:!1,zoom:14,dragging:!0,doubleClickZoom:!1,touchZoom:!1,tap:!1,center:(0,f.latLng)(-7.8699381,112.5285772)},this.getJsonData(),this.initYears();const F=(new Date).getFullYear();for(let y=F-5;y<F+1;y++)this.years.push(y);this.loadData(),this.initializeCharts(),this.fromDate=u.getToday(),this.toDate=u.getNext(u.getToday(),"d",1),this.api.endpoint="report-list"}loadData(){this.tes.getJsonData().pipe().subscribe({next:e=>{this.pieData=e.data,this.splineData=e.data,this.radarData=e.data,this.defaultPie=e,this.quartet(0,2023)}}),this.initializeCharts()}format(e){const a=this.formYears.value.years;let n="";return e instanceof Date&&!isNaN(e.getTime())?n=`${a}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}`:console.log("Nilai date tidak valid."),n}quartet(e,a){let n,s;switch(e){case 1:n=new Date(a,0,1),s=new Date(a,2,31);break;case 2:n=new Date(a,3,1),s=new Date(a,5,30);break;case 3:n=new Date(a,6,1),s=new Date(a,8,30);break;case 4:n=new Date(a,9,1),s=new Date(a,11,31)}const r=this.format(n),u=this.format(s);if(console.log(r,u),this.rekapitulasi.endpoint=`report-list/range-count?start_date=${r}&end_date=${u}`,this.rekapitulasi.getAll().subscribe({next:({data:h})=>{this.count=h}}),0===e){const h=this.defaultPie?.data.month||[];this.calculateTotalStatus(h||[]),this.calculateTotalSpline(h||[])}else{this.initializeCharts();const h=3,g=(e-1)*h,d=g+h,k=this.pieData.month?.slice(g,d),F=(this.splineData.month?.slice(g,d),this.radarData.month?.slice(g,d));switch(e){case 1:this.splineOptions.xaxis.categories=["Jan","Feb","Mar"],this.radarOptions.xaxis.categories=["Jan","Feb","Mar"];break;case 2:this.splineOptions.xaxis.categories=["Apr","May","Jun"],this.radarOptions.xaxis.categories=["Apr","May","Jun"];break;case 3:this.splineOptions.xaxis.categories=["Jul","Aug","Sep"],this.radarOptions.xaxis.categories=["Jul","Aug","Sep"];break;case 4:this.splineOptions.xaxis.categories=["Oct","Nov","Dec"],this.radarOptions.xaxis.categories=["Oct","Nov","Dec"]}this.selectedFilter=`Kuartal ${e}`,this.calculateTotalSpline(F||[]),this.calculateTotalStatus(k||[])}}calculateTotalSpline(e){const a={};console.log("tes",a),e.forEach(n=>{Object.keys(n).forEach(s=>{"month"!==s&&(a[s]||(a[s]=[]),a[s].push(n[s]||0))})}),console.log(this.splineOptions);for(const[n,s]of Object.entries(a))this.splineOptions.series.push({name:`${n}`,data:s});for(const[n,s]of Object.entries(a))this.radarOptions.series.push({name:`${n}`,data:s});return a}calculateTotalStatus(e){const a={};e.forEach(n=>{Object.keys(n).forEach(s=>{"month"!==s&&(a[s]||(a[s]=0)),a[s]+=n[s]||0})});for(const[n,s]of Object.entries(a))this.pieOptions.labels.push(n),this.pieOptions.series.push(s);return a}initYears(){this.formYears=this.formBuilder.group({years:[2023,[p.k0.required]]})}getYears(){}getMonthRange(){const e=new Date,a=e.getFullYear(),n=e.getMonth(),s=new Date(a,n,1),r=new Date(a,n+1,0);return s.setDate(s.getDate()+1),r.setDate(r.getDate()+1),this.start_date=s.toISOString().slice(0,10),this.end_date=r.toISOString().slice(0,10),this.selectedFilter="Bulan Sekarang",{startDate:"",endDate:""}}getYearRange(){const a=(new Date).getFullYear(),n=new Date(a,0,1),s=new Date(a,11,31);return n.setDate(n.getDate()+1),s.setDate(s.getDate()+1),this.start_date=n.toISOString().slice(0,10),this.end_date=s.toISOString().slice(0,10),this.selectedFilter="Tahun Sekarang",console.log(n,s),{startDate:"",endDate:""}}submitDate(){this.rekapitulasi.endpoint=`report-list/range-count?start_date=${this.form.value.start_date}&end_date=${this.form.value.end_date}`,this.rekapitulasi.getAll().subscribe({next:({data:e})=>{this.count=e,this.count={"Ditindak Lanjuti":0,"Dalam Proses":0,Perbaikan:0,"Laporan Selesai & Sudah Divalidasi":0,"Selesai Perbaikan":0,Ditolak:0,...this.count}}}),this.rekapitulasi.endpoint=`report-segmens/range-level-count?start_date=${this.form.value.start_date}&end_date=${this.form.value.end_date}`,this.rekapitulasi.getAll().subscribe({next:({data:e})=>{this.level=e,this.pieOptions.series=Object.values(this.level),this.pieOptions.labels=Object.keys(this.level).map(n=>`${n}: ${this.level[n]}`);const a=Object.entries(this.level).filter(([n])=>"Total Semua Tingkat Kerusakan"!==n).reduce((n,[s,r])=>({...n,[s]:r}),{});this.pieOptions.series=Object.values(a),this.pieOptions.labels=Object.keys(a).map(n=>`${n}: ${a[n]}`)}}),this.rekapitulasi.endpoint=`report-segmens/range-type-count?start_date=${this.form.value.start_date}&end_date=${this.form.value.end_date}`,this.rekapitulasi.getAll().subscribe({next:({data:e})=>{this.type=e}}),this.api.endpoint=`report-list/range?start_date=${this.start_date}&end_date=${this.end_date}`,this.api.getAll().subscribe({next:({data:e})=>{this.updateReportSegmens(e)}})}toggleDatePicker(){this.showDatePicker=!this.showDatePicker}formatDate(e){return`${e.year}-${e.month<10?"0"+e.month:e.month}-${e.day<10?"0"+e.day:e.day}`}formatDateAndValues(){const e=this.formatDate(this.fromDate);let a=this.toDate?this.formatDate(this.toDate):null;return null===a&&(a=e),{startDate:e,endDate:a}}saveDates(){this.savedDates=this.formatDateAndValues()}showFormatDate(){const{startDate:e,endDate:a}=this.formatDateAndValues();return a?`${e} - ${a}`:e}summaryReport(){this.api.endpoint="report-list/count",this.api.getAll().subscribe({next:({data:e})=>{this.count=e}}),this.initializeCharts()}reportList(){this.api.endpoint="report-list",this.queryLimit=5,this.searchFields="no_ticket,user.fullname,segmens.segmen.name",this.queries={page:1,sort:"-created_at",limit:5,embed:"status_report,user,segmens,segmens.segmen,segmens.photos"},this.getAll()}ngOnInit(){this.summaryReport(),this.getMap()}initMap(e){this.map||(this.map=e),this.map.zoomControl.setPosition("bottomright")}getMap(){this.getSubDistrict(),this.getReportSegmens()}toggleFullscreen(){const e=document.getElementById("map");e&&(document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():e.requestFullscreen&&e.requestFullscreen())}toggleCollapse(){this.isCollapsed||this.getStatusDss(),this.isCollapsed=!this.isCollapsed}onOptionChange(e){this.selectedOption=e,this.map&&(this.map.removeLayer(this.pointLayer),this.map.removeLayer(this.polygonLayer),this.map.removeLayer(this.polylineLayer)),this.selectedData=[],"DSS"===e?this.map&&this.map.closePopup():"Titik Laporan"===e&&(this.getStatusTitik(),this.getStatusSegmenByReport()),this.map&&("DSS"===e?(this.polygonLayer.addTo(this.map),this.polylineLayer.addTo(this.map)):"point"===e&&this.pointLayer.addTo(this.map))}getStatusTitik(){const e={"Dalam Proses":"#586AF5","Tindak Lanjut":"#FFAB00","Selesai Perbaikan":"#663000",Perbaikan:"#F35625",Selesai:"#24D07A"},a=Object.values(e);this.statusTitikLaporan=Object.keys(e).map((n,s)=>({status:n,jumlah:0,color:a[s]}))}getColorByStatusTitikLaporan(e){return{"Dalam Proses":"#586AF5","Tindak Lanjut":"#FFAB00","Selesai Perbaikan":"#663000",Perbaikan:"#F35625",Selesai:"#24D07A"}[e]||"transparent"}getStatusDss(){const e={"Berlubang Parah":"#215A99","Berlubang Sedang":"#2B79CC","Berlubang Ringan":"#87C0FF","Terkelupas Parah":"#18795F","Terkelupas Sedang":"#1CA762","Terkelupas Ringan":"#4FDA95","Retak Parah":"#992A44","Retak Sedang":"#FF4671","Retak Ringan":"#FF90AA","Bergelombang Parah":"#322564","Bergelombang Sedang":"#644BC8","Bergelombang Ringan":"#977EFB"},a=Object.values(e);this.statusDss=Object.keys(e).map((n,s)=>({status:n,jumlah:0,color:a[s]}))}getColorByStatusDss(e,a){const s={"Berlubang Parah":"#215A99","Berlubang Sedang":"#2B79CC","Berlubang Ringan":"#87C0FF","Terkelupas Parah":"#18795F","Terkelupas Sedang":"#1CA762","Terkelupas Ringan":"#4FDA95","Retak Parah":"#992A44","Retak Sedang":"#FF4671","Retak Ringan":"#FF90AA","Bergelombang Parah":"#322564","Bergelombang Sedang":"#644BC8","Bergelombang Ringan":"#977EFB",NULL:"#000000"};return s[`${e} ${a}`]||s[e]}getIconByStatus(e){switch(e){case"PROG":return"assets/images/icon/marker-dalam_proses.png";case"FOLUP":return"assets/images/icon/marker-tindak_lanjut.png";case"DONE":return"assets/images/icon/marker-selesai.png";case"RPR":return"assets/images/icon/marker-perbaikan.png";case"FIXED":return"assets/images/icon/marker-selesai-perbaikan.png";default:return"assets/images/icon/marker-default.svg"}}getSubDistrict(){this.subDistrict.getAll().subscribe(e=>{const a=e.data;if(a&&a.length>0){this.polygonLayer.clearLayers();for(const n of a){const s=JSON.parse(n.geojson),r=f.geoJSON(s,{style:{fillColor:"green",weight:2,color:"white"}});r.on("click",u=>{const h=u.target,g=n.name,d=f.popup().setContent(g);h.bindPopup(d).openPopup()}),r.addTo(this.polygonLayer)}this.map&&this.polygonLayer.addTo(this.map)}},e=>{})}getReportSegmens(){this.loading.isLoading(),this.reportSegmens.getAll({embed:"segmen,analytic_data"}).subscribe(({data:e})=>{this.updateReportSegmens(e)},e=>{})}updateReportSegmens(e){if(this.reportSegmensData=e,e&&e.length>0){this.polylineLayer.clearLayers();for(const a of e){const r=JSON.parse(a.segmen.geojson).coordinates.map(d=>({lat:d[1],lng:d[0]})),g=new f.Polyline(r,{color:this.getColorByStatusDss(a.user_type,a.user_level),weight:5});this.polylineLayer.addLayer(g)}this.map&&this.polylineLayer.addTo(this.map)}}getStatusSegmenByReport(){this.report.endpoint="report-list",this.report.getAll({embed:"segmens.segmen,segmens.analytic_data,segmens.photos,status_report,user"}).subscribe(e=>{const a=e.data;if(a&&a[0]?.segmens&&a[0]?.segmens.length>0){this.pointLayer.clearLayers();for(const n of a){const s=n.segmens;for(const r of s){const g=JSON.parse(r?.segmen?.geojson).coordinates.map(b=>({lat:b[1],lng:b[0]})),d=r.user_type+" "+r.user_level,k=n.status_id;if("RJT"!==k){const b=f.icon({iconUrl:this.getIconByStatus(k),iconSize:[32,32],iconAnchor:[16,32]}),F=f.marker(g[0],{icon:b}).addTo(this.pointLayer);this.pointLayer.setStyle({className:"mask"}),F.addTo(this.pointLayer),F.on("click",y=>{for(const jt of r.photos)this.map&&f.popup({className:"custom-popup"}).setLatLng(y.latlng).setContent(`\n <div>\n <div>\n <div class="d-flex justify-content-between align-items-center text-wrap" style:"display: flex">\n <p class="text-uppercase fs-6 fw-bold mb-2"\n style="font-size: 14px; color: ${"PROG"===n.status_report.id?"#586AF5":"RPR"===n.status_report.id?"#F35625":"FIXED"===n.status_report.id?"#663000":"FOLUP"===n.status_report.id?"#FFAB00":"DONE"===n.status_report.id?"#24D07A":"black"};">\n ${n.status_report.name}\n </p>\n <p class="fs-6 mb-2" style="text-align: right;">\n No.Tiket ${n.no_ticket}\n </p>\n </div>\n\n <div class="d-flex mb-2 align-items-center">\n <img \n class="location-image" \n src="${jt.abs_path}"\n style="width: 94px; height: 94px; border-radius: 8px;">\n <div class="ms-3">\n <div class="d-flex mb-1">\n <i class="bi bi-person me-2" style="color: #586af5"></i>\n Nama ${n.user.fullname}\n </div>\n <div class="d-flex mb-1">\n <i class="bi bi-geo-alt me-2" style="color: #586af5"></i>\n ${r.segmen.name}\n </div>\n <div class="d-flex mb-1">\n <i class="bi bi-calendar2 me-2" style="color: #586af5"></i>\n ${A(n.created_at).format("DD-MM-YYYY")}\n </div>\n </div>\n </div>\n\n <div class="d-flex mb-2">\n <Label class="d-flex align-self-center me-3">Keterangan :</Label>\n <small class="btn btn-custom" \n style="color: white; background-color: ${"Berlubang Parah"===d?"#215A99":"Berlubang Sedang"===d?"#2B79CC":"Berlubang Ringan"===d?"#87C0FF":"Terkelupas Parah"===d?"#18795F":"Terkelupas Sedang"===d?"#1CA762":"Terkelupas Ringan"===d?"#4FDA95":"Retak Parah"===d?"#992A44":"Retak Sedang"===d?"#FF4671":"Retak Ringan"===d?"#FF90AA":"Bergelombang Parah"===d?"#322564":"Bergelombang Sedang"===d?"#644BC8":"Bergelombang Ringan"===d?"#977EFB":"black"};"\n >\n ${r.user_type}\n ${r.user_level}\n </small>\n </div>\n\n <p \n class="description text-justify mb-0"\n style="font-size: 14px; letter-spacing: 0.15px; text-align: justify">\n ${n.note}\n </p>\n </div>\n </div>\n `).openOn(this.map)})}this.getColorByStatusTitikLaporan(n.status_report.name)}}this.getStatusTitik(),this.map&&this.pointLayer.addTo(this.map)}})}initializeCharts(){this.pieOptions={series:[],chart:{width:380,type:"pie"},labels:[],responsive:[{breakpoint:480,options:{chart:{width:200},legend:{position:"bottom"}}}]},this.splineOptions={series:[],chart:{height:350,type:"area"},dataLabels:{enabled:!1},stroke:{curve:"smooth",fill:{colors:["none"]}},xaxis:{categories:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},tooltip:{x:{format:"dd/MM/yy HH:mm"}}},this.radarOptions={series:[],chart:{height:350,type:"radar"},title:{text:"Basic Radar Chart"},xaxis:{categories:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}}}static{this.\u0275fac=function(a){return new(a||i)(t.rXU(P),t.rXU(p.ok),t.rXU($.B),t.rXU(B._),t.rXU(j.Z),t.rXU(l.iF),t.rXU(M),t.rXU(l.Bq),t.rXU(D.V),t.rXU(j.Z),t.rXU(S.U))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-rekapitulasi"]],features:[t.Vt3],decls:86,vars:23,consts:[[1,"h4","fw-bold"],[1,"row","gy-4","mt-2","p-2"],[1,"bg-white","p-4","rounded-3"],[1,"d-flex","align-items-start","justify-content-between","gap-3","flex-wrap","mb-3"],[1,"fw-semibold","d-flex","align-items-start"],[1,"d-flex","flex-wrap",3,"formGroup"],["id","years","formControlName","years",1,"form-control","me-2",2,"width","10rem",3,"click"],["disabled","","selected",""],[3,"value",4,"ngFor","ngForOf"],["ngbDropdown",""],["id","filterDropdown","ngbDropdownToggle","",1,"btn","no-caret","fw-normal",2,"background-color","#eef0fd"],[1,"ms-4","bi","bi-funnel"],["ngbDropdownMenu","","aria-labelledby","filterDropdown"],["ngbDropdownItem","",3,"click"],["class","text-body-tertiary",4,"ngIf"],["class","row g-3",4,"ngIf"],["id","map",1,"w-100","position-relative","rounded-3","overflow-hidden","bg-secondary-subtle",2,"height","460px"],["id","status",1,"position-absolute","z-1","ms-3","mt-3"],["type","button","aria-controls","collapseExample",1,"btn","btn-light","fw-light","mb-2",3,"click"],[1,"bi","bi-info-circle","me-1","text-primary"],["class","list-unstyled d-flex flex-column row-gap-1 rounded-2 bg-white bg-opacity-75 p-3 mb-0",3,"ngbCollapse","width","ngbCollapseChange",4,"ngIf"],["id","optionData",1,"position-absolute","z-1","me-3","mt-3","d-flex",2,"right","0"],["ngbDropdown","","class","d-inline-block",4,"ngIf"],[1,"btn","btn-light",3,"click"],[3,"ngClass"],["leaflet","",1,"tes","position-relative","z-0","w-100","h-100",3,"leafletOptions","leafletMapReady"],[1,"rounded-3","p-4","bg-white"],[1,"d-flex","align-items-center","justify-content-between","gap-3","flex-wrap","mb-3"],[1,"fw-semibold","mb-0"],[3,"series","chart","xaxis","stroke","tooltip","dataLabels"],[1,"rounded-3"],[1,"row","gap-3"],[1,"col","bg-white","rounded-3"],[1,"p-4","bg-white"],[1,"btn","no-caret","text-primary","me-2",2,"background-color","#eef0fd"],[1,"bi","bi-file-earmark-text","text-primary"],["id","filterDropdown","ngbDropdownToggle","",1,"btn","no-caret","text-primary",2,"background-color","#eef0fd"],[1,"ms-2","bi","bi-funnel","text-primary"],["ngbDropdownItem",""],[3,"series","chart","labels","responsive"],[3,"series","chart","xaxis","title"],[3,"value"],[1,"text-body-tertiary"],[1,"bi","bi-exclamation-circle"],[1,"row","g-3"],[1,"col-lg","col-md","col-sm-6"],[1,"d-flex","align-items-start","justify-content-between","column-gap-3","p-4","rounded-3","border","h-100"],[1,"d-flex","flex-column-reverse"],[1,"h6","text-body-tertiary","mb-0"],[1,"h4"],[1,"flex-shrink-0","bg-info","px-2","py-1","text-white","rounded-2"],[1,"bi","bi-database"],[1,"flex-shrink-0","bg-primary","px-2","py-1","text-white","rounded-2"],[1,"bi","bi-clipboard"],[1,"d-flex","flex-column","justify-content-center","align-items-center","bg-warning","px-2","py-2","rounded-2"],["src","assets/images/loader.svg","alt",""],[1,"flex-shrink-0","px-2","py-1","text-white","rounded-2",2,"background-color","#3697ff"],[1,"bi","bi-arrow-clockwise"],[1,"flex-shrink-0","px-2","py-1","text-white","rounded-2","bg-danger"],[1,"bi","bi-x"],[1,"flex-shrink-0","bg-success","px-2","py-1","text-white","rounded-2"],[1,"bi","bi-check-lg"],[1,"list-unstyled","d-flex","flex-column","row-gap-1","rounded-2","bg-white","bg-opacity-75","p-3","mb-0",3,"ngbCollapse","ngbCollapseChange"],["collapse","ngbCollapse"],["class","d-flex align-items-center",4,"ngFor","ngForOf"],[1,"d-flex","align-items-center"],[1,"p-1","rounded-circle","bg-status","me-2"],[1,"status-text",3,"ngClass"],["ngbDropdown","",1,"d-inline-block"],["type","button","id","dropdownBasic1","ngbDropdownToggle","",1,"btn","btn-primary","me-2"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1"],["ngbDropdownItem","",1,"py-2","px-2",3,"click"]],template:function(a,n){1&a&&(t.j41(0,"h1",0),t.EFF(1,"Rekapitulasi"),t.k0s(),t.j41(2,"div",1)(3,"div",2)(4,"div",3)(5,"h5",4),t.EFF(6," Ringkasan Total Laporan "),t.k0s(),t.j41(7,"form",5)(8,"select",6),t.bIt("click",function(){return n.getYears()}),t.j41(9,"option",7),t.EFF(10,"Pilih Tahun"),t.k0s(),t.DNE(11,Q,2,2,"option",8),t.k0s(),t.j41(12,"div",9)(13,"button",10),t.EFF(14),t.nrm(15,"i",11),t.k0s(),t.j41(16,"div",12)(17,"button",13),t.bIt("click",function(){return n.quartet(1,2023)}),t.EFF(18," Kuartal 1 "),t.k0s(),t.j41(19,"button",13),t.bIt("click",function(){return n.quartet(2,2023)}),t.EFF(20," Kuartal 2 "),t.k0s(),t.j41(21,"button",13),t.bIt("click",function(){return n.quartet(3,2023)}),t.EFF(22," Kuartal 3 "),t.k0s(),t.j41(23,"button",13),t.bIt("click",function(){return n.quartet(4,2023)}),t.EFF(24," Kuartal 4 "),t.k0s(),t.j41(25,"button",13),t.bIt("click",function(){return n.getMonthRange()}),t.EFF(26," Bulan Sekarang "),t.k0s(),t.j41(27,"button",13),t.bIt("click",function(){return n.getYearRange()}),t.EFF(28," Tahun Sekarang "),t.k0s()()()()(),t.DNE(29,W,3,0,"p",14),t.DNE(30,tt,55,6,"div",15),t.k0s(),t.j41(31,"div",16)(32,"div")(33,"div",17)(34,"button",18),t.bIt("click",function(){return n.toggleCollapse()}),t.nrm(35,"i",19),t.EFF(36," Info Garis "),t.k0s(),t.DNE(37,nt,3,4,"ul",20),t.k0s()(),t.j41(38,"div",21),t.DNE(39,at,8,1,"div",22),t.j41(40,"button",23),t.bIt("click",function(){return n.isExpand=!n.isExpand})("click",function(){return n.toggleFullscreen()}),t.nrm(41,"i",24),t.k0s()(),t.j41(42,"div",25),t.bIt("leafletMapReady",function(r){return n.initMap(r)}),t.k0s()(),t.j41(43,"div",26)(44,"div",27)(45,"h5",28),t.EFF(46,"Grafik Laporan"),t.k0s()(),t.nrm(47,"apx-chart",29),t.k0s(),t.j41(48,"div",30)(49,"div",31)(50,"div",32)(51,"div",33)(52,"div",27)(53,"h5",28),t.EFF(54,"Level Kerusakan"),t.k0s(),t.j41(55,"div",9)(56,"button",34),t.nrm(57,"i",35),t.EFF(58," Export PDF "),t.k0s(),t.j41(59,"button",36),t.EFF(60," Filter "),t.nrm(61,"i",37),t.k0s(),t.j41(62,"div",12)(63,"button",38),t.EFF(64,"Hari"),t.k0s(),t.j41(65,"button",38),t.EFF(66,"Bulan"),t.k0s()()()(),t.nrm(67,"apx-chart",39),t.k0s()(),t.j41(68,"div",32)(69,"div",33)(70,"div",27)(71,"h5",28),t.EFF(72,"Jenis Kerusakan"),t.k0s(),t.j41(73,"div",9)(74,"button",34),t.nrm(75,"i",35),t.EFF(76," Export PDF "),t.k0s(),t.j41(77,"button",36),t.EFF(78," Filter "),t.nrm(79,"i",37),t.k0s(),t.j41(80,"div",12)(81,"button",38),t.EFF(82,"Hari"),t.k0s(),t.j41(83,"button",38),t.EFF(84,"Bulan"),t.k0s()()()(),t.nrm(85,"apx-chart",40),t.k0s()()()()()),2&a&&(t.R7$(7),t.Y8G("formGroup",n.formYears),t.R7$(4),t.Y8G("ngForOf",n.years),t.R7$(3),t.SpI(" ",n.selectedFilter," "),t.R7$(15),t.Y8G("ngIf",null==n.count),t.R7$(1),t.Y8G("ngIf",n.count),t.R7$(7),t.Y8G("ngIf",n.isCollapsed),t.R7$(2),t.Y8G("ngIf",n.showOption),t.R7$(2),t.Y8G("ngClass",n.isExpand?"bi bi-arrows-angle-expand":"bi bi-arrows-angle-contract"),t.R7$(1),t.Y8G("leafletOptions",n.mapOptions),t.R7$(5),t.Y8G("series",n.splineOptions.series)("chart",n.splineOptions.chart)("xaxis",n.splineOptions.xaxis)("stroke",n.splineOptions.stroke)("tooltip",n.splineOptions.tooltip)("dataLabels",n.splineOptions.dataLabels),t.R7$(20),t.Y8G("series",n.pieOptions.series)("chart",n.pieOptions.chart)("labels",n.pieOptions.labels)("responsive",n.pieOptions.responsive),t.R7$(18),t.Y8G("series",n.radarOptions.series)("chart",n.radarOptions.chart)("xaxis",n.radarOptions.xaxis)("title",n.radarOptions.title))},dependencies:[m.YU,m.Sq,m.bT,l.tg,l.do,l.U0,l._H,p.qT,p.xH,p.y7,p.wz,p.BC,p.cb,p.j4,p.JD,O,l.$G,T.V1],styles:[".has-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:3rem}.has-search[_ngcontent-%COMP%] .form-control-feedback[_ngcontent-%COMP%]{position:absolute}.form-control[_ngcontent-%COMP%]::placeholder{color:#bdbdbd}.custom-day[_ngcontent-%COMP%]{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused[_ngcontent-%COMP%]{background-color:#e6e6e6}.custom-day.range[_ngcontent-%COMP%], .custom-day[_ngcontent-%COMP%]:hover{background-color:#0275d8;color:#fff}.custom-day.faded[_ngcontent-%COMP%]{background-color:#0275d880}"]})}}return i})();var it=c(2408);function ot(i,o){1&i&&(t.j41(0,"p",19),t.nrm(1,"i",20),t.EFF(2," Belum ada data. "),t.k0s())}function rt(i,o){if(1&i&&(t.j41(0,"div",21)(1,"div",22)(2,"div",23)(3,"div",24)(4,"h4",25),t.EFF(5,"Total Laporan"),t.k0s(),t.j41(6,"h6",26),t.EFF(7),t.k0s()(),t.j41(8,"span",27),t.nrm(9,"i",28),t.k0s()()(),t.j41(10,"div",22)(11,"div",23)(12,"div",24)(13,"h4",25),t.EFF(14,"Dalam Proses"),t.k0s(),t.j41(15,"h6",26),t.EFF(16),t.k0s()(),t.j41(17,"span",29),t.nrm(18,"i",30),t.k0s()()(),t.j41(19,"div",22)(20,"div",23)(21,"div",24)(22,"h4",25),t.EFF(23,"Ditindak Lanjuti"),t.k0s(),t.j41(24,"h6",26),t.EFF(25),t.k0s()(),t.j41(26,"span",31),t.nrm(27,"img",32),t.k0s()()(),t.j41(28,"div",22)(29,"div",23)(30,"div",24)(31,"h4",25),t.EFF(32,"Perbaikan"),t.k0s(),t.j41(33,"h6",26),t.EFF(34),t.k0s()(),t.j41(35,"span",33),t.nrm(36,"i",34),t.k0s()()(),t.j41(37,"div",22)(38,"div",23)(39,"div",24)(40,"h4",25),t.EFF(41,"Tertolak"),t.k0s(),t.j41(42,"h6",26),t.EFF(43),t.k0s()(),t.j41(44,"span",35),t.nrm(45,"i",36),t.k0s()()(),t.j41(46,"div",22)(47,"div",23)(48,"div",24)(49,"h4",25),t.EFF(50,"Selesai"),t.k0s(),t.j41(51,"h6",26),t.EFF(52),t.k0s()(),t.j41(53,"span",37),t.nrm(54,"i",38),t.k0s()()()()),2&i){const e=t.XpG();t.R7$(7),t.SpI(" ",e.count["Semua Laporan"]?e.count["Semua Laporan"]:"-"," "),t.R7$(9),t.SpI(" ",e.count["Dalam Proses"]?e.count["Dalam Proses"]:"-"," "),t.R7$(9),t.SpI(" ",e.count["Ditindak Lanjuti"]?e.count["Ditindak Lanjuti"]:"-"," "),t.R7$(9),t.SpI(" ",e.count.Perbaikan?e.count.Perbaikan:"-"," "),t.R7$(9),t.SpI(" ",e.count.Ditolak?e.count.Ditolak:"-"," "),t.R7$(9),t.SpI(" ",e.count["Laporan Selesai & Sudah Divalidasi"]?e.count["Laporan Selesai & Sudah Divalidasi"]:"-"," ")}}let lt=(()=>{class i extends x.v{constructor(e,a,n,s,r){super(n,r,s,a),this.modal=a,this.helpers=n,this.api=s,this.loading=r}ngOnInit(){this.api.getAll().subscribe({next:({data:e})=>{this.count=e}})}static{this.\u0275fac=function(a){return new(a||i)(t.rXU(l.iF),t.rXU(l.Bq),t.rXU(D.V),t.rXU(it.a),t.rXU(S.U))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-ringkasan"]],standalone:!0,features:[t.Vt3,t.aNF],decls:34,vars:3,consts:[[1,"bg-white","p-4","rounded-3"],[1,"d-flex","align-items-center","justify-content-between","gap-3","flex-wrap","mb-3"],[1,"fw-semibold"],[1,"d-flex"],["ngbDropdown",""],["id","filterDropdown","ngbDropdownToggle","",1,"btn","no-caret","fw-normal",2,"background-color","#eef0fd"],[1,"ms-4","bi","bi-funnel"],["ngbDropdownMenu","","aria-labelledby","filterDropdown"],["ngbDropdownItem",""],[1,"mx-3","my-auto"],[1,"row","row-cols-sm-auto"],[1,"col-12"],[1,"input-group",2,"background-color","#eef0fd"],["placeholder","yyyy-mm-dd","name","dp","ngbDatepicker","","autocomplete","off",1,"form-control",3,"ngModel","click","ngModelChange"],["d","ngbDatepicker"],["type","button",1,"btn","btn-outline-secondary","bi","bi-calendar2",3,"click"],[1,"ms-3","btn","btn-primary"],["class","text-body-tertiary",4,"ngIf"],["class","row g-3",4,"ngIf"],[1,"text-body-tertiary"],[1,"bi","bi-exclamation-circle"],[1,"row","g-3"],[1,"col-lg","col-md","col-sm-6"],[1,"d-flex","align-items-start","justify-content-between","column-gap-3","p-4","rounded-3","border","h-100"],[1,"d-flex","flex-column-reverse"],[1,"h6","text-body-tertiary","mb-0"],[1,"h4"],[1,"flex-shrink-0","bg-info","px-2","py-1","text-white","rounded-2"],[1,"bi","bi-database"],[1,"flex-shrink-0","bg-primary","px-2","py-1","text-white","rounded-2"],[1,"bi","bi-clipboard"],[1,"d-flex","flex-column","justify-content-center","align-items-center","bg-warning","px-2","py-2","rounded-2"],["src","assets/images/loader.svg","alt",""],[1,"flex-shrink-0","px-2","py-1","text-white","rounded-2",2,"background-color","#3697ff"],[1,"bi","bi-arrow-clockwise"],[1,"flex-shrink-0","px-2","py-1","text-white","rounded-2","bg-danger"],[1,"bi","bi-x"],[1,"flex-shrink-0","bg-success","px-2","py-1","text-white","rounded-2"],[1,"bi","bi-check-lg"]],template:function(a,n){if(1&a){const s=t.RV6();t.j41(0,"div",0)(1,"div",1)(2,"h5",2),t.EFF(3,"Ringkasan Total Laporan"),t.k0s(),t.j41(4,"div",3)(5,"div",4)(6,"button",5),t.EFF(7," Filter "),t.nrm(8,"i",6),t.k0s(),t.j41(9,"div",7)(10,"button",8),t.EFF(11,"Kuartal 1"),t.k0s(),t.j41(12,"button",8),t.EFF(13,"Kuartal 2"),t.k0s(),t.j41(14,"button",8),t.EFF(15,"Kuartal 3"),t.k0s(),t.j41(16,"button",8),t.EFF(17,"Kuartal 4"),t.k0s(),t.j41(18,"button",8),t.EFF(19,"Bulan Sekarang"),t.k0s(),t.j41(20,"button",8),t.EFF(21,"Tahun Sekarang"),t.k0s()()(),t.j41(22,"span",9),t.EFF(23,"/"),t.k0s(),t.j41(24,"form",10)(25,"div",11)(26,"div",12)(27,"input",13,14),t.bIt("click",function(){t.eBV(s);const u=t.sdS(28);return t.Njj(u.toggle())})("ngModelChange",function(u){return n.model=u}),t.k0s(),t.j41(29,"button",15),t.bIt("click",function(){t.eBV(s);const u=t.sdS(28);return t.Njj(u.toggle())}),t.k0s()()()(),t.j41(30,"button",16),t.EFF(31,"Submit"),t.k0s()()(),t.DNE(32,ot,3,0,"p",17),t.DNE(33,rt,55,6,"div",18),t.k0s()}2&a&&(t.R7$(27),t.Y8G("ngModel",n.model),t.R7$(5),t.Y8G("ngIf",null==n.count),t.R7$(1),t.Y8G("ngIf",n.count))},dependencies:[m.MD,m.bT,p.X1,p.qT,p.me,p.BC,p.cb,l.zH,l.tg,l.do,l.U0,l._H,l.IQ,l.cw,p.YN,p.vS,p.cV]})}}return i})();var ct=c(2257);let pt=(()=>{class i{constructor(){this.chartOptions={series:[{name:"Series 1",data:[30,40,25,50,49,21,70,51,10,98,10,50]}],chart:{toolbar:{show:!1},height:350,type:"area"},xaxis:{categories:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"]},stroke:{curve:"smooth"},dataLabels:{enabled:!1},yaxis:{},title:{},labels:[],legend:{},subtitle:{}}}static{this.\u0275fac=function(a){return new(a||i)}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-grafik-laporan"]],standalone:!0,features:[t.aNF],decls:17,vars:5,consts:[[1,"rounded-3","p-4","bg-white"],[1,"d-flex","align-items-center","justify-content-between","gap-3","flex-wrap","mb-3"],[1,"fw-semibold","mb-0"],["ngbDropdown",""],[1,"btn","no-caret","text-primary","me-2",2,"background-color","#eef0fd"],[1,"bi","bi-file-earmark-text","text-primary"],["id","filterDropdown","ngbDropdownToggle","",1,"btn","no-caret","text-primary",2,"background-color","#eef0fd"],[1,"ms-2","bi","bi-funnel","text-primary"],["ngbDropdownMenu","","aria-labelledby","filterDropdown"],["ngbDropdownItem",""],[3,"series","chart","xaxis","stroke","dataLabels"]],template:function(a,n){1&a&&(t.j41(0,"div",0)(1,"div",1)(2,"h5",2),t.EFF(3,"Grafik Laporan"),t.k0s(),t.j41(4,"div",3)(5,"button",4),t.nrm(6,"i",5),t.EFF(7," Export PDF "),t.k0s(),t.j41(8,"button",6),t.EFF(9," Filter "),t.nrm(10,"i",7),t.k0s(),t.j41(11,"div",8)(12,"button",9),t.EFF(13,"Hari"),t.k0s(),t.j41(14,"button",9),t.EFF(15,"Bulan"),t.k0s()()()(),t.nrm(16,"apx-chart",10),t.k0s()),2&a&&(t.R7$(16),t.Y8G("series",n.chartOptions.series)("chart",n.chartOptions.chart)("xaxis",n.chartOptions.xaxis)("stroke",n.chartOptions.stroke)("dataLabels",n.chartOptions.dataLabels))},dependencies:[l.zH,l.tg,l.do,l.U0,l._H,L,O]})}}return i})();var dt=c(5471);function ut(i,o){if(1&i&&(t.j41(0,"div",14),t.nrm(1,"i",15)(2,"input",16),t.k0s()),2&i){const e=t.XpG();t.R7$(2),t.Y8G("formControl",e.searchForm)("readonly",0===e.dataSourceLength&&e.queries.filter&&!e.queries.search)}}function ht(i,o){1&i&&(t.j41(0,"button",17),t.nrm(1,"i",18),t.EFF(2," Export PDF "),t.k0s())}function gt(i,o){if(1&i){const e=t.RV6();t.j41(0,"button",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.applyFilter("PROG"))}),t.EFF(1," Dalam Proses "),t.k0s()}}function mt(i,o){if(1&i){const e=t.RV6();t.j41(0,"button",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.applyFilter("RJT"))}),t.EFF(1," Ditolak "),t.k0s()}}function ft(i,o){1&i&&(t.j41(0,"p",19),t.nrm(1,"i",20),t.EFF(2," Belum ada data. "),t.k0s())}function bt(i,o){1&i&&(t.j41(0,"p",19),t.nrm(1,"i",21),t.EFF(2," Tidak ada hasil pencarian "),t.k0s())}const kt=function(i,o,e,a,n,s){return{"bg-primary":i,"bg-warning":o,"bg-danger":e,"bg-info":a,"bg-secondary":n,"bg-success":s,"text-nowrap text-white text-center rounded-2 px-2 py-2":!0,"d-block":!0}};function Ft(i,o){if(1&i){const e=t.RV6();t.j41(0,"tr")(1,"td"),t.EFF(2),t.nI1(3,"date"),t.k0s(),t.j41(4,"td"),t.EFF(5),t.k0s(),t.j41(6,"td"),t.EFF(7),t.k0s(),t.j41(8,"td")(9,"small",30),t.EFF(10),t.k0s()(),t.j41(11,"td")(12,"a",31),t.EFF(13),t.k0s()(),t.j41(14,"td"),t.EFF(15),t.k0s(),t.j41(16,"td",32)(17,"div",33)(18,"button",34),t.bIt("click",function(){const s=t.eBV(e).$implicit,r=t.XpG(2);return t.Njj(r.goToDetail(s.id))}),t.EFF(19," Detail "),t.k0s()()()()}if(2&i){const e=o.$implicit,a=t.XpG(2);t.R7$(2),t.JRh(t.i5U(3,11,e.created_at,"dd/MM/yyyy")),t.R7$(3),t.JRh(e.no_ticket),t.R7$(2),t.JRh(e.user.fullname),t.R7$(2),t.Y8G("ngClass",t.l4e(14,kt,"PROG"===e.status_report.id,"FOLUP"===e.status_report.id,"RJT"===e.status_report.id,"RPR"===e.status_report.id,"FIXED"===e.status_report.id,"DONE"===e.status_report.id)),t.R7$(1),t.SpI(" ","DONE"===e.status_report.id?"Selesai":e.status_report.name," "),t.R7$(2),t.FRS("href","https://www.google.com/maps/search/?api=1&query=",a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates[1],",",a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates[0],"&zoom=15&markers=",a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates[1],",",a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates[0],"",t.B4B),t.R7$(1),t.SpI(" ","["+a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates.reverse().join(", ")+"]"," "),t.R7$(2),t.SpI(" ",e.segmens.length>0?e.segmens[e.segmens.length-1].segmen.name:"-"," ")}}function yt(i,o){if(1&i&&(t.j41(0,"option",35),t.EFF(1),t.k0s()),2&i){const e=o.$implicit,a=t.XpG(2);t.Y8G("value",e)("selected",e===a.queryLimit),t.R7$(1),t.SpI(" ",e," ")}}function Dt(i,o){if(1&i){const e=t.RV6();t.qex(0),t.j41(1,"div",22)(2,"table",23)(3,"thead")(4,"tr")(5,"th"),t.EFF(6,"Tanggal"),t.k0s(),t.j41(7,"th"),t.EFF(8,"No Tiket"),t.k0s(),t.j41(9,"th"),t.EFF(10,"Nama Pelapor"),t.k0s(),t.j41(11,"th"),t.EFF(12,"Status"),t.k0s(),t.j41(13,"th"),t.EFF(14,"Lihat Maps"),t.k0s(),t.j41(15,"th"),t.EFF(16,"Lokasi"),t.k0s(),t.j41(17,"th"),t.EFF(18,"Aksi"),t.k0s()()(),t.j41(19,"tbody"),t.DNE(20,Ft,20,21,"tr",24),t.k0s()()(),t.j41(21,"div",25)(22,"div",26)(23,"span"),t.EFF(24,"Item per halalaman"),t.k0s(),t.j41(25,"select",27),t.bIt("change",function(n){t.eBV(e);const s=t.XpG();return t.Njj(s.onPageSizeChange(n))}),t.DNE(26,yt,2,3,"option",28),t.k0s(),t.j41(27,"span"),t.EFF(28),t.k0s()(),t.j41(29,"ngb-pagination",29),t.bIt("pageChange",function(n){t.eBV(e);const s=t.XpG();return t.Njj(s.queryPage=n)})("pageChange",function(n){t.eBV(e);const s=t.XpG();return t.Njj(s.onPaginateChange(n))}),t.k0s()(),t.bVm()}if(2&i){const e=t.XpG();t.R7$(20),t.Y8G("ngForOf",e.dataSource),t.R7$(6),t.Y8G("ngForOf",e.pageSizeOptions),t.R7$(2),t.SpI("dari ",e.dataSourceLength,""),t.R7$(1),t.Y8G("collectionSize",e.dataSourceLength)("page",e.queryPage)("maxSize",5)("pageSize",e.queryLimit)("rotate",!0)("ellipses",!1)("boundaryLinks",!1)("directionLinks",!0)}}let vt=(()=>{class i extends x.v{constructor(e,a,n,s,r,u){super(s,u,r,n),this.router=e,this.auth=a,this.modal=n,this.helpers=s,this.api=r,this.loading=u,this.statusId="",this.field={eq:this.statusId},this.queryLimit=5,this.queries={page:1,sort:"-created_at",limit:5,embed:"status_report,user,segmens,segmens.segmen,segmens.photos"},"PNGL"==this.auth.getLoggedUser().role.code&&(this.api.endpoint="report-list/pengelola")}applyFilter(e){return this.statusId=e,""!==this.statusId?this.queries.filter={status_id:{eq:this.statusId}}:"SADM"==this.auth.getLoggedUser().role.code?delete this.queries.filter.status_id:this.queries.filter={status_id:{ne:"PROG,RJT"}},this.getAll(),!0}goToDetail(e){this.auth.getLoggedUser(),this.router.navigate(["dashboard","data-laporan",e])}isPNGL(){const e=this.auth.getLoggedUser();return!!e&&"SADM"===e.role.code}parsing(e){return JSON.parse(e)}static{this.\u0275fac=function(a){return new(a||i)(t.rXU(w.Ix),t.rXU(dt.u),t.rXU(l.Bq),t.rXU(D.V),t.rXU(j.Z),t.rXU(S.U))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["app-laporan"]],standalone:!0,features:[t.Vt3,t.aNF],decls:26,vars:8,consts:[[1,"rounded-3","p-4","bg-white"],[1,"fw-semibold","mb-4"],[1,"d-flex","align-items-center","justify-content-between","gap-3","flex-wrap","mb-3",3,"ngClass"],["class","form-group has-search d-flex align-items-center",4,"ngIf"],["ngbDropdown",""],["class","btn no-caret text-primary me-2","style","background-color: #eef0fd",4,"ngIf"],["id","filterDropdown","ngbDropdownToggle","",1,"btn","no-caret","text-primary",2,"background-color","#eef0fd"],[1,"ms-2","bi","bi-funnel","text-primary"],["ngbDropdownMenu","","aria-labelledby","filterDropdown"],["ngbDropdownItem","",1,"dropdown-item",3,"click"],["ngbDropdownItem","",3,"click",4,"ngIf"],["ngbDropdownItem","",3,"click"],["class","text-body-tertiary",4,"ngIf"],[4,"ngIf"],[1,"form-group","has-search","d-flex","align-items-center"],[1,"bi","bi-search","form-control-feedback","mx-auto","ms-3",2,"color","black"],["type","text","placeholder","Cari data...",1,"form-control","border-0","form-control",2,"background","#f2f2f2","height","48px",3,"formControl","readonly"],[1,"btn","no-caret","text-primary","me-2",2,"background-color","#eef0fd"],[1,"bi","bi-file-earmark-text","text-primary"],[1,"text-body-tertiary"],[1,"bi","bi-exclamation-circle"],[1,"bi","bi-search"],[1,"table-responsive"],[1,"table"],[4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","justify-content-between","gap-3","flex-wrap"],[1,"w-auto","d-flex","align-items-center","gap-2"],[1,"form-select","w-auto",3,"change"],[3,"value","selected",4,"ngFor","ngForOf"],[1,"mb-n3",3,"collectionSize","page","maxSize","pageSize","rotate","ellipses","boundaryLinks","directionLinks","pageChange"],[3,"ngClass"],["target","_blank",1,"text-nowrap",3,"href"],[1,""],[1,"d-flex"],["type","button",1,"btn","btn-outline-primary","me-2",3,"click"],[3,"value","selected"]],template:function(a,n){1&a&&(t.j41(0,"div",0)(1,"h5",1),t.EFF(2,"Data Laporan"),t.k0s(),t.j41(3,"div",2),t.DNE(4,ut,3,2,"div",3),t.j41(5,"div",4),t.DNE(6,ht,3,0,"button",5),t.j41(7,"button",6),t.EFF(8," Filter "),t.nrm(9,"i",7),t.k0s(),t.j41(10,"div",8)(11,"button",9),t.bIt("click",function(){return n.applyFilter("")}),t.EFF(12," Semua "),t.k0s(),t.DNE(13,gt,2,0,"button",10),t.j41(14,"button",11),t.bIt("click",function(){return n.applyFilter("FOLUP")}),t.EFF(15," Ditindak Lanjuti "),t.k0s(),t.j41(16,"button",11),t.bIt("click",function(){return n.applyFilter("RPR")}),t.EFF(17,"Perbaikan"),t.k0s(),t.j41(18,"button",11),t.bIt("click",function(){return n.applyFilter("FIXED")}),t.EFF(19," Selesai Perbaikan "),t.k0s(),t.DNE(20,mt,2,0,"button",10),t.j41(21,"button",11),t.bIt("click",function(){return n.applyFilter("DONE")}),t.EFF(22,"Selesai"),t.k0s()()()(),t.DNE(23,ft,3,0,"p",12),t.DNE(24,bt,3,0,"p",12),t.DNE(25,Dt,30,11,"ng-container",13),t.k0s()),2&a&&(t.R7$(3),t.Y8G("ngClass",n.dataSourceTotal>0?"justify-content-between":"justify-content-end"),t.R7$(1),t.Y8G("ngIf",n.dataSourceTotal>0),t.R7$(2),t.Y8G("ngIf",n.dataSourceTotal>0),t.R7$(7),t.Y8G("ngIf",n.isPNGL()),t.R7$(7),t.Y8G("ngIf",n.isPNGL()),t.R7$(3),t.Y8G("ngIf",0==n.dataSourceTotal),t.R7$(1),t.Y8G("ngIf",n.dataSourceTotal>0&&0===n.dataSourceLength&&n.queries.search),t.R7$(1),t.Y8G("ngIf",n.dataSourceTotal>0&&n.dataSourceLength>0))},dependencies:[l.c9,l.s5,l.zH,l.tg,l.do,l.U0,l._H,m.MD,m.YU,m.Sq,m.bT,m.vh,p.X1,p.xH,p.y7,p.me,p.BC,p.l_],styles:[".has-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:3rem}.has-search[_ngcontent-%COMP%] .form-control-feedback[_ngcontent-%COMP%]{position:absolute}.form-control[_ngcontent-%COMP%]::placeholder{color:#bdbdbd}"]})}}return i})();const _t=[{path:"",component:st}];let xt=(()=>{class i{static{this.\u0275fac=function(a){return new(a||i)}}static{this.\u0275mod=t.$C({type:i})}static{this.\u0275inj=t.G2t({imports:[m.MD,w.iI.forChild(_t),lt,ct.i,pt,vt,l.IQ,l.zH,p.YN,p.X1,L,l.c9,l.HC,l.oi,l.UN,T.gI]})}}return i})()}}]);