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UAAU,+DACXb,EAAAA,cAAA,OAAKX,GAAI,YAAayB,wBAAyB,CAAEC,OAAQL,4mBC9BrE,MAAMM,EAAU,CAAEC,QAAS,GAAIC,YAAa,IAwCvCF,EAAQC,QAAQ,mBAAqB,CAClCE,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,CAAC,CAACC,KAAK,oBAAsBC,KAAK,gDAAiDC,MAAO,IAE9FC,KAAK,EACLC,GAAI,YACJC,EAAG,kBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,+BAlC4BC,EAACC,EAAqBC,KAUlD,GADAlB,EAAQE,YAAYe,GAAuBC,GACtClB,EAAQE,YAAYe,GAAqBE,QAC1C,MAAM,IAAIC,MAAM,oBAAsBH,EAAsB,mCAEhEjB,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUC,eAAiBL,EACxEjB,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUhD,KAC3D2B,EAAQE,YAAYF,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUhD,IAAM4C,IA0BzFD,CAF4B,gDACXZ,EAAQ,MAMjCmB,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAavB,QAAOwB,EAAAA,EAAA,GACpBF,OAAOC,aAAavB,SAAW,IAC/BD,EAAQC,SAGXsB,OAAOC,aAAatB,YAAWuB,EAAAA,EAAA,GAC5BF,OAAOC,aAAatB,aAAe,IACnCF,EAAQE,aAEY,MAAMwB,EAAiB,GAC9BA,EAAe,+DAAiE,CACxFvB,EAAGA,IAAMC,EAAQ,MACjBuB,GAAI,uCAEpBJ,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaE,eAAcD,EAAAA,EAAA,GACPF,OAAOC,aAAaE,gBAAkB,IACtCA,UCnF3BE,EAAOC,QAAU7C,cCAjB4C,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/data-actions/brightspot-content-action.action.ts?2792","webpack://mattressfirm/./src/modules/mfrm-brightspot/mfrm-brightspot.tsx?5cac","webpack://mattressfirm/./src/modules/mfrm-brightspot/mfrm-brightspot.view.tsx?1477","webpack://mattressfirm/./lib/mfrm-brightspot/module-registration.js?0903","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n/**\r\n * GetAuthTokenInput Input Action\r\n */\r\nexport class BrightSpotContentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private brightspotUrl: string = '';\r\n constructor(brightspotUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'bspagecache', cacheKey: 'bspagecache' });\r\n this.brightspotUrl = brightspotUrl;\r\n }\r\n\r\n public getBrightspotUrl = () => this.brightspotUrl;\r\n public getCacheKey = () => `bspagecache`;\r\n public getCacheObjectType = () => 'bspagecache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.brightspotPageUrl) {\r\n return new BrightSpotContentInput(inputData.config.brightspotPageUrl);\r\n }\r\n return new BrightSpotContentInput('');\r\n};\r\n\r\nasync function action(input: BrightSpotContentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(\r\n input.getBrightspotUrl(),\r\n 'get',\r\n null,\r\n { headers: {'Accept-Encoding': 'gzip'} }\r\n );\r\n\r\n return res.data;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n id: 'BsPageCache',\r\n action: >action,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as React from 'react';\r\n\r\nimport { IMfrmBrightspotData } from './mfrm-brightspot.data';\r\nimport { IMfrmBrightspotProps } from './mfrm-brightspot.props.autogenerated';\r\n\r\nexport interface IBrightspotViewProps extends IMfrmBrightspotProps {}\r\n\r\n/**\r\n *\r\n * Brightspot component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass Brightspot extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n return this.props.renderView(this.props);\r\n }\r\n}\r\n\r\nexport default Brightspot;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { IBrightspotViewProps } from './mfrm-brightspot';\r\n\r\nexport default (props: IBrightspotViewProps) => {\r\n const {\r\n data: { brightSpotContent }\r\n } = props;\r\n\r\n // Remove Doctype\r\n let brightspotHTML = brightSpotContent.result?.replace(//i, '');\r\n\r\n // Remove HTML tag\r\n brightspotHTML = brightspotHTML?.replace(/|<\\/html>/gi, '');\r\n\r\n // Remove open/close tags\r\n brightspotHTML = brightspotHTML?.replace(/|<\\/head>/gi, '');\r\n\r\n // If the content contains a , replace with a div\r\n brightspotHTML = brightspotHTML?.replace(//i, '
');\r\n\r\n // If the content contains a , replace with
\r\n brightspotHTML = brightspotHTML?.replace(/<\\/body>/i, '<\\/div>');\r\n\r\n return (\r\n
\r\n
\r\n
\r\n );\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 (binding.modules['mfrm-brightspot'] = {\n c: () => require('partner/modules/mfrm-brightspot/mfrm-brightspot.tsx'),\n $type: 'contentModule',\n da: [{name:'brightSpotContent', path:'data-actions/brightspot-content-action.action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-brightspot',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-brightspot'\n });\n \n\n {\n const sanitizedActionPath = 'data-actions/brightspot-content-action.action';\n let dataAction = require('partner/data-actions/brightspot-content-action.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 export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|mfrm-brightspot|mfrm-brightspot'] = {\n c: () => require('partner/modules/mfrm-brightspot/mfrm-brightspot.view.tsx'),\n cn: '__local__-__local__-mfrm-brightspot'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["BrightSpotContentInput","Msdyn365","constructor","brightspotUrl","super","shouldCacheOutput","cacheObjectType","cacheKey","getBrightspotUrl","this","getCacheKey","getCacheObjectType","dataCacheType","id","action","async","input","ctx","headers","data","inputData","config","brightspotPageUrl","Brightspot","React","render","props","renderView","_brightSpotContent$re","_brightspotHTML","_brightspotHTML2","_brightspotHTML3","_brightspotHTML4","brightSpotContent","brightspotHTML","result","replace","className","dangerouslySetInnerHTML","__html","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","window","__bindings__","_objectSpread","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}