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QE,YAAYE,GAAYC,QAAQC,UAAUC,IAAMP,EAAQE,YAAYE,GAEhGI,OAAOC,KAAKT,EAAQE,YAAYE,IAAe,IAAIM,SAAQC,IACnDX,EAAQE,YAAYE,GAAYO,IAChCX,EAAQE,YAAYE,GAAYO,GAAYL,WAC5CN,EAAQE,YAAYE,GAAYO,GAAYL,UAAUM,SACtDZ,EAAQE,YAAYF,EAAQE,YAAYE,GAAYO,GAAYL,UAAUC,IAAMP,EAAQE,YAAYE,GAAYO,QA2B5H,CACI,MAAMP,EAAa,iEACnBJ,EAAQE,YAAYE,GAAcS,EAAQ,MAC1CV,EAAiBC,GAGrB,CACI,MAAMA,EAAa,wDACnBJ,EAAQE,YAAYE,GAAcS,EAAQ,MAC1CV,EAAiBC,GAIzBU,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAad,QAAOF,EAAAA,EAAA,GACpBe,OAAOC,aAAad,SAAW,IAC/BD,EAAQC,SAGXa,OAAOC,aAAaC,mBAAqB,GACzCF,OAAOC,aAAaC,mBAA8B,UAACjB,EAAA,GAC5CC,EAAQE,c,mBC7DvBe,EAAOC,QAAUC,O,oBCAjBF,EAAOC,QAAUE,W","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/update-category-page-summary-canonical-url-hook.action.ts?4d26","webpack://Msdyn365.Commerce.Online/./src/actions/update-page-summary-canonical-url-hook.action.ts?7788","webpack://Msdyn365.Commerce.Online/./lib/__local__/module-registration.js?8a42","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["import { createDataActionHook, IActionInput } from '@msdyn365-commerce/core';\r\nimport { IActionContext } from '@msdyn365-commerce/core-internal/dist/types/interfaces/action/IAction';\r\n\r\nconst postHook = async (_inputs: IActionInput | IActionInput[], currentOutput: any, ctx: IActionContext) => {\r\n // modify canonical url as desired\r\n if (!ctx.requestContext.app.config.overrideDefaultCanonicalURL) {\r\n return currentOutput;\r\n }\r\n let newCanonicalUrl = '';\r\n const splitCanonicalUrl = currentOutput.canonicalUrl.split('//');\r\n if (splitCanonicalUrl.length > 0 && splitCanonicalUrl[1].indexOf('-online') > -1) {\r\n const splitCanonicalUrlWithoutHost = splitCanonicalUrl[1].split('/');\r\n splitCanonicalUrlWithoutHost.splice(1, 1);\r\n newCanonicalUrl = `${splitCanonicalUrl[0]}//${splitCanonicalUrlWithoutHost.join('/')}`;\r\n } else {\r\n newCanonicalUrl = currentOutput.canonicalUrl;\r\n }\r\n return { ...currentOutput, canonicalUrl: newCanonicalUrl };\r\n};\r\n\r\ncreateDataActionHook({\r\n actionId: '@msdyn365-commerce-modules/page-summary/category-page-summary',\r\n postHook\r\n});\r\n","import { createDataActionHook, IActionInput } from '@msdyn365-commerce/core';\r\nimport { IActionContext } from '@msdyn365-commerce/core-internal/dist/types/interfaces/action/IAction';\r\n\r\nconst postHook = async (_inputs: IActionInput | IActionInput[], currentOutput: any, ctx: IActionContext) => {\r\n // modify canonical url as desired\r\n if (!ctx.requestContext.app.config.overrideDefaultCanonicalURL) {\r\n return currentOutput;\r\n }\r\n let newCanonicalUrl = '';\r\n const splitCanonicalUrl = currentOutput.canonicalUrl.split('//');\r\n if (splitCanonicalUrl.length > 0 && splitCanonicalUrl[1].indexOf('-online') > -1) {\r\n const splitCanonicalUrlWithoutHost = splitCanonicalUrl[1].split('/');\r\n splitCanonicalUrlWithoutHost.splice(1, 1);\r\n newCanonicalUrl = `${splitCanonicalUrl[0]}//${splitCanonicalUrlWithoutHost.join('/')}`;\r\n } else {\r\n newCanonicalUrl = currentOutput.canonicalUrl;\r\n }\r\n return { ...currentOutput, canonicalUrl: newCanonicalUrl };\r\n};\r\n\r\ncreateDataActionHook({\r\n actionId: '@msdyn365-commerce-modules/page-summary/product-page-summary',\r\n postHook\r\n});\r\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 { \n const actionPath = 'actions/update-category-page-summary-canonical-url-hook.action';\n binding.dataActions[actionPath] = require('partner/actions/update-category-page-summary-canonical-url-hook.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/update-page-summary-canonical-url-hook.action';\n binding.dataActions[actionPath] = require('partner/actions/update-page-summary-canonical-url-hook.action');\n registerActionId(actionPath);\n }\n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.packageDataActions = {};\n window.__bindings__.packageDataActions['__local__'] = {\n ...binding.dataActions\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["createDataActionHook","actionId","postHook","async","_inputs","currentOutput","ctx","requestContext","app","config","overrideDefaultCanonicalURL","newCanonicalUrl","splitCanonicalUrl","canonicalUrl","split","length","indexOf","splitCanonicalUrlWithoutHost","splice","join","_objectSpread","binding","modules","dataActions","registerActionId","actionPath","default","prototype","id","Object","keys","forEach","exportName","Action","require","window","__bindings__","packageDataActions","module","exports","React","ReactDOM"],"sourceRoot":""}