{ "version": 3, "sources": ["src/app/modelling/qfa/dust.service.ts", "src/app/modelling/qfa/filenames.service.ts", "src/app/modelling/qfa/param.service.ts", "src/app/modelling/qfa/qfa-file.model.ts", "src/app/modelling/qfa/qfa.service.ts"], "sourcesContent": ["import { Injectable, inject } from \"@angular/core\";\nimport { HttpClient, HttpHeaders } from \"@angular/common/http\";\n\nenum Cities {\n INNSBRUCK = \"innsbruck\",\n BOZEN = \"bozen\",\n LIENZ = \"lienz\",\n}\n\ntype DustParams = Partial[]>>;\n\n@Injectable()\nexport class GetDustParamService {\n private http = inject(HttpClient);\n\n private pxOfCity = {\n bozen: {\n x: 278,\n y: 170,\n },\n innsbruck: {\n x: 275,\n y: 164,\n },\n lienz: {\n x: 285,\n y: 162,\n },\n };\n\n private colorToDust = {\n \"rgb(255,255,255)\": \"-\",\n \"rgb(238,229,204)\": \"1-10\",\n \"rgb(233,214,170)\": \"10-25\",\n \"rgb(233,187,146)\": \"25-50\",\n \"rgb(217,172,137)\": \"50-100\",\n \"rgb(217,146,113)\": \"100-500\",\n \"rgb(202,126,113)\": \"500-1000\",\n \"rgb(202,102,80)\": \">1000\",\n };\n\n private rgbToHex = {\n \"rgb(255,255,255)\": \"#FFFFFF\",\n \"rgb(238,229,204)\": \"#EEE5CC\",\n \"rgb(233,214,170)\": \"#E9D6AA\",\n \"rgb(233,187,146)\": \"#E9BB92\",\n \"rgb(217,172,137)\": \"#D9AC89\",\n \"rgb(217,146,113)\": \"#D99271\",\n \"rgb(202,126,113)\": \"#CA7E71\",\n \"rgb(202,102,80)\": \"#CA6650\",\n };\n\n private readonly URL = \"https://admin.avalanche.report/forecast.uoa.gr/0day/DUST/GRID1/zoomdload/%d.zoomdload.png\";\n\n private loadForecast = (time: number): Promise => {\n const paddedNumber = time.toString().padStart(3, \"0\");\n const url = this.URL.replace(\"%d\", paddedNumber);\n const headers = new HttpHeaders({\n Accept: \"image/avif,image/webp,*/*\",\n });\n const response = this.http.get(url, {\n responseType: \"blob\",\n observe: \"body\",\n headers: headers,\n });\n\n return response.toPromise();\n };\n\n private createImageFromBlob = (blob: Blob): Promise => {\n return new Promise((resolve) => {\n const objectURL = URL.createObjectURL(blob);\n const img = new Image();\n img.src = objectURL;\n img.onload = () => resolve(img);\n });\n };\n\n private getColorFromPx = (image: HTMLImageElement, x: number, y: number): Promise => {\n return new Promise((resolve) => {\n const canvas = document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = 1;\n canvas.getContext(\"2d\")?.drawImage(image, x, y, 1, 1, 0, 0, 1, 1);\n const rgba = [...(canvas.getContext(\"2d\")?.getImageData(0, 0, 1, 1).data ?? [])];\n rgba.pop();\n resolve(rgba);\n });\n };\n\n private getDustFromColor = (rgb: number[]): Promise => {\n return new Promise((resolve) => {\n const colorStr = `rgb(${rgb[0]},${rgb[1]},${rgb[2]})`;\n resolve(this.colorToDust[colorStr] ? this.colorToDust[colorStr] : \"-\");\n });\n };\n\n public dustToColor = (dust: string) => {\n const rgb = Object.entries(this.colorToDust).reduce((ret, entry) => {\n const [key, value] = entry;\n ret[value] = key;\n return ret;\n }, {});\n const hex = this.rgbToHex[rgb[dust]];\n return hex;\n };\n\n private getParamsForCity = (city: string): Promise[] => {\n const nSteps = 35;\n const promises = [];\n\n const px = this.pxOfCity[city];\n\n for (let i = 0; i <= nSteps * 6; i += 6) {\n const imageBlobPromise = this.loadForecast(i);\n const dustPromise = imageBlobPromise\n .then((blob) => this.createImageFromBlob(blob))\n .then((image) => this.getColorFromPx(image, px.x, px.y))\n .then((rgb) => this.getDustFromColor(rgb))\n .catch((error) => {\n return new Promise((resolve) => {\n resolve(\"-\");\n });\n });\n\n promises.push(dustPromise);\n }\n\n return promises;\n };\n\n public getDustParams = (): DustParams => {\n const dustParams: DustParams = {};\n for (const city of Object.keys(this.pxOfCity)) {\n const promises = this.getParamsForCity(city);\n dustParams[city] = promises;\n }\n return dustParams;\n };\n\n public parseDustParams = async () => {\n const promises = this.getDustParams();\n const dustForCity = {};\n for (const key of Object.keys(promises)) {\n const values = await Promise.all(promises[key]);\n const runs = [];\n while (values.length) runs.push(values.splice(0, 12));\n for (let i = 0; i < runs.length; i++) {\n const days = [];\n while (runs[i].length) {\n const day = runs[i].splice(0, 4);\n const parsedDay = {\n \"00\": day[0],\n \"06\": day[1],\n \"12\": day[2],\n \"18\": day[3],\n };\n days.push(parsedDay);\n }\n runs[i] = days;\n }\n dustForCity[key] = runs;\n }\n\n return dustForCity;\n };\n}\n", "import { Injectable, inject } from \"@angular/core\";\n\nimport { HttpClient } from \"@angular/common/http\";\n\nexport interface CaddyListingItem {\n name: string;\n size: number;\n url: string;\n mod_time: Date;\n mode: number;\n is_dir: boolean;\n is_symlink: boolean;\n}\n\ninterface File {\n date: string;\n hours: string;\n minutes: string;\n startDay: string;\n endDay: string;\n city: string;\n qfa: string;\n filename: string;\n}\n\n@Injectable()\nexport class GetFilenamesService {\n private http = inject(HttpClient);\n\n private baseUrl = \"https://static.avalanche.report/zamg_qfa\";\n\n private getHTMLResponse() {\n // Caddy serves directory index as JSON for Accept=application/json\n // https://github.com/caddyserver/caddy/blob/e8ad9b32c9730ddb162b6fb1443fc0b36fcef7dc/modules/caddyhttp/fileserver/browse.go#L105-L109\n return this.http.get(this.baseUrl, {\n observe: \"body\",\n });\n }\n\n public getFilenames = async (baseUrl: string, city: string) => {\n this.baseUrl = baseUrl;\n const response = await this.getHTMLResponse().toPromise();\n const files = response.reverse();\n // console.log(files);\n const filteredFiles = files.filter((file) => file.name.includes(city));\n return filteredFiles;\n };\n\n public parseFilename = (filename: string): File => {\n const parts = filename.split(\"_\");\n return {\n date: parts[0],\n hours: parts[1].substring(0, 2),\n minutes: parts[1].substring(2, 4),\n startDay: parts[4].substring(0, 2),\n endDay: parts[4].substring(2, 4),\n city: parts[3],\n qfa: parts[2],\n filename: filename,\n };\n };\n\n public stringifyFile = (file: File): string => {\n return `${file.date}_${file.hours}${file.minutes}_${file.qfa}_${file.city}_${file.startDay}${file.endDay}.txt`;\n };\n\n public changeDay = (file: File, startDay: string, endDay: string): File => {\n file.startDay = startDay;\n file.endDay = endDay;\n file.filename = this.stringifyFile(file);\n return file;\n };\n\n public getCityName = (files: File[]): string | void => {\n if (files.length) {\n const name = files[0].city.charAt(0).toUpperCase() + files[0].city.slice(1);\n return name;\n }\n };\n}\n", "import { Injectable, inject } from \"@angular/core\";\nimport { TranslateService } from \"@ngx-translate/core\";\n\n@Injectable()\nexport class ParamService {\n private translateService = inject(TranslateService);\n\n parameterClasses = {};\n\n public setParameterClasses(parameters: string[]) {\n for (const param of parameters) {\n this.parameterClasses[param] = param\n .replace(\"--\", \"_\")\n .replace(\" -\", \"_\")\n .replace(\" cm\", \"\")\n .replace(\" --\", \"\")\n .replace(\" s\", \"\")\n .replace(\"-\", \"_\")\n .replace(\".\", \"_\")\n .replace(\" \", \"_\");\n }\n }\n\n public getCellClass(param: string, value: string): string {\n let params = [\"N\", \"Nh\", \"Nm\", \"Nl\", \"N_CU\"];\n if (params.includes(this.parameterClasses[param])) {\n const parsedVal = Number(value);\n if (parsedVal >= 7) return \"darkest\";\n if (parsedVal >= 5) return \"darker\";\n if (parsedVal >= 3) return \"dark\";\n if (parsedVal == 0) return \"opacity-0\";\n }\n\n params = [\"RF_300\", \"RF_400\", \"RF_500\", \"RF_700\", \"RF_850\", \"RF_925\"];\n if (params.includes(this.parameterClasses[param])) {\n const parsedVal = Number(value);\n if (parsedVal >= 90) return \"darkest\";\n if (parsedVal >= 80) return \"darker\";\n if (parsedVal >= 70) return \"dark\";\n }\n\n params = [\"WX_CUF\"];\n if (params.includes(this.parameterClasses[param])) {\n if (value === \"NIL\") return \"opacity-0\";\n if (value === \"TS\") return \"yellow\";\n if (value === \"XXTS\") return \"orange\";\n }\n\n params = [\"SN_RA\"];\n if (params.includes(this.parameterClasses[param])) {\n const parsedVal = Number(value);\n if (parsedVal <= 1000) return \"sn-rf-color\";\n }\n\n params = [\"RR, RR_24h, SN\"];\n if (params.includes(this.parameterClasses[param])) {\n if (value === \"0.0\" || value === \"---\") return \"opacity-0\";\n }\n\n params = [\"QANmax\"];\n if (params.includes(this.parameterClasses[param])) {\n const parsedVal = Number(value);\n if (parsedVal >= 15) return \"orange\";\n }\n\n return \"\";\n }\n\n public getWParam(value: string): string {\n const parsedVal = Number(value);\n if (parsedVal <= -1000) return `-----${value}`;\n if (parsedVal <= -25) return `---${value}`;\n if (parsedVal <= -9) return `--${value}`;\n if (parsedVal <= -3) return `-${value}`;\n if (parsedVal <= 3) return value;\n if (parsedVal <= 15) return `+${value}`;\n if (parsedVal <= 30) return `++${value}`;\n if (parsedVal <= 100) return `+++${value}`;\n return `++++${value}`;\n }\n\n public getFullName(abbreviation: string): string {\n const match = abbreviation.match(/\\d{3,4}/g);\n if (match) {\n return this.translateService.instant(`qfa.parameters.${abbreviation.replace(match.join(\"\"), \"\")}`, {\n value: match,\n });\n }\n return this.translateService.instant(`qfa.parameters.${abbreviation}`);\n }\n}\n", "import * as types from \"./qfa-types\";\n\nimport { HttpClient } from \"@angular/common/http\";\n\nexport class QfaFile implements types.QFA {\n public metadata = {} as types.metadata;\n public parameters = {} as types.parameters;\n\n constructor(private http: HttpClient) {}\n\n get data(): types.data {\n return {\n metadata: this.metadata,\n parameters: this.parameters,\n };\n }\n\n get coordinates() {\n return this.metadata.coords;\n }\n\n get height() {\n return this.metadata.height;\n }\n\n get date() {\n const date = new Intl.DateTimeFormat(\"de\", {\n weekday: \"short\",\n day: \"2-digit\",\n month: \"long\",\n year: \"numeric\",\n timeZone: \"UTC\",\n timeZoneName: \"short\",\n });\n const stringDate = date.format(this.metadata.date).replace(/\\./, \"\").replace(\" um\", \",\");\n return stringDate;\n }\n\n get paramDates() {\n const intlDates = this.metadata.dates.map((date) =>\n new Intl.DateTimeFormat(\"de\", {\n weekday: \"short\",\n day: \"2-digit\",\n month: \"long\",\n timeZone: \"UTC\",\n }).format(date),\n );\n\n const prettyDates = intlDates.map((date) => date.replace(/\\./, \"\"));\n\n return prettyDates;\n }\n\n public listParameters() {\n return Object.keys(this.parameters);\n }\n\n private getHTMLFile = (url: string) => {\n return this.http.get(url, {\n responseType: \"text\",\n observe: \"body\",\n });\n };\n\n public loadFromURL = async (url: string) => {\n const fullUrl = `https://static.avalanche.report/zamg_qfa/${url}`;\n const response = (await this.getHTMLFile(fullUrl).toPromise()) as string;\n this.parseText(response);\n // console.log(this.data);\n return;\n };\n\n private parseMetaData = (plainText: string): types.metadata => {\n const plainMetadata = plainText.split(\n \"=======================================================================================\",\n )[0];\n const data = plainMetadata.split(/[\\s]{2,}/g);\n\n const days = data[9].match(/\\d/g);\n const nDays = Number(days![1]) - Number(days![0] || 0) + 1;\n const date = this.parseDate(data[6]);\n\n const parameters: types.metadata = {\n location: data[1],\n coords: {\n lng: Number(data[2]),\n lat: Number(data[3]),\n },\n height: Number(data[4]),\n orog: Number(data[5].match(/[\\d]+/g)),\n date: date,\n timezone: data[7].split(\" \")[1],\n model: data[8],\n nDays: nDays,\n };\n return parameters;\n };\n\n private parseDate = (date: string): Date => {\n const months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"];\n const day = Number(date.match(/[\\d]+/));\n const month = months.filter((month) => date.includes(month))[0];\n const year = Number(date.match(/[\\d]{4}/));\n const parameters = new Date(Date.UTC(year, months.indexOf(month), day));\n return parameters;\n };\n\n private parseParameters = (plainText: string): types.parameters => {\n let data = plainText.split(\n \"=======================================================================================\",\n )[1];\n data = data.replace(\"=\", \"\");\n // data = data.replace(/[\\s]{2,}/g, \" \");\n data = data.replace(/[-]{5,}\\|/g, \"\");\n const allLines = data.split(\"\\n\");\n const plainDates = allLines[1].split(\" |\");\n this.metadata.dates = [this.parseDate(plainDates[1]), this.parseDate(plainDates[2]), this.parseDate(plainDates[3])];\n const dateStrings = this.metadata.dates.map((el) => el.toISOString().split(\"T\")[0]);\n const lines = allLines.filter((el, i) => el !== \"\" && i > 3);\n\n const parameters = {} as types.parameters;\n for (const line of lines) {\n let sub = line.substring(0, line.length - 2);\n sub = sub.replace(/[\\s]{24,}/g, \" --- --- --- --- \");\n sub = sub.replace(/[\\s]{18,}/g, \" --- --- ---\");\n sub = sub.replace(/[\\s]{12,}/g, \" --- --- \");\n sub = sub.replace(/[\\s]{6,}/g, \" --- \");\n sub = sub.replace(/[\\s]+/g, \" \");\n // console.log(sub);\n const cols = sub.split(\" | \");\n // console.log(cols);\n\n const partial = [];\n for (const strKey of Object.keys(dateStrings)) {\n // console.log(key, value)\n const key = parseInt(strKey) + 1;\n // console.log(key);\n partial.push({\n \"00\": cols[key].split(\" \")[0],\n \"06\": cols[key].split(\" \")[1],\n \"12\": cols[key].split(\" \")[2],\n \"18\": cols[key].split(\" \")[3],\n });\n }\n const parameterName = cols[0].split(\" ---\")[0];\n parameters[parameterName] = partial;\n }\n\n return parameters;\n };\n\n private parseText = (plainText: string) => {\n this.metadata = this.parseMetaData(plainText);\n this.parameters = this.parseParameters(plainText);\n };\n}\n", "import { Injectable, inject } from \"@angular/core\";\nimport { HttpClient } from \"@angular/common/http\";\nimport * as types from \"./qfa-types\";\nimport { QfaFile } from \"./qfa-file.model\";\nimport { GetFilenamesService } from \"./filenames.service\";\nimport { GetDustParamService } from \"./dust.service\";\nimport { ParamService } from \"./param.service\";\n\nexport interface QfaResult {\n data: types.data;\n date: string;\n dates: string[];\n parameters: string[];\n file: any;\n}\n\n@Injectable()\nexport class QfaService {\n filenamesService = inject(GetFilenamesService);\n dustParamService = inject(GetDustParamService);\n paramService = inject(ParamService);\n private http = inject(HttpClient);\n\n baseUrl = \"https://static.avalanche.report/zamg_qfa/\";\n dustParams = {};\n coords = {\n bozen: {\n lng: 11.33,\n lat: 46.47,\n },\n innsbruck: {\n lng: 11.35,\n lat: 47.27,\n },\n lienz: {\n lng: 12.8,\n lat: 46.83,\n },\n };\n files = {\n innsbruck: [],\n bozen: [],\n lienz: [],\n };\n cities = Object.keys(this.files);\n\n async loadDustParams() {\n this.dustParams = await this.dustParamService.parseDustParams();\n }\n\n async getFiles() {\n for (const city of this.cities) {\n const filenames = await this.filenamesService.getFilenames(this.baseUrl, city);\n const parsedFiles = [];\n for (const file of filenames) {\n const parsedFile = this.filenamesService.parseFilename(file.name);\n parsedFiles.push(parsedFile);\n }\n this.files[city] = parsedFiles.filter((el) => el.startDay === \"00\");\n }\n\n return this.files;\n }\n\n async getRun(file, startDay: number, first: boolean): Promise {\n const days = `0${startDay}0${startDay + 2}`;\n const filename = file.filename.replace(/\\d{4}\\.txt/g, `${days}.txt`);\n const run = new QfaFile(this.http);\n await run.loadFromURL(filename);\n\n const parameters = Object.keys(run.data.parameters);\n\n if (first) {\n const city = run.data.metadata.location.split(\" \")[2].toLowerCase();\n if (this.dustParams) {\n const dust = this.dustParams[city][startDay / 3];\n run.data.parameters[\"DUST\"] = dust;\n parameters.unshift(\"DUST\");\n }\n }\n\n const qfa = {\n data: run.data,\n date: run.date,\n dates: run.paramDates,\n parameters: parameters,\n file: file,\n };\n\n return qfa;\n }\n}\n"], "mappings": "+GAYA,IAAaA,GAAmB,IAAA,CAA1B,MAAOA,CAAmB,CADhCC,aAAA,CAEU,KAAAC,KAAOC,EAAOC,CAAU,EAExB,KAAAC,SAAW,CACjBC,MAAO,CACLC,EAAG,IACHC,EAAG,KAELC,UAAW,CACTF,EAAG,IACHC,EAAG,KAELE,MAAO,CACLH,EAAG,IACHC,EAAG,MAIC,KAAAG,YAAc,CACpB,mBAAoB,IACpB,mBAAoB,OACpB,mBAAoB,QACpB,mBAAoB,QACpB,mBAAoB,SACpB,mBAAoB,UACpB,mBAAoB,WACpB,kBAAmB,SAGb,KAAAC,SAAW,CACjB,mBAAoB,UACpB,mBAAoB,UACpB,mBAAoB,UACpB,mBAAoB,UACpB,mBAAoB,UACpB,mBAAoB,UACpB,mBAAoB,UACpB,kBAAmB,WAGJ,KAAAC,IAAM,4FAEf,KAAAC,aAAgBC,GAA+B,CACrD,IAAMC,EAAeD,EAAKE,SAAQ,EAAG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AIG,EAAYM,OAAQC,GAAOA,EAAGC,WAAa,IAAI,CACpE,CAEA,OAAO,KAAKnB,KACd,GAEMoB,OAAOR,EAAMO,EAAkBE,EAAc,QAAAhB,EAAA,sBACjD,IAAMiB,EAAO,IAAIH,CAAQ,IAAIA,EAAW,CAAC,GACnCI,EAAWX,EAAKW,SAASC,QAAQ,cAAe,GAAGF,CAAI,MAAM,EAC7DG,EAAM,IAAIC,EAAQ,KAAKpC,IAAI,EACjC,MAAMmC,EAAIE,YAAYJ,CAAQ,EAE9B,IAAMK,EAAa1B,OAAOC,KAAKsB,EAAII,KAAKD,UAAU,EAElD,GAAIP,EAAO,CACT,IAAMb,EAAOiB,EAAII,KAAKC,SAASC,SAASC,MAAM,GAAG,EAAE,CAAC,EAAEC,YAAW,EACjE,GAAI,KAAKxC,WAAY,CACnB,IAAMyC,EAAO,KAAKzC,WAAWe,CAAI,EAAEW,EAAW,CAAC,EAC/CM,EAAII,KAAKD,WAAW,KAAUM,EAC9BN,EAAWO,QAAQ,MAAM,CAC3B,CACF,CAUA,MARY,CACVN,KAAMJ,EAAII,KACVO,KAAMX,EAAIW,KACVC,MAAOZ,EAAIa,WACXV,WAAYA,EACZhB,KAAMA,EAIV,mDAzEW/B,EAAU,CAAA,iCAAVA,EAAU0D,QAAV1D,EAAU2D,SAAA,CAAA,CAAA,SAAV3D,CAAU,GAAA", "names": ["GetDustParamService", "constructor", "http", "inject", "HttpClient", "pxOfCity", "bozen", "x", "y", "innsbruck", "lienz", "colorToDust", "rgbToHex", "URL", "loadForecast", "time", "paddedNumber", "toString", "padStart", "url", "replace", "headers", "HttpHeaders", "Accept", "get", "responseType", "observe", "toPromise", "createImageFromBlob", "blob", "Promise", "resolve", "objectURL", "createObjectURL", "img", "Image", "src", "onload", "getColorFromPx", "image", "canvas", "document", "createElement", "width", "height", "getContext", "drawImage", "rgba", "getImageData", "data", "pop", "getDustFromColor", "rgb", "colorStr", "dustToColor", "dust", "Object", "entries", "reduce", "ret", "entry", "key", "value", "getParamsForCity", "city", "promises", "px", "i", "nSteps", "dustPromise", "then", "catch", "error", "push", "getDustParams", "dustParams", "keys", "parseDustParams", "__async", "dustForCity", "values", "all", "runs", "length", "splice", "days", "day", "parsedDay", "factory", "\u0275fac", "GetFilenamesService", "constructor", "http", "inject", "HttpClient", "baseUrl", "getFilenames", "city", "__async", "getHTMLResponse", "toPromise", "reverse", "filter", "file", "name", "includes", "parseFilename", "filename", "parts", "split", "date", "hours", "substring", "minutes", "startDay", "endDay", "qfa", "stringifyFile", "changeDay", "getCityName", "files", "length", "charAt", "toUpperCase", "slice", "get", "observe", "factory", "\u0275fac", "ParamService", "constructor", "translateService", "inject", "TranslateService", "parameterClasses", "setParameterClasses", "parameters", "param", "replace", "getCellClass", "value", "params", "includes", "parsedVal", "Number", "getWParam", "getFullName", "abbreviation", "match", "instant", "join", "factory", "\u0275fac", "QfaFile", "constructor", "http", "metadata", "parameters", "getHTMLFile", "url", "get", "responseType", "observe", "loadFromURL", "__async", "fullUrl", "response", "toPromise", "parseText", "parseMetaData", "plainText", "data", "split", "days", "match", "nDays", "Number", "date", "parseDate", "location", "coords", "lng", "lat", "height", "orog", "timezone", "model", "months", "day", "month", "filter", "includes", "year", "Date", "UTC", "indexOf", "parseParameters", "replace", "allLines", "plainDates", "dates", "dateStrings", "map", "el", "toISOString", "lines", "i", "line", "sub", "substring", "length", "cols", "partial", "strKey", "Object", "keys", "key", "parseInt", "push", "parameterName", "coordinates", "Intl", "DateTimeFormat", "weekday", "timeZone", "timeZoneName", "format", "paramDates", "listParameters", "QfaService", "constructor", "filenamesService", "inject", "GetFilenamesService", "dustParamService", "GetDustParamService", "paramService", "ParamService", "http", "HttpClient", "baseUrl", "dustParams", "coords", "bozen", "lng", "lat", "innsbruck", "lienz", "files", "cities", "Object", "keys", "loadDustParams", "__async", "parseDustParams", "getFiles", "city", "filenames", "getFilenames", "parsedFiles", "file", "parsedFile", "parseFilename", "name", "push", "filter", "el", "startDay", "getRun", "first", "days", "filename", "replace", "run", "QfaFile", "loadFromURL", "parameters", "data", "metadata", "location", "split", "toLowerCase", "dust", "unshift", "date", "dates", "paramDates", "factory", "\u0275fac"] }