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AV,QAAAQ,EAAAI","names":["Link","LinkData","LinkModel","SitemapComponent","_SitemapComponent","AndroWebCoreComponent","constructor","navigatorService","router","siteService","super","this","keywords","occasions","linkModel","localAreas","_b","_a","tenant","PageSeos","Keywords","split","map","Function","prototype","call","String","trim","trackTrace","SeverityLevel","Error","navigate","generateHomePath","ngOnInit","document","getElementById","scrollIntoView","subscriptions$","getSites","subscribe","sites","forEach","site","LocalAreas","localArea","push","OccasionsSupported","concat","generateLinks","currentLinks","i","length","occasionType","OrderOccasion","Collection","TakeAway","Delivery","linkData","j","sector","toTitleCase","clean","join","links","k","link","description","formatDescriptionLocation","area","Key","input","outcode","pop","toUpperCase","Name","__decorate","Component","selector","template","__metadata","NavigatorService","Router","SiteService","routes","path","component","SitemapRoutingModule","NgModule","imports","RouterModule","forChild","exports","SitemapModule","declarations","CommonModule","ReactiveFormsModule","SharedComponentsModule","___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___","__webpack_require__","___CSS_LOADER_EXPORT___","___CSS_LOADER_API_IMPORT___","module","id","toString"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./src/app/models/sitemap/link.ts","./src/app/models/sitemap/link-data.ts","./src/app/models/sitemap/link-model.ts","./src/app/modules/sitemap/sitemap.component.ts","./src/app/modules/sitemap/sitemap-routing.module.ts","./src/app/modules/sitemap/sitemap.module.ts","./src/app/modules/sitemap/sitemap.component.scss"],"sourcesContent":["/**\r\n * The actual link meta data\r\n * @export\r\n * @class Link\r\n */\r\nexport class Link {\r\n description: string;\r\n outcode: string;\r\n area: string;\r\n}\r\n","import { Link } from '@app/models/sitemap/link';\r\n\r\n/**\r\n * Handles the link data to be clicked on\r\n * @export\r\n * @class LinkData\r\n */\r\nexport class LinkData {\r\n sector: string;\r\n links: Link[];\r\n}\r\n","import { LinkData } from '@app/models/sitemap/link-data';\r\n\r\n/**\r\n * Creates the link model for the sitemap\r\n * @export\r\n * @class LinkModel\r\n */\r\nexport class LinkModel {\r\n occasionType: string;\r\n linkData: LinkData[];\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\nimport { AndroWebCoreComponent } from '@app/core/AndroWebCoreComponent';\r\nimport { Link } from '@app/models/sitemap/link';\r\nimport { LinkData } from '@app/models/sitemap/link-data';\r\nimport { LinkModel } from '@app/models/sitemap/link-model';\r\nimport { LocalArea } from '@app/models/LocalArea';\r\nimport { NavigatorService } from '@app/core/navigator.service';\r\nimport { OrderOccasion } from '@app/models/order-occasion';\r\nimport { Router } from '@angular/router';\r\nimport { SeverityLevel } from '@microsoft/applicationinsights-web';\r\nimport { Site } from '@app/models/site';\r\nimport { SiteService } from '@app/api/site.service';\r\n\r\n@Component({\r\n selector: 'app-sitemap',\r\n styleUrls: ['./sitemap.component.scss'],\r\n templateUrl: './sitemap.component.html'\r\n})\r\nexport class SitemapComponent extends AndroWebCoreComponent implements OnInit {\r\n public keywords: string[] = [];\r\n public occasions: OrderOccasion[] = [];\r\n public linkModel: LinkModel[] = [];\r\n public localAreas: LocalArea[] = [];\r\n\r\n constructor(\r\n public navigatorService: NavigatorService,\r\n private router: Router,\r\n private siteService: SiteService) {\r\n super();\r\n\r\n if (!this.tenant?.PageSeos[0]?.Keywords) {\r\n this.trackTrace('PageSeos not setup to create the sitemap', SeverityLevel.Error);\r\n this.router.navigate([this.navigatorService.generateHomePath()]);\r\n } else {\r\n this.keywords = this.tenant.PageSeos[0].Keywords.split(',').map(Function.prototype.call, String.prototype.trim);\r\n }\r\n }\r\n\r\n ngOnInit(): void {\r\n document.getElementById('sitemap-container')?.scrollIntoView();\r\n\r\n this.subscriptions$['SitemapComponent-constructor-siteService-getSites'] = this.siteService.getSites().subscribe((sites: Site[]) => {\r\n if (sites) {\r\n sites.forEach((site:Site) => {\r\n if (site.LocalAreas) {\r\n site.LocalAreas.forEach((localArea: LocalArea) => {\r\n this.localAreas.push(localArea);\r\n });\r\n }\r\n this.occasions = site.OccasionsSupported;\r\n this.linkModel = this.linkModel.concat(this.generateLinks());\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Generate the link data\r\n * @private\r\n * @return {*} {LinkData[]}\r\n * @memberof SitemapComponent\r\n */\r\n private generateLinks() : LinkModel[] {\r\n const currentLinks: LinkModel[] = [];\r\n for (let i: number = 0; i < this.occasions.length; i++) {\r\n // Link Model\r\n const linkModel: LinkModel = new LinkModel();\r\n linkModel.occasionType = this.occasions[i] === OrderOccasion.Collection ? OrderOccasion[OrderOccasion.TakeAway] : OrderOccasion.Delivery;\r\n linkModel.linkData = [];\r\n for (let j: number = 0; j < this.keywords.length; j++) {\r\n const linkData: LinkData = new LinkData();\r\n linkData.sector = this.navigatorService.toTitleCase(this.navigatorService.clean(this.keywords[j]).split('-').join(' '));\r\n linkData.links = [];\r\n for (let k: number = 0; k < this.localAreas.length; k++) {\r\n const link: Link = new Link();\r\n link.description = `${this.keywords[j]} ${linkModel.occasionType} in ${this.formatDescriptionLocation(this.localAreas[k])}`;\r\n link.area = this.navigatorService.clean(this.localAreas[k].Key);\r\n linkData.links.push(link);\r\n }\r\n linkModel.linkData.push(linkData);\r\n }\r\n currentLinks.push(linkModel);\r\n }\r\n\r\n this.occasions = null;\r\n return currentLinks;\r\n }\r\n\r\n private formatDescriptionLocation(input: LocalArea): string {\r\n const parts: string[] = input.Key.split('-');\r\n const outcode = parts.pop().toUpperCase();\r\n return `${input.Name} ${outcode}`;\r\n }\r\n}\r\n","import { RouterModule, Routes } from '@angular/router';\r\n\r\nimport { NgModule } from '@angular/core';\r\nimport { SitemapComponent } from '@app/modules/sitemap/sitemap.component';\r\n\r\nconst routes: Routes = [\r\n { path: '', component: SitemapComponent },\r\n];\r\n\r\n@NgModule({\r\n imports: [RouterModule.forChild(routes)],\r\n exports: [RouterModule],\r\n})\r\nexport class SitemapRoutingModule { }\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\nimport { SharedComponentsModule } from '@app/shared/components/shared-components.module';\r\nimport { SitemapComponent } from '@app/modules/sitemap/sitemap.component';\r\nimport { SitemapRoutingModule } from '@app/modules/sitemap/sitemap-routing.module';\r\n\r\n@NgModule({\r\n declarations: [SitemapComponent],\r\n imports: [\r\n CommonModule,\r\n SitemapRoutingModule,\r\n ReactiveFormsModule,\r\n SharedComponentsModule\r\n ]\r\n})\r\nexport class SitemapModule { }\r\n","// Imports\nvar ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\");\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root {\n --footer-background-colour: #333333;\n --footer-link-colour: #fff;\n --nav-bar-background-colour: #fff;\n --product-content-padding: 0 10px;\n}\n\n@media all and (min-width: 900px) {\n .sitemap-container {\n width: 60%;\n padding: 10px;\n margin: 0 auto;\n }\n .sitemap-container ul {\n column-count: 2;\n list-style-type: none;\n padding-inline-start: 0px;\n }\n .sitemap-container li {\n text-align: left;\n }\n}\n@media only screen and (max-width: 768px) {\n .sitemap-container {\n padding: 10px;\n }\n .sitemap-container ul {\n list-style-type: none;\n padding-inline-start: 0px;\n }\n}\n.sitemap-heading {\n font-size: 1.8em;\n margin-top: 10px;\n margin-bottom: 5px;\n}\n.sitemap-heading-wrapper {\n border-bottom: 1px solid black;\n}\n\n@media screen and (max-width: 479px) {\n .sitemap-container li {\n height: 48px;\n line-height: initial;\n }\n}`, \"\"]);\n// Exports\nmodule.exports = ___CSS_LOADER_EXPORT___.toString();\n"],"x_google_ignoreList":[]}