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AavJ,EAAWrC,MAAM4L,WAAa,KAGzDvJ,EAAWrC,MAAMyL,aAAc,CAClC,IAAMjD,EAASV,EAAesE,EAAY/J,EAAWgB,YACrDpE,EAAGqD,UAAY,yDAEgBkG,OAD7BnG,EAAWrC,MAAMgM,MAAQ3J,EAAWrC,MAAM4L,WAAa,GACxD,gCAAqC,OAAPpD,EAAO,UACxC,CAQA,OANInG,EAAWrC,MAAMgM,OAAO/M,EAAGoN,UAAUC,IAAI,SAEb,uBAA5BjK,EAAWrC,MAAM2K,QACnB1L,EAAGoN,UAAUC,IAAI,QAAS,kBAGrBrN,CACT,EAhUmB4I,EA2VZkE,kBAAP,SAAyBhM,GACvB,MAAqB,iBAAVA,EAA2BA,EAC/BA,EAAM+G,MAAQ/G,EAAMwM,WAC7B,E,EA9VmB1E,G,EAAAA,C,CAef7I,IAAAA,O,IAAJ,WACE,OAAOvD,KAAKH,MAAMkM,QAAQ,OAC5B,G,CAEIuC,IAAAA,c,IAAJ,WASE,OARAtO,KAAK0M,gBAAkB,CACrB,CACEpI,MAAOtE,KAAKH,MAAM0E,MAClBA,MAAO,CAAEyL,cAAc,KAI3BhQ,KAAK0Q,aACE1Q,KAAK0M,eACd,M,2BA7BmBN,C,CAAN,E","sources":["webpack://webstaurantstore/../node_modules/awesomplete/awesomplete.js","webpack://webstaurantstore/../node_modules/es6-delegate/index.js","webpack://webstaurantstore/./common/SearchAutocomplete/index.ts"],"sourcesContent":["/**\n * Simple, lightweight, usable local autocomplete library for modern browsers\n * Because there weren’t enough autocomplete scripts in the world? Because I’m completely insane and have NIH syndrome? Probably both. :P\n * @author Lea Verou http://leaverou.github.io/awesomplete\n * MIT license\n */\n\n(function () {\n\nvar _ = function (input, o) {\n\tvar me = this;\n\n // Keep track of number of instances for unique IDs\n _.count = (_.count || 0) + 1;\n this.count = _.count;\n\n\t// Setup\n\n\tthis.isOpened = false;\n\n\tthis.input = $(input);\n\tthis.input.setAttribute(\"autocomplete\", \"off\");\n\tthis.input.setAttribute(\"aria-expanded\", \"false\");\n\tthis.input.setAttribute(\"aria-owns\", \"awesomplete_list_\" + this.count);\n\tthis.input.setAttribute(\"role\", \"combobox\");\n\n\t// store constructor options in case we need to distinguish\n\t// between default and customized behavior later on\n\tthis.options = o = o || {};\n\n\tconfigure(this, {\n\t\tminChars: 2,\n\t\tmaxItems: 10,\n\t\tautoFirst: false,\n\t\tdata: _.DATA,\n\t\tfilter: _.FILTER_CONTAINS,\n\t\tsort: o.sort === false ? false : _.SORT_BYLENGTH,\n\t\tcontainer: _.CONTAINER,\n\t\titem: _.ITEM,\n\t\treplace: _.REPLACE,\n\t\ttabSelect: false\n\t}, o);\n\n\tthis.index = -1;\n\n\t// Create necessary elements\n\n\tthis.container = this.container(input);\n\n\tthis.ul = $.create(\"ul\", {\n\t\thidden: \"hidden\",\n role: \"listbox\",\n id: \"awesomplete_list_\" + this.count,\n\t\tinside: this.container\n\t});\n\n\tthis.status = $.create(\"span\", {\n\t\tclassName: \"visually-hidden\",\n\t\trole: \"status\",\n\t\t\"aria-live\": \"assertive\",\n \"aria-atomic\": true,\n inside: this.container,\n textContent: this.minChars != 0 ? (\"Type \" + this.minChars + \" or more characters for results.\") : \"Begin typing for results.\"\n\t});\n\n\t// Bind events\n\n\tthis._events = {\n\t\tinput: {\n\t\t\t\"input\": this.evaluate.bind(this),\n\t\t\t\"blur\": this.close.bind(this, { reason: \"blur\" }),\n\t\t\t\"keydown\": function(evt) {\n\t\t\t\tvar c = evt.keyCode;\n\n\t\t\t\t// If the dropdown `ul` is in view, then act on keydown for the following keys:\n\t\t\t\t// Enter / Esc / Up / Down\n\t\t\t\tif(me.opened) {\n\t\t\t\t\tif (c === 13 && me.selected) { // Enter\n\t\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\t\tme.select(undefined, undefined, evt);\n\t\t\t\t\t}\n\t\t\t\t\telse if (c === 9 && me.selected && me.tabSelect) {\n\t\t\t\t\t\tme.select(undefined, undefined, evt);\n\t\t\t\t\t}\n\t\t\t\t\telse if (c === 27) { // Esc\n\t\t\t\t\t\tme.close({ reason: \"esc\" });\n\t\t\t\t\t}\n\t\t\t\t\telse if (c === 38 || c === 40) { // Down/Up arrow\n\t\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\t\tme[c === 38? \"previous\" : \"next\"]();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tform: {\n\t\t\t\"submit\": this.close.bind(this, { reason: \"submit\" })\n\t\t},\n\t\tul: {\n\t\t\t// Prevent the default mousedowm, which ensures the input is not blurred.\n\t\t\t// The actual selection will happen on click. This also ensures dragging the\n\t\t\t// cursor away from the list item will cancel the selection\n\t\t\t\"mousedown\": function(evt) {\n\t\t\t\tevt.preventDefault();\n\t\t\t},\n\t\t\t// The click event is fired even if the corresponding mousedown event has called preventDefault\n\t\t\t\"click\": function(evt) {\n\t\t\t\tvar li = evt.target;\n\n\t\t\t\tif (li !== this) {\n\n\t\t\t\t\twhile (li && !/li/i.test(li.nodeName)) {\n\t\t\t\t\t\tli = li.parentNode;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (li && evt.button === 0) { // Only select on left click\n\t\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\t\tme.select(li, evt.target, evt);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t$.bind(this.input, this._events.input);\n\t$.bind(this.input.form, this._events.form);\n\t$.bind(this.ul, this._events.ul);\n\n\tif (this.input.hasAttribute(\"list\")) {\n\t\tthis.list = \"#\" + this.input.getAttribute(\"list\");\n\t\tthis.input.removeAttribute(\"list\");\n\t}\n\telse {\n\t\tthis.list = this.input.getAttribute(\"data-list\") || o.list || [];\n\t}\n\n\t_.all.push(this);\n};\n\n_.prototype = {\n\tset list(list) {\n\t\tif (Array.isArray(list)) {\n\t\t\tthis._list = list;\n\t\t}\n\t\telse if (typeof list === \"string\" && list.indexOf(\",\") > -1) {\n\t\t\t\tthis._list = list.split(/\\s*,\\s*/);\n\t\t}\n\t\telse { // Element or CSS selector\n\t\t\tlist = $(list);\n\n\t\t\tif (list && list.children) {\n\t\t\t\tvar items = [];\n\t\t\t\tslice.apply(list.children).forEach(function (el) {\n\t\t\t\t\tif (!el.disabled) {\n\t\t\t\t\t\tvar text = el.textContent.trim();\n\t\t\t\t\t\tvar value = el.value || text;\n\t\t\t\t\t\tvar label = el.label || text;\n\t\t\t\t\t\tif (value !== \"\") {\n\t\t\t\t\t\t\titems.push({ label: label, value: value });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis._list = items;\n\t\t\t}\n\t\t}\n\n\t\tif (document.activeElement === this.input) {\n\t\t\tthis.evaluate();\n\t\t}\n\t},\n\n\tget selected() {\n\t\treturn this.index > -1;\n\t},\n\n\tget opened() {\n\t\treturn this.isOpened;\n\t},\n\n\tclose: function (o) {\n\t\tif (!this.opened) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.input.setAttribute(\"aria-expanded\", \"false\");\n\t\tthis.ul.setAttribute(\"hidden\", \"\");\n\t\tthis.isOpened = false;\n\t\tthis.index = -1;\n\n\t\tthis.status.setAttribute(\"hidden\", \"\");\n\n\t\t$.fire(this.input, \"awesomplete-close\", o || {});\n\t},\n\n\topen: function () {\n\t\tthis.input.setAttribute(\"aria-expanded\", \"true\");\n\t\tthis.ul.removeAttribute(\"hidden\");\n\t\tthis.isOpened = true;\n\n\t\tthis.status.removeAttribute(\"hidden\");\n\n\t\tif (this.autoFirst && this.index === -1) {\n\t\t\tthis.goto(0);\n\t\t}\n\n\t\t$.fire(this.input, \"awesomplete-open\");\n\t},\n\n\tdestroy: function() {\n\t\t//remove events from the input and its form\n\t\t$.unbind(this.input, this._events.input);\n\t\t$.unbind(this.input.form, this._events.form);\n\n\t\t// cleanup container if it was created by Awesomplete but leave it alone otherwise\n\t\tif (!this.options.container) {\n\t\t\t//move the input out of the awesomplete container and remove the container and its children\n\t\t\tvar parentNode = this.container.parentNode;\n\n\t\t\tparentNode.insertBefore(this.input, this.container);\n\t\t\tparentNode.removeChild(this.container);\n\t\t}\n\n\t\t//remove autocomplete and aria-autocomplete attributes\n\t\tthis.input.removeAttribute(\"autocomplete\");\n\t\tthis.input.removeAttribute(\"aria-autocomplete\");\n\n\t\t//remove this awesomeplete instance from the global array of instances\n\t\tvar indexOfAwesomplete = _.all.indexOf(this);\n\n\t\tif (indexOfAwesomplete !== -1) {\n\t\t\t_.all.splice(indexOfAwesomplete, 1);\n\t\t}\n\t},\n\n\tnext: function () {\n\t\tvar count = this.ul.children.length;\n\t\tthis.goto(this.index < count - 1 ? this.index + 1 : (count ? 0 : -1) );\n\t},\n\n\tprevious: function () {\n\t\tvar count = this.ul.children.length;\n\t\tvar pos = this.index - 1;\n\n\t\tthis.goto(this.selected && pos !== -1 ? pos : count - 1);\n\t},\n\n\t// Should not be used, highlights specific item without any checks!\n\tgoto: function (i) {\n\t\tvar lis = this.ul.children;\n\n\t\tif (this.selected) {\n\t\t\tlis[this.index].setAttribute(\"aria-selected\", \"false\");\n\t\t}\n\n\t\tthis.index = i;\n\n\t\tif (i > -1 && lis.length > 0) {\n\t\t\tlis[i].setAttribute(\"aria-selected\", \"true\");\n\n\t\t\tthis.status.textContent = lis[i].textContent + \", list item \" + (i + 1) + \" of \" + lis.length;\n\n this.input.setAttribute(\"aria-activedescendant\", this.ul.id + \"_item_\" + this.index);\n\n\t\t\t// scroll to highlighted element in case parent's height is fixed\n\t\t\tthis.ul.scrollTop = lis[i].offsetTop - this.ul.clientHeight + lis[i].clientHeight;\n\n\t\t\t$.fire(this.input, \"awesomplete-highlight\", {\n\t\t\t\ttext: this.suggestions[this.index]\n\t\t\t});\n\t\t}\n\t},\n\n\tselect: function (selected, origin, originalEvent) {\n\t\tif (selected) {\n\t\t\tthis.index = $.siblingIndex(selected);\n\t\t} else {\n\t\t\tselected = this.ul.children[this.index];\n\t\t}\n\n\t\tif (selected) {\n\t\t\tvar suggestion = this.suggestions[this.index];\n\n\t\t\tvar allowed = $.fire(this.input, \"awesomplete-select\", {\n\t\t\t\ttext: suggestion,\n\t\t\t\torigin: origin || selected,\n\t\t\t\toriginalEvent: originalEvent\n\t\t\t});\n\n\t\t\tif (allowed) {\n\t\t\t\tthis.replace(suggestion);\n\t\t\t\tthis.close({ reason: \"select\" });\n\t\t\t\t$.fire(this.input, \"awesomplete-selectcomplete\", {\n\t\t\t\t\ttext: suggestion,\n\t\t\t\t\toriginalEvent: originalEvent\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n\n\tevaluate: function() {\n\t\tvar me = this;\n\t\tvar value = this.input.value;\n\n\t\tif (value.length >= this.minChars && this._list && this._list.length > 0) {\n\t\t\tthis.index = -1;\n\t\t\t// Populate list with options that match\n\t\t\tthis.ul.innerHTML = \"\";\n\n\t\t\tthis.suggestions = this._list\n\t\t\t\t.map(function(item) {\n\t\t\t\t\treturn new Suggestion(me.data(item, value));\n\t\t\t\t})\n\t\t\t\t.filter(function(item) {\n\t\t\t\t\treturn me.filter(item, value);\n\t\t\t\t});\n\n\t\t\tif (this.sort !== false) {\n\t\t\t\tthis.suggestions = this.suggestions.sort(this.sort);\n\t\t\t}\n\n\t\t\tthis.suggestions = this.suggestions.slice(0, this.maxItems);\n\n\t\t\tthis.suggestions.forEach(function(text, index) {\n\t\t\t\t\tme.ul.appendChild(me.item(text, value, index));\n\t\t\t\t});\n\n\t\t\tif (this.ul.children.length === 0) {\n\n this.status.textContent = \"No results found\";\n\n\t\t\t\tthis.close({ reason: \"nomatches\" });\n\n\t\t\t} else {\n\t\t\t\tthis.open();\n\n this.status.textContent = this.ul.children.length + \" results found\";\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.close({ reason: \"nomatches\" });\n\n this.status.textContent = \"No results found\";\n\t\t}\n\t}\n};\n\n// Static methods/properties\n\n_.all = [];\n\n_.FILTER_CONTAINS = function (text, input) {\n\treturn RegExp($.regExpEscape(input.trim()), \"i\").test(text);\n};\n\n_.FILTER_STARTSWITH = function (text, input) {\n\treturn RegExp(\"^\" + $.regExpEscape(input.trim()), \"i\").test(text);\n};\n\n_.SORT_BYLENGTH = function (a, b) {\n\tif (a.length !== b.length) {\n\t\treturn a.length - b.length;\n\t}\n\n\treturn a < b? -1 : 1;\n};\n\n_.CONTAINER = function (input) {\n\treturn $.create(\"div\", {\n\t\tclassName: \"awesomplete\",\n\t\taround: input\n\t});\n}\n\n_.ITEM = function (text, input, item_id) {\n\tvar html = input.trim() === \"\" ? text : text.replace(RegExp($.regExpEscape(input.trim()), \"gi\"), \"$&\");\n\treturn $.create(\"li\", {\n\t\tinnerHTML: html,\n\t\t\"role\": \"option\",\n\t\t\"aria-selected\": \"false\",\n\t\t\"id\": \"awesomplete_list_\" + this.count + \"_item_\" + item_id\n\t});\n};\n\n_.REPLACE = function (text) {\n\tthis.input.value = text.value;\n};\n\n_.DATA = function (item/*, input*/) { return item; };\n\n// Private functions\n\nfunction Suggestion(data) {\n\tvar o = Array.isArray(data)\n\t ? { label: data[0], value: data[1] }\n\t : typeof data === \"object\" && \"label\" in data && \"value\" in data ? data : { label: data, value: data };\n\n\tthis.label = o.label || o.value;\n\tthis.value = o.value;\n}\nObject.defineProperty(Suggestion.prototype = Object.create(String.prototype), \"length\", {\n\tget: function() { return this.label.length; }\n});\nSuggestion.prototype.toString = Suggestion.prototype.valueOf = function () {\n\treturn \"\" + this.label;\n};\n\nfunction configure(instance, properties, o) {\n\tfor (var i in properties) {\n\t\tvar initial = properties[i],\n\t\t attrValue = instance.input.getAttribute(\"data-\" + i.toLowerCase());\n\n\t\tif (typeof initial === \"number\") {\n\t\t\tinstance[i] = parseInt(attrValue);\n\t\t}\n\t\telse if (initial === false) { // Boolean options must be false by default anyway\n\t\t\tinstance[i] = attrValue !== null;\n\t\t}\n\t\telse if (initial instanceof Function) {\n\t\t\tinstance[i] = null;\n\t\t}\n\t\telse {\n\t\t\tinstance[i] = attrValue;\n\t\t}\n\n\t\tif (!instance[i] && instance[i] !== 0) {\n\t\t\tinstance[i] = (i in o)? o[i] : initial;\n\t\t}\n\t}\n}\n\n// Helpers\n\nvar slice = Array.prototype.slice;\n\nfunction $(expr, con) {\n\treturn typeof expr === \"string\"? (con || document).querySelector(expr) : expr || null;\n}\n\nfunction $$(expr, con) {\n\treturn slice.call((con || document).querySelectorAll(expr));\n}\n\n$.create = function(tag, o) {\n\tvar element = document.createElement(tag);\n\n\tfor (var i in o) {\n\t\tvar val = o[i];\n\n\t\tif (i === \"inside\") {\n\t\t\t$(val).appendChild(element);\n\t\t}\n\t\telse if (i === \"around\") {\n\t\t\tvar ref = $(val);\n\t\t\tref.parentNode.insertBefore(element, ref);\n\t\t\telement.appendChild(ref);\n\n\t\t\tif (ref.getAttribute(\"autofocus\") != null) {\n\t\t\t\tref.focus();\n\t\t\t}\n\t\t}\n\t\telse if (i in element) {\n\t\t\telement[i] = val;\n\t\t}\n\t\telse {\n\t\t\telement.setAttribute(i, val);\n\t\t}\n\t}\n\n\treturn element;\n};\n\n$.bind = function(element, o) {\n\tif (element) {\n\t\tfor (var event in o) {\n\t\t\tvar callback = o[event];\n\n\t\t\tevent.split(/\\s+/).forEach(function (event) {\n\t\t\t\telement.addEventListener(event, callback);\n\t\t\t});\n\t\t}\n\t}\n};\n\n$.unbind = function(element, o) {\n\tif (element) {\n\t\tfor (var event in o) {\n\t\t\tvar callback = o[event];\n\n\t\t\tevent.split(/\\s+/).forEach(function(event) {\n\t\t\t\telement.removeEventListener(event, callback);\n\t\t\t});\n\t\t}\n\t}\n};\n\n$.fire = function(target, type, properties) {\n\tvar evt = document.createEvent(\"HTMLEvents\");\n\n\tevt.initEvent(type, true, true );\n\n\tfor (var j in properties) {\n\t\tevt[j] = properties[j];\n\t}\n\n\treturn target.dispatchEvent(evt);\n};\n\n$.regExpEscape = function (s) {\n\treturn s.replace(/[-\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n};\n\n$.siblingIndex = function (el) {\n\t/* eslint-disable no-cond-assign */\n\tfor (var i = 0; el = el.previousElementSibling; i++);\n\treturn i;\n};\n\n// Initialization\n\nfunction init() {\n\t$$(\"input.awesomplete\").forEach(function (input) {\n\t\tnew _(input);\n\t});\n}\n\n// Make sure to export Awesomplete on self when in a browser\nif (typeof self !== \"undefined\") {\n\tself.Awesomplete = _;\n}\n\n// Are we in a browser? Check for Document constructor\nif (typeof Document !== \"undefined\") {\n\t// DOM already loaded?\n\tif (document.readyState !== \"loading\") {\n\t\tinit();\n\t}\n\telse {\n\t\t// Wait for it\n\t\tdocument.addEventListener(\"DOMContentLoaded\", init);\n\t}\n}\n\n_.$ = $;\n_.$$ = $$;\n\n// Expose Awesomplete as a CJS module\nif (typeof module === \"object\" && module.exports) {\n\tmodule.exports = _;\n}\n\nreturn _;\n\n}());\n","'use strict';\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n/**\n * Function for delegating events from one element to another\n *\n * @param {(String|Node|NodeList)} [elements] Elements to bind events to\n * @param {String} eventListeners Space separated list of events to bind\n * @param {(String|Node|NodeList)} selector Element to trigger events\n * @param {Function} callback Callback function\n */\nvar delegate = (function () {\n for (var _len = arguments.length, delegateArgs = Array(_len), _key = 0; _key < _len; _key++) {\n delegateArgs[_key] = arguments[_key];\n }\n\n var args = delegateArgs;\n\n if (args.length === 3) {\n args = [[document.documentElement]].concat(_toConsumableArray(args));\n }\n\n if (args[0].constructor.name === 'String') {\n args[0] = [].concat(_toConsumableArray(document.querySelectorAll(args[0])));\n } else if (!args[0].forEach) {\n args[0] = [args[0]];\n } else {\n args[0] = [].concat(_toConsumableArray(args[0]));\n }\n\n if (args[2].constructor.name !== 'String') {\n if (!args[2].forEach) {\n args[2] = [args[2]];\n } else {\n args[2] = [].concat(_toConsumableArray(args[2]));\n }\n }\n\n var _args = args,\n _args2 = _slicedToArray(_args, 4),\n elements = _args2[0],\n eventListeners = _args2[1],\n selector = _args2[2],\n callback = _args2[3];\n\n var events = eventListeners.split(' ');\n\n var callMethod = function callMethod(e) {\n var delegateTarget = void 0;\n\n if (selector.constructor.name === 'String') {\n delegateTarget = e.target.closest(selector);\n } else {\n var _selector$filter = selector.filter(function (node) {\n return node === e.target || node.contains(e.target);\n });\n\n var _selector$filter2 = _slicedToArray(_selector$filter, 1);\n\n delegateTarget = _selector$filter2[0];\n }\n\n if (delegateTarget) {\n e.relatedElements = elements;\n callback.call(delegateTarget, e, delegateTarget);\n }\n };\n\n elements.forEach(function (element) {\n events.forEach(function (event) {\n element.addEventListener(event, callMethod, true);\n });\n });\n\n return callMethod;\n});\n\nmodule.exports = delegate;\n","import Awesomplete from \"awesomplete\";\nimport delegate from \"es6-delegate\";\nimport { Throwable } from \"@wss/error-tracking/throwable\";\nimport { toError } from \"@wss/error-tracking/utils\";\nimport { addBreadcrumb } from \"@wss/error-tracking\";\n\ntype Label = string | { name: string; description: string; link: string };\n\ninterface SectionResult {\n label: Label;\n value: {\n href?: string;\n first?: boolean;\n resultType?: string;\n userProvided?: boolean;\n action?: string;\n };\n}\n\ninterface CustomAwesomplete extends Awesomplete {\n sort?: boolean;\n filter?: () => boolean;\n item?: (suggestion: SectionResult, searchTerm: string) => HTMLLIElement;\n maxItems?: number;\n replace?: (suggestion: SectionResult) => void;\n autoFirst?: boolean;\n}\n\ntype Results = {\n keywords?: Label[];\n prods?: Label[];\n products?: Label[];\n history?: Label[];\n categories?: Label[];\n vendors?: Label[];\n};\n\ninterface SearchHistory {\n name: string;\n link?: string;\n}\n\nconst escapeRegExCharacters = (string: string) => {\n // sourced from https://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special-characters-using-javascript\n return string.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, \"\\\\$&\");\n};\n\nexport function markSearchTerm(query: string, resultText: string): string {\n return resultText.replace(\n RegExp(escapeRegExCharacters(query.trim()), \"gi\"),\n \"$&\"\n );\n}\n\nexport default class SearchAutocomplete {\n results: Results | undefined;\n\n resultTypes = [\"keywords\", \"categories\", \"products\", \"vendors\"] as const;\n\n count = 0;\n\n input: HTMLInputElement;\n\n submitButton: HTMLButtonElement;\n\n awesomplete: CustomAwesomplete;\n\n combinedResults: SectionResult[] = [];\n\n get form() {\n return this.input.closest(\"form\");\n }\n\n get flatResults() {\n this.combinedResults = [\n {\n label: this.input.value,\n value: { userProvided: true },\n },\n ];\n\n this.addResults();\n return this.combinedResults;\n }\n\n constructor(input: HTMLInputElement, submitButton: HTMLButtonElement) {\n this.input = input;\n this.submitButton = submitButton;\n\n input.addEventListener(\"input\", this.search);\n input.addEventListener(\"focus\", this.showSearchHistory);\n this.awesomplete = new Awesomplete(this.input, {\n list: [],\n autoFirst: true,\n minChars: 0,\n });\n\n this.awesomplete.sort = false;\n this.awesomplete.filter = () => true;\n this.awesomplete.item = SearchAutocomplete.createSearchResult;\n this.awesomplete.maxItems = 50;\n this.awesomplete.replace = this.action;\n\n delegate(this.form, \"mouseover\", \".result\", this.goto);\n }\n\n /**\n * Set the current autocomplete (search results) list in awesomplete. Resets selection state to avoid consistency issues within awesomplete.goto\n *\n * @param newList The new list of elements to forward to awesomplete\n */\n setAwesompleteList = (newList: Awesomplete.Suggestion[]) => {\n // reset internal awesomplete variables not automatically reset when the list updates\n // this should avoid a race condition in mouseover events caused by getting a fetch response and a mouseover while the UI is hung on a slow process.\n // See RCA in ADO for details: https://tfs.clarkinc.biz/DefaultCollection/Webstaurant.StoreFront/_workitems/edit/1234728\n this.awesomplete.index = -1;\n\n this.awesomplete.list = newList;\n };\n\n goto = (event: MouseEvent) => {\n if (!(event.target instanceof HTMLElement)) {\n return;\n }\n\n let result = event.target;\n\n if (\n (result.tagName === \"B\" || result.tagName === \"MARK\") &&\n result.parentElement\n )\n result = result.parentElement;\n const listItem = result.parentElement;\n if (!listItem || !listItem.parentElement) return;\n const index = [...listItem.parentElement.children].indexOf(listItem);\n try {\n this.awesomplete.goto(index);\n } catch (e) {\n addBreadcrumb(\n {\n message:\n \"Encountered error in SearchAutocomplete mouseover. This will recover on its own and can happen while the list is refreshing on slow devices, but may indicate other issues with Awesomplete state management.\",\n data: {\n error: toError(e),\n },\n },\n \"error\"\n );\n }\n };\n\n search = async (event: Event): Promise> => {\n if (this.input.value.length < 2) {\n if (this.input.value.length > 0) {\n this.combinedResults = [];\n this.setAwesompleteList([]);\n } else {\n this.showSearchHistory(event);\n }\n\n return {\n isError: false,\n value: false,\n };\n }\n\n this.awesomplete.autoFirst = true;\n\n if (!event.target) {\n return {\n isError: false,\n value: false,\n };\n }\n\n this.count += 1;\n const countAtTheTimeOfSearch = this.count;\n\n const query = encodeURIComponent(this.input.value);\n const searchUrl = `/wss/autosuggest/?queryText=${query}`;\n\n try {\n const results = await fetch(searchUrl).then((response) =>\n response.json()\n );\n\n if (countAtTheTimeOfSearch < this.count) {\n return {\n isError: false,\n value: false,\n };\n }\n\n this.results = results;\n\n // Normalize products property name.\n this.results.products = results.prods;\n this.results.keywords = results.keywords?.filter(\n (keyword) =>\n typeof keyword === \"string\" &&\n keyword.toLowerCase() !== `${this.input.value}`.toLowerCase()\n );\n\n if (this.flatResults[0]?.label === \"\") {\n this.showSearchHistory(event);\n\n return {\n isError: false,\n value: false,\n };\n }\n this.setAwesompleteList(this.flatResults);\n\n return {\n isError: false,\n value: true,\n };\n } catch (e) {\n const error = new Error(\n \"Error fetching and formatting global searchbar autocomplete.\",\n {\n cause: toError(e),\n }\n );\n\n return {\n error,\n isError: true,\n };\n }\n };\n\n showSearchHistory = (event: Event) => {\n // if user enters input with existing text, call search method\n if (this.input.value.length > 1) {\n this.search(event);\n return;\n }\n this.awesomplete.autoFirst = false;\n\n this.combinedResults = [];\n let localStorageHistory;\n try {\n localStorageHistory = localStorage.getItem(\"searchHistory\");\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n if (!localStorageHistory) return;\n\n const searchHistory = JSON.parse(localStorageHistory);\n\n if (!this.results) this.results = {};\n\n this.results.history = searchHistory;\n this.addResultsFor(\"history\");\n this.combinedResults.push({\n label: \"Clear Search History\",\n value: {\n action: \"clearSearchHistory\",\n },\n });\n this.setAwesompleteList(this.combinedResults);\n };\n\n updateSearchHistory = (\n newSearch: SearchHistory,\n searchHistory: SearchHistory[]\n ) => {\n const previousSearchIndex = searchHistory.findIndex((search) => {\n return search.name === newSearch.name;\n });\n\n if (previousSearchIndex > -1) {\n searchHistory.splice(previousSearchIndex, 1);\n }\n\n searchHistory.unshift(newSearch);\n\n if (searchHistory.length > 5) {\n searchHistory.splice(-1, 1);\n }\n import(\"storage-factory\").then(({ storageFactory }) => {\n const storage = storageFactory(() => window.localStorage);\n\n storage.setItem(\"searchHistory\", JSON.stringify(searchHistory));\n });\n };\n\n action = (suggestion: SectionResult) => {\n let searchHistoryLocalStorage;\n try {\n searchHistoryLocalStorage = localStorage.getItem(\"searchHistory\");\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n if (!searchHistoryLocalStorage) searchHistoryLocalStorage = \"[]\";\n const searchHistory: SearchHistory[] = JSON.parse(\n searchHistoryLocalStorage\n );\n\n if (\n suggestion.value.action &&\n suggestion.value.action === \"clearSearchHistory\"\n ) {\n import(\"storage-factory\").then(({ storageFactory }) => {\n const storage = storageFactory(() => window.localStorage);\n\n storage.setItem(\"searchHistory\", \"\");\n });\n return;\n }\n\n if (suggestion.value.href) {\n this.updateSearchHistory(\n {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n name:\n typeof suggestion.label === \"string\"\n ? suggestion.label\n : suggestion.label?.name,\n link: suggestion.value.href,\n },\n searchHistory\n );\n\n window.location.href = suggestion.value.href;\n\n return;\n }\n if (\n !suggestion.value.userProvided &&\n typeof suggestion.label === \"string\"\n ) {\n const linkName = suggestion.label.replace(\"\", \"\").replace(\"\", \"\");\n this.input.value = linkName;\n }\n\n this.updateSearchHistory(\n {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n name:\n typeof suggestion.label === \"string\"\n ? suggestion.label\n : suggestion.label?.name,\n },\n searchHistory\n );\n\n this.submitButton.click();\n };\n\n static createSearchResult(suggestion: SectionResult, searchTerm: string) {\n const li = document.createElement(\"li\");\n li.setAttribute(\n \"data-recommendation-type\",\n suggestion.value.resultType ? suggestion.value.resultType : \"\"\n );\n\n if (!suggestion.value.userProvided) {\n const result = markSearchTerm(searchTerm, suggestion.toString());\n li.innerHTML = `${\n suggestion.value.first ? suggestion.value.resultType : \"\"\n }${result}`;\n }\n\n if (suggestion.value.first) li.classList.add(\"first\");\n\n if (suggestion.value.action === \"clearSearchHistory\") {\n li.classList.add(\"clear\", \"text-green-500\");\n }\n\n return li;\n }\n\n addResults() {\n this.resultTypes.forEach(this.addResultsFor);\n }\n\n addResultsFor = (resultType: keyof Results) => {\n if (!this.results) return;\n\n const sectionResults: SectionResult[] = [];\n\n this.results[resultType]?.forEach((result) => {\n let href;\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n if (result.hasOwnProperty(\"link\")) href = result.link as string; // eslint-disable-line no-prototype-builtins\n sectionResults.push({\n label: SearchAutocomplete.extractResultName(result),\n value: { href, resultType },\n });\n });\n\n if (sectionResults[0]) {\n sectionResults[0].value.first = true;\n }\n this.combinedResults = this.combinedResults.concat(sectionResults);\n };\n\n static extractResultName(label: Label) {\n if (typeof label === \"string\") return label;\n return label.name || label.description;\n }\n}\n"],"names":["_","input","o","me","this","count","isOpened","$","setAttribute","options","instance","properties","i","initial","attrValue","getAttribute","toLowerCase","parseInt","Function","configure","minChars","maxItems","autoFirst","data","DATA","filter","FILTER_CONTAINS","sort","SORT_BYLENGTH","container","CONTAINER","item","ITEM","replace","REPLACE","tabSelect","index","ul","create","hidden","role","id","inside","status","className","textContent","_events","evaluate","bind","close","reason","evt","c","keyCode","opened","selected","preventDefault","select","undefined","form","li","target","test","nodeName","parentNode","button","hasAttribute","list","removeAttribute","all","push","Suggestion","Array","isArray","label","value","prototype","_list","indexOf","split","children","items","slice","apply","forEach","el","disabled","text","trim","document","activeElement","fire","open","goto","destroy","unbind","insertBefore","removeChild","indexOfAwesomplete","splice","next","length","previous","pos","lis","scrollTop","offsetTop","clientHeight","suggestions","origin","originalEvent","siblingIndex","suggestion","innerHTML","map","appendChild","RegExp","regExpEscape","FILTER_STARTSWITH","a","b","around","item_id","html","Object","defineProperty","String","get","toString","valueOf","expr","con","querySelector","$$","call","querySelectorAll","init","tag","element","createElement","val","ref","focus","event","callback","addEventListener","removeEventListener","type","createEvent","j","initEvent","dispatchEvent","s","previousElementSibling","self","Awesomplete","Document","readyState","module","exports","_slicedToArray","arr","Symbol","iterator","_arr","_n","_d","_e","_s","_i","done","err","sliceIterator","TypeError","_toConsumableArray","arr2","from","_len","arguments","delegateArgs","_key","args","documentElement","concat","constructor","name","_args","_args2","elements","eventListeners","selector","events","callMethod","e","delegateTarget","closest","_selector$filter","node","contains","relatedElements","SearchAutocomplete","markSearchTerm","query","resultText","submitButton","resultTypes","combinedResults","setAwesompleteList","newList","awesomplete","HTMLElement","result","tagName","parentElement","listItem","addBreadcrumb","message","error","toError","search","countAtTheTimeOfSearch","searchUrl","results","showSearchHistory","isError","encodeURIComponent","fetch","then","response","json","products","prods","keywords","keyword","flatResults","Error","cause","localStorageHistory","localStorage","getItem","console","searchHistory","JSON","parse","history","addResultsFor","action","updateSearchHistory","newSearch","previousSearchIndex","findIndex","unshift","storageFactory","window","setItem","stringify","searchHistoryLocalStorage","href","link","location","userProvided","linkName","click","resultType","sectionResults","hasOwnProperty","extractResultName","first","createSearchResult","delegate","addResults","searchTerm","classList","add","description"],"sourceRoot":""}