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,EAjB2D3R,IAEvD,MAAM,cAAEiK,EAAa,WAAEI,EAAU,aAAExK,EAAY,MAAEgK,GAAU7J,EAGrDsV,EAAoC3L,EAAAA,EAAA,GAAQU,EAAWE,mCAAiC,IAAEK,YAAY,IACtG2K,EAAa5L,EAAAA,EAAA,GAAQU,GAAU,IAAEE,kCAAmC+K,IAE1E,OACIxV,IAAAA,cAACkQ,EAAAA,OAAMpN,OAAAC,OAAA,GAAKhD,GACRC,IAAAA,cAAC+P,EAAAA,KAAIjN,OAAAC,OAAA,GAAKoH,IACTJ,EACA+J,EAAiB2B,EAAevV,YCvV7CwV,EAAOC,QAAU3V,cCAjB0V,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/media-gallery/media-gallery.props.autogenerated.ts?53ce","webpack://Msdyn365.Commerce.Online/./src/modules/media-gallery/utils/get-valid-product-images.ts?e579","webpack://Msdyn365.Commerce.Online/./src/modules/media-gallery/media-gallery.tsx?d0cb","webpack://Msdyn365.Commerce.Online/./src/modules/media-gallery/media-gallery.view.tsx?d842","webpack://Msdyn365.Commerce.Online/./src/themes/adventureworks/views/media-gallery.view.tsx?7d79","webpack://Msdyn365.Commerce.Online/./lib/media-gallery/module-registration.js?47e5","webpack://Msdyn365.Commerce.Online/./src/modules/media-gallery/media-gallery.view.tsx?5061","webpack://Msdyn365.Commerce.Online/./src/modules/media-gallery/utils/helper.ts?b895","webpack://Msdyn365.Commerce.Online/./src/modules/media-gallery/media-gallery.tsx?24d7","webpack://Msdyn365.Commerce.Online/./src/modules/adventureworks/views/media-gallery.view.tsx?7624","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.txt in the project root for license information.\r\n * IMediaGallery 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 imageSource {\r\n pageContext = 'pageContext',\r\n productId = 'productId'\r\n}\r\n\r\nexport const enum imageZoom {\r\n inline = 'inline',\r\n container = 'container'\r\n}\r\n\r\nexport const enum thumbnailsOrientation {\r\n vertical = 'vertical',\r\n horizontal = 'horizontal'\r\n}\r\n\r\nexport interface IMediaGalleryConfig extends Msdyn365.IModuleConfig {\r\n imageSource?: imageSource;\r\n images?: Msdyn365.IImageData[];\r\n productId?: string;\r\n imageZoom?: imageZoom;\r\n allowFullScreen?: boolean;\r\n dataScale?: string;\r\n zoomedImageSettings?: Msdyn365.IImageSettings;\r\n thumbnailsOrientation?: thumbnailsOrientation;\r\n thumbnailImageSettings?: Msdyn365.IImageSettings;\r\n galleryImageSettings?: Msdyn365.IImageSettings;\r\n shouldHideMasterProductImagesForVariant?: boolean;\r\n showPaginationTooltip?: boolean;\r\n shouldUpdateOnPartialDimensionSelection?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport interface IMediaGalleryResources {\r\n nextScreenshotFlipperText: string;\r\n previousScreenshotFlipperText: string;\r\n fullScreenTitleText: string;\r\n ariaLabelForSlide: string;\r\n}\r\n\r\nexport interface IMediaGalleryProps extends Msdyn365.IModule {\r\n resources: IMediaGalleryResources;\r\n config: IMediaGalleryConfig;\r\n}\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/* eslint-disable no-duplicate-imports */\nimport { getCatalogId, IActionContext, IImageData, IImageSettings } from '@msdyn365-commerce/core';\nimport { MediaLocation, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getMediaLocationsForSelectedVariant, MediaLocationsForSelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\n\nexport async function getValidProductImages(\n productId: number, channelId: number,\n actionContext: IActionContext, imageSettings: IImageSettings,\n selectedProduct?: SimpleProduct): Promise {\n\n const catalogId = getCatalogId(actionContext.requestContext);\n const actionInput = new MediaLocationsForSelectedVariantInput(\n productId,\n channelId,\n selectedProduct,\n catalogId\n );\n\n return getMediaLocationsForSelectedVariant(actionInput, actionContext)\n .then(mediaLocations => {\n if (mediaLocations) {\n return Promise.all(mediaLocations.map((mediaLocation) => validateMediaLocaionAsync(mediaLocation, imageSettings)))\n .then(pairs => {\n return pairs.filter(pair => pair[1]).map(pair => pair[0]);\n });\n }\n\n return [];\n }).catch(error => {\n actionContext.telemetry.exception(error);\n actionContext.telemetry.debug('Unable to get Media Locations for Selected Variant');\n return [];\n });\n}\n\nexport async function validateProductImages(mediaLocations: MediaLocation[], actionContext: IActionContext, imageSettings: IImageSettings): Promise {\n return Promise.all(mediaLocations.map((mediaLocation) => validateMediaLocaionAsync(mediaLocation, imageSettings)))\n .then(pairs => {\n return pairs.filter(pair => pair[1]).map(pair => pair[0]);\n }).catch(error => {\n actionContext.telemetry.exception(error);\n actionContext.telemetry.debug('Unable to validate prodcut images');\n return [];\n });\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-unused-vars-experimental -- .\nasync function validateMediaLocaionAsync(mediaLocation: MediaLocation, imageSettings?: IImageSettings): Promise<[IImageData, boolean]> {\n const imageData = {\n src: mediaLocation.Uri || '',\n altText: mediaLocation.AltText || ''\n };\n\n if (imageData.src === '') {\n return [imageData, false];\n }\n\n return new Promise<[IImageData, boolean]>((resolve) => {\n try {\n const http = new XMLHttpRequest();\n http.open('HEAD', imageData.src, true);\n\n http.addEventListener('load', () => {\n resolve([imageData, http.status === 200 || http.status === 201]);\n });\n\n http.addEventListener('error', () => {\n resolve([imageData, false]);\n });\n\n http.send();\n } catch {\n resolve([imageData, false]);\n }\n });\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/* eslint-disable no-duplicate-imports */\nimport { Carousel, ICarouselProps } from '@msdyn365-commerce/components';\nimport { IImageData, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n defaultDataScale,\n IComponentNodeProps,\n ImagefullView,\n IModalViewProps,\n IModuleProps,\n inlineZoomImageOnHover,\n inlineZoomImageOnMouseMove,\n inlineZoomImageOnMouseOut,\n inlineZoomInitClick,\n INodeProps,\n ISingleSlideCarouselProps,\n isMobile,\n KeyCodes,\n NodeTag,\n onContainerZoomInit,\n onMouseMoveLensContainer,\n onMouseOutLensContainer,\n onMouseOverImageContainer,\n removeContainerZoomStyle,\n removeInlineZoomStyle,\n SingleSlideCarousel,\n VariantType\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport * as React from 'react';\n\nimport { IMediaGalleryData } from './media-gallery.data';\nimport { imageSource, imageZoom, IMediaGalleryProps, thumbnailsOrientation } from './media-gallery.props.autogenerated';\nimport { getValidProductImages, validateProductImages } from './utils';\n\nexport interface IMediaGalleryState {\n animating: boolean;\n activeIndex: number;\n isImageZoomed: boolean;\n modalIsOpen: boolean;\n lastUpdate?: number;\n isMobileImageZoomed?: boolean;\n mediaGalleryItems?: IImageData[];\n}\n\nexport interface IMediaGalleryThumbnailsViewProps {\n ThumbnailsContainerProps: INodeProps;\n SingleSlideCarouselComponentProps: INodeProps;\n items?: IMediaGalleryThumbnailItemViewProps[];\n}\n\nexport interface IMediaGalleryThumbnailItemViewProps {\n ThumbnailItemContainerProps: INodeProps;\n Picture: React.ReactElement;\n}\n\nexport interface IMediaGalleryViewProps extends IMediaGalleryProps {\n state: IMediaGalleryState;\n MediaGallery: IModuleProps;\n CarouselProps: INodeProps;\n Thumbnails: IMediaGalleryThumbnailsViewProps;\n Modal?: React.ReactElement | null;\n callbackToggle?(): void;\n callbackThumbnailClick?(index: number): void;\n callbackThumbnailKeyDown?(index: number): void;\n}\n\n/**\n * Props for carousel.\n */\ninterface IMediaGalleryCarouselItems {\n items: ItemType[];\n keys: (string | undefined)[];\n}\n\n/**\n * Media gallery component.\n */\nclass MediaGallery extends React.Component, IMediaGalleryState> {\n private readonly _inlineZoomDivRef: Map = new Map();\n\n private readonly defaultGalleryImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=767&h=767&m=8', w: 0, h: 0 },\n sm: { q: 'w=600&h=600&m=8', w: 0, h: 0 },\n md: { q: 'w=600&h=772&m=8', w: 0, h: 0 },\n lg: { q: 'h=772&m=8', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n private readonly defaultThumbnailImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=100&m=8', w: 100, h: 0 },\n lg: { q: 'w=100&m=8', w: 100, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n private readonly _zoomedImageSettings: IImageSettings;\n\n public constructor(props: IMediaGalleryProps) {\n super(props);\n this._toggleModal = this._toggleModal.bind(this);\n this.state = { activeIndex: 0, animating: false, isImageZoomed: false, modalIsOpen: false };\n\n this._zoomedImageSettings = props.config.zoomedImageSettings ??\n props.config.galleryImageSettings ??\n this.defaultGalleryImageSettings;\n\n this._onImageMouseOut = this._onImageMouseOut.bind(this);\n this._inlineZoomImageOnHover = this._inlineZoomImageOnHover.bind(this);\n this._onInlineImageClick = this._onInlineImageClick.bind(this);\n this._onContainerZoomImageClick = this._onContainerZoomImageClick.bind(this);\n this._onMouseOutLensContainer = this._onMouseOutLensContainer.bind(this);\n }\n\n public isMobile(): boolean {\n const size = isMobile({ variant: VariantType.Viewport, context: this.props.context.request });\n return size === 'xs';\n }\n\n public async componentDidMount(): Promise {\n const source = this.props.config.imageSource || imageSource.pageContext;\n const shouldUpdateOnPartialDimensionSelection = this.props.config.shouldUpdateOnPartialDimensionSelection;\n\n if (source === imageSource.pageContext) {\n if (this.state.mediaGalleryItems === undefined && this.props.data.mediaLocationsForSelectedVariant.result) {\n const images = await validateProductImages(\n this.props.data.mediaLocationsForSelectedVariant.result,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings\n );\n this._setImages(images);\n } else if (this.state.mediaGalleryItems === undefined && this.props.data.product.result) {\n const product = this.props.data.product.result;\n const images = await getValidProductImages(\n product.RecordId,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings || this.defaultThumbnailImageSettings,\n product.productVariant\n );\n\n this._setImages(images);\n } else {\n this._setImages([]);\n }\n\n reaction(\n () => {\n const product = this.props.data.product.result;\n if (!product) {\n return null;\n }\n\n if (!shouldUpdateOnPartialDimensionSelection || ObjectExtensions.isNullOrUndefined(product.productVariant?.RecordId)) {\n return `${product.RecordId}`;\n }\n\n return `${product.RecordId}-${product.productVariant!.RecordId}`;\n },\n async () => {\n const product = this.props.data.product.result;\n if (product) {\n const images = await getValidProductImages(\n product.RecordId,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n shouldUpdateOnPartialDimensionSelection ? product.productVariant : undefined\n );\n this._setImages(images);\n } else {\n this._setImages([]);\n }\n }\n );\n }\n\n if (source === imageSource.productId && this.props.data.mediaLocations.result) {\n const images = await validateProductImages(\n this.props.data.mediaLocations.result,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings || this.defaultThumbnailImageSettings\n );\n this._setImages(images);\n }\n\n }\n\n public shouldComponentUpdate(nextProps: IMediaGalleryProps,\n nextState: IMediaGalleryState): 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 {\n id,\n config,\n resources\n } = this.props;\n\n const { className, showPaginationTooltip } = config;\n\n const isVertical: boolean = config.thumbnailsOrientation === thumbnailsOrientation.vertical;\n const isFullscreenAllowed: boolean = this.isMobile() || config.allowFullScreen || false;\n const zoomViewMode: string =\n config.imageZoom === imageZoom.inline ? imageZoom.inline : (config.imageZoom === imageZoom.container ? imageZoom.container : '');\n\n const mediaGalleryCarouselItems = this._getMediaGalleryItems(isFullscreenAllowed, zoomViewMode);\n const mediaGalleryThumbnailCarouselItems = this._getMediaGalleryThumbnailItems();\n const viewProps: IMediaGalleryViewProps = {\n ...(this.props as IMediaGalleryProps),\n state: this.state,\n MediaGallery: {\n moduleProps: this.props,\n className: classnames(`ms-media-gallery ${isVertical ? 'vertical' : ''}`, className)\n },\n Modal: isFullscreenAllowed ? this.imageModalSlider(zoomViewMode) : null,\n callbackToggle: this.openModalDialog,\n callbackThumbnailClick: this._generateOnThumbnailClick,\n callbackThumbnailKeyDown: this._generateOnThumbnailKeyDown,\n CarouselProps: {\n tag: Carousel,\n className: 'ms-media-gallery__carousel',\n items: mediaGalleryCarouselItems.items,\n activeIndex: this.state.activeIndex,\n next: this.next,\n previous: this.previous,\n interval: false,\n directionTextPrev: resources.previousScreenshotFlipperText,\n directionTextNext: resources.nextScreenshotFlipperText,\n onIndicatorsClickHandler: this.goToIndex,\n showPaginationTooltip: showPaginationTooltip === true,\n indicatorAriaText: resources.ariaLabelForSlide,\n handleOnExited: this.onExited,\n handleOnExiting: this.onExiting,\n key: mediaGalleryCarouselItems.keys\n } as IComponentNodeProps,\n Thumbnails: {\n ThumbnailsContainerProps: { className: 'ms-media-gallery__thumbnails-container' },\n SingleSlideCarouselComponentProps: {\n tag: SingleSlideCarousel,\n className: 'ms-media-gallery__thumbnails',\n vertical: isVertical,\n flipperPrevLabel: resources.previousScreenshotFlipperText,\n flipperNextLabel: resources.nextScreenshotFlipperText,\n parentId: id,\n useTabList: true,\n key: JSON.stringify(mediaGalleryThumbnailCarouselItems.keys)\n } as IComponentNodeProps,\n items: mediaGalleryThumbnailCarouselItems.items\n }\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Zoomed out image on previous/next click.\n */\n public updateZoomedInImage(): void {\n this.setState({ isImageZoomed: false });\n }\n\n private readonly onExiting = () => {\n this.setState({ animating: true });\n };\n\n private readonly onExited = () => {\n this.setState({ animating: false });\n };\n\n /**\n * On click next in carousel.\n */\n private readonly next = (): void => {\n removeInlineZoomStyle();\n if (this.isLastItem() === undefined) {\n return;\n }\n\n const nextIndex = this.isLastItem() ? 0 : this.state.activeIndex + 1;\n this.goToIndex(nextIndex);\n\n this.updateZoomedInImage();\n\n };\n\n /**\n * On click previous in carousel.\n */\n private readonly previous = (): void => {\n removeInlineZoomStyle();\n const images = this.state.mediaGalleryItems;\n const nextIndex = this.isFirstItem() ? (images ? images.length - 1 : 0) : this.state.activeIndex - 1;\n this.goToIndex(nextIndex);\n this.updateZoomedInImage();\n\n };\n\n private readonly goToIndex = (index: number): void => {\n this.setState({ activeIndex: index });\n };\n\n private _getMediaGalleryThumbnailItems(): IMediaGalleryCarouselItems {\n const mediaGalleryItems = this.state.mediaGalleryItems;\n const thumbnailImageSettings = this.props.config.thumbnailImageSettings;\n if (thumbnailImageSettings) {\n thumbnailImageSettings.cropFocalRegion = true;\n }\n\n const hasMediaGalleryItems = ArrayExtensions.hasElements(mediaGalleryItems);\n\n if (!hasMediaGalleryItems) {\n if (this.state.lastUpdate) {\n const defaultKey = 0;\n return { items: [this._getEmptyThumbnailItem(thumbnailImageSettings, defaultKey, this.state.activeIndex)], keys: ['empty'] };\n }\n return { items: [], keys: [] };\n }\n\n return {\n items: [\n ...mediaGalleryItems!.map((item: IImageData, index: number) => this._getThumbnailItem(\n item, thumbnailImageSettings ?? this.defaultThumbnailImageSettings, index, this.state.activeIndex))\n ],\n keys: [...mediaGalleryItems!.map(item => item.src)]\n };\n }\n\n private _getMediaGalleryItems(isFullscreenAllowed: boolean, zoomViewMode: string): IMediaGalleryCarouselItems {\n const mediaGalleryItems = this.state.mediaGalleryItems;\n const galleryImageSettings = this.props.config.galleryImageSettings;\n if (galleryImageSettings) {\n galleryImageSettings.cropFocalRegion = true;\n }\n\n const zoomView = isFullscreenAllowed ? 'fullscreen' : zoomViewMode;\n\n const hasMediaGalleryItems = ArrayExtensions.hasElements(mediaGalleryItems);\n\n if (!hasMediaGalleryItems) {\n if (this.state.lastUpdate) {\n return { items: [this._renderEmptyImage(galleryImageSettings)], keys: ['empty'] };\n }\n return { items: [], keys: [] };\n }\n\n return {\n items: [\n ...mediaGalleryItems!.map((item: IImageData, index: number) => this._renderCarouselItemImageView(\n zoomView, item, galleryImageSettings ?? this.defaultGalleryImageSettings, index))\n ],\n keys: [...mediaGalleryItems!.map(item => item.src)]\n };\n }\n\n private _setImages(images?: IImageData[]): void {\n const curatedImage = this.props.config.images || [];\n const shouldHidePrimaryImages = this.props.config.shouldHideMasterProductImagesForVariant ?? true;\n\n let imagesToSet = images ?? [];\n if (shouldHidePrimaryImages) {\n // Currently returned image response is having duplicate image\n // along with non-selected variant and previous selection is not getting cleared. With the help of index we\n // select item from 0 index till it is having non repeating image source name ending with index number.\n // Here we are keeping '.' to make sure that we are considering any digit just before '.' in image source path\n imagesToSet = imagesToSet.filter((item, index) => {\n let incrementedIndex = index;\n const imageIndex = `${++incrementedIndex}.`;\n return item.src?.includes(imageIndex);\n });\n }\n\n this.setState({\n mediaGalleryItems: [...imagesToSet, ...curatedImage],\n activeIndex: 0,\n lastUpdate: Date.now()\n });\n }\n\n private _renderCarouselItemImageView(\n zoomView: string, image: IImageData, imageSettings: IImageSettings, index: number,\n isInPopup: boolean = false): React.ReactNode {\n\n if (this.isMobile()) {\n if (isInPopup) {\n return this._renderImageInContainerOnZoom(image, this._zoomedImageSettings, index);\n }\n return this._renderImageFullScreenOnZoom(image, imageSettings, index);\n }\n\n switch (zoomView) {\n case 'container': {\n return this._renderImageInContainerOnZoom(image, this._zoomedImageSettings, index);\n }\n case 'inline': {\n return this._renderImageInlineOnZoom(image, this._zoomedImageSettings, index);\n }\n case 'fullscreen': {\n return this._renderImageFullScreenOnZoom(image, imageSettings, index);\n }\n\n // No default\n }\n return (<>\n {this._getCarouselItem(image, imageSettings, index, isInPopup)}\n );\n\n }\n\n private readonly _getCarouselItem = (image: IImageData, imageSettings: IImageSettings, index: number, isInPopup: boolean = false): React.ReactNode => (\n \n );\n\n private readonly _getThumbnailItem = (image: IImageData, imageSettings: IImageSettings, index: number, modifiedActiveIndex: number): IMediaGalleryThumbnailItemViewProps => {\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'tab',\n tabIndex: 0,\n key: index,\n 'aria-label': image.altText,\n 'aria-selected': modifiedActiveIndex === index,\n onClick: this._generateOnThumbnailClick(index),\n onKeyDown: this._generateOnThumbnailKeyDown(index)\n },\n Picture: (\n \n )\n };\n };\n\n /**\n * Ref Handler.\n * @param index -Remove item click function.\n * @returns Set inline zoom.\n */\n private readonly _refHandler = (index: number) => (divRef: HTMLDivElement) => {\n this._inlineZoomDivRef.set(index, divRef);\n };\n\n private readonly _generateOnThumbnailKeyDown = (index: number) => {\n return (event: React.KeyboardEvent) => {\n if (event.which === KeyCodes.Enter || event.which === KeyCodes.Space) {\n event.preventDefault();\n\n this.goToIndex(index);\n }\n };\n };\n\n private readonly _generateOnThumbnailClick = (index: number) => {\n return (event: React.MouseEvent) => {\n event.preventDefault();\n\n this.goToIndex(index);\n };\n };\n\n private _renderImageInlineOnZoom(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return (\n \n \n \n \n );\n }\n\n private _inlineZoomImageOnHover(event: React.MouseEvent): void {\n inlineZoomImageOnHover(event, this.props.config.dataScale ?? String(defaultDataScale));\n }\n\n private _handleMobileViewZoomedImageClick(event: React.MouseEvent) {\n const target = event.currentTarget;\n const mobileZoomedInImageClassName = 'msc-mobile-zoomed-in';\n if (!this.state.isMobileImageZoomed) {\n const bounds = target.getBoundingClientRect();\n const dataScale = Number(this.props.config.dataScale ?? defaultDataScale);\n\n const positionX = event.clientX - bounds.left;\n const positionY = event.clientY - bounds.top;\n const scaledPositionX = positionX * dataScale;\n const scaledPositionY = positionY * dataScale;\n\n target.style.transform = `scale(${dataScale})`;\n target.classList.add(mobileZoomedInImageClassName);\n target.parentElement!.style.overflow = 'auto';\n target.parentElement!.scrollTo(scaledPositionX - positionX, scaledPositionY - positionY);\n this.setState({\n isMobileImageZoomed: true\n });\n } else {\n target.style.transform = '';\n target.classList.remove(mobileZoomedInImageClassName);\n target.parentElement!.style.overflow = '';\n this.setState({\n isMobileImageZoomed: false\n });\n }\n }\n\n private _onInlineImageClick(event: React.MouseEvent): void {\n if (window.innerWidth <= 768) { // $msv-breakpoint-m\n this._handleMobileViewZoomedImageClick(event);\n return;\n }\n inlineZoomInitClick(event, this.props.config.dataScale ?? String(defaultDataScale));\n this.setState({\n isImageZoomed: true\n });\n }\n\n private _onImageMouseOut(event: React.MouseEvent): void {\n inlineZoomImageOnMouseOut(event);\n this.setState({\n isImageZoomed: false\n });\n\n }\n\n private _onContainerZoomImageClick(event: React.MouseEvent): void {\n if (window.innerWidth <= 768) { // $msv-breakpoint-m\n this._handleMobileViewZoomedImageClick(event);\n return;\n }\n\n onContainerZoomInit(event);\n\n this.setState({\n isImageZoomed: true\n });\n }\n\n private _onMouseOutLensContainer(event: React.MouseEvent): void {\n onMouseOutLensContainer(event);\n\n this.setState({\n isImageZoomed: false\n });\n }\n\n private _renderImageInContainerOnZoom(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return (\n
\n \n \n
\n );\n }\n\n private _renderImageFullScreenOnZoom(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return (\n
\n \n
\n \n
\n\n
\n );\n }\n\n private _mapProductToImageData(product: SimpleProduct): IImageData {\n return {\n src: product.PrimaryImageUrl || ''\n };\n }\n\n private _renderEmptyImage(imageSettings: IImageSettings | undefined): React.ReactNode {\n return (\n
\n \n
\n );\n }\n\n private _getEmptyThumbnailItem(imageSettings: IImageSettings | undefined, index: number, modifiedActiveIndex: number): IMediaGalleryThumbnailItemViewProps {\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'tab',\n tabIndex: 0,\n key: 'empty',\n 'aria-label': '',\n 'aria-selected': modifiedActiveIndex === index,\n onClick: this._generateOnThumbnailClick(index),\n onKeyDown: this._generateOnThumbnailKeyDown(index)\n },\n Picture: (\n \n )\n };\n }\n\n private readonly isFirstItem = () => this.state.activeIndex === 0;\n\n private readonly isLastItem = () => {\n const images = this.state.mediaGalleryItems;\n return images && this.state.activeIndex === images.length - 1;\n };\n\n private readonly openModalDialog = (): void => {\n this._toggleModal();\n };\n\n private _toggleModal(): void {\n if (this.state.modalIsOpen) {\n const parentDiv = this._inlineZoomDivRef.get(this.state.activeIndex);\n if (parentDiv && parentDiv.children && parentDiv.children.length >= 2) {\n const image = parentDiv.children[1].querySelector('img');\n if (image) {\n image.removeAttribute('style');\n }\n }\n this.setState({\n isImageZoomed: false\n });\n }\n this.setState({\n isImageZoomed: false,\n modalIsOpen: !this.state.modalIsOpen\n });\n removeInlineZoomStyle();\n removeContainerZoomStyle();\n }\n\n private readonly imageModalSlider = (ZoomView: string): React.ReactElement => {\n const {\n data: {\n product: { result: product }\n },\n resources\n } = this.props;\n let mediaGalleryItems = this.state.mediaGalleryItems;\n\n if (!mediaGalleryItems && product) {\n mediaGalleryItems = [this._mapProductToImageData(product)];\n }\n const carouselprops = {\n tag: Carousel,\n className: 'ms-media-gallery__carousel',\n items:\n mediaGalleryItems &&\n mediaGalleryItems.map((item: IImageData, index: number) => this._renderCarouselItemImageView(\n ZoomView, item, this._zoomedImageSettings, index, true)),\n activeIndex: this.state.activeIndex,\n next: this.next,\n previous: this.previous,\n interval: false,\n directionTextPrev: resources.previousScreenshotFlipperText,\n directionTextNext: resources.nextScreenshotFlipperText,\n onIndicatorsClickHandler: this.goToIndex,\n showPaginationTooltip: true,\n hideIndicator: false,\n keyboard: false,\n handleOnExited: this.onExited,\n handleOnExiting: this.onExiting,\n isDisabledFunctionality: this.state.isMobileImageZoomed\n } as IComponentNodeProps;\n\n const carousel = ;\n\n const imageModalSliderProps: IModalViewProps = {\n modalIsOpen: this.state.modalIsOpen,\n ontoggle: this._toggleModal,\n galleryCarousel: carousel,\n classNames: classnames('ms-media-gallery__modal', 'msc-modal-input-required')\n };\n return ImagefullView(imageModalSliderProps) as React.ReactElement;\n };\n}\n\nexport default MediaGallery;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/* eslint-disable no-duplicate-imports */\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IMediaGalleryThumbnailItemViewProps, IMediaGalleryThumbnailsViewProps, IMediaGalleryViewProps } from '@msdyn365-commerce-modules/media-gallery';\n\nconst MediaGalleryView: React.FC = props => {\n const { CarouselProps, Thumbnails, MediaGallery, Modal } = props;\n\n return (\n \n \n {Modal}\n {_renderThumbnails(Thumbnails)}\n \n );\n};\n\nconst _renderThumbnails = (thumbnails: IMediaGalleryThumbnailsViewProps): JSX.Element => {\n const { ThumbnailsContainerProps, SingleSlideCarouselComponentProps, items } = thumbnails;\n\n return (\n \n \n {items && items.map(_renderThumbnailItem)}\n \n \n );\n};\n\nconst _renderThumbnailItem = (thumbnail: IMediaGalleryThumbnailItemViewProps): JSX.Element => {\n const { ThumbnailItemContainerProps, Picture } = thumbnail;\n\n return (\n \n {Picture}\n \n );\n};\n\nexport default MediaGalleryView;\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 { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IMediaGalleryThumbnailItemViewProps, IMediaGalleryThumbnailsViewProps, IMediaGalleryViewProps } from '@msdyn365-commerce-modules/media-gallery';\r\n\r\nconst MediaGalleryView: React.FC = props => {\r\n const { CarouselProps, Thumbnails, MediaGallery, Modal } = props;\r\n\r\n return (\r\n \r\n \r\n {Modal}\r\n {_renderThumbnails(Thumbnails)}\r\n \r\n );\r\n};\r\n\r\nconst _renderThumbnails = (thumbnails: IMediaGalleryThumbnailsViewProps): JSX.Element => {\r\n const { ThumbnailsContainerProps, SingleSlideCarouselComponentProps, items } = thumbnails;\r\n\r\n return (\r\n \r\n \r\n {items && items.map(_renderThumbnailItem)}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderThumbnailItem = (thumbnail: IMediaGalleryThumbnailItemViewProps): JSX.Element => {\r\n const { ThumbnailItemContainerProps, Picture } = thumbnail;\r\n\r\n return (\r\n \r\n {Picture}\r\n \r\n );\r\n};\r\n\r\nexport default MediaGalleryView;\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['media-gallery'] = {\n c: () => require('partner/modules/media-gallery/media-gallery.tsx'),\n $type: 'contentModule',\n da: [{name:'mediaLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-by-id', runOn: 0},{name:'mediaLocationsForSelectedVariant', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-for-selected-variant', 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: 'media-gallery',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/media-gallery'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-by-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-by-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\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 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|media-gallery|media-gallery'] = {\n c: () => require('partner/modules/media-gallery/media-gallery.view.tsx'),\n cn: '__local__-__local__-media-gallery'\n };\nviewDictionary['__local__|__local__|themes|adventureworks|views|media-gallery'] = {\n c: () => require('partner/themes/adventureworks/views/media-gallery.view.tsx'),\n cn: '__local__-__local__-media-gallery'\n };\nviewDictionary['@msdyn365-commerce-modules|media-gallery|modules|media-gallery|media-gallery'] = {\n c: () => require('@msdyn365-commerce-modules/media-gallery/dist/lib/modules/media-gallery/media-gallery.view.js'),\n cn: '@msdyn365-commerce-modules-media-gallery-media-gallery'\n };\nviewDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|media-gallery'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/media-gallery.view.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-media-gallery'\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 { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IMediaGalleryThumbnailItemViewProps, IMediaGalleryThumbnailsViewProps, IMediaGalleryViewProps } from '../..';\n\nconst MediaGalleryView: React.FC = props => {\n const { CarouselProps, Thumbnails, MediaGallery, Modal } = props;\n\n return (\n \n \n {Modal}\n {_renderThumbnails(Thumbnails)}\n \n );\n};\n\nconst _renderThumbnails = (thumbnails: IMediaGalleryThumbnailsViewProps): JSX.Element => {\n const { ThumbnailsContainerProps, SingleSlideCarouselComponentProps, items } = thumbnails;\n\n return (\n \n {items && items.map(_renderThumbnailItem)}\n \n );\n};\n\nconst _renderThumbnailItem = (thumbnail: IMediaGalleryThumbnailItemViewProps): JSX.Element => {\n const { ThumbnailItemContainerProps, Picture } = thumbnail;\n\n return {Picture};\n};\n\nexport default MediaGalleryView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IImageData, IRequestContext, IVideoData } from '@msdyn365-commerce/core';\n\nexport enum MediaType {\n /**\n * The None.\n */\n None = 0,\n /**\n * The Image type.\n */\n Image = 1,\n /**\n * The video type.\n */\n Video = 2,\n /**\n * The file type.\n */\n File = 3\n}\n\nexport interface IMediaData extends IImageData {\n mediaTypeValue?: MediaType;\n displayOrder?: number;\n videoData?: IVideoData;\n}\n\n/**\n * Gets correct alt text for image based on configuration of site.\n * @param productName Product name.\n * @param context Current request context.\n * @param imageAltText Alt-text from CMS image.\n */\nexport function getAltText(\n context: IRequestContext,\n shouldUseCmsAltText: boolean,\n productName?: string,\n imageAltText?: string\n): string | undefined {\n if (!context?.app?.config?.OmniChannelMedia) {\n return productName;\n }\n if (shouldUseCmsAltText) {\n return imageAltText;\n }\n return productName;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Carousel, ICarouselProps, Player, IPlayerData, IPlayerOptions, IVideoMetadata } from '@msdyn365-commerce/components';\nimport { IImageData, IImageSettings, Image, Video } from '@msdyn365-commerce/core';\nimport { MediaLocation, MediaType, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, getFallbackImageUrl, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n defaultDataScale,\n IComponentNodeProps,\n ImagefullView,\n IModalViewProps,\n IModuleProps,\n inlineZoomImageOnHover,\n inlineZoomImageOnMouseMove,\n inlineZoomImageOnMouseOut,\n inlineZoomInitClick,\n INodeProps,\n ISingleSlideCarouselProps,\n isMobile,\n KeyCodes,\n NodeTag,\n onContainerZoomInit,\n onMouseMoveLensContainer,\n onMouseOutLensContainer,\n onMouseOverImageContainer,\n removeContainerZoomStyle,\n removeInlineZoomStyle,\n SingleSlideCarousel,\n VariantType\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport * as React from 'react';\n\nimport { IMediaGalleryData } from './media-gallery.data';\nimport { imageSource, imageZoom, IMediaGalleryProps, thumbnailsOrientation } from './media-gallery.props.autogenerated';\nimport { getProductImages, getValidProductImages, getVideoMetadataFromApi, validateProductImages } from './utils';\nimport { getAltText, IMediaData } from './utils/helper';\n\n/**\n * IMediaGalleryState Interface.\n */\nexport interface IMediaGalleryState {\n animating: boolean;\n activeIndex: number;\n isImageZoomed: boolean;\n modalIsOpen: boolean;\n lastUpdate?: number;\n isMobileImageZoomed?: boolean;\n mediaGalleryItems?: IMediaData[];\n isInitialLoad?: boolean;\n shouldUseOptimizedImage?: boolean;\n}\n\n/**\n * IMediaGalleryThumbnailsViewProps Interface.\n */\nexport interface IMediaGalleryThumbnailsViewProps {\n ThumbnailsContainerProps: INodeProps;\n SingleSlideCarouselComponentProps: INodeProps;\n items?: IMediaGalleryThumbnailItemViewProps[];\n}\n\n/**\n * IMediaGalleryThumbnailItemViewProps Interface.\n */\nexport interface IMediaGalleryThumbnailItemViewProps {\n ThumbnailItemContainerProps: INodeProps;\n Picture: React.ReactElement;\n}\n\n/**\n * IMediaGalleryViewProps Interface.\n */\nexport interface IMediaGalleryViewProps extends IMediaGalleryProps {\n state: IMediaGalleryState;\n MediaGallery: IModuleProps;\n CarouselProps: INodeProps;\n Thumbnails: IMediaGalleryThumbnailsViewProps;\n Modal?: React.ReactElement | null;\n callbackToggle?(): void;\n callbackThumbnailClick?(index: number): void;\n callbackThumbnailKeyDown?(index: number): void;\n}\n\n/**\n * Props for carousel.\n */\ninterface IMediaGalleryCarouselItems {\n items: ItemType[];\n keys: (string | undefined)[];\n}\n\n/**\n * Media gallery component.\n */\nclass MediaGallery extends React.Component, IMediaGalleryState> {\n private readonly _inlineZoomDivRef: Map = new Map();\n\n private readonly fullScreenOverlayButtonRef: React.RefObject = React.createRef();\n private readonly player: React.RefObject = React.createRef();\n private fallbackImage?: string;\n\n private readonly defaultGalleryImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=767&h=767&m=8', w: 0, h: 0 },\n sm: { q: 'w=600&h=600&m=8', w: 0, h: 0 },\n md: { q: 'w=600&h=772&m=8', w: 0, h: 0 },\n lg: { q: 'h=772&m=8', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n private readonly defaultThumbnailImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=100&m=8', w: 100, h: 0 },\n lg: { q: 'w=100&m=8', w: 100, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n private readonly _zoomedImageSettings: IImageSettings;\n\n public constructor(props: IMediaGalleryProps) {\n super(props);\n this._toggleModal = this._toggleModal.bind(this);\n const mediaGalleryImages = this.getImagesData();\n this.state = {\n activeIndex: 0,\n animating: false,\n isImageZoomed: false,\n modalIsOpen: false,\n isInitialLoad: true,\n shouldUseOptimizedImage: !!this.props.config.skipImageValidation,\n mediaGalleryItems: mediaGalleryImages\n };\n\n this._zoomedImageSettings =\n props.config.zoomedImageSettings ?? props.config.galleryImageSettings ?? this.defaultGalleryImageSettings;\n\n this._onImageMouseOut = this._onImageMouseOut.bind(this);\n this._inlineZoomImageOnHover = this._inlineZoomImageOnHover.bind(this);\n this._onInlineImageClick = this._onInlineImageClick.bind(this);\n this._onContainerZoomImageClick = this._onContainerZoomImageClick.bind(this);\n this._onMouseOutLensContainer = this._onMouseOutLensContainer.bind(this);\n }\n\n public isMobile(): boolean {\n const size = isMobile({ variant: VariantType.Viewport, context: this.props.context.request });\n return size === 'xs';\n }\n\n public async componentDidMount(): Promise {\n const source = this.props.config.imageSource ?? imageSource.pageContext;\n const shouldUpdateOnPartialDimensionSelection = this.props.config.shouldUpdateOnPartialDimensionSelection;\n this._setRenderType();\n if (!this.props.context.request.app?.config?.OmniChannelMedia) {\n if (source === imageSource.pageContext) {\n if (this.state.mediaGalleryItems === undefined && this.props.data.mediaLocationsForSelectedVariant.result) {\n const images = await validateProductImages(\n this.props.data.mediaLocationsForSelectedVariant.result,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings\n );\n await this._setImages(images);\n } else if (this.state.mediaGalleryItems === undefined && this.props.data.product.result) {\n const product = this.props.data.product.result;\n const images = await getValidProductImages(\n product.RecordId,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n product.productVariant\n );\n\n await this._setImages(images);\n } else {\n await this._setImages([]);\n }\n }\n }\n\n reaction(\n () => {\n const product = this.props.data.product.result;\n if (!product) {\n return null;\n }\n\n if (!shouldUpdateOnPartialDimensionSelection || !product.productVariant?.RecordId) {\n return `${product.RecordId}`;\n }\n\n return `${product.RecordId}-${product.productVariant.RecordId}`;\n },\n async () => {\n const product = this.props.data.product.result;\n let images: IImageData[] = [];\n if (product) {\n if (this.props.context.app?.config?.OmniChannelMedia) {\n images = await getProductImages(\n product.RecordId,\n this.shouldUseCmsAltText(),\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n product.Name,\n shouldUpdateOnPartialDimensionSelection ? product.productVariant : undefined\n );\n } else {\n images = await getValidProductImages(\n product.RecordId,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n shouldUpdateOnPartialDimensionSelection ? product.productVariant : undefined\n );\n }\n await this._setImages(images);\n } else {\n await this._setImages([]);\n }\n },\n { fireImmediately: true }\n );\n\n if (source === imageSource.productId && this.props.data.mediaLocations.result) {\n const images = await validateProductImages(\n this.props.data.mediaLocations.result,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings\n );\n await this._setImages(images);\n }\n }\n\n public shouldComponentUpdate(nextProps: IMediaGalleryProps, nextState: IMediaGalleryState): 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 { id, config, resources } = this.props;\n\n const { className, showPaginationTooltip } = config;\n\n const isVertical: boolean = config.thumbnailsOrientation === thumbnailsOrientation.vertical;\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- || is required.\n const isFullscreenAllowed: boolean = this.isMobile() || config.allowFullScreen || false;\n const zoomViewMode: string =\n config.imageZoom === imageZoom.inline ? imageZoom.inline : config.imageZoom === imageZoom.container ? imageZoom.container : '';\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\n const emptyPlaceHolderImage = this.props.context.app.config?.placeholderImageName as string;\n if (this.props.data.product.result) {\n this.fallbackImage = getFallbackImageUrl(\n this.props.data.product.result.ItemId,\n this.props.context.request.apiSettings,\n this.props.context.request.app?.config?.OmniChannelMedia\n );\n }\n if (emptyPlaceHolderImage && this.fallbackImage) {\n this.fallbackImage = `${this.fallbackImage},${emptyPlaceHolderImage}`;\n }\n\n const mediaGalleryCarouselItems = this._getMediaGalleryItems(isFullscreenAllowed, zoomViewMode);\n const mediaGalleryThumbnailCarouselItems = this._getMediaGalleryThumbnailItems();\n const viewProps: IMediaGalleryViewProps = {\n ...(this.props as IMediaGalleryProps),\n state: this.state,\n MediaGallery: {\n moduleProps: this.props,\n className: classnames(`ms-media-gallery ${isVertical ? 'vertical' : ''}`, className)\n },\n Modal: isFullscreenAllowed ? this.imageModalSlider(zoomViewMode) : null,\n callbackToggle: this.openModalDialog,\n callbackThumbnailClick: this._generateOnThumbnailClick,\n callbackThumbnailKeyDown: this._generateOnThumbnailKeyDown,\n CarouselProps: {\n tag: Carousel,\n className: 'ms-media-gallery__carousel',\n items: mediaGalleryCarouselItems.items,\n activeIndex: this.state.activeIndex,\n next: this.next,\n previous: this.previous,\n interval: false,\n directionTextPrev: resources.previousScreenshotFlipperText,\n directionTextNext: resources.nextScreenshotFlipperText,\n onIndicatorsClickHandler: this.goToIndex,\n showPaginationTooltip: showPaginationTooltip === true,\n indicatorAriaText: resources.ariaLabelForSlide,\n handleOnExited: this.onExited,\n handleOnExiting: this.onExiting,\n key: mediaGalleryCarouselItems.keys\n } as IComponentNodeProps,\n Thumbnails: {\n ThumbnailsContainerProps: { className: 'ms-media-gallery__thumbnails-container' },\n SingleSlideCarouselComponentProps: {\n tag: SingleSlideCarousel,\n className: 'ms-media-gallery__thumbnails',\n vertical: isVertical,\n flipperPrevLabel: resources.previousScreenshotFlipperText,\n flipperNextLabel: resources.nextScreenshotFlipperText,\n parentId: id,\n useTabList: true,\n key: JSON.stringify(mediaGalleryThumbnailCarouselItems.keys)\n } as IComponentNodeProps,\n items: mediaGalleryThumbnailCarouselItems.items\n }\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Zoomed out image on previous/next click.\n */\n public updateZoomedInImage(): void {\n this.setState({ isImageZoomed: false });\n }\n\n private readonly onExiting = () => {\n this.setState({ animating: true });\n };\n\n private readonly onExited = () => {\n this.setState({ animating: false });\n };\n\n /**\n * On click next in carousel.\n */\n private readonly next = (): void => {\n removeInlineZoomStyle();\n if (this.isLastItem() === undefined) {\n return;\n }\n\n const nextIndex = this.isLastItem() ? 0 : this.state.activeIndex + 1;\n this.goToIndex(nextIndex);\n\n this.updateZoomedInImage();\n };\n\n /**\n * On click previous in carousel.\n */\n private readonly previous = (): void => {\n removeInlineZoomStyle();\n const images = this.state.mediaGalleryItems;\n const nextIndex = this.isFirstItem() ? (images ? images.length - 1 : 0) : this.state.activeIndex - 1;\n this.goToIndex(nextIndex);\n this.updateZoomedInImage();\n };\n\n private readonly goToIndex = (index: number): void => {\n const { autoplay } = this.props.config;\n const currentIndex = this.state.activeIndex;\n const mediaItems = this.state.mediaGalleryItems;\n if (autoplay && mediaItems) {\n if (mediaItems[`${index}`]?.mediaTypeValue === MediaType.Video) {\n this.player.current?.play();\n } else if (mediaItems[`${currentIndex}`].mediaTypeValue === MediaType.Video) {\n this.player.current?.pause();\n }\n }\n this.setState({ activeIndex: index });\n };\n\n private _getMediaGalleryThumbnailItems(): IMediaGalleryCarouselItems {\n const mediaGalleryItems = this.state.mediaGalleryItems;\n const thumbnailImageSettings = this.props.config.thumbnailImageSettings;\n if (thumbnailImageSettings) {\n thumbnailImageSettings.cropFocalRegion = true;\n }\n\n const hasMediaGalleryItems = ArrayExtensions.hasElements(mediaGalleryItems);\n\n if (!hasMediaGalleryItems) {\n if (this.state.lastUpdate) {\n const defaultKey = 0;\n return {\n items: [this._getEmptyThumbnailItem(thumbnailImageSettings, defaultKey, this.state.activeIndex)],\n keys: ['empty']\n };\n }\n return { items: [], keys: [] };\n }\n\n return {\n items: [\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n ...mediaGalleryItems!.map((item: IMediaData, index: number) => {\n if (item.mediaTypeValue === MediaType.Video) {\n return this.getVideoThumbNailItem(\n item,\n thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n index,\n this.state.activeIndex\n );\n } else {\n return this._getThumbnailItem(\n item,\n thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n index,\n this.state.activeIndex\n );\n }\n })\n ],\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n keys: [...mediaGalleryItems!.map(item => item.src)]\n };\n }\n\n private getImagesData = (): IImageData[] => {\n if (this.props.config.skipImageValidation || this.props.context.request.app?.config?.OmniChannelMedia) {\n const source = this.props.config.imageSource ?? imageSource.pageContext;\n let images: IImageData[] = [];\n let mediaLocations: MediaLocation[] = [];\n if (source === imageSource.pageContext && this.props.data.mediaLocationsForSelectedVariant.result) {\n mediaLocations = this.props.data.mediaLocationsForSelectedVariant.result;\n } else if (source === imageSource.productId && this.props.data.mediaLocations.result) {\n mediaLocations = this.props.data.mediaLocations.result;\n }\n images = mediaLocations.map(mediaLocation => {\n return {\n src: mediaLocation.Uri ?? '',\n altText: getAltText(\n this.props.context.actionContext.requestContext,\n this.shouldUseCmsAltText(),\n this.props.data.product.result?.Name,\n mediaLocation.AltText\n ),\n additionalProperties: mediaLocation.IsApplicableForChildEntities\n ? {\n isApplicableForChildEntities: 'true'\n }\n : undefined\n };\n });\n const curatedImages = this.props.config.images ?? [];\n\n return [...this._filterMasterImageFromVariant(images), ...curatedImages];\n }\n return [];\n };\n\n private _getMediaGalleryItems(isFullscreenAllowed: boolean, zoomViewMode: string): IMediaGalleryCarouselItems {\n const mediaGalleryItems = this.state.mediaGalleryItems;\n const galleryImageSettings = this.props.config.galleryImageSettings;\n if (galleryImageSettings) {\n galleryImageSettings.cropFocalRegion = true;\n }\n\n const zoomView = isFullscreenAllowed ? 'fullscreen' : zoomViewMode;\n\n const hasMediaGalleryItems = ArrayExtensions.hasElements(mediaGalleryItems);\n\n if (!hasMediaGalleryItems) {\n if (this.state.lastUpdate) {\n return { items: [this._renderEmptyImage(galleryImageSettings)], keys: ['empty'] };\n }\n return { items: [], keys: [] };\n }\n\n return {\n items: [\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n ...mediaGalleryItems!.map((item: IMediaData, index: number) => {\n return this._renderCarouselItemImageView(\n zoomView,\n item,\n galleryImageSettings ?? this.defaultGalleryImageSettings,\n index\n );\n })\n ],\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n keys: [...mediaGalleryItems!.map(item => item.src)]\n };\n }\n\n private async _setImages(images?: IMediaData[]): Promise {\n const curatedImage = this.props.config.images || [];\n const mediaToSet: IMediaData[] = this._filterMasterImageFromVariant(images);\n\n void Promise.all(\n mediaToSet.map(async mediaData => {\n if (mediaData.mediaTypeValue === MediaType.Video && mediaData.src) {\n try {\n const url = new URL(mediaData.src);\n const videoId = url.searchParams.get('CVID');\n if (videoId) {\n mediaData.videoData = await getVideoMetadataFromApi(videoId, this.props.context.actionContext);\n }\n } catch (error) {\n if (this.props.telemetry) {\n this.props.telemetry.debug('Error while fetching videoId');\n }\n }\n }\n return mediaData;\n })\n ).then(mediaData => {\n const mediaItems = mediaData.filter(element => {\n return (\n element.mediaTypeValue !== MediaType.Video ||\n (element.mediaTypeValue === MediaType.Video && element.videoData !== undefined)\n );\n });\n\n this.setState({\n mediaGalleryItems: [...mediaItems, ...curatedImage],\n activeIndex: 0,\n lastUpdate: Date.now(),\n shouldUseOptimizedImage: false\n });\n });\n\n this.setState({\n mediaGalleryItems: [...mediaToSet, ...curatedImage],\n activeIndex: 0,\n lastUpdate: Date.now(),\n shouldUseOptimizedImage: false\n });\n }\n\n private _setRenderType(): void {\n this.setState({\n isInitialLoad: false\n });\n }\n\n private _renderCarouselItemImageView(\n zoomView: string,\n media: IMediaData,\n imageSettings: IImageSettings,\n index: number,\n isInPopup: boolean = false\n ): React.ReactNode {\n if (media.mediaTypeValue === MediaType.Video) {\n if (isInPopup || zoomView !== 'fullscreen') {\n return <>{this._renderCarouselItemVideo(media, index, imageSettings)};\n }\n return <>{this._renderVideoThumbnail(media, index, imageSettings)};\n } else {\n if (this.isMobile()) {\n if (isInPopup) {\n return this._renderImageInContainerOnZoom(media, this._zoomedImageSettings, index);\n }\n return this._renderImageFullScreenOnZoom(media, imageSettings, index);\n }\n\n switch (zoomView) {\n case 'container': {\n return this._renderImageInContainerOnZoom(media, this._zoomedImageSettings, index);\n }\n case 'inline': {\n return this._renderImageInlineOnZoom(media, this._zoomedImageSettings, index);\n }\n case 'fullscreen': {\n return this._renderImageFullScreenOnZoom(media, imageSettings, index);\n }\n\n // No default\n }\n return <>{this._getCarouselItem(media, imageSettings, index, isInPopup)};\n }\n }\n\n private _filterMasterImageFromVariant(images?: IImageData[]): IImageData[] {\n const shouldHidePrimaryImages = this.props.config.shouldHideMasterProductImagesForVariant ?? true;\n let variantImages = images ?? [];\n const isVariantProduct =\n !ObjectExtensions.isNullOrUndefined(this.props.data.product.result?.MasterProductId) ||\n !ObjectExtensions.isNullOrUndefined(this.props.data.product.result?.productVariant);\n const itemId = this.props.data.product.result?.ItemId;\n if (shouldHidePrimaryImages && isVariantProduct && itemId) {\n variantImages = variantImages.filter(item => {\n const isApplicableForChildEntities = item.additionalProperties?.isApplicableForChildEntities;\n return !isApplicableForChildEntities;\n });\n if (!ArrayExtensions.hasElements(variantImages)) {\n variantImages = images ?? [];\n }\n }\n return variantImages;\n }\n\n private readonly _renderCarouselItemVideo = (mediaData: IMediaData, index: number, imageSettings: IImageSettings): React.ReactNode => {\n const videoData = mediaData.videoData;\n if (videoData) {\n const options: IPlayerOptions = this.props.config as IPlayerOptions;\n const playerResources = this.props.resources;\n const videoMetaData: IVideoMetadata = {};\n videoMetaData.videoId = videoData.id;\n videoMetaData.title = videoData.title;\n videoMetaData.duration = videoData.playTime;\n if (videoData.thumbnail) {\n videoMetaData.posterframeUrl = videoData.thumbnail.src;\n }\n if (videoData._links?.binaryReferences) {\n videoMetaData.videoBinaryReferences = videoData._links.binaryReferences;\n }\n const videoPlayerData: IPlayerData = { options, metaData: videoMetaData };\n const attributes = {\n id: `${this.props.id}__carousel-item__${index}`\n };\n return (\n \n );\n }\n return this._renderEmptyImage(imageSettings);\n };\n\n private readonly _getCarouselItem = (\n image: IImageData,\n imageSettings: IImageSettings,\n index: number,\n isInPopup: boolean = false\n ): React.ReactNode => (\n \n );\n\n private readonly _getThumbnailItem = (\n image: IImageData,\n imageSettings: IImageSettings,\n index: number,\n modifiedActiveIndex: number\n ): IMediaGalleryThumbnailItemViewProps => {\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'tab',\n tabIndex: 0,\n key: index,\n 'aria-label': image.altText,\n 'aria-selected': modifiedActiveIndex === index,\n onClick: this._generateOnThumbnailClick(index),\n onKeyDown: this._generateOnThumbnailKeyDown(index)\n },\n Picture: (\n \n )\n };\n };\n\n /**\n * Gets the video thumbnail item to display media gallery.\n * @param props - The Media gallery view props from business layer.\n * @returns Return thumbnail view props which will be used to render video.\n */\n private readonly getVideoThumbNailItem = (\n mediaData: IMediaData,\n imageSettings: IImageSettings,\n index: number,\n modifiedActiveIndex: number\n ): IMediaGalleryThumbnailItemViewProps => {\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n\n const videoData = mediaData.videoData;\n let image: IImageData;\n if (videoData?.thumbnail) {\n image = videoData.thumbnail;\n } else {\n image = {\n src: 'empty'\n };\n }\n\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'tab',\n tabIndex: 0,\n key: index,\n 'aria-label': image.altText,\n 'aria-selected': modifiedActiveIndex === index,\n onClick: this._generateOnThumbnailClick(index),\n onKeyDown: this._generateOnThumbnailKeyDown(index)\n },\n Picture: (\n \n )\n };\n };\n\n /**\n * Ref Handler.\n * @param index -Remove item click function.\n * @returns Set inline zoom.\n */\n private readonly _refHandler = (index: number) => (divRef: HTMLDivElement) => {\n this._inlineZoomDivRef.set(index, divRef);\n };\n\n private readonly _generateOnThumbnailKeyDown = (index: number) => {\n return (event: React.KeyboardEvent) => {\n if (event.which === KeyCodes.Enter || event.which === KeyCodes.Space) {\n event.preventDefault();\n\n this.goToIndex(index);\n }\n };\n };\n\n private readonly _generateOnThumbnailClick = (index: number) => {\n return (event: React.MouseEvent) => {\n event.preventDefault();\n\n this.goToIndex(index);\n };\n };\n\n private _renderImageInlineOnZoom(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return (\n \n \n \n \n );\n }\n\n private _inlineZoomImageOnHover(event: React.MouseEvent): void {\n inlineZoomImageOnHover(event, this.props.config.dataScale ?? String(defaultDataScale));\n }\n\n private _handleMobileViewZoomedImageClick(event: React.MouseEvent) {\n const target = this.state.shouldUseOptimizedImage ? (event.target as HTMLImageElement) : event.currentTarget;\n const mobileZoomedInImageClassName = 'msc-mobile-zoomed-in';\n if (!this.state.isMobileImageZoomed) {\n const bounds = target.getBoundingClientRect();\n const dataScale = Number(this.props.config.dataScale ?? defaultDataScale);\n\n const positionX = event.clientX - bounds.left;\n const positionY = event.clientY - bounds.top;\n const scaledPositionX = positionX * dataScale;\n const scaledPositionY = positionY * dataScale;\n\n target.style.transform = `scale(${dataScale})`;\n target.classList.add(mobileZoomedInImageClassName);\n target.parentElement!.style.overflow = 'auto';\n target.parentElement!.scrollTo(scaledPositionX - positionX, scaledPositionY - positionY);\n this.setState({\n isMobileImageZoomed: true\n });\n } else {\n target.style.transform = '';\n target.classList.remove(mobileZoomedInImageClassName);\n target.parentElement!.style.overflow = '';\n this.setState({\n isMobileImageZoomed: false\n });\n }\n }\n\n private _onInlineImageClick(event: React.MouseEvent): void {\n if (window.innerWidth <= 768) {\n // $msv-breakpoint-m\n this._handleMobileViewZoomedImageClick(event);\n return;\n }\n inlineZoomInitClick(event, this.props.config.dataScale ?? String(defaultDataScale));\n this.setState({\n isImageZoomed: true\n });\n }\n\n private _onImageMouseOut(event: React.MouseEvent): void {\n inlineZoomImageOnMouseOut(event);\n this.setState({\n isImageZoomed: false\n });\n }\n\n private _onContainerZoomImageClick(event: React.MouseEvent): void {\n if (window.innerWidth <= 768) {\n // $msv-breakpoint-m\n this._handleMobileViewZoomedImageClick(event);\n return;\n }\n\n onContainerZoomInit(event);\n\n this.setState({\n isImageZoomed: true\n });\n }\n\n private _onMouseOutLensContainer(event: React.MouseEvent): void {\n onMouseOutLensContainer(event);\n\n this.setState({\n isImageZoomed: false\n });\n }\n\n private _renderImageInContainerOnZoom(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return (\n
\n \n \n
\n );\n }\n\n private _renderImageFullScreenOnZoom(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return (\n
\n \n
\n {}\n \n
\n
\n );\n }\n\n /**\n * Render the video thumbnail in full screen.\n * @param mediaData - Media Data.\n * @param index - Index\n * @param imageSettings - Image settings.\n * @returns - JSX.Element\n */\n private readonly _renderVideoThumbnail = (mediaData: IMediaData, index: number, imageSettings: IImageSettings): React.ReactNode => {\n const videoData = mediaData.videoData;\n let image: IImageData;\n if (videoData?.thumbnail) {\n image = videoData.thumbnail;\n } else {\n image = {\n src: 'empty'\n };\n }\n\n return (\n
\n \n
\n {}\n \n
\n
\n );\n };\n\n private _mapProductToImageData(product: SimpleProduct): IImageData {\n return {\n src: product.PrimaryImageUrl ?? ''\n };\n }\n\n private _renderEmptyImage(imageSettings: IImageSettings | undefined): React.ReactNode {\n return (\n
\n \n
\n );\n }\n\n private _getEmptyThumbnailItem(\n imageSettings: IImageSettings | undefined,\n index: number,\n modifiedActiveIndex: number\n ): IMediaGalleryThumbnailItemViewProps {\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'tab',\n tabIndex: 0,\n key: 'empty',\n 'aria-label': '',\n 'aria-selected': modifiedActiveIndex === index,\n onClick: this._generateOnThumbnailClick(index),\n onKeyDown: this._generateOnThumbnailKeyDown(index)\n },\n Picture: (\n \n )\n };\n }\n\n private readonly isFirstItem = () => this.state.activeIndex === 0;\n\n private readonly isLastItem = () => {\n const images = this.state.mediaGalleryItems;\n return images && this.state.activeIndex === images.length - 1;\n };\n\n private readonly openModalDialog = (): void => {\n this._toggleModal();\n };\n\n private _toggleModal(): void {\n if (this.state.modalIsOpen) {\n this.fullScreenOverlayButtonRef.current?.focus();\n const parentDiv = this._inlineZoomDivRef.get(this.state.activeIndex);\n if (parentDiv && parentDiv.children && parentDiv.children.length >= 2) {\n const image = parentDiv.children[1].querySelector('img');\n if (image) {\n image.removeAttribute('style');\n }\n }\n this.setState({\n isImageZoomed: false\n });\n }\n this.setState({\n isImageZoomed: false,\n modalIsOpen: !this.state.modalIsOpen\n });\n removeInlineZoomStyle();\n removeContainerZoomStyle();\n }\n\n private readonly imageModalSlider = (ZoomView: string): React.ReactElement => {\n const {\n data: {\n product: { result: product }\n },\n resources\n } = this.props;\n let mediaGalleryItems = this.state.mediaGalleryItems;\n\n if (!mediaGalleryItems && product) {\n mediaGalleryItems = [this._mapProductToImageData(product)];\n }\n const carouselprops = {\n tag: Carousel,\n className: 'ms-media-gallery__carousel',\n items:\n mediaGalleryItems &&\n mediaGalleryItems.map((item: IImageData, index: number) =>\n this._renderCarouselItemImageView(ZoomView, item, this._zoomedImageSettings, index, true)\n ),\n activeIndex: this.state.activeIndex,\n next: this.next,\n previous: this.previous,\n interval: false,\n directionTextPrev: resources.previousScreenshotFlipperText,\n directionTextNext: resources.nextScreenshotFlipperText,\n onIndicatorsClickHandler: this.goToIndex,\n showPaginationTooltip: true,\n hideIndicator: false,\n keyboard: false,\n handleOnExited: this.onExited,\n handleOnExiting: this.onExiting,\n isDisabledFunctionality: this.state.isMobileImageZoomed\n } as IComponentNodeProps;\n const carousel = ;\n\n const imageModalSliderProps: IModalViewProps = {\n modalIsOpen: this.state.modalIsOpen,\n ontoggle: this._toggleModal,\n galleryCarousel: carousel,\n classNames: classnames('ms-media-gallery__modal', 'msc-modal-input-required')\n };\n return ImagefullView(imageModalSliderProps) as React.ReactElement;\n };\n\n private shouldUseCmsAltText = (): boolean => {\n if (this.props.config.altTextSource === 'product') {\n return false;\n } else {\n return true;\n }\n };\n}\n\nexport default MediaGallery;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IImageData, IImageSettings, Image, Video } from '@msdyn365-commerce/core';\nimport {\n IMediaData,\n IMediaGalleryThumbnailItemViewProps,\n IMediaGalleryThumbnailsViewProps,\n IMediaGalleryViewProps,\n MediaType\n} from '@msdyn365-commerce-modules/media-gallery';\nimport { ArrayExtensions, getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, KeyCodes, Module, Node, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\nimport { IPlayerData, IPlayerOptions, IVideoMetadata, Player } from '@msdyn365-commerce-modules/video-player-utilities';\n\ninterface IMediaGalleryItemsProps extends IMediaGalleryThumbnailItemViewProps {\n Video?: React.ReactElement;\n}\n\n/**\n * Render the thumbnail item images.\n * @param thumbnail - The carousel thumbnail line props.\n * @returns Return HTML having thumbnail container props with image.\n */\nconst renderThumbnailItem = (thumbnail: IMediaGalleryItemsProps): JSX.Element => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from media-gallery.tsx file\n const { ThumbnailItemContainerProps, Picture, Video } = thumbnail;\n\n return {Video ? Video : Picture};\n};\n\n/**\n * Gets the thumbnail item to display media gallery images.\n * @param image - The media gallery images.\n * @param imageSettings - Image settings for the image gallery items.\n * @param imageId - Image id.\n * @param modifiedActiveIndex - Modified Index of the images when selection changes.\n * @param props - The Media gallery view props from business layer.\n * @returns Return thumbnail view props which will be used to render images.\n */\nconst GetThumbnailItemComponent = (\n image: IImageData,\n imageSettings: IImageSettings,\n imageId: number,\n modifiedActiveIndex: number,\n props: IMediaGalleryViewProps,\n mediaTypeValue?: MediaType\n): IMediaGalleryThumbnailItemViewProps => {\n let fallbackImage: string | undefined = '';\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\n const emptyPlaceHolderImage = props.context.app.config?.placeholderImageName as string;\n if (props.data.product.result) {\n fallbackImage = getFallbackImageUrl(\n props.data.product.result.ItemId,\n props.context.request.apiSettings,\n props.context.request.app?.config?.OmniChannelMedia\n );\n }\n if (emptyPlaceHolderImage && fallbackImage) {\n fallbackImage = `${fallbackImage},${emptyPlaceHolderImage}`;\n }\n\n /**\n * OnClick method of media gallery item.\n */\n const onClick = () => {\n props.callbackToggle?.();\n props.callbackThumbnailClick?.(imageId);\n props.state.activeIndex = imageId;\n };\n\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === imageId ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n\n /**\n * Keydown event of media gallery item.\n * @param event - React.KeyboardEvent.\n */\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCodes.Enter) {\n event.preventDefault();\n onClick();\n }\n };\n const defaultIndex = 0;\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'listitem',\n key: imageId\n },\n Picture: (\n \n \n \n \n \n \n \n \n )\n };\n};\n\n/**\n * Render the video player.\n * @param mediaData - Media Data\n * @param index - Index of the video\n * @param activeIndex - Active Index\n * @param imageSettings - Image settings\n * @param props - Media gallery view props\n * @returns - JSX.Element.\n */\nconst RenderVideo = (\n mediaData: IMediaData,\n index: number,\n activeIndex: number,\n imageSettings: IImageSettings,\n props: IMediaGalleryViewProps\n): IMediaGalleryItemsProps => {\n const videoData = mediaData.videoData;\n if (videoData) {\n const options: IPlayerOptions = props.config as IPlayerOptions;\n const playerResources = props.resources;\n const videoMetaData: IVideoMetadata = {};\n videoMetaData.videoId = videoData.id;\n videoMetaData.title = videoData.title;\n videoMetaData.duration = videoData.playTime;\n if (videoData.thumbnail) {\n videoMetaData.posterframeUrl = videoData.thumbnail.src;\n }\n if (videoData._links?.binaryReferences) {\n videoMetaData.videoBinaryReferences = videoData._links.binaryReferences;\n }\n const videoPlayerData: IPlayerData = { options, metaData: videoMetaData };\n\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n index === activeIndex ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'listitem',\n key: index\n },\n Picture: <>,\n Video: (\n \n )\n };\n }\n return GetEmptyThumbnailItemComponent(imageSettings, props);\n};\n\n/**\n * Gets the empty thumbnail item to display media gallery images.\n * @param imageSettings - Image settings for the image gallery items.\n * @param props - The Media gallery view props from business layer.\n * @returns Return thumbnail view props which will be used to render empty images.\n */\nconst GetEmptyThumbnailItemComponent = (\n imageSettings: IImageSettings,\n props: IMediaGalleryViewProps\n): IMediaGalleryThumbnailItemViewProps => {\n let fallbackImage: string | undefined = '';\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\n const emptyPlaceHolderImage = props.context.app.config?.placeholderImageName as string;\n\n if (props.data.product.result) {\n fallbackImage = getFallbackImageUrl(\n props.data.product.result.ItemId,\n props.context.request.apiSettings,\n props.context.request.app?.config?.OmniChannelMedia\n );\n }\n if (emptyPlaceHolderImage && fallbackImage) {\n fallbackImage = `${fallbackImage},${emptyPlaceHolderImage}`;\n }\n\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: 'ms-media-gallery__thumbnail-item',\n role: 'listitem',\n tabIndex: 0,\n key: 0,\n 'aria-label': ''\n },\n Picture: (\n \n )\n };\n};\n\n/**\n * Update media gallery items method.\n * @param items - The media gallery thumbnail item view props.\n * @returns The IImageData array.\n */\nconst getMediaGalleryItems = (items?: IMediaData[]): IMediaData[] | undefined => {\n return items?.map(item => {\n return {\n displayOrder: item.displayOrder,\n mediaTypeValue: item.mediaTypeValue,\n altText: item.altText,\n src: item.src,\n videoData: item.videoData\n };\n });\n};\n\nconst defaultThumbnailImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=295&h=295&q=80&m=6&f=jpg', w: 295, h: 295 },\n xl: { q: 'w=295&h=295&q=80&m=6&f=jpg', w: 295, h: 295 }\n },\n lazyload: true,\n cropFocalRegion: true\n};\n\n/**\n * Render the Media gallery thumbnails to represent images in grid view.\n * @param thumbnails - The thumbnail view props.\n * @param props - The media gallery view props.\n * @returns - The single slide carousel component to render as media gallery image.\n */\nconst renderThumbnails = (thumbnails: IMediaGalleryThumbnailsViewProps, props: IMediaGalleryViewProps): JSX.Element => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from media-gallery.tsx file\n const { ThumbnailsContainerProps, SingleSlideCarouselComponentProps } = thumbnails;\n const { state } = props;\n const mediaGalleryItems = getMediaGalleryItems(state.mediaGalleryItems);\n\n const items: IMediaGalleryItemsProps[] | undefined =\n // eslint-disable-next-line multiline-ternary -- need multiline for easy code reading\n state.lastUpdate && ArrayExtensions.hasElements(mediaGalleryItems) && mediaGalleryItems[0].src === 'empty'\n ? [GetEmptyThumbnailItemComponent(defaultThumbnailImageSettings, props)]\n : // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from media-gallery\n mediaGalleryItems?.map((item: IMediaData, id: number) => {\n if (item.mediaTypeValue === MediaType.Video) {\n if (props.config.allowFullScreen) {\n const videoThumbnail = item.videoData?.thumbnail;\n if (videoThumbnail) {\n return GetThumbnailItemComponent(\n videoThumbnail,\n defaultThumbnailImageSettings,\n id,\n state.activeIndex,\n props,\n item.mediaTypeValue\n );\n } else {\n return GetEmptyThumbnailItemComponent(defaultThumbnailImageSettings, props);\n }\n } else {\n return RenderVideo(item, id, state.activeIndex, defaultThumbnailImageSettings, props);\n }\n } else {\n return GetThumbnailItemComponent(item, defaultThumbnailImageSettings, id, state.activeIndex, props);\n }\n });\n\n return (\n \n {items?.map(renderThumbnailItem)}\n \n );\n};\n\n/**\n * Render the Media gallery items using viewprops.\n * @param props - The media gallery view props.\n * @returns The media gallery module wrapping up images node.\n */\nconst mediaGalleryView: React.FC = props => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from media-gallery.tsx file\n const { CarouselProps, Thumbnails, MediaGallery, Modal } = props;\n\n // The thumbnails in AW theme aren't used as tabs\n const NewSingleSlideCarouselComponentProps = { ...Thumbnails.SingleSlideCarouselComponentProps, useTabList: false };\n const NewThumbnails = { ...Thumbnails, SingleSlideCarouselComponentProps: NewSingleSlideCarouselComponentProps };\n\n return (\n \n \n {Modal}\n {renderThumbnails(NewThumbnails, props)}\n \n );\n};\n\nexport default mediaGalleryView;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["imageSource","imageZoom","thumbnailsOrientation","async","getValidProductImages","productId","channelId","actionContext","imageSettings","selectedProduct","catalogId","getCatalogId","requestContext","actionInput","MediaLocationsForSelectedVariantInput","getMediaLocationsForSelectedVariant","then","mediaLocations","Promise","all","map","mediaLocation","validateMediaLocaionAsync","pairs","filter","pair","catch","error","telemetry","exception","debug","validateProductImages","imageData","src","Uri","altText","AltText","resolve","http","XMLHttpRequest","open","addEventListener","status","send","_unused","MediaGallery","React","constructor","props","_this","_ref","_props$config$zoomedI","super","this","_inlineZoomDivRef","Map","defaultGalleryImageSettings","viewports","xs","q","w","h","sm","md","lg","lazyload","cropFocalRegion","defaultThumbnailImageSettings","onExiting","setState","animating","onExited","next","removeInlineZoomStyle","undefined","isLastItem","nextIndex","state","activeIndex","goToIndex","updateZoomedInImage","previous","images","mediaGalleryItems","isFirstItem","length","index","_getCarouselItem","image","isInPopup","arguments","Image","Object","assign","context","className","gridSettings","request","loadFailureBehavior","id","shouldSkipToMainImage","_getThumbnailItem","modifiedActiveIndex","ThumbnailItemContainerProps","tag","classnames","role","tabIndex","key","onClick","_generateOnThumbnailClick","onKeyDown","_generateOnThumbnailKeyDown","Picture","_refHandler","divRef","set","event","which","KeyCodes","Enter","Space","preventDefault","openModalDialog","_toggleModal","imageModalSlider","ZoomView","data","product","result","resources","_mapProductToImageData","carouselprops","Carousel","items","item","_renderCarouselItemImageView","_zoomedImageSettings","interval","directionTextPrev","previousScreenshotFlipperText","directionTextNext","nextScreenshotFlipperText","onIndicatorsClickHandler","showPaginationTooltip","hideIndicator","keyboard","handleOnExited","handleOnExiting","isDisabledFunctionality","isMobileImageZoomed","carousel","imageModalSliderProps","modalIsOpen","ontoggle","galleryCarousel","classNames","ImagefullView","bind","isImageZoomed","config","zoomedImageSettings","galleryImageSettings","_onImageMouseOut","_inlineZoomImageOnHover","_onInlineImageClick","_onContainerZoomImageClick","_onMouseOutLensContainer","isMobile","variant","VariantType","Viewport","source","pageContext","shouldUpdateOnPartialDimensionSelection","mediaLocationsForSelectedVariant","_this$props$config$th","thumbnailImageSettings","_setImages","RecordId","apiSettings","productVariant","reaction","_product$productVaria","ObjectExtensions","isNullOrUndefined","_this$props$config$th2","shouldComponentUpdate","nextProps","nextState","render","isVertical","vertical","isFullscreenAllowed","allowFullScreen","zoomViewMode","inline","container","mediaGalleryCarouselItems","_getMediaGalleryItems","mediaGalleryThumbnailCarouselItems","_getMediaGalleryThumbnailItems","viewProps","_objectSpread","moduleProps","Modal","callbackToggle","callbackThumbnailClick","callbackThumbnailKeyDown","CarouselProps","indicatorAriaText","ariaLabelForSlide","keys","Thumbnails","ThumbnailsContainerProps","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperNextLabel","parentId","useTabList","JSON","stringify","renderView","ArrayExtensions","hasElements","lastUpdate","defaultKey","_getEmptyThumbnailItem","zoomView","_renderEmptyImage","_this$props$config$sh","curatedImage","imagesToSet","shouldHideMasterProductImagesForVariant","_item$src","incrementedIndex","imageIndex","includes","Date","now","_renderImageInContainerOnZoom","_renderImageFullScreenOnZoom","_renderImageInlineOnZoom","_this$props$config$da","ref","dataScale","defaultDataScale","onMouseOver","onMouseMove","inlineZoomImageOnMouseMove","_this$props$config$da2","inlineZoomImageOnHover","String","_handleMobileViewZoomedImageClick","target","currentTarget","mobileZoomedInImageClassName","style","transform","classList","remove","parentElement","overflow","_this$props$config$da3","bounds","getBoundingClientRect","Number","positionX","clientX","left","positionY","clientY","top","scaledPositionX","scaledPositionY","add","scrollTo","_this$props$config$da4","window","innerWidth","inlineZoomInitClick","inlineZoomImageOnMouseOut","onContainerZoomInit","onMouseOutLensContainer","_this$props$config$da5","onMouseOut","onMouseMoveLensContainer","onMouseOverImageContainer","href","title","fullScreenTitleText","PrimaryImageUrl","parentDiv","get","children","querySelector","removeAttribute","removeContainerZoomStyle","_renderThumbnails","thumbnails","Node","_renderThumbnailItem","thumbnail","Module","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","__bindings__","viewDictionary","cn","MediaType","renderThumbnailItem","Video","GetThumbnailItemComponent","imageId","mediaTypeValue","_props$context$app$co","_props$config$thumbna","_props$context$reques2","fallbackImage","emptyPlaceHolderImage","app","placeholderImageName","_props$context$reques","getFallbackImageUrl","ItemId","OmniChannelMedia","_props$callbackToggle","_props$callbackThumbn","call","handleKeyDown","keyCode","Button","imageFallbackOptimize","shouldUseOptimizedImage","fallBackSrc","bypassHideOnFailure","playVideoTitleText","GetEmptyThumbnailItemComponent","_props$context$app$co2","_props$config$thumbna2","_props$context$reques3","skipImageValidation","xl","renderThumbnails","displayOrder","videoData","getMediaGalleryItems","_item$videoData","videoThumbnail","RenderVideo","mediaData","_videoData$_links","options","playerResources","videoMetaData","videoId","duration","playTime","posterframeUrl","_links","binaryReferences","videoBinaryReferences","videoPlayerData","metaData","editProps","Player","playerData","isEditor","params","NewSingleSlideCarouselComponentProps","NewThumbnails","module","exports","ReactDOM"],"sourceRoot":""}