{"version":3,"sources":["webpack:///./src/feature/search/search.js","webpack:///./node_modules/core-js/modules/es.object.get-prototype-of.js","webpack:///./node_modules/core-js/modules/es.object.set-prototype-of.js","webpack:///./node_modules/core-js/modules/es.string.search.js","webpack:///./node_modules/core-js/internals/same-value.js"],"names":["Search","element","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","call","initDomCache","el","lastKnownScrollY","currentScrollY","ticking","search","body","window","features","dom","searchBtnOpen","querySelector","searchBtnClose","searchInput","addClick","log","BaseFeature","_this2","addEventListener","menuTrigger","document","classList","remove","parentNode","add","setAttribute","focus","e","activeElement","keyCode","preventDefault","click","blur","$","__webpack_require__","fails","toObject","nativeGetPrototypeOf","CORRECT_PROTOTYPE_GETTER","target","stat","forced","sham","getPrototypeOf","it","setPrototypeOf","fixRegExpWellKnownSymbolLogic","anObject","requireObjectCoercible","sameValue","regExpExec","SEARCH","nativeSearch","maybeCallNative","regexp","O","searcher","undefined","RegExp","String","res","done","value","rx","S","previousLastIndex","lastIndex","result","index","module","exports","Object","is","x","y"],"mappings":"m+BAGMA,cACL,SAAAA,EAAYC,GAAS,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACpBE,EAAAG,EAAAD,KAAAE,EAAAN,GAAAO,KAAAH,KAAMH,KAEDO,eAELN,EAAKO,GAAKR,EACVC,EAAKQ,iBAAmB,EACxBR,EAAKS,eAAiB,EACtBT,EAAKU,SAAU,EACfV,EAAKW,OAASX,EAAKO,GACnBP,EAAKY,KAAOC,OAAOC,SAASC,IAAIH,KAChCZ,EAAKgB,cAAgBhB,EAAKO,GAAGU,cAAc,6BAC3CjB,EAAKkB,eAAiBlB,EAAKO,GAAGU,cAAc,8BAC5CjB,EAAKmB,YAAcnB,EAAKO,GAAGU,cAAc,2BAEzCjB,EAAKoB,WACLpB,EAAKqB,IAAI,UAhBWrB,wPADDsB,iDAqBT,IAAAC,EAAArB,KACNA,KAAKc,gBACRd,KAAKc,cAAcQ,iBAAiB,QAAS,WA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AAApD,MACA4D,EAAAC,MAAAH,OAAAG,EAAAH,EAAAH,GACA,YAAAM,IAAAD,IAAAzD,KAAAuD,EAAAC,GAAA,IAAAG,OAAAJ,GAAAH,GAAAQ,OAAAJ,KAIA,SAAAD,GACA,IAAAM,EAAAP,EAAAD,EAAAE,EAAA1D,MACA,GAAAgE,EAAAC,KAAA,OAAAD,EAAAE,MAEA,IAAAC,EAAAhB,EAAAO,GACAU,EAAAL,OAAA/D,MAEAqE,EAAAF,EAAAG,UACAjB,EAAAgB,EAAA,KAAAF,EAAAG,UAAA,GACA,IAAAC,EAAAjB,EAAAa,EAAAC,GAEA,OADAf,EAAAc,EAAAG,UAAAD,KAAAF,EAAAG,UAAAD,GACA,OAAAE,GAAA,EAAAA,EAAAC,6BC5BAC,EAAAC,QAAAC,OAAAC,IAAA,SAAAC,EAAAC,GAEA,OAAAD,IAAAC,EAAA,IAAAD,GAAA,EAAAA,GAAA,EAAAC,EAAAD,MAAAC","file":"8-fce25e65.pkg.js","sourcesContent":["import BaseFeature from '../../foundation/base/base';\r\n\r\n\r\nclass Search extends BaseFeature {\r\n\tconstructor(element) {\r\n\t\tsuper(element);\r\n\r\n\t\tthis.initDomCache();\r\n\r\n\t\tthis.el = element;\r\n\t\tthis.lastKnownScrollY = 0;\r\n\t\tthis.currentScrollY = 0;\r\n\t\tthis.ticking = false;\r\n\t\tthis.search = this.el;\r\n\t\tthis.body = window.features.dom.body;\r\n\t\tthis.searchBtnOpen = this.el.querySelector('[data-js=\"searchBtnOpen\"]');\r\n\t\tthis.searchBtnClose = this.el.querySelector('[data-js=\"searchBtnClose\"]');\r\n\t\tthis.searchInput = this.el.querySelector('[data-js=\"searchInput\"]');\r\n\r\n\t\tthis.addClick();\r\n\t\tthis.log('Search');\r\n\t}\r\n\r\n\r\n\taddClick() {\r\n\t\tif (this.searchBtnOpen) {\r\n\t\t\tthis.searchBtnOpen.addEventListener('click', () => {\r\n\t\t\t\t// Collapsing menu if search is triggered\r\n\t\t\t\tconst menuTrigger = document.querySelector('.m-menu-list__item.is-active');\r\n\t\t\t\tif (menuTrigger) {\r\n\t\t\t\t\tmenuTrigger.classList.remove('is-active');\r\n\t\t\t\t}\r\n\t\t\t\tthis.searchBtnOpen.parentNode.parentNode.classList.add('is-active');\r\n\t\t\t\tthis.searchBtnOpen.setAttribute('aria-expanded', 'true'); // Accessibility\r\n\t\t\t\tthis.searchBtnClose.setAttribute('aria-expanded', 'true'); // Accessibility\r\n\t\t\t\tthis.searchInput.focus();\r\n\t\t\t});\r\n\t\t\t// Accessibility\r\n\t\t\twindow.addEventListener('keyup', (e) => {\r\n\t\t\t\tconst isFocused = document.activeElement === this.searchBtnOpen;\r\n\t\t\t\tif (isFocused && e.keyCode === 13) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t// Trigger the button element with a click\r\n\t\t\t\t\tthis.searchBtnOpen.click();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.searchBtnClose) {\r\n\t\t\tthis.searchBtnClose.addEventListener('click', () => {\r\n\t\t\t\tthis.searchBtnOpen.parentNode.parentNode.classList.remove('is-active');\r\n\t\t\t\tthis.searchBtnOpen.setAttribute('aria-expanded', 'false'); // Accessibility\r\n\t\t\t\tthis.searchBtnClose.setAttribute('aria-expanded', 'false'); // Accessibility\r\n\t\t\t\tthis.searchInput.blur();\r\n\t\t\t});\r\n\t\t\t// Accessibility\r\n\t\t\twindow.addEventListener('keyup', (e) => {\r\n\t\t\t\tconst isFocused = document.activeElement === this.searchBtnClose;\r\n\t\t\t\tif (isFocused && e.keyCode === 13) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t// Trigger the button element with a click\r\n\t\t\t\t\tthis.searchBtnClose.click();\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 Search;\r\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toObject = require('../internals/to-object');\nvar nativeGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {\n getPrototypeOf: function getPrototypeOf(it) {\n return nativeGetPrototypeOf(toObject(it));\n }\n});\n\n","var $ = require('../internals/export');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n$({ target: 'Object', stat: true }, {\n setPrototypeOf: setPrototypeOf\n});\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar sameValue = require('../internals/same-value');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@search logic\nfixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {\n return [\n // `String.prototype.search` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.search\n function search(regexp) {\n var O = requireObjectCoercible(this);\n var searcher = regexp == undefined ? undefined : regexp[SEARCH];\n return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n },\n // `RegExp.prototype[@@search]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search\n function (regexp) {\n var res = maybeCallNative(nativeSearch, regexp, this);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n\n var previousLastIndex = rx.lastIndex;\n if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;\n var result = regExpExec(rx, S);\n if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;\n return result === null ? -1 : result.index;\n }\n ];\n});\n","// `SameValue` abstract operation\n// https://tc39.github.io/ecma262/#sec-samevalue\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n"],"sourceRoot":""}