text: import _pick from'lodash/pick';var _extends=Object.assign||function(a){for(var c,b=1;b<arguments.length;b++)for(var d in c=arguments[b],c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d]);return a},_createClass=function(){function a(b,c){for(var e,d=0;d<c.length;d++)e=c[d],e.enumerable=e.enumerable||!1,e.configurable=!0,'value'in e&&(e.writable=!0),Object.defineProperty(b,e.key,e)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function _inherits(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}import PropTypes from'prop-types';import React,{Component}from'react';import translatable from'../core/translatable';import List from'./List';import Link from'./Link';import Highlight from'../widgets/Highlight';import classNames from'./classNames.js';var cx=classNames('Menu'),Menu=function(a){function b(){var c,d,e,f;_classCallCheck(this,b);for(var g=arguments.length,h=Array(g),j=0;j<g;j++)h[j]=arguments[j];return f=(d=(e=_possibleConstructorReturn(this,(c=b.__proto__||Object.getPrototypeOf(b)).call.apply(c,[this].concat(h))),e),e.renderItem=function(k,l){var m=e.props.createURL,n=e.props.isFromSearch?React.createElement(Highlight,{attributeName:'label',hit:k}):k.label;return React.createElement(Link,_extends({},cx('itemLink',k.isRefined&&'itemLinkSelected'),{onClick:function onClick(){return e.selectItem(k,l)},href:m(k.value)}),React.createElement('span',cx('itemLabel',k.isRefined&&'itemLabelSelected'),n),' ',React.createElement('span',cx('itemCount',k.isRefined&&'itemCountSelected'),k.count))},e.selectItem=function(k,l){l(),e.props.refine(k.value)},d),_possibleConstructorReturn(e,f)}return _inherits(b,a),_createClass(b,[{key:'componentWillMount',value:function componentWillMount(){this.context.canRefine&&this.context.canRefine(this.props.canRefine)}},{key:'componentWillReceiveProps',value:function componentWillReceiveProps(c){this.context.canRefine&&this.context.canRefine(c.canRefine)}},{key:'render',value:function render(){return React.createElement(List,_extends({renderItem:this.renderItem,selectItem:this.selectItem,cx:cx},_pick(this.props,['translate','items','showMore','limitMin','limitMax','isFromSearch','searchForItems','withSearchBox','canRefine'])))}}]),b}(Component);Menu.propTypes={translate:PropTypes.func.isRequired,refine:PropTypes.func.isRequired,searchForItems:PropTypes.func.isRequired,withSearchBox:PropTypes.bool,createURL:PropTypes.func.isRequired,items:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.string.isRequired,count:PropTypes.number.isRequired,isRefined:PropTypes.bool.isRequired})),isFromSearch:PropTypes.bool.isRequired,canRefine:PropTypes.bool.isRequired,showMore:PropTypes.bool,limitMin:PropTypes.number,limitMax:PropTypes.number,transformItems:PropTypes.func},Menu.contextTypes={canRefine:PropTypes.func};export default translatable({showMore:function showMore(a){return a?'Show less':'Show more'},noResults:'No results',submit:null,reset:null,resetTitle:'Clear the search query.',submitTitle:'Submit your search query.',placeholder:'Search here\u2026'})(Menu);