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AAMC,EAA2CL,EAAMb,gBAEvD,IAAKkB,EAAe,CAChB,MAAMC,EAAuB,IAAIC,EAAAA,qBAC7BP,EAAMf,UACNe,EAAMd,eACNhD,OACAA,EACA+D,EAAQL,gBAGZ,OAAOY,EAAAA,EAAAA,oBAAmBF,EAAsBL,GAGpD,OAAOI,KAEVD,MAA+BK,IAC5B,MAAMJ,EAAsEI,EAE5E,OAAIJ,EACOK,EAAAA,oBAAAA,wBACH,CACIC,cAAeV,GAEnBI,EAAcO,SACdZ,EAAMd,UACNc,EAAMZ,WAIP,QAEVgB,MAAKN,MAAAA,IAKK,CAAEe,gBAAAA,EAAiBC,oCAJkBC,EAAAA,2BAAAA,+BAA0D,CAClGJ,cAAeV,QAKtBG,MAAKnE,IACK+E,EAAAA,EAAAA,mCAAkC/E,EAAO4E,gBAAiB5E,EAAO6E,iCAE3EG,OAAOC,IAEJ,MADAjB,EAAQkB,MAAMD,EAAME,SACd,IAAI7C,MAAM,+DAI5B,SAAe8C,EAAAA,EAAAA,IAA2B,CACtC3C,GAAI,8EACJ4C,OAAmCvB,EACnCC,MAAOR,WC7HX+B,EAAOC,QAAU9F,cCAjB6F,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/modules/mfrm-product-overview/mfrm-product-overview.tsx?3f66","webpack://mattressfirm/./src/modules/mfrm-product-overview/mfrm-product-overview.view.tsx?76c2","webpack://mattressfirm/./lib/mfrm-product-overview/module-registration.js?142e","webpack://mattressfirm/./src/dataActions/get-attributes-for-selected-variant.ts?e4b6","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\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\n\r\nimport { IMfrmProductOverviewData } from './mfrm-product-overview.data';\r\nimport { IMfrmProductOverviewProps } from './mfrm-product-overview.props.autogenerated';\r\n\r\nexport interface IMfrmProductOverviewViewProps extends IMfrmProductOverviewProps {\r\n\r\n productOverviewText: string;\r\n}\r\n\r\n/**\r\n *\r\n * MfrmProductOverview component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass MfrmProductOverview extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n let customDescription;\r\n if (this.props.data.productSpecificationData.result && this.props.data.productSpecificationData.result !== undefined) {\r\n const attributes = this.props.data.productSpecificationData.result;\r\n const customDescriptionAttributeKey = attributes[attributes.findIndex(obj => obj.Name === 'customDescription')];\r\n customDescription = customDescriptionAttributeKey?.TextValue ? customDescriptionAttributeKey?.TextValue : undefined;\r\n }\r\n\r\n const viewProps = {\r\n ...this.props,\r\n productOverviewText: customDescription ? customDescription :''\r\n };\r\n return this.props.renderView(viewProps);\r\n }\r\n}\r\n\r\nexport default MfrmProductOverview;\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\n\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { IMfrmProductOverviewViewProps } from './mfrm-product-overview';\r\n\r\nexport default (props: IMfrmProductOverviewViewProps) => {\r\n const { productOverviewText } = props;\r\n const {productOverviewHeadingText} =props.resources;\r\n return (\r\n <>\r\n {productOverviewText && \r\n \r\n

{productOverviewHeadingText}

\r\n
\r\n \r\n \r\n \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-product-overview'] = {\n c: () => require('partner/modules/mfrm-product-overview/mfrm-product-overview.tsx'),\n $type: 'contentModule',\n da: [{name:'productSpecificationData', path:'@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-product-overview',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-product-overview'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant');\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-product-overview|mfrm-product-overview'] = {\n c: () => require('partner/modules/mfrm-product-overview/mfrm-product-overview.view.tsx'),\n cn: '__local__-__local__-mfrm-product-overview'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\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 getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { AttributeValue, ProductsDataActions, SimpleProduct, StoreOperationsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport {\n getAttributeValuesByConfiguration,\n getSelectedProductIdFromActionInput,\n getSelectedVariant,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Chains getting the SelectedVariant with GetActivePrice.\n */\nexport class AttributesForSelectedVariantInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n public selectedProduct: SimpleProduct | undefined;\n\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\n this.productId = productId;\n this.channelId = channelId;\n this.selectedProduct = selectedProduct;\n this.catalogId = catalogId || 0;\n }\n\n public getCacheKey = () => 'AttributesForSelectedVariant';\n\n public getCacheObjectType = () => 'ProductAttributeValue';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport const createAttributesForSelectedVariantInput = (\n inputData: ICreateActionContext>\n): AttributesForSelectedVariantInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n const catalogId = getCatalogId(inputData.requestContext);\n\n if (productId) {\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, undefined, catalogId);\n }\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * Calls the Retail API a get a list of dimension values for a given product.\n * @param input - The input.\n * @param context - The context.\n * @returns The attribute values.\n */\nexport async function getAttributesForSelectedVariantAction(\n input: AttributesForSelectedVariantInput,\n context: IActionContext\n): Promise {\n return Promise.resolve()\n .then(() => {\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\n\n if (!activeProduct) {\n const selectedVariantInput = new SelectedVariantInput(\n input.productId,\n input.channelId,\n undefined,\n undefined,\n context.requestContext\n );\n\n return getSelectedVariant(selectedVariantInput, context);\n }\n\n return activeProduct;\n })\n .then((productResult: SimpleProduct | null) => {\n const activeProduct: SimpleProduct | undefined = productResult;\n\n if (activeProduct) {\n return ProductsDataActions.getAttributeValuesAsync(\n {\n callerContext: context\n },\n activeProduct.RecordId,\n input.channelId,\n input.catalogId\n );\n }\n\n return null;\n })\n .then(async (attributeValues: AttributeValue[] | null) => {\n const channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({\n callerContext: context\n });\n\n return { attributeValues, channelInventoryConfiguration };\n })\n .then(result => {\n return getAttributeValuesByConfiguration(result.attributeValues, result.channelInventoryConfiguration);\n })\n .catch((error: Error) => {\n context.trace(error.message);\n throw new Error('[getPriceForSelectedVariantAction]Error executing action');\n });\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\n action: >getAttributesForSelectedVariantAction,\n input: createAttributesForSelectedVariantInput\n});\n","module.exports = React;","module.exports = ReactDOM;"],"names":["MfrmProductOverview","React","render","customDescription","this","props","data","productSpecificationData","result","undefined","attributes","customDescriptionAttributeKey","findIndex","obj","Name","TextValue","viewProps","_objectSpread","productOverviewText","renderView","productOverviewHeadingText","resources","Node","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","id","window","__bindings__","viewDictionary","cn","AttributesForSelectedVariantInput","constructor","productId","channelId","selectedProduct","catalogId","getCacheKey","getCacheObjectType","dataCacheType","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","getCatalogId","requestContext","apiSettings","async","getAttributesForSelectedVariantAction","input","context","Promise","resolve","then","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariant","productResult","ProductsDataActions","callerContext","RecordId","attributeValues","channelInventoryConfiguration","StoreOperationsDataActions","getAttributeValuesByConfiguration","catch","error","trace","message","createObservableDataAction","action","module","exports","ReactDOM"],"sourceRoot":""}