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f40d","webpack://henrys-ecommerce/./src/modules/account-block/utilities/renderAccountBlock.tsx?e1f8","webpack://henrys-ecommerce/./src/modules/account-block/account-block.view.tsx?f7d7","webpack://henrys-ecommerce/./lib/account-block/module-registration.js?b1b5","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/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 React from 'react';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n INodeProps,\r\n ITelemetryContent,\r\n onTelemetryClick,\r\n Popover,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { IAccountBlockData } from './account-block.data';\r\nimport { IAccountBlockProps, IMyAccountLinksData } from './account-block.props.autogenerated';\r\nimport { ILinksData, Link, ContentEditableEvent } from '@msdyn365-commerce/core';\r\n\r\nexport interface IAccountBlockViewProps extends IAccountBlockProps {\r\n AccountInfoDropdownParentContainer?: INodeProps;\r\n AccountInfoDropdownPopoverConentContainer?: INodeProps;\r\n accountInfoDropdownButton?: React.ReactNode;\r\n\r\n signOutLink?: React.ReactNode;\r\n signInLink?: React.ReactNode;\r\n accountLinks?: React.ReactNode[];\r\n}\r\n\r\n/**\r\n *\r\n * AccountBlock component\r\n * @extends {React.PureComponent>}\r\n */\r\nconst AccountBlock = (props: IAccountBlockProps) => {\r\n const {\r\n data: { accountInformation }\r\n } = props;\r\n\r\n const customer = accountInformation && accountInformation.result;\r\n\r\n const popOverRef = React.useRef(null);\r\n const [signinPopoverOpen, setSigninPopoverOpen] = React.useState(false);\r\n\r\n const displayName = customer ? customer.FirstName || customer.Name : undefined;\r\n\r\n const telemetryContent = React.useMemo(() => {\r\n return getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n }, [props]);\r\n\r\n const togglePopover = React.useCallback(() => {\r\n setSigninPopoverOpen(!signinPopoverOpen);\r\n }, [signinPopoverOpen]);\r\n\r\n const getAccountInfoDropdownButton = () => {\r\n const payLoad = getPayloadObject('click', telemetryContent, TelemetryConstant.MyProfile);\r\n const attributes = getTelemetryAttributes(telemetryContent, payLoad);\r\n return (\r\n displayName && (\r\n \r\n {displayName}\r\n \r\n )\r\n );\r\n };\r\n\r\n const viewProps: IAccountBlockViewProps = {\r\n ...props,\r\n AccountInfoDropdownParentContainer: {\r\n className: 'ms-header__account-info'\r\n },\r\n AccountInfoDropdownPopoverConentContainer:\r\n (displayName && {\r\n tag: Popover,\r\n id: 'myprofilePopover',\r\n className: 'ms-header__account-info-content',\r\n placement: 'bottom',\r\n isOpen: signinPopoverOpen,\r\n target: popOverRef,\r\n toggle: togglePopover\r\n }) ||\r\n undefined,\r\n accountInfoDropdownButton: getAccountInfoDropdownButton(),\r\n signInLink: getSigninButton(props, telemetryContent),\r\n signOutLink: getSignOutButton(props, telemetryContent),\r\n accountLinks: getAccountLinks(props, telemetryContent)\r\n };\r\n\r\n return props.renderView(viewProps);\r\n};\r\n\r\nconst getSigninButton = (props: IAccountBlockProps, telemetryContent: ITelemetryContent) => {\r\n const {\r\n data: { accountInformation },\r\n context: {\r\n request: { user }\r\n },\r\n resources\r\n } = props;\r\n\r\n const customer = accountInformation && accountInformation.result;\r\n const payLoad = getPayloadObject('click', telemetryContent, TelemetryConstant.SignIn);\r\n const attributes = getTelemetryAttributes(telemetryContent, payLoad);\r\n return (\r\n !customer && (\r\n \r\n \r\n {resources.signInLinkText}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nconst getSignOutButton = (props: IAccountBlockProps, telemetryContent: ITelemetryContent) => {\r\n const {\r\n data: { accountInformation },\r\n context: {\r\n request: { user }\r\n },\r\n resources\r\n } = props;\r\n\r\n const customer = accountInformation && accountInformation.result;\r\n const displayName = customer ? customer.FirstName || customer.Name : undefined;\r\n\r\n const payLoad = getPayloadObject('click', telemetryContent, TelemetryConstant.SignOut);\r\n const attributes = getTelemetryAttributes(telemetryContent, payLoad);\r\n return (\r\n customer &&\r\n displayName && (\r\n \r\n \r\n {resources.signOutLinkText}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nconst getAccountLinks = (props: IAccountBlockProps, telemetryContent: ITelemetryContent) => {\r\n const {\r\n data: { accountInformation },\r\n context,\r\n config: { myAccountLinks }\r\n } = props;\r\n\r\n const customer = accountInformation && accountInformation.result;\r\n const displayName = customer ? customer.FirstName || customer.Name : undefined;\r\n const payLoad = getPayloadObject('click', telemetryContent, '');\r\n if (!customer || !displayName || !myAccountLinks || !myAccountLinks.length) {\r\n return undefined;\r\n }\r\n return myAccountLinks.map((cta: IMyAccountLinksData, index: number) => {\r\n payLoad.contentAction.etext = cta.linkText;\r\n const attributes = getTelemetryAttributes(telemetryContent, payLoad);\r\n const editableLink: ILinksData = {\r\n ariaLabel: cta.ariaLabel,\r\n className: 'ms-signin-info__account-link-button',\r\n linkText: cta.linkText,\r\n linkUrl: cta.linkUrl.destinationUrl,\r\n openInNewTab: cta.openInNewTab,\r\n role: 'button',\r\n additionalProperties: attributes\r\n };\r\n\r\n return (\r\n \r\n );\r\n });\r\n};\r\n\r\nconst handleLinkTextChange = (props: IAccountBlockProps, linkIndex: number) => (event: ContentEditableEvent) => {\r\n if (props.config.myAccountLinks && props.config.myAccountLinks[linkIndex]) {\r\n props.config.myAccountLinks[linkIndex].linkText = event.target.value;\r\n }\r\n};\r\n\r\nexport default AccountBlock;\r\n","import * as React from 'react';\r\nimport classnames from 'classnames';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { IAccountBlockViewProps } from '../account-block';\r\n\r\nconst renderAccountBlock = (props: IAccountBlockViewProps, renderForMobile: boolean): JSX.Element | null => {\r\n const {\r\n AccountInfoDropdownParentContainer,\r\n AccountInfoDropdownPopoverConentContainer,\r\n accountInfoDropdownButton,\r\n signOutLink,\r\n signInLink,\r\n accountLinks\r\n } = props;\r\n\r\n if (AccountInfoDropdownParentContainer) {\r\n const accountClassName = classnames(\r\n AccountInfoDropdownParentContainer.className,\r\n renderForMobile ? 'account-mobile' : 'account-desktop'\r\n );\r\n if (AccountInfoDropdownPopoverConentContainer) {\r\n return (\r\n \r\n {accountInfoDropdownButton}\r\n \r\n {accountLinks ? accountLinks.map((link: React.ReactNode) => link) : false}\r\n {signOutLink}\r\n \r\n \r\n );\r\n } else if (signInLink) {\r\n return (\r\n \r\n {signInLink}\r\n \r\n );\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { renderAccountBlock };\r\n","import * as React from 'react';\r\nimport { IAccountBlockViewProps } from './account-block';\r\nimport { renderAccountBlock } from './utilities';\r\n\r\nexport default (props: IAccountBlockViewProps) => {\r\n return
{renderAccountBlock(props, false)}
;\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['account-block'] = {\n c: () => require('partner/modules/account-block/account-block.tsx'),\n $type: 'contentModule',\n da: [{name:'accountInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'account-block',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/account-block'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\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|account-block|account-block'] = {\n c: () => require('partner/modules/account-block/account-block.view.tsx'),\n cn: '__local__-__local__-account-block'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["getSigninButton","props","telemetryContent","data","accountInformation","context","request","user","resources","customer","result","payLoad","getPayloadObject","TelemetryConstant","SignIn","attributes","getTelemetryAttributes","React","Button","Object","assign","className","title","signInLinkText","href","signInUrl","signInLinkAriaText","onClick","onTelemetryClick","getSignOutButton","displayName","FirstName","Name","undefined","SignOut","signOutLinkText","signOutUrl","signOutLinkAriaText","getAccountLinks","config","myAccountLinks","length","map","cta","index","contentAction","etext","linkText","editableLink","ariaLabel","linkUrl","destinationUrl","openInNewTab","role","additionalProperties","Link","key","link","editProps","onTextChange","handleLinkTextChange","requestContext","linkIndex","event","target","value","popOverRef","signinPopoverOpen","setSigninPopoverOpen","getTelemetryObject","telemetryPageName","friendlyName","telemetry","togglePopover","viewProps","_objectSpread","AccountInfoDropdownParentContainer","AccountInfoDropdownPopoverConentContainer","tag","Popover","id","placement","isOpen","toggle","accountInfoDropdownButton","getAccountInfoDropdownButton","MyProfile","innerRef","color","signInLink","signOutLink","accountLinks","renderView","renderAccountBlock","renderForMobile","accountClassName","classnames","Node","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__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}