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D,EAClCL,GAAcQ,EAAAA,EAAAA,gBAAeT,GAE7B,MAAMU,EAAkB7E,EAAQmD,eAAe0B,gBAC/C,GAAIT,GAAeS,EAAiB,CAChCT,EAAc,WAAWS,IAAkBT,IAAcU,oBACzD,MAAMC,GA1BAhB,EA0ByB/D,IAzBvB+D,EAAUZ,gBAAkBY,EAAUZ,eAAe6B,OAASjB,EAAUZ,eAAe6B,MAAMC,KA0B/FC,EAAM,IAAIC,IAAIf,GACdgB,EAA6B,IAAIC,gBAAgBH,EAAII,QACvDP,GACAK,EAAUG,IAAI,OAAQR,GAE1BG,EAAII,OAASF,EAAUI,WACvBpB,EAAcc,EAAIM,WAClBpB,GAAcqB,EAAAA,EAAAA,wBAAuBrB,EAAapE,EAAQmD,qBAE1DiB,OAAcjF,EAEpB,MAAAuG,GACEtB,OAAcjF,EAElB,MAAO,CACHO,MAAOyE,EAAgBQ,KACvB9E,gBAAiBsE,EAAgBwB,aACjC1F,aAAcmE,EACdtE,WAAYC,GAAUA,EAAOD,YAI9B,OAAIC,EACA,CACHL,MAAOK,EAAOL,MACdG,gBAAiBE,EAAOG,cAAgBH,EAAOG,aAAaC,IAC5DL,WAAYC,GAAUA,EAAOD,YAG9B,GAxDX,IAAsBiE,GA8DlBJ,MAAQiC,GACG,IAAI3C,EAAoD2C,EAAK7F,OAAQ6F,EAAKzC","sources":["webpack://bestseller.commerce.online/external var \"React\"?0d3b","webpack://bestseller.commerce.online/external var \"ReactDOM\"?853b","webpack://bestseller.commerce.online/./src/modules/default-page-summary/default-page-summary.tsx?0c78","webpack://bestseller.commerce.online/./lib/category-page-summary/module-registration.js?c2e4","webpack://bestseller.commerce.online/./src/modules/category-page-summary/category-page-summary.action.ts?c40c"],"sourcesContent":["module.exports = React;","module.exports = ReactDOM;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { HtmlHeadInclude, IAny, IGeneric } from '@msdyn365-commerce/core';\nimport * as React from 'react';\n\nimport { IDefaultPageSummaryData } from './default-page-summary.data';\nimport { IDefaultPageSummaryProps } from './default-page-summary.props.autogenerated';\n\n/**\n *\n * DefaultPageSummaryMetadata component.\n * @extends {React.PureComponent}\n */\nclass DefaultPageSummary extends React.PureComponent> {\n public render(): JSX.Element {\n if (this.props.data.pageSummary.result === undefined) {\n throw new Error('PageSummaryData input to page-summary is undefined. Unable to generate page-summary');\n }\n let {\n data: {\n pageSummary: {\n result: { title, description, keywords, sharingImageUrl, faviconUrl }\n }\n }\n } = this.props;\n\n const {\n config,\n context,\n data: {\n pageSummary: {\n result: { canonicalUrl }\n }\n }\n } = this.props;\n\n // Override values coming from data action if config values are provided\n title = config.title || title;\n description = config.description || description;\n keywords = config.keywords || keywords;\n sharingImageUrl = (config.sharingImage && config.sharingImage.src) || sharingImageUrl;\n faviconUrl = config.faviconUrl || faviconUrl;\n\n const pageTitle = this._constructPageTitle(title, context && context.request && context.request.app);\n return (\n <>\n \n {pageTitle && {pageTitle}}\n {description && }\n {keywords && }\n {canonicalUrl && }\n {faviconUrl && }\n \n {!config.disableOgTags && this._renderOgTags(pageTitle, description, sharingImageUrl)}\n {!config.disableTwitterTags && this._renderTwitterTags(pageTitle, description, sharingImageUrl)}\n \n );\n }\n\n private _renderOgTags(title: string | undefined, description: string | undefined, sharingImageUrl: string | undefined): JSX.Element {\n return (\n \n {title && }\n {description && }\n {sharingImageUrl && }\n \n \n );\n }\n\n private _renderTwitterTags(\n title: string | undefined,\n description: string | undefined,\n sharingImageUrl: string | undefined\n ): JSX.Element {\n return (\n \n {title && }\n {description && }\n {sharingImageUrl && }\n \n \n );\n }\n\n private _constructPageTitle(title: string | undefined, app: IGeneric): string | undefined {\n if (!title) {\n title = '';\n }\n\n const moduleConfig = this.props.config;\n if (moduleConfig && moduleConfig.ignoreTitleSuffixPrefix) {\n return title;\n }\n\n const appConfig = app && app.platform;\n if (appConfig) {\n if (appConfig.pageTitlePrefix) {\n title = (appConfig.pageTitlePrefix as string) + title;\n }\n if (appConfig.pageTitleSuffix) {\n title += appConfig.pageTitleSuffix as string;\n }\n }\n\n return title;\n }\n}\n\nexport default DefaultPageSummary;\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['category-page-summary'] = {\n c: () => require('@msdyn365-commerce-modules/page-summary/dist/lib/modules/default-page-summary/default-page-summary'),\n $type: 'htmlHeadTagsModule',\n da: [{name:'pageSummary', path:'@msdyn365-commerce-modules/page-summary/dist/lib/modules/category-page-summary/category-page-summary.action', runOn: 0}],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'category-page-summary',\n p: 'page-summary',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/page-summary/dist/lib/modules/category-page-summary'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/page-summary/dist/lib/modules/category-page-summary/category-page-summary.action';\n let dataAction = require('@msdyn365-commerce-modules/page-summary/dist/lib/modules/category-page-summary/category-page-summary.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getFriendlyName,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport {\n buildCacheKeyWithUrlTokens,\n CurrentCategoryInput,\n getCategoryUrl,\n getCurrentCategory,\n removeDomainQspFromUrl\n} from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IPageSummaryData } from '../IPageSummaryData';\n\nimport { ICategoryPageSummaryConfig } from './category-page-summary.props.autogenerated';\nimport { IDefaultPageSummaryConfig } from '../default-page-summary';\n\n/**\n * Category Page Summary Input\n */\nexport class CategoryPageSummaryInput implements IActionInput {\n public requestContext: IRequestContext;\n\n public config: ICategoryPageSummaryConfig | IDefaultPageSummaryConfig;\n\n constructor(config: ICategoryPageSummaryConfig | IDefaultPageSummaryConfig, requestContext: IRequestContext) {\n this.config = config || {};\n this.requestContext = requestContext;\n }\n\n public getCacheObjectType = (): string => 'CategoryPageSummary';\n\n public getCacheKey = (): string => buildCacheKeyWithUrlTokens('CategoryPageSummary', this.requestContext);\n\n public dataCacheType = (): CacheType => 'request';\n}\n\nconst createGetCurrentCategoryInput = (\n inputData: IActionContext,\n config?: ICategoryPageSummaryConfig | IDefaultPageSummaryConfig\n): CurrentCategoryInput => {\n if (inputData && inputData.requestContext) {\n let includeRootCategory: boolean | undefined;\n if (config) {\n includeRootCategory = (config as ICategoryPageSummaryConfig).includeRootCategory;\n }\n return new CurrentCategoryInput(inputData.requestContext, includeRootCategory);\n }\n\n throw new Error('Please specify categoryId query string in request.');\n};\n/**\n * Get skip count.\n * @param inputData\n */\nfunction getSkipCount(inputData: ICreateActionContext, IGeneric>): string | undefined {\n return inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.skip;\n}\n\nconst action = async (input: CategoryPageSummaryInput, context: IActionContext): Promise => {\n const { config } = input;\n let currentCategoryResult;\n try {\n currentCategoryResult = await getCurrentCategory(createGetCurrentCategoryInput(context, input.config), context);\n } catch {\n // Do nothing, if the action fails fallback to values defined in data\n }\n if (currentCategoryResult) {\n const currentCategory = { ...currentCategoryResult };\n let categoryUrl: string | undefined;\n try {\n // Reset category's name neutralizedName\n const localName = getFriendlyName(context.requestContext.locale, currentCategory.NameTranslations);\n const neutralizedName = currentCategory.NeutralizedName || currentCategory.Name;\n currentCategory.Name = localName;\n currentCategory.NeutralizedName = neutralizedName;\n categoryUrl = getCategoryUrl(currentCategory);\n\n const canonicalDomain = context.requestContext.canonicalDomain;\n if (categoryUrl && canonicalDomain) {\n categoryUrl = `https://${canonicalDomain}${categoryUrl}`.toLocaleLowerCase();\n const skipCount = getSkipCount(context);\n const Url = new URL(categoryUrl);\n const urlParams: URLSearchParams = new URLSearchParams(Url.search);\n if (skipCount) {\n urlParams.set('skip', skipCount);\n }\n Url.search = urlParams.toString();\n categoryUrl = Url.toString();\n categoryUrl = removeDomainQspFromUrl(categoryUrl, context.requestContext);\n } else {\n categoryUrl = undefined;\n }\n } catch {\n categoryUrl = undefined;\n }\n return {\n title: currentCategory.Name,\n sharingImageUrl: currentCategory.OfflineImage,\n canonicalUrl: categoryUrl,\n faviconUrl: config && config.faviconUrl\n };\n\n // If the action fails fallback to values defined from data\n } else if (config) {\n return {\n title: config.title,\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\n faviconUrl: config && config.faviconUrl\n };\n }\n return {};\n};\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/page-summary/category-page-summary',\n action: >action,\n input: (args: ICreateActionContext) => {\n return new CategoryPageSummaryInput(args.config, args.requestContext);\n }\n});\n"],"names":["module","exports","React","ReactDOM","DefaultPageSummary","render","undefined","this","props","data","pageSummary","result","Error","title","description","keywords","sharingImageUrl","faviconUrl","config","context","canonicalUrl","sharingImage","src","pageTitle","_constructPageTitle","request","app","HtmlHeadInclude","name","content","rel","href","disableOgTags","_renderOgTags","disableTwitterTags","_renderTwitterTags","property","moduleConfig","ignoreTitleSuffixPrefix","appConfig","platform","pageTitlePrefix","pageTitleSuffix","binding","modules","dataActions","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","id","window","__bindings__","_objectSpread","CategoryPageSummaryInput","constructor","requestContext","getCacheObjectType","getCacheKey","buildCacheKeyWithUrlTokens","dataCacheType","createObservableDataAction","action","async","input","currentCategoryResult","getCurrentCategory","createGetCurrentCategoryInput","inputData","includeRootCategory","CurrentCategoryInput","_unused","currentCategory","categoryUrl","localName","getFriendlyName","locale","NameTranslations","neutralizedName","NeutralizedName","Name","getCategoryUrl","canonicalDomain","toLocaleLowerCase","skipCount","query","skip","Url","URL","urlParams","URLSearchParams","search","set","toString","removeDomainQspFromUrl","_unused2","OfflineImage","args"],"sourceRoot":""}