{"version":3,"file":"chunk-ijrvrtui.js","sources":["packages/vanilla/lib/features/flags/src/flags.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { WindowRef } from '@frontend/vanilla/core';\nimport { Observable, of } from 'rxjs';\n\n/**\n * @whatItDoes Provides functionality to fetch flags based on culture route value.\n *\n * @stable\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class FlagsService {\n get flags() {\n const iconsData: any = this.windowRef.nativeWindow.clientConfig;\n return iconsData.vnIcons.iconItems?.filter((x: any) => x.iconName.includes('-flag'));\n }\n /** Gets all available items. */\n get available(): Observable<{ [key: string]: string | null }> {\n return this.flags.length > 0 ? of(this.flags) : of([]);\n }\n constructor(private windowRef: WindowRef) {}\n\n /** Finds flag image by key. */\n find(routeValue: string): Observable {\n const imageUrl = this.flags?.find((x: any) => x.iconName === `${routeValue}-flag`)?.imageUrl;\n return imageUrl ? of(imageUrl) : of('');\n }\n}\n"],"names":["FlagsService","flags","windowRef","nativeWindow","clientConfig","vnIcons","iconItems","filter","x","iconName","includes","available","length","of","constructor","find","routeValue","imageUrl","ɵɵinject","WindowRef","factory","ɵfac","providedIn","_FlagsService"],"mappings":"uDAaaA,IAAAA,CAAAA,CAAAA,CAAY,IAAA,CAAnB,IAAOA,EAAP,MAAOA,CAAY,CACrB,IAAIC,KAAAA,EAAK,CAEL,OADuB,IAAA,CAAKC,UAAUC,YAAaC,CAAAA,YAAAA,CAClCC,QAAQC,SAAWC,EAAAA,MAAAA,CAAQC,GAAWA,CAAEC,CAAAA,QAAAA,CAASC,SAAS,OAAO,CAAC,CACvF,CAEA,IAAIC,WAAS,CACT,OAAO,KAAKV,KAAMW,CAAAA,MAAAA,CAAS,EAAIC,EAAG,CAAA,IAAA,CAAKZ,KAAK,CAAIY,CAAAA,EAAAA,CAAG,EAAE,CACzD,CACAC,WAAAA,CAAoBZ,CAAoB,CAAA,CAApB,KAAAA,SAAAA,CAAAA,EAAuB,CAG3Ca,IAAKC,CAAAA,CAAAA,CAAkB,CACnB,IAAMC,CAAAA,CAAW,KAAKhB,KAAOc,EAAAA,IAAAA,CAAMP,GAAWA,CAAEC,CAAAA,QAAAA,GAAa,GAAGO,CAAU,CAAA,KAAA,CAAO,GAAGC,QACpF,CAAA,OAAOA,EAAWJ,EAAGI,CAAAA,CAAQ,EAAIJ,EAAG,CAAA,EAAE,CAC1C,CAfSb,CAAAA,CAAAA,CAAAA,CAAAA,SAAAA,CAAAA,SAAAA,CAAAA,CAAAA,CAAAA,OAAAA,IAAAA,CAAAA,EAAAA,CAAAA,EAAYkB,EAAAC,CAAA,CAAA,CAAA,CAAZnB,CAAAA,CAAAA,CAAAA,UAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAYoB,QAAZpB,CAAYqB,CAAAA,SAAAA,CAAAC,WAFT,MAAM,CAAA,EAEhB,IAAOtB,CAAAA,CAAPuB,CAAOvB,CAAAA,OAAAA,CAAY,CAAA"}