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QAAQ,qBAAuB,CACpCE,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,GAEJC,KAAK,EACLC,GAAI,YACJC,EAAG,oBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,iCAKRC,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAab,QAAOtB,EAAAA,EAAA,GACpBkC,OAAOC,aAAab,SAAW,IAC/BD,EAAQC,SAGXY,OAAOC,aAAaZ,YAAWvB,EAAAA,EAAA,GAC5BkC,OAAOC,aAAaZ,aAAe,IACnCF,EAAQE,aAEY,MAAMa,EAAiB,GAC9BA,EAAe,mEAAqE,CAC5FZ,EAAGA,IAAMC,EAAQ,MACjBY,GAAI,yCAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaC,eAAcpC,EAAAA,EAAA,GACPkC,OAAOC,aAAaC,gBAAkB,IACtCA,I,MCtC3BE,EAAOC,QAAU1B,O,OCAjByB,EAAOC,QAAUC,W","sources":["webpack://henrys-ecommerce/./src/modules/hei-store-picture/hei-store-picture.tsx?cf62","webpack://henrys-ecommerce/./src/modules/hei-store-picture/hei-store-picture.view.tsx?cd89","webpack://henrys-ecommerce/./lib/hei-store-picture/module-registration.js?ab32","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b"],"sourcesContent":["import { OrgUnitLocation, OrgUnitsDataActions } from '@msdyn365-commerce/retail-proxy';\r\nimport { useEffect, useState } from 'react';\r\nimport { IHeiStorePictureData } from './hei-store-picture.data';\r\nimport { IHeiStorePictureProps } from './hei-store-picture.props.autogenerated';\r\n\r\nexport interface IHeiStorePictureViewProps extends IHeiStorePictureProps {\r\n storeName: string;\r\n}\r\n\r\nconst HeiStorePicture = (props: IHeiStorePictureProps) => {\r\n const {\r\n config: { orgUnitNumber },\r\n context\r\n } = props;\r\n\r\n const [orgUnitLocation, setOrgUnitLocation] = useState();\r\n const [storeInfoLoaded, setStoreInfoLoaded] = useState(false);\r\n\r\n useEffect(() => {\r\n const ctx = { callerContext: context.actionContext };\r\n\r\n if (storeInfoLoaded) {\r\n return;\r\n }\r\n\r\n setStoreInfoLoaded(true);\r\n\r\n void (async () => {\r\n try {\r\n const allStores = await OrgUnitsDataActions.searchOrgUnitLocationsAsync(ctx, {\r\n OrgUnitNumber: orgUnitNumber\r\n });\r\n\r\n const store = allStores?.find(s => s.OrgUnitNumber === orgUnitNumber);\r\n\r\n if (store) {\r\n setOrgUnitLocation(store);\r\n }\r\n } catch (error) {\r\n context.telemetry.exception(error as Error);\r\n }\r\n })();\r\n }, [orgUnitNumber]);\r\n\r\n if (!orgUnitLocation) {\r\n return null;\r\n }\r\n\r\n return props.renderView({\r\n ...props,\r\n storeName: orgUnitLocation.OrgUnitName\r\n });\r\n};\r\n\r\nexport default HeiStorePicture;\r\n","import * as React from 'react';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { IHeiStorePictureViewProps } from './hei-store-picture';\r\nimport classnames from 'classnames';\r\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nexport default (props: IHeiStorePictureViewProps) => {\r\n const {\r\n config: { className, orgUnitNumber, altText },\r\n context: { request },\r\n storeName\r\n } = props;\r\n\r\n const { locale, apiSettings, gridSettings } = request;\r\n\r\n if (!gridSettings) {\r\n return null;\r\n }\r\n\r\n const fileName = `Catalogs/${locale}/Store_${orgUnitNumber}_${locale}.jpg`;\r\n const storeImageUrl = generateImageUrl(fileName, apiSettings);\r\n const ImageData: Msdyn365.IImageData = { src: storeImageUrl };\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['hei-store-picture'] = {\n c: () => require('partner/modules/hei-store-picture/hei-store-picture.tsx'),\n $type: 'contentModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'hei-store-picture',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/hei-store-picture'\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|hei-store-picture|hei-store-picture'] = {\n c: () => require('partner/modules/hei-store-picture/hei-store-picture.view.tsx'),\n cn: '__local__-__local__-hei-store-picture'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["props","config","orgUnitNumber","context","orgUnitLocation","setOrgUnitLocation","useState","storeInfoLoaded","setStoreInfoLoaded","useEffect","ctx","callerContext","actionContext","allStores","OrgUnitsDataActions","OrgUnitNumber","store","find","s","error","telemetry","exception","renderView","_objectSpread","storeName","OrgUnitName","className","altText","request","locale","apiSettings","gridSettings","fileName","ImageData","src","generateImageUrl","React","classnames","Msdyn365","Object","assign","title","loadFailureBehavior","id","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}