{"version":3,"sources":["webpack:///./ClientApp/services/Localizer.tsx","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/hawksearch/net/HawkClient.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Autocomplete/Request.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/Response.ts","webpack:///./ClientApp/shared/components/hawksearch/models/Autocomplete/Category.ts","webpack:///./ClientApp/shared/components/hawksearch/components/ui/SearchBox/SearchSuggestions.tsx","webpack:///./ClientApp/shared/components/svg/MagnifyingGlassSVG.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/SearchBox/SearchBoxBase.tsx","webpack:///./ClientApp/shared/components/hawksearch/components/ui/SearchBox/GlobalSearchBox.tsx","webpack:///./ClientApp/features/search/RocHawkConfig.ts","webpack:///./ClientApp/shared/components/hawksearch/styles/app.scss?c542","webpack:///./node_modules/regenerator-runtime/runtime.js","webpack:///./ClientApp/shared/edit/InlineAlert.tsx","webpack:///./node_modules/core-js/modules/es.array.filter.js","webpack:///./ClientApp/features/search/Search.tsx","webpack:///./node_modules/core-js/modules/es.object.get-own-property-descriptor.js","webpack:///./node_modules/core-js/modules/es.object.get-own-property-descriptors.js","webpack:///./ClientApp/shared/util/ErrorBoundary.tsx","webpack:///./ClientApp/shared/util/ApplicationInit.tsx","webpack:///./node_modules/core-js/internals/native-url.js","webpack:///./ClientApp/shared/components/hawksearch/components/ConfigProvider.tsx","webpack:///./ClientApp/util/StringUtil.ts","webpack:///./ClientApp/shared/components/hawksearch/util/Constants.ts","webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack:///./node_modules/core-js/modules/web.url.js","webpack:///./node_modules/core-js/internals/string-punycode-to-ascii.js","webpack:///./node_modules/core-js/modules/web.url-search-params.js","webpack:///./node_modules/core-js/internals/get-iterator.js"],"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","Pagination","init","assign","this","Items","map","i","PaginationItem","Result","field","Document","values","Sorting","SortingItem","Selections","selFacet","SelectionFacet","SelectionFacetValue","Value","Swatch","Range","Facet","SwatchData","s","Ranges","r","Values","v","DisplayType","TruncateThreshold","IsSearch","SearchThreshold","ParamName","Field","RuleType","RuleOperatorType","Rule","Parent","Rules","BannerTrigger","FeaturedItems","FeaturedItem","Merchandising","MerchandisingItem","PageContentItem","Trigger","PageContent","Response","Results","Facets","f","p","ContentType","HawkClient","config","baseUrl","apiUrl","Constants","dashboardUrl","searchUrl","autocompleteUrl","request","cancellationToken","axios","post","URL","href","cancelToken","result","data","Product","Content","Products","c","SearchSuggestions","query","downshift","useHawkConfig","client","useState","results","setResults","isLoading","setIsLoading","input","response","autocomplete","ClientGuid","clientGuid","Keyword","DisplayFullResponse","isCancel","error","useEffect","debounceMs","autocompleteDebounce","cts","CancelToken","source","timeout","setTimeout","doAutocomplete","token","cancel","clearTimeout","products","getMenuProps","getItemProps","highlightedIndex","className","item","DocId","ProductName","MagnifyingGlassSVG","rest","viewBox","classnames","focusable","aria-hidden","d","Downshift","React","lazy","SearchBoxBase","initialValue","onSubmit","Suspense","fallback","stateReducer","state","changes","type","inputValue","itemToString","onChange","location","Url","initialInputValue","options","isOpen","getInputProps","openMenu","showSuggestions","getLabelProps","style","width","onKeyDown","event","onFocus","placeholder","searchBoxPlaceholder","onClick","GlobalSearchBox","searchPageUrl","keywords","redirect","searchState","__ROC_SEARCH_STATE__","RocHawkConfig","searchEndpoint","trackingKey","api","content","__esModule","default","module","exported","locals","exports","runtime","Op","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","method","arg","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","done","value","makeInvokeMethod","fn","call","err","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","Gp","defineIteratorMethods","AsyncIterator","previousPromise","callInvokeWithMethodAndArg","Promise","resolve","reject","invoke","__await","then","unwrapped","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","constructor","displayName","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","async","iter","toString","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","InlineAlert","title","message","children","theme","isTitleOnOwnRow","defaultProps","$","$filter","filter","arrayMethodHasSpeciesSupport","arrayMethodUsesToLength","HAS_SPECIES_SUPPORT","USES_TO_LENGTH","target","proto","forced","callbackfn","arguments","initReactApp","hawkConfig","render","fails","toIndexedObject","nativeGetOwnPropertyDescriptor","DESCRIPTORS","FAILS_ON_PRIMITIVES","stat","sham","getOwnPropertyDescriptor","it","ownKeys","getOwnPropertyDescriptorModule","createProperty","getOwnPropertyDescriptors","descriptor","O","ErrorBoundary","setState","renderError","Component","getReactElement","elementId","element","document","getElementById","ReactDOM","wellKnownSymbol","IS_PURE","ITERATOR","url","searchParams","pathname","toJSON","sort","get","String","URLSearchParams","username","host","hash","ConfigContext","createContext","useContext","ConfigProvider","assetPath","path","startsWith","endsWith","__webpack_public_path__","Provider","trim","toLocaleLowerCase","defaultApiUrl","defaultDashboardUrl","defaultSearchUrl","defaultAutocompleteUrl","defaultSearchPageUrl","memo","isOldIE","Boolean","all","atob","getTarget","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","stylesInDom","getIndexByIdentifier","identifier","modulesToDom","list","idCountMap","identifiers","id","base","count","concat","css","media","sourceMap","references","updater","addStyle","insertStyleElement","createElement","attributes","nonce","setAttribute","insert","appendChild","textStore","replaceText","replacement","join","applyToSingletonTag","remove","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","removeAttribute","btoa","unescape","encodeURIComponent","JSON","stringify","firstChild","singleton","singletonCounter","update","styleIndex","bind","parentNode","removeStyleElement","newObj","lastIdentifiers","newList","newLastIdentifiers","_i","_index","splice","EOF","USE_NATIVE_URL","global","defineProperties","redefine","anInstance","has","arrayFrom","codeAt","toASCII","setToStringTag","URLSearchParamsModule","InternalStateModule","NativeURL","getInternalSearchParamsState","getState","setInternalState","set","getInternalURLState","getterFor","floor","Math","pow","ALPHA","ALPHANUMERIC","DIGIT","HEX_START","OCT","DEC","HEX","FORBIDDEN_HOST_CODE_POINT","FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT","LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE","TAB_AND_NEW_LINE","parseHost","codePoints","parseIPv6","isSpecial","test","parseIPv4","percentEncode","C0ControlPercentEncodeSet","partsLength","numbers","part","radix","number","ipv4","parts","split","parseInt","numbersSeen","ipv4Piece","swaps","swap","address","pieceIndex","compress","pointer","char","serializeHost","ignore0","unshift","ipv6","maxIndex","maxLength","currStart","currLength","findLongestZeroSequence","fragmentPercentEncodeSet","pathPercentEncodeSet","userinfoPercentEncodeSet","code","specialSchemes","ftp","file","http","https","ws","wss","scheme","includesCredentials","password","cannotHaveUsernamePasswordPort","cannotBeABaseURL","isWindowsDriveLetter","string","normalized","second","startsWithWindowsDriveLetter","third","shortenURLsPath","pathSize","isSingleDot","segment","toLowerCase","SCHEME_START","SCHEME","NO_SCHEME","SPECIAL_RELATIVE_OR_AUTHORITY","PATH_OR_AUTHORITY","RELATIVE","RELATIVE_SLASH","SPECIAL_AUTHORITY_SLASHES","SPECIAL_AUTHORITY_IGNORE_SLASHES","AUTHORITY","HOST","HOSTNAME","PORT","FILE","FILE_SLASH","FILE_HOST","PATH_START","PATH","CANNOT_BE_A_BASE_URL_PATH","QUERY","FRAGMENT","parseURL","stateOverride","bufferCodePoints","failure","buffer","seenAt","seenBracket","seenPasswordToken","port","fragment","codePoint","encodedCodePoints","shift","URLConstructor","baseState","that","urlString","searchParamsState","updateSearchParams","updateURL","serializeURL","origin","getOrigin","protocol","getProtocol","getUsername","getPassword","getHost","hostname","getHostname","getPort","getPathname","search","getSearch","getSearchParams","getHash","URLPrototype","output","accessorDescriptor","getter","setter","configurable","enumerable","nativeCreateObjectURL","createObjectURL","nativeRevokeObjectURL","revokeObjectURL","blob","apply","regexNonASCII","regexSeparators","OVERFLOW_ERROR","stringFromCharCode","fromCharCode","digitToBasic","digit","adapt","delta","numPoints","firstTime","k","baseMinusTMin","encode","currentValue","inputLength","counter","charCodeAt","extra","ucs2decode","n","bias","basicLength","handledCPCount","m","handledCPCountPlusOne","RangeError","q","t","qMinusT","baseMinusT","label","encoded","labels","getBuiltIn","redefineAll","createIteratorConstructor","classof","anObject","isObject","createPropertyDescriptor","getIterator","getIteratorMethod","$fetch","Headers","getInternalParamsState","getInternalIteratorState","URL_SEARCH_PARAMS","plus","sequences","percentSequence","bytes","RegExp","percentDecode","sequence","decodeURIComponent","deserialize","find","replacer","serialize","parseSearchParams","attribute","entries","validateArgumentsLength","passed","required","URLSearchParamsIterator","params","kind","step","URLSearchParamsConstructor","entryIterator","entryNext","first","URLSearchParamsPrototype","append","getAll","found","val","entriesIndex","sliceIndex","callback","boundFunction","fetch","body","headers"],"mappings":"2/BA8GA,IAAMA,EAAwC,GAKxCC,EAAkB,GAKxB,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,EAAUD,GAAwD,2BAA1BE,EAA0B,iCAA1BA,EAA0B,kBAKjF,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,EAAeO,GAASP,EAAeO,GAAS,MAJhDH,EAqBF,SAASI,EAAcC,GAA2B,IAChDC,EAA2BD,EAA3BC,YADgD,EACrBD,EAAdE,YADmC,MAC5B,GAD4B,EAElDC,EAAkBb,EAAS,WAAT,GAAUW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W,EAAE,CAAEgJ,QAAQ,EAAM6J,YAAY,EAAMpS,QAAQ,GAAQ,CAClD8X,MAAO,SAAe5lB,GACpB,IACInF,EAAMgrB,EAAMC,EADZxrB,EAAO,CAAC0F,GAkBV,OAhBEgO,UAAUpU,OAAS,IACrBiB,EAAOmT,UAAU,GACbgV,EAASnoB,KACXgrB,EAAOhrB,EAAKgrB,KA3SE,oBA4SV/C,EAAQ+C,MACVC,EAAUjrB,EAAKirB,QAAU,IAAIzC,EAAQxoB,EAAKirB,SAAW,IAAIzC,GAC5C5M,IAAI,iBACfqP,EAAQ1O,IAAI,eAAgB,mDAE9Bvc,EAAO6L,EAAO7L,EAAM,CAClBgrB,KAAM5C,EAAyB,EAAG3S,OAAOuV,IACzCC,QAAS7C,EAAyB,EAAG6C,OAI3CxrB,EAAK4P,KAAKrP,IACHuoB,EAAO5C,MAAMzlB,KAAMT,MAKlC2K,EAAOG,QAAU,CACfmL,gBAAiBwU,EACjB7N,SAAUoM,I,mBCzVZ,IAAIP,EAAW,EAAQ,IACnBI,EAAoB,EAAQ,IAEhCle,EAAOG,QAAU,SAAUwJ,GACzB,IAAIrE,EAAiB4Y,EAAkBvU,GACvC,GAA6B,mBAAlBrE,EACT,MAAMlB,UAAUiH,OAAO1B,GAAM,oBAC7B,OAAOmU,EAASxY,EAAevC,KAAK4G,O","file":"search.js","sourcesContent":["import * as React from 'react';\r\nimport { LoginResourceKeys } from 'features/login/resources';\r\nimport { ContactFormResourceKeys } from 'features/contact-form/resources';\r\nimport { ResetPasswordResourceKeys } from 'features/reset-password/resources';\r\nimport { MyAccountResourceKeys } from 'features/my-account/resources';\r\nimport { SubmitQuestionResourceKeys } from 'features/submit-question/resources';\r\nimport { LoginWith2faResourceKeys } from 'features/login-with-2fa/resources';\r\nimport { LoginWithRecoveryCodeResourceKeys } from 'features/login-with-recovery-code/resources';\r\nimport { toKebabCase } from 'util/StringUtil';\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| '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| '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| 'RequiredFields';\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| ResetPasswordResourceKeys\r\n\t| SubmitQuestionResourceKeys\r\n\t| ResetPasswordResourceKeys\r\n\t| MyAccountResourceKeys\r\n\t| LoginWith2faResourceKeys\r\n\t| LoginWithRecoveryCodeResourceKeys;\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 = {};\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(key: LocalizerResourceKey, ...replaceStrings: string[]) {\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","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\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\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';\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 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\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 axios, { CancelToken } from 'axios';\r\nimport { Request as SearchRequest, Response as SearchResponse } from 'models/Search';\r\nimport { Request as AutocompleteRequest, Response as AutocompleteResponse } from 'models/Autocomplete';\r\nimport { HawkSearchConfig } from 'types/HawkSearchConfig';\r\nimport * as Constants from 'util/Constants';\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\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}\r\n\r\n\tpublic async search(request: SearchRequest, cancellationToken?: CancelToken): Promise {\r\n\t\tconst result = await axios.post(new URL(this.searchUrl, this.baseUrl).href, request, {\r\n\t\t\tcancelToken: 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 axios.post(\r\n\t\t\tnew URL(this.autocompleteUrl, this.baseUrl).href,\r\n\t\t\trequest,\r\n\t\t\t{\r\n\t\t\t\tcancelToken: cancellationToken,\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\treturn result.data;\r\n\t}\r\n}\r\n\r\nexport default HawkClient;\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}\r\n","import { Result } from 'models/Search';\r\n\r\nexport class Product {\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\tObject.assign(this, init);\r\n\t\tthis.Results = new Result(init.Results);\r\n\t}\r\n}\r\n","import { Result } from 'models/Search';\r\n\r\nexport class Content {\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/** 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\tObject.assign(this, init);\r\n\t\tthis.Results = new Result(init.Results);\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.Products = init.Products.map((p) => new Product(p));\r\n\t\tthis.Content = init.Content.map((c) => new Content(c));\r\n\t}\r\n}\r\n","export class Category {\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","import React, { useState, useEffect } from 'react';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\nimport axios, { CancelToken } from 'axios';\r\n\r\nimport HawkClient from 'net/HawkClient';\r\nimport { Response, Product } from 'models/Autocomplete';\r\nimport { useHawkConfig } from 'components/ConfigProvider';\r\n\r\ninterface 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\r\nfunction SearchSuggestions({ query, downshift }: SearchSuggestionsProps) {\r\n\tconst { config } = useHawkConfig();\r\n\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}, [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\ttry {\r\n\t\t\tresponse = await client.autocomplete(\r\n\t\t\t\t{\r\n\t\t\t\t\tClientGuid: config.clientGuid,\r\n\r\n\t\t\t\t\tKeyword: input,\r\n\t\t\t\t\tDisplayFullResponse: true,\r\n\t\t\t\t},\r\n\t\t\t\tcancellationToken,\r\n\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(new Response(response));\r\n\t\t}\r\n\t}\r\n\r\n\tconst { Products: products } = results;\r\n\r\n\tconst { getMenuProps, getItemProps, highlightedIndex } = downshift;\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
    \r\n\t\t\t\t{isLoading &&
  • Loading...
  • }\r\n\r\n\t\t\t\t{products &&\r\n\t\t\t\t\tproducts.map((item, index) => (\r\n\t\t\t\t\t\t// tslint:disable-next-line: jsx-key\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{item.ProductName}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t))}\r\n\r\n\t\t\t\t{!isLoading && products && products.length === 0 && (\r\n\t\t\t\t\t
  • No results.
  • \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 SearchSuggestions;\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","import React from 'react';\r\nimport { DownshiftState, StateChangeOptions, ControllerStateAndHelpers } from 'downshift';\r\n\r\nimport { Product } from 'models/Autocomplete';\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 { useHawkConfig } from 'components/ConfigProvider';\r\n\r\nconst Downshift = React.lazy(() => import(/* webpackChunkName: \"downshift\" */ 'downshift'));\r\n\r\ninterface SearchBoxBaseProps {\r\n\tinitialValue?: string;\r\n\tonSubmit: (keywords: string) => void;\r\n}\r\n\r\nfunction SearchBoxBase({ initialValue, onSubmit }: SearchBoxBaseProps) {\r\n\tconst { config } = useHawkConfig();\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: Product, downshift: ControllerStateAndHelpers) {\r\n\t\tlocation.assign(item.Url);\r\n\t}\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t (item ? item.ProductName : '')}\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;\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\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\tif (event.key === 'Enter' && onSubmit) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tonSubmit(inputValue || '');\r\n\t\t\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// when the input is focused again, reopen the downshift menu\r\n\t\t\t\t\t\t\t\t\t\tonFocus: () => {\r\n\t\t\t\t\t\t\t\t\t\t\tif (inputValue && inputValue.length > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\topenMenu();\r\n\t\t\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\tplaceholder: config.searchBoxPlaceholder\r\n\t\t\t\t\t\t\t\t\t\t\t? config.searchBoxPlaceholder\r\n\t\t\t\t\t\t\t\t\t\t\t: 'Enter a search term',\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-text-input\"\r\n\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\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\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 { useHawkConfig } from 'components/ConfigProvider';\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\r\n\tconst searchUrl = config.searchPageUrl || Constants.defaultSearchPageUrl;\r\n\r\n\tfunction handleSubmit(keywords: string) {\r\n\t\tconst redirect = `${searchUrl}?keyword=${keywords}`;\r\n\r\n\t\tlocation.assign(redirect);\r\n\t}\r\n\r\n\treturn ;\r\n}\r\n\r\nexport default GlobalSearchBox;\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};\r\n\r\nexport default RocHawkConfig;\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/lib/loader.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\nvar exported = content.locals ? content.locals : {};\n\n\n\nmodule.exports = exported;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import React from 'react';\r\nimport classnames from 'classnames';\r\nimport { Localizer } from 'services/Localizer';\r\n\r\ntype Theme = 'danger' | 'warning' | 'info' | 'success';\r\n\r\nexport interface ErrorAlertProps {\r\n\ttitle: string;\r\n\tmessage: React.ReactNode | string;\r\n\tchildren?: any;\r\n\ttheme?: Theme;\r\n\tisTitleOnOwnRow?: 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 = Localizer('ErrorMessageGenericTitle'),\r\n\t\tmessage = Localizer('UnexpectedErrorOccurred'),\r\n\t\tchildren,\r\n\t\ttheme = 'danger',\r\n\t\tisTitleOnOwnRow = false,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t{title}\r\n\t\t\t{' '}\r\n\t\t\t{message}\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};\r\n","'use strict';\nvar $ = require('../internals/export');\nvar $filter = require('../internals/array-iteration').filter;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');\n// Edge 14- issue\nvar USES_TO_LENGTH = arrayMethodUsesToLength('filter');\n\n// `Array.prototype.filter` method\n// https://tc39.github.io/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\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","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });\nvar FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor\n$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {\n return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);\n }\n});\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar ownKeys = require('../internals/own-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar createProperty = require('../internals/create-property');\n\n// `Object.getOwnPropertyDescriptors` method\n// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIndexedObject(object);\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n var keys = ownKeys(O);\n var result = {};\n var index = 0;\n var key, descriptor;\n while (keys.length > index) {\n descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);\n if (descriptor !== undefined) createProperty(result, key, descriptor);\n }\n return result;\n }\n});\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: () => ,\r\n\t};\r\n\r\n\tpublic state: ErrorBoundaryState = {};\r\n\r\n\tpublic componentDidCatch(error: Error) {\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 React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport ErrorBoundary from './ErrorBoundary';\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: () => 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\tconsole.debug(`Rendering application inside element with ID ${elementId}.`);\r\n\t\tReactDOM.render({getReactElement()}, element);\r\n\t};\r\n};\r\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = !fails(function () {\n var url = new URL('b?a=1&b=2&c=3', 'http://a');\n var searchParams = url.searchParams;\n var result = '';\n url.pathname = 'c%20d';\n searchParams.forEach(function (value, key) {\n searchParams['delete']('b');\n result += key + value;\n });\n return (IS_PURE && !url.toJSON)\n || !searchParams.sort\n || url.href !== 'http://a/c%20d?a=1&c=3'\n || searchParams.get('c') !== '3'\n || String(new URLSearchParams('?a=1')) !== 'a=1'\n || !searchParams[ITERATOR]\n // throws in Edge\n || new URL('https://a@b').username !== 'a'\n || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'\n // not punycoded in Edge\n || new URL('http://тест').host !== 'xn--e1aybc'\n // not escaped in Chrome 62-\n || new URL('http://a#б').hash !== '#%D0%B1'\n // fails in Chrome 66-\n || result !== 'a1c3'\n // throws in Safari\n || new URL('http://x', undefined).host !== 'x';\n});\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","// 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.toLocaleLowerCase();\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 * @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","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && btoa) {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of