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ACwJ,IAAKrI,GAChBnB,EAAAA,aAAmBiJ,EAA4B,CAC5CW,YAAa1J,EAAAA,YAAY2J,UACzB5I,WAAYE,IAAUV,KAAK4H,MAAMxB,gBACjC3F,UAAWC,EACXG,MAAOb,KAAKJ,MAAMkC,OAkE9BgG,eAAeU,EAAuB9H,GAC1C,OACInB,EAAAA,cAACA,EAAAA,SAAc,CAACwJ,IAAKrI,GAChBnB,EAAAA,aAAmBiJ,EAA4B,CAC5CW,YAAa1J,EAAAA,YAAY4J,WACzB7I,WAAYE,IAAUV,KAAK4H,MAAMxB,gBACjC3F,UAAWC,EACXG,MAAOb,KAAKJ,MAAMkC,MAM1B0E,iBAAiBH,EAA0CiD,EAAmBC,GAClF,IAAIC,EAGAA,EADArB,EAAAA,GAA0BsB,UACpB,IAAIC,IAAIzE,OAAO0E,SAASC,MAExB,IAAIF,IAAIrD,EAAemD,IAAIK,WAAWD,MAGhD,MAAMlB,EAAS,IAAIzD,OAAO6E,gBAAgBN,EAAIO,QAG9C,OAFArB,EAAOsB,IAAIV,EAAWC,GACtBC,EAAIO,OAASE,mBAAmBvB,EAAOwB,YAChCV,EAAIU,aA5Ob7E,GAAGnD,EAAAA,EAAAA,IAAA,CADRC,EAAAA,IACKkD,GAgPN","sources":["webpack://bestseller.commerce.online/external var \"React\"?0d3b","webpack://bestseller.commerce.online/external var \"ReactDOM\"?853b","webpack://bestseller.commerce.online/./src/modules/tab-item/tab-item.tsx?b1b8","webpack://bestseller.commerce.online/./src/data-actions/tab-state-data-action.ts?09b4","webpack://bestseller.commerce.online/./src/modules/tab/tab.view.tsx?a99d","webpack://bestseller.commerce.online/./lib/tab/module-registration.js?a17c","webpack://bestseller.commerce.online/./src/modules/tab/tab.tsx?9ac6"],"sourcesContent":["module.exports = React;","module.exports = ReactDOM;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModuleProps, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ITabItemData } from './tab-item.data';\nimport { ITabItemProps } from './tab-item.props.autogenerated';\n\nexport interface ITabItemViewProps {\n TabContentContainer: IModuleProps;\n TabHeaderContainer: IModuleProps;\n tabSlots: INodeProps;\n TabItemContent: INodeProps;\n tabItemType?: TabItemType;\n tabHeader: React.ReactNode;\n}\n\nexport interface ITabItemExtentedProps extends ITabItemProps {\n tabItemType?: TabItemType;\n isSelected?: boolean;\n itemIndex?: number;\n tabId?: string;\n}\n\nexport enum TabItemType {\n TabHeader,\n TabContent\n}\n\n/**\n *\n * TabItem component.\n * @extends {React.Component}\n */\n@observer\nclass TabItem extends React.PureComponent {\n private readonly moduleContentClassName: string = 'ms-tab-item-content';\n\n private readonly moduleHeaderClassName: string = 'ms-tab-item-header';\n\n constructor(props: ITabItemProps) {\n super(props);\n this._renderTabHeader = this._renderTabHeader.bind(this);\n }\n\n public render(): JSX.Element {\n const { slots, renderView, config, data, isSelected, itemIndex } = this.props;\n const index = itemIndex || 0;\n const contentID = getContentID(index, this.props.tabId || '');\n const activeContentIDResult = data && data.activeTabState && data.activeTabState.result;\n const shown =\n activeContentIDResult &&\n activeContentIDResult.tabId === this.props.tabId &&\n activeContentIDResult.activeContentIndex !== undefined\n ? activeContentIDResult.activeContentIndex === index\n : isSelected || false;\n const viewProps = {\n ...this.props,\n TabContentContainer: {\n moduleProps: this.props,\n className: classnames(this.moduleContentClassName, config.className)\n },\n TabHeaderContainer: {\n moduleProps: this.props,\n className: classnames(this.moduleHeaderClassName, config.className)\n },\n TabItemContent: {\n className: 'ms-tab-item-content__content',\n tag: 'section' as NodeTag,\n 'aria-hidden': !shown,\n role: 'tabpanel',\n tabIndex: shown ? 0 : -1,\n id: contentID\n },\n tabHeader: this._renderTabHeader(),\n tabSlots: slots\n };\n return renderView(viewProps) as React.ReactElement;\n }\n\n private _renderTabHeader(): React.ReactNode {\n return <>{this.props.config.tabItemTitle};\n }\n}\n\nexport const getContentID = (index: number, id: string) => {\n return `tab-item-content-${id}-${index}`;\n};\n\nexport default TabItem;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IActiveTabState } from './tab-state';\n\nexport function createTabStateInput(result: IActiveTabState): GenericInput {\n return new GenericInput('activeTabState', result, 'IActiveTabState');\n}\n\nconst createTabStateInputInternal = (): IActionInput => {\n return createTabStateInput({});\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createTabStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ITabViewProps } from './tab';\n\nconst tabView: React.FC = props => {\n const { heading, TabContainer, tabHeaders, tabContents } = props;\n if (!props.heading && !props.tabHeaders && !props.tabContents) {\n props.context.telemetry.error('Tab content is empty, module wont render');\n return null;\n }\n return (\n \n {heading}\n {tabHeaders}\n {tabContents}\n \n );\n};\n\nexport default tabView;\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['tab'] = {\n c: () => require('@msdyn365-commerce-modules/tab/dist/lib/modules/tab/tab'),\n $type: 'moduleDefinition',\n da: [{name:'activeTabState', path:'@msdyn365-commerce-modules/tab/dist/lib/data-actions/tab-state-data-action', runOn: 0}],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'tab',\n p: 'tab',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/tab/dist/lib/modules/tab'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/tab/dist/lib/data-actions/tab-state-data-action';\n let dataAction = require('@msdyn365-commerce-modules/tab/dist/lib/data-actions/tab-state-data-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['@msdyn365-commerce-modules|tab|modules|tab|tab'] = {\n c: () => require('@msdyn365-commerce-modules/tab/dist/lib/modules/tab/tab.view.js'),\n cn: '@msdyn365-commerce-modules-tab-tab'\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 * as MsDyn365 from '@msdyn365-commerce/core';\nimport { IModuleProps, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { createTabStateInput, getContentID, TabItemType } from '../..';\nimport { ITabData } from './tab.data';\nimport { ITabProps } from './tab.props.autogenerated';\n\n/**\n *\n * Tab component.\n * @extends {React.PureComponent>}\n */\n\nexport interface ICallToActionProps {\n link: INodeProps[];\n}\n\nexport interface ITabViewProps extends ITabProps<{}> {\n heading?: React.ReactNode;\n TabContainer: IModuleProps;\n headerSection: INodeProps;\n tabHeaderSection: INodeProps;\n tabsSection: INodeProps;\n tabItemContainer: INodeProps;\n tabHeaders: React.ReactNode;\n tabContents: React.ReactNode;\n}\n\nexport interface ITabViewStates {\n currentTabIndex: number;\n}\n\n/**\n *\n * Tab component.\n * @extends {React.Component>}\n */\n@observer\nclass Tab extends React.Component, ITabViewStates> {\n public readonly tabIndexQuery: string = 'activeTab';\n\n private activeLink: HTMLLIElement | null;\n\n constructor(props: ITabProps) {\n super(props);\n const { defaultTabIndex } = this.props.config;\n const { slots } = this.props;\n const slotLength = (slots && slots.tabItems && slots.tabItems.length) || 0;\n let initialIndex = defaultTabIndex && defaultTabIndex <= slotLength && defaultTabIndex > 0 ? defaultTabIndex - 1 : 0;\n const queryString: string =\n (this.props.context &&\n this.props.context.request &&\n this.props.context.request.query &&\n this.props.context.request.query.activeTab) ||\n '';\n let queryTabIndex: number = 0;\n if (queryString.indexOf(':') > 0) {\n const arr = queryString.split(':');\n const moduleId = arr[0];\n if (moduleId === this.props.id) {\n queryTabIndex = Number.parseInt(arr[1], 10);\n }\n }\n initialIndex = queryTabIndex > 0 && queryTabIndex <= slotLength ? queryTabIndex - 1 : initialIndex;\n this.state = { currentTabIndex: initialIndex };\n\n this._getTabHeader = this._getTabHeader.bind(this);\n this._getTabContent = this._getTabContent.bind(this);\n this._onClick = this._onClick.bind(this);\n this._onKeyDown = this._onKeyDown.bind(this);\n this._setGetParameter = this._setGetParameter.bind(this);\n this.activeLink = null;\n }\n\n public shouldComponentUpdate(nextProps: ITabProps, nextState: ITabViewStates): 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 {\n const { slots } = this.props;\n const { heading, className } = this.props.config;\n\n const headingComponent = heading && (\n \n );\n const slotLength = (slots && slots.tabItems && slots.tabItems.length) || 0;\n\n // Const queryTabIndex = this.props.context && this.props.context.request && this.props.context.request.query && +this.props.context.request.query.activeTabIndex || 0;\n // let activeIndex = defaultTabIndex && defaultTabIndex <= slotLength && defaultTabIndex > 0 ? defaultTabIndex - 1 : 0;\n // activeIndex = queryTabIndex > 0 && queryTabIndex <= slotLength ? queryTabIndex - 1 : activeIndex;\n\n const tabViewProps = {\n ...this.props,\n TabContainer: {\n moduleProps: this.props,\n className: classnames('ms-tab', className)\n },\n headerSection: { className: 'ms-tab-header-section' },\n tabsSection: { className: 'ms-tab-tabs-section', tag: 'ul' as NodeTag, role: 'tablist' },\n heading: headingComponent,\n config: this.props && this.props.config,\n tabItemContainer: {\n tag: 'div' as NodeTag,\n className: 'ms-tab-content-section'\n },\n tabContents: slotLength > 0 && slots.tabItems.map((item: React.ReactNode, index: number) => this._getTabContent(item, index)),\n tabHeaders: slotLength > 0 && slots.tabItems.map((item: React.ReactNode, index: number) => this._getTabHeader(item, index))\n };\n return this.props.renderView(tabViewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: MsDyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\n\n public componentDidUpdate(): void {\n const { data } = this.props;\n if (!this.props.context.request.params.isEditor) {\n const dataActionTabId = data && data.activeTabState && data.activeTabState.result && data.activeTabState.result.tabId;\n if (dataActionTabId) {\n if (this.props.id === dataActionTabId) {\n this.activeLink && this.activeLink.focus();\n }\n } else {\n const queryString: string =\n (this.props.context &&\n this.props.context.request &&\n this.props.context.request.query &&\n this.props.context.request.query.activeTab) ||\n '';\n if (queryString.indexOf(':') > 0) {\n const arr = queryString.split(':');\n const moduleId = arr[0];\n if (moduleId === this.props.id) {\n this.activeLink && this.activeLink.focus();\n }\n }\n }\n }\n }\n\n /**\n *Set the activate link value on tab click.\n * @param link -Ref link value.\n */\n private readonly _refHandler = (link: HTMLLIElement | null) => {\n this.activeLink = link;\n };\n\n private _getTabHeader(item: React.ReactNode, index: number): React.ReactNode {\n const { data } = this.props;\n const activeContentIndex =\n data && data.activeTabState && data.activeTabState.result && data.activeTabState.result.activeContentIndex;\n const dataActionTabId = data && data.activeTabState && data.activeTabState.result && data.activeTabState.result.tabId;\n const selected =\n activeContentIndex !== undefined && dataActionTabId === this.props.id\n ? activeContentIndex === index\n : this.state.currentTabIndex === index;\n const contentID = getContentID(index, this.props.id);\n\n return (\n \n \n {React.cloneElement(item as React.ReactElement, {\n tabItemType: TabItemType.TabHeader,\n isSelected: index === this.state.currentTabIndex,\n itemIndex: index,\n tabId: this.props.id\n })}\n \n \n );\n }\n\n private readonly _onClick = (index: number, id: string) => (e: React.MouseEvent) => {\n const activeTabState = { activeContentIndex: index, tabId: id };\n this.props.context.actionContext.update(createTabStateInput(activeTabState), activeTabState);\n this.setState({ currentTabIndex: index });\n\n // Update query paramter\n const requestContext = this.props.context.request;\n const newUrl = this._setGetParameter(requestContext, this.tabIndexQuery, `${this.props.id}:${String(index + 1)}`);\n requestContext && window.history.pushState({ path: newUrl }, '', newUrl);\n };\n\n private readonly _onKeyDown = (index: number, id: string) => (e: React.KeyboardEvent) => {\n if (e.keyCode === 13) {\n const activeTabState = { activeContentIndex: index, tabId: id };\n this.props.context.actionContext.update(createTabStateInput(activeTabState), activeTabState);\n this.setState({ currentTabIndex: index });\n\n // Update query paramter\n const requestContext = this.props.context.request;\n const newUrl = this._setGetParameter(requestContext, this.tabIndexQuery, `${this.props.id}:${String(index + 1)}`);\n requestContext && window.history.pushState({ path: newUrl }, '', newUrl);\n }\n\n if (e.keyCode === 39 || e.keyCode === 37) {\n const { slots } = this.props;\n const slotLength = (slots && slots.tabItems && slots.tabItems.length) || 0;\n\n if (e.keyCode === 39) {\n // If we're at the end, go to the start\n if (index + 1 === slotLength) {\n index = -1;\n }\n const activeTabState = { activeContentIndex: index + 1, tabId: id };\n this.props.context.actionContext.update(createTabStateInput(activeTabState), activeTabState);\n this.setState({ currentTabIndex: index + 1 });\n\n // Update query paramter\n const requestContext = this.props.context.request;\n const newUrl = this._setGetParameter(requestContext, this.tabIndexQuery, `${this.props.id}:${String(index + 2)}`);\n requestContext && window.history.pushState({ path: newUrl }, '', newUrl);\n\n // Move left\n } else if (e.keyCode === 37) {\n // If we're at the start, move to the end\n if (index === 0) {\n index = slotLength;\n }\n const activeTabState = { activeContentIndex: index - 1, tabId: id };\n this.props.context.actionContext.update(createTabStateInput(activeTabState), activeTabState);\n this.setState({ currentTabIndex: index - 1 });\n\n // Update query paramter\n const requestContext = this.props.context.request;\n const newUrl = this._setGetParameter(requestContext, this.tabIndexQuery, `${this.props.id}:${String(index)}`);\n requestContext && window.history.pushState({ path: newUrl }, '', newUrl);\n }\n }\n };\n\n private _getTabContent(item: React.ReactNode, index: number): React.ReactNode {\n return (\n \n {React.cloneElement(item as React.ReactElement, {\n tabItemType: TabItemType.TabContent,\n isSelected: index === this.state.currentTabIndex,\n itemIndex: index,\n tabId: this.props.id\n })}\n \n );\n }\n\n private _setGetParameter(requestContext: MsDyn365.IRequestContext, paramName: string, paramValue: string): string {\n let url;\n\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n url = new URL(window.location.href);\n } else {\n url = new URL(requestContext.url.requestUrl.href);\n }\n\n const params = new window.URLSearchParams(url.search);\n params.set(paramName, paramValue);\n url.search = decodeURIComponent(params.toString());\n return url.toString();\n }\n}\n\nexport default Tab;\n"],"names":["module","exports","React","ReactDOM","TabItemType","TabItem","constructor","props","super","moduleContentClassName","moduleHeaderClassName","this","_renderTabHeader","bind","render","slots","renderView","config","data","isSelected","itemIndex","index","contentID","getContentID","tabId","activeContentIDResult","activeTabState","result","shown","undefined","activeContentIndex","_objectSpread","TabContentContainer","moduleProps","className","classnames","TabHeaderContainer","TabItemContent","tag","role","tabIndex","id","tabHeader","tabSlots","tabItemTitle","__decorate","observer","createTabStateInput","GenericInput","getGenericActionDataAction","createObservableDataAction","action","getGenericAction","input","createTabStateInputInternal","heading","TabContainer","tabHeaders","tabContents","Module","Object","assign","Node","headerSection","tabsSection","tabItemContainer","context","telemetry","error","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","Tab","tabIndexQuery","handleHeadingChange","event","text","target","value","_refHandler","link","activeLink","_onClick","e","actionContext","update","setState","currentTabIndex","requestContext","request","newUrl","_setGetParameter","String","history","pushState","_onKeyDown","keyCode","slotLength","tabItems","length","defaultTabIndex","initialIndex","queryString","query","activeTab","queryTabIndex","indexOf","arr","split","Number","parseInt","state","_getTabHeader","_getTabContent","shouldComponentUpdate","nextProps","nextState","headingComponent","MsDyn365","editProps","onEdit","tabViewProps","map","item","componentDidUpdate","params","isEditor","dataActionTabId","focus","selected","key","onClick","onKeyDown","ref","tabItemType","TabHeader","TabContent","paramName","paramValue","url","isBrowser","URL","location","href","requestUrl","URLSearchParams","search","set","decodeURIComponent","toString"],"sourceRoot":""}