{ "version": 3, "sources": ["src/app/_pipes/age-rating.pipe.ts"], "sourcesContent": ["import {inject, Pipe, PipeTransform} from '@angular/core';\r\nimport { Observable, of } from 'rxjs';\r\nimport { AgeRating } from '../_models/metadata/age-rating';\r\nimport { AgeRatingDto } from '../_models/metadata/age-rating-dto';\r\nimport {TranslocoService} from \"@jsverse/transloco\";\r\n\r\n@Pipe({\r\n name: 'ageRating',\r\n standalone: true\r\n})\r\nexport class AgeRatingPipe implements PipeTransform {\r\n\r\n translocoService = inject(TranslocoService);\r\n\r\n transform(value: AgeRating | AgeRatingDto | undefined): Observable {\r\n if (value === undefined || value === null) return of(this.translocoService.translate('age-rating-pipe.unknown') as string);\r\n\r\n if (value.hasOwnProperty('title')) {\r\n return of((value as AgeRatingDto).title);\r\n }\r\n\r\n switch (value) {\r\n case AgeRating.Unknown:\r\n return this.translocoService.translate('age-rating-pipe.unknown');\r\n case AgeRating.EarlyChildhood:\r\n return this.translocoService.translate('age-rating-pipe.early-childhood');\r\n case AgeRating.AdultsOnly:\r\n return this.translocoService.translate('age-rating-pipe.adults-only');\r\n case AgeRating.Everyone:\r\n return this.translocoService.translate('age-rating-pipe.everyone');\r\n case AgeRating.Everyone10Plus:\r\n return this.translocoService.translate('age-rating-pipe.everyone-10-plus');\r\n case AgeRating.G:\r\n return this.translocoService.translate('age-rating-pipe.g');\r\n case AgeRating.KidsToAdults:\r\n return this.translocoService.translate('age-rating-pipe.kids-to-adults');\r\n case AgeRating.Mature:\r\n return this.translocoService.translate('age-rating-pipe.mature');\r\n case AgeRating.Mature15Plus:\r\n return this.translocoService.translate('age-rating-pipe.ma15-plus');\r\n case AgeRating.Mature17Plus:\r\n return this.translocoService.translate('age-rating-pipe.mature-17-plus');\r\n case AgeRating.RatingPending:\r\n return this.translocoService.translate('age-rating-pipe.rating-pending');\r\n case AgeRating.Teen:\r\n return this.translocoService.translate('age-rating-pipe.teen');\r\n case AgeRating.X18Plus:\r\n return this.translocoService.translate('age-rating-pipe.x18-plus');\r\n case AgeRating.NotApplicable:\r\n return this.translocoService.translate('age-rating-pipe.not-applicable');\r\n case AgeRating.PG:\r\n return this.translocoService.translate('age-rating-pipe.pg');\r\n case AgeRating.R18Plus:\r\n return this.translocoService.translate('age-rating-pipe.r18-plus');\r\n }\r\n\r\n return of(this.translocoService.translate('age-rating-pipe.unknown') as string);\r\n }\r\n\r\n}\r\n"], "mappings": "wGAUA,IAAaA,GAAa,IAAA,CAApB,MAAOA,CAAa,CAJ1BC,aAAA,CAME,KAAAC,iBAAmBC,EAAOC,CAAgB,EAE1CC,UAAUC,EAA2C,CACnD,GAA2BA,GAAU,KAAM,OAAOC,EAAG,KAAKL,iBAAiBM,UAAU,yBAAyB,CAAW,EAEzH,GAAIF,EAAMG,eAAe,OAAO,EAC9B,OAAOF,EAAID,EAAuBI,KAAK,EAGzC,OAAQJ,EAAK,CACX,KAAKK,EAAUC,QACb,OAAO,KAAKV,iBAAiBM,UAAU,yBAAyB,EAClE,KAAKG,EAAUE,eACb,OAAO,KAAKX,iBAAiBM,UAAU,iCAAiC,EAC1E,KAAKG,EAAUG,WACb,OAAO,KAAKZ,iBAAiBM,UAAU,6BAA6B,EACtE,KAAKG,EAAUI,SACb,OAAO,KAAKb,iBAAiBM,UAAU,0BAA0B,EACnE,KAAKG,EAAUK,eACb,OAAO,KAAKd,iBAAiBM,UAAU,kCAAkC,EAC3E,KAAKG,EAAUM,EACb,OAAO,KAAKf,iBAAiBM,UAAU,mBAAmB,EAC5D,KAAKG,EAAUO,aACb,OAAO,KAAKhB,iBAAiBM,UAAU,gCAAgC,EACzE,KAAKG,EAAUQ,OACb,OAAO,KAAKjB,iBAAiBM,UAAU,wBAAwB,EACjE,KAAKG,EAAUS,aACb,OAAO,KAAKlB,iBAAiBM,UAAU,2BAA2B,EACpE,KAAKG,EAAUU,aACb,OAAO,KAAKnB,iBAAiBM,UAAU,gCAAgC,EACzE,KAAKG,EAAUW,cACb,OAAO,KAAKpB,iBAAiBM,UAAU,gCAAgC,EACzE,KAAKG,EAAUY,KACb,OAAO,KAAKrB,iBAAiBM,UAAU,sBAAsB,EAC/D,KAAKG,EAAUa,QACb,OAAO,KAAKtB,iBAAiBM,UAAU,0BAA0B,EACnE,KAAKG,EAAUc,cACb,OAAO,KAAKvB,iBAAiBM,UAAU,gCAAgC,EACzE,KAAKG,EAAUe,GACb,OAAO,KAAKxB,iBAAiBM,UAAU,oBAAoB,EAC7D,KAAKG,EAAUgB,QACb,OAAO,KAAKzB,iBAAiBM,UAAU,0BAA0B,CACrE,CAEA,OAAOD,EAAG,KAAKL,iBAAiBM,UAAU,yBAAyB,CAAW,CAChF,iDA/CWR,EAAa,CAAA,iDAAbA,EAAa4B,KAAA,GAAAC,WAAA,EAAA,CAAA,CAAA,SAAb7B,CAAa,GAAA", "names": ["AgeRatingPipe", "constructor", "translocoService", "inject", "TranslocoService", "transform", "value", "of", "translate", "hasOwnProperty", "title", "AgeRating", "Unknown", "EarlyChildhood", "AdultsOnly", "Everyone", "Everyone10Plus", "G", "KidsToAdults", "Mature", "Mature15Plus", "Mature17Plus", "RatingPending", "Teen", "X18Plus", "NotApplicable", "PG", "R18Plus", "pure", "standalone"] }