{"version":3,"sources":["webpack:///./src/project/app/client-pages/CategoryPage.vue?5fd5","webpack:///./src/project/app/client-pages/CategoryPage.vue","webpack:///./src/project/app/client-pages/CategoryPage.vue?77de","webpack:///./src/project/app/client-pages/CategoryPage.vue?49e6"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","categoryId","pageDataUrl","handlePageDataCallback","handleSearchResultCallback","hideLeftMenu","scopedSlots","_u","key","fn","ref","activeMenuItem","rootMenuItem","menuItems","staticRenderFns","CategoryNavigation","isFeatureEnabled","ProductListingPageV2","SearchProductControl","previousCategoryId","isFirstRequest","delayLoaderTimer","searchResult","seoInformation","seoCategoryName","seoBreadcrumb","settings","departmentPage","pageUrl","pageData","navigation","activeCategory","getCategoryById","page","getPage","url","includes","pageKey","location","getLocationForPage","query","paramString","Object","entries","map","val","join","setCanonicalUrl","window","servercontext","culture","setOpenGraphUrl","expectedCategoryUrl","siteInfo","setPrerenderRedirectUrlsIfLocationIsWrong","delay","uaIsPrerender","uaIsBot","setTimeout","loadMetadataForPage","category","getCategorySeoInformation","then","result","updatePageTitleAndDescription","getBreadCrumbForCategory","categoryValues","cat","catIndex","name","length","totalHits","seofyNumbers","totalResults","undefined","toString","labelValues","brand","brandName","results","titleLabelKey","title","get","titleFromPage","seoTitle","titleWithParams","getWithNamedValues","setTitle","descriptionLabelKey","description","descriptionFromPage","seoDescription","descriptionWithParams","setDescription","to","from","isSearching","$route","trackGenericPageView","clearTimeout","String","immediate","components","CategoryTileBlock","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,uBAAuB,CAACE,MAAM,CAAC,cAAcN,EAAIO,WAAW,gBAAgBP,EAAIQ,YAAY,4BAA4BR,EAAIS,uBAAuB,yBAAyBT,EAAIU,2BAA2B,iBAAiBV,EAAIW,aAAa,cAAc,WAAW,0BAA0B,IAAIC,YAAYZ,E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c||_h;return _c('SearchProductControl',{attrs:{\"category-id\":_vm.categoryId,\"page-data-url\":_vm.pageDataUrl,\"page-data-result-callback\":_vm.handlePageDataCallback,\"search-result-callback\":_vm.handleSearchResultCallback,\"hide-left-menu\":_vm.hideLeftMenu,\"context-key\":\"category\",\"with-results-breadcrumb\":\"\"},scopedSlots:_vm._u([{key:\"navigation\",fn:function(ref){\nvar activeMenuItem = ref.activeMenuItem;\nvar rootMenuItem = ref.rootMenuItem;\nvar menuItems = ref.menuItems;\nreturn [_c('CategoryNavigation',{attrs:{\"active-menu-item\":activeMenuItem,\"root-menu-item\":rootMenuItem,\"menu-items\":menuItems}})]}}])})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue, Watch } from 'vue-property-decorator';\r\nimport gtmService from '@/project/tracking/gtm/GTM.service';\r\nimport { Route } from 'vue-router';\r\nimport megaMenuService from '@/project/shared/megaMenu.service';\r\nimport dictionaryService, { NamedLabelArgument } from '@/core/translation/dictionary.service';\r\nimport domService from '@/core/dom/dom.service';\r\nimport { upperFirst } from 'lodash';\r\nimport { PageData } from '@/types/contentServerContract';\r\nimport CategoryTileBlock from '@/project/app/blocks/categories/CategoryTileBlock.vue';\r\nimport botService from '@/project/site/bot.service';\r\nimport { CategorySeoInformationViewModel, Feature, MenuItem, SearchViewModel } from '@/types/apiServerContract';\r\nimport Api from '@/project/http/Api.service';\r\nimport urlHelper from '@/core/urlHelper.service';\r\nimport { UrlQueryKey } from '@/core/urlQueryKey';\r\nimport serverContextService from '@/core/serverContext.service';\r\nconst CategoryNavigation = () => serverContextService.isFeatureEnabled(Feature.ProductListingPageV2)\r\n ? import('@/project/search/navigation/CategoryNavigation.vue')\r\n : import('@/project/search/navigation/CategoryNavigationV1.vue');\r\nconst SearchProductControl = () => serverContextService.isFeatureEnabled(Feature.ProductListingPageV2)\r\n ? import('@/project/search/SearchProductControl.vue')\r\n : import('@/project/search/SearchProductControlV1.vue');\r\n\r\n@Component({\r\n components: { CategoryTileBlock, SearchProductControl, CategoryNavigation }\r\n})\r\nexport default class CategoryPage extends Vue {\r\n @Prop(String)\r\n categoryId!: string;\r\n\r\n previousCategoryId: string = '';\r\n isFirstRequest: boolean = true;\r\n delayLoaderTimer: number = 0;\r\n\r\n searchResult: SearchViewModel | null = null;\r\n seoInformation: CategorySeoInformationViewModel | null = null;\r\n seoCategoryName: null | string = null;\r\n seoBreadcrumb: MenuItem[] = [];\r\n hideLeftMenu: boolean = false;\r\n\r\n get pageDataUrl() {\r\n if (serverContextService.settings?.departmentPage) {\r\n const pageUrl = `${serverContextService.settings?.departmentPage}?categoryId=${this.categoryId}`;\r\n return pageUrl;\r\n }\r\n }\r\n\r\n async handlePageDataCallback(pageData?: PageData) {\r\n this.hideLeftMenu = pageData?.navigation?.hideLeftMenu ?? false;\r\n const activeCategory = this.categoryId ? await megaMenuService.getCategoryById(this.categoryId) : null;\r\n\r\n const page = urlHelper.getPage();\r\n if (activeCategory?.url && page > 1 && !activeCategory?.url.includes(`${UrlQueryKey.pageKey}=`)) {\r\n const location = urlHelper.getLocationForPage(page) as any;\r\n const query = location.query || {};\r\n const paramString = Object.entries(query).map(([key, val]) => `${key}=${val}`).join('&');\r\n activeCategory.url = `${activeCategory.url}${(activeCategory.url.includes('?') ? '&' : '?')}${paramString}`;\r\n }\r\n\r\n domService.setCanonicalUrl(window.servercontext.culture + activeCategory?.url ?? '', true);\r\n domService.setOpenGraphUrl(window.servercontext.culture + activeCategory?.url ?? '', true);\r\n const expectedCategoryUrl = activeCategory?.url ? `${serverContextService.siteInfo.url}${activeCategory.url}` : null;\r\n botService.setPrerenderRedirectUrlsIfLocationIsWrong(expectedCategoryUrl);\r\n }\r\n\r\n async handleSearchResultCallback(searchResult: SearchViewModel) {\r\n const delay = (botService.uaIsPrerender() || botService.uaIsBot()) ? 0 : this.isFirstRequest ? 1500 : 750;\r\n this.isFirstRequest = false;\r\n this.searchResult = searchResult;\r\n this.delayLoaderTimer = setTimeout(() => {\r\n this.loadMetadataForPage();\r\n }, delay);\r\n }\r\n\r\n async loadMetadataForPage() {\r\n if (this.categoryId !== this.previousCategoryId) {\r\n Api.category.getCategorySeoInformation(this.categoryId).then(result => {\r\n this.seoInformation = result;\r\n this.updatePageTitleAndDescription();\r\n });\r\n megaMenuService.getBreadCrumbForCategory(this.categoryId).then(result => {\r\n this.seoBreadcrumb = result || [];\r\n this.updatePageTitleAndDescription();\r\n });\r\n this.previousCategoryId = this.categoryId;\r\n }\r\n }\r\n\r\n updatePageTitleAndDescription() {\r\n const categoryValues = {};\r\n this.seoBreadcrumb.map((cat, catIndex) => {\r\n categoryValues[`categoryLevel${catIndex + 1}`] = cat.name;\r\n });\r\n const activeCategory = this.categoryId && this.seoBreadcrumb.length > 0 ? this.seoBreadcrumb[this.seoBreadcrumb.length - 1] : null;\r\n this.seoCategoryName = upperFirst(activeCategory?.name ?? 'Unknown');\r\n\r\n const totalHits = dictionaryService.seofyNumbers(this.searchResult?.totalHits);\r\n const totalResults = totalHits !== undefined ? totalHits.toString(10) : undefined;\r\n const labelValues: NamedLabelArgument = {\r\n brand: this.searchResult?.brandName || undefined,\r\n totalResults: totalResults,\r\n results: totalResults,\r\n category: this.seoCategoryName,\r\n ...categoryValues\r\n };\r\n\r\n const titleLabelKey = 'Category.SEO.Title';\r\n const title = dictionaryService.get(titleLabelKey, [this.seoCategoryName]);\r\n const titleFromPage = this.seoInformation?.seoTitle;\r\n const titleWithParams = dictionaryService.getWithNamedValues(titleFromPage || titleLabelKey, labelValues, true, !!titleFromPage);\r\n domService.setTitle(titleWithParams || title);\r\n\r\n const descriptionLabelKey = 'Category.SEO.Description';\r\n const description = dictionaryService.get(descriptionLabelKey, [this.seoCategoryName]);\r\n const descriptionFromPage = this.seoInformation?.seoDescription;\r\n const descriptionWithParams = dictionaryService.getWithNamedValues(descriptionFromPage || descriptionLabelKey, labelValues, true, !!descriptionFromPage);\r\n domService.setDescription(descriptionWithParams || description);\r\n }\r\n\r\n @Watch('$route', {\r\n immediate: true\r\n })\r\n onRouteChange(to: Route, from?: Route) {\r\n const isSearching = urlHelper.isSearching(to) || urlHelper.isSearching(from);\r\n if (isSearching) return;\r\n\r\n if (this.$route.name) {\r\n gtmService.trackGenericPageView(this.$route.name);\r\n }\r\n }\r\n\r\n destroyed() {\r\n if (this.delayLoaderTimer) {\r\n clearTimeout(this.delayLoaderTimer);\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CategoryPage.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CategoryPage.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CategoryPage.vue?vue&type=template&id=6cf6baa7&\"\nimport script from \"./CategoryPage.vue?vue&type=script&lang=ts&\"\nexport * from \"./CategoryPage.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}