UNPKG

react-select

Version:

A Select control built with and for ReactJS

1 lines 66.5 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("emotion"),require("react"),require("react-dom"),require("react-input-autosize"),require("prop-types")):"function"==typeof define&&define.amd?define(["emotion","react","react-dom","react-input-autosize","prop-types"],t):e.Select=t(e.emotion,e.React,e.ReactDOM,e.AutosizeInput,e.PropTypes)}(this,function(e,t,n,o,u){"use strict";var i="default"in t?t.default:t;o=o&&o.hasOwnProperty("default")?o.default:o,u=u&&u.hasOwnProperty("default")?u.default:u;var r=function(e,t){return e===t};var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),c=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},f=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},h=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},m=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,u=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(o=(r=s.next()).done)&&(n.push(r.value),!t||n.length!==t);o=!0);}catch(e){u=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(u)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),v=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},g=Array.isArray,E=Object.keys,b=Object.prototype.hasOwnProperty;function y(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==(void 0===t?"undefined":s(t))&&"object"==(void 0===n?"undefined":s(n))){var o,u,i,r=g(t),a=g(n);if(r&&a){if((u=t.length)!=n.length)return!1;for(o=u;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(r!=a)return!1;var l=t instanceof Date,c=n instanceof Date;if(l!=c)return!1;if(l&&c)return t.getTime()==n.getTime();var p=t instanceof RegExp,d=n instanceof RegExp;if(p!=d)return!1;if(p&&d)return t.toString()==n.toString();var f=E(t);if((u=f.length)!==E(n).length)return!1;for(o=u;0!=o--;)if(!b.call(n,f[o]))return!1;for(o=u;0!=o--;)if(!("_owner"===(i=f[o])&&t.$$typeof||e(t[i],n[i])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i))return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}var C=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}],O=function(e){for(var t=0;t<C.length;t++)e=e.replace(C[t].letters,C[t].base);return e},F=function(e){return e.replace(/^\s+|\s+$/g,"")},A=function(e){return e.label+" "+e.value},D=function(e){return function(t,n){var o=p({ignoreCase:!0,ignoreAccents:!0,stringify:A,trim:!0,matchFrom:"any"},e),u=o.ignoreCase,i=o.ignoreAccents,r=o.stringify,s=o.trim,a=o.matchFrom,l=s?F(n):n,c=s?F(r(t)):r(t);return u&&(l=l.toLowerCase(),c=c.toLowerCase()),i&&(l=O(l),c=O(c)),"start"===a?c.substr(0,l.length)===l:c.indexOf(l)>-1}},S=function(t){return i.createElement("span",p({className:e.css({zIndex:9999,border:0,clip:"rect(1px, 1px, 1px, 1px)",height:1,width:1,position:"absolute",overflow:"hidden",padding:0,whiteSpace:"nowrap",backgroundColor:"red",color:"blue"})},t))},x=function(t){function n(){return a(this,n),h(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return d(n,t),l(n,[{key:"render",value:function(){var t=this.props,n=(t.in,t.out,t.onExited,t.appear,t.enter,t.exit,t.innerRef),o=f(t,["in","out","onExited","appear","enter","exit","innerRef"]);return i.createElement("input",p({ref:n},o,{className:e.css({background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"})}))}}]),n}(t.Component),w=function(e){function t(){return a(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),l(t,[{key:"componentDidMount",value:function(){this.props.innerRef(n.findDOMNode(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),t}(t.Component),M=["boxSizing","height","overflow","paddingRight","position"],I={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function L(e){e.preventDefault()}function P(e){e.stopPropagation()}function V(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function k(){return"ontouchstart"in window||navigator.maxTouchPoints}var B=!("undefined"==typeof window||!window.document||!window.document.createElement),T=0,R=function(e){function t(){var e,n,o;a(this,t);for(var u=arguments.length,i=Array(u),r=0;r<u;r++)i[r]=arguments[r];return n=o=h(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),o.originalStyles={},o.listenerOptions={capture:!1,passive:!1},h(o,n)}return d(t,e),l(t,[{key:"componentDidMount",value:function(){var e=this;if(B){var t=this.props,n=t.accountForScrollbars,o=t.touchScrollTarget,u=document.body,i=u&&u.style;if(n&&M.forEach(function(t){var n=i&&i[t];e.originalStyles[t]=n}),n&&T<1){var r=parseInt(this.originalStyles.paddingRight,10)||0,s=document.body?document.body.clientWidth:0,a=window.innerWidth-s+r||0;Object.keys(I).forEach(function(e){var t=I[e];i&&(i[e]=t)}),i&&(i.paddingRight=a+"px")}u&&k()&&(u.addEventListener("touchmove",L,this.listenerOptions),o&&(o.addEventListener("touchstart",V,this.listenerOptions),o.addEventListener("touchmove",P,this.listenerOptions))),T+=1}}},{key:"componentWillUnmount",value:function(){var e=this;if(B){var t=this.props,n=t.accountForScrollbars,o=t.touchScrollTarget,u=document.body,i=u&&u.style;T=Math.max(T-1,0),n&&T<1&&M.forEach(function(t){var n=e.originalStyles[t];i&&(i[t]=n)}),u&&k()&&(u.removeEventListener("touchmove",L,this.listenerOptions),o&&(o.removeEventListener("touchstart",V,this.listenerOptions),o.removeEventListener("touchmove",P,this.listenerOptions)))}}},{key:"render",value:function(){return null}}]),t}(t.Component);R.defaultProps={accountForScrollbars:!0};var H=function(t){function n(){var e,t,o;a(this,n);for(var u=arguments.length,i=Array(u),r=0;r<u;r++)i[r]=arguments[r];return t=o=h(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(i))),o.state={touchScrollTarget:null},o.getScrollTarget=function(e){e!==o.state.touchScrollTarget&&o.setState({touchScrollTarget:e})},o.blurSelectInput=function(){document.activeElement&&document.activeElement.blur()},h(o,t)}return d(n,t),l(n,[{key:"render",value:function(){var t=this.props,n=t.children,o=t.isEnabled,u=this.state.touchScrollTarget;return o?i.createElement("div",null,i.createElement("div",{onClick:this.blurSelectInput,className:e.css({position:"fixed",left:0,bottom:0,right:0,top:0})}),i.createElement(w,{innerRef:this.getScrollTarget},n),u?i.createElement(R,{touchScrollTarget:u}):null):n}}]),n}(t.PureComponent),_=function(e){function t(){var e,n,o;a(this,t);for(var u=arguments.length,i=Array(u),r=0;r<u;r++)i[r]=arguments[r];return n=o=h(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),o.isBottom=!1,o.isTop=!1,o.cancelScroll=function(e){e.preventDefault(),e.stopPropagation()},o.handleEventDelta=function(e,t){var n=o.props,u=n.onBottomArrive,i=n.onBottomLeave,r=n.onTopArrive,s=n.onTopLeave,a=o.scrollTarget,l=a.scrollTop,c=a.scrollHeight,p=a.clientHeight,d=o.scrollTarget,f=t>0,h=c-p-l,m=!1;h>t&&o.isBottom&&(i&&i(e),o.isBottom=!1),f&&o.isTop&&(s&&s(e),o.isTop=!1),f&&t>h?(u&&!o.isBottom&&u(e),d.scrollTop=c,m=!0,o.isBottom=!0):!f&&-t>l&&(r&&!o.isTop&&r(e),d.scrollTop=0,m=!0,o.isTop=!0),m&&o.cancelScroll(e)},o.onWheel=function(e){o.handleEventDelta(e,e.deltaY)},o.onTouchStart=function(e){o.touchStart=e.changedTouches[0].clientY},o.onTouchMove=function(e){var t=o.touchStart-e.changedTouches[0].clientY;o.handleEventDelta(e,t)},o.getScrollTarget=function(e){o.scrollTarget=e},h(o,n)}return d(t,e),l(t,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))}},{key:"stopListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return i.createElement(w,{innerRef:this.getScrollTarget},this.props.children)}}]),t}(t.Component),N=function(e){function t(){return a(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.isEnabled,n=f(e,["isEnabled"]);return t?i.createElement(_,n):this.props.children}}]),t}(t.Component);N.defaultProps={isEnabled:!0};var U="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};for(var j,z=(function(e){(function(){var t,n,o,u,i,r;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(e.exports=function(){return(t()-i)/1e6},n=process.hrtime,u=(t=function(){var e;return 1e9*(e=n())[0]+e[1]})(),r=1e9*process.uptime(),i=u-r):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(U)}(j={exports:{}},j.exports),j.exports),W="undefined"==typeof window?U:window,Y=["moz","webkit"],G="AnimationFrame",q=W["request"+G],X=W["cancel"+G]||W["cancelRequest"+G],K=0;!q&&K<Y.length;K++)q=W[Y[K]+"Request"+G],X=W[Y[K]+"Cancel"+G]||W[Y[K]+"CancelRequest"+G];if(!q||!X){var J=0,Z=0,$=[];q=function(e){if(0===$.length){var t=z(),n=Math.max(0,1e3/60-(t-J));J=n+t,setTimeout(function(){var e=$.slice(0);$.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(J)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return $.push({handle:++Z,callback:e,cancelled:!1}),Z},X=function(e){for(var t=0;t<$.length;t++)$[t].handle===e&&($[t].cancelled=!0)}}var Q=function(e){return q.call(W,e)};Q.cancel=function(){X.apply(W,arguments)},Q.polyfill=function(e){e||(e=W),e.requestAnimationFrame=q,e.cancelAnimationFrame=X};var ee=function(){};function te(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}var ne=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===(void 0===e?"undefined":s(e))&&null!==e?[e]:[]};function oe(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function ue(e){return oe(e)?window.pageYOffset:e.scrollTop}function ie(e,t){oe(e)?window.scrollTo(0,t):e.scrollTop=t}function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ee,u=ue(e),i=t-u,r=10,s=0;!function t(){var a,l=i*((a=(a=s+=r)/n-1)*a*a+1)+u;ie(e,l),s<n?Q(t):o(e)}()}function se(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var ae="#222",le="#2684FF",ce="#B2D4FF",pe="#DEEBFF",de="#DE350B",fe="#FFBDAD",he="hsl(0, 0%, 100%)",me="hsl(0, 0%, 98%)",ve="hsl(0, 0%, 95%)",ge="hsl(0, 0%, 90%)",Ee="hsl(0, 0%, 80%)",be="hsl(0, 0%, 70%)",ye="hsl(0, 0%, 60%)",Ce="hsl(0, 0%, 50%)",Oe="hsl(0, 0%, 40%)",Fe="hsl(0, 0%, 0%)",Ae="hsla(0, 0%, 0%, 0.1)",De={baseUnit:4,controlHeight:38,menuGutter:8},Se=function(t){function n(){return a(this,n),h(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return d(n,t),l(n,[{key:"render",value:function(){var t=this.props,n=t.children,o=t.className,u=t.cx,r=t.isMulti,s=t.getStyles,a=t.hasValue;return i.createElement("div",{className:u(e.css(s("valueContainer",this.props)),{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":a},o)},n)}}]),n}(t.Component),xe=function(t){var n=t.size,o=f(t,["size"]);return i.createElement("svg",p({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:e.css({display:"inline-block",fill:"currentColor",lineHeight:1,stroke:"currentColor",strokeWidth:0})},o))},we=function(e){return i.createElement(xe,p({size:20},e),i.createElement("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Me=function(e){return i.createElement(xe,p({size:20},e),i.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Ie=function(e){var t=e.isFocused;return{color:t?Oe:Ee,display:"flex",padding:2*De.baseUnit,transition:"color 150ms",":hover":{color:t?Fe:ye}}},Le=Ie,Pe=Ie,Ve=function(t){var n=t.color,o=t.delay,u=t.offset;return i.createElement("span",{className:e.css({animationDuration:"1s",animationDelay:o+"ms",animationIterationCount:"infinite",animationName:"react-select-loading-indicator",animationTimingFunction:"ease-in-out",backgroundColor:n,borderRadius:"1em",display:"inline-block",marginLeft:u?"1em":null,height:"1em",verticalAlign:"top",width:"1em"})})};e.injectGlobal("@keyframes ","react-select-loading-indicator","{0%,80%,100%{opacity:0;}40%{opacity:1;}};");var ke=function(t){var n=t.className,o=t.cx,u=t.getStyles,r=t.innerProps,s=t.isFocused,a=t.isRtl,l=s?ae:Ee;return i.createElement("div",p({},r,{className:o(e.css(u("loadingIndicator",t)),{indicator:!0,"loading-indicator":!0},n)}),i.createElement(Ve,{color:l,delay:0,offset:a}),i.createElement(Ve,{color:l,delay:160,offset:!0}),i.createElement(Ve,{color:l,delay:320,offset:!a}))};ke.defaultProps={size:4};function Be(e){var t=e.maxHeight,n=e.menuEl,o=e.minHeight,u=e.placement,i=e.shouldScroll,r=e.isFixedPosition,s=function(e){var t=getComputedStyle(e),n="absolute"===t.position,o=/(auto|scroll)/,u=document.documentElement;if("fixed"===t.position)return u;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),(!n||"static"!==t.position)&&o.test(t.overflow+t.overflowY+t.overflowX))return i;return u}(n),a={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return a;var l=s.getBoundingClientRect().height,c=n.getBoundingClientRect(),p=c.bottom,d=c.height,f=c.top,h=n.offsetParent.getBoundingClientRect().top,m=window.innerHeight,v=ue(s),g=De.menuGutter,E=h-g,b=m-f,y=E+v,C=l-v-f,O=p-m+v+g,F=v+f-g;switch(u){case"auto":case"bottom":if(b>=d)return{placement:"bottom",maxHeight:t};if(C>=d&&!r)return i&&re(s,O,160),{placement:"bottom",maxHeight:t};if(!r&&C>=o||r&&b>=o)return i&&re(s,O,160),{placement:"bottom",maxHeight:r?b-g:C-g};if("auto"===u||r){var A=t;return(!r&&y>=o||r&&E>=o)&&(A=r?E-g-De.controlHeight:y-g-De.controlHeight),{placement:"top",maxHeight:A}}if("bottom"===u)return ie(s,O),{placement:"bottom",maxHeight:t};break;case"top":if(E>=d)return{placement:"top",maxHeight:t};if(y>=d&&!r)return i&&re(s,F,160),{placement:"top",maxHeight:t};if(!r&&y>=o||r&&E>=o){var D=t;return(!r&&y>=o||r&&E>=o)&&(D=r?E-g:y-g),i&&re(s,F,160),{placement:"top",maxHeight:D}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'+u+'".')}return a}var Te=function(e){return"auto"===e?"bottom":e},Re=function(t){function n(){var e,t,o;a(this,n);for(var u=arguments.length,i=Array(u),r=0;r<u;r++)i[r]=arguments[r];return t=o=h(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(i))),o.state={maxHeight:o.props.maxMenuHeight,placement:null},o.getPlacement=function(e){var t=o.props,n=t.minMenuHeight,u=t.maxMenuHeight,i=t.menuPlacement,r=t.menuPosition,s=t.menuShouldScrollIntoView,a=o.context.getPortalPlacement;if(e){var l="fixed"===r,c=Be({maxHeight:u,menuEl:e,minHeight:n,placement:i,shouldScroll:s&&!l,isFixedPosition:l});a&&a(c),o.setState(c)}},o.getState=function(){var e=o.props.menuPlacement,t=o.state.placement||Te(e);return p({},o.props,{placement:t,maxHeight:o.state.maxHeight})},h(o,t)}return d(n,t),l(n,[{key:"render",value:function(){var t=this.props,n=t.children,o=t.className,u=t.cx,r=t.getStyles,s=t.innerProps;return i.createElement("div",p({className:u(e.css(r("menu",this.getState())),{menu:!0},o),ref:this.getPlacement},s),n)}}]),n}(t.Component);Re.contextTypes={getPortalPlacement:u.func};var He=function(){return{color:ye,padding:2*De.baseUnit+"px "+3*De.baseUnit+"px",textAlign:"center"}},_e=He,Ne=He,Ue=function(t){var n=t.children,o=t.className,u=t.cx,r=t.getStyles,s=t.innerProps;return i.createElement("div",p({className:u(e.css(r("noOptionsMessage",t)),{"menu-notice":!0,"menu-notice--no-options":!0},o)},s),n)};Ue.defaultProps={children:"No options"};var je=function(t){var n=t.children,o=t.className,u=t.cx,r=t.getStyles,s=t.innerProps;return i.createElement("div",p({className:u(e.css(r("loadingMessage",t)),{"menu-notice":!0,"menu-notice--loading":!0},o)},s),n)};je.defaultProps={children:"Loading..."};var ze=function(t){function o(){var e,t,n;a(this,o);for(var u=arguments.length,i=Array(u),r=0;r<u;r++)i[r]=arguments[r];return t=n=h(this,(e=o.__proto__||Object.getPrototypeOf(o)).call.apply(e,[this].concat(i))),n.state={placement:null},n.getPortalPlacement=function(e){var t=e.placement;t!==Te(n.props.menuPlacement)&&n.setState({placement:t})},h(n,t)}return d(o,t),l(o,[{key:"getChildContext",value:function(){return{getPortalPlacement:this.getPortalPlacement}}},{key:"render",value:function(){var t=this.props,o=t.appendTo,u=t.children,r=t.controlElement,s=t.menuPlacement,a=t.menuPosition,l=t.getStyles,c="fixed"===a;if(!o&&!c||!r)return null;var p=this.state.placement||Te(s),d=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),f=c?0:window.pageYOffset,h={offset:d[p]+f,position:a,rect:d},m=i.createElement("div",{className:e.css(l("menuPortal",h))},u);return o?n.createPortal(m,o):m}}]),o}(t.Component);ze.childContextTypes={getPortalPlacement:u.func};var We=function(e){var t=e.children,n=e.innerProps;return i.createElement("div",n,t)},Ye=We,Ge=We,qe=function(e){function t(){return a(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.innerProps;return i.createElement("div",n,t)}}]),t}(t.Component);qe.defaultProps={children:i.createElement(we,{size:14})};var Xe=function(t){function n(){return a(this,n),h(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return d(n,t),l(n,[{key:"render",value:function(){var t=this.props,n=t.children,o=t.className,u=t.components,r=t.cx,s=t.data,a=t.getStyles,l=t.innerProps,c=t.isDisabled,d=t.removeProps,f=t.selectProps,h=u.Container,m=u.Label,v=u.Remove,g=p({className:r(e.css(a("multiValue",this.props)),{"multi-value":!0,"multi-value--is-disabled":c},o)},l),E={className:r(e.css(a("multiValueLabel",this.props)),{"multi-value__label":!0},o)},b=p({className:r(e.css(a("multiValueRemove",this.props)),{"multi-value__remove":!0},o)},d);return i.createElement(h,{data:s,innerProps:g,selectProps:f},i.createElement(m,{data:s,innerProps:E,selectProps:f},n),i.createElement(v,{data:s,innerProps:b,selectProps:f}))}}]),n}(t.Component);Xe.defaultProps={cropWithEllipsis:!0};var Ke={ClearIndicator:function(t){var n=t.children,o=void 0===n?i.createElement(we,null):n,u=t.className,r=t.cx,s=t.getStyles,a=t.innerProps;return i.createElement("div",p({},a,{className:r(e.css(s("clearIndicator",t)),{indicator:!0,"clear-indicator":!0},u)}),o)},Control:function(t){var n=t.children,o=t.cx,u=t.getStyles,r=t.className,s=t.isDisabled,a=t.isFocused,l=t.innerRef,c=t.innerProps;return i.createElement("div",p({ref:l,className:o(e.css(u("control",t)),{control:!0,"control--is-disabled":s,"control--is-focused":a},r)},c),n)},DropdownIndicator:function(t){var n=t.children,o=void 0===n?i.createElement(Me,null):n,u=t.className,r=t.cx,s=t.getStyles,a=t.innerProps;return i.createElement("div",p({},a,{className:r(e.css(s("dropdownIndicator",t)),{indicator:!0,"dropdown-indicator":!0},u)}),o)},DownChevron:Me,CrossIcon:we,Group:function(t){var n=t.children,o=t.className,u=t.cx,r=t.getStyles,s=t.Heading,a=t.label;return i.createElement("div",{className:u(e.css(r("group",t)),{group:!0},o)},i.createElement(s,{getStyles:r,cx:u},a),i.createElement("div",null,n))},GroupHeading:function(t){var n=t.className,o=t.cx,u=t.getStyles,r=f(t,["className","cx","getStyles"]);return i.createElement("div",p({className:o(e.css(u("groupHeading",t)),{"group-heading":!0},n)},r))},IndicatorsContainer:function(t){var n=t.children,o=t.className,u=t.cx,r=t.getStyles;return i.createElement("div",{className:u(e.css(r("indicatorsContainer",t)),{indicators:!0},o)},n)},IndicatorSeparator:function(t){var n=t.className,o=t.cx,u=t.getStyles,r=t.innerProps;return i.createElement("span",p({},r,{className:o(e.css(u("indicatorSeparator",t)),{"indicator-separator":!0},n)}))},Input:function(t){var n=t.className,u=t.cx,r=t.getStyles,s=t.innerRef,a=t.isHidden,l=t.isDisabled,c=f(t,["className","cx","getStyles","innerRef","isHidden","isDisabled"]);return i.createElement("div",{className:e.css(r("input",c))},i.createElement(o,p({className:u(null,{input:!0},n),inputRef:s,inputStyle:function(e){return{background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}}(a),disabled:l},c)))},LoadingIndicator:ke,Menu:Re,MenuList:function(t){var n=t.children,o=t.className,u=t.cx,r=t.getStyles,s=t.isMulti,a=t.innerRef;return i.createElement("div",{className:u(e.css(r("menuList",t)),{"menu-list":!0,"menu-list--is-multi":s},o),ref:a},n)},MenuPortal:ze,LoadingMessage:je,NoOptionsMessage:Ue,MultiValue:Xe,MultiValueContainer:Ye,MultiValueLabel:Ge,MultiValueRemove:qe,Option:function(t){var n=t.children,o=t.className,u=t.cx,r=t.getStyles,s=t.isDisabled,a=t.isFocused,l=t.isSelected,c=t.innerRef,d=t.innerProps;return i.createElement("div",p({ref:c,className:u(e.css(r("option",t)),{option:!0,"option--is-disabled":s,"option--is-focused":a,"option--is-selected":l},o)},d),n)},Placeholder:function(t){var n=t.children,o=t.className,u=t.cx,r=t.getStyles,s=t.innerProps;return i.createElement("div",p({className:u(e.css(r("placeholder",t)),{placeholder:!0},o)},s),n)},SelectContainer:function(t){var n=t.children,o=t.className,u=t.cx,r=t.getStyles,s=t.innerProps,a=t.isDisabled,l=t.isRtl;return i.createElement("div",p({className:u(e.css(r("container",t)),{"--is-disabled":a,"--is-rtl":l},o)},s),n)},SingleValue:function(t){var n=t.children,o=t.className,u=t.cx,r=t.getStyles,s=t.isDisabled,a=t.innerProps;return i.createElement("div",p({className:u(e.css(r("singleValue",t)),{"single-value":!0,"single-value--is-disabled":s},o)},a),n)},ValueContainer:Se},Je={clearIndicator:Pe,container:function(e){var t=e.isDisabled;return{direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused;return{alignItems:"center",backgroundColor:t?ve:n?he:me,borderColor:t?ge:n?le:Ee,borderRadius:4,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px "+le:null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:De.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?le:be}}},dropdownIndicator:Le,group:function(){return{paddingBottom:2*De.baseUnit,paddingTop:2*De.baseUnit}},groupHeading:function(){return{color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*De.baseUnit,paddingRight:3*De.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){return{alignSelf:"stretch",backgroundColor:e.isDisabled?ge:Ee,marginBottom:2*De.baseUnit,marginTop:2*De.baseUnit,width:1}},input:function(e){var t=e.isDisabled;return{margin:De.baseUnit/2,paddingBottom:De.baseUnit/2,paddingTop:De.baseUnit/2,visibility:t?"hidden":"visible",color:ae}},loadingIndicator:function(e){var t=e.isFocused,n=e.size;return{color:t?Oe:Ee,display:"flex",padding:2*De.baseUnit,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:Ne,menu:function(e){var t,n=e.placement;return c(t={},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),c(t,"backgroundColor",he),c(t,"borderRadius",4),c(t,"boxShadow","0 0 0 1px "+Ae+", 0 4px 11px "+Ae),c(t,"marginBottom",De.menuGutter),c(t,"marginTop",De.menuGutter),c(t,"position","absolute"),c(t,"width","100%"),c(t,"zIndex",1),t},menuList:function(e){return{maxHeight:e.maxHeight,overflowY:"auto",paddingBottom:De.baseUnit,paddingTop:De.baseUnit,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,o=e.position;return{left:t.left,position:o,top:n,width:t.width,zIndex:1}},multiValue:function(){return{backgroundColor:ge,borderRadius:2,display:"flex",margin:De.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.cropWithEllipsis;return{borderRadius:2,color:ae,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:t?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){return{alignItems:"center",borderRadius:2,backgroundColor:e.isFocused&&fe,display:"flex",paddingLeft:De.baseUnit,paddingRight:De.baseUnit,":hover":{backgroundColor:fe,color:de}}},noOptionsMessage:_e,option:function(e){var t=e.isDisabled,n=e.isFocused,o=e.isSelected;return{backgroundColor:o?le:n?pe:"transparent",color:t?Ee:o?he:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:2*De.baseUnit+"px "+3*De.baseUnit+"px",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:o?le:ce}}},placeholder:function(){return{color:Ce,marginLeft:De.baseUnit/2,marginRight:De.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){return{color:e.isDisabled?ye:ae,marginLeft:De.baseUnit/2,marginRight:De.baseUnit/2,maxWidth:"calc(100% - "+2*De.baseUnit+"px)",overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(){return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:De.baseUnit/2+"px "+2*De.baseUnit+"px",WebkitOverflowScrolling:"touch",position:"relative"}}};var Ze={backspaceRemovesValue:!0,blurInputOnSelect:se(),captureMenuScroll:!se(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:D(),formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return t+" result"+(1!==t?"s":"")+" available"},styles:{},tabIndex:"0",tabSelectsValue:!0},$e=1,Qe=function(e){function t(e){a(this,t);var n=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));et.call(n);var o=e.value;n.cacheComponents=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=void 0,o=[],u=void 0,i=!1,s=function(e,n){return t(e,o[n])};return function(){for(var t=arguments.length,r=Array(t),a=0;a<t;a++)r[a]=arguments[a];return i&&n===this&&r.length===o.length&&r.every(s)?u:(i=!0,n=this,o=r,u=e.apply(this,r))}}(n.cacheComponents,y).bind(n),n.cacheComponents(e.components),n.instancePrefix="react-select-"+(n.props.instanceId||++$e);var u=ne(o),i=n.buildMenuOptions(e,u);return n.state.menuOptions=i,n.state.selectValue=u,n}return d(t,e),l(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.options,o=t.value,u=t.inputValue;if(this.cacheComponents(e.components),e.value!==o||e.options!==n||e.inputValue!==u){var i=ne(e.value),r=this.buildMenuOptions(e,i),s=this.getNextFocusedValue(i),a=this.getNextFocusedOption(r.focusable);this.setState({menuOptions:r,selectValue:i,focusedOption:a,focusedValue:s})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t,n,o,u,i,r=this.props,s=r.isDisabled,a=r.menuIsOpen,l=this.state.isFocused;(l&&!s&&e.isDisabled||l&&a&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,o=t.getBoundingClientRect(),u=n.getBoundingClientRect(),i=n.offsetHeight/3,u.bottom+i>o.bottom?ie(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):u.top-i<o.top&&ie(t,Math.max(n.offsetTop-i,0))),this.scrollToFocusedOptionOnUpdate=!1}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){var e=this.props,t=e.isSearchable,n=e.isMulti;this.announceAriaLiveContext({event:"input",context:{isSearchable:t,isMulti:n}}),this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this.state,n=t.menuOptions,o=t.selectValue,u=this.props.isMulti,i="first"===e?0:n.focusable.length-1;if(!u){var r=n.focusable.indexOf(o[0]);r>-1&&(i=r)}this.scrollToFocusedOptionOnUpdate=!0,this.inputIsHiddenAfterUpdate=!1,this.onMenuOpen(),this.setState({focusedValue:null,focusedOption:n.focusable[i]}),this.announceAriaLiveContext({event:"menu"})}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,o=t.isSearchable,u=this.state,i=u.selectValue,r=u.focusedValue;if(n){this.setState({focusedOption:null});var s=i.indexOf(r);r||(s=-1,this.announceAriaLiveContext({event:"value"}));var a=i.length-1,l=-1;if(i.length){switch(e){case"previous":l=0===s?0:-1===s?a:s-1;break;case"next":s>-1&&s<a&&(l=s+1)}-1===l&&this.announceAriaLiveContext({event:"input",context:{isSearchable:o,isMulti:n}}),this.setState({inputIsHidden:-1!==l,focusedValue:i[l]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state,o=n.focusedOption,u=n.menuOptions.focusable;if(u.length){var i=0,r=u.indexOf(o);o||(r=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?i=r>0?r-1:u.length-1:"down"===e?i=(r+1)%u.length:"pageup"===e?(i=r-t)<0&&(i=0):"pagedown"===e?(i=r+t)>u.length-1&&(i=u.length-1):"last"===e&&(i=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[i],focusedValue:null})}}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,o=this.selectOption,u=this.props,i=u.classNamePrefix,r=u.isMulti,s=u.isRtl,a=u.options,l=this.state.selectValue,c=this.hasValue();return{cx:function(e,t,n,o){var u=[t,o];if(n&&e)for(var i in n)n.hasOwnProperty(i)&&n[i]&&u.push(""+te(e,i));return u.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}.bind(null,i),clearValue:e,getStyles:t,getValue:function(){return l},hasValue:c,isMulti:r,isRtl:s,options:a,selectOption:o,setValue:n,selectProps:u}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,o=t.selectValue.indexOf(n);if(o>-1){if(e.indexOf(n)>-1)return n;if(o<e.length)return e[o]}return null}},{key:"getNextFocusedOption",value:function(e){var t=this.state.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var o=this.getOptionValue(e);return t.some(function(e){return n.getOptionValue(e)===o})}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,o=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:o})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"buildMenuOptions",value:function(e,t){var n=this,o=e.inputValue,u=void 0===o?"":o,i=function(e,o){var i=n.isOptionDisabled(e,t),r=n.isOptionSelected(e,t),s=n.getOptionLabel(e),a=n.getOptionValue(e);if(!(n.shouldHideSelectedOptions()&&r||!n.filterOption({label:s,value:a,data:e},u))){var l=i?void 0:function(){return n.onOptionHover(e)},c=i?void 0:function(){return n.selectOption(e)},p=n.getElementId("option")+"-"+o;return{innerProps:{id:p,onClick:c,onMouseMove:l,onMouseOver:l,role:"option",tabIndex:-1},data:e,isDisabled:i,isSelected:r,key:p,label:s,type:"option",value:a}}};return e.options.reduce(function(e,t,o){if(t.options){n.hasGroups||(n.hasGroups=!0);var u=t.options.map(function(t,n){var u=i(t,o+"-"+n);return u&&!u.isDisabled&&e.focusable.push(t),u}).filter(Boolean);if(u.length){var r=n.getElementId("group")+"-"+o;e.render.push({type:"group",key:r,data:t,options:u})}}else{var s=i(t,""+o);s&&(e.render.push(s),s.isDisabled||e.focusable.push(t))}return e},{render:[],focusable:[]})}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,o=e.focusedValue,u=e.focusedOption,i=this.props,r=i.options,s=i.menuIsOpen,a=i.inputValue,l=i.screenReaderStatus;return(o?function(e){var t=e.focusedValue,n=e.getOptionLabel,o=e.selectValue;return"value "+n(t)+" focused, "+(o.indexOf(t)+1)+" of "+o.length+"."}({focusedValue:o,getOptionLabel:this.getOptionLabel,selectValue:n}):"")+" "+(u&&s?function(e){var t=e.focusedOption,n=e.getOptionLabel,o=e.options;return"option "+n(t)+" focused, "+(o.indexOf(t)+1)+" of "+o.length+"."}({focusedOption:u,getOptionLabel:this.getOptionLabel,options:r}):"")+" "+function(e){var t=e.inputValue;return e.screenReaderMessage+(t?" for search term "+t:"")+"."}({inputValue:a,screenReaderMessage:l({count:this.countOptions()})})+" "+t}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,o=e.inputId,u=e.inputValue,r=e.tabIndex,s=this.components.Input,a=this.state.inputIsHidden,l=o||this.getElementId("input");if(!n)return i.createElement(x,{id:l,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ee,onFocus:this.onInputFocus,readOnly:!0,tabIndex:r,value:""});var c={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]},d=this.commonProps.cx;return i.createElement(s,p({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:d,getStyles:this.getStyles,id:l,innerRef:this.getInputRef,isDisabled:t,isHidden:a,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,type:"text",value:u},c))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,o=t.MultiValueContainer,u=t.MultiValueLabel,r=t.MultiValueRemove,s=t.SingleValue,a=t.Placeholder,l=this.commonProps,c=this.props,d=c.controlShouldRenderValue,f=c.isDisabled,h=c.isMulti,m=c.inputValue,v=c.placeholder,g=this.state,E=g.selectValue,b=g.focusedValue;if(!this.hasValue()||!d)return m?null:i.createElement(a,p({},l,{key:"placeholder",isDisabled:f}),v);if(h)return E.map(function(t){var s=t===b;return i.createElement(n,p({},l,{components:{Container:o,Label:u,Remove:r},isFocused:s,isDisabled:f,key:e.getOptionValue(t),removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))});if(m)return null;var y=E[0];return i.createElement(s,p({},l,{data:y,isDisabled:f}),this.formatOptionLabel(y,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,o=n.isDisabled,u=n.isLoading,r=this.state.isFocused;if(!this.isClearable()||!e||o||!this.hasValue()||u)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.createElement(e,p({},t,{innerProps:s,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,o=n.isDisabled,u=n.isLoading,r=this.state.isFocused;if(!e||!u)return null;return i.createElement(e,p({},t,{innerProps:{"aria-hidden":"true"},isDisabled:o,isFocused:r}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var o=this.commonProps,u=this.props.isDisabled,r=this.state.isFocused;return i.createElement(n,p({},o,{isDisabled:u,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,o=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.createElement(e,p({},t,{innerProps:u,isDisabled:n,isFocused:o}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,o=t.GroupHeading,u=t.Menu,r=t.MenuList,s=t.MenuPortal,a=t.LoadingMessage,l=t.NoOptionsMessage,c=t.Option,d=this.commonProps,h=this.state,m=h.focusedOption,v=h.menuOptions,g=this.props,E=g.captureMenuScroll,b=g.inputValue,y=g.isLoading,C=g.loadingMessage,O=g.minMenuHeight,F=g.maxMenuHeight,A=g.menuIsOpen,D=g.menuPlacement,S=g.menuPosition,x=g.menuPortalTarget,w=g.menuShouldBlockScroll,M=g.menuShouldScrollIntoView,I=g.noOptionsMessage,L=g.onMenuScrollToTop,P=g.onMenuScrollToBottom;if(!A)return null;var V=function(t){var n=m===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,i.createElement(c,p({},d,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))},k=void 0;if(this.hasOptions())k=v.render.map(function(t){if("group"===t.type){t.type;var u=f(t,["type"]),r=t.key+"-heading";return i.createElement(n,p({},d,u,{Heading:o,headingProps:{id:r},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return V(e)}))}if("option"===t.type)return V(t)});else if(y){var B=C({inputValue:b});if(null===B)return null;k=i.createElement(a,d,B)}else{var T=I({inputValue:b});if(null===T)return null;k=i.createElement(l,d,T)}var R=i.createElement("div",null,i.cre