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AG7B,GAFApe,IAAAA,cAACwC,EAAAA,KAAIC,OAAAC,OAAA,GAAK+X,GAAuBC,GAInC2E,EAAAA,iBAAiBC,cAAclB,GAmC7B,KAlCApe,IAAAA,cAAAA,IAAAA,SAAA,KACIA,IAAAA,cAACwC,EAAAA,KAAI,CAACP,UAAU,2CACVoC,EAA8BY,UAC/BiZ,EAAYC,EAAyBtc,IAE1C7B,IAAAA,cAACwC,EAAAA,KAAI,CAACP,UAAU,sCACZjC,IAAAA,cAACwC,EAAAA,KAAI,CAACP,UAAU,6BACXC,EAAAA,EAAAA,GACGoL,EACAnL,EACAC,EACAC,EACAC,IAEHiD,EAAAA,EAAAA,GACGqV,EACAO,EACA7V,EACAnD,EACAkZ,EACAhZ,EACAC,KAGP2D,EAAAA,EAAAA,GACG4U,EACAO,EACAhZ,EACAkZ,EACAjZ,EACAC","sources":["webpack://bestseller.commerce.online/external var \"React\"?0d3b","webpack://bestseller.commerce.online/external var \"ReactDOM\"?853b","webpack://bestseller.commerce.online/./src/shared/functions/get-commercial-name.ts?6aba","webpack://bestseller.commerce.online/./src/search-state.ts?dd10","webpack://bestseller.commerce.online/./src/search-state-data-action.ts?8223","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.categorysuggest.tsx?c73a","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.mobile.empty.tsx?4216","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.form.tsx?e656","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.keywordsuggest.tsx?3d15","webpack://bestseller.commerce.online/./src/themes/only/views/components/search.productsuggest.tsx?f667","webpack://bestseller.commerce.online/./lib/ext-search/module-registration.js?3799","webpack://bestseller.commerce.online/./src/modules/ext-search/actions/get-auto-suggest-suggestions.ts?5b12","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.categorysuggest.tsx?5a0b","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.form.tsx?8113","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.keywordsuggest.tsx?003c","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.label.tsx?44e8","webpack://bestseller.commerce.online/./src/modules/ext-search/components/ext-search.productsuggest.tsx?ef64","webpack://bestseller.commerce.online/./src/modules/ext-search/ext-search.props.autogenerated.ts?be6f","webpack://bestseller.commerce.online/./src/modules/ext-search/ext-search.tsx?8892","webpack://bestseller.commerce.online/./src/modules/ext-search/ext-search.view.tsx?810d","webpack://bestseller.commerce.online/./src/themes/only/views/ext-search.view.tsx?d98f"],"sourcesContent":["module.exports = React;","module.exports = ReactDOM;","/**\r\n * Centralised location for checkout generic data updates\r\n */\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Gets the CommercialName from a list of attributes - returns the product name if no commercial name attribute is present\r\n * @param attributes\r\n * @param productName\r\n * @param commercialStyleNameAttribute\r\n * @returns\r\n */\r\nexport const getCommercialName = (\r\n attributes: AttributeValue[] = [],\r\n productName: string = '',\r\n commercialStyleNameAttribute: string = 'CommercialStyleName'\r\n): string => {\r\n var styleName = attributes.find(x => x.Name === commercialStyleNameAttribute);\r\n var productBrand = productName?.split(' ')[0] ?? '';\r\n if (styleName?.TextValue) {\r\n return `${productBrand} ${styleName?.TextValue}`;\r\n }\r\n\r\n return productName;\r\n};\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { observable } from 'mobx';\n\n/**\n * State information related to what is needed to succesfully perform a autosuggest.\n */\nexport class SearchState {\n @observable public searchText?: string;\n\n @observable public defaultBasicSearchUrl?: string;\n\n @observable public searchQueryStringParameter?: string;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { SearchState } from './search-state';\n\nexport function createSearchStateInput(result: SearchState): GenericInput {\n return new GenericInput('searchState', result, 'SearchState');\n}\n\nconst createsearchStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createSearchStateInput({ searchText: '' });\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createsearchStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","/*!\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 { ISearchData, ISearchViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\r\n\r\n/**\r\n * Render Categories heading.\r\n * @param inCategoriesHeading - The Keywords result heading.\r\n * @returns The JSX Element.\r\n */\r\nconst renderCategorySuggestionsTitle = (inCategoriesHeading: string): JSX.Element => {\r\n const categoryAutoSuggestionHeading = inCategoriesHeading ? inCategoriesHeading : 'In categories';\r\n\r\n return
{categoryAutoSuggestionHeading}
;\r\n};\r\n\r\n/**\r\n * Render Categories suggestion result.\r\n * @param inCategoriesHeading - The Categories result heading.\r\n * @param noResultText - The \"No Result\" text.\r\n * @param props - The Categories suggestion result.\r\n * @param isLoadingAutoSuggest - The autosuggestion loading flag.\r\n * @param isLoadingNode - The autosuggestion loading node.\r\n * @returns The JSX Element.\r\n */\r\nexport const CategorySuggestionsComponent = (\r\n inCategoriesHeading: string,\r\n noResultText: string,\r\n props: ISearchViewProps & ISearchProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n): JSX.Element => {\r\n return props.autosuggestCategory ? (\r\n \r\n {renderCategorySuggestionsTitle(inCategoriesHeading)}\r\n \r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n props.autosuggestCategory.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n ) : (\r\n \r\n {renderCategorySuggestionsTitle(inCategoriesHeading)}\r\n \r\n
  • {noResultText}
  • \r\n
    \r\n
    \r\n );\r\n};\r\n","/*!\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 { IImageData, Image } from '@msdyn365-commerce/core';\r\nimport { ISearchData } from '@msdyn365-commerce-modules/search';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\r\n\r\n/**\r\n * Render Products Suggestion result heading.\r\n * @param props -The props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductNotFoundResultsImage = (props: ISearchProps): JSX.Element | null => {\r\n const noSearchResultImage: IImageData | undefined = props.config.noSearchResultImage;\r\n if (!noSearchResultImage || !noSearchResultImage.src) {\r\n return null;\r\n }\r\n const imageSettings = {\r\n lazyload: true,\r\n viewports: {\r\n xs: { w: 100, h: 100, q: 'w=100&h=100&q=60&m=6' }\r\n }\r\n };\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render Product suggestion result.\r\n * @param props -The props.\r\n * @returns The JSX Element.\r\n */\r\nexport const MobileAutoSuggestEmptyComponent = (props: ISearchProps): JSX.Element => {\r\n return (\r\n \r\n
    {renderProductNotFoundResultsImage(props)}
    \r\n
    \r\n
    {props.resources.emptyMobileSearchTextHeading}
    \r\n
    {props.resources.emptyMobileSearchText}
    \r\n
    \r\n
    \r\n );\r\n};\r\n","/*!\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 { ISearchData, ISearchFormViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { Button, INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\r\nimport { MobileAutoSuggestEmptyComponent } from './search.mobile.empty';\r\n\r\n/**\r\n * Render Clear button for mobile viewport.\r\n * @param clearSearchButtonText -The Clear button text.\r\n * @param clearSearch -Clear Search callback.\r\n * @returns -The JSX Element.\r\n */\r\nconst renderClearButton = (clearSearchButtonText: string, clearSearch: () => void): JSX.Element => {\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render Search form.\r\n * @param form -Form view props.\r\n * @param searchForm -Search Form props.\r\n * @param formWrapper -Form Wrapper props.\r\n * @param isMobile -Is mobile viewport flag.\r\n * @param clearSearchButtonText -The Clear button text.\r\n * @param props -The props for resource.\r\n * @param isSearchText -Is SearchText flag for input text.\r\n * @param clearSearch -Clear Search callback.\r\n * @returns -The JSX Element.\r\n */\r\nexport const FormComponent = (\r\n form: ISearchFormViewProps,\r\n searchForm: INodeProps,\r\n formWrapper: INodeProps,\r\n isMobile: boolean,\r\n clearSearchButtonText: string,\r\n props: ISearchProps,\r\n isSearchText: boolean,\r\n clearSearch: () => void\r\n): JSX.Element => {\r\n const cancelButtonNode = (\r\n \r\n );\r\n\r\n return isMobile ? (\r\n \r\n {form.cancelBtn}\r\n \r\n {form.input}\r\n {isSearchText && renderClearButton(clearSearchButtonText, clearSearch)}\r\n {!isSearchText ? MobileAutoSuggestEmptyComponent(props) : null}\r\n \r\n \r\n ) : (\r\n \r\n \r\n {form.submitBtn}\r\n {form.input}\r\n {isSearchText && cancelButtonNode}\r\n \r\n \r\n );\r\n};\r\n","/*!\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 { ISearchKeywordViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\n/**\r\n * Render keywords heading.\r\n * @param keywordsHeading -The Keywords result heading.\r\n * @returns The JSX Element.\r\n */\r\nconst renderKeywordSuggestionsTitle = (keywordsHeading: string): JSX.Element => {\r\n const categoryAutoSuggestionHeading = keywordsHeading ? keywordsHeading : 'Keywords';\r\n\r\n return
    {categoryAutoSuggestionHeading}
    ;\r\n};\r\n\r\n/**\r\n * Render keywords reults.\r\n * @param keywordSuggest -The Keywords suggest Node props.\r\n * @param ulKeyword -The List Node props.\r\n * @param keywordsHeading -The Keywords result heading.\r\n * @param noResultText -The \"No Result\" text.\r\n * @param keywordSuggestions -The Keywords suggestion result.\r\n * @param isLoadingAutoSuggest - The autosuggestion loading flag.\r\n * @param isLoadingNode - The autosuggestion loading node.\r\n * @returns -The JSX Element.\r\n */\r\nexport const KeywordSuggestionsComponent = (\r\n keywordSuggest: INodeProps,\r\n ulKeyword: INodeProps,\r\n keywordsHeading: string,\r\n noResultText: string,\r\n keywordSuggestions?: ISearchKeywordViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n): JSX.Element => {\r\n return keywordSuggestions ? (\r\n \r\n {renderKeywordSuggestionsTitle(keywordsHeading)}\r\n \r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n keywordSuggestions.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n ) : (\r\n \r\n {renderKeywordSuggestionsTitle(keywordsHeading)}\r\n \r\n
  • {noResultText}
  • \r\n
    \r\n
    \r\n );\r\n};\r\n","/*!\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 { IImageData, Image } from '@msdyn365-commerce/core';\r\nimport { ISearchData, ISearchProductViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\r\n\r\n/**\r\n * Render Products Suggestion result heading.\r\n * @param productSuggestionsHeading -The products suggestion result heading.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductSuggestionsTitle = (productSuggestionsHeading: string): JSX.Element => {\r\n const productAutoSuggestionHeading = productSuggestionsHeading ? productSuggestionsHeading : 'Products';\r\n\r\n return
    {productAutoSuggestionHeading}
    ;\r\n};\r\n\r\n/**\r\n * Render Products Suggestion result heading.\r\n * @param props -The props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductNotFoundResultsImage = (props: ISearchProps): JSX.Element | null => {\r\n const noSearchResultImage: IImageData | undefined = props.config.noSearchResultImage;\r\n if (!noSearchResultImage || !noSearchResultImage.src) {\r\n return null;\r\n }\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render Products No result section.\r\n * @param props -The props.\r\n * @returns The JSX Element.\r\n */\r\nconst renderProductNotFoundResults = (props: ISearchProps): JSX.Element => {\r\n return (\r\n \r\n
    {renderProductNotFoundResultsImage(props)}
    \r\n
    {props.resources.noResultContentHeadingText}
    \r\n
    \r\n {props.resources.noResultContentParagraphText}\r\n
    \r\n
    \r\n );\r\n};\r\n\r\n/**\r\n * Render Product suggestion result.\r\n * @param productSuggest -The product suggest Node props.\r\n * @param ulProduct -The List Node props.\r\n * @param props -The props.\r\n * @param productSuggestions -The Product suggestion result.\r\n * @param isLoadingAutoSuggest - The autosuggestion loading flag.\r\n * @param isLoadingNode - The autosuggestion loading node.\r\n * @returns The JSX Element.\r\n */\r\nexport const ProductSuggestionsComponent = (\r\n productSuggest: INodeProps,\r\n ulProduct: INodeProps,\r\n props: ISearchProps,\r\n productSuggestions?: ISearchProductViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n): JSX.Element => {\r\n const liProduct: INodeProps = {\r\n tag: 'li',\r\n className: 'msc-no-result-content'\r\n };\r\n return productSuggestions ? (\r\n \r\n {renderProductSuggestionsTitle(props.resources.productSuggestionHeading)}\r\n \r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n productSuggestions.items.map((item, index) => {\r\n return (\r\n \r\n \r\n {item.thumbnail}\r\n {item.text}\r\n {item.price}\r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n ) : (\r\n \r\n {renderProductSuggestionsTitle(props.resources.productSuggestionHeading)}\r\n \r\n {renderProductNotFoundResults(props)}\r\n \r\n \r\n );\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['ext-search'] = {\n c: () => require('partner/modules/ext-search/ext-search.tsx'),\n $type: 'contentModule',\n da: [{name:'searchState', path:'@msdyn365-commerce-modules/search-utilities/dist/lib/search-state-data-action', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'ext-search',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/ext-search'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/search-utilities/dist/lib/search-state-data-action';\n let dataAction = require('@msdyn365-commerce-modules/search-utilities/dist/lib/search-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|ext-search|ext-search'] = {\n c: () => require('partner/modules/ext-search/ext-search.view.tsx'),\n cn: '__local__-__local__-ext-search'\n };\nviewDictionary['__local__|__local__|themes|only|views|ext-search'] = {\n c: () => require('partner/themes/only/views/ext-search.view.tsx'),\n cn: '__local__-__local__-ext-search'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\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\n/* eslint-disable no-duplicate-imports */\r\nimport { Autosuggestions } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getCatalogId,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n AttributeDataType,\r\n ChannelInventoryConfiguration,\r\n ProductRefinerSource,\r\n ProductRefinerValue,\r\n ProductSearchCriteria,\r\n SearchSuggestion,\r\n SearchSuggestionCriteria\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getInventoryConfigurationAsync,\r\n getSearchSuggestionsAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nexport enum SuggestionType {\r\n Category = 'ScopedCategory',\r\n Keyword = 'Keyword',\r\n Product = 'Product',\r\n None = 'None'\r\n}\r\n\r\n/**\r\n * This setting defines inventory filtering options.\r\n */\r\nexport enum ProductListInventoryFilteringOptions {\r\n /**\r\n * Filter out all products out of stock.\r\n */\r\n HideOOS = 'hideOOS',\r\n\r\n /**\r\n * Sort products by availability, OOS goes last.\r\n */\r\n SortOOS = 'sortOOS',\r\n\r\n /**\r\n * No filtering selected.\r\n */\r\n Default = 'default'\r\n}\r\n\r\n/**\r\n * Input class for auto suggest search input.\r\n */\r\nexport class AutoSuggestInput implements IActionInput {\r\n public searchQuery?: string;\r\n\r\n public topResultsCount?: number;\r\n\r\n public suggestionType?: string;\r\n\r\n public hitPrefix?: string;\r\n\r\n public hitSuffix?: string;\r\n\r\n public constructor(searchText?: string, top?: number, suggestionType?: string, hitPrefix?: string, hitSuffix?: string) {\r\n this.searchQuery = searchText;\r\n this.topResultsCount = top;\r\n this.suggestionType = suggestionType;\r\n this.hitPrefix = hitPrefix;\r\n this.hitSuffix = hitSuffix;\r\n }\r\n\r\n public getCacheKey = () => 'AutoSuggestSearchSuggestions';\r\n\r\n public getCacheObjectType = () => 'AutoSuggestSearchSuggestions';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext) => {\r\n return new AutoSuggestInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a auto-suggest suggestions.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getSearchSuggestionsAction(input: AutoSuggestInput, ctx: IActionContext): Promise {\r\n // If no input is provided fail out\r\n if (!input || !input.searchQuery) {\r\n throw new Error('[getSearchSuggestionsAction]No valid Input was provided, failing');\r\n }\r\n\r\n const autosuggest: Autosuggestions = {};\r\n\r\n const autoSuggestPromises = [_getAutoSuggest(input, autosuggest, ctx)];\r\n return Promise.all(autoSuggestPromises).then(() => {\r\n return autosuggest;\r\n });\r\n}\r\n\r\n/**\r\n * Returns inventory in stock sortable refiner value.\r\n * @param channelInventoryConfiguration - The channelInventoryConfiguration.\r\n * @param isInStock - The flag indicating whether is getting in-stock refiner or out-of-stock refiner.\r\n * @returns Refiners.\r\n */\r\nconst getInventorySortableRefinerValue = (\r\n channelInventoryConfiguration: ChannelInventoryConfiguration,\r\n isInStock: boolean\r\n): ProductRefinerValue | undefined => {\r\n if (channelInventoryConfiguration && channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId) {\r\n return {\r\n RefinerRecordId: channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId,\r\n DataTypeValue: AttributeDataType.TrueFalse,\r\n LeftValueBoundString: isInStock ? 'true' : 'false',\r\n RightValueBoundString: isInStock ? 'true' : 'false',\r\n UnitText: '',\r\n RowNumber: 0,\r\n Count: 0,\r\n ExtensionProperties: [],\r\n RefinerSourceValue: ProductRefinerSource.Attribute\r\n };\r\n }\r\n return undefined;\r\n};\r\n\r\nasync function _getAutoSuggest(input: AutoSuggestInput, autosuggest: Autosuggestions, ctx: IActionContext): Promise {\r\n const catalogId = getCatalogId(ctx.requestContext);\r\n let productSearchCriteria: ProductSearchCriteria = {\r\n SearchCondition: input.searchQuery && input.searchQuery.length > 0 ? input.searchQuery : '',\r\n Context: {\r\n ChannelId: +ctx.requestContext.apiSettings.channelId,\r\n CatalogId: catalogId\r\n }\r\n };\r\n\r\n if (ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n const channelInventoryConfiguration = await getInventoryConfigurationAsync({ callerContext: ctx });\r\n const isInStockRefiner = true;\r\n const inventoryRefinerValue = getInventorySortableRefinerValue(channelInventoryConfiguration, isInStockRefiner);\r\n\r\n if (inventoryRefinerValue) {\r\n productSearchCriteria = {\r\n ...productSearchCriteria,\r\n Refinement: [inventoryRefinerValue]\r\n };\r\n }\r\n }\r\n\r\n const searchCriteria: SearchSuggestionCriteria = {\r\n ProductSearchCriteria: productSearchCriteria,\r\n HitPrefix: input.hitPrefix,\r\n HitSuffix: input.hitSuffix,\r\n SuggestionType: input.suggestionType\r\n };\r\n\r\n const searchSuggestions = await getSearchSuggestionsAsync(\r\n { callerContext: ctx, queryResultSettings: { Paging: { Top: input.topResultsCount } } },\r\n searchCriteria\r\n );\r\n\r\n if (searchSuggestions && searchSuggestions.length > 0) {\r\n // Generate image url\r\n searchSuggestions.map(\r\n (item: SearchSuggestion) =>\r\n (item.ImageUrl = item.ImageUrl ? generateImageUrl(item.ImageUrl, ctx.requestContext.apiSettings) : '')\r\n );\r\n\r\n autosuggest.AllSearchResults = searchSuggestions;\r\n } else {\r\n ctx.telemetry.error(\r\n `[getSearchSuggestionsAction] unable to get availabilites for search with suggestion type ${searchCriteria.SuggestionType}`\r\n );\r\n }\r\n}\r\n\r\nexport const getSearchSuggestionsActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/search/get-auto-suggest-suggestions',\r\n action: >getSearchSuggestionsAction,\r\n input: createInput\r\n});\r\n\r\nexport default getSearchSuggestionsActionDataAction;\r\n","/*!\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\n/* eslint-disable no-duplicate-imports */\r\n/* eslint-disable security/detect-non-literal-regexp */\r\n/* eslint-disable security/detect-object-injection */\r\nimport MsDyn365, { getRichTextHtml } from '@msdyn365-commerce/core';\r\nimport { ProductRefiner, ProductRefinerSource, ProductRefinerValue, SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\r\nimport { format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IExtSearchData } from '../ext-search.data';\r\nimport { IExtSearchProps } from '../ext-search.props.autogenerated';\r\n\r\nexport interface ISearchCategorySuggestProps {\r\n searchCategorySuggestClass: string;\r\n searchPageURL: string;\r\n searchQsp: string | undefined;\r\n hitPrefix: string;\r\n hitSuffix: string;\r\n autoSuggestProps: IExtSearchProps;\r\n searchText: string;\r\n searchRefiners: ProductRefiner[] | undefined;\r\n suggestions: SearchSuggestion[] | undefined;\r\n telemetryContent?: ITelemetryContent;\r\n shouldShowFullPath?: boolean;\r\n}\r\n\r\nexport interface ISearchCategoryViewProps {\r\n title: React.ReactNode;\r\n text: React.ReactNode[];\r\n}\r\n\r\nlet payLoad: IPayLoad;\r\n\r\n/**\r\n * CategorySuggestionsComponent.\r\n * @param props\r\n */\r\nexport const CategorySuggestionsComponent = (props: ISearchCategorySuggestProps): ISearchCategoryViewProps | undefined => {\r\n const {\r\n suggestions,\r\n searchText,\r\n autoSuggestProps: {\r\n resources: { categorySuggestionHeading }\r\n }\r\n } = props;\r\n\r\n const reactNodes: React.ReactNode[] = [];\r\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\r\n\r\n suggestions?.map(item => {\r\n reactNodes.push(_assembleNode(item, props));\r\n });\r\n\r\n const titleNode = _renderTitle(categorySuggestionHeading, searchText);\r\n\r\n return { title: titleNode, text: reactNodes };\r\n};\r\n\r\nconst _renderTitle = (categorySuggestionHeading: string, searchText: string) => {\r\n const categoryAutoSuggestionHeading = categorySuggestionHeading\r\n ? format(categorySuggestionHeading, searchText)\r\n : `Search \"${searchText}\" in categories`;\r\n\r\n return
  • {categoryAutoSuggestionHeading}
  • ;\r\n};\r\n\r\nconst _assembleNode = (item: SearchSuggestion, props: ISearchCategorySuggestProps) => {\r\n const { searchText, hitPrefix, hitSuffix, shouldShowFullPath } = props;\r\n\r\n const splitValue = shouldShowFullPath ? item.Value : item.Value && item.Value.split('|').pop();\r\n const ariaLabel = splitValue\r\n ? splitValue.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '')\r\n : item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n payLoad.contentAction.etext = item.Value;\r\n const attribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n return (\r\n
  • \r\n \r\n {_generateLink(item, searchText, props) && _getHighlightedText(splitValue ? splitValue : '', hitPrefix, hitSuffix)}\r\n \r\n
  • \r\n );\r\n};\r\n\r\nconst _generateLink = (suggestion: SearchSuggestion, searchText: string, props: ISearchCategorySuggestProps): string => {\r\n return suggestion && suggestion.Id ? _getCategoryLink(suggestion.Id, searchText, props) : '';\r\n};\r\n\r\nconst _getCategoryLink = (id: string, searchText: string, props: ISearchCategorySuggestProps): string => {\r\n const { searchPageURL, searchQsp, searchRefiners } = props;\r\n\r\n if (!MsDyn365.isBrowser) {\r\n return '';\r\n }\r\n\r\n const queryUrl = new URL(searchPageURL, window.location.href);\r\n\r\n if (searchQsp && searchText) {\r\n queryUrl.searchParams.set(searchQsp, searchText);\r\n }\r\n\r\n const categoryRefiners = searchRefiners?.find(refiners => {\r\n return refiners.SourceValue === ProductRefinerSource.Category;\r\n });\r\n const refiner = categoryRefiners?.Values?.find(item => {\r\n return item.RefinerRecordId === Number.parseInt(id, 10);\r\n });\r\n\r\n const encodedRefiner = refiner && JSON.stringify(compressRefiners([refiner]));\r\n if (encodedRefiner) {\r\n queryUrl.searchParams.set('refiners', encodedRefiner);\r\n }\r\n\r\n return queryUrl.href;\r\n};\r\n\r\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\r\n const formattedText = suggestion\r\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\r\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n\r\n // eslint-disable-next-line react/no-danger\r\n return ;\r\n};\r\n\r\n// TODO: This code is currently duplicated in categoryautosuggest need to either remove one of these files\r\n// or move this code to a common place\r\nconst compressedRefinerKeys = [\r\n 'DataTypeValue',\r\n 'LeftValueBoundString',\r\n 'RefinerRecordId',\r\n 'RefinerSourceValue',\r\n 'RightValueBoundString',\r\n 'UnitText'\r\n];\r\n\r\n/**\r\n * Compressed a list of refiners for use in URLs.\r\n * @param refiners The uncompressed refiners.\r\n */\r\nconst compressRefiners = (refiners: ProductRefinerValue[]) => {\r\n const compressedRefiners: (string | number)[][] = [];\r\n\r\n refiners.forEach(refiner => {\r\n const compressedRefiner: (string | number)[] = [];\r\n compressedRefinerKeys.forEach(refinerKey => {\r\n compressedRefiner.push(refiner[refinerKey]);\r\n });\r\n compressedRefiners.push(compressedRefiner);\r\n });\r\n\r\n return compressedRefiners;\r\n};\r\n","/*!\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\n/* eslint-disable no-duplicate-imports */\r\nimport { Button } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface ISearchFormProps {\r\n hideSearchLabel: boolean | undefined;\r\n isSearchFormExpanded?: boolean | undefined;\r\n disableSubmitSearch: boolean | undefined;\r\n searchTextInput: React.RefObject;\r\n maxChars: number;\r\n searchQsp: string;\r\n searchPlaceholder: string;\r\n query: string;\r\n ariaLabelCancel: string;\r\n ariaLabelSearch: string;\r\n ariaLabelSubmit: string;\r\n handleCancelSearchChange(): void;\r\n handleInputChange(query: string): void;\r\n}\r\n\r\nexport interface ISearchFormViewProps {\r\n input: React.ReactNode;\r\n submitBtn: React.ReactNode;\r\n cancelBtn: React.ReactNode;\r\n}\r\n\r\n/**\r\n * On Input Change functionality.\r\n * @param handleInputChange -Input change function.\r\n * @returns Set updated input value.\r\n */\r\nconst onInputChangeFunction = (handleInputChange: (query: string) => void) => (event: React.ChangeEvent) => {\r\n handleInputChange(event.target.value || '');\r\n};\r\nexport const FormComponent = (props: ISearchFormProps): ISearchFormViewProps => {\r\n const {\r\n searchQsp,\r\n searchPlaceholder,\r\n hideSearchLabel,\r\n searchTextInput,\r\n handleInputChange,\r\n maxChars,\r\n disableSubmitSearch,\r\n handleCancelSearchChange,\r\n query,\r\n ariaLabelCancel,\r\n ariaLabelSearch,\r\n ariaLabelSubmit\r\n } = props;\r\n\r\n const onInputChange = onInputChangeFunction(handleInputChange);\r\n\r\n const inputNode = !hideSearchLabel ? (\r\n \r\n ) : (\r\n \r\n );\r\n\r\n const submitBtnNode = !disableSubmitSearch && \r\n \r\n );\r\n};\r\n","/*!\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\n/* eslint-disable no-duplicate-imports */\r\n/* eslint-disable security/detect-non-literal-regexp */\r\n/* eslint-disable security/detect-object-injection */\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport { getRichTextHtml, IActionContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\r\nimport { SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\r\nimport { getProductPageUrlSync, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n INodeProps,\r\n IPayLoad,\r\n ITelemetryContent,\r\n NodeTag\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IExtSearchData } from '../ext-search.data';\r\nimport { IExtSearchProps } from '../ext-search.props.autogenerated';\r\n\r\n/**\r\n * Search product suggest resources.\r\n */\r\nexport interface ISearchProductSuggestResources {\r\n freePriceText: string;\r\n}\r\n\r\nexport interface ISearchProductSuggestProps {\r\n searchProductSuggestClass: string;\r\n searchPageURL: string;\r\n searchQsp: string | undefined;\r\n hitPrefix: string;\r\n hitSuffix: string;\r\n autoSuggestProps: IExtSearchProps;\r\n searchText: string;\r\n suggestions: SearchSuggestion[] | undefined;\r\n telemetry: ITelemetry;\r\n moduleType: string;\r\n moduleId: string;\r\n telemetryContent?: ITelemetryContent;\r\n resources?: ISearchProductSuggestResources;\r\n}\r\n\r\nexport interface ISearchProductViewProps {\r\n title: React.ReactNode;\r\n items: ISearchProductItemViewProps[];\r\n}\r\n\r\nexport interface ISearchProductItemViewProps {\r\n text: React.ReactNode;\r\n thumbnail: React.ReactNode;\r\n price: React.ReactNode;\r\n LiProduct: INodeProps;\r\n AProduct: INodeProps;\r\n id: string | undefined;\r\n}\r\n\r\nlet payLoad: IPayLoad;\r\nlet telemetryContent: ITelemetryContent | undefined;\r\n\r\n/**\r\n * ProductSuggestionsComponent.\r\n * @param props\r\n */\r\nexport const ProductSuggestionsComponent = (props: ISearchProductSuggestProps): ISearchProductViewProps | undefined => {\r\n const {\r\n suggestions,\r\n hitSuffix,\r\n hitPrefix,\r\n autoSuggestProps: {\r\n context: { actionContext },\r\n resources: { productSuggestionHeading }\r\n },\r\n moduleType,\r\n moduleId\r\n } = props;\r\n const reactNodes: ISearchProductItemViewProps[] = [];\r\n telemetryContent = props.telemetryContent;\r\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\r\n\r\n suggestions?.map(item => {\r\n reactNodes.push(_assembleNode(item, hitPrefix, hitSuffix, actionContext, props, moduleType, moduleId));\r\n });\r\n\r\n const titleNode = _renderTitle(productSuggestionHeading);\r\n\r\n return { title: titleNode, items: reactNodes };\r\n};\r\n\r\nconst _renderTitle = (productSuggestionHeading: string) => {\r\n const productAutoSuggestionHeading = productSuggestionHeading ? productSuggestionHeading : 'Go to products';\r\n\r\n return
  • {productAutoSuggestionHeading}
  • ;\r\n};\r\n\r\nconst _assembleNode = (\r\n item: SearchSuggestion,\r\n hitPrefix: string,\r\n hitSuffix: string,\r\n actionContext: IActionContext,\r\n props: ISearchProductSuggestProps,\r\n moduleType: string,\r\n moduleId: string\r\n): ISearchProductItemViewProps => {\r\n const altText =\r\n item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n\r\n const price = item.Value3?.Value?.DecimalValue;\r\n return {\r\n text: _getHighlightedText(item.Value ? item.Value : '', hitPrefix, hitSuffix),\r\n thumbnail: _renderThumbnail(item, altText ? altText : '', props),\r\n price: !ObjectExtensions.isNullOrUndefined(price) && _renderPrice(price, price, moduleId, moduleType, props),\r\n LiProduct: _getLiWrapper(),\r\n AProduct: _getAWrapper(item, hitPrefix, hitSuffix, actionContext, props),\r\n id: item.Id\r\n };\r\n};\r\n\r\nconst _getLiWrapper = () => {\r\n return {\r\n className: 'msc-autoSuggest__productResults-item',\r\n tag: 'li' as NodeTag\r\n };\r\n};\r\n\r\nconst _getAWrapper = (\r\n item: SearchSuggestion,\r\n hitPrefix: string,\r\n hitSuffix: string,\r\n actionContext: IActionContext,\r\n props: ISearchProductSuggestProps\r\n) => {\r\n const {\r\n autoSuggestProps: { context }\r\n } = props;\r\n const ariaLabel =\r\n item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n\r\n payLoad.contentAction.recid = item.Id;\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n const productPrice = context.cultureFormatter.formatCurrency(item.Value3!.Value!.DecimalValue!);\r\n\r\n return {\r\n className: 'msc-autoSuggest__productResults-item',\r\n tag: 'a' as NodeTag,\r\n 'aria-label': `${ariaLabel!} ${productPrice}`,\r\n href: _generateLink(item, hitPrefix, hitSuffix, actionContext),\r\n ...attribute\r\n };\r\n};\r\n\r\nconst _generateLink = (suggestion: SearchSuggestion, hitPrefix: string, hitSuffix: string, actionContext: IActionContext) => {\r\n const formattedLink = (suggestion.Value as string)\r\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\r\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n return suggestion.Value && suggestion.Id\r\n ? getProductPageUrlSync(formattedLink, (suggestion.Id as unknown) as number, actionContext, undefined)\r\n : '';\r\n};\r\n\r\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\r\n const formattedText = suggestion\r\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\r\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\r\n\r\n return (\r\n // eslint-disable-next-line react/no-danger\r\n \r\n );\r\n};\r\n\r\nconst _renderPrice = (\r\n adjustedPrice: number,\r\n basePrice: number,\r\n moduleId: string,\r\n moduleType: string,\r\n props: ISearchProductSuggestProps\r\n): JSX.Element | null => {\r\n const {\r\n autoSuggestProps: { context }\r\n } = props;\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst _renderThumbnail = (suggestion: SearchSuggestion, altText: string, props: ISearchProductSuggestProps): JSX.Element | null => {\r\n const {\r\n autoSuggestProps: {\r\n context: {\r\n request: { gridSettings }\r\n },\r\n config: { imageSettings }\r\n }\r\n } = props;\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n\r\n if (!suggestion || !suggestion.ImageUrl) {\r\n //props.telemetry.error('Search suggestion content is empty, module wont render.');\r\n return null;\r\n }\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=40&h=40&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true,\r\n cropFocalRegion: true\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IExtSearch 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 interface IExtSearchConfig extends Msdyn365.IModuleConfig {\r\n suggestionTypeCriterion?: ISuggestionTypeCriterionData[];\r\n topResultsCount?: number;\r\n imageSettings?: Msdyn365.IImageSettings;\r\n hideSearchLabel?: boolean;\r\n disableSubmitSearch?: boolean;\r\n searchplaceholderText?: string;\r\n shouldShowFullCategoryPath?: boolean;\r\n className?: string;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IExtSearchResources {\r\n searchtext: string;\r\n searchLabelArialLabel: string;\r\n cancelBtnAriaLabel: string;\r\n searchBtnAriaLabel: string;\r\n submitBtnAriaLabel: string;\r\n autoSuggestFoundMessage: string;\r\n noAutoSuggestionMessage: string;\r\n productSuggestionHeading: string;\r\n categorySuggestionHeading: string;\r\n autoSuggestResultLoadingMessage: string;\r\n freePriceText: string;\r\n}\r\n\r\nexport const enum SuggestionTypeCriterionSuggestionType {\r\n product = 'product',\r\n keyword = 'keyword',\r\n scopedCategory = 'scopedCategory'\r\n}\r\n\r\nexport interface ISuggestionTypeCriterionData {\r\n SuggestionType?: SuggestionTypeCriterionSuggestionType;\r\n}\r\n\r\nexport interface IExtSearchProps extends Msdyn365.IModule {\r\n resources: IExtSearchResources;\r\n config: IExtSearchConfig;\r\n}\r\n","/*!\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\n/* eslint-disable no-duplicate-imports */\r\nimport { Autosuggestions } from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, { getCatalogId, getUrlSync } from '@msdyn365-commerce/core';\r\nimport { ProductRefiner, ProductRefinerSource, ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n ObjectExtensions,\r\n Random,\r\n validateCatalogId,\r\n QueryResultSettingsProxy\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { createSearchStateInput } from '@msdyn365-commerce-modules/search-utilities';\r\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, KeyCodes } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { debounce } from 'lodash';\r\nimport { Spinner, SpinnerSize } from 'office-ui-fabric-react';\r\nimport * as React from 'react';\r\n\r\nimport getSearchSuggestionsAction, { AutoSuggestInput, SuggestionType } from './actions/get-auto-suggest-suggestions';\r\nimport {\r\n CategorySuggestionsComponent,\r\n FormComponent,\r\n ISearchCategoryViewProps,\r\n ISearchKeywordViewProps,\r\n ISearchProductViewProps,\r\n KeywordSuggestionsComponent,\r\n LabelComponent,\r\n ProductSuggestionsComponent\r\n} from './components';\r\nimport { IExtSearchData } from './ext-search.data';\r\nimport { IExtSearchProps, ISuggestionTypeCriterionData, SuggestionTypeCriterionSuggestionType } from './ext-search.props.autogenerated';\r\nimport { getCommercialName } from '../../shared/functions/get-commercial-name';\r\n\r\nexport interface ISearchState {\r\n isSearchFormExpanded: boolean;\r\n searchText: string;\r\n searchKeywordSuggestClass: string;\r\n searchProductSuggestClass: string;\r\n searchCategorySuggestClass: string;\r\n suggestions: Autosuggestions | undefined;\r\n searchRefiners?: ProductRefiner[] | undefined;\r\n autoSuggestAriaLabel: string;\r\n isInitialState: boolean;\r\n isLoadingAutoSuggest?: boolean;\r\n}\r\n\r\nexport interface ISearchViewProps extends IExtSearchProps {\r\n Search: IModuleProps;\r\n AutoSuggestAriaLabel: INodeProps;\r\n AutoSuggestAriaLabelText: string;\r\n searchText: string;\r\n AutoSuggest: INodeProps;\r\n KeywordSuggest: INodeProps;\r\n ProductSuggest: INodeProps;\r\n CategorySuggest: INodeProps;\r\n SearchForm: INodeProps;\r\n FormWrapper: INodeProps;\r\n UlKeyword: INodeProps;\r\n UlProduct: INodeProps;\r\n UlCategory: INodeProps;\r\n label: React.ReactNode;\r\n form: React.ReactNode;\r\n autosuggestKeyword?: ISearchKeywordViewProps;\r\n autosuggestProduct?: ISearchProductViewProps;\r\n autosuggestCategory?: ISearchCategoryViewProps;\r\n callbacks: {\r\n handleCancelSearchChange(): void;\r\n handleCancelSearchFocused?(): void;\r\n };\r\n isSearchFormExpanded: boolean;\r\n isLoadingAutoSuggest?: boolean;\r\n isLoadingNode?: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * Search module.\r\n * @extends {React.Component, ISearchState>}\r\n */\r\nclass Search extends React.Component, ISearchState> {\r\n private readonly searchTextInput: React.RefObject;\r\n\r\n private readonly searchCollapsedLabel: React.RefObject;\r\n\r\n private readonly formReference: React.RefObject;\r\n\r\n private readonly maxChars: number;\r\n\r\n private readonly topResultsCount?: number;\r\n\r\n private readonly hitPrefix: string = '{';\r\n\r\n private readonly hitSuffix: string = '}';\r\n\r\n private readonly waitTime: number = 500;\r\n\r\n private readonly autoSuggestResultScreenReaderDiv: React.RefObject;\r\n\r\n private readonly autoSuggestResultDiv: React.RefObject;\r\n\r\n private readonly searchFormClass: string;\r\n\r\n private readonly searchLabelClass: string;\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private loadSuggestionsRequestId?: string;\r\n\r\n private inputSuggestionType: ISuggestionTypeCriterionData[];\r\n\r\n // @ts-expect-error\r\n private cancellabelDebounce: debounce;\r\n\r\n public constructor(props: IExtSearchProps) {\r\n super(props);\r\n this.searchTextInput = React.createRef();\r\n this.searchCollapsedLabel = React.createRef();\r\n this.autoSuggestResultScreenReaderDiv = React.createRef();\r\n this.autoSuggestResultDiv = React.createRef();\r\n this.formReference = React.createRef();\r\n this.state = {\r\n isSearchFormExpanded: false,\r\n searchText: '',\r\n searchKeywordSuggestClass: 'ms-search__autoSuggest__keyword',\r\n searchProductSuggestClass: 'ms-search__autoSuggest__product',\r\n searchCategorySuggestClass: 'ms-search__autoSuggest__category',\r\n suggestions: undefined,\r\n searchRefiners: undefined,\r\n autoSuggestAriaLabel: '',\r\n isInitialState: true,\r\n isLoadingAutoSuggest: false\r\n };\r\n this.maxChars =\r\n (this.props.context &&\r\n this.props.context.app &&\r\n this.props.context.app.config &&\r\n this.props.context.app.config.searchInputMaxLength) ||\r\n 50;\r\n\r\n this.inputSuggestionType = [];\r\n this.topResultsCount = this.props.config && this.props.config.topResultsCount ? this.props.config.topResultsCount : 5;\r\n this.searchFormClass = 'ms-search__form';\r\n this.searchLabelClass = 'ms-search__label';\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n\r\n this._initSuggestionTypes();\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n document.body && document.body.addEventListener('mousedown', this._focusOutTarget);\r\n window && window.addEventListener('keyup', this._keyup);\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n document.body && document.body.removeEventListener('mousedown', this._focusOutTarget, false);\r\n window && window.removeEventListener('keyup', this._keyup, false);\r\n }\r\n\r\n public componentDidUpdate(): void {\r\n const {\r\n config: { hideSearchLabel }\r\n } = this.props;\r\n const { isSearchFormExpanded, isInitialState } = this.state;\r\n\r\n if (!this.props.context.request.params.isEditor) {\r\n if (!hideSearchLabel && isSearchFormExpanded) {\r\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\r\n } else if (!isInitialState && !isSearchFormExpanded) {\r\n this.searchCollapsedLabel && this.searchCollapsedLabel.current && this.searchCollapsedLabel.current.focus();\r\n }\r\n }\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IExtSearchProps, nextState: ISearchState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n // eslint-disable-next-line complexity -- ignore complexity.\r\n public render(): JSX.Element {\r\n const {\r\n context,\r\n resources: { searchtext, searchLabelArialLabel, cancelBtnAriaLabel, searchBtnAriaLabel, submitBtnAriaLabel },\r\n config: { hideSearchLabel, disableSubmitSearch, searchplaceholderText, shouldShowFullCategoryPath, className = '' }\r\n } = this.props;\r\n\r\n const {\r\n isSearchFormExpanded,\r\n searchText,\r\n searchKeywordSuggestClass,\r\n searchProductSuggestClass,\r\n searchCategorySuggestClass,\r\n suggestions,\r\n searchRefiners,\r\n isLoadingAutoSuggest\r\n } = this.state;\r\n\r\n const searchQsp = (context && context.app && context.app.config && context.app.config.searchQueryStringParameter) || 'q';\r\n const searchPageURL = getUrlSync('search', context && context.actionContext) || '';\r\n const searchURL = this._appendQueryParams(searchPageURL, searchText, searchQsp);\r\n const searchPlaceholder = searchplaceholderText && searchplaceholderText.length > 0 ? searchplaceholderText : 'Search in Fabrikam';\r\n\r\n const keywordSuggestions = suggestions?.AllSearchResults?.filter(\r\n suggestion => suggestion.SuggestionType === SuggestionType.Keyword || suggestion.SuggestionType === SuggestionType.None\r\n );\r\n const productSuggestions = suggestions?.AllSearchResults?.filter(\r\n suggestion => suggestion.SuggestionType === SuggestionType.Product\r\n );\r\n const categoryRefiners = searchRefiners?.find(refiner => {\r\n return refiner.SourceValue === ProductRefinerSource.Category;\r\n });\r\n const categorySuggestions = suggestions?.AllSearchResults?.filter(suggestion => {\r\n if (suggestion.SuggestionType !== SuggestionType.Category) {\r\n return false;\r\n }\r\n const refiner = categoryRefiners?.Values?.find(item => {\r\n return `${item.RefinerRecordId ?? 0}` === suggestion.Id;\r\n });\r\n\r\n return !ObjectExtensions.isNullOrUndefined(refiner);\r\n });\r\n\r\n const viewProps: ISearchViewProps = {\r\n ...(this.props as IExtSearchProps),\r\n\r\n Search: {\r\n moduleProps: this.props,\r\n className: `${classnames('ms-search', className)} ${disableSubmitSearch ? 'no-submit' : 'with-submit'}`\r\n },\r\n AutoSuggestAriaLabel: {\r\n tag: 'div',\r\n className: 'msc-autoSuggest__screen-reader',\r\n 'aria-live': 'assertive',\r\n ref: this.autoSuggestResultScreenReaderDiv\r\n },\r\n AutoSuggestAriaLabelText: this.state.autoSuggestAriaLabel,\r\n searchText: this.state.searchText,\r\n AutoSuggest: {\r\n ref: this.autoSuggestResultDiv,\r\n className: 'ms-search__autoSuggest'\r\n },\r\n KeywordSuggest: {\r\n className: searchKeywordSuggestClass\r\n },\r\n ProductSuggest: {\r\n className: searchProductSuggestClass\r\n },\r\n CategorySuggest: {\r\n className: searchCategorySuggestClass\r\n },\r\n SearchForm: {\r\n className: `${this.searchFormClass} ${isSearchFormExpanded ? 'bx-show' : 'bx-hide'}`\r\n },\r\n FormWrapper: {\r\n tag: 'form',\r\n ref: this.formReference,\r\n className: 'ms-search__searchForm',\r\n 'aria-label': 'Search',\r\n name: 'searchForm',\r\n role: 'search',\r\n action: searchURL,\r\n autoComplete: 'off',\r\n onSubmit: this._handleSubmit\r\n },\r\n UlKeyword: {\r\n tag: 'ul',\r\n className: classnames('msc-autoSuggest__keywordResults-items', className)\r\n },\r\n UlProduct: {\r\n tag: 'ul',\r\n className: classnames('msc-autoSuggest__productResults-items', className)\r\n },\r\n UlCategory: {\r\n tag: 'ul',\r\n className: classnames('msc-autoSuggest__categoryResults-items', className)\r\n },\r\n label: LabelComponent({\r\n isSearchFormExpanded,\r\n searchLabelClass: `${this.searchLabelClass} ${isSearchFormExpanded ? 'bx-hide' : 'bx-show'}`,\r\n searchtext,\r\n searchLabelArialLabel,\r\n searchCollapsedLabel: this.searchCollapsedLabel,\r\n hideSearchLabel,\r\n handleCancelSearchChange: this._handleCancelSearchChange,\r\n telemetryContent: this.telemetryContent\r\n }),\r\n form: FormComponent({\r\n ariaLabelCancel: cancelBtnAriaLabel,\r\n ariaLabelSearch: searchBtnAriaLabel,\r\n ariaLabelSubmit: submitBtnAriaLabel,\r\n hideSearchLabel,\r\n searchTextInput: this.searchTextInput,\r\n disableSubmitSearch,\r\n handleInputChange: this._handleInputChange,\r\n handleCancelSearchChange: this._handleCancelSearchChange,\r\n maxChars: this.maxChars,\r\n searchQsp,\r\n searchPlaceholder,\r\n query: searchText\r\n }),\r\n autosuggestKeyword:\r\n searchText &&\r\n searchText.length > 0 &&\r\n (isLoadingAutoSuggest || (keywordSuggestions && ArrayExtensions.hasElements(keywordSuggestions)))\r\n ? KeywordSuggestionsComponent({\r\n searchKeywordSuggestClass,\r\n searchPageURL,\r\n searchQsp,\r\n hitPrefix: this.hitPrefix,\r\n hitSuffix: this.hitSuffix,\r\n autoSuggestProps: this.props,\r\n searchText,\r\n suggestions: keywordSuggestions,\r\n telemetryContent: this.telemetryContent\r\n })\r\n : undefined,\r\n autosuggestProduct:\r\n searchText &&\r\n searchText.length > 0 &&\r\n (isLoadingAutoSuggest || (productSuggestions && ArrayExtensions.hasElements(productSuggestions)))\r\n ? ProductSuggestionsComponent({\r\n searchProductSuggestClass,\r\n searchPageURL,\r\n searchQsp,\r\n hitPrefix: this.hitPrefix,\r\n hitSuffix: this.hitSuffix,\r\n autoSuggestProps: this.props,\r\n searchText,\r\n suggestions: productSuggestions,\r\n telemetry: this.props.telemetry,\r\n moduleType: this.props.typeName,\r\n moduleId: this.props.id,\r\n telemetryContent: this.telemetryContent,\r\n resources: this.props.resources\r\n })\r\n : undefined,\r\n autosuggestCategory:\r\n searchText &&\r\n searchText.length > 0 &&\r\n (isLoadingAutoSuggest || (categorySuggestions && ArrayExtensions.hasElements(categorySuggestions)))\r\n ? CategorySuggestionsComponent({\r\n searchCategorySuggestClass,\r\n searchPageURL,\r\n searchQsp,\r\n hitPrefix: this.hitPrefix,\r\n hitSuffix: this.hitSuffix,\r\n autoSuggestProps: this.props,\r\n searchText,\r\n suggestions: categorySuggestions,\r\n searchRefiners,\r\n telemetryContent: this.telemetryContent,\r\n shouldShowFullPath: shouldShowFullCategoryPath\r\n })\r\n : undefined,\r\n callbacks: {\r\n handleCancelSearchChange: this._handleCancelSearchChange,\r\n handleCancelSearchFocused: this._handleCancelSearchFocused\r\n },\r\n isSearchFormExpanded: this.state.isSearchFormExpanded,\r\n isLoadingAutoSuggest,\r\n isLoadingNode: this._isLoadingNode()\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _initSuggestionTypes() {\r\n const suggestionTypes = this.props.config.suggestionTypeCriterion;\r\n\r\n const suggestions = ArrayExtensions.unique(ArrayExtensions.validValues(suggestionTypes));\r\n if (!ArrayExtensions.hasElements(suggestions)) {\r\n this.inputSuggestionType = [\r\n { SuggestionType: SuggestionTypeCriterionSuggestionType.keyword },\r\n { SuggestionType: SuggestionTypeCriterionSuggestionType.product },\r\n { SuggestionType: SuggestionTypeCriterionSuggestionType.scopedCategory }\r\n ];\r\n return;\r\n }\r\n\r\n const validSuggestions = suggestions.filter(suggestion => suggestion.SuggestionType);\r\n if (ArrayExtensions.hasElements(validSuggestions)) {\r\n this.inputSuggestionType = validSuggestions;\r\n return;\r\n }\r\n\r\n this.inputSuggestionType = [];\r\n }\r\n\r\n /**\r\n * Function to create the ReactNode for loading Autosuggest result.\r\n * @returns ReachNode for loading Autosuggest result.\r\n */\r\n private readonly _isLoadingNode = (): React.ReactNode => {\r\n const loadingText = this.props.resources.autoSuggestResultLoadingMessage;\r\n return ;\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n private readonly _focusOutTarget = (e: any): void => {\r\n const { suggestions } = this.state;\r\n\r\n if (suggestions && suggestions.AllSearchResults && e.target.closest('.ms-search') === null) {\r\n this._clearAutoSuggestState();\r\n }\r\n };\r\n\r\n private readonly _keyup = (e: KeyboardEvent): void => {\r\n const { suggestions } = this.state;\r\n\r\n if (suggestions && suggestions.AllSearchResults && e.keyCode === KeyCodes.Escape) {\r\n this._clearAutoSuggestState();\r\n } else if (this.state.isSearchFormExpanded && e.keyCode === KeyCodes.Escape) {\r\n if (this.state.isSearchFormExpanded) {\r\n this.setState({ isSearchFormExpanded: false });\r\n }\r\n }\r\n\r\n if (\r\n !(\r\n (this.formReference.current && this.formReference.current.contains((e.target as unknown) as Node)) ||\r\n (this.autoSuggestResultDiv.current && this.autoSuggestResultDiv.current.contains((e.target as unknown) as Node))\r\n )\r\n ) {\r\n if (suggestions && suggestions.AllSearchResults) {\r\n this._clearAutoSuggestState();\r\n }\r\n\r\n if (this.state.isSearchFormExpanded) {\r\n this.setState({ isSearchFormExpanded: false });\r\n }\r\n }\r\n };\r\n\r\n private readonly _clearAutoSuggestState = (): void => {\r\n const {\r\n context: { actionContext },\r\n data: { searchState }\r\n } = this.props;\r\n\r\n if (this.searchTextInput.current && this.searchTextInput.current.value.length > 0) {\r\n searchState.searchText = '';\r\n searchState.defaultBasicSearchUrl = '';\r\n searchState.searchQueryStringParameter = '';\r\n actionContext ? actionContext.update(createSearchStateInput(searchState), searchState) : null;\r\n this.searchTextInput.current.value = '';\r\n }\r\n\r\n this.setState({ searchText: '', suggestions: undefined, searchRefiners: undefined });\r\n };\r\n\r\n private async _getSearchSuggestions(loadSuggestionsRequestId: string, query: string) {\r\n try {\r\n const searchSuggestions = await getSearchSuggestionsAction(\r\n new AutoSuggestInput(query, this.topResultsCount, this._getSuggestionType(), this.hitPrefix, this.hitSuffix),\r\n this.props.context.actionContext\r\n );\r\n if (searchSuggestions.AllSearchResults && this.props.app.config?.useCommercialStyleName) {\r\n for (var searchSuggestion of searchSuggestions.AllSearchResults) {\r\n if (searchSuggestion.SuggestionType === 'Product') {\r\n var attributes = await ProductsDataActions.getAttributeValuesAsync(\r\n {\r\n callerContext: this.props.context.actionContext,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(\r\n this.props.context.actionContext\r\n )\r\n },\r\n Number(searchSuggestion.Id),\r\n this.props.context.actionContext.requestContext.apiSettings.channelId,\r\n this.props.context.actionContext.requestContext.apiSettings.catalogId ?? 0\r\n );\r\n searchSuggestion.Value = getCommercialName(\r\n attributes,\r\n searchSuggestion.Value,\r\n this.props.app.config?.commercialStyleNameAttribute\r\n );\r\n }\r\n }\r\n }\r\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\r\n return undefined;\r\n }\r\n return searchSuggestions;\r\n } catch (error) {\r\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\r\n return undefined;\r\n }\r\n this.setState({ suggestions: undefined, searchRefiners: undefined, autoSuggestAriaLabel: this._setAutoSuggestResultCount() });\r\n this.props.telemetry.exception(error);\r\n this.props.telemetry.debug('Unable to get auto suggest results');\r\n return undefined;\r\n }\r\n }\r\n\r\n private async _updateSearchRefiners(loadSuggestionsRequestId: string, query: string, suggestions: Autosuggestions | undefined) {\r\n try {\r\n const refiners = await this._getSearchRefiners(query);\r\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\r\n return;\r\n }\r\n this.setState({\r\n suggestions,\r\n searchRefiners: refiners,\r\n autoSuggestAriaLabel: this._setAutoSuggestResultCount(suggestions),\r\n isLoadingAutoSuggest: false\r\n });\r\n } catch (error) {\r\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\r\n return;\r\n }\r\n this.setState({ suggestions, searchRefiners: undefined, autoSuggestAriaLabel: this._setAutoSuggestResultCount(suggestions) });\r\n this.props.telemetry.exception(error);\r\n this.props.telemetry.debug('Unable to get refiners results');\r\n }\r\n }\r\n\r\n private _loadSuggestions(query: string) {\r\n this.cancellabelDebounce = debounce(async () => {\r\n this.setState({ isLoadingAutoSuggest: true });\r\n const loadSuggestionsRequestId = Random.Guid.generateGuid();\r\n this.loadSuggestionsRequestId = loadSuggestionsRequestId;\r\n const searchSuggestions = await this._getSearchSuggestions(loadSuggestionsRequestId, query);\r\n await this._updateSearchRefiners(loadSuggestionsRequestId, query, searchSuggestions);\r\n }, this.waitTime);\r\n\r\n setTimeout(() => {\r\n this.cancellabelDebounce();\r\n }, 0);\r\n }\r\n\r\n private readonly _handleInputChange = (query: string): void => {\r\n if (!query || query.length <= this.maxChars) {\r\n this.setState({ searchText: query });\r\n }\r\n\r\n if (this.cancellabelDebounce) {\r\n this.cancellabelDebounce.cancel();\r\n }\r\n\r\n const {\r\n context,\r\n data: { searchState }\r\n } = this.props;\r\n\r\n if (context) {\r\n if (query && query.length > 0) {\r\n if (query.length > this.maxChars) {\r\n return;\r\n }\r\n\r\n if (ArrayExtensions.hasElements(this.inputSuggestionType)) {\r\n this._loadSuggestions(query);\r\n }\r\n\r\n searchState.searchText = query;\r\n } else {\r\n this.setState({ suggestions: undefined, searchRefiners: undefined });\r\n searchState.searchText = '';\r\n }\r\n context.actionContext.update(createSearchStateInput(searchState), searchState);\r\n }\r\n };\r\n\r\n private _getSuggestionType(): string {\r\n const distinctSuggestionTypes: string[] = this.inputSuggestionType.map(\r\n suggestionTypeItem => suggestionTypeItem.SuggestionType!.charAt(0).toUpperCase() + suggestionTypeItem.SuggestionType!.slice(1)\r\n );\r\n return distinctSuggestionTypes.join(',');\r\n }\r\n\r\n private async _getSearchRefiners(searchText: string): Promise {\r\n const { actionContext: ctx } = this.props.context;\r\n const catalogId = getCatalogId(ctx.requestContext);\r\n validateCatalogId(catalogId);\r\n return ProductsDataActions.getProductSearchRefinersAsync(\r\n { callerContext: ctx },\r\n {\r\n SearchCondition: searchText,\r\n Context: {\r\n ChannelId: +ctx.requestContext.apiSettings.channelId,\r\n CatalogId: catalogId\r\n }\r\n }\r\n );\r\n }\r\n\r\n private readonly _handleSubmit = (\r\n e: React.MouseEvent | React.KeyboardEvent | React.FormEvent\r\n ): void => {\r\n const {\r\n config: { disableSubmitSearch },\r\n context: {\r\n actionContext,\r\n app: {\r\n config: { searchQueryStringParameter }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const query = this.searchTextInput.current && this.searchTextInput.current.value;\r\n e.preventDefault();\r\n\r\n if (!query || (query && query.length === 0) || disableSubmitSearch) {\r\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\r\n } else {\r\n const searchQsp = searchQueryStringParameter || 'q';\r\n const searchURL = this._appendQueryParams(getUrlSync('search', actionContext) || '', query, searchQsp);\r\n document.location.href = searchURL;\r\n }\r\n };\r\n\r\n private readonly _handleCancelSearchChange = (): void => {\r\n const { isSearchFormExpanded, suggestions } = this.state;\r\n\r\n if (!isSearchFormExpanded) {\r\n this.setState({\r\n isSearchFormExpanded: true,\r\n searchText: '',\r\n isInitialState: false\r\n });\r\n } else {\r\n if (suggestions && suggestions.AllSearchResults) {\r\n this._clearAutoSuggestState();\r\n }\r\n this.setState({ isSearchFormExpanded: false });\r\n }\r\n };\r\n\r\n private readonly _handleCancelSearchFocused = (): void => {\r\n const { suggestions } = this.state;\r\n if (!(suggestions && suggestions.AllSearchResults)) {\r\n this._clearAutoSuggestState();\r\n this.setState({ isSearchFormExpanded: false });\r\n }\r\n };\r\n\r\n private readonly _appendQueryParams = (route: string, query: string, qsp: string): string => {\r\n if (!MsDyn365.isBrowser) {\r\n return '';\r\n }\r\n\r\n const queryUrl = new URL(route, window.location.href);\r\n if (qsp && query) {\r\n queryUrl.searchParams.set(qsp, query);\r\n }\r\n\r\n return queryUrl.href;\r\n };\r\n\r\n private readonly _setAutoSuggestResultCount = (result?: Autosuggestions) => {\r\n if (this.autoSuggestResultScreenReaderDiv.current !== null) {\r\n const ariaLiveRegion = this.autoSuggestResultScreenReaderDiv.current;\r\n const suggestResultString = this.props.resources.autoSuggestFoundMessage;\r\n const emptyResultString = this.props.resources.noAutoSuggestionMessage;\r\n ariaLiveRegion.innerText =\r\n result && result.AllSearchResults && result.AllSearchResults.length > 0 ? suggestResultString : emptyResultString;\r\n ariaLiveRegion.setAttribute('aria-live', 'assertive');\r\n return ariaLiveRegion.innerText;\r\n }\r\n return '';\r\n };\r\n}\r\n\r\nexport default Search;\r\n","/*!\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\n/* eslint-disable no-duplicate-imports */\r\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ISearchCategoryViewProps, ISearchFormViewProps, ISearchKeywordViewProps, ISearchProductViewProps } from './components';\r\nimport { ISearchViewProps } from './ext-search';\r\n\r\nconst SearchView: React.FC = props => {\r\n const {\r\n Search,\r\n AutoSuggestAriaLabel,\r\n AutoSuggestAriaLabelText,\r\n searchText,\r\n AutoSuggest,\r\n KeywordSuggest,\r\n ProductSuggest,\r\n CategorySuggest,\r\n UlKeyword,\r\n UlProduct,\r\n UlCategory,\r\n form,\r\n autosuggestCategory,\r\n autosuggestKeyword,\r\n autosuggestProduct,\r\n SearchForm,\r\n FormWrapper,\r\n label,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n } = props;\r\n\r\n return (\r\n \r\n {label}\r\n {_renderForm(form as ISearchFormViewProps, SearchForm, FormWrapper)}\r\n \r\n {searchText && searchText.length > 0 ? {AutoSuggestAriaLabelText} : ''}\r\n {_renderKeywordSuggestions(KeywordSuggest, UlKeyword, autosuggestKeyword, isLoadingAutoSuggest, isLoadingNode)}\r\n {_renderProductSuggestions(ProductSuggest, UlProduct, autosuggestProduct, isLoadingAutoSuggest, isLoadingNode)}\r\n {_renderCategorySuggestions(CategorySuggest, UlCategory, autosuggestCategory, isLoadingAutoSuggest, isLoadingNode)}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderForm = (form: ISearchFormViewProps, SearchForm: INodeProps, FormWrapper: INodeProps) => {\r\n return (\r\n \r\n \r\n {form.input}\r\n {form.cancelBtn}\r\n {form.submitBtn}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderKeywordSuggestions = (\r\n KeywordSuggest: INodeProps,\r\n UlKeyword: INodeProps,\r\n keywordSuggestions?: ISearchKeywordViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n) => {\r\n return (\r\n keywordSuggestions && (\r\n \r\n \r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n keywordSuggestions.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nconst _renderProductSuggestions = (\r\n ProductSuggest: INodeProps,\r\n UlProduct: INodeProps,\r\n productSuggestions?: ISearchProductViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n) => {\r\n return (\r\n productSuggestions && (\r\n \r\n \r\n {productSuggestions.title}\r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n productSuggestions.items.map((item, index) => {\r\n return (\r\n \r\n \r\n {item.thumbnail}\r\n {item.text}\r\n {item.price}\r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nconst _renderCategorySuggestions = (\r\n CategorySuggest: INodeProps,\r\n UlCategory: INodeProps,\r\n categorySuggestions?: ISearchCategoryViewProps,\r\n isLoadingAutoSuggest?: boolean,\r\n isLoadingNode?: React.ReactNode\r\n) => {\r\n return (\r\n categorySuggestions && (\r\n \r\n \r\n {categorySuggestions.title}\r\n {isLoadingAutoSuggest && isLoadingNode}\r\n {!isLoadingAutoSuggest &&\r\n categorySuggestions.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nexport default SearchView;\r\n","/*!\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 { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ISearchData, ISearchFormViewProps, ISearchViewProps } from '@msdyn365-commerce-modules/search';\r\nimport { Button, format, isMobile, Module, Node, VariantType } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useCallback, useEffect, useState } from 'react';\r\n\r\nimport { ISearchProps } from '../definition-extensions/search.ext.props.autogenerated';\r\nimport { CategorySuggestionsComponent } from './components/search.categorysuggest';\r\nimport { FormComponent } from './components/search.form';\r\nimport { KeywordSuggestionsComponent } from './components/search.keywordsuggest';\r\nimport { ProductSuggestionsComponent } from './components/search.productsuggest';\r\n\r\n/**\r\n * Render Title for AutoSuggest.\r\n * @param searchSuggestionHeading -The heading resource string.\r\n * @param searchText -The search string.\r\n * @returns -The JSX Element.\r\n */\r\nconst renderTitle = (searchSuggestionHeading: string, searchText: string): JSX.Element => {\r\n const searchTextString = '\"'.concat(searchText.concat('\"'));\r\n const searchAutoSuggestionHeading = format(searchSuggestionHeading, searchTextString);\r\n \r\n return {searchAutoSuggestionHeading};\r\n};\r\n\r\n/**\r\n * Search View.\r\n * @param props - The view props.\r\n * @returns The JSX Element.\r\n */\r\nconst SearchView: React.FC> = (\r\n props: ISearchViewProps & ISearchProps\r\n): JSX.Element => {\r\n const {\r\n Search,\r\n AutoSuggestAriaLabel,\r\n AutoSuggestAriaLabelText,\r\n searchText,\r\n AutoSuggest,\r\n KeywordSuggest,\r\n ProductSuggest,\r\n UlKeyword,\r\n UlProduct,\r\n form,\r\n autosuggestKeyword,\r\n autosuggestProduct,\r\n SearchForm,\r\n FormWrapper,\r\n label,\r\n context,\r\n isLoadingAutoSuggest,\r\n isLoadingNode,\r\n callbacks: { handleCancelSearchFocused }\r\n } = props;\r\n\r\n const { searchSuggestionHeading, categorySuggestionHeading, keywordsHeading, noResultText, clearSearchButtonText } = props.resources;\r\n\r\n const [searchTextString, setSearchTextString] = useState();\r\n const [isMobilePort, setIsMobile] = useState(false);\r\n\r\n useEffect(() => {\r\n setSearchTextString(searchText);\r\n }, [searchText]);\r\n\r\n /**\r\n * ClearSearch callback method to clear search string.\r\n */\r\n const clearSearch = (): void => {\r\n setSearchTextString('');\r\n\r\n const propsForm = props.form as ISearchFormViewProps;\r\n const propsFormInput = propsForm.input as React.DetailedHTMLProps, HTMLInputElement>;\r\n const propsFormInputCurrent = (propsFormInput.ref as React.RefObject).current;\r\n\r\n if (propsFormInputCurrent) {\r\n propsFormInputCurrent.value = '';\r\n }\r\n\r\n propsFormInput.value = '';\r\n props.searchText = '';\r\n props.FormWrapper.action = '';\r\n };\r\n\r\n const isMobileViewport = useCallback(() => {\r\n const isMobileView = isMobile({ variant: VariantType.Browser, context: context.request }) === 'xs';\r\n setIsMobile(isMobileView);\r\n }, [context]);\r\n\r\n useEffect(() => {\r\n window.addEventListener('resize', isMobileViewport);\r\n isMobileViewport();\r\n }, [isMobileViewport]);\r\n\r\n const viewport = isMobile({ variant: VariantType.Browser, context: context.request });\r\n\r\n const isMobileView = viewport === 'sm' || viewport === 'xs';\r\n\r\n AutoSuggest.className = !StringExtensions.isNullOrEmpty(searchTextString)\r\n ? `${AutoSuggest.className} show`\r\n : `${AutoSuggest.className} hide`;\r\n const isSearchText: boolean = !StringExtensions.isNullOrEmpty(searchTextString);\r\n\r\n return (\r\n \r\n {label}\r\n {FormComponent(\r\n form as ISearchFormViewProps,\r\n SearchForm,\r\n FormWrapper,\r\n isMobilePort,\r\n clearSearchButtonText,\r\n props,\r\n isSearchText,\r\n clearSearch\r\n )}\r\n {!isMobileView && (\r\n \r\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\r\n {AutoSuggestAriaLabelText}\r\n ) : (\r\n ''\r\n )}\r\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\r\n <>\r\n \r\n \r\n {renderTitle(searchSuggestionHeading, searchText)}\r\n \r\n \r\n \r\n {CategorySuggestionsComponent(\r\n categorySuggestionHeading,\r\n noResultText,\r\n props,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n {KeywordSuggestionsComponent(\r\n KeywordSuggest,\r\n UlKeyword,\r\n keywordsHeading,\r\n noResultText,\r\n autosuggestKeyword,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n \r\n {ProductSuggestionsComponent(\r\n ProductSuggest,\r\n UlProduct,\r\n props,\r\n autosuggestProduct,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n \r\n \r\n ) : null}\r\n \r\n )}\r\n {isMobileView && props.isSearchFormExpanded && (\r\n \r\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\r\n {AutoSuggestAriaLabelText}\r\n ) : (\r\n ''\r\n )}\r\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\r\n <>\r\n \r\n {(form as ISearchFormViewProps).cancelBtn}\r\n {renderTitle(searchSuggestionHeading, searchText)}\r\n \r\n \r\n \r\n {CategorySuggestionsComponent(\r\n categorySuggestionHeading,\r\n noResultText,\r\n props,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n {KeywordSuggestionsComponent(\r\n KeywordSuggest,\r\n UlKeyword,\r\n keywordsHeading,\r\n noResultText,\r\n autosuggestKeyword,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n \r\n {ProductSuggestionsComponent(\r\n ProductSuggest,\r\n UlProduct,\r\n props,\r\n autosuggestProduct,\r\n isLoadingAutoSuggest,\r\n isLoadingNode\r\n )}\r\n \r\n \r\n ) : null}\r\n \r\n )}\r\n \r\n );\r\n};\r\nexport default SearchView;\r\n"],"names":["module","exports","React","ReactDOM","getCommercialName","_productName$split$","attributes","arguments","length","undefined","productName","commercialStyleNameAttribute","styleName","find","x","Name","productBrand","split","TextValue","SearchState","__decorate","observable","createSearchStateInput","result","GenericInput","getGenericActionDataAction","createObservableDataAction","action","getGenericAction","input","inputData","searchText","renderCategorySuggestionsTitle","inCategoriesHeading","categoryAutoSuggestionHeading","className","CategorySuggestionsComponent","noResultText","props","isLoadingAutoSuggest","isLoadingNode","autosuggestCategory","Node","Object","assign","CategorySuggest","UlCategory","text","map","MobileAutoSuggestEmptyComponent","noSearchResultImage","config","src","Image","altText","gridSettings","context","request","requestContext","imageSettings","lazyload","viewports","xs","w","h","q","renderProductNotFoundResultsImage","resources","emptyMobileSearchTextHeading","emptyMobileSearchText","FormComponent","form","searchForm","formWrapper","isMobile","clearSearchButtonText","isSearchText","clearSearch","cancelButtonNode","Button","cancelBtnAriaLabel","onClick","type","cancelBtn","renderClearButton","title","submitBtn","renderKeywordSuggestionsTitle","keywordsHeading","KeywordSuggestionsComponent","keywordSuggest","ulKeyword","keywordSuggestions","renderProductSuggestionsTitle","productSuggestionsHeading","productAutoSuggestionHeading","renderProductNotFoundResults","noResultContentHeadingText","noResultContentParagraphText","ProductSuggestionsComponent","productSuggest","ulProduct","productSuggestions","productSuggestionHeading","items","item","index","_item$id","LiProduct","key","id","AProduct","thumbnail","price","tag","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","window","__bindings__","_objectSpread","viewDictionary","cn","SuggestionType","ProductListInventoryFilteringOptions","AutoSuggestInput","constructor","top","suggestionType","hitPrefix","hitSuffix","getCacheKey","getCacheObjectType","dataCacheType","this","searchQuery","topResultsCount","async","_getAutoSuggest","autosuggest","ctx","_ctx$requestContext$a","catalogId","getCatalogId","productSearchCriteria","SearchCondition","Context","ChannelId","apiSettings","channelId","CatalogId","app","productListInventoryDisplay","HideOOS","inventoryRefinerValue","getInventorySortableRefinerValue","channelInventoryConfiguration","isInStock","ProductAvailabilitySortableAttributeRecordId","RefinerRecordId","DataTypeValue","AttributeDataType","TrueFalse","LeftValueBoundString","RightValueBoundString","UnitText","RowNumber","Count","ExtensionProperties","RefinerSourceValue","ProductRefinerSource","Attribute","getInventoryConfigurationAsync","callerContext","Refinement","searchCriteria","ProductSearchCriteria","HitPrefix","HitSuffix","searchSuggestions","getSearchSuggestionsAsync","queryResultSettings","Paging","Top","ImageUrl","generateImageUrl","AllSearchResults","telemetry","error","autoSuggestPromises","Promise","all","then","payLoad","suggestions","autoSuggestProps","categorySuggestionHeading","reactNodes","getPayloadObject","telemetryContent","push","_assembleNode","_renderTitle","format","shouldShowFullPath","splitValue","Value","pop","ariaLabel","replace","RegExp","contentAction","etext","attribute","getTelemetryAttributes","Id","href","_generateLink","_getHighlightedText","suggestion","_getCategoryLink","_categoryRefiners$Val","searchPageURL","searchQsp","searchRefiners","MsDyn365","isBrowser","queryUrl","URL","location","searchParams","set","categoryRefiners","refiners","SourceValue","Category","refiner","Values","Number","parseInt","encodedRefiner","JSON","stringify","compressRefiners","formattedText","dangerouslySetInnerHTML","getRichTextHtml","compressedRefinerKeys","compressedRefiners","forEach","compressedRefiner","refinerKey","searchPlaceholder","hideSearchLabel","searchTextInput","handleInputChange","maxChars","disableSubmitSearch","handleCancelSearchChange","query","ariaLabelCancel","ariaLabelSearch","ariaLabelSubmit","onInputChange","event","target","value","onInputChangeFunction","inputNode","placeholder","ref","onChange","maxLength","submitBtnNode","formattedLink","LabelComponent","searchLabelClass","searchLabelArialLabel","isSearchFormExpanded","searchtext","searchCollapsedLabel","innerRef","actionContext","moduleType","moduleId","_item$Value","Value3","DecimalValue","_renderThumbnail","ObjectExtensions","isNullOrUndefined","_renderPrice","_getLiWrapper","_getAWrapper","recid","cultureFormatter","formatCurrency","getProductPageUrlSync","adjustedPrice","basePrice","_props$resources","PriceComponent","typeName","data","CustomerContextualPrice","BasePrice","freePriceText","cropFocalRegion","lg","xl","loadFailureBehavior","SuggestionTypeCriterionSuggestionType","Search","super","waitTime","_isLoadingNode","loadingText","autoSuggestResultLoadingMessage","Spinner","label","size","SpinnerSize","medium","labelPosition","_focusOutTarget","e","state","closest","_clearAutoSuggestState","_keyup","keyCode","KeyCodes","Escape","setState","formReference","current","contains","autoSuggestResultDiv","searchState","defaultBasicSearchUrl","searchQueryStringParameter","update","_handleInputChange","cancellabelDebounce","cancel","ArrayExtensions","hasElements","inputSuggestionType","_loadSuggestions","_handleSubmit","preventDefault","focus","searchURL","_appendQueryParams","getUrlSync","document","_handleCancelSearchChange","isInitialState","_handleCancelSearchFocused","route","qsp","_setAutoSuggestResultCount","autoSuggestResultScreenReaderDiv","ariaLiveRegion","suggestResultString","autoSuggestFoundMessage","emptyResultString","noAutoSuggestionMessage","innerText","setAttribute","searchKeywordSuggestClass","searchProductSuggestClass","searchCategorySuggestClass","autoSuggestAriaLabel","searchInputMaxLength","searchFormClass","getTelemetryObject","telemetryPageName","friendlyName","_initSuggestionTypes","body","addEventListener","componentWillUnmount","removeEventListener","componentDidUpdate","params","isEditor","shouldComponentUpdate","nextProps","nextState","render","_suggestions$AllSearc","_suggestions$AllSearc2","_suggestions$AllSearc3","searchBtnAriaLabel","submitBtnAriaLabel","searchplaceholderText","shouldShowFullCategoryPath","filter","Keyword","None","Product","categorySuggestions","_item$RefinerRecordId","viewProps","moduleProps","classnames","AutoSuggestAriaLabel","AutoSuggestAriaLabelText","AutoSuggest","KeywordSuggest","ProductSuggest","SearchForm","FormWrapper","role","autoComplete","onSubmit","UlKeyword","UlProduct","autosuggestKeyword","autosuggestProduct","callbacks","handleCancelSearchFocused","renderView","suggestionTypes","suggestionTypeCriterion","unique","validValues","keyword","product","scopedCategory","validSuggestions","loadSuggestionsRequestId","_this$props$app$confi","getSearchSuggestionsAction","_getSuggestionType","useCommercialStyleName","searchSuggestion","_this$props$context$a","_this$props$app$confi2","ProductsDataActions","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","exception","debug","_getSearchRefiners","_debounce","Random","Guid","generateGuid","_getSearchSuggestions","_updateSearchRefiners","setTimeout","suggestionTypeItem","charAt","toUpperCase","slice","join","validateCatalogId","_renderForm","_renderKeywordSuggestions","_renderProductSuggestions","_renderCategorySuggestions","Module","renderTitle","searchSuggestionHeading","searchTextString","concat","searchAutoSuggestionHeading","setSearchTextString","useState","isMobilePort","setIsMobile","useEffect","propsFormInput","propsFormInputCurrent","isMobileViewport","useCallback","isMobileView","variant","VariantType","Browser","viewport","StringExtensions","isNullOrEmpty","onBlur"],"sourceRoot":""}