(function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("preact")):"function"==typeof define&&define.amd?define(["preact"],t):"object"==typeof exports?exports["Autocomplete"]=t(require("preact")):e["Autocomplete"]=t(e["preact"])})(window,function(n){return function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/",o(o.s=32)}([function(e,t,n){var m=n(1),v=n(5),y=n(6),g=n(15),b=n(17),O="prototype",w=function(e,t,n){var r,o,i,u,s=e&w.F,l=e&w.G,a=e&w.S,c=e&w.P,p=e&w.B,f=l?m:a?m[t]||(m[t]={}):(m[t]||{})[O],d=l?v:v[t]||(v[t]={}),h=d[O]||(d[O]={});for(r in l&&(n=t),n)i=((o=!s&&f&&f[r]!==undefined)?f:n)[r],u=p&&o?b(i,m):c&&"function"==typeof i?b(Function.call,i):i,f&&g(f,r,i,e&w.U),d[r]!=i&&y(d,r,u),c&&h[r]!=i&&(h[r]=i)};m.core=v,w.F=1,w.G=2,w.S=4,w.P=8,w.B=16,w.W=32,w.U=64,w.R=128,e.exports=w},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(7),o=n(36);e.exports=n(3)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var o=n(8),i=n(34),u=n(35),s=Object.defineProperty;t.f=n(3)?Object.defineProperty:function(e,t,n){if(o(e),t=u(t,!0),o(n),i)try{return s(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(2);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(e===undefined?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(21);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){e.exports=function(e){if(e==undefined)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t){e.exports=n},function(e,t,n){var r=n(2),o=n(1).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var i=n(1),u=n(6),s=n(16),l=n(9)("src"),r="toString",o=Function[r],a=(""+o).split(r);n(5).inspectSource=function(e){return o.call(e)},(e.exports=function(e,t,n,r){var o="function"==typeof n;o&&(s(n,"name")||u(n,"name",t)),e[t]!==n&&(o&&(s(n,l)||u(n,l,e[t]?""+e[t]:a.join(String(t)))),e===i?e[t]=n:r?e[t]?e[t]=n:u(e,t,n):(delete e[t],u(e,t,n)))})(Function.prototype,r,function(){return"function"==typeof this&&this[l]||o.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var i=n(18);e.exports=function(r,o,e){if(i(r),o===undefined)return r;switch(e){case 1:return function(e){return r.call(o,e)};case 2:return function(e,t){return r.call(o,e,t)};case 3:return function(e,t,n){return r.call(o,e,t,n)}}return function(){return r.apply(o,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(38),o=n(27);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(10),o=n(11);e.exports=function(e){return r(o(e))}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var l=n(20),a=n(23),c=n(39);e.exports=function(s){return function(e,t,n){var r,o=l(e),i=a(o.length),u=c(n,i);if(s&&t!=t){for(;u=r;this.setState({query:s}),i||!l&&a&&c?o(s,function(e){var t=0=u,P=this.props.showNoOptionsFound&&j&&k&&M&&A,F=n+"__wrapper",D=n+"__input",N=null!==w?" "+D+"--focused":"",q=this.props.showAllValues?" "+D+"--show-all-values":" "+D+"--default",R=n+"__dropdown-arrow-down",T=-1!==w&&null!==w,L=n+"__menu",B=L+"--"+r,V=L+"--"+(_||P?"visible":"hidden"),K=n+"__option",U=n+"__list",Q=n+"__hint",$=this.templateInputValue(S[C]),W=$&&0===$.toLowerCase().indexOf(E.toLowerCase())&&I?E+$.substr(E.length):"",H=Y&&W;return p&&"string"==typeof(e=g({className:R}))&&(e=(0,G.createElement)("div",{className:n+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}})),(0,G.createElement)("div",{className:F,onKeyDown:this.handleKeyDown,role:"combobox","aria-expanded":_?"true":"false"},(0,G.createElement)(J["default"],{length:S.length,queryLength:E.length,minQueryLength:u,selectedOption:this.templateInputValue(S[C]),selectedOptionIndex:C,tQueryTooShort:d,tNoResults:h,tSelectedOption:m,tResults:v}),H&&(0,G.createElement)("span",null,(0,G.createElement)("input",{className:Q,readonly:!0,tabIndex:"-1",value:W})),(0,G.createElement)("input",X({"aria-activedescendant":!!T&&i+"__option--"+w,"aria-owns":i+"__listbox",autoComplete:"off",className:""+D+N+q,id:i,onClick:function(e){return o.handleInputClick(e)},onBlur:this.handleInputBlur},function z(e){return{onInput:e}}(this.handleInputChange),{onFocus:this.handleInputFocus,name:s,placeholder:l,ref:function(e){o.elementReferences[-1]=e},type:"text",role:"textbox",required:a,value:E},b)),e,(0,G.createElement)("ul",{className:L+" "+B+" "+V,onMouseLeave:function(e){return o.handleListMouseLeave(e)},id:i+"__listbox",role:"listbox"},S.map(function(e,t){var n=(-1===w?C===t:w===t)&&null===x?" "+K+"--focused":"",r=t%2?" "+K+"--odd":"";return(0,G.createElement)("li",{"aria-selected":w===t,className:""+K+n+r,dangerouslySetInnerHTML:{__html:o.templateSuggestion(e)},id:i+"__option--"+t,key:t,onBlur:function(e){return o.handleOptionBlur(e,t)},onClick:function(e){return o.handleOptionClick(e,t)},onMouseEnter:function(e){return o.handleOptionMouseEnter(e,t)},ref:function(e){o.elementReferences[t]=e},role:"option",tabIndex:"-1"})}),P&&(0,G.createElement)("li",{className:K+" "+K+"--no-results"},f())),c&&(0,G.createElement)("ul",{className:""+U,id:i+"__list",role:"listbox"},this.props.selectedOptions.map(function(e,t){return(0,G.createElement)("li",{id:i+"__option--"+t,className:"autocomplete__selected-option"},(0,G.createElement)("span",{dangerouslySetInnerHTML:{__html:o.templateSuggestion(e.textContent)}}),(0,G.createElement)("button",{type:"button",className:"autocomplete__remove-option","aria-label":o.templateSuggestion(e.textContent)+", selected. "+y(),onClick:function(e){return o.handleSelectedOptionClick(e,t)}},"remove"))}),P&&(0,G.createElement)("li",{className:K+" "+K+"--no-results"},f())))},e}(G.Component);(t["default"]=l).defaultProps={autoselect:!1,cssNamespace:"autocomplete",customAttributes:{},defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,multiple:!1,selectedOptions:{},tNoResults:function(){return"No results found"},tSelectedOptionDescription:function(){return"Press Enter or Space to remove selection"},dropdownArrow:r["default"]}},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(37)})},function(e,t,n){e.exports=!n(3)&&!n(4)(function(){return 7!=Object.defineProperty(n(14)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var o=n(2);e.exports=function(e,t){if(!o(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!o(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";var f=n(19),d=n(41),h=n(42),m=n(28),v=n(10),o=Object.assign;e.exports=!o||n(4)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=o({},e)[n]||Object.keys(o({},t)).join("")!=r})?function(e,t){for(var n=m(e),r=arguments.length,o=1,i=d.f,u=h.f;oo;)u(r,n=t[o++])&&(~l(i,n)||i.push(n));return i}},function(e,t,n){var r=n(24),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t){e.exports=!1},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){var o=r(8),i=r(44),u=r(27),s=r(25)("IE_PROTO"),l=function(){},a="prototype",c=function(){var e,t=r(14)("iframe"),n=u.length;for(t.style.display="none",r(45).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("