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I,KAC3D6H,EAAQE,YAAYF,EAAQE,YAAYE,GAAqBE,QAAQC,UAAUpI,IAAMiI,IAMhGJ,EAAQC,QAAQ,qCAAuC,CACpDQ,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,CAAC,CAACC,KAAK,8BAAgCC,KAAK,uDAAwDC,MAAO,GAAG,CAACF,KAAK,UAAYC,KAAK,0EAA2EC,MAAO,IAE3NC,KAAK,EACLC,GAAI,YACJC,EAAG,oCACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,iDAOAlB,EAF4B,0EACXO,EAAQ,KAQzBP,EAF4B,uDACXO,EAAQ,MAMjCY,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAatB,QAAO7D,EAAAA,EAAA,GACpBkF,OAAOC,aAAatB,SAAW,IAC/BD,EAAQC,SAGXqB,OAAOC,aAAarB,YAAW9D,EAAAA,EAAA,GAC5BkF,OAAOC,aAAarB,aAAe,IACnCF,EAAQE,aAEY,MAAMsB,EAAiB,GAC9BA,EAAe,mGAAqG,CAC5Hf,EAAGA,IAAMC,EAAQ,MACjBe,GAAI,yDAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaC,eAAcpF,EAAAA,EAAA,GACPkF,OAAOC,aAAaC,gBAAkB,IACtCA,UC1F3BE,EAAOC,QAAU/H,cCAjB8H,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/get-custom-product-additional-details.action.ts?0d95","webpack://Msdyn365.Commerce.Online/./src/actions/getProductAdditionalDetails.ts?41e4","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-additional-details/genera-product-additional-details.props.autogenerated.ts?6017","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-additional-details/components/product-custom-additional-details-table-stucture.tsx?8c14","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-additional-details/genera-product-additional-details.tsx?dd7b","webpack://Msdyn365.Commerce.Online/./src/modules/genera-product-additional-details/genera-product-additional-details.view.tsx?bd6b","webpack://Msdyn365.Commerce.Online/./lib/genera-product-additional-details/module-registration.js?e4d0","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/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 Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\n// import { IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n// import {getByIdAsync, searchByCriteriaAsync} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getProductAdditionalDetailsAsync } from './getProductAdditionalDetails';\r\n\r\n/**\r\n * GetCustomProductSpec Input Action\r\n */\r\nexport class GetCustomProductSpecficiationInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public config: any;\r\n\r\n constructor(productId: number, channelId: number, config: any) {\r\n this.channelId = channelId;\r\n this.productId = productId;\r\n this.config = config;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `GetCustomProductAdditionalDetails${this.productId}`;\r\n public getCacheObjectType = () => 'Spec';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n// export interface IGetCustomProductSpecData {\r\n// text: string;\r\n// }\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new GetCustomProductSpecficiationInput(+productId, +inputData.requestContext.apiSettings.channelId, inputData.config);\r\n\r\n }\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetCustomProductSpecficiationInput, ctx: Msdyn365.IActionContext): Promise {\r\n const prodAttr: AttributeValue[] = new Array();\r\n const response = await getProductAdditionalDetailsAsync({ callerContext: ctx }, input.productId);\r\n if (response && response.length > 0) {\r\n // response = response.sort((x,y) => x.Interchange_Part_Number!.localeCompare(y.Interchange_Part_Number!));\r\n\r\n let attr: AttributeValue = {\r\n KeyName: 'Country Of Origin',\r\n Name: 'Country Of Origin',\r\n TextValue: response[0].CountryLongName === \"\" ? 'N/A' : response[0].CountryLongName\r\n , DataTypeValue: 5\r\n };\r\n prodAttr.push(attr);\r\n attr = {\r\n KeyName: 'Life Cycle Status',\r\n Name: 'Life Cycle Status',\r\n TextValue: response[0].ProductLifeCycleDescription === \"\" ? 'N/A' : response[0].ProductLifeCycleDescription\r\n , DataTypeValue: 5\r\n };\r\n prodAttr.push(attr);\r\n }\r\n else{\r\n let attr: AttributeValue = {\r\n KeyName: 'Country Of Origin',\r\n Name: 'Country Of Origin',\r\n TextValue: 'N/A'\r\n , DataTypeValue: 5\r\n };\r\n prodAttr.push(attr);\r\n attr = {\r\n KeyName: 'Life Cycle Status',\r\n Name: 'Life Cycle Status',\r\n TextValue: 'N/A'\r\n , DataTypeValue: 5\r\n };\r\n prodAttr.push(attr);\r\n }\r\n return prodAttr;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'GetCustomProductAdditionalDetails',\r\n input: createInput\r\n});\r\n","import { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './AlternateItemsEntity.g';\r\n\r\nexport function getProductAdditionalDetailsQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n }\r\n\r\nfunction getProductAdditionalDetailsInput (\r\n queryResultSettings: IQueryResultSettings, productId:\r\n number\r\n): IDataServiceRequest {\r\n const query = getProductAdditionalDetailsQuery().resultSettings(queryResultSettings);\r\n return query.createDataServiceRequestForOperation(\r\n 'GetProductAdditionalDetails',\r\n true,\r\n DataServiceEntities.ProductAdditionalDetailsExtensionClass\r\n ,\r\n 'true',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IProductAdditionalDetailsEntity' },\r\n {\r\n ProductId: productId\r\n }\r\n );\r\n}\r\n\r\nexport function getProductAdditionalDetailsAsync (\r\n context: IContext, productId:\r\n number\r\n ): AsyncResult {\r\n const request = getProductAdditionalDetailsInput(\r\n context.queryResultSettings || {}, productId);\r\n return callActionOrExecute(request, context.callerContext);\r\n }","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IGeneraProductAdditionalDetails contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum displayStyle {\r\n accordion = 'accordion',\r\n table = 'table'\r\n}\r\n\r\nexport interface IGeneraProductAdditionalDetailsConfig extends Msdyn365.IModuleConfig {\r\n showText?: string;\r\n heading?: IHeadingData;\r\n displayStyle?: displayStyle;\r\n className?: string;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IGeneraProductAdditionalDetailsResources {\r\n trueValueText: string;\r\n falseValueText: string;\r\n}\r\n\r\nexport const enum HeadingTag {\r\n h1 = 'h1',\r\n h2 = 'h2',\r\n h3 = 'h3',\r\n h4 = 'h4',\r\n h5 = 'h5',\r\n h6 = 'h6'\r\n}\r\n\r\nexport interface IHeadingData {\r\n text: string;\r\n tag?: HeadingTag;\r\n}\r\n\r\nexport interface IGeneraProductAdditionalDetailsProps extends Msdyn365.IModule {\r\n resources: IGeneraProductAdditionalDetailsResources;\r\n config: IGeneraProductAdditionalDetailsConfig;\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getRichTextHtml } from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\n/**\r\n * Product specification table row.\r\n */\r\nexport interface IProductSpecificationTableRow {\r\n productName?: string;\r\n cellData?: React.ReactNode;\r\n className?: string;\r\n}\r\n\r\n/**\r\n * Product specification table row component.\r\n * @param props - For product specification table row.\r\n * @param props.productName - Product name.\r\n * @param props.cellData - Cell data.\r\n * @param props.className - Class name.\r\n * @returns - Returns JSX element.\r\n */\r\nexport const ProductSpecificationTableRow: React.FC = ({ productName, cellData, className }) => (\r\n \r\n \r\n \r\n \r\n \r\n { cellData }\r\n \r\n \r\n);\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\n// import { observer } from 'mobx-react';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { Drawer, IModuleProps, INodeProps, Module } from '@msdyn365-commerce-modules/utilities';\nimport { IGeneraProductAdditionalDetailsData } from './genera-product-additional-details.data';\nimport { displayStyle, IGeneraProductAdditionalDetailsProps } from './genera-product-additional-details.props.autogenerated';\nimport { ProductSpecificationTableRow } from './components/product-custom-additional-details-table-stucture';\n import {getProductAdditionalDetailsAsync } from '../../actions/getProductAdditionalDetails';\n\n export interface IProductAdditionalDetailState {\n isDrawerOpen: boolean;\n drawerListId: number | undefined;\n}\n\nexport interface IGeneraProductAdditionalDetailsViewProps extends IGeneraProductAdditionalDetailsProps {\n ProductSpecification: IModuleProps;\n ProductSpecificationTableProps: INodeProps;\n ProductSpecificationTableBodyProps: INodeProps;\n productSpecificationResult?: (JSX.Element | null)[];\n title?: React.ReactNode;\n isAccrodion?: boolean;\n handleText?(event: Msdyn365.ContentEditableEvent): void;\n}\n\nexport interface IGeneraProductAdditionalDetailsExtentedProps extends IGeneraProductAdditionalDetailsProps {\n displayStyle?: displayStyle;\n}\n\n/**\n *\n * GeneraProductDetails component\n * @extends {React.PureComponent>}\n */\n\nclass GeneraProductAdditionalDetails extends React.PureComponent {\n public constructor(props: IGeneraProductAdditionalDetailsExtentedProps) {\n super(props);\n this.state = {\n isDrawerOpen: false,\n drawerListId: undefined\n };\n }\n\n public async componentDidMount(): Promise {\n const { context, data } = this.props;\n // const catalogId = Msdyn365.getCatalogId(this.props.context.request);\n reaction(\n () => (data.product && data.product.result ? data.product.result.RecordId : null),\n () => {\n if (context && data.product.result && (this.props.data.generaProductAdditionalData === undefined ||(this.props.data.generaProductAdditionalData && this.props.data.generaProductAdditionalData.result === undefined)) ) {\n this.getProductSpecificationDatas();\n }\n }\n );\n }\n\n public async getProductSpecificationDatas(): Promise{\n getProductAdditionalDetailsAsync({callerContext: this.props.context.actionContext},this.props.data.product?.result!.RecordId).then(data=>{\n this.props.data.generaProductAdditionalData.result = data;\n }).catch((error: Error) => {\n });\n }\n\n public shouldComponentUpdate(nextProps: IGeneraProductAdditionalDetailsExtentedProps,\n nextState: IProductAdditionalDetailState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n let data: IGeneraProductAdditionalDetailsData;\n try {\n data = this.props.data;\n } catch (error) {\n this.props.telemetry.error(`Something went wrong ------${error}`);\n return (
\n {error}\n
);\n }\n\n if (!data.generaProductAdditionalData || (!data.generaProductAdditionalData.result || data.generaProductAdditionalData.result.length <= 0)) {\n this.props.telemetry.error('Product specification content is empty, module wont render.');\n return null;\n }\n\n const { heading, className } = this.props.config;\n const { generaProductAdditionalData } = this.props.data;\n const isAccrodion = this.props.config.displayStyle === displayStyle.accordion;\n const viewProps = {\n ...this.props,\n handleText: this.handleHeadingChange,\n ProductSpecification: {\n moduleProps: this.props,\n className: classnames('ms-product-specification', className)\n },\n ProductSpecificationTableProps: isAccrodion ? {\n moduleProps: this.props,\n className: classnames('ms-product-specification__accordion', className)\n } : {\n className: classnames('ms-product-specification__table table-striped table-bordered'),\n tag: 'table'\n },\n isAccrodion,\n ProductSpecificationTableBodyProps: isAccrodion ? {} : {\n className: '',\n tag: 'tbody'\n },\n title: heading?.text && (\n ),\n\n productSpecificationResult: isAccrodion ? generaProductAdditionalData.result && this._createDrawerBody(data) : generaProductAdditionalData.result && this._createTableBody(data)\n } as IGeneraProductAdditionalDetailsViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n\n /**\n * Handle Heading Text Change.\n * @param event - Current event.\n */\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n private _createTableBody(content: IGeneraProductAdditionalDetailsData): (JSX.Element | null)[] {\n return content.generaProductAdditionalData && content.generaProductAdditionalData.result && content.generaProductAdditionalData.result.length > 0 ?content.generaProductAdditionalData.result.map((product, index) => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n\n if (!cellData) {\n return null;\n }\n\n return (\n \n );\n }) : [];\n }\n\n private _createDrawerBody(content: IGeneraProductAdditionalDetailsData): (JSX.Element | null)[] {\n const accordionItemContainer: IModuleProps = {\n moduleProps: this.props,\n className: 'ms-product-specification-title'\n };\n return content.generaProductAdditionalData.result!.map((product) => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n if (!cellData) {\n return null;\n }\n return (\n \n \n
\n {cellData}\n
\n \n
\n );\n });\n }\n\n private readonly _toggle = (drawerListId: number | undefined) => (): void => {\n if (this.state.drawerListId !== drawerListId) {\n this.setState({ drawerListId, isDrawerOpen: true });\n } else {\n this.setState({ drawerListId: undefined, isDrawerOpen: false });\n }\n };\n\n private _renderProductCell(product: AttributeValue): JSX.Element | null {\n switch (product.DataTypeValue) {\n case 0: // None\n // Return span here instead of null so the row still shows\n return ;\n case 1: // Currency\n return this._renderCurrencyCell(product);\n case 2: // DateTime\n return this._renderDateTimeCell(product);\n case 3: // Decimal\n return this._renderDecimalCell(product);\n case 4: // Integer\n return this._renderIntegerCell(product);\n case 5: // Text\n return this._renderTextCell(product);\n case 6: // TrueFalse\n return this._renderTrueFalseCell(product);\n case 40: // Video\n this.props.telemetry.warning('Got video specification type, not supported yet so skipping line');\n return null;\n case 41: // Image\n this.props.telemetry.warning('Got image specification type, not supported yet so skipping line');\n return null;\n default:\n this.props.telemetry.warning(`Got unknown specification type ${product.DataTypeValue} so skipping line`);\n return null;\n }\n }\n\n private _renderCurrencyCell(product: AttributeValue): JSX.Element | null {\n if (product.CurrencyValue !== null && product.CurrencyValue !== undefined) {\n return (\n \n {product.CurrencyCode}\n {product.CurrencyValue}\n \n );\n }\n\n return null;\n }\n\n private _renderDateTimeCell(product: AttributeValue): JSX.Element | null {\n if (product.DateTimeOffsetValue?.toUTCString) {\n return (\n {product.DateTimeOffsetValue.toUTCString()}\n );\n }\n\n return null;\n }\n\n private _renderIntegerCell(product: AttributeValue): JSX.Element | null {\n if (product.IntegerValue !== null && product.IntegerValue !== undefined) {\n return (\n {product.IntegerValue}\n );\n }\n\n return null;\n }\n\n private _renderDecimalCell(product: AttributeValue): JSX.Element | null {\n if (product.FloatValue !== null && product.FloatValue !== undefined) {\n return (\n {product.FloatValue}\n );\n }\n\n return null;\n }\n\n private _renderTextCell(product: AttributeValue): JSX.Element | null {\n if (product.TextValue !== null && product.TextValue !== undefined) {\n return ;\n }\n\n return null;\n }\n\n private _renderTrueFalseCell(product: AttributeValue): JSX.Element | null {\n // TODO 20369885 setting to default value is needed to work around a platform bug where\n // config string value does not get its default value.\n if (product.BooleanValue) {\n return (\n {this.props.resources.trueValueText ? this.props.resources.trueValueText : 'Yes'}\n );\n }\n return (\n {this.props.resources.falseValueText ? this.props.resources.falseValueText : 'No'}\n );\n\n }\n}\n\nexport default GeneraProductAdditionalDetails;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IGeneraProductAdditionalDetailsViewProps } from './genera-product-additional-details';\n\nconst ProductAdditionalDetailsView: React.FC = props => {\n const { ProductSpecification, ProductSpecificationTableProps, ProductSpecificationTableBodyProps, productSpecificationResult } = props;\n const rowdata = productSpecificationResult &&\n ArrayExtensions.hasElements(productSpecificationResult) &&\n productSpecificationResult.filter((row) => !ObjectExtensions.isNullOrUndefined(row));\n\n return (\n rowdata && ArrayExtensions.hasElements(rowdata) ? (\n \n {props.title}\n \n \n { rowdata }\n \n \n ) : null\n );\n};\n\n\nexport default ProductAdditionalDetailsView;","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['genera-product-additional-details'] = {\n c: () => require('partner/modules/genera-product-additional-details/genera-product-additional-details.tsx'),\n $type: 'contentModule',\n da: [{name:'generaProductAdditionalData', path:'actions/get-custom-product-additional-details.action', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'genera-product-additional-details',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/genera-product-additional-details'\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 const sanitizedActionPath = 'actions/get-custom-product-additional-details.action';\n let dataAction = require('partner/actions/get-custom-product-additional-details.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|genera-product-additional-details|genera-product-additional-details'] = {\n c: () => require('partner/modules/genera-product-additional-details/genera-product-additional-details.view.tsx'),\n cn: '__local__-__local__-genera-product-additional-details'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["GetCustomProductSpecficiationInput","constructor","productId","channelId","config","getCacheKey","this","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","prodAttr","Array","response","getProductAdditionalDetailsAsync","callerContext","length","attr","KeyName","Name","TextValue","CountryLongName","DataTypeValue","push","ProductLifeCycleDescription","id","inputData","getSelectedProductIdFromActionInput","requestContext","apiSettings","Error","getProductAdditionalDetailsInput","queryResultSettings","DataServiceQuery","resultSettings","createDataServiceRequestForOperation","DataServiceEntities","bypassCache","returnEntity","ProductId","context","request","callActionOrExecute","displayStyle","HeadingTag","ProductSpecificationTableRow","_ref","productName","cellData","className","React","scope","dangerouslySetInnerHTML","getRichTextHtml","GeneraProductAdditionalDetails","props","super","handleHeadingChange","event","heading","text","target","value","_toggle","drawerListId","state","setState","isDrawerOpen","undefined","data","reaction","product","result","RecordId","generaProductAdditionalData","getProductSpecificationDatas","_this$props$data$prod","actionContext","then","catch","error","shouldComponentUpdate","nextProps","nextState","render","_heading$tag","telemetry","isAccrodion","accordion","viewProps","_objectSpread","handleText","ProductSpecification","moduleProps","classnames","ProductSpecificationTableProps","tag","ProductSpecificationTableBodyProps","title","editProps","onEdit","productSpecificationResult","_createDrawerBody","_createTableBody","renderView","content","map","index","_renderProductCell","key","accordionItemContainer","_product$Name","Module","Object","assign","Drawer","collapseProps","timeout","isOpen","openGlyph","closeGlyph","glyphPlacement","toggleButtonText","onToggle","_renderCurrencyCell","_renderDateTimeCell","_renderDecimalCell","_renderIntegerCell","_renderTextCell","_renderTrueFalseCell","warning","CurrencyValue","CurrencyCode","_product$DateTimeOffs","DateTimeOffsetValue","toUTCString","IntegerValue","FloatValue","BooleanValue","resources","trueValueText","falseValueText","rowdata","ArrayExtensions","hasElements","filter","row","ObjectExtensions","isNullOrUndefined","Node","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","window","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}