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CAAC,GAChCD,EAAQC,SAGX7F,OAAOoH,aAAatB,YAAWzH,EAAAA,EAAA,GAC5B2B,OAAOoH,aAAatB,aAAe,CAAC,GACpCF,EAAQE,aAEY,MAAMuB,EAAiB,CAAC,EAC/BA,EAAe,yEAA2E,CAClGtB,EAAGA,IAAMC,EAAQ,MACjBsB,GAAI,4CAEpBtH,OAAOoH,aAAepH,OAAOoH,cAAgB,CAAC,EAC9CpH,OAAOoH,aAAaC,eAAchJ,EAAAA,EAAA,GACP2B,OAAOoH,aAAaC,gBAAkB,CAAC,GACvCA,UCnF3BE,EAAOC,QAAUrK,cCAjBoK,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/components/breakpoints.ts?f4e7","webpack://Msdyn365.Commerce.Online/./src/modules/ecomm-product-slider/ecomm-product-slider.tsx?d637","webpack://Msdyn365.Commerce.Online/./src/modules/ecomm-product-slider/components/slider-card.tsx?98f0","webpack://Msdyn365.Commerce.Online/./src/modules/ecomm-product-slider/components/slider-filter.tsx?f577","webpack://Msdyn365.Commerce.Online/./src/modules/ecomm-product-slider/ecomm-product-slider.view.tsx?6101","webpack://Msdyn365.Commerce.Online/./lib/ecomm-product-slider/module-registration.js?64df","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["// <= 999 = Mobile\r\n// >= 1000 = Tablet and Desktop\r\n\r\nexport const enum Breakpoints {\r\n small = 540,\r\n medium = 768,\r\n large = 992\r\n}\r\n\r\nexport function isMobile (width: number): boolean {\r\n return width < Breakpoints.large;\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 * as React from 'react';\r\n\r\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IGridSettings } from '@msdyn365-commerce/core-internal';\r\nimport { searchByCategoryAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\nimport { IEcommProductSliderData } from './ecomm-product-slider.data';\r\nimport { IEcommProductSliderProps } from './ecomm-product-slider.props.autogenerated';\r\n\r\nexport interface IEcommProductSliderViewProps extends IEcommProductSliderProps {\r\n indexes: number[];\r\n parentCategoryId: number;\r\n subCategories: CategoryHierarchy[];\r\n gridSettings: IGridSettings;\r\n}\r\n\r\n/**\r\n *\r\n * EcommProductSlider component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass EcommProductSlider extends React.PureComponent> {\r\n private _indexes: number[] =[];\r\n\r\n public render(): JSX.Element | null {\r\n const { data: { hierarchy }, config } = this.props;\r\n\r\n let parentCategoryId = 0;\r\n\r\n if (hierarchy && hierarchy.result) {\r\n const result = hierarchy.result.find(item => item.Name === config.categoryName)?.RecordId;\r\n\r\n parentCategoryId = result ? result : 0;\r\n }\r\n\r\n const EcommProductSliderViewProps = {\r\n ...this.props,\r\n indexes: this._indexes,\r\n parentCategoryId: parentCategoryId,\r\n subCategories: this._getChildCategories()\r\n };\r\n\r\n return this.props.renderView(EcommProductSliderViewProps);\r\n }\r\n\r\n private _getChildCategories(): CategoryHierarchy[] {\r\n const { data: { hierarchy }, config, context } = this.props;\r\n\r\n const result: CategoryHierarchy[] = [];\r\n\r\n if (hierarchy && hierarchy.result) {\r\n hierarchy.result.forEach(item => {\r\n // Quick links level e.g. offerings, donations etc.\r\n if (item.Name?.toLowerCase() === config.categoryName?.toLowerCase()) {\r\n if (item.Children) {\r\n // Sub categories under a quick link level e.g. halls.\r\n item.Children.forEach((child: CategoryHierarchy) => {\r\n searchByCategoryAsync({ callerContext: context.actionContext }, context.request.apiSettings.channelId, context.request.apiSettings.catalogId, child.RecordId)\r\n .then(products => {\r\n if (products && products.length > 0) { \r\n if (this._indexes.length === 0) {\r\n this._indexes.push(0);\r\n } else {\r\n this._indexes.push(this._indexes[this._indexes.length - 1] + products.length);\r\n }\r\n }\r\n });\r\n \r\n result.push(child)\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n\r\nexport default EcommProductSlider;\r\n","import * as React from 'react';\r\n\r\nimport { ICoreContext, Image } from '@msdyn365-commerce/core';\r\nimport { IGridSettings } from '@msdyn365-commerce/core-internal';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { getFallbackImageUrl, getProductUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\ninterface ISliderCard {\r\n button_text: string;\r\n category?: string;\r\n context: ICoreContext;\r\n enableDescription?: boolean;\r\n enableLocation?: boolean;\r\n enablePrice?: boolean;\r\n gridSettings: IGridSettings;\r\n product: SimpleProduct;\r\n mobileMode: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * EcommContentTemplate1View component\r\n * @extends {React.PureComponent}\r\n */\r\nexport class SliderCard extends React.PureComponent {\r\n public state: any = { hasMounted: false };\r\n\r\n public componentDidMount(): void {\r\n if (!this.state.hasMounted) {\r\n this.setState({ hasMounted: true });\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this.state.hasMounted) {\r\n return null;\r\n }\r\n\r\n if (this.props.mobileMode) {\r\n return (\r\n
\r\n {this._renderImage()}\r\n {this._renderInfo()}\r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n {this._renderImage()}\r\n {this._renderInfo()}\r\n
\r\n
\r\n );\r\n }\r\n\r\n private _renderImage(): JSX.Element | null {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n\r\n private _renderInfo(): JSX.Element | null {\r\n const DescriptionStyle = this.props.enableDescription ? 'info-description ellipsis' : 'no-display';\r\n const LocationStyle = this.props.enableLocation ? 'info-category' : 'no-display';\r\n const PriceStyle = this.props.enablePrice ? '' : 'no-display';\r\n\r\n return (\r\n
\r\n

{this.props.category === undefined ? '' : this.props.category}

\r\n

{this.props.product.Name}

\r\n {!this.props.mobileMode &&

{this.props.product.Description}

}\r\n

${this.props.product.Price}

\r\n
\r\n );\r\n }\r\n\r\n private _onClick = () => {\r\n if (typeof window !== 'undefined') {\r\n window.location.assign(getProductUrlSync(this.props.product, this.props.context.actionContext, undefined));\r\n }\r\n }\r\n}\r\n\r\nexport default SliderCard;","import * as React from 'react';\r\n\r\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\r\n\r\ninterface ISliderFilter {\r\n category?: CategoryHierarchy;\r\n callback?: any;\r\n}\r\n\r\n/**\r\n *\r\n * EcommContentTemplate1View component\r\n * @extends {React.PureComponent}\r\n */\r\nexport class SliderFilter extends React.PureComponent {\r\n public render(): JSX.Element | null {\r\n return ;\r\n }\r\n\r\n private _handleOnClick = () => {\r\n this.props.callback(this.props.category?.RecordId);\r\n }\r\n}\r\n\r\nexport default SliderFilter;","/*!\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\n\r\nimport Carousel from 'react-multi-carousel';\r\n\r\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { searchByCategoryAsync, getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\nimport { isMobile } from '../../components/breakpoints';\r\n\r\nimport SliderCard from './components/slider-card';\r\nimport SliderFilter from './components/slider-filter';\r\n\r\nimport { IEcommProductSliderViewProps } from './ecomm-product-slider';\r\n\r\n/**\r\n *\r\n * EcommContentTemplate1View component\r\n * @extends {React.PureComponent}\r\n */\r\nexport class EcommProductSliderView extends React.PureComponent {\r\n public state: any = { width: 0, currCategoryId: 0, productList: [], hasMounted: false };\r\n\r\n public componentDidMount(): void {\r\n if (this.props.subCategories.length > 0) {\r\n window.addEventListener('resize', this._updateDimensions);\r\n\r\n this.setState({ width: window.innerWidth, currCategoryId: this.props.subCategories[0].RecordId, hasMounted: true });\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this.state.hasMounted) {\r\n return null;\r\n }\r\n \r\n const { indexes, parentCategoryId, subCategories, config, context, gridSettings } = this.props;\r\n\r\n const responsive = {\r\n superLargeDesktop: {\r\n breakpoint: { max: 4000, min: 992 },\r\n items: 5,\r\n slidesToSlide: 5\r\n },\r\n desktop: {\r\n breakpoint: { max: 992, min: 768 },\r\n items: 4,\r\n slidesToSlide: 4\r\n },\r\n tablet: {\r\n breakpoint: { max: 768, min: 540 },\r\n items: 4,\r\n slidesToSlide: 4\r\n },\r\n mobile: {\r\n breakpoint: { max: 540, min: 0 },\r\n items: 2,\r\n slidesToSlide: 2\r\n }\r\n };\r\n\r\n const mobileMode = isMobile(this.state.width);\r\n\r\n const categoryId = mobileMode ? parentCategoryId : (this.state.currCategoryId === 0 ? parentCategoryId : this.state.currCategoryId);\r\n\r\n searchByCategoryAsync({ callerContext: context.actionContext }, context.request.apiSettings.channelId, context.request.apiSettings.catalogId, categoryId)\r\n .then(result => {\r\n if (result && result.length > 0) {\r\n const productIds: number[] = [];\r\n\r\n result.map(item => productIds.push(item.RecordId));\r\n\r\n getByIdsAsync({ callerContext: context.actionContext }, context.request.apiSettings.channelId, productIds)\r\n .then(ret => this.setState({ productList: ret }) );\r\n }\r\n });\r\n\r\n const bg = config.bgImage?.src ? { backgroundImage: `url(${config.bgImage.src})`} : { backgroundImage: '' };\r\n const showArrows = mobileMode ? false : true;\r\n const spd = config.sliderSpeed ? config.sliderSpeed * 1000 : 5000; // Convert to milliseconds.\r\n\r\n let level = subCategories.find(item => item.RecordId === this.state.currCategoryId)?.Name;\r\n\r\n return (\r\n
\r\n {this._renderTop()}\r\n {!mobileMode && this._renderSubCategories()}\r\n \r\n {this.state.productList.map((item: SimpleProduct, index: number) => {\r\n if (mobileMode) { \r\n const idx = indexes.findIndex((i: number) => i === index);\r\n\r\n if (idx !== -1) {\r\n level = subCategories[`${idx}`] ? subCategories[`${idx}`].Name : '';\r\n }\r\n }\r\n\r\n return (\r\n \r\n );\r\n })}\r\n \r\n
\r\n );\r\n }\r\n\r\n public componentWillUnmount() {\r\n window.removeEventListener('resize', this._updateDimensions);\r\n }\r\n\r\n private _renderTop(): JSX.Element | null {\r\n const { config } = this.props;\r\n\r\n const categoryLink = config.categoryLink !== undefined && config.categoryLink.linkUrl.destinationUrl !== '' ? config.categoryLink.linkUrl.destinationUrl : '';\r\n\r\n const linkText = config.categoryLink !== undefined && config.categoryLink.linkText !== '' ? config.categoryLink.linkText : '';\r\n\r\n return (\r\n
\r\n

{config.title}

\r\n \r\n
\r\n );\r\n }\r\n\r\n private _renderSubCategories(): JSX.Element | null {\r\n const { subCategories } = this.props;\r\n\r\n return (\r\n
\r\n {subCategories.map((item: CategoryHierarchy, index: number) => (\r\n \r\n )\r\n )}\r\n
\r\n );\r\n }\r\n\r\n private _handleOnClickCategory = (value: number) => {\r\n this.setState({ currCategoryId: value });\r\n }\r\n\r\n private _updateDimensions = () => {\r\n this.setState({ width: window.innerWidth });\r\n }; \r\n}\r\n\r\nexport default EcommProductSliderView;","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['ecomm-product-slider'] = {\n c: () => require('partner/modules/ecomm-product-slider/ecomm-product-slider.tsx'),\n $type: 'contentModule',\n da: [{name:'hierarchy', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'ecomm-product-slider',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/ecomm-product-slider'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy');\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|ecomm-product-slider|ecomm-product-slider'] = {\n c: () => require('partner/modules/ecomm-product-slider/ecomm-product-slider.view.tsx'),\n cn: '__local__-__local__-ecomm-product-slider'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["Breakpoints","isMobile","width","large","EcommProductSlider","React","constructor","_indexes","render","data","hierarchy","config","this","props","parentCategoryId","result","_hierarchy$result$fin","find","item","Name","categoryName","RecordId","EcommProductSliderViewProps","_objectSpread","indexes","subCategories","_getChildCategories","renderView","context","forEach","_item$Name","_config$categoryName","toLowerCase","Children","child","searchByCategoryAsync","callerContext","actionContext","request","apiSettings","channelId","catalogId","then","products","length","push","SliderCard","state","hasMounted","_onClick","window","location","assign","getProductUrlSync","product","undefined","componentDidMount","setState","mobileMode","className","onClick","_renderImage","_renderInfo","button_text","Image","src","PrimaryImageUrl","fallBackSrc","getFallbackImageUrl","ItemId","requestContext","altText","gridSettings","loadFailureBehavior","DescriptionStyle","enableDescription","LocationStyle","enableLocation","PriceStyle","enablePrice","category","Description","Price","SliderFilter","_handleOnClick","_this$props$category","callback","_this$props$category2","EcommProductSliderView","currCategoryId","productList","_handleOnClickCategory","value","_updateDimensions","innerWidth","addEventListener","_config$bgImage","_subCategories$find","categoryId","productIds","map","getByIdsAsync","ret","bg","bgImage","backgroundImage","showArrows","spd","sliderSpeed","level","style","_renderTop","_renderSubCategories","Carousel","responsive","superLargeDesktop","breakpoint","max","min","items","slidesToSlide","desktop","tablet","mobile","infinite","arrows","autoPlay","autoPlaySpeed","index","idx","findIndex","i","key","cardButtonText","componentWillUnmount","removeEventListener","categoryLink","linkUrl","destinationUrl","linkText","title","href","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","id","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}