{ "version": 3, "sources": ["src/app/providers/statistics-service/statistics.service.ts"], "sourcesContent": ["import { inject, Injectable } from \"@angular/core\";\nimport { HttpClient, HttpHeaders } from \"@angular/common/http\";\nimport { Observable } from \"rxjs\";\nimport { ConstantsService } from \"../constants-service/constants.service\";\nimport { AuthenticationService } from \"../authentication-service/authentication.service\";\n\n@Injectable()\nexport class StatisticsService {\n http = inject(HttpClient);\n private constantsService = inject(ConstantsService);\n private authenticationService = inject(AuthenticationService);\n\n getBulletinStatisticsCsv(\n startDate: Date,\n endDate: Date,\n lang: string,\n extended: boolean,\n duplicates: boolean,\n ): Observable {\n const url =\n this.constantsService.getServerUrl() +\n \"statistics?\" +\n this.constantsService\n .createSearchParams([\n [\"startDate\", this.constantsService.getISOStringWithTimezoneOffset(startDate)],\n [\"endDate\", this.constantsService.getISOStringWithTimezoneOffset(endDate)],\n [\"region\", this.authenticationService.getActiveRegionId()],\n [\"lang\", lang],\n [\"extended\", extended],\n [\"duplicates\", duplicates],\n ])\n .toString();\n const headers = new HttpHeaders({ Accept: \"text/csv\" });\n return this.http.get(url, { headers, responseType: \"blob\" });\n }\n\n getDangerSourceStatisticsCsv(startDate: Date, endDate: Date): Observable {\n const url =\n this.constantsService.getServerUrl() +\n \"statistics/danger-sources?\" +\n this.constantsService\n .createSearchParams([\n [\"startDate\", this.constantsService.getISOStringWithTimezoneOffset(startDate)],\n [\"endDate\", this.constantsService.getISOStringWithTimezoneOffset(endDate)],\n ])\n .toString();\n const headers = new HttpHeaders({ Accept: \"text/csv\" });\n return this.http.get(url, { headers, responseType: \"blob\" });\n }\n}\n"], "mappings": "+EAOA,IAAaA,GAAiB,IAAA,CAAxB,MAAOA,CAAiB,CAD9BC,aAAA,CAEE,KAAAC,KAAOC,EAAOC,CAAU,EAChB,KAAAC,iBAAmBF,EAAOG,CAAgB,EAC1C,KAAAC,sBAAwBJ,EAAOK,CAAqB,EAE5DC,yBACEC,EACAC,EACAC,EACAC,EACAC,EAAmB,CAEnB,IAAMC,EACJ,KAAKV,iBAAiBW,aAAY,EAClC,cACA,KAAKX,iBACFY,mBAAmB,CAClB,CAAC,YAAa,KAAKZ,iBAAiBa,+BAA+BR,CAAS,CAAC,EAC7E,CAAC,UAAW,KAAKL,iBAAiBa,+BAA+BP,CAAO,CAAC,EACzE,CAAC,SAAU,KAAKJ,sBAAsBY,kBAAiB,CAAE,EACzD,CAAC,OAAQP,CAAI,EACb,CAAC,WAAYC,CAAQ,EACrB,CAAC,aAAcC,CAAU,CAAC,CAC3B,EACAM,SAAQ,EACPC,EAAU,IAAIC,EAAY,CAAEC,OAAQ,UAAU,CAAE,EACtD,OAAO,KAAKrB,KAAKsB,IAAIT,EAAK,CAAEM,QAAAA,EAASI,aAAc,MAAM,CAAE,CAC7D,CAEAC,6BAA6BhB,EAAiBC,EAAa,CACzD,IAAMI,EACJ,KAAKV,iBAAiBW,aAAY,EAClC,6BACA,KAAKX,iBACFY,mBAAmB,CAClB,CAAC,YAAa,KAAKZ,iBAAiBa,+BAA+BR,CAAS,CAAC,EAC7E,CAAC,UAAW,KAAKL,iBAAiBa,+BAA+BP,CAAO,CAAC,CAAC,CAC3E,EACAS,SAAQ,EACPC,EAAU,IAAIC,EAAY,CAAEC,OAAQ,UAAU,CAAE,EACtD,OAAO,KAAKrB,KAAKsB,IAAIT,EAAK,CAAEM,QAAAA,EAASI,aAAc,MAAM,CAAE,CAC7D,iDAzCWzB,EAAiB,CAAA,iCAAjBA,EAAiB2B,QAAjB3B,EAAiB4B,SAAA,CAAA,CAAA,SAAjB5B,CAAiB,GAAA", "names": ["StatisticsService", "constructor", "http", "inject", "HttpClient", "constantsService", "ConstantsService", "authenticationService", "AuthenticationService", "getBulletinStatisticsCsv", "startDate", "endDate", "lang", "extended", "duplicates", "url", "getServerUrl", "createSearchParams", "getISOStringWithTimezoneOffset", "getActiveRegionId", "toString", "headers", "HttpHeaders", "Accept", "get", "responseType", "getDangerSourceStatisticsCsv", "factory", "\u0275fac"] }