{"version":3,"sources":["webpack:///./ClientApp/services/Localizer.tsx","webpack:///./ClientApp/features/search/RocHawkConfig.ts","webpack:///./ClientApp/shared/components/hawksearch/util/SearchTracking.ts","webpack:///./ClientApp/shared/components/hawksearch/store/HawkState.ts","webpack:///./ClientApp/shared/components/hawksearch/util/MergableState.ts","webpack:///./ClientApp/features/tracking/trackers/commerce/hawksearch/tracking-commerce.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Autocomplete/Request.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Autocomplete/Category.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Autocomplete/Product.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Autocomplete/Content.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Autocomplete/Popular.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Autocomplete/Response.ts","webpack:///./ClientApp/shared/polyfills/customEvent.js","webpack:///./ClientApp/shared/components/hawksearch/models/Search/Pagination.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/Result.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/Sorting.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/Selections.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Facets/Value.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Facets/Swatch.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Facets/Range.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Facets/Facet.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/Rule.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/Trigger.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/Merchandising.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/PageContent.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/Response.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/ClientData.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Search/ContentType.ts","webpack:///./ClientApp/shared/components/svg/MagnifyingGlassSVG.tsx","webpack:///./ClientApp/util/StringUtil.ts","webpack:///./ClientApp/shared/components/hawksearch/net/HawkClient.ts","webpack:///./ClientApp/shared/components/hawksearch/components/hcl/util.ts","webpack:///./ClientApp/services/ServerData.ts","webpack:///./ClientApp/shared/components/svg/QuestionMarkCircleSVG.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/svg/CheckmarkSVG.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/svg/PlusCircleSVG.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/FacetTypes/Checkbox.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/FacetTypes/Search.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/FacetTypes/Link.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/SliderNumericInputs.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/FacetTypes/Slider.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/FacetTypes/SwatchItem.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/FacetTypes/Swatch.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/FacetTypes/NestedItem.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/FacetTypes/Nested.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/FacetTypes/OpenRange.tsx","webpack:///./ClientApp/shared/components/hawksearch/models/Facets/FacetType.ts","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/Overrides.ts","webpack:///./ClientApp/shared/components/hawksearch/components/ui/SearchBox/SearchSuggestionsList.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/SearchBox/SearchSuggestions.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/SearchBox/SearchBoxBase.tsx","webpack:///./ClientApp/shared/components/Spinner.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/SearchBox/GlobalSearchBox.tsx","webpack:///./ClientApp/services/AxiosHelper.ts","webpack:///./ClientApp/shared/components/hawksearch/styles/app.scss?a7f7","webpack:///./ClientApp/styles/node-modules/@reach/tooltip/styles.css?c65c","webpack:///./ClientApp/styles/node-modules/@reach/tooltip/styles.css","webpack:///./ClientApp/shared/edit/InlineAlert.tsx","webpack:///./ClientApp/shared/hooks/useRocEventHandler.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/StoreProvider.tsx","webpack:///./ClientApp/shared/components/svg/XSVG.tsx","webpack:///./ClientApp/services/UserData.ts","webpack:///./ClientApp/shared/util/ErrorBoundary.tsx","webpack:///./ClientApp/shared/util/AccountUrls.ts","webpack:///./ClientApp/features/tracking/trackers/hawksearch/tracking.ts","webpack:///./ClientApp/shared/components/hawksearch/store/Store.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Autocomplete/Suggestion.ts","webpack:///./ClientApp/shared/polyfills/getAttributeNames.js","webpack:///./ClientApp/shared/util/ApplicationInit.tsx","webpack:///./ClientApp/shared/components/hawksearch/util/Constants.ts","webpack:///./ClientApp/shared/components/hawksearch/helpers/Cookies.ts","webpack:///./ClientApp/shared/hooks/useDelayedDisplay.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/svg/PlusThinSVG.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/svg/MinusThinSVG.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/Facets/Facet.tsx","webpack:///./ClientApp/shared/util/events/rocEventUtils.ts","webpack:///./ClientApp/shared/components/hawksearch/components/ConfigProvider.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/svg/DashCircleSVG.tsx","webpack:///./ClientApp/features/search/Search.tsx"],"names":["LocalizerResources","isAlreadyLogged","initializeLocalizerResources","windowWithResources","window","__ROC_LOCALIZER_RESOURCES__","Array","isArray","forEach","obj","Object","keys","key","Localizer","replaceStrings","length","console","warn","resource","replace","match","index","LocalizedSpan","props","resourceKey","args","localizedString","data-testid","toKebabCase","dangerouslySetInnerHTML","__html","searchState","__ROC_SEARCH_STATE__","RocHawkConfig","apiUrl","searchEndpoint","clientGuid","trackingKey","searchPageUrl","dashboardUrl","Constants","searchBoxPlaceholder","trackingUrl","recommendationUrl","recommendationEndpoint","enableRemovingDashesFromSearchKeyword","setSearchTracking","request","response","isLandingPage","CustomUrl","searchType","FacetSelections","MaxPerPage","PageNo","SearchType","Refinement","Initial","dispatchRocEvent","trackingId","TrackingId","CompareValueType","useHawkState","initialSearch","initialValue","typeConstructor","state","setState","config","useHawkConfig","client","HawkClient","pendingSearch","Keyword","SearchStore","isLoading","itemsToCompare","comparedResults","itemsToCompareIds","useState","value","prevState","newState","store","setStore","cancellationToken","getComparedItems","search","searchResults","searchParams","IsInPreview","isInPreview","ClientGuid","indexName","IndexName","validateQueryAndRemoveDash","axios","isCancel","error","requestError","Success","Response","setSearch","doHistory","undefined","setSearchSelections","selections","searchWithin","SearchWithin","useEffect","cts","CancelToken","source","token","cancel","actor","toggleFacetValue","facet","facetValue","negate","facetName","Name","facetField","selectionField","valueValue","Value","valueLabel","Label","facetSelections","isFacetSelected","selState","selectionIndex","FacetSelectionState","Selected","Negated","splice","push","setFacetValues","facetValues","clearFacet","clearFacetValue","NotSelected","clearAllFacets","setItemsToCompare","resultItem","isCheck","itemsArray","filter","item","DocId","map","setComparedResults","data","clearItemsToCompare","getCompareFieldValue","compareItem","fieldName","compareType","field","Document","find","Field","MultipleValueDecimal","parsedValues","rawValue","parseFloat","toFixed","toString","join","SingleValueString","MultipleValueString","CommerceEventTrackingType","CommercePageType","CommerceSuggestType","trackCommerce","eventName","toLocaleLowerCase","orderNo","itemList","total","subTotal","tax","currency","payload","EventType","sale","EventData","preparePayload","OrderNo","ItemList","Total","Tax","SubTotal","Currency","makeRequest","uniqueId","price","quantity","addToCart","UniqueId","Quantity","Price","trackAddToCart","itemsList","add2CartMultiple","ItemsList","TrackAddToCartMultiple","rate","trackRate","Category","init","SuggestionType","assign","Suggestion","CategoryStrategy","downshift","location","Url","Product","Results","Result","ProductStrategy","ProductName","Content","ContentStrategy","Popular","PopularStrategy","this","Categories","r","Products","CustomEvent","event","params","bubbles","cancelable","detail","evt","document","createEvent","initCustomEvent","prototype","Event","Pagination","Items","i","PaginationItem","values","Sorting","SortingItem","Selections","selFacet","SelectionFacet","SelectionFacetValue","Swatch","Range","Facet","SwatchData","s","Ranges","Values","v","DisplayType","TruncateThreshold","IsSearch","SearchThreshold","ParamName","RuleType","RuleOperatorType","Rule","Parent","Rules","BannerTrigger","FeaturedItems","FeaturedItem","Merchandising","MerchandisingItem","PageContentItem","Trigger","PageContent","Facets","f","p","ContentType","MagnifyingGlassSVG","className","rest","viewBox","classnames","focusable","aria-hidden","d","trim","toCamelCase","word","toLowerCase","toUpperCase","stripHtml","html","tmp","createElement","innerHTML","textContent","innerText","addEllipsis","text","cutoff","substring","trimString","baseUrl","searchUrl","autocompleteUrl","recommendationWidgetUrl","compareItemsURL","AxiosHelper","post","cancelToken","result","inputString","test","ServerData","windowWithServerData","__ROC_SERVER_DATA__","initializeServerData","QuestionMarkCircleSVG","stroke","strokeWidth","fill","fillRule","transform","CheckmarkSVG","class","PlusCircleSVG","Checkbox","useHawkSearch","useFacet","renderer","renderCheckMark","isSelected","renderFacetActions","isNegated","onClick","negateFacet","DashCircleSVG","FieldType","correspondingRange","c","rangeValueAssetUrl","AssetFullUrl","selectionState","selectFacet","aria-pressed","title","src","alt","style","textDecoration","Count","renderTruncation","Search","hawkActor","input","setInput","searchInputRef","useRef","t","useTranslation","labelFor","FacetId","htmlFor","onChange","e","currentTarget","onKeyDown","type","ref","name","current","aria-label","Link","LazyNumberFormat","React","lazy","SliderNumericInputs","sliderProps","minValue","setMinValue","maxValue","setMaxValue","reloadFacets","onValueChange","Number","Suspense","fallback","Spinner","thousandSeparator","isCurrency","prefix","currencySymbol","min","max","newMinValue","isNaN","onBlur","decimalScale","decimalPrecision","newMaxValue","Rheostat","Slider","range","Math","floor","RangeMin","rangeMin","setMinRange","ceil","RangeMax","rangeMax","setMaxRange","RangeStart","rangeStart","setStartRange","RangeEnd","rangeEnd","setEndRange","IsCurrency","setIsCurrency","CurrencySymbol","setCurrencySymbol","paramName","items","selectedValues","split","newRange","minVal","maxVal","selection","setFacets","currentMinValue","currentMaxValue","SwatchItem","swatchValue","swatchUrl","suffix","facetSwatch","AssetUrl","AssetName","getSwatchUrl","colorSwatchStyle","backgroundColor","Color","listItemClassNames","onSwatchSelected","isColor","NestedItem","isExpanded","setIsExpanded","shouldTruncate","isTruncated","setIsTruncated","hierarchyValue","hierarchyChildren","Children","remainingValues","shouldTruncateChildren","valuesBeforeTrunc","slice","onValueSelected","aria-expanded","Path","Nested","OpenRange","FacetType","setStartValue","setEndValue","startVal","endVal","data-type","defaultFacetComponents","facetType","component","DefaultCheckbox","NestedCheckbox","DefaultNestedCheckbox","DefaultSearch","DefaultLink","DefaultSlider","DefaultSwatch","DefaultOpenRange","defaultAutocompleteStrategies","strategy","getFacetComponents","overridedComponents","facetComponents","fType","fComponent","getAutocompleteStrategies","overridedStrategies","suggestionStrategies","sType","autocompleteStrategy","strategyMatch","SearchSuggestionsList","query","onViewMatches","popular","categories","products","content","PopularHeading","CategoryHeading","ProductHeading","ContentHeading","getItemProps","getMenuProps","highlightedIndex","isRecordEmpty","hasPopular","hasCategories","hasProducts","hasContent","hasAllEmpty","isAtleastOneExist","getAtleastOneExist","dynamicIndex","keyword","suggestType","TopProductMatches","itemName","url","Thumb","ViewAll","SearchSuggestions","results","setResults","setIsLoading","autocomplete","DisplayFullResponse","then","o","debounceMs","autocompleteDebounce","timeout","setTimeout","doAutocomplete","clearTimeout","Downshift","SearchBoxBase","onSubmit","strategies","autocompleteStrategies","isOpenOverride","setIsOpenOverride","stateReducer","changes","inputValue","itemToString","matchedStrategy","handleToString","handleItemChange","initialInputValue","options","isOpen","getInputProps","openMenu","showSuggestions","getLabelProps","relTarget","relatedTarget","id","onFocus","placeholder","light","waitMs","align","block","parentCentered","useDelayedDisplay","spinner","GlobalSearchBox","redirectToSearchPage","keywords","redirect","encodeURIComponent","create","defaults","headers","common","interceptors","use","method","getCsrfToken","csrfToken","RequestVerificationToken","addUnauthorizedAccessInterceptor","history","status","AccountUrls","Login","pathname","Promise","reject","api","__esModule","default","module","exports","locals","___CSS_LOADER_API_IMPORT___","InlineAlert","defaultProps","children","theme","isTitleOnOwnRow","isCollapsed","onCollapse","message","axiosError","isAxiosError","eventType","dispatchEvent","useRocEventHandler","eventHandler","deps","removeHandlerCallback","addRocEventHandler","HawkContext","createContext","useContext","StoreProvider","Provider","XSVG","userDataPromise","getUserData","get","getUserDataNoCache","userData","requestToken","ErrorBoundary","lastRefreshedTimestamp","Date","parseInt","localStorage","getItem","getTime","setItem","reload","renderError","Component","renderProps","BaseUrl","ACCOUNT_URL_BASE","ACCOUNT_LOGIN_URL","Login2fa","ACCOUNT_LOGIN_WITH_2FA_URL","Register","ACCOUNT_REGISTER_URL","ForgotPassword","ACCOUNT_FORGOT_PASSWORD_URL","LoginWithRecoveryCode","ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL","Logout","ACCOUNT_LOGOUT_URL","OrganizationReview","ACCOUNT_ORGANIZATION_REVIEW_URL","OrganizationSelector","ACCOUNT_ORGANIZATION_SELECTOR_URL","ExternalLogout","EventTrackingType","PageType","SuggestType","createGuid","substr","random","JSON","stringify","utf8Bytes","TextEncoder","encode","btoa","String","fromCharCode","HawkSearch","TrackingUrl","visitId","getCookie","visitorId","isNewVisitor","setCookie","setTime","toUTCString","getVisitorExpiry","VisitId","VisitorId","TrackingProperties","Context","CustomDictionary","CustomContext","catch","initCustomEvents","readyState","addEventListener","ContextDictionary","remove","hasOwnProperty","existingValue","add","Tracking","track","pageType","documentElement","clientHeight","clientWidth","pageLoad","PageTypeId","RequestPath","Qs","ViewportHeight","ViewportWidth","typeId","queryId","QueryId","TypeId","trackSearchTracking","click","trackClick","bannerId","campaignId","bannerClick","CampaignId","BannerId","bannerImpression","trackBannerImpression","autoCompleteClick","widgetGuid","itemIndex","requestId","recommendationClick","ItemIndex","RequestId","WidgetGuid","trackRecommendationClick","initial","selectionIdx","indexOf","negationIdx","selectedValue","selectionValue","matchingValue","findMatchingValue","clientSelections","facets","label","selectionValues","matchingVal","suggestionType","Element","getAttributeNames","attributes","getDataPropsFromAttributes","element","startsWith","attributeName","getAttribute","initReactApp","getReactElement","elementId","getElementById","ReactDOM","render","initReactAppByAttribute","attribute","elements","querySelectorAll","defaultApiUrl","defaultDashboardUrl","defaultSearchUrl","defaultAutocompleteUrl","defaultSearchPageUrl","defaultCompareItemsURL","defaultRecommendationUrl","getVisitExpiry","nameEQ","ca","cookie","charAt","expiry","expires","display","setDisplay","PlusThinSVG","MinusThinSVG","LazyTooltip","FacetContext","onFacetChange","searchActor","wrapperRef","setFilter","setTruncated","IsCollapsible","IsCollapsedDefault","setCollapsed","hasTooltip","Tooltip","shouldSearch","val","remainingFacets","contains","target","toggleCollapsible","aria-describedby","as","ScrollHeight","height","overflowY","facetStyle","handler","removeEventListener","ConfigContext","context","Error","ConfigProvider","assetPath","path","endsWith","__webpack_public_path__","hawkConfig"],"mappings":"y/BA0JA,IAAMA,EAAwC,GAKxCC,EAA2C,GAKjD,SAASC,IACR,IAAMC,EAAsBC,OAG3BD,GACAA,EAAoBE,6BACpBC,MAAMC,QAAQJ,EAAoBE,8BAElCF,EAAoBE,4BAA4BG,SAAQ,SAACC,GACxD,cAAkBC,OAAOC,KAAKF,GAA9B,eAAoC,CAA/B,IAAMG,EAAG,KACbZ,EAAmBY,GAAOH,EAAIG,OAc3B,SAASC,EACfD,GAEC,2BADEE,EACF,iCADEA,EACF,kBAKD,GAJ+C,IAA3CJ,OAAOC,KAAKX,GAAoBe,QACnCb,KAGIF,IAAuBA,EAAmBY,GAQ9C,OALMX,EAAgBW,KACpBI,QAAQC,KAAKL,EAAK,2DAClBX,EAAgBW,IAAO,GAGlBA,EAGR,IAAMM,EAAWlB,EAAmBY,GAEpC,OAAKE,EAIEI,EAASC,QAAQ,YAAY,SAACC,EAAeC,GACnD,OAAOP,E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 'features/address-book/resources';\r\nimport { ContactFormResourceKeys } from 'features/contact-form/resources';\r\nimport { CreatePasswordResourceKeys } from 'features/create-password/resources';\r\nimport { LoginWith2faResourceKeys } from 'features/login-with-2fa/resources';\r\nimport { LoginWithRecoveryCodeResourceKeys } from 'features/login-with-recovery-code/resources';\r\nimport { LoginResourceKeys } from 'features/login/resources';\r\nimport { MyAccountResourceKeys } from 'features/my-account/resources';\r\nimport { ResetPasswordResourceKeys } from 'features/reset-password/resources';\r\nimport { SubmitQuestionResourceKeys } from 'features/submit-question/resources';\r\nimport * as React from 'react';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\n// #region Commerce\r\nimport { CommerceResourceKeys } from 'features/commerce/CommerceResourceKeys';\r\n// #endregion\r\n\r\n// #region HCL\r\nimport { QuickBagsResourceKeys } from 'features/hcl/quick-bags/resources';\r\nimport { QuickLabelsResourceKeys } from 'features/hcl/quick-labels/resources';\r\nimport { ProductCatalogsResourceKeys } from 'features/hcl/product-catalogs/resources';\r\nimport { FileUploadResourceKeys } from 'features/hcl/file-upload/resources';\r\nimport { NewsletterKeys } from 'features/hcl/newsletter-signup/resources';\r\n// #endregion\r\n\r\n/**\r\n * Type that will hold all the global localization keys\r\n */\r\ntype LocalizerGlobalResourceKeys =\r\n\t| 'Success'\r\n\t| 'OfTotalPages'\r\n\t| 'Cancel'\r\n\t| 'Confirm'\r\n\t| 'FirstName'\r\n\t| 'LastName'\r\n\t| 'Email'\r\n\t| 'Username'\r\n\t| 'Amount'\r\n\t| 'NameOnCard'\r\n\t| 'CardNumber'\r\n\t| 'ExpDate'\r\n\t| 'ExpMonth'\r\n\t| 'ExpYear'\r\n\t| 'Expires'\r\n\t| 'Expired'\r\n\t| 'SecurityCode'\r\n\t| 'Submit'\r\n\t| 'Save'\r\n\t| 'ZipCode'\r\n\t| 'Remove'\r\n\t| 'Removed'\r\n\t| 'Update'\r\n\t| 'Undo'\r\n\t| 'Cancel'\r\n\t| 'Enter'\r\n\t| 'Close'\r\n\t| 'SortBy'\r\n\t| 'PleaseWait'\r\n\t| 'Unknown'\r\n\t| 'Yes'\r\n\t| 'No'\r\n\t| 'Delete'\r\n\t| 'Update'\r\n\t| 'SaveAndContinueButtonText'\r\n\t| 'SaveAndContinue'\r\n\t| 'Continue'\r\n\t| 'SaveErrorMessage'\r\n\t| 'Edit'\r\n\t| 'ErrorMessageGenericTitle'\r\n\t| 'CheckEnteredValues'\r\n\t| 'ErrorMessageForbidden'\r\n\t| 'ErrorMessageNetwork'\r\n\t| 'ErrorOccurredSubmittingTheForm'\r\n\t| 'UnexpectedErrorOccurred'\r\n\t| 'Login'\r\n\t| 'ReturnToShipping'\r\n\t| 'BreadcrumbsLabel'\r\n\t| 'Other'\r\n\t| 'RememberMe'\r\n\t| 'ForgotYourPassword'\r\n\t| 'RegisterNewUserLinkText'\r\n\t| 'LoginPageTitleText'\r\n\t| 'ForgotPasswordPageTitle'\r\n\t| 'ForgotPasswordConfirmationPageTitle'\r\n\t| 'ForgotPasswordConfirmation'\r\n\t| 'Optional'\r\n\t| 'SearchBoxPlaceholder'\r\n\t| 'XOutOfYStars'\r\n\t| 'XToYOfZ'\r\n\t| 'ModalLabel'\r\n\t| 'RequiredFields'\r\n\t| 'Status'\r\n\t| 'Version'\r\n\t| 'CreatedOn'\r\n\t| 'CreatedBy'\r\n\t| 'ModifiedOn'\r\n\t| 'ModifiedBy'\r\n\t| 'OpenStatusInformation'\r\n\t| 'CloseStatusInformation'\r\n\t| 'SearchFilter'\r\n\t| 'Pagination'\r\n\t| 'Previous'\r\n\t| 'Next'\r\n\t| 'ClearFilter';\r\n\r\n/**\r\n * Type that will hold all the localization keys\r\n */\r\nexport type LocalizerResourceKey =\r\n\t| LocalizerGlobalResourceKeys\r\n\t| LoginResourceKeys\r\n\t| ContactFormResourceKeys\r\n\t// #region Commerce\r\n\t| CommerceResourceKeys\r\n\t// #endregion\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| SubmitQuestionResourceKeys\r\n\t| ResetPasswordResourceKeys\r\n\t| CreatePasswordResourceKeys\r\n\t| MyAccountResourceKeys\r\n\t| LoginWith2faResourceKeys\r\n\t| LoginWithRecoveryCodeResourceKeys\r\n\t| AddressResourceKeys\r\n\t// #region HCL\r\n\t| QuickBagsResourceKeys\r\n\t| QuickLabelsResourceKeys\r\n\t| ProductCatalogsResourceKeys\r\n\t| NewsletterKeys\r\n\t| FileUploadResourceKeys;\r\n// #endregion\r\n\r\n/**\r\n * Interface for the resources\r\n *\r\n * @export\r\n * @interface LocalizerResource\r\n */\r\ninterface LocalizerResource {\r\n\t[id: string]: string;\r\n}\r\n\r\n/**\r\n * Extends Window with a property that will hold the localizer resources\r\n *\r\n * @interface WindowWithResources\r\n * @extends {Window}\r\n */\r\nexport interface WindowWithResources extends Window {\r\n\t__ROC_LOCALIZER_RESOURCES__?: LocalizerResource[];\r\n}\r\n\r\n/**\r\n * Main object that will hold all the localized resources\r\n */\r\nconst LocalizerResources: LocalizerResource = {};\r\n\r\n/**\r\n * To prevent redundant logging\r\n */\r\nconst isAlreadyLogged: Record = {};\r\n\r\n/**\r\n * Initializer function that will populate the main localized resources object\r\n */\r\nfunction initializeLocalizerResources() {\r\n\tconst windowWithResources = window as WindowWithResources;\r\n\r\n\tif (\r\n\t\twindowWithResources &&\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__ &&\r\n\t\tArray.isArray(windowWithResources.__ROC_LOCALIZER_RESOURCES__)\r\n\t) {\r\n\t\twindowWithResources.__ROC_LOCALIZER_RESOURCES__.forEach((obj) => {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tLocalizerResources[key] = obj[key];\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\n/**\r\n * Function that can be used to load the localized strings with support to parameter replacements\r\n *\r\n * @export\r\n * @param {string} key\r\n * @param {...string[]} replaceStrings\r\n * @returns\r\n */\r\nexport function Localizer(\r\n\tkey: TResourceKey,\r\n\t...replaceStrings: string[]\r\n) {\r\n\tif (Object.keys(LocalizerResources).length === 0) {\r\n\t\tinitializeLocalizerResources();\r\n\t}\r\n\r\n\tif (!LocalizerResources || !LocalizerResources[key]) {\r\n\t\t// if running in a test environment, just skip any warnings.\r\n\t\tif (process.env.NODE_ENV !== 'test') {\r\n\t\t\tif (!isAlreadyLogged[key]) {\r\n\t\t\t\tconsole.warn(key, 'Localizer Resource not found. Key will be used instead.');\r\n\t\t\t\tisAlreadyLogged[key] = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn key;\r\n\t}\r\n\r\n\tconst resource = LocalizerResources[key];\r\n\r\n\tif (!replaceStrings) {\r\n\t\treturn resource;\r\n\t}\r\n\r\n\treturn resource.replace(/{(\\d+)}/g, (match: string, index: number) => {\r\n\t\treturn replaceStrings[index] ? replaceStrings[index] : '';\r\n\t});\r\n}\r\n\r\n/**\r\n * Interface for the LocalizedSpan component\r\n *\r\n * @interface LocalizedSpanProps\r\n */\r\ninterface LocalizedSpanProps {\r\n\tresourceKey: LocalizerResourceKey;\r\n\targs?: string[];\r\n}\r\n\r\n/**\r\n * Component responsible for the initialization of the react app\r\n */\r\nexport function LocalizedSpan(props: LocalizedSpanProps) {\r\n\tconst { resourceKey, args = [] } = props;\r\n\tconst localizedString = Localizer(resourceKey, ...args);\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n","import { HawkSearchConfig } from 'shared/components/hawksearch/types/HawkSearchConfig';\r\nimport * as Constants from 'util/Constants';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\nconst searchState = (window as any).__ROC_SEARCH_STATE__;\r\n\r\nconst RocHawkConfig: HawkSearchConfig = {\r\n\tapiUrl: searchState.searchEndpoint as string,\r\n\tclientGuid: searchState.trackingKey as string,\r\n\tsearchPageUrl: (searchState.searchPageUrl as string) || '/search',\r\n\tdashboardUrl: (searchState.dashboardUrl as string) || Constants.defaultDashboardUrl,\r\n\tsearchBoxPlaceholder: Localizer('SearchBoxPlaceholder'),\r\n\ttrackingUrl: searchState.trackingUrl as string,\r\n\t/* #region Commerce */\r\n\trecommendationUrl: searchState.recommendationEndpoint as string,\r\n\tenableRemovingDashesFromSearchKeyword: searchState.enableRemovingDashesFromSearchKeyword as boolean,\r\n\t/* #endregion */\r\n};\r\n\r\nexport default RocHawkConfig;\r\n","/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable no-unused-vars */\r\nimport { SearchType } from 'features/tracking/trackers/hawksearch/tracking';\r\nimport { Response, Request } from 'models/Search';\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\n\r\n/**\r\n * Dispatches hawk search page tracking events based on search request\r\n */\r\nexport function setSearchTracking(request: Partial, response: Response) {\r\n\tconst isLandingPage: boolean = !!request.CustomUrl;\r\n\tconst hasFacetSelections: boolean =\r\n\t\trequest.FacetSelections && Object.keys(request.FacetSelections).length > 0 ? true : false;\r\n\r\n\tconst searchType: SearchType =\r\n\t\t!hasFacetSelections && !request.MaxPerPage && !request.PageNo ? SearchType.Initial : SearchType.Refinement;\r\n\r\n\tif (isLandingPage) {\r\n\t\tdispatchRocEvent('hawk-landing-page-viewed', {});\r\n\t} else {\r\n\t\tdispatchRocEvent('hawk-search-tracking', { trackingId: response.TrackingId, searchType: searchType });\r\n\t}\r\n}\r\n","import { useEffect } from 'react';\r\nimport axios, { CancelToken } from 'axios';\r\nimport { SearchStore, FacetSelectionState } from './Store';\r\nimport HawkClient from 'net/HawkClient';\r\nimport { Response, Request, FacetSelections, Result } from 'models/Search';\r\nimport { useMergableState } from 'util/MergableState';\r\nimport { useHawkConfig } from 'components/ConfigProvider';\r\nimport { Facet, Value } from 'models/Facets';\r\nimport { Response as CompareDataResponse, Request as CompareItemRequest } from 'models/CompareItems';\r\nimport { CompareResultObject } from '../models/CompareResultObject';\r\nimport { setSearchTracking } from '../util/SearchTracking';\r\n// #region HCL\r\nimport { validateQueryAndRemoveDash } from '../components/hcl/util';\r\n// #endregion\r\n\r\nexport interface SearchActor {\r\n\t/**\r\n\t * Performs a search with the currently configured pending search request. The search request can be\r\n\t * configured via the `setSearch` method. This method usually doesn't need to be called directly, as\r\n\t * the `StoreProvider` component will usually trigger searches directly in response to calls to\r\n\t * `setSearch`.\r\n\t * @returns A promise that resolves when the search request has been completed.\r\n\t */\r\n\tsearch(cancellationToken?: CancelToken): Promise;\r\n\r\n\t/**\r\n\t * Configures the next search request that will be executed. This will also execute a search in response to\r\n\t * the next search request changing.\r\n\t * @param search The partial search request object. This will be merged with previous calls to `setSearch`.\r\n\t * @param doHistory Whether or not this search request will push a history entry into the browser. If\r\n\t * \t\t\t\t\tnot specified, the default is `true`.\r\n\t */\r\n\tsetSearch(search: Partial, doHistory?: boolean): void;\r\n\r\n\t/**\r\n\t * Toggles a facet value for the next search request that will be executed. If the given facet had previously\r\n\t * been selected, it will be unselected. If the negation state of a selected facet is changed, the selection\r\n\t * will have its negation state changed. Internally, this will call `setSearch` to configure the next search\r\n\t * with this selected facet.\r\n\t * @param facet The facet for which the value is being selected.\r\n\t * @param facetValue The facet value being selected.\r\n\t * @param negate Whether or not this selection is considered a negation.\r\n\t */\r\n\ttoggleFacetValue(facet: Facet | string, facetValue: Value | string, negate?: boolean): void;\r\n\r\n\tsetFacetValues(facet: Facet | string, facetValues: Value[] | string[]): void;\r\n\r\n\t/**\r\n\t * Entirely clears all the values of the given facet from the current selection.\r\n\t * @param facet The facet to clear.\r\n\t */\r\n\tclearFacet(facet: Facet | string): void;\r\n\r\n\t/**\r\n\t * Clears a given facet value of the given facet from the current selection.\r\n\t * @param facet The facet to clear.\r\n\t * @param facetValue The facet value to clear.\r\n\t */\r\n\tclearFacetValue(facet: Facet | string, facetValue?: Value | string): void;\r\n\r\n\t/**\r\n\t * Clears all selected facets from the current selection.\r\n\t */\r\n\tclearAllFacets(): void;\r\n\r\n\t// Store items to make comparision via request\r\n\tsetItemsToCompare(resultItem: Result, isCheck: boolean): void;\r\n\r\n\t// To store items after getting the results from compare request\r\n\tsetComparedResults(comparedResults: CompareResultObject[]): void;\r\n\r\n\t// Clear stored compared items\r\n\tclearItemsToCompare(): void;\r\n\r\n\t// Get comparision of items from request\r\n\tgetComparedItems(request: CompareItemRequest, cancellationToken?: CancelToken): Promise;\r\n\r\n\t/** Gets the value for a given field of a compared item */\r\n\tgetCompareFieldValue(\r\n\t\tcompareItem: CompareResultObject,\r\n\t\tfieldName: string,\r\n\t\tcompareType: CompareValueType,\r\n\t): string | undefined;\r\n}\r\n\r\n/** The format expected for a compare value */\r\nexport enum CompareValueType {\r\n\tSingleValueString = 0,\r\n\tMultipleValueString = 1,\r\n\tMultipleValueDecimal = 2,\r\n}\r\n\r\nexport function useHawkState(initialSearch?: Partial): [SearchStore, SearchActor] {\r\n\tconst { config } = useHawkConfig();\r\n\r\n\tconst client = new HawkClient(config);\r\n\r\n\tconst pendingSearch: Partial = initialSearch || { Keyword: '', FacetSelections: {} };\r\n\r\n\tconst [store, setStore] = useMergableState(\r\n\t\tnew SearchStore({\r\n\t\t\tpendingSearch,\r\n\t\t\tisLoading: true,\r\n\t\t\titemsToCompare: [],\r\n\t\t\tcomparedResults: [],\r\n\t\t\titemsToCompareIds: [],\r\n\t\t}),\r\n\t\tSearchStore,\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\t// when the pending search changes, trigger a search\r\n\r\n\t\tconst cts = axios.CancelToken.source();\r\n\t\tsearch(cts.token);\r\n\r\n\t\treturn () => {\r\n\t\t\tcts.cancel();\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [store.pendingSearch]);\r\n\r\n\t/**\r\n\t * Performs a comparision between two or more than two products based on ID\r\n\t * user can use this method from view application.\r\n\t * @returns A promise that resolves when the compare request has been completed.\r\n\t */\r\n\tasync function getComparedItems(\r\n\t\trequest: CompareItemRequest,\r\n\t\tcancellationToken?: CancelToken,\r\n\t): Promise {\r\n\t\treturn await client.getComparedItems(request, cancellationToken);\r\n\t}\r\n\r\n\t/**\r\n\t * Performs a search with the currently configured pending search request. The search request can be\r\n\t * configured via the `setSearch` method. This method usually doesn't need to be called directly, as\r\n\t * the `StoreProvider` component will usually trigger searches directly in response to calls to\r\n\t * `setSearch`.\r\n\t * @returns A promise that resolves when the search request has been completed.\r\n\t */\r\n\tasync function search(cancellationToken?: CancelToken): Promise {\r\n\t\tsetStore({ isLoading: true });\r\n\r\n\t\tlet searchResults: Response | null = null;\r\n\r\n\t\tconst searchParams = {\r\n\t\t\t// the search request being executed is spread from the pendingSearch\r\n\t\t\t...store.pendingSearch,\r\n\t\t\t// pass parameter for extended response\r\n\t\t\tIsInPreview: config.isInPreview,\r\n\t\t\t// and override some of the request fields with config values\r\n\t\t\tClientGuid: config.clientGuid,\r\n\t\t};\r\n\r\n\t\t// The index name in the configuration takes priority over the one supplied from the URL\r\n\t\tif (config.indexName) {\r\n\t\t\tsearchParams.IndexName = config.indexName;\r\n\t\t}\r\n\r\n\t\t// #region HCL\r\n\t\tif (config?.enableRemovingDashesFromSearchKeyword) {\r\n\t\t\tsearchParams.Keyword = validateQueryAndRemoveDash(searchParams.Keyword);\r\n\t\t}\r\n\t\t// #endregion\r\n\r\n\t\ttry {\r\n\t\t\tsearchResults = await client.search(searchParams, cancellationToken);\r\n\t\t} catch (error) {\r\n\t\t\tif (axios.isCancel(error)) {\r\n\t\t\t\t// if the request was cancelled, it's because this component was updated\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconsole.error('Search request error:', error);\r\n\t\t\tsetStore({ requestError: true });\r\n\t\t}\r\n\r\n\t\tsetStore({ isLoading: false });\r\n\r\n\t\tif (searchResults) {\r\n\t\t\tif (!searchResults.Success) {\r\n\t\t\t\tconsole.error('Search result error:', searchResults);\r\n\t\t\t\tsetStore({ requestError: true });\r\n\t\t\t} else {\r\n\t\t\t\tsetStore({\r\n\t\t\t\t\tsearchResults: new Response(searchResults),\r\n\t\t\t\t\trequestError: false,\r\n\t\t\t\t});\r\n\t\t\t\t// tracking search event changes\r\n\t\t\t\tsetSearchTracking(pendingSearch, searchResults);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Configures the next search request that will be executed. This will also execute a search in response to\r\n\t * the next search request changing.\r\n\t * @param search The partial search request object. This will be merged with previous calls to `setSearch`.\r\n\t * @param doHistory Whether or not this search request will push a history entry into the browser. If\r\n\t * \t\t\t\t\tnot specified, the default is `true`.\r\n\t */\r\n\tfunction setSearch(pendingSearch: Partial, doHistory?: boolean): void {\r\n\t\tif (doHistory === undefined) {\r\n\t\t\tdoHistory = true;\r\n\t\t}\r\n\r\n\t\tsetStore((prevState) => {\r\n\t\t\tconst newState = {\r\n\t\t\t\tpendingSearch: { ...prevState.pendingSearch, ...pendingSearch },\r\n\t\t\t\tdoHistory,\r\n\t\t\t};\r\n\t\t\tif (newState.pendingSearch.Keyword === '') {\r\n\t\t\t\tnewState.pendingSearch.Keyword = undefined;\r\n\t\t\t}\r\n\r\n\t\t\treturn newState;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the facet selections and search within configuration for the next search request. This will also\r\n\t * clear the page number of the next request to display the first page of results.\r\n\t * @param selections The facet selections to set.\r\n\t * @param searchWithin The search within value to set.\r\n\t */\r\n\tfunction setSearchSelections(selections?: FacetSelections, searchWithin?: string) {\r\n\t\tsetSearch({\r\n\t\t\tFacetSelections: selections,\r\n\t\t\tSearchWithin: searchWithin,\r\n\r\n\t\t\t// when we change facet selections, also clear the current page so that we navigate\r\n\t\t\t// back to the first page of results\r\n\t\t\tPageNo: undefined,\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles a facet value for the next search request that will be executed. Internally, this will call\r\n\t * `setSearch` to configure the next search with this selected facet.\r\n\t * @param facet The facet for which the value is being selected.\r\n\t * @param facetValue The facet value being selected.\r\n\t * @param negate Whether or not this selection is considered a negation.\r\n\t */\r\n\tfunction toggleFacetValue(facet: Facet | string, facetValue: Value | string, negate?: boolean): void {\r\n\t\tif (negate === undefined) {\r\n\t\t\tnegate = false;\r\n\t\t}\r\n\r\n\t\tconst facetName: string = typeof facet === 'string' ? facet : facet.Name;\r\n\t\tconst facetField = typeof facet === 'string' ? facet : facet.selectionField;\r\n\r\n\t\t/* #region HCL */\r\n\t\tconst valueValue = (typeof facetValue === 'string' ? facetValue : facetValue.Value)?.replace(/%c%/g, ',');\r\n\t\t/* #endregion */\r\n\t\tconst valueLabel = typeof facetValue === 'string' ? facetValue : facetValue.Label;\r\n\r\n\t\tif (!valueValue) {\r\n\t\t\tconsole.error(`Facet ${facetName} (${facetField}) has no facet value for ${valueLabel}`);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet facetSelections = store.pendingSearch.FacetSelections;\r\n\r\n\t\t// handle `searchWithin` facet, which isn't a facet selection but is instead a field on the\r\n\t\t// search request.\r\n\t\tif (facetField === 'searchWithin') {\r\n\t\t\t// set the search within to the facet value provided\r\n\t\t\tsetSearchSelections(facetSelections, /* searchWithin */ valueValue);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!facetSelections) {\r\n\t\t\tfacetSelections = {};\r\n\t\t}\r\n\r\n\t\tif (!facetSelections[facetField]) {\r\n\t\t\tfacetSelections[facetField] = [];\r\n\t\t}\r\n\r\n\t\tconst { state: selState, selectionIndex } = store.isFacetSelected(facet, facetValue);\r\n\r\n\t\tif (selState === FacetSelectionState.Selected || selState === FacetSelectionState.Negated) {\r\n\t\t\t// we're selecting this facet, and it's already selected\r\n\r\n\t\t\t// first, remove it from our selections\r\n\t\t\tfacetSelections[facetField]!.splice(selectionIndex!, 1);\r\n\r\n\t\t\tif (\r\n\t\t\t\t(selState === FacetSelectionState.Selected && negate) ||\r\n\t\t\t\t(selState === FacetSelectionState.Negated && !negate)\r\n\t\t\t) {\r\n\t\t\t\t// if we're toggling from negation to non-negation or vice versa, then push the new selection\r\n\t\t\t\tfacetSelections[facetField]!.push(negate ? `-${valueValue}` : valueValue);\r\n\t\t\t} else {\r\n\t\t\t\t// if we're not toggling the negation, nothing to do because we already removed the selection above\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// not selected, so we want to select it\r\n\t\t\tfacetSelections[facetField]!.push(negate ? `-${valueValue}` : valueValue);\r\n\t\t}\r\n\r\n\t\tif (facetSelections[facetField]!.length === 0) {\r\n\t\t\t// clean up any facets that no longer have any selected facet values\r\n\t\t\tdelete facetSelections[facetField];\r\n\t\t}\r\n\r\n\t\tsetSearchSelections(facetSelections, store.pendingSearch.SearchWithin);\r\n\t}\r\n\r\n\tfunction setFacetValues(facet: Facet | string, facetValues: Value[] | string[]): void {\r\n\t\tconst facetName = typeof facet === 'string' ? facet : facet.Name;\r\n\t\tconst facetField = typeof facet === 'string' ? facet : facet.selectionField;\r\n\r\n\t\tlet facetSelections = store.pendingSearch.FacetSelections;\r\n\r\n\t\tif (!facetSelections) {\r\n\t\t\tfacetSelections = {};\r\n\t\t}\r\n\r\n\t\tfacetSelections[facetField] = [];\r\n\r\n\t\tfor (const facetValue of facetValues) {\r\n\t\t\tconst valueValue = typeof facetValue === 'string' ? facetValue : facetValue.Value;\r\n\t\t\tconst valueLabel = typeof facetValue === 'string' ? facetValue : facetValue.Label;\r\n\r\n\t\t\tif (!valueValue) {\r\n\t\t\t\tconsole.error(`Facet ${facetName} (${facetField}) has no facet value for ${valueLabel}`);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tfacetSelections[facetField]!.push(valueValue);\r\n\t\t}\r\n\r\n\t\tsetSearchSelections(facetSelections, store.pendingSearch.SearchWithin);\r\n\t}\r\n\r\n\t/**\r\n\t * Entirely clears all the values of the given facet from the current selection.\r\n\t * @param facet The facet to clear.\r\n\t */\r\n\tfunction clearFacet(facet: Facet | string) {\r\n\t\tconst facetField = typeof facet === 'string' ? facet : facet.selectionField;\r\n\r\n\t\tconst facetSelections = store.pendingSearch.FacetSelections;\r\n\r\n\t\t// handle `searchWithin` facet, which isn't a facet selection but is instead a field on the\r\n\t\t// search request.\r\n\t\tif (facetField === 'searchWithin') {\r\n\t\t\t// set searchWithin to undefined to clear it\r\n\t\t\tsetSearchSelections(facetSelections, /* searchWithin */ undefined);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!facetSelections || !facetSelections[facetField]) {\r\n\t\t\t// if there are no facet selections or the facet isn't selected at all, there's nothing to clear\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tdelete facetSelections[facetField];\r\n\r\n\t\tsetSearchSelections(facetSelections, store.pendingSearch.SearchWithin);\r\n\t}\r\n\r\n\t/**\r\n\t * Clears a given facet value of the given facet from the current selection.\r\n\t * @param facet The facet to clear.\r\n\t * @param facetValue The facet value to clear.\r\n\t */\r\n\tfunction clearFacetValue(facet: Facet | string, facetValue: Value | string) {\r\n\t\tconst facetName = typeof facet === 'string' ? facet : facet.Name;\r\n\t\tconst facetField = typeof facet === 'string' ? facet : facet.selectionField;\r\n\r\n\t\tconst valueValue = typeof facetValue === 'string' ? facetValue : facetValue.Value;\r\n\t\tconst valueLabel = typeof facetValue === 'string' ? facetValue : facetValue.Label;\r\n\r\n\t\tif (!valueValue) {\r\n\t\t\tconsole.error(`Facet ${facetName} (${facetField}) has no facet value for ${valueLabel}`);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// handle `searchWithin` facet, which isn't a facet selection but is instead a field on the\r\n\t\t// search request.\r\n\t\tif (facetField === 'searchWithin') {\r\n\t\t\t// set searchWithin to undefined to clear it\r\n\t\t\tsetSearchSelections(store.pendingSearch.FacetSelections, /* searchWithin */ undefined);\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst { state: selState, selectionIndex } = store.isFacetSelected(facet, facetValue);\r\n\r\n\t\tif (selState === FacetSelectionState.NotSelected) {\r\n\t\t\t// if there are no facet selections or the facet isn't selected at all, there's nothing to clear\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst facetSelections = store.pendingSearch.FacetSelections!;\r\n\r\n\t\t// remove it from the selections\r\n\t\tfacetSelections[facetField]!.splice(selectionIndex!, 1);\r\n\r\n\t\tif (facetSelections[facetField]!.length === 0) {\r\n\t\t\t// clean up any facets that no longer have any selected facet values\r\n\t\t\tdelete facetSelections[facetField];\r\n\t\t}\r\n\r\n\t\tsetSearchSelections(facetSelections, store.pendingSearch.SearchWithin);\r\n\t}\r\n\r\n\t/**\r\n\t * Clears all selected facets from the current selection.\r\n\t */\r\n\tfunction clearAllFacets(): void {\r\n\t\tsetSearchSelections();\r\n\t}\r\n\r\n\tfunction setItemsToCompare(resultItem: Result, isCheck: boolean): void {\r\n\t\tlet itemsArray = [...store.itemsToCompare];\r\n\t\tif (isCheck) {\r\n\t\t\t// append\r\n\t\t\titemsArray = [...itemsArray, ...[resultItem]];\r\n\t\t} else {\r\n\t\t\t// filter out\r\n\t\t\titemsArray = itemsArray.filter((item) => item.DocId !== resultItem.DocId);\r\n\t\t}\r\n\t\t// setStore({ itemsToCompare: itemsArray });\r\n\t\tsetStore({\r\n\t\t\titemsToCompare: itemsArray,\r\n\t\t\titemsToCompareIds: itemsArray.map((item) => item.DocId),\r\n\t\t});\r\n\t}\r\n\r\n\tfunction setComparedResults(data: CompareResultObject[]): void {\r\n\t\tsetStore({\r\n\t\t\tcomparedResults: data,\r\n\t\t});\r\n\t}\r\n\r\n\tfunction clearItemsToCompare() {\r\n\t\tsetStore({\r\n\t\t\titemsToCompare: [],\r\n\t\t\titemsToCompareIds: [],\r\n\t\t});\r\n\t}\r\n\r\n\t/** Gets the value for a given field of a compared item */\r\n\tfunction getCompareFieldValue(compareItem: CompareResultObject, fieldName: string, compareType: CompareValueType) {\r\n\t\tconst field = compareItem.Document.find((item) => item.Field === fieldName);\r\n\r\n\t\tif (field == null || field.Value.length === 0) {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tswitch (compareType) {\r\n\t\t\tcase CompareValueType.MultipleValueDecimal:\r\n\t\t\t\t// Parse decimal values and then join them together into a comma-separated list\r\n\t\t\t\tconst parsedValues: string[] = [];\r\n\t\t\t\tfor (const rawValue of field.Value) {\r\n\t\t\t\t\tparsedValues.push(parseFloat(rawValue).toFixed(1).toString());\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn parsedValues.join(', ');\r\n\t\t\tcase CompareValueType.SingleValueString:\r\n\t\t\t\treturn field.Value[0];\r\n\t\t\tcase CompareValueType.MultipleValueString:\r\n\t\t\tdefault:\r\n\t\t\t\treturn field.Value.join(', ');\r\n\t\t}\r\n\t}\r\n\r\n\tconst actor: SearchActor = {\r\n\t\tsearch,\r\n\t\tsetSearch,\r\n\t\ttoggleFacetValue,\r\n\t\tsetFacetValues,\r\n\t\tclearFacet,\r\n\t\tclearFacetValue,\r\n\t\tclearAllFacets,\r\n\t\tsetItemsToCompare,\r\n\t\tsetComparedResults,\r\n\t\tclearItemsToCompare,\r\n\t\tgetComparedItems,\r\n\t\tgetCompareFieldValue,\r\n\t};\r\n\r\n\treturn [store, actor];\r\n}\r\n","import { useState, Dispatch } from 'react';\r\n\r\ntype SetStateAction = Partial | ((prevState: T) => Partial);\r\n\r\nexport function useMergableState(\r\n\tinitialValue: T,\r\n\ttypeConstructor: new (init: Partial) => T,\r\n): [T, Dispatch>] {\r\n\tconst [state, setState] = useState(new typeConstructor(initialValue));\r\n\r\n\tfunction setStateAndMerge(value: SetStateAction) {\r\n\t\tif (typeof value === 'function') {\r\n\t\t\t// if we're being passed a function, we're setting state in the form of setState(prevState => ...).\r\n\r\n\t\t\tsetState((prevState) => {\r\n\t\t\t\t// so we derive the new state from the previous state\r\n\t\t\t\tconst newState = value(prevState);\r\n\r\n\t\t\t\t// and then set the new merged state\r\n\t\t\t\treturn new typeConstructor({ ...prevState, ...newState });\r\n\t\t\t});\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// otherwise, the new state was simply passed in\r\n\t\tsetState((prevState) => {\r\n\t\t\t// merge state together and set it\r\n\t\t\treturn new typeConstructor({ ...prevState, ...value });\r\n\t\t});\r\n\t}\r\n\r\n\treturn [state, setStateAndMerge];\r\n}\r\n","import { ExtractEventParameters } from 'shared/events';\r\nimport { makeRequest, preparePayload } from '../../hawksearch/tracking';\r\n\r\nexport enum CommerceEventTrackingType {\r\n\taddToCart = 4,\r\n\trate = 5,\r\n\tsale = 6,\r\n\tadd2CartMultiple = 14,\r\n}\r\n\r\n/**\r\n * The page type\r\n */\r\nexport enum CommercePageType {\r\n\t/**\r\n\t * Item detail page (i.e. PDP)\r\n\t */\r\n\titem = 1,\r\n\t/**\r\n\t * Shopping Cart Page\r\n\t */\r\n\tcart = 3,\r\n\t/**\r\n\t * Order Confirmation Page\r\n\t */\r\n\torder = 4,\r\n}\r\n\r\nexport enum CommerceSuggestType {\r\n\tTopCategories = 2,\r\n\tTopProductMatches = 3,\r\n}\r\n\r\ntype CommerceHawkEvents =\r\n\t| ({ name: 'sale' } & TrackSaleArgs)\r\n\t| ({ name: 'add2cart' } & TrackAddToCartArgs)\r\n\t| ({ name: 'add2cartmultiple' } & TrackAddToCartMultipleArgs)\r\n\t| ({ name: 'rate' } & TrackRateArgs);\r\n\r\nexport type CommerceHawkEventType = CommerceHawkEvents['name'];\r\n\r\nexport function trackCommerce(\r\n\teventName: T,\r\n\targs: ExtractEventParameters,\r\n) {\r\n\tswitch (eventName.toLocaleLowerCase()) {\r\n\t\tcase 'sale':\r\n\t\t\t//HawkSearch.Tracking.track('sale', {orderNo: 'order_123',itemList: [{uniqueid: '123456789', itemPrice: 12.99, quantity: 2}], total: 25.98, subTotal: 22, tax: 3.98, currency: 'USD'});\r\n\t\t\treturn trackSale((args as unknown) as TrackSaleArgs);\r\n\t\tcase 'add2cart':\r\n\t\t\t//HawkSearch.Tracking.track('add2cart',{uniqueId: '123456789', price: 19.99, quantity: 3, currency: 'USD'});\r\n\t\t\treturn trackAddToCart((args as unknown) as TrackAddToCartArgs);\r\n\t\tcase 'add2cartmultiple':\r\n\t\t\t//HawkSearch.Tracking.track('add2cartmultiple', [{uniqueId: '123456789',price: 15.97,quantity: 1,currency: 'USD'},{uniqueId: '987465321', price: 18.00, quantity: 1, currency: 'USD'}]);\r\n\t\t\treturn TrackAddToCartMultiple((args as unknown) as TrackAddToCartMultipleArgs);\r\n\t\tcase 'rate':\r\n\t\t\t//HawkSearch.Tracking.track('rate', {uniqueId: '123456789',value: 3.00});\r\n\t\t\treturn trackRate((args as unknown) as TrackRateArgs);\r\n\t}\r\n}\r\n\r\nexport type TrackSaleItemArgs = {\r\n\t/**\r\n\t * Represents the unique identifier of a product. This should correspond to the value of the field set up as the primary key in the fields section of Hawksearch dashboard\r\n\t */\r\n\tuniqueId: string;\r\n\t/**\r\n\t * Represents a single item price\r\n\t */\r\n\titemPrice: number;\r\n\t/**\r\n\t * The number of items being added to the cart\r\n\t */\r\n\tquantity: number;\r\n};\r\n\r\ntype TrackSaleArgs = {\r\n\t/**\r\n\t * The alphanumeric value representing the order number\r\n\t */\r\n\torderNo: string;\r\n\t/**\r\n\t * Is an array of objects that stores information about items. To see object properties check Sale Item Info Model below.\r\n\t */\r\n\titemList: TrackSaleItemArgs[];\r\n\t/**\r\n\t * The actual order total amount\r\n\t */\r\n\ttotal?: number;\r\n\t/**\r\n\t * The order the sub total amoun\r\n\t */\r\n\tsubTotal?: number;\r\n\t/**\r\n\t * The tax value\r\n\t */\r\n\ttax?: number;\r\n\t/**\r\n\t * The actual currency in ISO format\r\n\t */\r\n\tcurrency?: string;\r\n};\r\n\r\nfunction trackSale({ orderNo, itemList, total, subTotal, tax, currency }: TrackSaleArgs) {\r\n\tconst payload = {\r\n\t\tEventType: CommerceEventTrackingType.sale,\r\n\t\tEventData: preparePayload({\r\n\t\t\tOrderNo: orderNo,\r\n\t\t\tItemList: itemList,\r\n\t\t\tTotal: total,\r\n\t\t\tTax: tax,\r\n\t\t\tSubTotal: subTotal,\r\n\t\t\tCurrency: currency,\r\n\t\t}),\r\n\t};\r\n\r\n\tmakeRequest(payload);\r\n}\r\n\r\nexport type TrackAddToCartArgs = {\r\n\t/**\r\n\t * Represents the unique identifier of a product. This should correspond to the value of the field set up as the primary key in the fields section of Hawksearch dashboard\r\n\t */\r\n\tuniqueId: string;\r\n\t/**\r\n\t * Represents a single item price\r\n\t */\r\n\tprice: number;\r\n\t/**\r\n\t * The number of items being added to the cart\r\n\t */\r\n\tquantity: number;\r\n\t/**\r\n\t * Actual currency in ISO format\r\n\t */\r\n\tcurrency: string;\r\n};\r\n\r\nfunction trackAddToCart({ uniqueId, price, quantity, currency }: TrackAddToCartArgs) {\r\n\tconst payload = {\r\n\t\tEventType: CommerceEventTrackingType.addToCart,\r\n\t\tEventData: preparePayload({\r\n\t\t\tUniqueId: uniqueId,\r\n\t\t\tQuantity: quantity,\r\n\t\t\tPrice: price,\r\n\t\t\tCurrency: currency,\r\n\t\t}),\r\n\t};\r\n\r\n\tmakeRequest(payload);\r\n}\r\n\r\ntype TrackAddToCartMultipleArgs = {\r\n\t/**\r\n\t * Is an array of objects that stores information about items\r\n\t */\r\n\titemsList: TrackAddToCartArgs[];\r\n};\r\n\r\nfunction TrackAddToCartMultiple({ itemsList }: TrackAddToCartMultipleArgs) {\r\n\tconst payload = {\r\n\t\tEventType: CommerceEventTrackingType.add2CartMultiple,\r\n\t\tEventData: preparePayload({\r\n\t\t\tItemsList: itemsList,\r\n\t\t}),\r\n\t};\r\n\r\n\tmakeRequest(payload);\r\n}\r\n\r\ntype TrackRateArgs = {\r\n\t/**\r\n\t * The unique identifier of an item. In many cases the uniqueId is different than SKU.\r\n\t */\r\n\tuniqueId: string;\r\n\t/**\r\n\t * Represents a user’s rating for an item. The decimal value must be between 1 and 5.\r\n\t */\r\n\tvalue: number;\r\n};\r\n\r\nfunction trackRate({ uniqueId, value }: TrackRateArgs) {\r\n\tconst payload = {\r\n\t\tEventType: CommerceEventTrackingType.rate,\r\n\t\tEventData: preparePayload({\r\n\t\t\tUniqueId: uniqueId,\r\n\t\t\tValue: value,\r\n\t\t}),\r\n\t};\r\n\tmakeRequest(payload);\r\n}\r\n","import { ClientData } from 'models/Search';\r\n\r\nexport class Request {\r\n\t/**\r\n\t * API Client Guid. Usually comes from the \"Tracking Key\" in the \"Account Info\" section of the hawk dashboard.\r\n\t */\r\n\tpublic ClientGuid: string;\r\n\r\n\t/**\r\n\t * Search term entered by a user. If keyword is not included, all items configured to be returned will be\r\n\t * returned. When this parameter is populated, the results will be matched against this term by the search\r\n\t * engine.\r\n\t */\r\n\tpublic Keyword?: string;\r\n\r\n\t/**\r\n\t * This is used by the Hawksearch Preview to set to true will display elements in a preview mode.\r\n\t *\r\n\t * You can use this if you desire additional score information returned.\r\n\t */\r\n\tpublic IsInPreview?: boolean;\r\n\r\n\tpublic Type?: 'Category' | 'Product' | 'Content' | 'Popular';\r\n\r\n\t/** The maximum number of results to return for selected @see Type */\r\n\tpublic ProductCount?: number;\r\n\r\n\t/** Flag set to true will display also full Document object from Elastic for Products and Content suggestions. */\r\n\tpublic DisplayFullResponse?: boolean;\r\n\r\n\t/**\r\n\t * An array of field names that will be returned in the response. If provided, only the fields listed will\r\n\t * be returned. If no FieldOverride value is sent, the Workbench configuration will be used.\r\n\t *\r\n\t * If the Skip from Custom flag is turned “on” for a field, it will not be returned in the response, even if\r\n\t * set in the FieldOverride parameter.\r\n\t */\r\n\tpublic FieldOverride?: string[];\r\n\r\n\t/** Client data. */\r\n\tpublic ClientData?: ClientData;\r\n\tpublic IndexName?: string;\r\n}\r\n","import { Suggestion, SuggestionType, SuggestionStrategy } from './Suggestion';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\n\r\nexport class Category extends Suggestion {\r\n\t/** Display name of category (example: Men » Jackets). */\r\n\tpublic Value: string;\r\n\t/**\r\n\t * URL for displaying contents of the category, ex:\r\n\t * http://dev.hawksearch.net/sites/elasticdemo?department_nest=Jackets_4\r\n\t */\r\n\tpublic Url: string;\r\n\r\n\tpublic constructor(init: Category) {\r\n\t\tsuper(SuggestionType.Category);\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n\r\nexport class CategoryStrategy implements SuggestionStrategy {\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic handleItemChange(item: Category, downshift: ControllerStateAndHelpers): void {\r\n\t\tlocation.assign(item.Url);\r\n\t}\r\n\r\n\tpublic toString(item: Category): string {\r\n\t\treturn item.Value;\r\n\t}\r\n}\r\n","import { Result } from 'models/Search';\r\nimport { Suggestion, SuggestionStrategy, SuggestionType } from './Suggestion';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\n\r\nexport class Product extends Suggestion {\r\n\t/** Name of the item (if applicable). */\r\n\tpublic ProductName: string;\r\n\r\n\t/* Sku of the item (if applicable). */\r\n\tpublic Sku: string;\r\n\r\n\t/** URL of image of the item (if applicable). */\r\n\tpublic Thumb: string;\r\n\r\n\t/** URL of product page (if applicable). */\r\n\tpublic Url: string;\r\n\r\n\t/** HTML to display the item in autocomplete. */\r\n\tpublic Html: string;\r\n\r\n\t/**\r\n\t * This will only be populated if the request parameter @see Request.DisplayFullResponse is sent\r\n\t * as `true`.\r\n\t */\r\n\tpublic Results: Result;\r\n\r\n\tpublic constructor(init: Product) {\r\n\t\tsuper(SuggestionType.Product);\r\n\t\tObject.assign(this, init);\r\n\t\tthis.Results = new Result(init.Results);\r\n\t}\r\n}\r\n\r\nexport class ProductStrategy implements SuggestionStrategy {\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic handleItemChange(item: Product, downshift: ControllerStateAndHelpers): void {\r\n\t\tlocation.assign(item.Url);\r\n\t}\r\n\r\n\tpublic toString(item: Product): string {\r\n\t\treturn item.ProductName;\r\n\t}\r\n}\r\n","import { Result } from 'models/Search';\r\nimport { SuggestionType, Suggestion, SuggestionStrategy } from './Suggestion';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\n\r\nexport class Content extends Suggestion {\r\n\t/** Display label for the content item in Autocomplete. */\r\n\tpublic Value: string;\r\n\r\n\t/** The URL for the link created. */\r\n\tpublic Url: string;\r\n\r\n\t/** URL of image of the item (if applicable). */\r\n\tpublic Thumb: string;\r\n\r\n\t/** The display label in HTML format, if applicable. */\r\n\tpublic Html: string;\r\n\r\n\tpublic Results: Result;\r\n\r\n\tpublic constructor(init: Content) {\r\n\t\tsuper(SuggestionType.Content);\r\n\t\tObject.assign(this, init);\r\n\t\tthis.Results = new Result(init.Results);\r\n\t}\r\n}\r\n\r\nexport class ContentStrategy implements SuggestionStrategy {\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic handleItemChange(item: Content, downshift: ControllerStateAndHelpers): void {\r\n\t\tlocation.assign(item.Url);\r\n\t}\r\n\r\n\tpublic toString(item: Content): string {\r\n\t\treturn item.Value;\r\n\t}\r\n}\r\n","import { SuggestionType, Suggestion, SuggestionStrategy } from './Suggestion';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\n\r\nexport class Popular extends Suggestion {\r\n\t/** Display label for the popular search term. */\r\n\tpublic Value: string;\r\n\r\n\t/** The URL for the link created. */\r\n\tpublic Url: string;\r\n\r\n\tpublic constructor(init: Popular) {\r\n\t\tsuper(SuggestionType.Popular);\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n\r\nexport class PopularStrategy implements SuggestionStrategy {\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic handleItemChange(item: Popular, downshift: ControllerStateAndHelpers): void {\r\n\t\tlocation.assign(item.Url);\r\n\t}\r\n\r\n\tpublic toString(item: Popular): string {\r\n\t\treturn item.Value;\r\n\t}\r\n}\r\n","import { Category } from './Category';\r\nimport { Product } from './Product';\r\nimport { Content } from './Content';\r\nimport { Popular } from './Popular';\r\n\r\nexport class Response {\r\n\t/** Number of products that would be in search results if search was executed. */\r\n\tpublic Count: number;\r\n\t/** Number of content items that would be in search results if search was executed. */\r\n\tpublic ContentCount: number;\r\n\r\n\t/**\r\n\t * Pairs of display values and URLs for matching category names. The number of categories returned\r\n\t * is configured in the Hawksearch Workbench unless overridden by the request parameters.\r\n\t */\r\n\tpublic Categories: Category[];\r\n\r\n\tpublic Products: Product[];\r\n\r\n\t/**\r\n\t * A set of objects for each content item returned. The number returned is configured in the\r\n\t * Hawksearch Workbench > Keyword Search > Auto-complete > Update Top Content.\r\n\t */\r\n\tpublic Content: Content[];\r\n\r\n\t/**\r\n\t * A set of Value and Url for each popular search term. The definition of Popular can be defined in\r\n\t * the Hawksearch Workbench > Keyword Search > Auto-complete > Update Popular Searches.\r\n\t */\r\n\tpublic Popular: Popular[];\r\n\r\n\t/** Search website URL to be used to complete links. */\r\n\tpublic SearchWebsiteUrl: string;\r\n\r\n\t/** The name of the parameter used to pass the keyword entered by user. */\r\n\tpublic KeywordField: string;\r\n\r\n\t/**\r\n\t * Will be included in the response if there are results to display. The `CategoryHeading` contains\r\n\t * the text to display above the list of categories to display in Autocomplete.\r\n\t */\r\n\tpublic CategoryHeading?: string;\r\n\r\n\t/**\r\n\t * Will be included in the response if there are results to display. The `ContentHeading` contains\r\n\t * the text to display above the list of content items to display in Autocomplete.\r\n\t */\r\n\tpublic ContentHeading?: string;\r\n\r\n\t/**\r\n\t * Will be included in the response if there are results to display. The `ProductHeading` contains\r\n\t * the text to display above the list of products to display in Autocomplete.\r\n\t */\r\n\tpublic ProductHeading?: string;\r\n\r\n\t/**\r\n\t * Will be included in the response if there are results to display. The `PopularHeading` contains\r\n\t * the text to display above the list of popular search terms to display in Autocomplete.\r\n\t */\r\n\tpublic PopularHeading?: string;\r\n\r\n\t/**\r\n\t * Will be included in the response if there are results to display. The `ViewAllButtonLabel` contains\r\n\t * the text to display for the link to return all results from searching with the term entered.\r\n\t */\r\n\tpublic ViewAllButtonLabel?: string;\r\n\r\n\tpublic constructor(init: Response) {\r\n\t\tObject.assign(this, init);\r\n\r\n\t\tthis.Categories = init.Categories.map((r) => new Category(r));\r\n\t\tthis.Products = init.Products.map((r) => new Product(r));\r\n\t\tthis.Popular = init.Popular.map((r) => new Popular(r));\r\n\t\tthis.Content = init.Content.map((r) => new Content(r));\r\n\t}\r\n}\r\n","// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\r\n(function () {\r\n\tif (typeof window.CustomEvent === 'function') {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction CustomEvent(event, params) {\r\n\t\tparams = params || { bubbles: false, cancelable: false, detail: undefined };\r\n\t\t// eslint-disable-next-line\r\n\t\tvar evt = document.createEvent('CustomEvent');\r\n\t\tevt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\r\n\t\treturn evt;\r\n\t}\r\n\r\n\tCustomEvent.prototype = window.Event.prototype;\r\n\r\n\twindow.CustomEvent = CustomEvent;\r\n})();\r\n","export class Pagination {\r\n\t/** Number of total items in the result set. */\r\n\tpublic NofResults: number;\r\n\r\n\t/** The page number returned. */\r\n\tpublic CurrentPage: number;\r\n\r\n\t/** The number of items returned for the page. */\r\n\tpublic MaxPerPage: number;\r\n\r\n\t/** The total number of pages for the result set - with the current @see MaxPerPage. */\r\n\tpublic NofPages: number;\r\n\r\n\t/** Set of pagination options */\r\n\tpublic Items: PaginationItem[];\r\n\r\n\tpublic constructor(init: Pagination) {\r\n\t\tObject.assign(this, init);\r\n\r\n\t\tthis.Items = init.Items.map((i) => new PaginationItem(i));\r\n\t}\r\n}\r\n\r\nexport class PaginationItem {\r\n\t/** Display label for user's pagination option (i.e. 24 per page). */\r\n\tpublic Label: string;\r\n\r\n\t/** The maximum number of items that will be returned per page when this option is selected. */\r\n\tpublic PageSize: number;\r\n\r\n\t/** Indicates if this is the option selected. Only one pagination item will have this set to `true`. */\r\n\tpublic Selected: boolean;\r\n\r\n\t/** Indicates if this is the default option. Only one pagination item will have this set to `true`. */\r\n\tpublic Default: boolean;\r\n\r\n\tpublic constructor(init: PaginationItem) {\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n","import { Explain } from './Explain';\r\n\r\nexport class Result {\r\n\t/** Unique identifier for this search result item. */\r\n\tpublic DocId: string;\r\n\r\n\t/** Calculated relevancy score. */\r\n\tpublic Score: number;\r\n\r\n\t/**\r\n\t * Contains the fields for the search result item, as an object of string keys to an array\r\n\t * of string values. The keys correspond to the name of the field within the hawk dashboard,\r\n\t * and the value of the map is an array of strings for each of the values for that field.\r\n\t */\r\n\tpublic Document?: { [field: string]: string[] };\r\n\r\n\tpublic Explain?: Explain;\r\n\r\n\tpublic IsPin: boolean;\r\n\r\n\tpublic BestFragment: string;\r\n\r\n\t/**\r\n\t * Returns a single document value, by the given field name. If the field does not exist in\r\n\t * the document, or has no values, then `undefined` is returned instead.\r\n\t * @param field The field within the result document to retrieve the value of.\r\n\t */\r\n\tpublic getDocumentValue(field: string): string | undefined {\r\n\t\tif (this.Document) {\r\n\t\t\tconst values = this.Document[field];\r\n\r\n\t\t\tif (values && values.length > 0) {\r\n\t\t\t\treturn values[0];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn undefined;\r\n\t}\r\n\r\n\t// #region HCL\r\n\tpublic setDocumentValue(field: string, value: string) {\r\n\t\tif (this.Document) {\r\n\t\t\tconst values = this.Document[field];\r\n\r\n\t\t\tif (values && values.length > 0) {\r\n\t\t\t\tvalues[0] = value;\r\n\t\t\t} else {\r\n\t\t\t\tthis.Document[field] = [];\r\n\t\t\t\tthis.Document[field].push(value);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tpublic getDocumentValues(field: string): string[] | undefined {\r\n\t\tif (this.Document) {\r\n\t\t\tconst values = this.Document[field];\r\n\r\n\t\t\tif (values && values.length > 0) {\r\n\t\t\t\treturn values;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn undefined;\r\n\t}\r\n\t// #endregion\r\n\r\n\tpublic constructor(init: Result) {\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n","export class Sorting {\r\n\t/** The sorting items. */\r\n\tpublic Items: SortingItem[];\r\n\r\n\tpublic constructor(init: Sorting) {\r\n\t\tObject.assign(this, init);\r\n\r\n\t\tthis.Items = init.Items.map((i) => new SortingItem(i));\r\n\t}\r\n}\r\n\r\nexport class SortingItem {\r\n\t/** Name of the sorting option. This is the label to display to users. */\r\n\tpublic Label: string;\r\n\r\n\t/**\r\n\t * The value to be used to specify the sort order once user selects it. This value is passed in the @see Request.SortBy\r\n\t * field in the @see Request object.\r\n\t */\r\n\tpublic Value: string;\r\n\r\n\t/** Indicates if this sorting option was configured to be the default. */\r\n\tpublic IsDefault: boolean;\r\n\r\n\t/** Indicates if this sorting option is currently being used for the current result set. */\r\n\tpublic Selected: boolean;\r\n\r\n\tpublic constructor(init: SortingItem) {\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n","export class Selections {\r\n\t// You may get build errors if you are using react hot loader because of this indexer. If this file is listed as a culprit and you don't know why, this is likely the reason.\r\n\t[field: string]: SelectionFacet;\r\n\r\n\tpublic constructor(init: Selections) {\r\n\t\tObject.assign(this, init);\r\n\r\n\t\tObject.keys(init).forEach((key) => {\r\n\t\t\tconst selFacet = init[key];\r\n\r\n\t\t\tthis[key] = new SelectionFacet(selFacet);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport class SelectionFacet {\r\n\t/** Display name for facet. */\r\n\tpublic Label: string;\r\n\r\n\t/** Will contain an entry for each selection made within the facet. */\r\n\tpublic Items: SelectionFacetValue[];\r\n\r\n\tpublic constructor(init: SelectionFacet) {\r\n\t\tObject.assign(this, init);\r\n\r\n\t\tthis.Items = init.Items.map((i) => new SelectionFacetValue(i));\r\n\t}\r\n}\r\n\r\nexport class SelectionFacetValue {\r\n\t/** Display label for facet value. */\r\n\tpublic Label: string;\r\n\r\n\t/** Value for facet value. */\r\n\tpublic Value: string;\r\n\r\n\tpublic constructor(init: SelectionFacetValue) {\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n","export class Value {\r\n\t/** Label of the value to display. */\r\n\tpublic Label?: string;\r\n\t/** Value to use when setting the facet value selection. */\r\n\tpublic Value?: string;\r\n\r\n\t/** Number of results in current set that have this facet value. */\r\n\tpublic Count: number;\r\n\t/** Indicates if this facet value has been selected. */\r\n\tpublic Selected: boolean;\r\n\r\n\t/**\r\n\t * Used for displaying the slider facet. @see RangeStart indicates what the starting point of the range\r\n\t * to display, either on basis of what the user selected by sliding the slider, or if they have no\r\n\t * selection it reflects the lowest price product.\r\n\t */\r\n\tpublic RangeStart?: string;\r\n\t/**\r\n\t * Used for displaying the slider facet. @see RangeEnd indicates what the end point of the range to\r\n\t * display is, either on basis of what the user selected by sliding the slider, or if they have no\r\n\t * selection, it reflects the highest price product.\r\n\t */\r\n\tpublic RangeEnd?: string;\r\n\r\n\t/**\r\n\t * Used for displaying the slider facet. @see RangeMin indicates lowest value for the range in the list\r\n\t * of products displayed.\r\n\t */\r\n\tpublic RangeMin?: string;\r\n\t/**\r\n\t * Used for displaying the slider facet. @see RangeMax indicates highest value for the range in the list\r\n\t * of products displayed.\r\n\t */\r\n\tpublic RangeMax?: string;\r\n\r\n\t/** Used for nested facets. */\r\n\tpublic Path?: string;\r\n\r\n\t/** Set of pagination options */\r\n\tpublic Children: Value[];\r\n\r\n\tpublic Level: number;\r\n\r\n\tpublic constructor(init: Value) {\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n","export class Swatch {\r\n\t/** Match this value to the @see Value object in the @see Values array of @see Facet. */\r\n\tpublic Value: string;\r\n\r\n\t/** Name of the asset. */\r\n\tpublic AssetName: string;\r\n\t/** URL of the asset. */\r\n\tpublic AssetUrl: string;\r\n\r\n\t/** Indicates if value is the default. */\r\n\tpublic IsDefault: boolean;\r\n\r\n\t/** Color of the asset. */\r\n\tpublic Color: string;\r\n\r\n\tpublic constructor(init: Swatch) {\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n","export class Range {\r\n\t/** Label of the value to display. */\r\n\tpublic Label: string;\r\n\t/** Value to use when setting the facet value selection. */\r\n\tpublic Value: string;\r\n\r\n\t/** Indicates if the values are numeric. */\r\n\tpublic IsNumeric: boolean;\r\n\r\n\t/** Lower value of the range. */\r\n\tpublic LBound: string;\r\n\t/** Upper value of the range. */\r\n\tpublic UBound: string;\r\n\t/** Asset Url */\r\n\tpublic AssetFullUrl: string;\r\n\r\n\tpublic constructor(init: Range) {\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n","import { Value } from './Value';\r\nimport { Swatch } from './Swatch';\r\nimport { Range } from './Range';\r\nimport { FacetType } from 'models/Facets/FacetType';\r\n\r\nexport class Facet {\r\n\t/** Unique identifier of the facet. */\r\n\tpublic FacetId: number;\r\n\r\n\t/** Display name of the facet. */\r\n\tpublic Name: string;\r\n\r\n\t/** The name of the field that is linked to this facet. */\r\n\tpublic Field: string;\r\n\r\n\t/** The name of the field that is linked to this facet. */\r\n\tpublic FieldType: 'string' | 'range' | 'numeric' | 'search' | 'tab';\r\n\r\n\t/** The type of facet. This dictates the appearance and behavior of this instance and is partially restricted by @see FieldType */\r\n\tpublic FacetType: FacetType;\r\n\r\n\t/** The Display Type controls how many options your users can see when they search and how they are able to access them. */\r\n\tpublic DisplayType: 'default' | 'scrolling' | 'truncating';\r\n\r\n\t/** Indicates the maximum number of facet values that are returned. */\r\n\tpublic MaxCount: number;\r\n\r\n\t/** Indicates the minimum number of results each facet value needs to have in order to be returned. */\r\n\tpublic MinHitCount: number;\r\n\r\n\t/**\r\n\t * If this is set, it is to be used as the facet name if passed in the `FacetSelections`. If not set,\r\n\t * the value of the Field object would be used. (This is only applicable when a slider and range\r\n\t * facets are both configured for the same field.)\r\n\t */\r\n\tpublic ParamName?: string;\r\n\r\n\t/**\r\n\t * Indicates the sorting logic that is used for this facet’s values. The possible values for this\r\n\t * are the parameters for sorting set options that are configured in \"Workbench > Data Configuration\r\n\t * > Sorting/Pagination\".\r\n\t */\r\n\tpublic SortBy: string;\r\n\r\n\t/** Indicates if the user should be able to apply more than one filter value from this facet. */\r\n\tpublic ExpandSelection: boolean;\r\n\r\n\t/** Indicates if facet values are numeric. */\r\n\tpublic IsNumeric: boolean;\r\n\r\n\t/** Indicates if facet values are currency (and should be displayed appropriately). */\r\n\tpublic IsCurrency: boolean;\r\n\r\n\t/** Indicates currency symbol in case of currency type facets */\r\n\tpublic CurrencySymbol: string;\r\n\r\n\t/** Indicates if the facet can be collapsed and expanded by the user. */\r\n\tpublic IsCollapsible: boolean;\r\n\r\n\t/** If @see IsCollapsible is `true`, this indicates if the facet should initially be collapsed or expanded. */\r\n\tpublic IsCollapsedDefault: boolean;\r\n\r\n\t/** Indicates if the facet is set to be visible. */\r\n\tpublic IsVisible: boolean;\r\n\r\n\t/**\r\n\t * Indicates if search is enabled for this facet. If it is enabled, a search box should be available for\r\n\t * users to filter the facet values by typing in the search box.\r\n\t */\r\n\tpublic IsSearch: boolean;\r\n\r\n\t/**\r\n\t * If facet display type is Scrolling, this value is the height in pixels for the window inside scroll box.\r\n\t * Only to be used if @see DisplayType is `\"scrolling\"`.\r\n\t */\r\n\tpublic ScrollHeight: number;\r\n\r\n\t/**\r\n\t * If the number of facet values exceeds this number and @see DisplayType is `\"scrolling\"`, then the facet\r\n\t * should be displayed as scrolling list; if not, display as `\"default\"`.\r\n\t */\r\n\tpublic ScrollThreshold: number;\r\n\r\n\t/**\r\n\t * If the number of facet values exceeds this number and @see DisplayType is `\"truncate\"`, then the facet\r\n\t * should be displayed as truncated list; if not, display as `\"default\"`.\r\n\t */\r\n\tpublic TruncateThreshold: number;\r\n\r\n\t/**\r\n\t * To be used if @see IsSearch is `true`. The number of facet values must be this number or higher for the\r\n\t * facet search box to display.\r\n\t */\r\n\tpublic SearchThreshold: number;\r\n\r\n\t/** Text to display when user hovers over a help icon. */\r\n\tpublic Tooltip?: string;\r\n\r\n\t/**\r\n\t * If `false`, indicates that sometimes this facet will not be returned. The conditions that trigger its\r\n\t * display are maintained in the Workbench.\r\n\t */\r\n\tpublic AlwaysVisible: boolean;\r\n\r\n\t/**\r\n\t * The display order of the facet in the facet list.\r\n\t */\r\n\tpublic SortOrder: number;\r\n\r\n\t/** This is maximum number of values that could be returned for the facet. */\r\n\tpublic NofVisible: number;\r\n\r\n\t/** Will be included if @see FacetType is `\"swatch\"`. */\r\n\tpublic SwatchData?: Swatch[];\r\n\r\n\t/** Indicates type of facet range display. */\r\n\tpublic FacetRangeDisplayType: number;\r\n\r\n\t/** Indicates if setting in Workbench is set to On or Off. */\r\n\tpublic PreloadChildren: boolean;\r\n\r\n\t/**\r\n\t * To be used if @see FacetType is `\"slider\"`. If @see ShowSliderInputs is `true`, input boxes should be\r\n\t * available for user to enter values.\r\n\t */\r\n\tpublic ShowSliderInputs: boolean;\r\n\r\n\t/** Always present, but will only be populated if the facet is numeric and not a slider. */\r\n\tpublic Ranges: Range[];\r\n\r\n\t/** The values for this facet. */\r\n\tpublic Values: Value[];\r\n\r\n\t/** Whether or not the facet should be rendered as truncated. */\r\n\tpublic get shouldTruncate() {\r\n\t\t// the facet does truncated listing of values if configured for truncating and we have too many facets\r\n\t\treturn this.DisplayType === 'truncating' && this.Values.length > this.TruncateThreshold;\r\n\t}\r\n\r\n\t/** Whether or not the facet should have a quick lookup search input. */\r\n\tpublic get shouldSearch() {\r\n\t\t// the facet should have a search box if configured to do so, and the number of facet values is greater\r\n\t\t// than the threshold\r\n\t\treturn this.IsSearch && this.Values.length > this.SearchThreshold;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the name of the key when using this facet for a selection. This will take into consideration\r\n\t * @see ParamName and @see Field in determining which value should be returned.\r\n\t */\r\n\tpublic get selectionField() {\r\n\t\treturn this.ParamName ? this.ParamName : this.Field;\r\n\t}\r\n\r\n\tpublic constructor(init: Facet) {\r\n\t\tObject.assign(this, init);\r\n\r\n\t\tthis.SwatchData = init.SwatchData ? init.SwatchData.map((s) => new Swatch(s)) : [];\r\n\t\tthis.Ranges = init.Ranges.map((r) => new Range(r));\r\n\t\tthis.Values = init.Values.map((v) => new Value(v));\r\n\t}\r\n}\r\n","export class Rule {\r\n\tpublic RuleType: RuleType;\r\n\tpublic Field: string;\r\n\tpublic Condition: string;\r\n\tpublic Value: string;\r\n\tpublic Operator: RuleOperatorType;\r\n\r\n\tpublic Rules: Rule[];\r\n\tpublic Parent: Rule;\r\n\tpublic constructor(init: Rule) {\r\n\t\tObject.assign(this, init);\r\n\t\tif (init.Parent) {\r\n\t\t\tthis.Parent = new Rule(init.Parent);\r\n\t\t}\r\n\t\tthis.Rules = init.Rules ? init.Rules.map((i) => new Rule(i)) : [];\r\n\t}\r\n}\r\n\r\nexport enum RuleType {\r\n\tGroup = 0,\r\n\tEval = 1,\r\n}\r\n\r\nexport enum RuleOperatorType {\r\n\tAll = 0,\r\n\tAny = 1,\r\n\tNone = 2,\r\n}\r\n","import { Rule } from './Rule';\r\n\r\nexport class BannerTrigger {\r\n\tpublic BannerGroupId: number;\r\n\tpublic Name: string;\r\n\tpublic SortOrder: number;\r\n\tpublic Rule: Rule;\r\n\r\n\tpublic constructor(init: BannerTrigger) {\r\n\t\tObject.assign(this, init);\r\n\r\n\t\tthis.Rule = new Rule(this.Rule);\r\n\t}\r\n}\r\n","import { ContentType } from './ContentType';\r\nimport { Result } from './Result';\r\nimport { BannerTrigger } from './Trigger';\r\n\r\nexport class FeaturedItems {\r\n\tpublic Items: FeaturedItem[];\r\n\r\n\tpublic constructor(init: FeaturedItems) {\r\n\t\tObject.assign(this, init);\r\n\t\tif (init && init.Items) {\r\n\t\t\tthis.Items = init.Items.map((i) => new FeaturedItem(i));\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport class Merchandising {\r\n\tpublic Items: MerchandisingItem[];\r\n\r\n\tpublic constructor(init: Merchandising) {\r\n\t\tObject.assign(this, init);\r\n\t\tif (init && init.Items) {\r\n\t\t\tthis.Items = init.Items.map((i) => new MerchandisingItem(i));\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport class PageContentItem {\r\n\tpublic Zone: string;\r\n\tpublic ContentType: ContentType;\r\n\tpublic ImageUrl: string;\r\n\tpublic AltTag: string;\r\n\tpublic ForwardUrl: string;\r\n\tpublic Output: any;\r\n\tpublic WidgetArgs: string;\r\n\tpublic Title: string;\r\n\tpublic Name: string;\r\n\tpublic DateFrom: string;\r\n\tpublic DateTo: string;\r\n\tpublic IsMobile: boolean;\r\n\tpublic MobileContentType: string;\r\n\tpublic MobileImageUrl: string;\r\n\tpublic MobileOutput: string;\r\n\tpublic MobileWidgetArgs: string;\r\n\tpublic IsTrackingEnabled: boolean;\r\n\tpublic MobileIsTrackingEnabled?: boolean;\r\n\tpublic FeaturedItems: Result[];\r\n\tpublic Items: Result[];\r\n\tpublic Target: string;\r\n\tpublic MobileTarget: string;\r\n\tpublic MobileAltTag: string;\r\n\tpublic MobileForwardUrl: string;\r\n\tpublic MobileWidth: string;\r\n\tpublic MobileHeight: string;\r\n\tpublic Trigger: BannerTrigger;\r\n\r\n\tpublic constructor(init: PageContentItem) {\r\n\t\tObject.assign(this, init);\r\n\t\tif (init.FeaturedItems) {\r\n\t\t\tthis.FeaturedItems = init.FeaturedItems.map((i) => new Result(i));\r\n\t\t}\r\n\t\tif (init.Trigger) {\r\n\t\t\tthis.Trigger = new BannerTrigger(init.Trigger);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport class FeaturedItem extends PageContentItem {\r\n\tpublic Items: Result[];\r\n\r\n\tpublic constructor(init: FeaturedItem) {\r\n\t\tsuper(init);\r\n\t\tObject.assign(this, init);\r\n\t\tthis.Items = init.Items.map((i) => new Result(i));\r\n\t}\r\n}\r\n\r\nexport class MerchandisingItem extends PageContentItem {\r\n\tpublic constructor(init: MerchandisingItem) {\r\n\t\tsuper(init);\r\n\t\tObject.assign(this, init);\r\n\t}\r\n}\r\n","import { PageContentItem } from './Merchandising';\r\n\r\nexport class PageContent {\r\n\tpublic ZoneName: string;\r\n\r\n\tpublic Items: PageContentItem[];\r\n\r\n\tpublic constructor(init: PageContent) {\r\n\t\tObject.assign(this, init);\r\n\t\tthis.Items = init.Items.map((i) => new PageContentItem(i));\r\n\t}\r\n}\r\n","import { Pagination } from './Pagination';\r\nimport { Result } from './Result';\r\nimport { Sorting } from './Sorting';\r\nimport { Selections } from './Selections';\r\nimport { Facet } from 'models/Facets';\r\nimport { Merchandising, FeaturedItems } from './Merchandising';\r\nimport { PageContent } from './PageContent';\r\n\r\nexport class Response {\r\n\t/** Indicates if request was successful. */\r\n\tpublic Success: boolean;\r\n\r\n\t/** Summary of pagination details and a set of pagination options. */\r\n\tpublic Pagination: Pagination;\r\n\r\n\t/**\r\n\t * The Keyword value that was sent to Hawksearch in the request. If no Keyword was set in the\r\n\t * request, the value will be empty.\r\n\t */\r\n\tpublic Keyword: string;\r\n\r\n\t/**\r\n\t * If this is populated, it indicates that the Keyword value returned 0 results, but the results\r\n\t * in this response are from this AdjustedKeyword. A message should be displayed to the user\r\n\t * informing them that their search was corrected to this string.\r\n\t *\r\n\t * This is the result of Auto Correct, which is configured in the Workbench > Keyword Search >\r\n\t * Did You Mean.\r\n\t */\r\n\tpublic AdjustedKeyword?: string;\r\n\r\n\t/** An entry in the array for each item returned in search results. */\r\n\tpublic Results: Result[];\r\n\r\n\tpublic Facets: Facet[];\r\n\r\n\t/**\r\n\t * Will contain an entry for each facet that has one or more selections. Will be empty if no facet\r\n\t * selections have been made.\r\n\t */\r\n\tpublic Selections: Selections;\r\n\r\n\tpublic Sorting: Sorting;\r\n\r\n\t/**\r\n\t * If any strings are returned in the array, they should be displayed to the user as suggested\r\n\t * search terms.\r\n\t *\r\n\t * This is the result of Did You Mean, which is configured in the Workbench > Keyword Search >\r\n\t * Did You Mean.\r\n\t */\r\n\tpublic DidYouMean: string[];\r\n\r\n\t/**\r\n\t * Merchandising can be placed by using Campaigns in the Hawksearch Workbench. The Campaign will\r\n\t * determine if the content should appear and in what zone.\r\n\t */\r\n\tpublic Merchandising: Merchandising;\r\n\tpublic FeaturedItems: FeaturedItems;\r\n\r\n\tpublic SearchDuration: number;\r\n\r\n\tpublic DocExplain?: string;\r\n\r\n\t/**\r\n\t * Properties that gets populated when user requests landing page related results\r\n\t *\r\n\t */\r\n\r\n\tpublic Breadcrumb: string;\r\n\r\n\tpublic CustomHtml: string;\r\n\r\n\tpublic HeaderTitle: string;\r\n\r\n\tpublic MetaDescription: string;\r\n\r\n\tpublic MetaKeywords: string;\r\n\tpublic MetaRobots: string;\r\n\tpublic Name: string;\r\n\tpublic Next: string;\r\n\tpublic Prev: string;\r\n\tpublic PageHeading: string;\r\n\tpublic PageContent: PageContent[];\r\n\tpublic RelCanonical: string;\r\n\tpublic PageLayoutId: number;\r\n\tpublic TrackingId: string;\r\n\t// end of landing page related fields\r\n\r\n\tpublic constructor(init: Response) {\r\n\t\tObject.assign(this, init);\r\n\r\n\t\tthis.Pagination = new Pagination(init.Pagination);\r\n\t\tthis.Merchandising = new Merchandising(init.Merchandising);\r\n\t\tthis.FeaturedItems = new FeaturedItems(init.FeaturedItems);\r\n\t\tthis.Results = init.Results.map((r) => new Result(r));\r\n\t\tthis.Facets = init.Facets.map((f) => new Facet(f));\r\n\t\tthis.PageContent = init.PageContent ? init.PageContent.map((p) => new PageContent(p)) : [];\r\n\t\tthis.Selections = new Selections(init.Selections);\r\n\t\tthis.Sorting = new Sorting(init.Sorting);\r\n\t}\r\n}\r\n","/** An object that contains the data related to the client making search or autosuggest requests. */\r\nexport class ClientData {\r\n\t/** Unique identifier used for tracking visitors. */\r\n\tpublic VisitorId: string;\r\n\r\n\t/** Custom information used for evaluating Visitor Targets. */\r\n\tpublic Custom?: string;\r\n\r\n\t/** Client IP used for evaluating Visitor Targets. */\r\n\tpublic HttpTrueClientIp?: string;\r\n\r\n\t/** Browser user agent used for evaluating Visitor Targets. */\r\n\tpublic UserAgent?: string;\r\n\r\n\tpublic PreviewBuckets?: number[];\r\n\r\n\t/**\r\n\t * The source used for evaluating Visitor Targets. This was previously called 'hawksource' and can\r\n\t * be used to track the source the user came from (i.e. email, instagram, etc).\r\n\t */\r\n\tpublic Source?: string;\r\n}\r\n","export enum ContentType {\r\n\tImage = 'image',\r\n\tWidget = 'widget',\r\n\tFeatured = 'featured',\r\n\tCustom = 'custom',\r\n\tLandingPage = 'landingPage',\r\n}\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Spinner SVG for loading purposes\r\n *\r\n * @returns\r\n */\r\nfunction MagnifyingGlassSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default MagnifyingGlassSVG;\r\n","// These functions may be potentially innaccurate in certain locales that use differing amounts of characters in different cases\r\n\r\n/**\r\n * Tests if a string includes another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyIncludes(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().includes(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string starts with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyStartsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().startsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string ends with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyEndsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().endsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToUpper(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleUpperCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToLower(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleLowerCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n// https://github.com/uxitten/polyfill/blob/master/string.polyfill.js\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart\r\nexport function padStart(value, targetLength, padString) {\r\n\t// tslint:disable-next-line:no-bitwise\r\n\ttargetLength = targetLength >> 0; // truncate if number, or convert non-number to 0;\r\n\tpadString = String(typeof padString !== 'undefined' ? padString : ' ');\r\n\tif (value.length >= targetLength) {\r\n\t\treturn String(value);\r\n\t} else {\r\n\t\ttargetLength = targetLength - value.length;\r\n\t\tif (targetLength > padString.length) {\r\n\t\t\tpadString += padString.repeat(targetLength / padString.length); // append to original to ensure we are longer than needed\r\n\t\t}\r\n\t\treturn padString.slice(0, targetLength) + String(value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts a string from \" Something Like This\" to \"something-like-this\"\r\n * @param value The string to convert\r\n */\r\nexport function toKebabCase(value: string) {\r\n\tif (!value || !value.trim()) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn value\r\n\t\t.trim()\r\n\t\t.replace(/[^a-zA-Z0-9]+/g, '-')\r\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\r\n\t\t.replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2')\r\n\t\t.replace(/-$/, '')\r\n\t\t.toLocaleLowerCase();\r\n}\r\n\r\n/**\r\n * Converts a string from PascalCase, camelCase, snake_case, or space separated to camelCase. Beginning and trailing whitespace are trimmed.\r\n * @param value The string to convert\r\n */\r\nexport function toCamelCase(value: string) {\r\n\treturn value\r\n\t\t.replace(/(?:^\\w|[A-Z]|\\b\\w)/g, function (word, index) {\r\n\t\t\treturn index === 0 ? word.toLowerCase() : word.toUpperCase();\r\n\t\t})\r\n\t\t.replace(/(?:\\s+|[-_])/g, '');\r\n}\r\n\r\n/**\r\n * Removes html characters\r\n *\r\n * @export\r\n * @param {*} html\r\n * @returns\r\n */\r\nexport function stripHtml(html) {\r\n\tconst tmp = document.createElement('div');\r\n\ttmp.innerHTML = html;\r\n\treturn tmp.textContent || tmp.innerText || '';\r\n}\r\n\r\n/**\r\n * Cuts of text and adds ellipsis (...) after a certain number of characters\r\n * @param text The text to format\r\n * @param cutoff The number of characters to add the ellipsis after\r\n */\r\nexport function addEllipsis(text: string, cutoff: number = 20) {\r\n\tif (!text || text.length < cutoff) {\r\n\t\treturn text;\r\n\t}\r\n\r\n\treturn text.substring(0, cutoff) + '...';\r\n}\r\n\r\n/**\r\n * Trims a string value\r\n */\r\nexport function trimString(value: string) {\r\n\treturn value ? value.trim() : '';\r\n}\r\n","import { CancelToken } from 'axios';\r\nimport { Request as AutocompleteRequest, Response as AutocompleteResponse } from 'models/Autocomplete';\r\nimport { Request as CompareItemRequest, Response as CompareDataResponse } from 'models/CompareItems';\r\nimport { Request as SearchRequest, Response as SearchResponse } from 'models/Search';\r\nimport { HawkSearchConfig } from 'types/HawkSearchConfig';\r\nimport * as Constants from 'util/Constants';\r\nimport AxiosHelper from '../../../../services/AxiosHelper';\r\nimport { Request as RecommendationRequest, Response as RecommendationResponse } from '../models/Recommendation';\r\n\r\nclass HawkClient {\r\n\tprivate baseUrl: string;\r\n\tprivate searchUrl: string;\r\n\tprivate dashboardUrl: string;\r\n\tprivate autocompleteUrl: string;\r\n\tprivate compareItemsURL: string;\r\n\tprivate recommendationUrl: string;\r\n\tprivate recommendationWidgetUrl: string;\r\n\t// #region HCL\r\n\tprivate enableRemovingDashesFromSearchKeyword: boolean;\r\n\t// #endregion\r\n\r\n\tconstructor(config: HawkSearchConfig) {\r\n\t\tthis.baseUrl = config.apiUrl || Constants.defaultApiUrl;\r\n\t\tthis.dashboardUrl = config.dashboardUrl || Constants.defaultDashboardUrl;\r\n\t\tthis.searchUrl = config.searchUrl || Constants.defaultSearchUrl;\r\n\t\tthis.autocompleteUrl = config.autocompleteUrl || Constants.defaultAutocompleteUrl;\r\n\t\tthis.recommendationUrl = config.recommendationUrl || Constants.defaultRecommendationUrl;\r\n\t\tthis.recommendationWidgetUrl = config.recommendationWidgetUrl || Constants.recommendationWidgetUrl;\r\n\t\t/* #region Commerce */\r\n\t\tthis.compareItemsURL = config.compareItemsURL || Constants.defaultCompareItemsURL;\r\n\t\t/* #endregion */\r\n\t\t/* #region HCL */\r\n\t\tthis.enableRemovingDashesFromSearchKeyword =\r\n\t\t\tconfig.enableRemovingDashesFromSearchKeyword || Constants.enableRemovingDashesFromSearchKeyword;\r\n\t\t/* #endregion */\r\n\t}\r\n\r\n\t// #region HCL\r\n\tpublic async search(request: SearchRequest, cancellationToken?: CancelToken): Promise {\r\n\t\tconst result = await AxiosHelper.post(\r\n\t\t\t'/ajax/hawksearch/search',\r\n\t\t\t{ request },\r\n\t\t\t{ cancelToken: cancellationToken },\r\n\t\t);\r\n\r\n\t\treturn result.data;\r\n\t}\r\n\r\n\tpublic async autocomplete(\r\n\t\trequest: AutocompleteRequest,\r\n\t\tcancellationToken?: CancelToken,\r\n\t): Promise {\r\n\t\tconst result = await AxiosHelper.post(\r\n\t\t\t'/ajax/hawksearch/autocomplete',\r\n\t\t\t{ request },\r\n\t\t\t{ cancelToken: cancellationToken },\r\n\t\t);\r\n\r\n\t\treturn result.data;\r\n\t}\r\n\r\n\tpublic async getComparedItems(\r\n\t\trequest: CompareItemRequest,\r\n\t\tcancellationToken?: CancelToken,\r\n\t): Promise {\r\n\t\tconst result = await AxiosHelper.post(\r\n\t\t\t'/ajax/hawksearch/compare',\r\n\t\t\t{ request },\r\n\t\t\t{ cancelToken: cancellationToken },\r\n\t\t);\r\n\r\n\t\treturn result.data;\r\n\t}\r\n\r\n\tpublic async getRecommendationWidgetItems(\r\n\t\trequest: RecommendationRequest,\r\n\t\tcancellationToken?: CancelToken,\r\n\t): Promise {\r\n\t\tconst result = await AxiosHelper.post(\r\n\t\t\t'/ajax/hawksearch/recommendation',\r\n\t\t\t{ request },\r\n\t\t\t{ cancelToken: cancellationToken },\r\n\t\t);\r\n\r\n\t\treturn result.data;\r\n\t}\r\n\t// #endregion\r\n}\r\n\r\nexport default HawkClient;\r\n","/**\r\n * Returns the input string without dashes if the input matches this regex /^[A-Za-z0-9]{0,7}-[A-Za-z0-9]{0,7}$/.\r\n * The regex should be validated so the string contains at most 7 characters before the dash & Matches at most 7 characters after the dash\r\n */\r\n\r\nexport function validateQueryAndRemoveDash(inputString) {\r\n\t// Matches at most 7 characters before the dash & Matches at most 7 characters after the dash\r\n\tconst regex = /^[A-Za-z0-9]{0,7}-[A-Za-z0-9]{0,7}$/;\r\n\r\n\tif (regex.test(inputString)) {\r\n\t\treturn inputString.replace('-', '');\r\n\t}\r\n\r\n\treturn inputString;\r\n}\r\n","import { ExternalLoginProvider } from 'features/login/ExternalLogins';\r\n\r\n/**\r\n * Extends Window with a property that will hold the client data\r\n *\r\n * @interface WindowWithClientData\r\n * @extends {Window}\r\n */\r\ninterface WindowWithServerData extends Window {\r\n\t__ROC_SERVER_DATA__?: Array<{\r\n\t\t[name: string]: string;\r\n\t}>;\r\n}\r\n\r\n/**\r\n * This type will hold all the keys that are used by ServerData\r\n */\r\ninterface ServerData {\r\n\tIsReCaptchaEnabled?: boolean;\r\n\tReCaptchaV3Key?: string;\r\n\tTimeZone?: string;\r\n\tUSE_EMAIL_AS_USERNAME?: boolean;\r\n\tRegistrationThankYouTitle?: string;\r\n\tRegistrationThankYouMessage?: string;\r\n\tForgotPasswordConfirmationTitle?: string;\r\n\tForgotPasswordConfirmationMessage?: string;\r\n\tPageTitleSuffix?: string;\r\n\tRequireConfirmEmail?: boolean;\r\n\tACCOUNT_URL_BASE?: string;\r\n\tACCOUNT_LOGIN_URL?: string;\r\n\tACCOUNT_LOGOUT_URL?: string;\r\n\tACCOUNT_REGISTER_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_2FA_URL?: string;\r\n\tACCOUNT_FORGOT_PASSWORD_URL?: string;\r\n\tACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL?: string;\r\n\tEXTERNAL_LOGIN_PROVIDERS?: ExternalLoginProvider[];\r\n\t// #region Commerce\r\n\tACCOUNT_ORGANIZATION_REVIEW_URL?: string;\r\n\tACCOUNT_ORGANIZATION_SELECTOR_URL?: string;\r\n\tGoogleMapsApiKey?: string; // used in Store Locator\r\n\tMinimumTimeBeforeRecentlyViewedProductsAreValidated?: number;\r\n\tQuickOrderItemMinumumSearchCharacters?: number;\r\n\tMaxAllowedQuickOrderItems?: number;\r\n\tMaxNumberForQuantityDropdown?: number;\r\n\tOrderDetailsUIComponent?: string;\r\n\tGuestCheckoutEnabled?: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Main object that will hold all the client data\r\n */\r\nexport const ServerData: ServerData = {};\r\n\r\n/**\r\n * Initializer function that will populate the main settings object\r\n */\r\nfunction initializeServerData() {\r\n\tconst windowWithServerData = window as WindowWithServerData;\r\n\r\n\tif (\r\n\t\twindowWithServerData &&\r\n\t\twindowWithServerData.__ROC_SERVER_DATA__ &&\r\n\t\tArray.isArray(windowWithServerData.__ROC_SERVER_DATA__)\r\n\t) {\r\n\t\tfor (const obj of windowWithServerData.__ROC_SERVER_DATA__) {\r\n\t\t\tfor (const key of Object.keys(obj)) {\r\n\t\t\t\tServerData[key] = obj[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\ninitializeServerData();\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Question Mark within a Circle SVG\r\n */\r\nfunction QuestionMarkCircleSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default QuestionMarkCircleSVG;\r\n","import * as React from 'react';\r\n\r\ninterface CheckmarkSVGProps {\r\n\tclass?: string;\r\n}\r\n\r\n/**\r\n * Checkmark SVG\r\n *\r\n * @returns\r\n */\r\nfunction CheckmarkSVG(props: CheckmarkSVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default CheckmarkSVG;\r\n","import * as React from 'react';\r\n\r\ninterface PlusCircleSVGProps {\r\n\tclass: string;\r\n}\r\n\r\n/**\r\n * Plus SVG\r\n *\r\n * @returns\r\n */\r\nfunction PlusCircleSVG(props: PlusCircleSVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PlusCircleSVG;\r\n","import React from 'react';\r\n\r\nimport { useHawkSearch } from 'components/StoreProvider';\r\nimport { useFacet } from 'components/ui/Facets/Facet';\r\nimport { FacetSelectionState } from 'store/Store';\r\nimport DashCircleSVG from 'components/svg/DashCircleSVG';\r\nimport CheckmarkSVG from 'components/svg/CheckmarkSVG';\r\nimport PlusCircleSVG from 'components/svg/PlusCircleSVG';\r\nimport { useHawkConfig } from 'components/ConfigProvider';\r\n\r\nfunction Checkbox() {\r\n\tconst { store } = useHawkSearch();\r\n\tconst { config } = useHawkConfig();\r\n\r\n\tconst {\r\n\t\tfacet,\r\n\t\tstate: { facetValues },\r\n\t\tactor,\r\n\t\trenderer,\r\n\t} = useFacet();\r\n\r\n\tfunction renderOptions() {\r\n\t\tif (facet.FieldType === 'range') {\r\n\t\t\treturn facetValues.map((value) => {\r\n\t\t\t\tconst correspondingRange = facet.Ranges.find((c) => c.Value === value.Value);\r\n\t\t\t\tconst rangeValueAssetUrl = correspondingRange\r\n\t\t\t\t\t? config.dashboardUrl + correspondingRange.AssetFullUrl\r\n\t\t\t\t\t: '';\r\n\r\n\t\t\t\t// facets can be selected or negated, so explicitly check that the facet is not selected\r\n\t\t\t\tconst selectionState = store.isFacetSelected(facet, value).state;\r\n\r\n\t\t\t\tconst isSelected = selectionState !== FacetSelectionState.NotSelected;\r\n\t\t\t\tconst isNegated = selectionState === FacetSelectionState.Negated;\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t
  • \r\n\t\t\t\t\t\t actor.selectFacet(value)}\r\n\t\t\t\t\t\t\tclassName=\"hawk-facet-rail__facet-btn\"\r\n\t\t\t\t\t\t\taria-pressed={isSelected}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{renderCheckMark(isSelected)}\r\n\t\t\t\t\t\t\t{rangeValueAssetUrl !== '' ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\t{value.Label}\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{value.Label} ({value.Count})\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{value.Label} ({value.Count})\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t{renderFacetActions(value.Value || '', isNegated)}\r\n\t\t\t\t\t
  • \r\n\t\t\t\t);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\treturn facetValues.map((value) => {\r\n\t\t\t\t// facets can be selected or negated, so explicitly check that the facet is not selected\r\n\t\t\t\tconst selectionState = store.isFacetSelected(facet, value).state;\r\n\r\n\t\t\t\tconst isSelected = selectionState !== FacetSelectionState.NotSelected;\r\n\t\t\t\tconst isNegated = selectionState === FacetSelectionState.Negated;\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t
  • \r\n\t\t\t\t\t\t actor.selectFacet(value)}\r\n\t\t\t\t\t\t\tclassName=\"hawk-facet-rail__facet-btn\"\r\n\t\t\t\t\t\t\taria-pressed={isSelected}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{renderCheckMark(isSelected)}\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{value.Label} ({value.Count})\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t{renderFacetActions(value.Value || '', isNegated)}\r\n\t\t\t\t\t
  • \r\n\t\t\t\t);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfunction renderCheckMark(isSelected: boolean) {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t{isSelected ? : null}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\tfunction renderFacetActions(value: string, isNegated: boolean) {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t{facetValues.length > 0 ? (\r\n\t\t\t\t
    \r\n\t\t\t\t\t
      {renderOptions()}
    \r\n\t\t\t\t
    \r\n\t\t\t) : null}\r\n\r\n\t\t\t{/* render the default truncation control as we don't need to customize this */}\r\n\t\t\t{renderer.renderTruncation()}\r\n\t\t
    \r\n\t);\r\n}\r\n\r\nexport default Checkbox;\r\n","import React, { useState, useRef } from 'react';\r\nimport { useHawkSearch } from 'components/StoreProvider';\r\nimport { useFacet } from 'components/ui/Facets/Facet';\r\nimport { useTranslation } from 'react-i18next';\r\nimport MagnifyingGlassSVG from 'shared/components/svg/MagnifyingGlassSVG';\r\n\r\nfunction Search() {\r\n\tconst { store, actor: hawkActor } = useHawkSearch();\r\n\tconst { facet, actor } = useFacet();\r\n\r\n\tconst [input, setInput] = useState(undefined);\r\n\r\n\tconst searchInputRef = useRef(null);\r\n\tconst { t } = useTranslation();\r\n\r\n\tfunction onKeyDown(event: React.KeyboardEvent) {\r\n\t\tif (event.key === 'Enter') {\r\n\t\t\tsetInput(undefined); // clear the user's entered value as we want to be driven by the store again\r\n\r\n\t\t\tactor.selectFacet(event.currentTarget.value);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction clearFacet() {\r\n\t\tsetInput(undefined); // clear the user's entered value as we want to be driven by the store again\r\n\r\n\t\thawkActor.clearFacet(facet);\r\n\t}\r\n\r\n\tfunction getInputValue() {\r\n\t\tif (input !== undefined) {\r\n\t\t\t// if the user type an input, that's the value for the input\r\n\t\t\treturn input;\r\n\t\t}\r\n\r\n\t\t// otherwise, use the value from the store\r\n\t\treturn store.pendingSearch.SearchWithin ?? '';\r\n\t}\r\n\r\n\tconst labelFor = `search-within-${facet.FacetId.toString()}`;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t
    \r\n\t\t\t\t\r\n\r\n\t\t\t\t {\r\n\t\t\t\t\t\tif (searchInputRef && searchInputRef.current) {\r\n\t\t\t\t\t\t\tsetInput(undefined);\r\n\r\n\t\t\t\t\t\t\tactor.selectFacet(searchInputRef.current.value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}}\r\n\t\t\t\t\taria-label={facet.Name}\r\n\t\t\t\t>\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
    \r\n\r\n\t\t\t{store.pendingSearch.SearchWithin ? (\r\n\t\t\t\t
    \r\n\t\t\t\t\t\r\n\t\t\t\t
    \r\n\t\t\t) : null}\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default Search;\r\n","import React from 'react';\r\n\r\nimport { useHawkSearch } from 'components/StoreProvider';\r\nimport { useFacet } from 'components/ui/Facets/Facet';\r\nimport { FacetSelectionState } from 'store/Store';\r\n\r\nfunction Link() {\r\n\tconst { store } = useHawkSearch();\r\n\tconst {\r\n\t\tfacet,\r\n\t\tstate: { facetValues },\r\n\t\tactor,\r\n\t\trenderer,\r\n\t} = useFacet();\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t
      \r\n\t\t\t\t\t{facetValues.map((value) => {\r\n\t\t\t\t\t\t// facets can be selected or negated, so explicitly check that the facet is not selected\r\n\t\t\t\t\t\tconst selectionState = store.isFacetSelected(facet, value).state;\r\n\r\n\t\t\t\t\t\tconst isSelected = selectionState !== FacetSelectionState.NotSelected;\r\n\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\t\t actor.selectFacet(value)}\r\n\t\t\t\t\t\t\t\t\tclassName=\"hawk-facet-rail__facet-btn\"\r\n\t\t\t\t\t\t\t\t\taria-pressed={isSelected}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{value.Label} ({value.Count})\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t
    \r\n\t\t\t
    \r\n\r\n\t\t\t{/* render the default truncation control as we don't need to customize this */}\r\n\t\t\t{renderer.renderTruncation()}\r\n\t\t
    \r\n\t);\r\n}\r\n\r\nexport default Link;\r\n","import React, { useState, useEffect } from 'react';\r\nimport type NumberFormat from 'react-number-format';\r\nimport Spinner from 'shared/components/Spinner';\r\nconst LazyNumberFormat = React.lazy(() => import('react-number-format'));\r\n\r\nexport interface SliderNumericInputsProps {\r\n\tmin: number;\r\n\tmax: number;\r\n\tvalues: number[];\r\n\tisCurrency: boolean;\r\n\tcurrencySymbol: string;\r\n\tdecimalPrecision: number;\r\n\tonValueChange(minValue: number, maxValue: number): void;\r\n}\r\n\r\nfunction SliderNumericInputs(sliderProps: SliderNumericInputsProps) {\r\n\tconst [minValue, setMinValue] = useState('' as string);\r\n\tconst [maxValue, setMaxValue] = useState('' as string);\r\n\r\n\tfunction onMinUpdate(values: any) {\r\n\t\tconst { value } = values;\r\n\r\n\t\tconst newMinValue = Number(value);\r\n\t\tif (isNaN(newMinValue) || minValue === value) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetMinValue(value);\r\n\t}\r\n\r\n\tfunction onMaxUpdate(values: any) {\r\n\t\tconst { value } = values;\r\n\r\n\t\tconst newMaxValue = Number(value);\r\n\t\tif (isNaN(newMaxValue) || maxValue === value) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tsetMaxValue(value);\r\n\t}\r\n\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tfunction reloadFacets(event: React.FormEvent) {\r\n\t\tsliderProps.onValueChange(Number(minValue), Number(maxValue));\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tsetMinValue(sliderProps.values[0].toString());\r\n\t\tsetMaxValue(sliderProps.values[1].toString());\r\n\t}, [sliderProps]);\r\n\r\n\treturn (\r\n\t\t}>\r\n\t\t\t
    \r\n\t\t\t\t\r\n\r\n\t\t\t\t\r\n\t\t\t
    \r\n\t\t
    \r\n\t);\r\n}\r\n\r\nexport default SliderNumericInputs;\r\n","import React, { useState, useEffect } from 'react';\r\nimport { PublicState } from 'rheostat';\r\nimport { useHawkSearch } from 'components/StoreProvider';\r\nimport { useFacet } from 'components/ui/Facets/Facet';\r\nimport SliderNumericInputs from 'components/ui/Facets/SliderNumericInputs';\r\n\r\nconst Rheostat = React.lazy(() => import(/* webpackChunkName: \"rheostat\" */ 'rheostat'));\r\n\r\nfunction Slider() {\r\n\tconst {\r\n\t\tstore: { facetSelections },\r\n\t} = useHawkSearch();\r\n\r\n\tconst {\r\n\t\tstate: { facetValues, decimalPrecision },\r\n\t\tfacet,\r\n\t\tactor,\r\n\t} = useFacet();\r\n\r\n\t// the range of the slider is defined by the first facet value. or null if there is no first value\r\n\tconst range = facetValues.length > 0 ? facetValues[0] : null;\r\n\r\n\tconst [rangeMin, setMinRange] = useState(range && Math.floor(parseFloat(range.RangeMin || '')));\r\n\tconst [rangeMax, setMaxRange] = useState(range && Math.ceil(parseFloat(range.RangeMax || '')));\r\n\tconst [rangeStart, setStartRange] = useState(range && Math.floor(parseFloat(range.RangeStart || '')));\r\n\tconst [rangeEnd, setEndRange] = useState(range && Math.ceil(parseFloat(range.RangeEnd || '')));\r\n\r\n\t// if there's no range, initialize to zeros\r\n\tconst [minValue, setMinValue] = useState();\r\n\tconst [maxValue, setMaxValue] = useState();\r\n\r\n\tconst [isCurrency, setIsCurrency] = useState(facet.IsCurrency);\r\n\tconst [currencySymbol, setCurrencySymbol] = useState(facet.CurrencySymbol);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetCurrencySymbol(facet.CurrencySymbol ?? '$');\r\n\t\tsetIsCurrency(facet.IsCurrency);\r\n\t}, [facet]);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst paramName = facet.ParamName || facet.Field;\r\n\r\n\t\t// clear min and max value if these were cleared\r\n\t\tif (!paramName || !(paramName in facetSelections)) {\r\n\t\t\tsetMinValue(undefined);\r\n\t\t\tsetMaxValue(undefined);\r\n\t\t} else if (\r\n\t\t\tparamName in facetSelections &&\r\n\t\t\tfacetSelections[paramName].items &&\r\n\t\t\tfacetSelections[paramName].items.length > 0\r\n\t\t) {\r\n\t\t\tconst selectedValues = facetSelections[paramName].items[0].value.split(',');\r\n\t\t\tsetMinValue(Number(selectedValues[0]));\r\n\t\t\tsetMaxValue(Number(selectedValues[1]));\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [facetSelections]);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst newRange = facetValues.length > 0 ? facetValues[0] : null;\r\n\t\tsetMinRange(newRange && Math.floor(parseFloat(newRange.RangeMin || '')));\r\n\t\tsetMaxRange(newRange && Math.ceil(parseFloat(newRange.RangeMax || '')));\r\n\t\tsetStartRange(newRange && Math.floor(parseFloat(newRange.RangeStart || '')));\r\n\t\tsetEndRange(newRange && Math.ceil(parseFloat(newRange.RangeEnd || '')));\r\n\t}, [facetValues]);\r\n\r\n\tif (\r\n\t\trangeMin === null ||\r\n\t\tisNaN(rangeMin) ||\r\n\t\trangeMax === null ||\r\n\t\tisNaN(rangeMax) ||\r\n\t\trangeStart === null ||\r\n\t\tisNaN(rangeStart) ||\r\n\t\trangeEnd === null ||\r\n\t\tisNaN(rangeEnd)\r\n\t) {\r\n\t\t// this facet is somehow misconfigured so don't render\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction onSliderValueChange(state: PublicState) {\r\n\t\tconst [newMin, newMax] = state.values;\r\n\r\n\t\tsetFacetValues(newMin, newMax);\r\n\t}\r\n\r\n\tfunction onValueChange(newMinValue: number, newMaxValue: number) {\r\n\t\tlet currentMinValue = minValue;\r\n\t\tlet currentMaxValue = maxValue;\r\n\t\t// if min value wasn't yet selected use range start\r\n\t\tif (minValue === undefined && rangeStart !== null) {\r\n\t\t\tcurrentMinValue = rangeStart; // setMinValue(rangeStart);\r\n\t\t}\r\n\r\n\t\t// if max value wasn't yet selected use range end\r\n\t\tif (maxValue === undefined && rangeEnd !== null) {\r\n\t\t\tcurrentMaxValue = rangeEnd;\r\n\t\t}\r\n\r\n\t\tif (currentMinValue === undefined || currentMaxValue === undefined) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (currentMinValue !== newMinValue && newMinValue <= currentMaxValue) {\r\n\t\t\tcurrentMinValue = newMinValue;\r\n\t\t}\r\n\r\n\t\tif (currentMaxValue !== newMaxValue && newMaxValue >= currentMinValue) {\r\n\t\t\tcurrentMaxValue = newMaxValue;\r\n\t\t}\r\n\t\tsetMinValue(currentMinValue);\r\n\t\tsetMaxValue(currentMaxValue);\r\n\t\tsetFacetValues(currentMinValue, currentMaxValue);\r\n\t}\r\n\r\n\tfunction setFacetValues(minVal: number | undefined, maxVal: number | undefined) {\r\n\t\tif (minVal === undefined || maxVal === undefined || isNaN(minVal) || isNaN(maxVal)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tsetMinValue(minVal);\r\n\t\tsetMaxValue(maxVal);\r\n\r\n\t\t// this selection is sent to hawk separated by commas, so build the value here\r\n\t\tconst selection = `${minVal},${maxVal}`;\r\n\r\n\t\tactor.setFacets([selection]);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t
    \r\n\t\t\t\tLoading...
    }>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default Slider;\r\n","import React from 'react';\r\n\r\nimport { Value } from 'models/Facets/Value';\r\nimport { Swatch } from 'models/Facets';\r\nimport { useHawkConfig } from 'components/ConfigProvider';\r\nimport * as Constants from 'util/Constants';\r\n\r\nexport interface SwatchItemProps {\r\n\tswatchValue: Value;\r\n\tfacetSwatch: Swatch;\r\n\tisNegated: boolean;\r\n\tisSelected: boolean;\r\n\tisColor: boolean;\r\n\tonSwatchSelected(facetValue: string, isNegated: boolean): void;\r\n}\r\n\r\n/**\r\n * Gets the absolute URL of the swatch's image resource.\r\n */\r\nfunction getSwatchUrl(item: SwatchItemProps) {\r\n\t// eslint-disable-next-line\r\n\tconst { config } = useHawkConfig();\r\n\r\n\tlet suffix = !item.facetSwatch.AssetUrl ? item.facetSwatch.AssetName : item.facetSwatch.AssetUrl;\r\n\r\n\tif (suffix.length === 0 || /^https?:\\/\\//.test(suffix)) {\r\n\t\t// If our \"suffix\" is an absolute url or empty it isn't meaningful to prepend anything to it.\r\n\t\treturn suffix;\r\n\t}\r\n\r\n\t// Suffix must have a prepended slash\r\n\tif (suffix[0] !== '/') {\r\n\t\tsuffix = '/' + suffix;\r\n\t}\r\n\r\n\t// Prefix shoudn't have an appended slash\r\n\t// Technically speaking this is legal eg \"https://www.example.com/test//assets/1232/red.gif\" but it is more likely than not, an error.\r\n\tconst dashboardUrl = config.dashboardUrl || Constants.defaultDashboardUrl;\r\n\tconst prefix =\r\n\t\tdashboardUrl[dashboardUrl.length - 1] === '/'\r\n\t\t\t? dashboardUrl.substring(0, dashboardUrl.length - 1)\r\n\t\t\t: dashboardUrl;\r\n\r\n\treturn prefix + suffix;\r\n}\r\n\r\nfunction SwatchItem(item: SwatchItemProps) {\r\n\tconst facetValue = item.swatchValue.Value || '';\r\n\r\n\t// facets can be selected or negated, so explicitly check that the facet is not selected\r\n\tconst swatchUrl = getSwatchUrl(item);\r\n\r\n\tconst colorSwatchStyle = {\r\n\t\tbackgroundColor: item.facetSwatch.Color,\r\n\t};\r\n\r\n\tconst listItemClassNames =\r\n\t\t'hawk-facet-rail__swatch-list-item' +\r\n\t\t(item.isSelected ? ' hawkFacet-active' : '') +\r\n\t\t(item.isNegated ? ' hawkFacet-negative' : '');\r\n\r\n\treturn (\r\n\t\t
  • \r\n\t\t\t item.onSwatchSelected(facetValue, false)}\r\n\t\t\t\tclassName=\"hawk-styleSwatch\"\r\n\t\t\t\taria-pressed={item.isSelected}\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\t\t{item.isColor ? (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t{item.facetSwatch.Value}\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t
  • \r\n\t);\r\n}\r\n\r\nexport default SwatchItem;\r\n","import React from 'react';\r\n\r\nimport { useHawkSearch } from 'components/StoreProvider';\r\nimport { useFacet } from 'components/ui/Facets/Facet';\r\nimport { FacetSelectionState } from 'store/Store';\r\nimport SwatchItem from './SwatchItem';\r\n\r\nfunction Swatch() {\r\n\tconst { store } = useHawkSearch();\r\n\tconst {\r\n\t\tfacet,\r\n\t\tactor,\r\n\t\tstate: { facetValues },\r\n\t\trenderer,\r\n\t} = useFacet();\r\n\r\n\tfunction onSwatchSelected(facetValue: string, isNegated: boolean) {\r\n\t\tisNegated ? actor.negateFacet(facetValue) : actor.selectFacet(facetValue);\r\n\t}\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t
      \r\n\t\t\t\t\t{facet.SwatchData &&\r\n\t\t\t\t\t\tfacetValues.map((value) => {\r\n\t\t\t\t\t\t\tconst facetValue = value.Value || '';\r\n\t\t\t\t\t\t\t// find swatch that is corresponding with value\r\n\t\t\t\t\t\t\tconst facetSwatch =\r\n\t\t\t\t\t\t\t\tfacet.SwatchData &&\r\n\t\t\t\t\t\t\t\tfacet.SwatchData.find((s) => s.Value.toLowerCase() === facetValue.toLowerCase());\r\n\t\t\t\t\t\t\tif (!facetSwatch) {\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconst selectionState = store.isFacetSelected(facet, value).state;\r\n\t\t\t\t\t\t\tconst isNegated = selectionState === FacetSelectionState.Negated;\r\n\t\t\t\t\t\t\tconst isSelected = selectionState !== FacetSelectionState.NotSelected;\r\n\r\n\t\t\t\t\t\t\tconst isColor = !!facetSwatch.Color;\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t
    \r\n\t\t\t
    \r\n\r\n\t\t\t{/* render the default truncation control as we don't need to customize this */}\r\n\t\t\t{renderer.renderTruncation()}\r\n\t\t
    \r\n\t);\r\n}\r\n\r\nexport default Swatch;\r\n","import React, { useState } from 'react';\r\n\r\nimport { useHawkSearch } from 'components/StoreProvider';\r\nimport { FacetSelectionState } from 'store/Store';\r\nimport { useFacet } from 'components/ui/Facets/Facet';\r\nimport CheckmarkSVG from 'components/svg/CheckmarkSVG';\r\nimport { Value } from 'models/Facets';\r\nimport PlusCircleSVG from 'components/svg/PlusCircleSVG';\r\nimport DashCircleSVG from 'components/svg/DashCircleSVG';\r\n\r\nexport interface NestedItemProps {\r\n\thierarchyValue: Value;\r\n\tisNegated: boolean;\r\n\tisSelected: boolean;\r\n\tonValueSelected(facetValue: Value, isNegated: boolean): void;\r\n}\r\n\r\nfunction NestedItem(item: NestedItemProps) {\r\n\tconst { store } = useHawkSearch();\r\n\tconst { facet } = useFacet();\r\n\r\n\tconst [isExpanded, setIsExpanded] = useState(false);\r\n\tconst [isTruncated, setIsTruncated] = useState(facet.shouldTruncate);\r\n\r\n\tconst hierarchyValue = item.hierarchyValue || '';\r\n\tlet hierarchyChildren = item.hierarchyValue.Children || [];\r\n\r\n\tlet remainingValues = 0;\r\n\r\n\tconst shouldTruncateChildren =\r\n\t\tfacet.DisplayType === 'truncating' && hierarchyChildren.length > facet.TruncateThreshold;\r\n\r\n\tif (shouldTruncateChildren && isTruncated) {\r\n\t\tconst valuesBeforeTrunc = hierarchyChildren.length;\r\n\r\n\t\thierarchyChildren = hierarchyChildren.slice(0, facet.TruncateThreshold);\r\n\r\n\t\tremainingValues = valuesBeforeTrunc - facet.TruncateThreshold;\r\n\t}\r\n\r\n\tfunction renderChildTruncation() {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t{shouldTruncateChildren && (\r\n\t\t\t\t\t
  • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
  • \r\n\t\t\t\t)}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t
  • \r\n\t\t\t
    \r\n\t\t\t\t item.onValueSelected(hierarchyValue, false)}\r\n\t\t\t\t\tclassName=\"hawk-facet-rail__facet-btn\"\r\n\t\t\t\t\taria-pressed={item.isSelected}\r\n\t\t\t\t>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{item.isSelected ? : null}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{item.hierarchyValue.Label} ({item.hierarchyValue.Count})\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\t\t\t\t item.onValueSelected(hierarchyValue, true)}\r\n\t\t\t\t\tclassName=\"hawk-facet-rail__facet-btn-exclude\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{item.isNegated ? (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tInclude facet\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tExclude facet\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t
    \r\n\r\n\t\t\t{hierarchyChildren.length > 0 ? (\r\n\t\t\t\t setIsExpanded(!isExpanded)}\r\n\t\t\t\t>\r\n\t\t\t\t\t{isExpanded ? (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\tCollapse child facets\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\tExpand child facets\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{isExpanded && hierarchyChildren ? (\r\n\t\t\t\t
    \r\n\t\t\t\t\t
      \r\n\t\t\t\t\t\t{hierarchyChildren.map((value) => {\r\n\t\t\t\t\t\t\tconst selectionState = store.isFacetSelected(facet, value).state;\r\n\t\t\t\t\t\t\tconst isNegated = selectionState === FacetSelectionState.Negated;\r\n\t\t\t\t\t\t\tconst isSelected = selectionState !== FacetSelectionState.NotSelected;\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t{renderChildTruncation()}\r\n\t\t\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t) : (\r\n\t\t\t\t<>\r\n\t\t\t)}\r\n\t\t
  • \r\n\t);\r\n}\r\n\r\nexport default NestedItem;\r\n","import React from 'react';\r\n\r\nimport { useHawkSearch } from 'components/StoreProvider';\r\nimport { FacetSelectionState } from 'store/Store';\r\nimport { useFacet } from 'components/ui/Facets/Facet';\r\nimport NestedItem from './NestedItem';\r\nimport { Value } from 'models/Facets/Value';\r\n\r\nfunction Nested() {\r\n\tconst { store } = useHawkSearch();\r\n\tconst {\r\n\t\tfacet,\r\n\t\tstate: { facetValues },\r\n\t\tactor,\r\n\t\trenderer,\r\n\t} = useFacet();\r\n\r\n\tfunction onValueSelected(facetValue: Value, isNegated: boolean) {\r\n\t\tisNegated ? actor.negateFacet(facetValue) : actor.selectFacet(facetValue);\r\n\t}\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t{facetValues.length > 0 ? (\r\n\t\t\t\t
    \r\n\t\t\t\t\t
      \r\n\t\t\t\t\t\t{facetValues.map((value) => {\r\n\t\t\t\t\t\t\t// facets can be selected or negated, so explicitly check that the facet is not selected\r\n\t\t\t\t\t\t\tconst selectionState = store.isFacetSelected(facet, value).state;\r\n\r\n\t\t\t\t\t\t\tconst isSelected = selectionState !== FacetSelectionState.NotSelected;\r\n\t\t\t\t\t\t\tconst isNegated = selectionState === FacetSelectionState.Negated;\r\n\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t) : null}\r\n\r\n\t\t\t{/* render the default truncation control as we don't need to customize this */}\r\n\t\t\t{renderer.renderTruncation()}\r\n\t\t
    \r\n\t);\r\n}\r\n\r\nexport default Nested;\r\n","import React, { useState } from 'react';\r\nimport { useHawkSearch } from 'components/StoreProvider';\r\nimport { useFacet } from 'components/ui/Facets/Facet';\r\n\r\nfunction OpenRange() {\r\n\tconst { actor: hawkActor } = useHawkSearch();\r\n\r\n\tconst {\r\n\t\tstate: { facetValues },\r\n\t\tfacet,\r\n\t\tactor,\r\n\t} = useFacet();\r\n\r\n\t// the open range boundary values are defined by the first facet value. or null if there is no first value\r\n\r\n\tconst range = facetValues.length > 0 ? facetValues[0] : null;\r\n\r\n\tconst rangeStart = (range && range.RangeStart) || '';\r\n\tconst rangeEnd = (range && range.RangeEnd) || '';\r\n\r\n\t// if there's no range, initialize to empty strings\r\n\tconst [minValue, setStartValue] = useState(rangeStart || '');\r\n\tconst [maxValue, setEndValue] = useState(rangeEnd || '');\r\n\r\n\tif (rangeStart === null || rangeEnd === null) {\r\n\t\t// this facet is somehow misconfigured so don't render\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction onRangeStartChange(event: React.FormEvent) {\r\n\t\tsetFacetValues(event.currentTarget.value, maxValue);\r\n\t}\r\n\r\n\tfunction onRangeEndChange(event: React.FormEvent) {\r\n\t\tsetFacetValues(minValue, event.currentTarget.value);\r\n\t}\r\n\r\n\tfunction setFacetValues(startVal: string, endVal: string) {\r\n\t\tsetStartValue(startVal);\r\n\t\tsetEndValue(endVal);\r\n\r\n\t\t// this selection is sent to hawk separated by commas, so build the value here\r\n\r\n\t\tif (startVal === '' && endVal === '') {\r\n\t\t\thawkActor.clearFacet(facet);\r\n\t\t} else {\r\n\t\t\tconst selection = `${startVal},${endVal}`;\r\n\t\t\tactor.setFacets([selection]);\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
    \r\n\t\t\t
    \r\n\t\t
    \r\n\t);\r\n}\r\n\r\nexport default OpenRange;\r\n","export enum FacetType {\r\n\tCheckbox = 'checkbox',\r\n\tNestedCheckbox = 'nestedcheckbox',\r\n\tLink = 'link',\r\n\tNestedlink = 'nestedlink',\r\n\tSlider = 'slider',\r\n\tSwatch = 'swatch',\r\n\tRating = 'rating',\r\n\tSize = 'size',\r\n\tSearchWithin = 'search',\r\n\tRecentSearches = 'recentsearches',\r\n\tRelatedSearches = 'relatedsearches',\r\n\tOpenRange = 'openRange',\r\n}\r\n","import {\r\n\tCheckbox as DefaultCheckbox,\r\n\tNestedCheckbox as DefaultNestedCheckbox,\r\n\tSearch as DefaultSearch,\r\n\tLink as DefaultLink,\r\n\tSlider as DefaultSlider,\r\n\tSwatch as DefaultSwatch,\r\n\tOpenRange as DefaultOpenRange,\r\n} from 'components/ui/Facets/FacetTypes';\r\nimport { FacetComponent } from 'types/FacetComponent';\r\nimport { FacetType } from 'models/Facets/FacetType';\r\nimport { SuggestionStrategyMatch, SuggestionType } from 'models/Autocomplete/Suggestion';\r\nimport { ProductStrategy, CategoryStrategy, PopularStrategy, ContentStrategy } from 'models/Autocomplete';\r\n\r\n// the default set of facet components that we support\r\nconst defaultFacetComponents: FacetComponent[] = [\r\n\t{ facetType: FacetType.Checkbox, component: DefaultCheckbox },\r\n\t{ facetType: FacetType.NestedCheckbox, component: DefaultNestedCheckbox },\r\n\t{ facetType: FacetType.SearchWithin, component: DefaultSearch },\r\n\t{ facetType: FacetType.Link, component: DefaultLink },\r\n\t{ facetType: FacetType.Slider, component: DefaultSlider },\r\n\t{ facetType: FacetType.Swatch, component: DefaultSwatch },\r\n\t{ facetType: FacetType.OpenRange, component: DefaultOpenRange },\r\n];\r\n\r\nconst defaultAutocompleteStrategies: SuggestionStrategyMatch[] = [\r\n\t{ type: SuggestionType.Product, strategy: new ProductStrategy() },\r\n\t{ type: SuggestionType.Category, strategy: new CategoryStrategy() },\r\n\t{ type: SuggestionType.Popular, strategy: new PopularStrategy() },\r\n\t{ type: SuggestionType.Content, strategy: new ContentStrategy() },\r\n];\r\n\r\n/**\r\n * Builds a list of all supported facet components by also taking into consideration overridden components.\r\n */\r\nexport function getFacetComponents(overridedComponents: FacetComponent[]) {\r\n\tconst facetComponents: FacetComponent[] = [];\r\n\r\n\tfor (const key in FacetType) {\r\n\t\tconst fType = FacetType[key];\r\n\r\n\t\tconst fComponent =\r\n\t\t\t// check to see if the facet is overridden\r\n\t\t\toverridedComponents.find((component) => component.facetType === fType) ||\r\n\t\t\t// otherwise, pull from defaults\r\n\t\t\tdefaultFacetComponents.find((component) => component.facetType === fType);\r\n\r\n\t\tif (fComponent) {\r\n\t\t\tfacetComponents.push(fComponent);\r\n\t\t}\r\n\t}\r\n\r\n\treturn facetComponents;\r\n}\r\n\r\n/**\r\n * Builds a list of all supported autocomplete suggestion strategiesby also taking into consideration overridden strategies.\r\n */\r\nexport function getAutocompleteStrategies(overridedStrategies: SuggestionStrategyMatch[]): SuggestionStrategyMatch[] {\r\n\tconst suggestionStrategies: SuggestionStrategyMatch[] = [];\r\n\r\n\t// tslint:disable-next-line:forin\r\n\tfor (const key in SuggestionType) {\r\n\t\tconst sType = SuggestionType[key];\r\n\r\n\t\tconst autocompleteStrategy =\r\n\t\t\t// check to see if the facet is overridden\r\n\t\t\toverridedStrategies.find((strategyMatch) => strategyMatch.type === sType) ||\r\n\t\t\t// otherwise, pull from defaults\r\n\t\t\tdefaultAutocompleteStrategies.find((strategyMatch) => strategyMatch.type === sType);\r\n\r\n\t\tif (autocompleteStrategy) {\r\n\t\t\tsuggestionStrategies.push(autocompleteStrategy);\r\n\t\t}\r\n\t}\r\n\treturn suggestionStrategies;\r\n}\r\n","/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\r\nimport React from 'react';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\nimport { Response, Product, Popular, Category, Content } from 'models/Autocomplete';\r\nimport { Suggestion, SuggestionType } from '../../../models/Autocomplete/Suggestion';\r\nimport { useTranslation } from 'react-i18next';\r\nimport classnames from 'classnames';\r\n/* #region Commerce */\r\nimport { dispatchRocEvent } from 'shared/hooks/useRocEventHandler';\r\nimport { CommerceSuggestType } from 'features/tracking/trackers/commerce/hawksearch/tracking-commerce';\r\n/* #endregion */\r\n\r\nexport interface SearchSuggestionsListProps {\r\n\tisLoading: boolean;\r\n\tsearchResults: Response;\r\n\tdownshift: ControllerStateAndHelpers;\r\n\tquery: string;\r\n\tonViewMatches: (downshift: ControllerStateAndHelpers) => void;\r\n}\r\n\r\nfunction hasAllEmpty(\r\n\tpopular: Popular[] | undefined,\r\n\tcategories: Category[] | undefined,\r\n\tproducts: Product[] | undefined,\r\n\tcontent: Content[] | undefined,\r\n) {\r\n\tconst hasPopular = popular && popular.length === 0;\r\n\tconst hasCategories = categories && categories.length === 0;\r\n\tconst hasProducts = products && products.length === 0;\r\n\tconst hasContent = content && content.length === 0;\r\n\treturn hasPopular && hasCategories && hasProducts && hasContent;\r\n}\r\n\r\nfunction getAtleastOneExist(\r\n\tpopular: Popular[] | undefined,\r\n\tcategories: Category[] | undefined,\r\n\tproducts: Product[] | undefined,\r\n\tcontent: Content[] | undefined,\r\n) {\r\n\tconst hasPopular = popular && popular.length > 0;\r\n\tconst hasCategories = categories && categories.length > 0;\r\n\tconst hasProducts = products && products.length > 0;\r\n\tconst hasContent = content && content.length > 0;\r\n\treturn hasPopular || hasCategories || hasProducts || hasContent;\r\n}\r\n\r\nfunction SearchSuggestionsList({\r\n\tisLoading,\r\n\tsearchResults,\r\n\tdownshift,\r\n\tquery,\r\n\tonViewMatches,\r\n}: SearchSuggestionsListProps) {\r\n\tconst {\r\n\t\tPopular: popular,\r\n\t\tCategories: categories,\r\n\t\tProducts: products,\r\n\t\tContent: content,\r\n\t\tPopularHeading,\r\n\t\tCategoryHeading,\r\n\t\tProductHeading,\r\n\t\tContentHeading,\r\n\t} = searchResults;\r\n\r\n\tconst { getItemProps, getMenuProps, highlightedIndex } = downshift;\r\n\tconst isRecordEmpty = hasAllEmpty(popular, categories, products, content);\r\n\tconst isAtleastOneExist = getAtleastOneExist(popular, categories, products, content);\r\n\tconst { t } = useTranslation();\r\n\r\n\tlet dynamicIndex = 0;\r\n\r\n\treturn (\r\n\t\t
      \r\n\t\t\t{isLoading &&
    • Loading...
    • }\r\n\t\t\t{products && products.length ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{ProductHeading ?

      {ProductHeading}

      : ''}\r\n\t\t\t\t\t{products.map((item) => {\r\n\t\t\t\t\t\tdynamicIndex++;\r\n\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\tdispatchRocEvent('hawk-autocomplete-click', {\r\n\t\t\t\t\t\t\t\t\t\t\tkeyword: query,\r\n\t\t\t\t\t\t\t\t\t\t\tsuggestType: CommerceSuggestType.TopProductMatches,\r\n\t\t\t\t\t\t\t\t\t\t\titemName: item.ProductName,\r\n\t\t\t\t\t\t\t\t\t\t\turl: item.Url,\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t/* #endregion */\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t
      \r\n\t\t\t\t\t\t\t\t{item.ProductName}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\t\t\t
      \r\n\t\t\t\t{categories && categories.length ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t

      {CategoryHeading}

      \r\n\t\t\t\t\t\t{categories.map((item) => {\r\n\t\t\t\t\t\t\tdynamicIndex++;\r\n\r\n\t\t\t\t\t\t\t/* #region HCL */\r\n\t\t\t\t\t\t\titem.Url = item.Url.replace(/%2c/g, '%c%');\r\n\t\t\t\t\t\t\t/* #endregion */\r\n\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
      \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t\r\n\t\t\t\t) : null}\r\n\t\t\t\t{popular && popular.length ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t

      {PopularHeading}

      \r\n\t\t\t\t\t\t{popular.map((item) => {\r\n\t\t\t\t\t\t\tdynamicIndex++;\r\n\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t
      \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t\r\n\t\t\t\t) : null}\r\n\t\t\t\t{content && content.length ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t

      {ContentHeading}

      \r\n\t\t\t\t\t\t{content.map((item) => {\r\n\t\t\t\t\t\t\tdynamicIndex++;\r\n\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{item.Thumb &&
      }\r\n\t\t\t\t\t\t\t\t\t{item.Value}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t\r\n\t\t\t\t) : null}\r\n\t\t\t
      \r\n\t\t\t{isAtleastOneExist && (\r\n\t\t\t\t// eslint-disable-next-line jsx-a11y/click-events-have-key-events\r\n\t\t\t\t onViewMatches(downshift)}\r\n\t\t\t\t>\r\n\t\t\t\t\tView all matches\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\t{!isLoading && isRecordEmpty &&
    • {t('No results.')}
    • }\r\n\t\t
    \r\n\t);\r\n}\r\n\r\nexport default SearchSuggestionsList;\r\n","import React, { useState, useEffect } from 'react';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\nimport axios, { CancelToken } from 'axios';\r\nimport HawkClient from 'net/HawkClient';\r\nimport { Response } from 'models/Autocomplete';\r\nimport { useHawkConfig } from 'components/ConfigProvider';\r\nimport SearchSuggestionsList from './SearchSuggestionsList';\r\nimport { Suggestion } from 'models/Autocomplete/Suggestion';\r\n// #region HCL\r\nimport { validateQueryAndRemoveDash } from '../../hcl/util';\r\n// #endregion\r\n\r\nexport interface SearchSuggestionsProps {\r\n\t/** The user entered search string in the autocomplete text input. */\r\n\tquery: string;\r\n\r\n\t/** Downshift's render prop parameter. */\r\n\tdownshift: ControllerStateAndHelpers;\r\n\r\n\tonViewMatches: (downshift: ControllerStateAndHelpers) => void;\r\n}\r\n\r\nfunction SearchSuggestions({ query, downshift, onViewMatches }: SearchSuggestionsProps) {\r\n\tconst { config } = useHawkConfig();\r\n\tconst client = new HawkClient(config);\r\n\r\n\tconst [results, setResults] = useState({} as Response);\r\n\tconst [isLoading, setIsLoading] = useState(false);\r\n\r\n\t// debounce the input search string so that we only do an autocomplete query every so often\r\n\tuseEffect(() => {\r\n\t\t// default to 200ms if not specified\r\n\t\tconst debounceMs = config.autocompleteDebounce || 200;\r\n\r\n\t\tconst cts = axios.CancelToken.source();\r\n\t\tconst timeout = setTimeout(() => doAutocomplete(query, cts.token), debounceMs);\r\n\r\n\t\treturn () => {\r\n\t\t\tcts.cancel();\r\n\t\t\tclearTimeout(timeout);\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [query, config.autocompleteDebounce]);\r\n\r\n\t/**\r\n\t * Performs an autocomplete request to the Hawk API and populates the result set of this component.\r\n\t * @param input The user entered search string that results will be autocompleted for.\r\n\t */\r\n\tasync function doAutocomplete(input: string, cancellationToken?: CancelToken) {\r\n\t\tsetIsLoading(true);\r\n\r\n\t\tlet response: Response | null = null;\r\n\r\n\t\t// #region HCL\r\n\t\tif (config?.enableRemovingDashesFromSearchKeyword) {\r\n\t\t\tinput = validateQueryAndRemoveDash(input);\r\n\t\t}\r\n\t\t// #endregion\r\n\r\n\t\ttry {\r\n\t\t\tresponse = await client\r\n\t\t\t\t.autocomplete(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tClientGuid: config.clientGuid,\r\n\r\n\t\t\t\t\t\tKeyword: input,\r\n\t\t\t\t\t\tIndexName: config.indexName,\r\n\t\t\t\t\t\tDisplayFullResponse: true,\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcancellationToken,\r\n\t\t\t\t)\r\n\t\t\t\t.then((o) => {\r\n\t\t\t\t\t// ensure, returned object will return response\r\n\t\t\t\t\t// since by default, axios uses JSON.parse to parse an object,\r\n\t\t\t\t\t// it doesn't recognize it as Response type - this line is to prevent it\r\n\t\t\t\t\treturn new Response(o);\r\n\t\t\t\t});\r\n\t\t} catch (error) {\r\n\t\t\tif (axios.isCancel(error)) {\r\n\t\t\t\t// if the request was cancelled, it's because this component was updated\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconsole.error('Autocomplete request error:', error);\r\n\t\t}\r\n\r\n\t\tsetIsLoading(false);\r\n\r\n\t\tif (response) {\r\n\t\t\tsetResults(response);\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t\r\n\t\t
    \r\n\t);\r\n}\r\n\r\nexport default SearchSuggestions;\r\n","import React, { useState } from 'react';\r\nimport { DownshiftState, StateChangeOptions, ControllerStateAndHelpers } from 'downshift';\r\nimport SearchSuggestions from 'components/ui/SearchBox/SearchSuggestions';\r\nimport MagnifyingGlassSVG from 'shared/components/svg/MagnifyingGlassSVG'; // ERRONEOUS: Referencing stuff outside of Hawk from within Hawk. This should be inverted.\r\nimport { Suggestion } from 'models/Autocomplete/Suggestion';\r\nimport { getAutocompleteStrategies } from '../Facets/Overrides';\r\nimport { useHawkConfig } from 'components/ConfigProvider';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nconst Downshift = React.lazy(() => import(/* webpackChunkName: \"downshift\" */ 'downshift'));\r\n\r\nexport interface SearchBoxBaseProps {\r\n\tinitialValue?: string;\r\n\tonSubmit: (keywords: string) => void;\r\n\tonViewMatches: (downshift: ControllerStateAndHelpers) => void;\r\n}\r\n\r\nfunction SearchBoxBase({ initialValue, onSubmit, onViewMatches }: SearchBoxBaseProps) {\r\n\tconst { config } = useHawkConfig();\r\n\tconst strategies = getAutocompleteStrategies(config.autocompleteStrategies || []);\r\n\tconst [isOpenOverride, setIsOpenOverride] = useState(true);\r\n\tconst { t } = useTranslation();\r\n\r\n\t/** Called when the internal state of downshift changes - we're handling a couple custom behaviors here */\r\n\tfunction handleStateChange(\r\n\t\tstate: DownshiftState,\r\n\t\tchanges: StateChangeOptions,\r\n\t): Partial> {\r\n\t\tif (\r\n\t\t\t// NOTE: these strings are hardcoded to support code splitting downshift.\r\n\t\t\t// using the constants from the package will prevent code splitting from operating correctly\r\n\t\t\tchanges.type === '__autocomplete_mouseup__' ||\r\n\t\t\tchanges.type === '__autocomplete_keydown_enter__' ||\r\n\t\t\tchanges.type === '__autocomplete_click_item__'\r\n\t\t) {\r\n\t\t\t// when:\r\n\t\t\t//\r\n\t\t\t// 1. the mouse the clicked outside of downshift\r\n\t\t\t// 2. enter is pressed on the keyboard\r\n\t\t\t// 3. an item is selected from the dropdown\r\n\t\t\t//\r\n\t\t\t// then we want to retain the input value that was originally typed in. by default downshift\r\n\t\t\t// will clear the input value, so we're overriding this behavior here.\r\n\t\t\treturn { ...changes, inputValue: state.inputValue };\r\n\t\t}\r\n\r\n\t\treturn changes;\r\n\t}\r\n\r\n\t/** Called when an item has been selected from the autocomplete results. */\r\n\tfunction handleItemChange(item: Suggestion, downshift: ControllerStateAndHelpers) {\r\n\t\tif (!item) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst matchedStrategy = strategies.find((strategy) => strategy.type === item.SuggestionType);\r\n\t\tif (!matchedStrategy) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmatchedStrategy.strategy.handleItemChange(item, downshift);\r\n\t}\r\n\r\n\tfunction handleToString(item: Suggestion): string {\r\n\t\tif (!item) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\tconst matchedStrategy = strategies.find((strategy) => strategy.type === item.SuggestionType);\r\n\t\tif (!matchedStrategy) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\treturn matchedStrategy.strategy.toString(item);\r\n\t}\r\n\r\n\treturn (\r\n\t\t
    \r\n\t\t\t{t('Loading')}...
    }>\r\n\t\t\t\t handleToString(item)}\r\n\t\t\t\t\tonChange={handleItemChange}\r\n\t\t\t\t\tinitialInputValue={initialValue || ''}\r\n\t\t\t\t>\r\n\t\t\t\t\t{(options: ControllerStateAndHelpers) => {\r\n\t\t\t\t\t\tconst { isOpen, inputValue, getInputProps, openMenu } = options;\r\n\t\t\t\t\t\tconst showSuggestions = isOpen && inputValue && inputValue.length > 0 && isOpenOverride;\r\n\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\tif (onSubmit) {\r\n\t\t\t\t\t\t\t\t\t\t\tonSubmit(inputValue ?? '');\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"global-search-button\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tSearch\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t{showSuggestions ? (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default SearchBoxBase;\r\n","import React from 'react';\r\nimport useDelayedDisplay from 'shared/hooks/useDelayedDisplay';\r\nimport classnames from 'classnames';\r\n\r\ntype SpinnerAlignment = 'left' | 'right' | 'none';\r\n\r\ninterface SpinnerProps {\r\n\tlight?: boolean;\r\n\twaitMs?: number;\r\n\talign?: SpinnerAlignment;\r\n\tblock?: boolean;\r\n\tparentCentered?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable roc-spinner component with color, alignment and wait time props.\r\n *\r\n * @export\r\n * @param {SpinnerProps} { light = false, waitMs = 200, align = 'right', block }\r\n * @returns\r\n */\r\nexport default function Spinner({\r\n\tlight = false,\r\n\twaitMs = 200,\r\n\talign = 'right',\r\n\tblock,\r\n\tparentCentered = false,\r\n}: SpinnerProps) {\r\n\tconst display = useDelayedDisplay(waitMs);\r\n\r\n\tif (!display) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst spinner = (\r\n\t\t\r\n\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t\t
    \r\n\t\t\t
    \r\n\t\t
    \r\n\t);\r\n\r\n\tif (parentCentered) {\r\n\t\treturn
    {spinner}
    ;\r\n\t}\r\n\r\n\treturn spinner;\r\n}\r\n","import React from 'react';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\nimport { useHawkConfig } from 'components/ConfigProvider';\r\nimport { Product } from 'models/Autocomplete';\r\nimport SearchBoxBase from 'components/ui/SearchBox/SearchBoxBase';\r\nimport * as Constants from 'util/Constants';\r\n\r\n/**\r\n * This component is a simple search input box (with autosuggest) that can be placed globally throughout the site.\r\n * This search box is intended to be used on non-search pages. On search pages, the `SearchBox` component should be\r\n * used instead.\r\n */\r\nfunction GlobalSearchBox() {\r\n\tconst { config } = useHawkConfig();\r\n\tconst searchUrl = config.searchPageUrl || Constants.defaultSearchPageUrl;\r\n\r\n\tfunction redirectToSearchPage(keywords: string | null) {\r\n\t\tlet redirect = `${searchUrl}?keyword=${encodeURIComponent(keywords ?? '')}`;\r\n\t\tif (config.indexName) {\r\n\t\t\tredirect += '&indexName=' + config.indexName;\r\n\t\t}\r\n\r\n\t\tlocation.assign(redirect);\r\n\t}\r\n\r\n\tfunction handleSubmit(keywords: string) {\r\n\t\tredirectToSearchPage(keywords);\r\n\t}\r\n\r\n\t// On select view all matches from suggestions list\r\n\tfunction handleViewAllMatches(downshift: ControllerStateAndHelpers) {\r\n\t\tconst { inputValue } = downshift;\r\n\t\tredirectToSearchPage(inputValue);\r\n\t}\r\n\r\n\treturn ;\r\n}\r\n\r\nexport default GlobalSearchBox;\r\n","import axios, { AxiosInstance, AxiosResponse, AxiosError } from 'axios';\r\nimport AccountUrls from 'shared/util/AccountUrls';\r\nimport { getCsrfToken } from './UserData';\r\n\r\n/**\r\n * Helper that creates an instance of Axios to be used throughout the client application\r\n * and adds a default X-Requested-With header to all requests.\r\n *\r\n */\r\nconst AxiosHelper: AxiosInstance = axios.create();\r\nAxiosHelper.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\r\n\r\n// Add CSRF tokens to all commands that are not GET, HEAD, or OPTIONS\r\nAxiosHelper.interceptors.request.use(async (config) => {\r\n\tif (\r\n\t\tconfig.method?.toLowerCase() !== 'get' &&\r\n\t\tconfig.method?.toLowerCase() !== 'head' &&\r\n\t\tconfig.method?.toLowerCase() !== 'options'\r\n\t) {\r\n\t\tconst csrfToken = await getCsrfToken();\r\n\t\tconfig.headers = { RequestVerificationToken: csrfToken, ...config.headers };\r\n\t}\r\n\treturn config;\r\n});\r\n\r\nexport default AxiosHelper;\r\n\r\n// eslint-disable-next-line no-unused-vars\r\nexport const addUnauthorizedAccessInterceptor = (history) => {\r\n\t// this allows us to act when any request going through axios succeeds or fails.\r\n\tAxiosHelper.interceptors.response.use(\r\n\t\t(response: AxiosResponse) => {\r\n\t\t\treturn response;\r\n\t\t},\r\n\t\t(error: AxiosError) => {\r\n\t\t\tif (error.response && error.response.status === 401) {\r\n\t\t\t\twindow.location.replace(\r\n\t\t\t\t\t`${AccountUrls.Login}?ReturnUrl=${encodeURIComponent(window.location.pathname)}`,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.reject(error);\r\n\t\t},\r\n\t);\r\n};\r\n","var api = require(\"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/dist/cjs.js!../../../../../node_modules/postcss-loader/src/index.js!../../../../../node_modules/sass-loader/dist/cjs.js!./app.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","var api = require(\"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../../node_modules/css-loader/dist/cjs.js!./styles.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \":root {\\n --reach-tooltip: 1;\\n}\\n\\n[data-reach-tooltip] {\\n z-index: 1;\\n pointer-events: none;\\n position: absolute;\\n padding: 0.25em 0.5em;\\n box-shadow: 2px 2px 10px hsla(0, 0%, 0%, 0.1);\\n white-space: nowrap;\\n font-size: 85%;\\n background: #f0f0f0;\\n color: #444;\\n border: solid 1px #ccc;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport { Localizer } from 'services/Localizer';\r\nimport { AxiosError } from 'axios';\r\nimport XSVG from 'shared/components/svg/XSVG';\r\n\r\ntype Theme = 'danger' | 'warning' | 'info' | 'success';\r\n\r\nexport interface ErrorAlertProps {\r\n\t/**\r\n\t * The title of the error message such as \"Uh Oh!\" or \"An Unexpected Error has Occurred!\"\r\n\t */\r\n\ttitle: string;\r\n\r\n\t/**\r\n\t * The error message to display if an error object doesn't have a more appropriate message.\r\n\t */\r\n\tmessage: React.ReactNode | string;\r\n\r\n\tchildren?: any;\r\n\r\n\ttheme?: Theme;\r\n\r\n\tisTitleOnOwnRow?: boolean;\r\n\r\n\t/** The error responsible for this message. */\r\n\terror: AxiosError | Error | null;\r\n\r\n\t/**\r\n\t * Method from parent that handles collapse state.\r\n\t */\r\n\tonCollapse?: (collased: boolean) => void;\r\n\r\n\t/**\r\n\t * Controlled collapse state from parent.\r\n\t */\r\n\tisCollapsed?: boolean;\r\n}\r\n\r\n/**\r\n * Reusable Error Alert Component.\r\n */\r\nexport default function InlineAlert(props: ErrorAlertProps) {\r\n\tconst {\r\n\t\ttitle = InlineAlert.defaultProps.title,\r\n\t\tchildren,\r\n\t\ttheme = 'danger',\r\n\t\tisTitleOnOwnRow = false,\r\n\t\terror = InlineAlert.defaultProps.error,\r\n\t\tisCollapsed = false,\r\n\t\tonCollapse,\r\n\t} = props;\r\n\r\n\tlet { message = InlineAlert.defaultProps.message } = props;\r\n\r\n\tconst axiosError = error as AxiosError | null;\r\n\tif (axiosError?.isAxiosError && axiosError != null && axiosError.response == null && axiosError.request != null) {\r\n\t\tmessage = Localizer('ErrorMessageNetwork');\r\n\t}\r\n\r\n\tif (axiosError?.isAxiosError && (axiosError?.response?.status === 401 || axiosError?.response?.status === 403)) {\r\n\t\tmessage = Localizer('ErrorMessageForbidden');\r\n\t}\r\n\r\n\tif (axiosError?.response?.data?.message) {\r\n\t\tmessage = axiosError.response.data.message;\r\n\t}\r\n\r\n\tif (isCollapsed) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{onCollapse ? (\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{title ? (\r\n\t\t\t\t\r\n\t\t\t\t\t{title}\r\n\t\t\t\t\r\n\t\t\t) : null}\r\n\r\n\t\t\t{message ? {message} : null}\r\n\r\n\t\t\t{children ? <> {children} : null}\r\n\t\t
    \r\n\t);\r\n}\r\n\r\n/**\r\n * Error Alert Default Props\r\n */\r\nInlineAlert.defaultProps = {\r\n\ttitle: Localizer('ErrorMessageGenericTitle'),\r\n\tmessage: Localizer('UnexpectedErrorOccurred'),\r\n\terror: null,\r\n};\r\n","import { useEffect } from 'react';\r\nimport 'shared/polyfills/customEvent';\r\nimport { RocEventType, ExtractEventParameters, RocEvent } from 'shared/events';\r\nimport addRocEventHandler from 'shared/util/events/rocEventUtils';\r\n\r\n/**\r\n * Helper function for dispatching ROC events.\r\n *\r\n * @param eventType The event type for the dispatcher\r\n */\r\nexport function dispatchRocEvent(eventType: T, data: ExtractEventParameters) {\r\n\tconst event = new CustomEvent(eventType, {\r\n\t\tdetail: data,\r\n\t});\r\n\tdocument.dispatchEvent(event);\r\n}\r\n\r\n/**\r\n * Reusable hook for handling ROC events\r\n *\r\n * @param eventType The type of event to handle\r\n * @param eventHandler The event handler\r\n * @param deps List of dependencies\r\n */\r\nexport default function useRocEventHandler(\r\n\teventType: T,\r\n\teventHandler: (data: ExtractEventParameters) => void,\r\n\tdeps?: any[],\r\n) {\r\n\tuseEffect(() => {\r\n\t\tconst removeHandlerCallback = addRocEventHandler(eventType, eventHandler);\r\n\r\n\t\treturn () => {\r\n\t\t\tremoveHandlerCallback();\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, deps);\r\n}\r\n","import React, { useContext } from 'react';\r\n\r\nimport { SearchStore } from 'store/Store';\r\nimport { useHawkState, SearchActor } from 'store/HawkState';\r\nimport { Request } from 'models/Search';\r\n\r\nconst HawkContext = React.createContext({} as HawkContextValue);\r\n\r\nexport interface HawkContextValue {\r\n\t/** The store of data used throughout the application. */\r\n\tstore: SearchStore;\r\n\r\n\t/**\r\n\t * An interface that allows actions to be performed on the store (such as executing searches,\r\n\t * changing pages, etc).\r\n\t */\r\n\tactor: SearchActor;\r\n}\r\n\r\nexport interface HawkStoreProviderProps {\r\n\t/** The initial search to perform when initializing the search components. */\r\n\tinitialSearch?: Partial;\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * This component acts as the global store for the hawksearch application state. Only one instance of this component\r\n * should exist, and it should be the root level component.\r\n */\r\nfunction StoreProvider({ initialSearch, children }: HawkStoreProviderProps) {\r\n\tconst [store, actor] = useHawkState(initialSearch);\r\n\r\n\treturn {children};\r\n}\r\n\r\n/**\r\n * Retrieves the global hawk store for use within a component.\r\n */\r\nexport function useHawkSearch() {\r\n\treturn useContext(HawkContext);\r\n}\r\n\r\nexport default StoreProvider;\r\n","import React from 'react';\r\nimport { SVGProps } from './SVGProps';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * X SVG\r\n *\r\n * @returns\r\n */\r\nfunction XSVG({ className, ...rest }: SVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default XSVG;\r\n","import AxiosHelper from 'services/AxiosHelper';\r\nimport { AxiosResponse } from 'axios';\r\n\r\nexport interface UserSummary {\r\n\tisSignedIn: boolean;\r\n\tuserName: string | null;\r\n\tfirstName: string | null;\r\n\tlastName: string | null;\r\n\temail: string | null;\r\n\tphoneNumber: string | null;\r\n\ttwoFactorEnabled: boolean;\r\n\thasRecoveryCodes: boolean;\r\n\tisMachineRemembered: boolean;\r\n\tannouncements: UserAnnouncement[];\r\n\tisExternalLoginUser: boolean;\r\n\t// #region HCL\r\n\tversaPayEnabled: boolean;\r\n\tversaPayRedirectUrl: string | null;\r\n\tazureUserId: string | null;\r\n\t// #endregion\r\n}\r\n\r\n/** Represents the details about an admin impersonation session of the logged in user. */\r\nexport interface Impersonation {\r\n\t/** The id of the admin impersonating the front end user. */\r\n\timpersonatorId: string;\r\n\r\n\t/** The name of the admin impersonating the front end user. */\r\n\timpersonatorName: string;\r\n\r\n\t/** The id of the active user impersonation session. */\r\n\tsessionId: string;\r\n}\r\n\r\nexport interface UserData {\r\n\t/**\r\n\t * Summary of user-specific details\r\n\t */\r\n\tsummary?: UserSummary;\r\n\r\n\t/**\r\n\t * CSRF validation token generated by the server\r\n\t */\r\n\trequestToken?: string;\r\n\r\n\t/**\r\n\t * The information on an impersonation session if one is active.\r\n\t * If an impersonation session isn't active this field will be undefined.\r\n\t */\r\n\timpersonation?: Impersonation;\r\n}\r\n\r\nexport interface UserAnnouncement {\r\n\t/** The id used as the primary key for the announcement in the database */\r\n\tid: string;\r\n\r\n\t/** An announcement to be displayed to the user */\r\n\tmessage: string;\r\n\r\n\t/** A list of pages where the announcement will be displayed. This will be an empty array if it is to be displayed on all pages. */\r\n\tpages: string[];\r\n}\r\n\r\nlet userDataPromise: Promise> | null = null;\r\n\r\n/**\r\n * Returns details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserData = () => {\r\n\tif (userDataPromise === null) {\r\n\t\tuserDataPromise = AxiosHelper.get('/ajax/user');\r\n\t}\r\n\r\n\treturn userDataPromise;\r\n};\r\n\r\n/**\r\n * Returns non-cached details related to the current user. By default, this is primarily their first/last name\r\n * and whether they are logged in or not. This can customized to include more details if necessary.\r\n */\r\nexport const getUserDataNoCache = () => {\r\n\treturn AxiosHelper.get('/ajax/user');\r\n};\r\n\r\n/**\r\n * Returns a promise that will contain the CSRF token generated on the server to be used to validate\r\n * forms being posted via AJAX.\r\n */\r\nexport async function getCsrfToken() {\r\n\ttry {\r\n\t\tconst userData = await getUserData();\r\n\t\treturn userData.data.requestToken;\r\n\t} catch (error) {\r\n\t\tconsole.warn('Unable to load CSRF token.');\r\n\t\treturn '';\r\n\t}\r\n}\r\n\r\n// #region Commerce\r\nimport { CartSummary } from './UserData.Commerce';\r\nimport { LocationDto } from 'features/commerce/store-locator/types';\r\nimport { OrganizationInvite, OrganizationShipTo } from 'shared-client/types/commerce/organization';\r\nimport { AutoSuggestOption } from '../../../Roc.SharedClientApp/types/fields';\r\n\r\n// Commerce extensions to the UserData interface\r\nexport interface UserData {\r\n\t// #region HCL - allows null\r\n\tcartSummary?: CartSummary | null;\r\n\t// #endregion\r\n\r\n\t/***\r\n\t * The customer's default store location or null if not set\r\n\t */\r\n\tdefaultStoreLocation?: LocationDto | null;\r\n\r\n\t/**\r\n\t * If store is enabled for this site\r\n\t */\r\n\tenableStoreLocation?: boolean;\r\n}\r\n\r\n/***\r\n * Organization data and permissions\r\n */\r\nexport interface Organization {\r\n\tid: string;\r\n\tpurchaseOrderNumberRequired: boolean;\r\n\tcreditCardAllowed: boolean;\r\n\tgiftCardAllowed: boolean;\r\n\torganizationName: string;\r\n\tcorpAccountAllowed: boolean;\r\n}\r\n\r\n/***\r\n * Organization dto data\r\n */\r\nexport interface OrganizationDto extends AutoSuggestOption {}\r\n\r\n/***\r\n * User's organization and permissions data\r\n */\r\nexport interface UserSummary {\r\n\t/***\r\n\t * User's current default organization\r\n\t */\r\n\torganization: Organization | null;\r\n\r\n\t/***\r\n\t * The list of organizations the user is part of\r\n\t */\r\n\tuserOrganizations?: OrganizationDto[] | null;\r\n\r\n\t/***\r\n\t * The selected organization ship to\r\n\t */\r\n\tselectedShipTo: OrganizationShipTo | null;\r\n\r\n\t/***\r\n\t * Defines if the user has multiple shiptos to select from\r\n\t */\r\n\thasMultipleShipTos: boolean | null;\r\n\r\n\t/***\r\n\t * Defines if the user has saved payment methods\r\n\t */\r\n\thasSavedPaymentMethods: boolean | null;\r\n\r\n\t/***\r\n\t * The list of user permissions\r\n\t */\r\n\tpermissions?: UserPermissions;\r\n\r\n\t/***\r\n\t * The list of organizations the user is invited to join\r\n\t */\r\n\torganizationInvites?: OrganizationInvite[];\r\n\r\n\t/***\r\n\t * The user organization removal notification\r\n\t * Used to notify the user if he is no more part of his default organization\r\n\t */\r\n\tuserOrganizationRemovalNotification?: string;\r\n}\r\n\r\n/***\r\n * User's permissions\r\n */\r\nexport interface UserPermissions {\r\n\t/***\r\n\t * Defines if the current user can see organization users\r\n\t */\r\n\tcanSeeOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can assign roles to organization users\r\n\t */\r\n\tcanAssignRolesToOrganizationUsers?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can remove users from an organization\r\n\t */\r\n\tremoveUserFromOrganization?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can create organization users\r\n\t */\r\n\tcreateOrganizationUser?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can enable/disable ShipTos for organization users\r\n\t */\r\n\tmanageShipTosAssociation?: boolean;\r\n\r\n\t/***\r\n\t * Defines if the current user can see status of the organization users\r\n\t */\r\n\tcanSeePendingOrganizationUsers?: boolean;\r\n}\r\n// #endregion\r\n","import React from 'react';\r\nimport InlineAlert from 'shared/edit/InlineAlert';\r\n\r\n// eslint-disable-next-line\r\n// tslint:disable-next-line\r\nexport interface ErrorBoundaryRenderProps extends ErrorBoundaryState {}\r\n\r\nexport interface ErrorBoundaryProps {\r\n\tchildren: React.ReactNode;\r\n\trenderError?: (renderProps: ErrorBoundaryRenderProps) => React.ReactNode;\r\n}\r\n\r\nexport interface ErrorBoundaryState {\r\n\terror?: Error;\r\n}\r\n\r\n/**\r\n * Default Error Boundary component for frontend components, so that in case a JS error occurs, we show\r\n * something instead of nothing.\r\n */\r\nexport default class ErrorBoundary extends React.Component {\r\n\tpublic static defaultProps = {\r\n\t\trenderError: (renderProps: ErrorBoundaryRenderProps) => ,\r\n\t};\r\n\r\n\tpublic state: ErrorBoundaryState = {};\r\n\r\n\tpublic componentDidCatch(error: Error) {\r\n\t\tif (error.name === 'ChunkLoadError') {\r\n\t\t\tconst lastRefreshedTimestamp = new Date(\r\n\t\t\t\tparseInt(window.localStorage.getItem('force-refresh-timestamp') || '0'),\r\n\t\t\t);\r\n\t\t\tconst pageAlreadyRefreshedLessThan30SecondsAgo =\r\n\t\t\t\tnew Date(lastRefreshedTimestamp.getTime() + 30 * 1000) > new Date();\r\n\r\n\t\t\tif (!pageAlreadyRefreshedLessThan30SecondsAgo) {\r\n\t\t\t\t// Assuming that the user is not on the latest version of the application. Refresh the page immediately.\r\n\t\t\t\twindow.localStorage.setItem('force-refresh-timestamp', new Date().getTime().toString());\r\n\t\t\t\treturn window.location.reload();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setState({\r\n\t\t\terror,\r\n\t\t});\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tif (this.state.error) {\r\n\t\t\treturn this.props.renderError!(this.state);\r\n\t\t}\r\n\r\n\t\treturn this.props.children;\r\n\t}\r\n}\r\n","import { ServerData } from 'services/ServerData';\r\n\r\nexport default {\r\n\tBaseUrl: ServerData.ACCOUNT_URL_BASE ?? '/my-account',\r\n\tLogin: ServerData.ACCOUNT_LOGIN_URL ?? '/my-account/login',\r\n\tLogin2fa: ServerData.ACCOUNT_LOGIN_WITH_2FA_URL ?? '/my-account/login-with-2fa',\r\n\tRegister: ServerData.ACCOUNT_REGISTER_URL ?? '/my-account/register',\r\n\tForgotPassword: ServerData.ACCOUNT_FORGOT_PASSWORD_URL ?? '/my-account/forgot-password',\r\n\tLoginWithRecoveryCode: ServerData.ACCOUNT_LOGIN_WITH_RECOVERY_CODE_URL ?? '/my-account/login-with-recovery-code',\r\n\tLogout: ServerData.ACCOUNT_LOGOUT_URL ?? '/my-account/logout',\r\n\t// #region Commerce\r\n\tOrganizationReview: ServerData.ACCOUNT_ORGANIZATION_REVIEW_URL ?? '/my-account/organization-review',\r\n\tOrganizationSelector: ServerData.ACCOUNT_ORGANIZATION_SELECTOR_URL ?? '/my-account/organization-selector',\r\n\t// #endregion\r\n\t// #region HCL - hardcoded same way as external login is\r\n\tExternalLogout: '/my-account/external-logout',\r\n\t// #endregion\r\n};\r\n","import { AxiosError } from 'axios';\r\nimport RocHawkConfig from 'features/search/RocHawkConfig';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { getCookie, setCookie } from 'shared/components/hawksearch/helpers/Cookies';\r\nimport { ExtractEventParameters } from 'shared/events';\r\n//#region Commerce\r\nimport { CommercePageType, CommerceSuggestType, trackCommerce } from '../commerce/hawksearch/tracking-commerce';\r\n//#endregion\r\n\r\nexport interface HawkSearch {\r\n\tClientGuid: string;\r\n\tContext: ContextDictionary;\r\n\tCustomContext: ContextDictionary;\r\n\tTrackingUrl: string | null;\r\n\tinitCustomEvents?: () => void;\r\n}\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\tHawkSearch: HawkSearch;\r\n\t}\r\n}\r\n\r\nexport enum EventTrackingType {\r\n\tpageLoad = 1,\r\n\tsearch = 2,\r\n\tclick = 3,\r\n\tbannerClick = 7,\r\n\tbannerImpression = 8,\r\n\trecommendationClick = 10,\r\n\tautoCompleteClick = 11,\r\n}\r\n\r\n/**\r\n * The page type\r\n */\r\nexport enum PageType {\r\n\t/**\r\n\t * Landing Page\r\n\t */\r\n\tlanding = 2,\r\n\t/**\r\n\t * All other Page Types\r\n\t */\r\n\tcustom = 5,\r\n}\r\n\r\nexport enum SuggestType {\r\n\tPopularSearches = 1,\r\n\tTopContentMatches = 4,\r\n}\r\n\r\nexport enum SearchType {\r\n\tInitial = 1,\r\n\tRefinement = 2,\r\n}\r\n\r\ntype HawkEvents =\r\n\t| ({ name: 'pageload' } & TrackPageLoadArgs)\r\n\t| ({ name: 'searchtracking' } & TrackSearchTrackingArgs)\r\n\t| ({ name: 'click' } & TrackClickArgs)\r\n\t| ({ name: 'bannerclick' } & TrackBannerClickArgs)\r\n\t| ({ name: 'bannerimpression' } & TrackBannerImpressionArgs)\r\n\t| ({ name: 'autocompleteclick' } & TrackAutoCompleteClickArgs)\r\n\t| ({ name: 'recommendationclick' } & TrackRecommendationClickArgs);\r\n\r\nexport type HawkEventType = HawkEvents['name'];\r\n\r\nfunction track(eventName: T, args: ExtractEventParameters) {\r\n\tswitch (eventName.toLocaleLowerCase()) {\r\n\t\tcase 'pageload':\r\n\t\t\t//HawkSearch.Context.add(\"uniqueid\", \"123456789\");\r\n\t\t\t//HawkSearch.Tracking.track('pageload',{pageType: \"item\"});\r\n\t\t\treturn trackPageLoad((args as unknown) as TrackPageLoadArgs);\r\n\t\tcase 'searchtracking':\r\n\t\t\t//HawkSearch.Tracking.track(\"searchtracking\", {trackingId:\"a9bd6e50-e434-45b9-9f66-489eca07ad0a\", typeId: HawkSearch.Tracking.SearchType.Initial});\r\n\t\t\t//HawkSearch.Tracking.track(\"searchtracking\", {trackingId:\"a9bd6e50-e434-45b9-9f66-489eca07ad0a\", typeId: HawkSearch.Tracking.SearchType.Refinement});\r\n\t\t\treturn trackSearchTracking((args as unknown) as TrackSearchTrackingArgs);\r\n\t\tcase 'click':\r\n\t\t\t//HawkSearch.Tracking.track('click',{event: e, uniqueId: \"33333\", trackingId: \"75a0801a-a93c-4bcb-81f1-f4b011f616e3\"});\r\n\t\t\treturn trackClick((args as unknown) as TrackClickArgs);\r\n\t\tcase 'bannerclick':\r\n\t\t\t//HawkSearch.Tracking.track('bannerclick',{bannerId: 1, campaignId: 2, trackingId:\"2d652a1e-2e05-4414-9d76-51979109f724\"});\r\n\t\t\treturn trackBannerClick((args as unknown) as TrackBannerClickArgs);\r\n\t\tcase 'bannerimpression':\r\n\t\t\t//HawkSearch.Tracking.track('bannerimpression',{bannerId: \"2\", campaignId: \"2\", trackingId:\"2d652a1e-2e05-4414-9d76-51979109f724\"});\r\n\t\t\treturn trackBannerImpression((args as unknown) as TrackBannerImpressionArgs);\r\n\t\tcase 'autocompleteclick':\r\n\t\t\t//HawkSearch.Tracking.track('autocompleteclick',{keyword: \"test\", suggestType: HawkSearch.Tracking.SuggestType.PopularSearches, name:\"tester\", url:\"/test\"});\r\n\t\t\treturn trackAutoCompleteClick((args as unknown) as TrackAutoCompleteClickArgs);\r\n\t\tcase 'recommendationclick':\r\n\t\t\t//HawkSearch.Tracking.track('recommendationclick',{uniqueId: \"223222\", itemIndex: \"222\", widgetGuid:\"2d652a1e-2e05-4414-9d76-51979109f724\", requestId:\"2d652a1e-2e05-4414-9d76-51979109f724\"});\r\n\t\t\treturn trackRecommendationClick((args as unknown) as TrackRecommendationClickArgs);\r\n\t}\r\n}\r\n\r\nfunction getVisitorExpiry() {\r\n\tconst d = new Date();\r\n\t// 1 year\r\n\td.setTime(d.getTime() + 360 * 24 * 60 * 60 * 1000);\r\n\treturn d.toUTCString();\r\n}\r\n\r\nfunction getVisitExpiry() {\r\n\tconst d = new Date();\r\n\t// 4 hours\r\n\td.setTime(d.getTime() + 4 * 60 * 60 * 1000);\r\n\treturn d.toUTCString();\r\n}\r\n\r\nfunction createGuid() {\r\n\tconst s: string[] = [];\r\n\tconst hexDigits = '0123456789abcdef';\r\n\tfor (let i = 0; i < 36; i++) {\r\n\t\ts[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\r\n\t}\r\n\ts[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010\r\n\ts[19] = hexDigits.substr(((s[19] as any) & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01\r\n\ts[8] = s[13] = s[18] = s[23] = '-';\r\n\r\n\treturn s.join('');\r\n}\r\n\r\ntype TrackPageLoadArgs = {\r\n\t/**\r\n\t * The page type\r\n\t */\r\n\tpageType:\r\n\t\t| PageType\r\n\t\t// #region Commerce\r\n\t\t| CommercePageType;\r\n\t// #endregion\r\n\r\n\t/**\r\n\t * Unique identifier of item that was clicked\r\n\t */\r\n\tuniqueId?: string;\r\n};\r\n\r\nfunction trackPageLoad({ pageType, uniqueId }: TrackPageLoadArgs) {\r\n\tconst { clientHeight, clientWidth } = document.documentElement;\r\n\r\n\tconst payload = {\r\n\t\tEventType: EventTrackingType.pageLoad,\r\n\t\tEventData: preparePayload({\r\n\t\t\tPageTypeId: pageType,\r\n\t\t\tRequestPath: window.location.pathname,\r\n\t\t\tQs: window.location.search,\r\n\t\t\tViewportHeight: clientHeight,\r\n\t\t\tViewportWidth: clientWidth,\r\n\t\t\tUniqueId: uniqueId,\r\n\t\t}),\r\n\t};\r\n\r\n\tmakeRequest(payload);\r\n}\r\n\r\ntype TrackSearchTrackingArgs = {\r\n\t/**\r\n\t * The ‘TrackingId’ object that is passed in this function is returned in the Hawksearch response\r\n\t */\r\n\ttrackingId: string;\r\n\t/**\r\n\t * The type of search that is performed\r\n\t */\r\n\ttypeId: SearchType;\r\n};\r\n\r\nfunction trackSearchTracking({ trackingId, typeId }: TrackSearchTrackingArgs) {\r\n\tif (typeId == SearchType.Initial) {\r\n\t\tsetCookie('hawk_query_id', createGuid());\r\n\t}\r\n\r\n\tconst queryId = getCookie('hawk_query_id');\r\n\tconst { clientHeight, clientWidth } = document.documentElement;\r\n\tconst payload = {\r\n\t\tEventType: EventTrackingType.search,\r\n\t\tEventData: preparePayload({\r\n\t\t\tQueryId: queryId,\r\n\t\t\tTrackingId: trackingId,\r\n\t\t\tTypeId: typeId,\r\n\t\t\tViewportHeight: clientHeight,\r\n\t\t\tViewportWidth: clientWidth,\r\n\t\t}),\r\n\t};\r\n\r\n\tmakeRequest(payload);\r\n}\r\n\r\ntype TrackClickArgs = {\r\n\t/**\r\n\t * Unique identifier of item that was clicked\r\n\t */\r\n\tuniqueId: string;\r\n\t/**\r\n\t * This is the TrackingId that was passed back in the search response\r\n\t */\r\n\ttrackingId: string;\r\n\t/**\r\n\t * Target URL that clicked element points to\r\n\t */\r\n\turl: string;\r\n};\r\n\r\nfunction trackClick({ uniqueId, trackingId, url }: TrackClickArgs) {\r\n\tconst { clientHeight, clientWidth } = document.documentElement;\r\n\r\n\tconst payload = {\r\n\t\tEventType: EventTrackingType.click,\r\n\t\tEventData: preparePayload({\r\n\t\t\tUrl: url,\r\n\t\t\tQs: window.location.search,\r\n\t\t\tRequestPath: window.location.pathname,\r\n\t\t\tTrackingId: trackingId,\r\n\t\t\tUniqueId: uniqueId,\r\n\t\t\tViewportHeight: clientHeight,\r\n\t\t\tViewportWidth: clientWidth,\r\n\t\t}),\r\n\t};\r\n\r\n\tmakeRequest(payload);\r\n}\r\n\r\ntype TrackBannerClickArgs = {\r\n\t/**\r\n\t * The identifier of corresponding banner\r\n\t */\r\n\tbannerId: string;\r\n\t/**\r\n\t * The identifier of corresponding campaign (optional)\r\n\t */\r\n\tcampaignId: string;\r\n\t/**\r\n\t * The ‘TrackingId’ object that is passed in this function is returned in the Hawksearch response\r\n\t */\r\n\ttrackingId: string;\r\n};\r\n\r\nfunction trackBannerClick({ bannerId, trackingId, campaignId }: TrackBannerClickArgs) {\r\n\tconst payload = {\r\n\t\tEventType: EventTrackingType.bannerClick,\r\n\t\tEventData: preparePayload({\r\n\t\t\tCampaignId: campaignId,\r\n\t\t\tBannerId: bannerId,\r\n\t\t\tTrackingId: trackingId,\r\n\t\t}),\r\n\t};\r\n\r\n\tmakeRequest(payload);\r\n}\r\n\r\ntype TrackBannerImpressionArgs = TrackBannerClickArgs;\r\n\r\nfunction trackBannerImpression({ bannerId, campaignId, trackingId }: TrackBannerImpressionArgs) {\r\n\tconst payload = {\r\n\t\tEventType: EventTrackingType.bannerImpression,\r\n\t\tEventData: preparePayload({\r\n\t\t\tCampaignId: campaignId,\r\n\t\t\tBannerId: bannerId,\r\n\t\t\tTrackingId: trackingId,\r\n\t\t}),\r\n\t};\r\n\tmakeRequest(payload);\r\n}\r\n\r\ntype TrackAutoCompleteClickArgs = {\r\n\t/**\r\n\t * Selected keyword used as a autocomplete query\r\n\t */\r\n\tkeyword: string;\r\n\t/**\r\n\t * The type of autocomplete results type\r\n\t */\r\n\tsuggestType?: SuggestType | CommerceSuggestType;\r\n\t/**\r\n\t * Text value associated with the autocomplete item clicked\r\n\t */\r\n\titemName: string;\r\n\t/**\r\n\t * The target URL of clicked autocomplete item\r\n\t */\r\n\turl: string;\r\n};\r\n\r\nfunction trackAutoCompleteClick({ keyword, suggestType, itemName, url }: TrackAutoCompleteClickArgs) {\r\n\tconst payload = {\r\n\t\tEventType: EventTrackingType.autoCompleteClick,\r\n\t\tEventData: preparePayload({\r\n\t\t\tKeyword: keyword,\r\n\t\t\tName: itemName,\r\n\t\t\tSuggestType: suggestType,\r\n\t\t\tUrl: url,\r\n\t\t}),\r\n\t};\r\n\r\n\tmakeRequest(payload);\r\n}\r\n\r\ntype TrackRecommendationClickArgs = {\r\n\t/**\r\n\t * The unique identifier of the recommendation widget that displayed clicked item. This should correspond to the widget GUID generated for each widget individually in Hawksearch dashboard\r\n\t */\r\n\twidgetGuid: string;\r\n\t/**\r\n\t * Represents the unique identifier of a product. This should correspond to the value of the field set up as the primary key in the fields section of Hawksearch dashboard.\r\n\t */\r\n\tuniqueId: string;\r\n\t/**\r\n\t * The number of the clicked recommendation item on the displayed widget.\r\n\t */\r\n\titemIndex: number;\r\n\t/**\r\n\t * The ‘RequestId’ object that is passed in this function is returned in the recommendation widget response\r\n\t */\r\n\trequestId: string;\r\n};\r\n\r\nfunction trackRecommendationClick({ widgetGuid, uniqueId, itemIndex, requestId }: TrackRecommendationClickArgs) {\r\n\tconst payload = {\r\n\t\tEventType: EventTrackingType.recommendationClick,\r\n\t\tEventData: preparePayload({\r\n\t\t\tItemIndex: itemIndex,\r\n\t\t\tRequestId: requestId,\r\n\t\t\tUniqueId: uniqueId,\r\n\t\t\tWidgetGuid: widgetGuid,\r\n\t\t}),\r\n\t};\r\n\r\n\tmakeRequest(payload);\r\n}\r\n\r\n// #region HCL\r\nfunction safeBtoa(input: string): string {\r\n\t// Encode the string into UTF-8 and then to base64\r\n\tconst utf8Bytes = new TextEncoder().encode(input);\r\n\treturn btoa(String.fromCharCode(...utf8Bytes));\r\n}\r\n// #endregion\r\n\r\nexport function preparePayload(payload: any) {\r\n\t// #region HCL\r\n\treturn safeBtoa(JSON.stringify(payload));\r\n\t// #endregion\r\n}\r\n\r\nexport function makeRequest(data) {\r\n\tif (!HawkSearch.TrackingUrl) {\r\n\t\tconsole.warn(\r\n\t\t\t\"Unable to send tracking event to HawkSearch because site's configuration is missing tracking URL.\",\r\n\t\t);\r\n\t\treturn;\r\n\t}\r\n\r\n\tlet visitId = getCookie('hawk_visit_id');\r\n\tlet visitorId = getCookie('hawk_visitor_id');\r\n\tconst isNewVisitor = !visitId || !visitorId;\r\n\r\n\tif (!visitId) {\r\n\t\tsetCookie('hawk_visit_id', createGuid(), getVisitExpiry());\r\n\t\tvisitId = getCookie('hawk_visit_id');\r\n\t}\r\n\r\n\tif (!visitorId) {\r\n\t\tsetCookie('hawk_visitor_id', createGuid(), getVisitorExpiry());\r\n\t\tvisitorId = getCookie('hawk_visitor_id');\r\n\t}\r\n\r\n\tif (isNewVisitor) {\r\n\t\tAxiosHelper.post('/ajax/hawksearch/identify', {\r\n\t\t\tvisitId: visitId,\r\n\t\t\tvisitorId: visitorId,\r\n\t\t});\r\n\t}\r\n\r\n\tconst payload = Object.assign(\r\n\t\t{\r\n\t\t\tClientGuid: HawkSearch.ClientGuid,\r\n\t\t\tVisitId: visitId,\r\n\t\t\tVisitorId: visitorId,\r\n\t\t\tTrackingProperties: HawkSearch.Context,\r\n\t\t\tCustomDictionary: HawkSearch.CustomContext,\r\n\t\t},\r\n\t\tdata,\r\n\t);\r\n\r\n\t// #region HCL\r\n\tAxiosHelper.post('/ajax/hawksearch/trackevent', { request: payload })\r\n\t\t// #endregion\r\n\t\t.then((response) => {\r\n\t\t\tconsole.log('Success:', response.statusText);\r\n\t\t})\r\n\t\t.catch((error: AxiosError) => {\r\n\t\t\tconsole.error('Error:', error);\r\n\t\t});\r\n}\r\n\r\n// TODO: add comments about what this is for? i think it has to do with timing between hawksearch.js and this script?\r\nfunction init() {\r\n\tif (window.HawkSearch && typeof window.HawkSearch.initCustomEvents === 'function') {\r\n\t\twindow.HawkSearch.initCustomEvents();\r\n\t}\r\n}\r\n\r\nif (document.readyState === 'complete' || document.readyState === 'interactive') {\r\n\tsetTimeout(init);\r\n} else {\r\n\tdocument.addEventListener('DOMContentLoaded', init);\r\n}\r\n\r\nclass ContextDictionary {\r\n\tadd(key: string, value: any) {\r\n\t\tthis[key] = value;\r\n\t}\r\n\r\n\tclear() {\r\n\t\tfor (const key in this) {\r\n\t\t\tthis.remove(key);\r\n\t\t}\r\n\t}\r\n\r\n\tremove(key: string) {\r\n\t\tif (this.hasOwnProperty(key)) {\r\n\t\t\tdelete this[key];\r\n\t\t}\r\n\t}\r\n\r\n\tpush(key: string, value: any) {\r\n\t\tif (this.hasOwnProperty(key)) {\r\n\t\t\tconst existingValue = this[key];\r\n\t\t\tthis[key] = `${existingValue},${value}`;\r\n\t\t} else {\r\n\t\t\tthis.add(key, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nconst Context = new ContextDictionary();\r\nconst CustomContext = new ContextDictionary();\r\n\r\n// initialize HawkSearch with values from RocHawkConfig\r\nif (!window.HawkSearch) {\r\n\twindow.HawkSearch = {\r\n\t\tClientGuid: RocHawkConfig.clientGuid,\r\n\t\tTrackingUrl: RocHawkConfig.trackingUrl,\r\n\t\tContext: Context,\r\n\t\tCustomContext: CustomContext,\r\n\t};\r\n}\r\n\r\nconst HawkSearch = window.HawkSearch;\r\n\r\nexport default {\r\n\tTracking: {\r\n\t\ttrack,\r\n\t\t// #region Commerce\r\n\t\ttrackCommerce,\r\n\t\t// #endregion\r\n\t},\r\n\tContext,\r\n\tCustomContext,\r\n};\r\n","import { Response, Request, Result } from 'models/Search';\r\nimport { Value, Facet } from 'models/Facets';\r\nimport { ClientSelections, ClientSelectionValue } from 'store/ClientSelections';\r\nimport { CompareResultObject } from '../models/CompareResultObject';\r\n\r\nexport enum FacetSelectionState {\r\n\t/** The facet value is not selected. */\r\n\tNotSelected,\r\n\t/** The facet value is selected. */\r\n\tSelected,\r\n\t/** The facet value is selected, but negated. */\r\n\tNegated,\r\n}\r\n\r\nexport interface SelectionInfo {\r\n\t/** The facet value selection state. */\r\n\tstate: FacetSelectionState;\r\n\r\n\t/**\r\n\t * If the facet value is `FacetSelectionState.Selected` or `FacetSelectionState.Negated`, this is the value of\r\n\t * the facet value. For negated facet values this will be prefixed with the negation character `'-'`.\r\n\t */\r\n\tselectedValue?: string;\r\n\r\n\t/**\r\n\t * If the facet value is `FacetSelectionState.Selected` or `FacetSelectionState.Negated`, this is the index\r\n\t * into the `pendingSearch.FacetSelections[facetName]` array for this facet value.\r\n\t */\r\n\tselectionIndex?: number;\r\n}\r\n\r\nexport class SearchStore {\r\n\t/** This represents the next search request that will be executed. */\r\n\tpublic pendingSearch: Partial;\r\n\r\n\t/**\r\n\t * Whether or not the next search request will perform history actions (pushing the search into browser\r\n\t * history).\r\n\t */\r\n\tpublic doHistory: boolean;\r\n\r\n\t/** Whether or not a search request is waiting for completion. */\r\n\tpublic isLoading: boolean;\r\n\r\n\tpublic itemsToCompare: Result[];\r\n\tpublic itemsToCompareIds: string[];\r\n\tpublic comparedResults: CompareResultObject[];\r\n\r\n\t/** The results of the last search request, if one has been performed. Otherwise, `undefined`. */\r\n\tpublic searchResults?: Response;\r\n\r\n\tpublic requestError: boolean;\r\n\r\n\tpublic constructor(initial?: Partial) {\r\n\t\tObject.assign(this, initial);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns whether or not this is the initial load of the search results.\r\n\t */\r\n\tpublic get isInitialLoad() {\r\n\t\treturn this.isLoading && !this.searchResults;\r\n\t}\r\n\r\n\t/**\r\n\t * Determines whether or not the given facet and facet value is selected, and returns info regarding the selection.\r\n\t * @param facet The facet for which the facet value will be checked for selection.\r\n\t * @param facetValue The facet value that will be checked for selection.\r\n\t */\r\n\tpublic isFacetSelected(facet: Facet | string, facetValue: Value | string): SelectionInfo {\r\n\t\tconst facetName = typeof facet === 'string' ? facet : facet.Name;\r\n\t\tconst facetField = typeof facet === 'string' ? facet : facet.selectionField;\r\n\r\n\t\t/* #region HCL */\r\n\t\tconst valueValue = (typeof facetValue === 'string' ? facetValue : facetValue.Value)?.replace(/%c%/g, ',');\r\n\t\t/* #endregion */\r\n\t\tconst valueLabel = typeof facetValue === 'string' ? facetValue : facetValue.Label;\r\n\r\n\t\tif (!valueValue) {\r\n\t\t\tconsole.error(`Facet ${facetName} (${facetField}) has no facet value for ${valueLabel}`);\r\n\t\t\treturn { state: FacetSelectionState.NotSelected };\r\n\t\t}\r\n\r\n\t\tconst facetSelections = this.pendingSearch.FacetSelections;\r\n\r\n\t\tif (!facetSelections || !facetSelections[facetField]) {\r\n\t\t\treturn { state: FacetSelectionState.NotSelected };\r\n\t\t}\r\n\r\n\t\tconst selectionIdx = facetSelections[facetField]!.indexOf(valueValue);\r\n\t\tconst negationIdx = facetSelections[facetField]!.indexOf(`-${valueValue}`);\r\n\r\n\t\tif (selectionIdx !== -1) {\r\n\t\t\t// if the exact facet value exists, then we're normally selected\r\n\t\t\treturn {\r\n\t\t\t\tstate: FacetSelectionState.Selected,\r\n\t\t\t\tselectedValue: valueValue,\r\n\t\t\t\tselectionIndex: selectionIdx,\r\n\t\t\t};\r\n\t\t} else if (negationIdx !== -1) {\r\n\t\t\t// if the facet value is selected but prefixed with a -, then we're negated\r\n\t\t\treturn {\r\n\t\t\t\tstate: FacetSelectionState.Negated,\r\n\t\t\t\tselectedValue: `-${valueValue}`,\r\n\t\t\t\tselectionIndex: negationIdx,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn { state: FacetSelectionState.NotSelected };\r\n\t}\r\n\r\n\t/**\r\n\t * Returns an object containing the selections that have been made in both the next search request and also\r\n\t * in the previous search request. This should be used when iterating selections instead of pulling the values\r\n\t * out from the search result or pending search - as this will merge the values together and provide an accurate\r\n\t * view of all facet selections.\r\n\t */\r\n\tpublic get facetSelections(): ClientSelections {\r\n\t\tconst {\r\n\t\t\tpendingSearch: { FacetSelections: clientSelections, SearchWithin },\r\n\t\t\tsearchResults,\r\n\t\t} = this;\r\n\r\n\t\tconst selections: ClientSelections = {};\r\n\r\n\t\tif (!clientSelections && !SearchWithin) {\r\n\t\t\treturn selections;\r\n\t\t}\r\n\r\n\t\t// if we've made selections on the client, transform these into more detailed selections.\r\n\t\t// the client-side selections are just facet fields and values without any labels - so we\r\n\t\t// need to combine this information with the list of facets received from the server in the\r\n\t\t// previous search in order to return a rich list of selections\r\n\r\n\t\tconst facets = searchResults ? searchResults.Facets : null;\r\n\r\n\t\tif (!facets) {\r\n\t\t\t// but we can only do this if we've received facet information from the server. without this\r\n\t\t\t// info we can't determine what labels should be used\r\n\t\t\treturn selections;\r\n\t\t}\r\n\r\n\t\t// manually handle the `searchWithin` selection, as this doesn't usually behave like a normal facet selection\r\n\t\t// but instead a field on the search request\r\n\t\tif (SearchWithin) {\r\n\t\t\tconst facet = facets.find((f) => f.selectionField === 'searchWithin');\r\n\r\n\t\t\tif (facet) {\r\n\t\t\t\tselections.searchWithin = {\r\n\t\t\t\t\tfacet,\r\n\t\t\t\t\tlabel: facet.Name,\r\n\t\t\t\t\titems: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tlabel: SearchWithin,\r\n\t\t\t\t\t\t\tvalue: SearchWithin,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t],\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!clientSelections) {\r\n\t\t\treturn selections;\r\n\t\t}\r\n\r\n\t\tObject.keys(clientSelections).forEach((fieldName) => {\r\n\t\t\tconst selectionValues = clientSelections[fieldName];\r\n\r\n\t\t\tif (!selectionValues) {\r\n\t\t\t\t// if this selection has no values, it's not really selected\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst facet = facets.find((f) => f.selectionField === fieldName);\r\n\r\n\t\t\tif (!facet) {\r\n\t\t\t\t// if there's no matching facet from the server, we can't show this since we'll have no labels\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst items: ClientSelectionValue[] = [];\r\n\r\n\t\t\tif (facet.FieldType === 'range') {\r\n\t\t\t\t// if the facet this selection is for is a range, there won't be a matching value and thus there won't be a label.\r\n\t\t\t\t// so because of this we'll just use the selection value as the label\r\n\r\n\t\t\t\tselectionValues.forEach((selectionValue) => {\r\n\t\t\t\t\titems.push({\r\n\t\t\t\t\t\tlabel: selectionValue,\r\n\t\t\t\t\t\tvalue: selectionValue,\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t} else if (facet.FieldType === 'tab') {\r\n\t\t\t\t// do not return the selection value for tab facet\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\t// for other types of facets, try to find a matching value\r\n\r\n\t\t\t\tselectionValues.forEach((selectionValue) => {\r\n\t\t\t\t\tconst matchingVal =\r\n\t\t\t\t\t\tthis.findMatchingValue(selectionValue, facet.Values) ||\r\n\t\t\t\t\t\tthis.findMatchingValue(selectionValue.replace(/,/g, '%c%'), facet.Values);\r\n\r\n\t\t\t\t\tif (!matchingVal || !matchingVal.Label) {\r\n\t\t\t\t\t\t// if there's no matching value from the server, we cannot display because there would\r\n\t\t\t\t\t\t// be no label - same if there's no label at all\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\titems.push({\r\n\t\t\t\t\t\tlabel: matchingVal.Label,\r\n\t\t\t\t\t\tvalue: selectionValue.replace(/%c%/g, ','),\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tselections[fieldName] = {\r\n\t\t\t\tfacet,\r\n\t\t\t\tlabel: facet.Name,\r\n\t\t\t\titems,\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn selections;\r\n\t}\r\n\r\n\tprivate findMatchingValue(selectionValue: string, facetValues: Value[]): Value | null {\r\n\t\tlet matchingValue: Value | null = null;\r\n\t\tif (!facetValues || facetValues.length === 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tfor (const facetValue of facetValues) {\r\n\t\t\tconst isMatchingVal = facetValue.Value === selectionValue || `-${facetValue.Value}` === selectionValue;\r\n\t\t\t// loop through children\r\n\t\t\tif (!isMatchingVal) {\r\n\t\t\t\tmatchingValue = this.findMatchingValue(selectionValue, facetValue.Children);\r\n\t\t\t} else {\r\n\t\t\t\tmatchingValue = facetValue;\r\n\t\t\t}\r\n\r\n\t\t\tif (matchingValue) {\r\n\t\t\t\treturn matchingValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn matchingValue;\r\n\t}\r\n}\r\n","import { ControllerStateAndHelpers } from 'downshift';\r\n\r\nexport enum SuggestionType {\r\n\tProduct = 'product',\r\n\tCategory = 'category',\r\n\tContent = 'content',\r\n\tPopular = 'popular',\r\n\tViewAll = 'viewall',\r\n}\r\nexport abstract class Suggestion {\r\n\tpublic SuggestionType: SuggestionType;\r\n\tpublic constructor(suggestionType: SuggestionType) {\r\n\t\tthis.SuggestionType = suggestionType;\r\n\t}\r\n}\r\n\r\nexport interface SuggestionStrategy {\r\n\thandleItemChange(item: Suggestion, downshift: ControllerStateAndHelpers): void;\r\n\ttoString(item: Suggestion): string;\r\n}\r\n\r\nexport interface SuggestionStrategyMatch {\r\n\ttype: SuggestionType;\r\n\tstrategy: SuggestionStrategy;\r\n}\r\n","// source: https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames\r\n/* eslint-disable no-var */\r\n(function () {\r\n\tif (Element.prototype.getAttributeNames == undefined) {\r\n\t\tElement.prototype.getAttributeNames = function () {\r\n\t\t\tvar attributes = this.attributes;\r\n\t\t\tvar length = attributes.length;\r\n\t\t\tvar result = new Array(length);\r\n\t\t\tfor (var i = 0; i < length; i++) {\r\n\t\t\t\tresult[i] = attributes[i].name;\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t};\r\n\t}\r\n})();\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport ErrorBoundary from './ErrorBoundary';\r\nimport { toCamelCase } from 'util/StringUtil';\r\nimport 'shared/polyfills/getAttributeNames';\r\nimport Spinner from 'shared/components/Spinner';\r\n\r\ninterface AttributeProps {\r\n\t[index: string]: string;\r\n}\r\n\r\nfunction getDataPropsFromAttributes(element: Element): AttributeProps {\r\n\tconst props: AttributeProps = {};\r\n\r\n\tconst dataAttributePrefix = 'data-';\r\n\r\n\tconst attributeNames = element.getAttributeNames().filter((s) => s.startsWith(dataAttributePrefix));\r\n\tfor (const attributeName of attributeNames) {\r\n\t\tconst strippedName = toCamelCase(attributeName.substring(dataAttributePrefix.length));\r\n\t\tprops[strippedName] = element.getAttribute(attributeName) ?? '';\r\n\t}\r\n\r\n\treturn props;\r\n}\r\n\r\n/**\r\n * A helper function to facilitate initializing react applications on top of server-side rendered elements.\r\n * @param getReactElement Function that returns the react component to render.\r\n * @param elementId The ID of the DOM element being targeted.\r\n */\r\nexport const initReactApp = (getReactElement: (props: unknown) => React.ReactElement, elementId: string) => {\r\n\tif (typeof getReactElement !== 'function' || !elementId) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst element = document.getElementById(elementId);\r\n\r\n\tif (!element) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`Element with ID '${elementId}' was not found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\tconsole.debug(`Rendering application inside element with ID ${elementId}.`);\r\n\t\tReactDOM.render(\r\n\t\t\t}>\r\n\t\t\t\t{getReactElement(props)}\r\n\t\t\t,\r\n\t\t\telement,\r\n\t\t);\r\n\t};\r\n};\r\n\r\nexport const initReactAppByAttribute = (\r\n\tgetReactElement: (props: unknown, domElement: Element) => React.ReactElement,\r\n\tattribute: string,\r\n) => {\r\n\tif (typeof getReactElement !== 'function' || !attribute) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn('A react element generator function and element ID are required.');\r\n\t\t};\r\n\t}\r\n\r\n\tconst elements = document.querySelectorAll(`[${attribute}]`);\r\n\r\n\tif (!elements || elements.length == 0) {\r\n\t\treturn () => {\r\n\t\t\tconsole.warn(\r\n\t\t\t\t`No elements with data attribute '${attribute}' were found. Did you forget to render it on the server or is this entry point not supposed to run?`,\r\n\t\t\t);\r\n\t\t};\r\n\t}\r\n\r\n\treturn () => {\r\n\t\tfor (let i = 0; i < elements.length; ++i) {\r\n\t\t\tconst element = elements[i];\r\n\t\t\tconst props = getDataPropsFromAttributes(element);\r\n\t\t\tconsole.debug(`Rendering application inside element with attribute ${attribute}.`);\r\n\t\t\tReactDOM.render(\r\n\t\t\t\t}>\r\n\t\t\t\t\t{getReactElement(props, element)}\r\n\t\t\t\t,\r\n\t\t\t\telement,\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n};\r\n","/**\r\n * @see HawkSearchConfig.apiUrl\r\n */\r\nexport const defaultApiUrl = 'https://searchapi-dev.hawksearch.net';\r\n\r\n/**\r\n * @see HawkSearchConfig.dashboardUrl\r\n */\r\nexport const defaultDashboardUrl = 'https://dev.hawksearch.net';\r\n\r\n/**\r\n * @see HawkSearchConfig.searchUrl\r\n */\r\nexport const defaultSearchUrl = '/api/v2/search';\r\n\r\n/**\r\n * @see HawkSearchConfig.autocompleteUrl\r\n */\r\nexport const defaultAutocompleteUrl = '/api/autocomplete';\r\n\r\n/**\r\n * @see HawkSearchConfig.searchPageUrl\r\n */\r\nexport const defaultSearchPageUrl = '/search';\r\n\r\n/**\r\n * Endpoint for hawksearch's compare api\r\n */\r\nexport const defaultCompareItemsURL = '/api/v2/compare';\r\n\r\n/**\r\n * @see HawkSearchConfig.recommendationUrl\r\n */\r\nexport const defaultRecommendationUrl = 'https://recs-dev.hawksearch.net';\r\n\r\n/**\r\n * @see HawkSearchConfig.recommendationWidgetUrl\r\n */\r\nexport const recommendationWidgetUrl = '/api/recommendation/v2/getwidgetitems';\r\n\r\n// #region HCL\r\n/**\r\n * @see HawkSearchConfig.enableRemovingDashesFromSearchKeyword\r\n */\r\nexport const enableRemovingDashesFromSearchKeyword = false;\r\n// #endregion\r\n","/**\r\n * Returns visitor expiry date for hawksearch visitor id stored in the cookie for the user.\r\n */\r\nexport function getVisitorExpiry() {\r\n\tconst d = new Date();\r\n\t// 1 year\r\n\td.setTime(d.getTime() + 360 * 24 * 60 * 60 * 1000);\r\n\treturn d.toUTCString();\r\n}\r\n\r\n/**\r\n * Returns visitor expiry date for hawksearch visit id stored in the cookie for the user.\r\n */\r\nexport function getVisitExpiry() {\r\n\tconst d = new Date();\r\n\t// 4 hours\r\n\td.setTime(d.getTime() + 4 * 60 * 60 * 1000);\r\n\treturn d.toUTCString();\r\n}\r\n\r\n/**\r\n * Creates GUID.\r\n */\r\nexport function createGuid() {\r\n\tconst s: string[] = [];\r\n\tconst hexDigits = '0123456789abcdef';\r\n\tfor (let i = 0; i < 36; i++) {\r\n\t\ts[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);\r\n\t}\r\n\ts[14] = '4'; // bits 12-15 of the time_hi_and_version field to 0010\r\n\ts[19] = hexDigits.substr(((s[19] as any) & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01\r\n\ts[8] = s[13] = s[18] = s[23] = '-';\r\n\r\n\treturn s.join('');\r\n}\r\n\r\n/**\r\n * Returns the cookie.\r\n */\r\nexport function getCookie(name) {\r\n\tconst nameEQ = name + '=';\r\n\tconst ca = document.cookie.split(';');\r\n\r\n\tfor (let i = 0; i < ca.length; i++) {\r\n\t\tlet cookie = ca[i];\r\n\r\n\t\twhile (cookie.charAt(0) == ' ') {\r\n\t\t\tcookie = cookie.substring(1, cookie.length);\r\n\t\t}\r\n\r\n\t\tif (cookie.indexOf(nameEQ) == 0) {\r\n\t\t\treturn cookie.substring(nameEQ.length, cookie.length);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n/**\r\n * Sets the cookie.\r\n */\r\nexport function setCookie(name: string, value: string, expiry?: string) {\r\n\tlet expires = '';\r\n\r\n\tif (expiry) {\r\n\t\texpires = '; expires=' + expiry;\r\n\t}\r\n\r\n\tdocument.cookie = name + '=' + value + expires + '; path=/';\r\n}\r\n","import { useState, useEffect } from 'react';\r\n\r\n/**\r\n * Reusable hook that returns true after a certain amount of time has passed. Useful to delay\r\n * displaying components in render functions.\r\n *\r\n * @export\r\n * @param {number} [waitMs=200]\r\n * @returns\r\n */\r\nexport default function useDelayedDisplay(waitMs: number = 200) {\r\n\tconst [display, setDisplay] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\t// after a set amount of time, show the spinner\r\n\t\tconst timeout = setTimeout(() => {\r\n\t\t\tsetDisplay(true);\r\n\t\t}, waitMs);\r\n\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(timeout);\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\treturn display;\r\n}\r\n","import * as React from 'react';\r\n\r\ninterface PlusSVGProps {\r\n\tclass?: string;\r\n}\r\n\r\n/**\r\n * Plus SVG\r\n *\r\n * @returns\r\n */\r\nfunction PlusThinSVG(props: PlusSVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default PlusThinSVG;\r\n","import * as React from 'react';\r\n\r\ninterface MinusSVGProps {\r\n\tclass?: string;\r\n}\r\n\r\n/**\r\n * Minus SVG\r\n *\r\n * @returns\r\n */\r\nfunction MinusThinSVG(props: MinusSVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default MinusThinSVG;\r\n","import React, { useContext, useState, useRef, MouseEvent } from 'react';\r\nimport { Facet as FacetModel, Value } from 'models/Facets';\r\nimport { useHawkSearch } from 'components/StoreProvider';\r\nimport PlusThinSVG from 'components/svg/PlusThinSVG';\r\nimport MinusThinSVG from 'components/svg/MinusThinSVG';\r\nimport { useTranslation } from 'react-i18next';\r\nimport type Tooltip from '@reach/tooltip';\r\nimport 'styles/node-modules/@reach/tooltip/styles.css';\r\nimport QuestionMarkCircleSVG from 'shared/components/svg/QuestionMarkCircleSVG';\r\nimport Spinner from 'shared/components/Spinner';\r\nimport classnames from 'classnames';\r\nconst LazyTooltip = React.lazy(() => import('@reach/tooltip'));\r\nconst FacetContext = React.createContext({} as FacetContextValue);\r\n\r\nexport interface FacetProps {\r\n\tfacet: FacetModel;\r\n\tchildren: React.ReactNode;\r\n\tonFacetChange: () => void;\r\n}\r\n\r\ninterface FacetContextValue {\r\n\t/** The facet model returned from the server for this facet. */\r\n\tfacet: FacetModel;\r\n\r\n\t/** Returns the state of the parent facet container. */\r\n\tstate: FacetState;\r\n\r\n\t/** An actor interface to perform actions for this facet. */\r\n\tactor: FacetActor;\r\n\r\n\trenderer: FacetRenderer;\r\n}\r\n\r\nexport interface FacetState {\r\n\t/**\r\n\t * An array of facet values for this facet. If this facet has a quick lookup search bar, this list\r\n\t * will be filtered by this quick lookup.\r\n\t */\r\n\tfacetValues: Value[];\r\n\r\n\t/**\r\n\t * If the facet is configured for filtering, this is the user's entered filter value. Updated on\r\n\t * immediately when the user types.\r\n\t */\r\n\tfilter: string;\r\n\r\n\t/** Whether or not this facet has its values truncated. */\r\n\tisTruncated: boolean;\r\n\r\n\t/** Whether or not this facet is collapsed. */\r\n\tisCollapsed: boolean;\r\n\r\n\t/** If filter is enabled, contains the number of facets that are truncated. */\r\n\tremainingFacets: number;\r\n\r\n\t/** The number of digits displayed after the decimal points for numeric facet values. */\r\n\tdecimalPrecision: number;\r\n}\r\n\r\nexport interface FacetActor {\r\n\t/** Select the given facet value. */\r\n\tselectFacet(facetValue: Value | string): void;\r\n\r\n\t/** Selects and negates the given facet value. */\r\n\tnegateFacet(facetValue: Value | string): void;\r\n\r\n\t/** Sets the selected facet values by replacing existing selections for this facet. */\r\n\tsetFacets(facetValues: Value[] | string[]): void;\r\n\r\n\t/** Sets the filter for this facet container. */\r\n\tsetFilter(filter: string): void;\r\n\r\n\t/** Sets whether or not this facet is currently being truncated. */\r\n\tsetTruncated(truncated: boolean): void;\r\n\r\n\t/** Sets whether or not this facet is currently collapsed. */\r\n\tsetCollapsed(collapsed: boolean): void;\r\n}\r\n\r\nexport interface FacetRenderer {\r\n\t/**\r\n\t * Conditionally renders the default truncation UI (the \"Show More\"/\"Show Less\" buttons). Nothing will render\r\n\t * if the facet is configured to not be truncated.\r\n\t */\r\n\trenderTruncation();\r\n}\r\n\r\nfunction Facet({ facet, children, onFacetChange }: FacetProps) {\r\n\tconst { actor: searchActor } = useHawkSearch();\r\n\tconst wrapperRef = useRef(null);\r\n\tconst [filter, setFilter] = useState('');\r\n\tconst [isTruncated, setTruncated] = useState(facet.shouldTruncate);\r\n\tconst [isCollapsed, setCollapsed] = useState(facet.IsCollapsible && facet.IsCollapsedDefault);\r\n\tconst { t } = useTranslation();\r\n\r\n\tconst hasTooltip = !!facet.Tooltip;\r\n\r\n\tfunction selectFacet(facetValue: Value | string): void {\r\n\t\tsetFilter('');\r\n\t\tsearchActor.toggleFacetValue(facet, facetValue);\r\n\t\tonFacetChange();\r\n\t}\r\n\r\n\tfunction setFacets(values: Value[] | string[]): void {\r\n\t\tsetFilter('');\r\n\t\tsearchActor.setFacetValues(facet, values);\r\n\t\tonFacetChange();\r\n\t}\r\n\r\n\tfunction negateFacet(facetValue: Value | string): void {\r\n\t\tsetFilter('');\r\n\t\tsearchActor.toggleFacetValue(facet, facetValue, /* negate */ true);\r\n\t\tonFacetChange();\r\n\t}\r\n\r\n\tfunction renderTruncation() {\r\n\t\t// only show the toggle button if the facet is configured for truncation and we're not filtering\r\n\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t{facet.shouldTruncate && !filter && (\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n\r\n\t// TODO: sort facet values\r\n\tlet facetValues = facet.Values;\r\n\r\n\t// first, perform any filtering if enabled and a filter has been typed in\r\n\tif (facet.shouldSearch && filter) {\r\n\t\tfacetValues = facet.Values.filter((val) => {\r\n\t\t\tif (!val.Label) {\r\n\t\t\t\t// if a facet value doesn't have a label, we can't really filter down to it\r\n\t\t\t\t// so exclude it\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\treturn val.Label.toLowerCase().indexOf(filter.toLowerCase()) !== -1;\r\n\t\t});\r\n\t}\r\n\r\n\t// next, handle truncation\r\n\tlet remainingFacets = 0;\r\n\r\n\tif (facet.shouldTruncate && isTruncated) {\r\n\t\tconst valuesBeforeTrunc = facetValues.length;\r\n\r\n\t\tfacetValues = facetValues.slice(0, facet.TruncateThreshold);\r\n\r\n\t\tremainingFacets = valuesBeforeTrunc - facet.TruncateThreshold;\r\n\t}\r\n\r\n\tconst actor: FacetActor = {\r\n\t\tselectFacet,\r\n\t\tnegateFacet,\r\n\t\tsetFacets,\r\n\t\tsetFilter,\r\n\t\tsetTruncated,\r\n\t\tsetCollapsed,\r\n\t};\r\n\r\n\tconst state: FacetState = {\r\n\t\tfacetValues,\r\n\t\tfilter,\r\n\t\tisTruncated,\r\n\t\tisCollapsed,\r\n\t\tremainingFacets,\r\n\t\tdecimalPrecision: 2,\r\n\t};\r\n\r\n\tconst renderer: FacetRenderer = {\r\n\t\trenderTruncation,\r\n\t};\r\n\r\n\tfunction toggleCollapsible(event: MouseEvent) {\r\n\t\tif (wrapperRef.current && wrapperRef.current.contains(event.target as Node)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tsetCollapsed(!isCollapsed);\r\n\t}\r\n\r\n\tfunction facetStyle(facet: FacetModel) {\r\n\t\tif (facet.DisplayType === 'scrolling' && facet.ScrollHeight) {\r\n\t\t\treturn {\r\n\t\t\t\theight: facet.ScrollHeight,\r\n\t\t\t\toverflowY: 'auto',\r\n\t\t\t} as React.CSSProperties;\r\n\t\t}\r\n\t\treturn {};\r\n\t}\r\n\r\n\treturn (\r\n\t\t}>\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\t toggleCollapsible(event)}\r\n\t\t\t\t\t\t\taria-expanded={!isCollapsed}\r\n\t\t\t\t\t\t\taria-describedby={'hawk-facet-rail-facet-heading-' + facet.Name}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t

    {facet.Name}

    \r\n\r\n\t\t\t\t\t\t\t{isCollapsed ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\t\t\t\tExpand facet category{' '}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\t\t\t\tCollapse facet category\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t{facet.Tooltip ? (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t
    \r\n\r\n\t\t\t\t\t
    \r\n\t\t\t\t\t\tClicking this button will display a list of tabbable {facet.Name} values below. Tab down to\r\n\t\t\t\t\t\tinteract with them.\r\n\t\t\t\t\t
    \r\n\r\n\t\t\t\t\t{!isCollapsed && (\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t{facet.shouldSearch && (\r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\t setFilter(e.currentTarget.value)}\r\n\t\t\t\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\t\t\t\tplaceholder={t('Quick Lookup')}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t{/* render listing component */}\r\n\t\t\t\t\t\t\t{children}\r\n\t\t\t\t\t\t
    \r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t
    \r\n\t\t
    \r\n\t);\r\n}\r\n\r\nexport function useFacet() {\r\n\treturn useContext(FacetContext);\r\n}\r\n\r\nexport default Facet;\r\n","import { RocEventType, RocEvent, ExtractEventParameters } from 'shared/events';\r\n\r\n/**\r\n * Helper function for handling ROC events from non React functions.\r\n * @param eventType The type of event to handle\r\n * @param eventHandler The event handler\r\n * @returns The callback function to remove this handler\r\n */\r\nexport default function addRocEventHandler(\r\n\teventType: T,\r\n\teventHandler: (data: ExtractEventParameters) => void,\r\n): () => void {\r\n\tconst handler = (evt: CustomEvent): void => {\r\n\t\teventHandler(evt.detail);\r\n\t};\r\n\r\n\tdocument.addEventListener(eventType, handler);\r\n\r\n\treturn () => document.removeEventListener(eventType, handler);\r\n}\r\n","/*eslint camelcase: \"off\"*/\r\nimport React, { useContext } from 'react';\r\n\r\nimport { HawkSearchConfig } from 'types/HawkSearchConfig';\r\n\r\nconst ConfigContext = React.createContext({} as ConfigContextValue);\r\n\r\ndeclare global {\r\n\tinterface Window {\r\n\t\t__webpack_public_path__: string;\r\n\t}\r\n}\r\n\r\nexport interface ConfigContextValue {\r\n\t/** Global configuration. */\r\n\tconfig: HawkSearchConfig;\r\n}\r\n\r\nexport interface ConfigProviderProps {\r\n\tconfig: HawkSearchConfig;\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\nfunction ConfigProvider({ config, children }: ConfigProviderProps) {\r\n\tif (config.assetPath) {\r\n\t\tlet path = config.assetPath;\r\n\r\n\t\t// ensure the provided path both starts and ends with a slash\r\n\t\tif (!path.startsWith('/')) {\r\n\t\t\tpath = '/' + path;\r\n\t\t}\r\n\t\tif (!path.endsWith('/')) {\r\n\t\t\tpath = path + '/';\r\n\t\t}\r\n\r\n\t\t// allow consumers to tell webpack where to load code split/lazy loaded files from, as they may not be\r\n\t\t// hosting our JS from /assets/ (the default path)\r\n\t\t// eslint-disable-next-line\r\n\t\twindow.__webpack_public_path__ = path;\r\n\t}\r\n\r\n\treturn {children};\r\n}\r\n\r\nexport function useHawkConfig() {\r\n\tconst context = useContext(ConfigContext);\r\n\r\n\tif (!context.config) {\r\n\t\tthrow new Error(\r\n\t\t\t'No HawkSearchConfig is available, did you forget to wrap your components in a ConfigProvider component?',\r\n\t\t);\r\n\t}\r\n\r\n\treturn context;\r\n}\r\n\r\nexport default ConfigProvider;\r\n","import * as React from 'react';\r\n\r\ninterface DashCircleSVGProps {\r\n\tclass?: string;\r\n}\r\n\r\n/**\r\n * Dash circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction DashCircleSVG(props: DashCircleSVGProps) {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n}\r\n\r\nexport default DashCircleSVG;\r\n","import React from 'react';\r\n\r\nimport 'shared/components/hawksearch/styles/app.scss';\r\n\r\nimport ConfigProvider from 'shared/components/hawksearch/components/ConfigProvider';\r\nimport GlobalSearchBox from 'shared/components/hawksearch/components/ui/SearchBox/GlobalSearchBox';\r\nimport hawkConfig from './RocHawkConfig';\r\nimport { initReactApp } from 'shared/util/ApplicationInit';\r\n\r\nconst render = initReactApp(\r\n\t() => (\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t),\r\n\t'searchbox',\r\n);\r\n\r\nrender();\r\n"],"sourceRoot":""}