LocalCDN-Firefox-Chrome-Brave/resources/findify-bundle/6.17.0/autocomplete.jsm

2 lines
26 KiB
JavaScript

(window.findifyJsonp=window.findifyJsonp||[]).push([[1],{"+MKu":function(e,t,n){"use strict";n.r(t);var o=n("aZci"),i=n("KXty"),r=n("zDdf"),a=n("lrOp"),c=n("8nTv"),s=n("1NYs"),u=n.n(s);t.default=Object(i.compose)(Object(i.setDisplayName)("Dropdown"),Object(r.default)(u.a),o.connectSuggestions,a.default)(c.default)},"172o":function(e,t,n){"use strict";n.r(t);var o=n("KXty"),i=n("t7Qm"),r=n("sOw0"),a=n.n(r),c=n("zDdf");t.default=Object(o.compose)(Object(o.setDisplayName)("ProductMatches"),Object(o.defaultProps)({columns:3}),Object(c.default)(a.a))(i.default)},"1DRH":function(e,t,n){"use strict";n.r(t),n.d(t,"usePosition",(function(){return l}));var o=n("EKKX"),i=n.n(o),r=n("gZYI"),a=n.n(r),c=n("Jmof");function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var u={},l=function(e){var t=Object(c.useRef)(null),n=Object(c.useState)(u[e.get("widgetKey")]||e.get("position")||"left"),o=a()(n,2),i=o[0],r=o[1];return Object(c.useEffect)((function(){t.current&&!u[e.get("widgetKey")]&&window.requestAnimationFrame((function(){if(t.current){var n=function(e){var t=e.getBoundingClientRect(),n=t.left,o=t.width;return window.innerWidth<n+o?"right":"left"}(t.current);u[e.get("widgetKey")]=n,r(n)}}))}),[t]),[i,e.get("position")?void 0:t]};t.default=function(e){var t=Object(c.createFactory)(e);return function(e){var n=l(e.config),o=a()(n,2),r=o[0],c=o[1];return t(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(n,!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e,{position:r,innerRef:c}))}}},"1NYs":function(e,t){e.exports={root:"findify-layouts--autocomplete--dropdown",wrapper:"findify-layouts--autocomplete--dropdown__wrapper","type-title":"findify-layouts--autocomplete--dropdown__type-title",typeTitle:"findify-layouts--autocomplete--dropdown__type-title","suggestions-title":"findify-layouts--autocomplete--dropdown__suggestions-title",suggestionsTitle:"findify-layouts--autocomplete--dropdown__suggestions-title","trending-title":"findify-layouts--autocomplete--dropdown__trending-title",trendingTitle:"findify-layouts--autocomplete--dropdown__trending-title",overlay:"findify-layouts--autocomplete--dropdown__overlay","not-found":"findify-layouts--autocomplete--dropdown__not-found",notFound:"findify-layouts--autocomplete--dropdown__not-found","start-typing":"findify-layouts--autocomplete--dropdown__start-typing",startTyping:"findify-layouts--autocomplete--dropdown__start-typing",tip:"findify-layouts--autocomplete--dropdown__tip",highlight:"findify-layouts--autocomplete--dropdown__highlight",container:"findify-layouts--autocomplete--dropdown__container","product-matches-container":"findify-layouts--autocomplete--dropdown__product-matches-container",productMatchesContainer:"findify-layouts--autocomplete--dropdown__product-matches-container","suggestions-container":"findify-layouts--autocomplete--dropdown__suggestions-container",suggestionsContainer:"findify-layouts--autocomplete--dropdown__suggestions-container"}},"1X6+":function(e,t,n){"use strict";n.r(t);var o=n("KXty"),i=n("gNLg");t.default=Object(o.compose)(Object(o.setDisplayName)("Pure"),Object(o.shouldUpdate)((function(e,t){return!Object.keys(t).every((function(n){return Object(i.is)(t[n],e[n])}))})))},"78fZ":function(e,t,n){"use strict";n.r(t);var o=n("EKKX"),i=n.n(o),r=n("Z1L4"),a=n.n(r),c=n("Jmof"),s=n.n(c),u=n("JgyH"),l=n.n(u),d=n("k19o"),f=n("uAbj"),p=n.n(f);function m(e,t,n){var o=new RegExp("(".concat(p()(t),")"),"i");return e.replace(o,'<span class="'.concat(n.highlightedText,'">$1</span>'))}t.default=function(e){var t,n=e.item,o=e.query,r=e.theme,u=e.highlighted,f=e.onClick,p=e.icon,g=e.isTrendingSearches,y=(a()(e,["item","query","theme","highlighted","onClick","icon","isTrendingSearches"]),n&&n.get("value"));Object(c.useRef)(null);return y?s.a.createElement("li",{onClick:f,role:"option",id:n.hashCode(),"aria-selected":u,className:l()(r.suggestion,(t={},i()(t,r.highlighted,u),i()(t,r.withIcon,!!p),i()(t,r.trending,g),t))},p?s.a.createElement(d.default,{name:p,className:r.icon,width:14,height:14}):null,s.a.createElement("span",{dangerouslySetInnerHTML:{__html:m(y,o.get("q"),r)}})):null}},"8nTv":function(e,t,n){"use strict";n.r(t);var o=n("gZYI"),i=n.n(o),r=n("2nRU"),a=n.n(r),c=n("EKKX"),s=n.n(c),u=n("Z1L4"),l=n.n(u),d=n("Jmof"),f=n.n(d),p=n("JHxg"),m=n("172o"),g=n("rU4C"),y=n("JgyH"),h=n.n(y),b=n("1DRH"),v=function(e){var t=e.config,n=e.theme,o=e.isTrendingSearches,i=l()(e,["config","theme","isTrendingSearches"]);return f.a.createElement("div",{className:n.suggestionsContainer},f.a.createElement("h4",{className:h()(n.typeTitle,n.suggestionsTitle,s()({},n.trendingTitle,o))},t.getIn(["i18n",o?"trendingSearches":"suggestionsTitle"])),f.a.createElement(g.default,a()({className:n.searchSuggestions,widgetKey:t.get("widgetKey"),isTrendingSearches:o},i)))},w=function(e){var t=e.config,n=e.theme,o=e.isTrendingSearches,i=l()(e,["config","theme","isTrendingSearches"]);return f.a.createElement("div",{className:n.productMatchesContainer},f.a.createElement("h4",{className:h()(n.typeTitle,s()({},n.trendingTitle,o))},t.getIn(["i18n",o?"trendingProducts":"productMatchesTitle"])),f.a.createElement(m.default,a()({className:n.productMatches,config:t},i)))};t.default=function(e){var t=e.config,n=e.theme,o=e.meta,r=e.suggestions,c=(e.innerRef,e.closeAutocomplete),u=l()(e,["config","theme","meta","suggestions","innerRef","closeAutocomplete"]),d=!o.get("q"),m=Object(b.usePosition)(t),g=i()(m,2),y=g[0],h=g[1];return r&&r.size>0?f.a.createElement("div",{className:n.wrapper},t.get("showOverlay")?f.a.createElement("div",{className:n.overlay,onClick:c}):null,f.a.createElement("div",{className:n.root,"data-findify-autocomplete":!0,tabIndex:0,ref:h,style:s()({},y,0)},f.a.createElement(p.default,{className:n.tip,title:t.getIn(["i18n","tipResults"]),zeroResultsTitle:t.getIn(["i18n","tipTrendingResults"],"View All Results"),widgetKey:t.get("widgetKey")}),f.a.createElement("div",{className:n.container},f.a.createElement(v,a()({},u,{theme:n,config:t,icon:d&&"Fire",isTrendingSearches:d})),f.a.createElement(w,a()({},u,{theme:n,config:t,isTrendingSearches:d}))))):null}},"94tO":function(e,t,n){"use strict";n.r(t);var o=n("KXty"),i=n("zDdf"),r=n("VjZN"),a=n("ABws"),c=n.n(a);t.default=Object(o.compose)(Object(o.setDisplayName)("Drawer"),Object(i.default)(c.a))(r.default)},ABws:function(e,t){e.exports={"body-no-scroll":"findify-components-common--drawer__body-no-scroll",bodyNoScroll:"findify-components-common--drawer__body-no-scroll",backdrop:"findify-components-common--drawer__backdrop",content:"findify-components-common--drawer__content"}},Evfj:function(e,t,n){"use strict";n.r(t),n.d(t,"Portal",(function(){return _})),n.d(t,"portal",(function(){return j}));var o=n("g22a"),i=n.n(o),r=n("wdT7"),a=n.n(r),c=n("nONz"),s=n.n(c),u=n("PFRG"),l=n.n(u),d=n("F5iF"),f=n.n(d),p=n("POSU"),m=n.n(p),g=n("EKKX"),y=n.n(g),h=n("Jmof"),b=n("wLXD");function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(n,!0).forEach((function(t){y()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(){var e=document.createElement("div");return e.className="findify-portal",document.body.appendChild(e),e},_=function(e){function t(e){var n;return i()(this,t),n=s()(this,l()(t).call(this,e)),y()(f()(n),"element",void 0),n.element=O(),n}return m()(t,e),a()(t,[{key:"componentDidMount",value:function(){document.body.appendChild(this.element)}},{key:"componentWillUnmount",value:function(){document.body.removeChild(this.element)}},{key:"render",value:function(){return Object(b.createPortal)(Object(h.createElement)(this.props.children),this.element)}}]),t}(h.Component);y()(_,"displayName","BodyRender");var j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(h.createElement)(_,w({children:e},t))}},JHxg:function(e,t,n){"use strict";n.r(t);var o=n("nTXM"),i=n("fqGd"),r=n.n(i),a=n("KXty"),c=n("zDdf");t.default=Object(a.compose)(Object(a.setDisplayName)("Tip"),Object(c.default)(r.a))(o.default)},Meeq:function(e,t,n){"use strict";n.r(t);var o=n("2nRU"),i=n.n(o),r=n("Z1L4"),a=n.n(r),c=n("g22a"),s=n.n(c),u=n("wdT7"),l=n.n(u),d=n("nONz"),f=n.n(d),p=n("PFRG"),m=n.n(p),g=n("F5iF"),y=n.n(g),h=n("POSU"),b=n.n(h),v=n("EKKX"),w=n.n(v),O=n("Jmof"),_=n.n(O),j=n("94tO"),E=n("k19o"),N=n("rU4C"),P=function(e){function t(){var e,n;s()(this,t);for(var o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];return n=f()(this,(e=m()(t)).call.apply(e,[this].concat(i))),w()(y()(n),"state",{isOpen:!1}),w()(y()(n),"suggestionsContainer",void 0),w()(y()(n),"input",void 0),w()(y()(n),"isFocused",void 0),w()(y()(n),"mounted",!1),w()(y()(n),"handleFocusOut",(function(e){if(e.stopImmediatePropagation(),n.mounted)return e.relatedTarget===n.input?(n.isFocused=!1,void n.setState({isOpen:!1})):void 0})),w()(y()(n),"handleInputChange",(function(e){var t=e.target.value;n.props.update("q",t)})),w()(y()(n),"handleExited",(function(){window.findify.emit("autocompleteFocusLost",n.props.config.get("widgetKey"))})),w()(y()(n),"getInputRef",(function(e){n.input=e})),w()(y()(n),"handleSubmit",(function(){window.findify.emit("search",n.props.config.get("widgetKey"),n.input.value),n.handleExited()})),n}return b()(t,e),l()(t,[{key:"componentWillUnmount",value:function(){this.setState({isOpen:!1}),document.removeEventListener("focusout",this.handleFocusOut),this.mounted=!1}},{key:"componentDidMount",value:function(){this.setState({isOpen:!0}),this.mounted=!0,document.addEventListener("focusout",this.handleFocusOut,!0)}},{key:"componentDidUpdate",value:function(){this.input&&this.input.focus()}},{key:"render",value:function(){var e=this,t=this.props,n=t.theme,o=t.meta,r=(t.isMobile,t.suggestions),c=t.config,s=a()(t,["theme","meta","isMobile","suggestions","config"]);return _.a.createElement(j.default,{hideModal:this.handleExited},_.a.createElement("div",{className:n.root,"data-findify-autocomplete":!0,tabIndex:0},_.a.createElement("div",{className:n.backdrop}),_.a.createElement("div",{className:n.header},_.a.createElement("form",{onSubmit:this.handleSubmit},_.a.createElement("input",{defaultValue:o.get("q"),className:n.input,ref:this.getInputRef,onChange:this.handleInputChange,placeholder:"What are you looking for?"})),_.a.createElement("div",{className:n.icons},_.a.createElement(E.default,{onClick:this.handleSubmit,className:n.searchIcon,name:"Search",width:18,height:18}),_.a.createElement("div",{className:n.iconDivider}),_.a.createElement(E.default,{onClick:this.handleExited,className:n.xIcon,name:"XMobile",width:13,height:13}))),r&&r.size>0?_.a.createElement("div",{className:n.suggestionsWrapper},_.a.createElement("div",{className:n.suggestionsContainer,ref:function(t){e.suggestionsContainer=t}},_.a.createElement("h4",{className:n.typeTitle},c.getIn(["i18n","suggestionsTitle"])),_.a.createElement(N.default,i()({className:n.searchSuggestions,widgetKey:c.get("widgetKey")},s)))):null))}}]),t}(_.a.Component);t.default=P},Ne2L:function(e,t,n){"use strict";n.r(t);var o=n("EKKX"),i=n.n(o),r=n("Z1L4"),a=n.n(r),c=n("Jmof"),s=n.n(c),u=n("aZci"),l=n("Evfj"),d=n("+MKu"),f=n("cyJn"),p=n("PWaQ");function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var g={dropdown:d.default,sidebar:f.default,fullscreen:p.default},y=function(e,t){return("sidebar"===e?l.portal:c.createElement)(function(e,t){return function(){return s.a.createElement("div",{"data-findify-autocomplete-wrapper":"true"},Object(c.createElement)(g[e]||p.default,t))}}(e,t))},h=Object(u.connectConfig)((function(e){var t=e.config,n=e.isTrendingSearches,o=a()(e,["config","isTrendingSearches"]),r=window.innerWidth<=t.get("mobileBreakpoint"),c=r&&t.get("mobileViewType","sidebar")||t.get("viewType","simple");return y(c,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(n,!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o,{config:t,isMobile:r,isTrendingSearches:n}))}));t.default=h},P8wK:function(e,t,n){"use strict";n.r(t);var o=n("EKKX"),i=n.n(o),r=n("Z1L4"),a=n.n(r),c=n("Jmof"),s=n.n(c),u=n("uW8t"),l=n("ZWvu");function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var f=s.a.createFactory(u.default);t.default=function(e){var t=e.items,n=e.wrapper,o=void 0===n?s.a.Fragment:n,r=a()(e,["items","wrapper"]),c=r.limit,u=r.factory,p=r.keyAccessor,m=a()(r,["limit","factory","keyAccessor"]);return s.a.createElement(o,m,Object(l.default)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(n,!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({keyAccessor:p,limit:c,array:t,factory:u||f},m)))}},PWaQ:function(e,t,n){"use strict";n.r(t);var o=n("KXty"),i=n("zDdf"),r=n("ZN57"),a=n("TUfK"),c=n.n(a),s=n("lrOp"),u=n("aZci");t.default=Object(o.compose)(Object(o.setDisplayName)("Fullscreen"),Object(i.default)(c.a),u.connectSuggestions,s.default)(r.default)},QGrJ:function(e,t,n){"use strict";n.r(t);var o=n("2nRU"),i=n.n(o),r=n("gZYI"),a=n.n(r),c=n("Z1L4"),s=n.n(c),u=n("Jmof"),l=n.n(u),d=n("ZWvu"),f=n("sgqn");t.default=function(e){var t=e.theme,n=e.suggestions,o=e.query,r=e.selectedSuggestion,c=e.widgetKey,p=e.getSuggestionProps,m=s()(e,["theme","suggestions","query","selectedSuggestion","widgetKey","getSuggestionProps"]),g=Object(u.useState)(""),y=a()(g,2),h=y[0],b=y[1];return Object(u.useEffect)((function(){void 0!==r&&(m.config.get("node").setAttribute("aria-activedescendant",~r?n.get(r).hashCode():""),~r&&(b(n.get(r).get("value")),setTimeout((function(){return b("")}),1e3)))}),[r]),l.a.createElement(l.a.Fragment,null,n&&o?l.a.createElement("ul",{className:t.list,tabIndex:0,id:"FindifyAutocompleteSuggestions",role:"listbox","aria-label":"Search suggestions","aria-live":"assertive"},l.a.createElement(d.default,{array:n,factory:function(e){var t=e.item,n=e.index;return l.a.createElement(f.default,i()({item:t,index:n,highlighted:r===n,query:o},p(n,c||""),m))}})):null,l.a.createElement("span",{style:{display:"none"},id:"FindifyAutocompleteDescription"},m.config.getIn(["a11y","autocompleteNote"],"Use up and down arrows to review and enter to select.")),l.a.createElement("div",{"aria-live":"assertive",className:t.readerText},h))}},TUfK:function(e,t){e.exports={root:"findify-layouts--autocomplete--fullscreen",wrapper:"findify-layouts--autocomplete--fullscreen__wrapper","type-title":"findify-layouts--autocomplete--fullscreen__type-title",typeTitle:"findify-layouts--autocomplete--fullscreen__type-title","suggestions-title":"findify-layouts--autocomplete--fullscreen__suggestions-title",suggestionsTitle:"findify-layouts--autocomplete--fullscreen__suggestions-title","trending-title":"findify-layouts--autocomplete--fullscreen__trending-title",trendingTitle:"findify-layouts--autocomplete--fullscreen__trending-title","not-found":"findify-layouts--autocomplete--fullscreen__not-found",notFound:"findify-layouts--autocomplete--fullscreen__not-found","start-typing":"findify-layouts--autocomplete--fullscreen__start-typing",startTyping:"findify-layouts--autocomplete--fullscreen__start-typing",tip:"findify-layouts--autocomplete--fullscreen__tip",highlight:"findify-layouts--autocomplete--fullscreen__highlight",container:"findify-layouts--autocomplete--fullscreen__container"}},UD93:function(e,t){e.exports={list:"findify-components-autocomplete--search-suggestions__list",readerText:"findify-components-autocomplete--search-suggestions__readerText"}},V6UN:function(e,t){e.exports={root:"findify-layouts--autocomplete--sidebar",backdrop:"findify-layouts--autocomplete--sidebar__backdrop",input:"findify-layouts--autocomplete--sidebar__input",icons:"findify-layouts--autocomplete--sidebar__icons","search-icon":"findify-layouts--autocomplete--sidebar__search-icon",searchIcon:"findify-layouts--autocomplete--sidebar__search-icon","x-icon":"findify-layouts--autocomplete--sidebar__x-icon",xIcon:"findify-layouts--autocomplete--sidebar__x-icon","icon-divider":"findify-layouts--autocomplete--sidebar__icon-divider",iconDivider:"findify-layouts--autocomplete--sidebar__icon-divider",header:"findify-layouts--autocomplete--sidebar__header","type-title":"findify-layouts--autocomplete--sidebar__type-title",typeTitle:"findify-layouts--autocomplete--sidebar__type-title","suggestions-container":"findify-layouts--autocomplete--sidebar__suggestions-container",suggestionsContainer:"findify-layouts--autocomplete--sidebar__suggestions-container","suggestions-wrapper":"findify-layouts--autocomplete--sidebar__suggestions-wrapper",suggestionsWrapper:"findify-layouts--autocomplete--sidebar__suggestions-wrapper","body-noscroll":"findify-layouts--autocomplete--sidebar__body-noscroll",bodyNoscroll:"findify-layouts--autocomplete--sidebar__body-noscroll"}},VjZN:function(e,t,n){"use strict";n.r(t);var o=n("EKKX"),i=n.n(o),r=n("gZYI"),a=n.n(r),c=n("Z1L4"),s=n.n(c),u=n("Jmof"),l=n.n(u),d=n("RsXh"),f=n("JgyH"),p=n.n(f);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(n,!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y={from:{transform:"translate3d(-100%, 0, 0)"},to:{transform:"translate3d(0%, 0, 0)"}},h=0;t.default=function(e){var t=e.hideModal,n=e.name,o=e.theme,i=e.options,r=void 0===i?y:i,c=e.children,f=s()(e,["hideModal","name","theme","options","children"]),m=Object(u.useState)(!1),b=a()(m,2),v=b[0],w=b[1],O=Object(d.useSpring)({from:{opacity:0},to:g({},v?r.to:r.from,{opacity:v?1:0}),config:d.config[r.easing||"default"]}),_=O.opacity,j=s()(O,["opacity"]),E=Object(u.useCallback)((function(){w(!1),setTimeout((function(){return t(n)}),400)}),[]);return Object(u.useEffect)((function(){var e=function(e){"Escape"===e.key&&E()};return h=window.scrollY,document.querySelector("body").classList.add(o.bodyNoScroll),document.addEventListener("keydown",e),requestAnimationFrame((function(){return w(!0)})),function(){document.querySelector("body").classList.remove(o.bodyNoScroll),document.removeEventListener("keydown",e),window.scrollTo(0,h),h=0}}),[]),l.a.createElement(l.a.Fragment,null,l.a.createElement(d.animated.div,{className:p()("findify-container",o.backdrop),onClick:E,style:{opacity:_}}),l.a.createElement(d.animated.div,{className:p()("findify-container",o.content,r.className),style:j,role:"region","aria-live":"polite","aria-modal":"true",ref:function(e){return e&&e.focus()}},c instanceof Function?c(g({},f,{hideModal:E})):c))}},ZJwZ:function(e,t,n){"use strict";n.r(t);var o=n("KXty"),i=n("aZci"),r=n("P8wK"),a=n("1X6+");t.default=Object(o.compose)(Object(o.setDisplayName)("ItemsList"),i.connectItems,a.default)(r.default)},ZN57:function(e,t,n){"use strict";n.r(t);var o=n("2nRU"),i=n.n(o),r=n("Z1L4"),a=n.n(r),c=n("Jmof"),s=n.n(c),u=n("rU4C"),l=n("JgyH"),d=n.n(l);t.default=function(e){var t=e.config,n=e.theme,o=(e.meta,e.suggestions),r=(e.innerRef,e.position,a()(e,["config","theme","meta","suggestions","innerRef","position"]));return o&&o.size>0?s.a.createElement("div",{className:n.wrapper},s.a.createElement("div",{className:n.root,"data-findify-autocomplete":!0,tabIndex:0},s.a.createElement("div",{className:n.container},s.a.createElement("h4",{className:d()(n.typeTitle,n.suggestionsTitle)},t.getIn(["i18n","suggestionsTitle"])),s.a.createElement(u.default,i()({className:n.searchSuggestions,widgetKey:t.get("widgetKey")},r))))):null}},"c/vA":function(e,t){e.exports={suggestion:"findify-components-autocomplete--suggestion-item__suggestion",highlightedText:"findify-components-autocomplete--suggestion-item__highlightedText",highlighted:"findify-components-autocomplete--suggestion-item__highlighted",icon:"findify-components-autocomplete--suggestion-item__icon",withIcon:"findify-components-autocomplete--suggestion-item__withIcon",trending:"findify-components-autocomplete--suggestion-item__trending"}},cyJn:function(e,t,n){"use strict";n.r(t);var o=n("KXty"),i=n("zDdf"),r=n("Meeq"),a=n("V6UN"),c=n.n(a),s=n("aZci");t.default=Object(o.compose)(Object(o.setDisplayName)("Sidebar"),Object(i.default)(c.a),s.connectSuggestions)(r.default)},fqGd:function(e,t){e.exports={tip:"findify-components-autocomplete--tip__tip",highlight:"findify-components-autocomplete--tip__highlight"}},kNe7:function(e,t,n){"use strict";n.r(t),n.d(t,"emit",(function(){return c})),n.d(t,"listen",(function(){return s}));var o=n("KoXD"),i=Object(o.createChangeEmitter)(),r=!1,a=function(){!r&&window.findify.addListeners&&(window.findify.addListeners(i.getListeners()),i.emit=window.findify.emit,i.listen=window.findify.listen,r=!0)},c=function(){return a(),i.emit.apply(i,arguments)},s=function(){return a(),i.listen.apply(i,arguments)}},lrOp:function(e,t,n){"use strict";n.r(t),n.d(t,"useAutocompleteLogic",(function(){return l}));var o=n("EKKX"),i=n.n(o),r=n("gZYI"),a=n.n(r),c=n("Jmof");function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var u=["ArrowUp","ArrowDown"],l=function(e){var t=e.config,n=e.suggestions,o=e.getSuggestionProps,i=e.meta,r=t.get("node"),s=Object(c.useReducer)((function(e,i){if(i&&!i.key)return i;if("Enter"===i.key&&-1!==e)return i.stopPropagation(),i.preventDefault(),o(e,t.get("widgetKey")).onClick(),e;if(!u.includes(i.key))return e;i.preventDefault();var r=e+("ArrowUp"===i.key?-1:1),a=n&&n.size||0;return r<0?a-1:a-1<r?0:r}),-1),l=a()(s,2),d=l[0],f=l[1],p=Object(c.useCallback)((function(){return window.findify.emit("autocompleteFocusLost",t.get("widgetKey"))}),[t.get("widgetKey")]);return Object(c.useEffect)((function(){r.autocomplete="off";var e=function(e){if(e.target===r)return"Escape"===e.key?p():void f(e)};return document.querySelector("body").addEventListener("keydown",e,!0),function(){return document.querySelector("body").removeEventListener("keydown",e,!0)}}),[]),Object(c.useEffect)((function(){return f(-1)}),[i.get("q")]),Object(c.useMemo)((function(){return{selectedSuggestion:d,closeAutocomplete:p}}),[d])};t.default=function(e){var t=Object(c.createFactory)(e);return function(e){var n=l(e);return t(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(n,!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e,{},n))}}},nTXM:function(e,t,n){"use strict";n.r(t);var o=n("Jmof"),i=n.n(o),r=n("JgyH"),a=n.n(r),c=n("aZci"),s=n("kNe7");t.default=function(e){var t=e.className,n=e.title,r=e.zeroResultsTitle,u=e.theme,l=e.widgetKey,d=Object(c.useQuery)().query,f=Object(o.useCallback)((function(){return Object(s.emit)("search",l,d.get("q")?d.get("q"):"")}),[d]);return i.a.createElement(i.a.Fragment,null,d.get("q")?i.a.createElement("div",{className:a()(u.tip,t),onClick:f},n," ",i.a.createElement("span",{className:u.highlight},d.get("q"))):null,d.get("q")?null:i.a.createElement("div",{className:a()(u.tip,t),onClick:f},r))}},rU4C:function(e,t,n){"use strict";n.r(t);var o=n("KXty"),i=n("aZci"),r=n("zDdf"),a=n("QGrJ"),c=n("UD93"),s=n.n(c);t.default=Object(o.compose)(Object(o.setDisplayName)("SearchSuggestions"),Object(r.default)(s.a),i.connectSuggestions,i.connectQuery)(a.default)},sOw0:function(e,t){e.exports={root:"findify-components-autocomplete--product-matches","product-card":"findify-components-autocomplete--product-matches__product-card",productCard:"findify-components-autocomplete--product-matches__product-card",imageWrap:"findify-components-autocomplete--product-matches__imageWrap",content:"findify-components-autocomplete--product-matches__content","price-wrapper":"findify-components-autocomplete--product-matches__price-wrapper",priceWrapper:"findify-components-autocomplete--product-matches__price-wrapper","grid-column-class":"findify-components-autocomplete--product-matches__grid-column-class",gridColumnClass:"findify-components-autocomplete--product-matches__grid-column-class","view-more-button":"findify-components-autocomplete--product-matches__view-more-button",viewMoreButton:"findify-components-autocomplete--product-matches__view-more-button"}},sgqn:function(e,t,n){"use strict";n.r(t);var o=n("KXty"),i=n("zDdf"),r=n("c/vA"),a=n.n(r),c=n("78fZ");t.default=Object(o.compose)(Object(o.setDisplayName)("SuggestionItem"),Object(i.default)(a.a))(c.default)},t7Qm:function(e,t,n){"use strict";n.r(t);var o=n("Jmof"),i=n.n(o),r=n("uW8t"),a=n("xlCz"),c=n("ZJwZ"),s=n("k3UE"),u=n("sOw0"),l=n.n(u);i.a.createFactory(r.default);t.default=function(e){e.items;var t=e.className,n=(e.columnClass,e.config),o=(e.columns,e.limit,e.theme),u=e.suggestions,d=e.getSuggestionProps,f=e.widgetKey;return i.a.createElement("div",{className:l.a.root},i.a.createElement(c.default,{wrapper:a.default,columns:String(12),columnClass:o.gridColumnClass,className:t,limit:n.getIn(["meta","item_limit"]),theme:o,config:n,factory:r.default}),u&&u.size>0&&n.get("showViewMoreButton")?i.a.createElement(s.default,{className:o.viewMoreButton,onClick:u&&u.size>0&&d(0,f).onClick},n.getIn(["i18n","viewMore"])):null)}}}]);
//# sourceMappingURL=autocomplete.js.map