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GAEzH,MAAM,IAAItB,MAAM,gGASbgC,eAAeC,EAClBC,EACAlK,GAEA,OAAOmK,QAAQC,UACVC,MAAK,KACF,MAAMC,EAA2CJ,EAAMb,gBAEvD,IAAKiB,EAAe,CAChB,MAAMC,EAAuB,IAAIC,EAAAA,qBAC7BN,EAAMf,UACNe,EAAMd,eACN7C,OACAA,EACAvG,EAAQ8J,gBAGZ,OAAOW,EAAAA,EAAAA,oBAAmBF,EAAsBvK,GAGpD,OAAOsK,KAEVD,MAA+BK,IAC5B,MAAMJ,EAAsEI,EAE5E,OAAIJ,EACOK,EAAAA,oBAAAA,wBACH,CACIC,cAAe5K,GAEnBsK,EAAcO,SACdX,EAAMd,UACNc,EAAMZ,WAIP,QAEVe,MAAKL,MAAAA,IAKK,CAAEc,gBAAAA,EAAiBC,oCAJkBC,EAAAA,2BAAAA,+BAA0D,CAClGJ,cAAe5K,QAKtBqK,MAAKlE,IACK8E,EAAAA,EAAAA,mCAAkC9E,EAAO2E,gBAAiB3E,EAAO4E,iCAE3EG,OAAOC,IAEJ,MADAnL,EAAQoL,MAAMD,EAAME,SACd,IAAIrD,MAAM,+DAI5B,SAAesD,EAAAA,EAAAA,IAA2B,CACtCxH,GAAI,8EACJyH,OAAmCtB,EACnCC,MAAOR,WC7HX8B,EAAOC,QAAUnK,cCAjBkK,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/get-view-port.tsx?4210","webpack://mattressfirm/./src/modules/mfrm-product-details/mfrm-product-details-specification/mfrm-product-details-specification.tsx?6597","webpack://mattressfirm/./src/modules/mfrm-product-details/mfrm-product-details.tsx?b5aa","webpack://mattressfirm/./src/modules/mfrm-product-details/mfrm-product-details.view.tsx?c431","webpack://mattressfirm/./lib/mfrm-product-details/module-registration.js?f322","webpack://mattressfirm/./src/dataActions/get-attributes-for-selected-variant.ts?e4b6","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import MsDyn365, { ICoreContext } from '@msdyn365-commerce/core';\r\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\nconst _getViewPort = (context: ICoreContext): GridSize => {\r\n if (MsDyn365.isBrowser && window.innerWidth) {\r\n const gridSettings = context.request.gridSettings;\r\n if (gridSettings) {\r\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\r\n return 'xs';\r\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\r\n return 'sm';\r\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\r\n return 'md';\r\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\r\n return 'lg';\r\n } else {\r\n return 'xl';\r\n }\r\n }\r\n }\r\n return 'xs';\r\n};\r\n\r\nexport default _getViewPort;\r\n","import * as React from 'react';\r\n\r\nexport interface IconFeature {\r\n url: string;\r\n text: string;\r\n}\r\n\r\nexport interface MfrmProductDetailsSpecificationProps {\r\n iconFeatures: IconFeature[];\r\n listedFeatures: string[];\r\n heading2: string[];\r\n heading1: string[];\r\n mattressBreakdown: Record;\r\n}\r\n\r\nexport const MfrmProductDetailsSpecification = (props: MfrmProductDetailsSpecificationProps) => {\r\n const { listedFeatures, heading1, heading2, mattressBreakdown, iconFeatures } = props;\r\n const mattressBreakdownArr = mattressBreakdown && Object.entries(mattressBreakdown);\r\n return (\r\n
\r\n {(listedFeatures?.length || iconFeatures?.length) &&
\r\n

{heading1 ? heading1 : 'Features'}

\r\n
    \r\n {iconFeatures?.map((icon, i) => {\r\n return (\r\n
  • \r\n \r\n {icon?.text ?? ''}\r\n
  • \r\n );\r\n })}\r\n
\r\n {listedFeatures?.map((listedFeature, i) => {\r\n return

{listedFeature ?? ''}

;\r\n })}\r\n
\r\n }\r\n {mattressBreakdownArr?.length &&
\r\n

{heading2 ? heading2 : 'Breakdown'}

\r\n
\r\n {mattressBreakdownArr?.map(([key, values]) => {\r\n return (\r\n
\r\n
{key}
\r\n
\r\n {Array.isArray(values) ? (\r\n values.map(value => {\r\n return
;\r\n })\r\n ) : (\r\n
\r\n )}\r\n
\r\n
\r\n );\r\n })}\r\n
\r\n
\r\n }\r\n
\r\n );\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 { addThrottledEvent, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport MsDyn365, { RichTextComponent } from '@msdyn365-commerce/core';\r\nimport AccordionItem from 'mfcl/AccordionItem';\r\nimport * as React from 'react';\r\nimport _getViewPort from '../../Utilities/get-view-port';\r\n\r\nimport { IMfrmProductDetailsData } from './mfrm-product-details.data';\r\nimport { IMfrmProductDetailsProps } from './mfrm-product-details.props.autogenerated';\r\nimport { MfrmProductDetailsSpecification } from './mfrm-product-details-specification/mfrm-product-details-specification';\r\nexport interface IPanelContent {\r\n header: string;\r\n content: React.ReactElement;\r\n id: string;\r\n}\r\nexport interface IResponsiveState {\r\n isMobile: boolean;\r\n isTablet: boolean;\r\n activeTab: number;\r\n}\r\n\r\nexport interface IResultData {\r\n AttributeValueId?: number;\r\n DataTypeValue?: number;\r\n ExtensionProperties?: [];\r\n Name?: string;\r\n RecordId?: number;\r\n TextValue?: string;\r\n}\r\n\r\nexport interface IMfrmProductDetailsViewProps extends IMfrmProductDetailsProps {\r\n accordionData: React.ReactNode;\r\n panelContent: [];\r\n}\r\n\r\n/**\r\n *\r\n * MfrmProductDetails component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass MfrmProductDetails extends React.PureComponent, IResponsiveState> {\r\n private panelContent: IPanelContent[];\r\n\r\n private resizeThrottledEventHandler?: (event: Event) => void;\r\n constructor(props: IMfrmProductDetailsProps) {\r\n super(props);\r\n this.panelContent = [];\r\n this.state = {\r\n isMobile: false,\r\n isTablet: false,\r\n activeTab: 0\r\n };\r\n }\r\n public componentDidMount(): void {\r\n if (MsDyn365.isBrowser) {\r\n this.resizeThrottledEventHandler = addThrottledEvent(window, 'resize', () => this._updateViewport());\r\n }\r\n this._updateViewport();\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n MsDyn365.isBrowser && window.removeEventListener('resize', this.resizeThrottledEventHandler!, false);\r\n }\r\n public render(): JSX.Element | null {\r\n const { descriptionHeading, specificationsHeading, aboutHeading, deliveryShippingHeading, warrantyHeading } = this.props.resources;\r\n this.panelContent = [\r\n {\r\n header: descriptionHeading,\r\n content: this._getDescriptionContent(this.props.slots?.descriptionContent),\r\n id: descriptionHeading\r\n },\r\n {\r\n header: specificationsHeading,\r\n content: this._getSpecificationContent(),\r\n id: specificationsHeading\r\n },\r\n {\r\n header: `${aboutHeading} ${this._getBrandName()}`,\r\n content: this._getAboutContent(),\r\n id: aboutHeading\r\n },\r\n {\r\n header: deliveryShippingHeading,\r\n content: this._getDeliveryShippingContent(this.props.slots?.deliveryShippingContent),\r\n id: deliveryShippingHeading\r\n },\r\n {\r\n header: warrantyHeading,\r\n content: this._getWarrentyContent(this.props.slots?.warrantyContent),\r\n id: warrantyHeading\r\n }\r\n ];\r\n const viewProps = {\r\n ...this.props,\r\n accordionData: this._showAccordion(),\r\n panelContent: this.panelContent\r\n };\r\n return this.props.renderView(viewProps);\r\n }\r\n private _updateViewport = () => {\r\n const { context } = this.props;\r\n const viewPort = _getViewPort(context);\r\n viewPort === 'xs' || viewPort === 'sm' ? this.setState({ isMobile: true }) : this.setState({ isMobile: false });\r\n viewPort === 'md' || viewPort === 'lg' ? this.setState({ isTablet: true }) : this.setState({ isTablet: false });\r\n };\r\n private _getDescriptionContent(description: React.ReactNode[]): JSX.Element {\r\n if (this.props.slots && this.props.slots.descriptionContent && this.props.slots.descriptionContent.length) {\r\n return (\r\n <>\r\n {description && description.length\r\n ? description.map((children: React.ReactNode, index: number) => {\r\n return
{children}
;\r\n })\r\n : null}\r\n \r\n );\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _validateResult(key: string): IResultData | undefined {\r\n const {\r\n data: {\r\n productSpecificationData: { result }\r\n }\r\n } = this.props;\r\n const content: object | undefined = result ? result.find(obj => obj?.Name === key) : undefined;\r\n return content ? content : undefined;\r\n }\r\n\r\n private _getSpecificationContent(): JSX.Element {\r\n const result: IResultData | undefined = this._validateResult('Specification');\r\n if (result?.TextValue) {\r\n try {\r\n const props = JSON.parse(result.TextValue);\r\n return ;\r\n } catch (e) {\r\n return ;\r\n }\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _getBrandName(): string {\r\n const brandKey = this.props.context.app.config?.brandBackofficeAttributePdp;\r\n const result: IResultData | undefined = this._validateResult(brandKey);\r\n return result && result.TextValue ? result.TextValue.toLowerCase() : '';\r\n }\r\n\r\n private _getAboutContent(): JSX.Element {\r\n const result: IResultData | undefined = this._validateResult('About Brand');\r\n if (result) {\r\n return ;\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _getDeliveryShippingContent(deliveryShippingContent: React.ReactNode[]): JSX.Element {\r\n if (this.props.slots && this.props.slots.deliveryShippingContent && this.props.slots.deliveryShippingContent.length) {\r\n return (\r\n
\r\n {deliveryShippingContent && deliveryShippingContent.length\r\n ? deliveryShippingContent.map((children: React.ReactNode, index: number) => {\r\n return {children};\r\n })\r\n : null}\r\n
\r\n );\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _getWarrentyContent(warrantyContent: React.ReactNode[]): JSX.Element {\r\n if (this.props.slots && this.props.slots.warrantyContent && this.props.slots.warrantyContent.length) {\r\n return (\r\n <>\r\n {warrantyContent && warrantyContent.length\r\n ? warrantyContent.map((children: React.ReactNode, index: number) => {\r\n return {children};\r\n })\r\n : null}\r\n \r\n );\r\n }\r\n return this._defaultContent();\r\n }\r\n\r\n private _showAccordion = () => {\r\n const { isMobile, isTablet } = this.state;\r\n const accordionContent = isMobile || isTablet ? this.panelContent.slice(2) : '';\r\n return (\r\n
\r\n {accordionContent &&\r\n accordionContent.length &&\r\n accordionContent.map((children: IPanelContent, index: number) => {\r\n return (\r\n \r\n );\r\n })}\r\n
\r\n );\r\n };\r\n\r\n private _defaultContent(): JSX.Element {\r\n const { defaultContent } = this.props.resources;\r\n return {defaultContent};\r\n }\r\n}\r\n\r\nexport default MfrmProductDetails;\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 { IMfrmProductDetailsViewProps } from './mfrm-product-details';\r\nimport AccordionItem from 'mfcl/AccordionItem';\r\n\r\n//todo import this\r\nexport interface IPanelContent {\r\n header: string;\r\n content: React.ReactElement;\r\n id: string;\r\n}\r\n\r\nexport default (props: IMfrmProductDetailsViewProps) => {\r\n const { panelContent } = props;\r\n return (\r\n
\r\n
\r\n {panelContent &&\r\n panelContent.length &&\r\n panelContent\r\n .filter((panel: IPanelContent) => panel.header !== 'Description')\r\n .map((panel: IPanelContent, index: number) => {\r\n return (\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-details'] = {\n c: () => require('partner/modules/mfrm-product-details/mfrm-product-details.tsx'),\n $type: 'containerModule',\n da: [{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{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-details',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-product-details'\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 const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-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-details|mfrm-product-details'] = {\n c: () => require('partner/modules/mfrm-product-details/mfrm-product-details.view.tsx'),\n cn: '__local__-__local__-mfrm-product-details'\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":["context","MsDyn365","isBrowser","window","innerWidth","gridSettings","request","xs","w","sm","md","lg","MfrmProductDetailsSpecification","props","listedFeatures","heading1","heading2","mattressBreakdown","iconFeatures","mattressBreakdownArr","Object","entries","React","className","length","map","icon","i","_icon$url","_icon$text","key","src","url","text","listedFeature","_ref","values","Array","isArray","value","dangerouslySetInnerHTML","__html","MfrmProductDetails","constructor","super","_updateViewport","this","viewPort","_getViewPort","setState","isMobile","isTablet","_showAccordion","state","accordionContent","panelContent","slice","children","index","AccordionItem","title","header","id","content","activeTab","componentDidMount","resizeThrottledEventHandler","addThrottledEvent","componentWillUnmount","removeEventListener","render","_this$props$slots","_this$props$slots2","_this$props$slots3","descriptionHeading","specificationsHeading","aboutHeading","deliveryShippingHeading","warrantyHeading","resources","_getDescriptionContent","slots","descriptionContent","_getSpecificationContent","_getBrandName","_getAboutContent","_getDeliveryShippingContent","deliveryShippingContent","_getWarrentyContent","warrantyContent","viewProps","_objectSpread","accordionData","renderView","description","_defaultContent","_validateResult","data","productSpecificationData","result","find","obj","Name","undefined","TextValue","JSON","parse","assign","e","RichTextComponent","_this$props$context$a","brandKey","app","config","brandBackofficeAttributePdp","toLowerCase","defaultContent","Node","filter","panel","initialOpen","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","__bindings__","viewDictionary","cn","AttributesForSelectedVariantInput","productId","channelId","selectedProduct","catalogId","getCacheKey","getCacheObjectType","dataCacheType","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","getCatalogId","requestContext","apiSettings","async","getAttributesForSelectedVariantAction","input","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":""}