From 17095065c1752a82dd9f17be443b3b6be5bfeccd Mon Sep 17 00:00:00 2001 From: Theodor Vararu Date: Tue, 16 May 2017 12:28:35 +0100 Subject: [PATCH] Update changelog and dist --- CHANGELOG.md | 2 ++ dist/accessible-autocomplete.min.js | 2 +- dist/accessible-autocomplete.min.js.map | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 310e99f8..8dbdcbd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ _(add items here for easier creation of next log entry)_ +- Update preact to v8.1.0. + ## 1.0.5 - 2017-05-16 - Add support for handling null/placeholder options when using `enhanceSelectElement`. Use `preserveNullOptions: true` to include options with `value=''` in the autocomplete results when enhancing a select element. diff --git a/dist/accessible-autocomplete.min.js b/dist/accessible-autocomplete.min.js index a787472a..f6c7c9f9 100644 --- a/dist/accessible-autocomplete.min.js +++ b/dist/accessible-autocomplete.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.accessibleAutocomplete=t():e.accessibleAutocomplete=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=4)}([function(e,t,n){!function(e,n){!function(e){function t(e,t,n){this.nodeName=e,this.attributes=t,this.children=n,this.key=t&&t.key}function n(e,n){var o,r,i,l,u=[];for(l=arguments.length;l-- >2;)q.push(arguments[l]);for(n&&n.children&&(q.length||q.push(n.children),delete n.children);q.length;)if((r=q.pop())instanceof Array)for(l=r.length;l--;)q.push(r[l]);else null!=r&&!1!==r&&("number"!=typeof r&&!0!==r||(r=String(r)),i="string"==typeof r,i&&o?u[u.length-1]+=r:(u.push(r),o=i));var a=new t(e,n||void 0,u);return F.vnode&&F.vnode(a),a}function o(e,t){if(t)for(var n in t)e[n]=t[n];return e}function r(e){return o({},e)}function i(e,t){for(var n=t.split("."),o=0;o2?[].slice.call(arguments,2):e.children)}function p(e,t,n){var o=t.split(".");return function(t){for(var r=t&&t.target||this,l={},a=l,s=u(n)?i(t,n):r.nodeName?r.type.match(/^che|rad/)?r.checked:r.value:t,p=0;p47&&e<58||32===e||8===e||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223}t.__esModule=!0,t.default=void 0;var a,s,p=n(0),c=n(3),d=function(e){return e&&e.__esModule?e:{default:e}}(c),f={13:"enter",27:"escape",38:"up",40:"down"},h=function(){var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}(),m=(s=a=function(e){function t(n){o(this,t);var i=r(this,e.call(this,n));return i.elementRefs={},i.state={focused:null,hovered:null,menuOpen:!1,options:n.defaultValue?[n.defaultValue]:[],query:n.defaultValue,selected:null},i.handleComponentBlur=i.handleComponentBlur.bind(i),i.handleKeyDown=i.handleKeyDown.bind(i),i.handleUpArrow=i.handleUpArrow.bind(i),i.handleDownArrow=i.handleDownArrow.bind(i),i.handleEnter=i.handleEnter.bind(i),i.handlePrintableKey=i.handlePrintableKey.bind(i),i.handleOptionClick=i.handleOptionClick.bind(i),i.handleOptionFocusOut=i.handleOptionFocusOut.bind(i),i.handleOptionFocus=i.handleOptionFocus.bind(i),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(i),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(i),i.handleOptionMouseOut=i.handleOptionMouseOut.bind(i),i.handleOptionTouchEnd=i.handleOptionTouchEnd.bind(i),i.handleInputBlur=i.handleInputBlur.bind(i),i.handleInputChange=i.handleInputChange.bind(i),i.handleInputFocus=i.handleInputFocus.bind(i),i.pollInputElement=i.pollInputElement.bind(i),i.getDirectInputChanges=i.getDirectInputChanges.bind(i),i}return i(t,e),t.prototype.componentDidMount=function(){this.pollInputElement()},t.prototype.componentWillUnmount=function(){clearTimeout(this.$pollInput)},t.prototype.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout(function(){e.pollInputElement()},100)},t.prototype.getDirectInputChanges=function(){var e=this.elementRefs[-1];e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})},t.prototype.componentDidUpdate=function(e,t){var n=this.state.focused,o=null===n,r=t.focused!==n;r&&!o&&this.elementRefs[n].focus();var i=-1===n,l=r&&null===t.focused;if(i&&l){var u=this.elementRefs[n];u.setSelectionRange(0,u.value.length)}},t.prototype.hasAutoselect=function(){return!l()&&this.props.autoselect},t.prototype.templateInputValue=function(e){var t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e},t.prototype.templateSuggestion=function(e){var t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e},t.prototype.handleComponentBlur=function(e){var t=this.state,n=t.options,o=t.query,r=t.selected,i=void 0;this.props.confirmOnBlur?(i=e.query||o,this.props.onConfirm(n[r])):i=o,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:i,selected:null})},t.prototype.handleOptionFocusOut=function(e,t){var n=this.state,o=n.focused,r=n.menuOpen,i=n.options,u=n.selected,a=null===e.relatedTarget,s=e.relatedTarget===this.elementRefs[-1],p=o!==t&&-1!==o;if(a||!p&&!s){var c=r&&l();this.handleComponentBlur({menuOpen:c,query:this.templateInputValue(i[u])})}},t.prototype.handleInputBlur=function(e){var t=this.state,n=t.focused,o=t.menuOpen,r=t.options,i=t.query,u=t.selected;if(-1===n){var a=o&&l(),s=l()?i:this.templateInputValue(r[u]);this.handleComponentBlur({menuOpen:a,query:s})}},t.prototype.handleInputChange=function(e){var t=this,n=this.props,o=n.minLength,r=n.source,i=this.hasAutoselect(),l=e.target.value,u=0===l.length,a=this.state.query.length!==l.length,s=l.length>=o;this.setState({query:l}),!u&&a&&s?r(l,function(e){var n=e.length>0;t.setState({menuOpen:n,options:e,selected:i&&n?0:-1})}):!u&&s||this.setState({menuOpen:!1,options:[]})},t.prototype.handleInputFocus=function(e){this.setState({focused:-1})},t.prototype.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e})},t.prototype.handleOptionMouseEnter=function(e,t){this.setState({hovered:t})},t.prototype.handleOptionMouseOut=function(e,t){this.setState({hovered:null})},t.prototype.handleOptionTouchEnd=function(e,t){this.handleOptionClick(e,t)},t.prototype.handleOptionClick=function(e,t){var n=this.state.options[t],o=this.templateInputValue(n);this.props.onConfirm(n),this.setState({focused:-1,menuOpen:!1,query:o,selected:-1})},t.prototype.handleOptionMouseDown=function(e){e.preventDefault()},t.prototype.handleUpArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,o=t.selected;-1!==o&&n&&this.handleOptionFocus(o-1)},t.prototype.handleDownArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,o=t.options,r=t.selected;r!==o.length-1&&n&&this.handleOptionFocus(r+1)},t.prototype.handleEnter=function(e){this.state.menuOpen&&(e.preventDefault(),this.state.selected>=0&&this.handleOptionClick(e,this.state.selected))},t.prototype.handlePrintableKey=function(e){var t=this.elementRefs[-1];e.target===t||this.handleInputFocus()},t.prototype.handleKeyDown=function(e){switch(f[e.keyCode]){case"up":this.handleUpArrow(e);break;case"down":this.handleDownArrow(e);break;case"enter":this.handleEnter(e);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:u(e.keyCode)&&this.handlePrintableKey(e)}},t.prototype.render=function(){var e=this,t=this.props,n=t.cssNamespace,o=t.displayMenu,r=t.id,i=t.minLength,l=t.name,u=this.state,a=u.focused,s=u.hovered,c=u.menuOpen,f=u.options,m=u.query,v=u.selected,y=this.hasAutoselect(),b=-1===a,g=0===f.length,_=0!==m.length,O=m.length>=i,x=this.props.showNoOptionsFound&&b&&g&&_&&O,C=function(t){var o=t.children;return(0,p.h)("div",{className:n+"__wrapper",onKeyDown:e.handleKeyDown},o)},w=function(){var t=e.templateInputValue(f[v]),o=t&&0===t.toLowerCase().indexOf(m.toLowerCase()),r=o&&y?m+t.substr(m.length):"";return r?(0,p.h)("input",{className:n+"__hint",readonly:!0,tabindex:"-1",value:r}):null},N=function(){var t=n+"__input",o=null!==a,i=o?" "+t+"--focused":"",u=""+t+i;return(0,p.h)("input",{"aria-activedescendant":-1!==a&&null!==a&&r+"__option--"+a,"aria-expanded":c,"aria-owns":r+"__listbox",autocomplete:"off",className:u,id:r,name:l,onBlur:e.handleInputBlur,onFocus:e.handleInputFocus,onInput:e.handleInputChange,placeholder:e.props.placeholder,role:"combobox",type:"text",value:m})},E=function(e){var t=e.children,i=n+"__menu",l=i+"--"+(c||x?"visible":"hidden"),u=i+" "+i+"--"+o+" "+l;return(0,p.h)("ul",{className:u,id:r+"__listbox",role:"listbox"},t)},I=function(){return(0,p.h)("li",{className:n+"__option "+n+"__option--no-results"},"No results found")},M=function(t){var o=t.dangerouslySetInnerHTML,i=t.idx,l=n+"__option",u=-1===a?v===i:a===i,c=u&&null===s?" "+l+"--focused":"",d=i%2?" "+l+"--odd":"",f=""+l+c+d;return(0,p.h)("li",{"aria-selected":a===i,className:f,dangerouslySetInnerHTML:o,id:r+"__option--"+i,onClick:function(t){return e.handleOptionClick(t,i)},onFocusOut:function(t){return e.handleOptionFocusOut(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},onMouseOut:function(t){return e.handleOptionMouseOut(t,i)},onTouchEnd:function(t){return e.handleOptionTouchEnd(t,i)},role:"option",tabindex:"-1"})};return(0,p.h)(C,null,(0,p.h)(d.default,{length:f.length,queryLength:m.length,minQueryLength:i,selectedOption:this.templateInputValue(f[v])}),h&&(0,p.h)(w,null),(0,p.h)(N,{ref:function(t){e.elementRefs[-1]=t}}),(0,p.h)(E,null,f.map(function(t,n){return(0,p.h)(M,{dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)},idx:n,ref:function(t){e.elementRefs[n]=t}})}),x&&(0,p.h)(I,null)))},t}(p.Component),a.defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",id:"autocomplete",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0},s);t.default=m},function(e,t,n){"use strict";function o(e,t){}function r(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){"function"!=typeof t&&null!==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))}t.__esModule=!0,t.default=void 0;var l=n(0),u=function(e){function t(){var n,i,l;o(this,t);for(var u=arguments.length,a=Array(u),s=0;s2;)S.push(arguments[l]);for(n&&null!=n.children&&(S.length||S.push(n.children),delete n.children);S.length;)if((r=S.pop())&&void 0!==r.pop)for(l=r.length;l--;)S.push(r[l]);else!0!==r&&!1!==r||(r=null),(i="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?u[u.length-1]+=r:u===T?u=[r]:u.push(r),o=i;var s=new t;return s.nodeName=e,s.children=u,s.attributes=null==n?void 0:n,s.key=null==n?void 0:n.key,void 0!==L.vnode&&L.vnode(s),s}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e,t){return n(e.nodeName,o(o({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}function i(e){!e.__d&&(e.__d=!0)&&1==U.push(e)&&(L.debounceRendering||setTimeout)(l)}function l(){var e,t=U;for(U=[];e=t.pop();)e.__d&&N(e)}function u(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&s(e,t.nodeName):n||e._componentConstructor===t.nodeName}function s(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function p(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function c(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===A.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var l=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,f,l):e.removeEventListener(t,f,l),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)h(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var u=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?u?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(u?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function h(e,t,n){try{e[t]=n}catch(e){}}function f(e){return this.__l[e.type](L.event&&L.event(e)||e)}function m(){for(var e;e=P.pop();)L.afterMount&&L.afterMount(e),e.componentDidMount&&e.componentDidMount()}function _(e,t,n,o,r,i){V++||(j=null!=r&&void 0!==r.ownerSVGElement,q=null!=e&&!("__preactattr_"in e));var l=v(e,t,n,o,i);return r&&l.parentNode!==r&&r.appendChild(l),--V||(q=!1,i||m()),l}function v(e,t,n,o,r){var i=e,l=j;if(null==t&&(t=""),"string"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),b(e,!0))),i.__preactattr_=!0,i;if("function"==typeof t.nodeName)return M(e,t,n,o);if(j="svg"===t.nodeName||"foreignObject"!==t.nodeName&&j,(!e||!s(e,String(t.nodeName)))&&(i=p(String(t.nodeName),j),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),b(e,!0)}var u=i.firstChild,a=i.__preactattr_||(i.__preactattr_={}),c=t.children;return!q&&c&&1===c.length&&"string"==typeof c[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=c[0]&&(u.nodeValue=c[0]):(c&&c.length||null!=u)&&y(i,c,n,o,q||null!=a.dangerouslySetInnerHTML),O(i,t.attributes,a),j=l,i}function y(e,t,n,o,r){var i,l,s,a,p=e.childNodes,d=[],h={},f=0,m=0,_=p.length,y=0,g=t?t.length:0;if(0!==_)for(var O=0;O<_;O++){var w=p[O],C=w.__preactattr_,x=g&&C?w._component?w._component.__k:C.key:null;null!=x?(f++,h[x]=w):(C||(void 0!==w.splitText?!r||w.nodeValue.trim():r))&&(d[y++]=w)}if(0!==g)for(var O=0;O=_?e.appendChild(a):a!==p[O]&&(a===p[O+1]?c(p[O]):e.insertBefore(a,p[O]||null)))}if(f)for(var O in h)void 0!==h[O]&&b(h[O],!1);for(;m<=y;)void 0!==(a=d[y--])&&b(a,!1)}function b(e,t){var n=e._component;n?I(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||c(e),g(e))}function g(e){for(e=e.lastChild;e;){var t=e.previousSibling;b(e,!0),e=t}}function O(e,t,n){var o;for(o in n)t&&null!=t[o]||null==n[o]||d(e,o,n[o],n[o]=void 0,j);for(o in t)"children"===o||"innerHTML"===o||o in n&&t[o]===("value"===o||"checked"===o?e[o]:n[o])||d(e,o,n[o],n[o]=t[o],j)}function w(e){var t=e.constructor.name;(F[t]||(F[t]=[])).push(e)}function C(e,t,n){var o,r=F[e.name];if(e.prototype&&e.prototype.render?(o=new e(t,n),k.call(o,t,n)):(o=new k(t,n),o.constructor=e,o.render=x),r)for(var i=r.length;i--;)if(r[i].constructor===e){o.__b=r[i].__b,r.splice(i,1);break}return o}function x(e,t,n){return this.constructor(e,n)}function E(e,t,n,o,r){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||r?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===L.syncComponentUpdates&&e.base?i(e):N(e,1,r)),e.__r&&e.__r(e))}function N(e,t,n,r){if(!e.__x){var i,l,u,s=e.props,p=e.state,c=e.context,d=e.__p||s,h=e.__s||p,f=e.__c||c,v=e.base,y=e.__b,g=v||y,O=e._component,w=!1;if(v&&(e.props=d,e.state=h,e.context=f,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(s,p,c)?w=!0:e.componentWillUpdate&&e.componentWillUpdate(s,p,c),e.props=s,e.state=p,e.context=c),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!w){i=e.render(s,p,c),e.getChildContext&&(c=o(o({},c),e.getChildContext()));var x,M,k=i&&i.nodeName;if("function"==typeof k){var D=a(i);l=O,l&&l.constructor===k&&D.key==l.__k?E(l,D,1,c,!1):(x=l,e._component=l=C(k,D,c),l.__b=l.__b||y,l.__u=e,E(l,D,0,c,!1),N(l,1,n,!0)),M=l.base}else u=g,x=O,x&&(u=e._component=null),(g||1===t)&&(u&&(u._component=null),M=_(u,i,c,n||!v,g&&g.parentNode,!0));if(g&&M!==g&&l!==O){var S=g.parentNode;S&&M!==S&&(S.replaceChild(M,g),x||(g._component=null,b(g,!1)))}if(x&&I(x),e.base=M,M&&!r){for(var T=e,A=e;A=A.__u;)(T=A).base=M;M._component=T,M._componentConstructor=T.constructor}}if(!v||n?P.unshift(e):w||(m(),e.componentDidUpdate&&e.componentDidUpdate(d,h,f),L.afterUpdate&&L.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);V||r||m()}}function M(e,t,n,o){for(var r=e&&e._component,i=r,l=e,u=r&&e._componentConstructor===t.nodeName,s=u,p=a(t);r&&!s&&(r=r.__u);)s=r.constructor===t.nodeName;return r&&s&&(!o||r._component)?(E(r,p,3,n,o),e=r.base):(i&&!u&&(I(i),e=l=null),r=C(t.nodeName,p,n),e&&!r.__b&&(r.__b=e,l=null),E(r,p,1,n,o),e=r.base,l&&e!==l&&(l._component=null,b(l,!1))),e}function I(e){L.beforeUnmount&&L.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?I(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,c(t),w(e),g(t)),e.__r&&e.__r(null)}function k(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}function D(e,t,n){return _(n,e,{},!1,t,!1)}var L={},S=[],T=[],A=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,U=[],P=[],V=0,j=!1,q=!1,F={};o(k.prototype,{setState:function(e,t){var n=this.state;this.__s||(this.__s=o({},n)),o(n,"function"==typeof e?e(n,this.props):e),t&&(this.__h=this.__h||[]).push(t),i(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),N(this,2)},render:function(){}});var B={h:n,createElement:n,cloneElement:r,Component:k,render:D,rerender:l,options:L};e.exports=B}()},function(e,t,n){"use strict";function o(e){if(!e.element)throw new Error("element is not defined");if(!e.id)throw new Error("id is not defined");if(!e.source)throw new Error("source is not defined");(0,i.render)((0,i.h)(u.default,e),e.element)}var r=Object.assign||function(e){for(var t=1;t47&&e<58||32===e||8===e||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223}t.__esModule=!0,t.default=void 0;var s,a,p=n(0),c=n(3),d=function(e){return e&&e.__esModule?e:{default:e}}(c),h={13:"enter",27:"escape",38:"up",40:"down"},f=function(){var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}(),m=(a=s=function(e){function t(n){o(this,t);var i=r(this,e.call(this,n));return i.elementRefs={},i.state={focused:null,hovered:null,menuOpen:!1,options:n.defaultValue?[n.defaultValue]:[],query:n.defaultValue,selected:null},i.handleComponentBlur=i.handleComponentBlur.bind(i),i.handleKeyDown=i.handleKeyDown.bind(i),i.handleUpArrow=i.handleUpArrow.bind(i),i.handleDownArrow=i.handleDownArrow.bind(i),i.handleEnter=i.handleEnter.bind(i),i.handlePrintableKey=i.handlePrintableKey.bind(i),i.handleOptionClick=i.handleOptionClick.bind(i),i.handleOptionFocusOut=i.handleOptionFocusOut.bind(i),i.handleOptionFocus=i.handleOptionFocus.bind(i),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(i),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(i),i.handleOptionMouseOut=i.handleOptionMouseOut.bind(i),i.handleOptionTouchEnd=i.handleOptionTouchEnd.bind(i),i.handleInputBlur=i.handleInputBlur.bind(i),i.handleInputChange=i.handleInputChange.bind(i),i.handleInputFocus=i.handleInputFocus.bind(i),i.pollInputElement=i.pollInputElement.bind(i),i.getDirectInputChanges=i.getDirectInputChanges.bind(i),i}return i(t,e),t.prototype.componentDidMount=function(){this.pollInputElement()},t.prototype.componentWillUnmount=function(){clearTimeout(this.$pollInput)},t.prototype.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout(function(){e.pollInputElement()},100)},t.prototype.getDirectInputChanges=function(){var e=this.elementRefs[-1];e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})},t.prototype.componentDidUpdate=function(e,t){var n=this.state.focused,o=null===n,r=t.focused!==n;r&&!o&&this.elementRefs[n].focus();var i=-1===n,l=r&&null===t.focused;if(i&&l){var u=this.elementRefs[n];u.setSelectionRange(0,u.value.length)}},t.prototype.hasAutoselect=function(){return!l()&&this.props.autoselect},t.prototype.templateInputValue=function(e){var t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e},t.prototype.templateSuggestion=function(e){var t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e},t.prototype.handleComponentBlur=function(e){var t=this.state,n=t.options,o=t.query,r=t.selected,i=void 0;this.props.confirmOnBlur?(i=e.query||o,this.props.onConfirm(n[r])):i=o,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:i,selected:null})},t.prototype.handleOptionFocusOut=function(e,t){var n=this.state,o=n.focused,r=n.menuOpen,i=n.options,u=n.selected,s=null===e.relatedTarget,a=e.relatedTarget===this.elementRefs[-1],p=o!==t&&-1!==o;if(s||!p&&!a){var c=r&&l();this.handleComponentBlur({menuOpen:c,query:this.templateInputValue(i[u])})}},t.prototype.handleInputBlur=function(e){var t=this.state,n=t.focused,o=t.menuOpen,r=t.options,i=t.query,u=t.selected;if(-1===n){var s=o&&l(),a=l()?i:this.templateInputValue(r[u]);this.handleComponentBlur({menuOpen:s,query:a})}},t.prototype.handleInputChange=function(e){var t=this,n=this.props,o=n.minLength,r=n.source,i=this.hasAutoselect(),l=e.target.value,u=0===l.length,s=this.state.query.length!==l.length,a=l.length>=o;this.setState({query:l}),!u&&s&&a?r(l,function(e){var n=e.length>0;t.setState({menuOpen:n,options:e,selected:i&&n?0:-1})}):!u&&a||this.setState({menuOpen:!1,options:[]})},t.prototype.handleInputFocus=function(e){this.setState({focused:-1})},t.prototype.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e})},t.prototype.handleOptionMouseEnter=function(e,t){this.setState({hovered:t})},t.prototype.handleOptionMouseOut=function(e,t){this.setState({hovered:null})},t.prototype.handleOptionTouchEnd=function(e,t){this.handleOptionClick(e,t)},t.prototype.handleOptionClick=function(e,t){var n=this.state.options[t],o=this.templateInputValue(n);this.props.onConfirm(n),this.setState({focused:-1,menuOpen:!1,query:o,selected:-1})},t.prototype.handleOptionMouseDown=function(e){e.preventDefault()},t.prototype.handleUpArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,o=t.selected;-1!==o&&n&&this.handleOptionFocus(o-1)},t.prototype.handleDownArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,o=t.options,r=t.selected;r!==o.length-1&&n&&this.handleOptionFocus(r+1)},t.prototype.handleEnter=function(e){this.state.menuOpen&&(e.preventDefault(),this.state.selected>=0&&this.handleOptionClick(e,this.state.selected))},t.prototype.handlePrintableKey=function(e){var t=this.elementRefs[-1];e.target===t||this.handleInputFocus()},t.prototype.handleKeyDown=function(e){switch(h[e.keyCode]){case"up":this.handleUpArrow(e);break;case"down":this.handleDownArrow(e);break;case"enter":this.handleEnter(e);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:u(e.keyCode)&&this.handlePrintableKey(e)}},t.prototype.render=function(){var e=this,t=this.props,n=t.cssNamespace,o=t.displayMenu,r=t.id,i=t.minLength,l=t.name,u=t.placeholder,s=this.state,a=s.focused,c=s.hovered,h=s.menuOpen,m=s.options,_=s.query,v=s.selected,y=this.hasAutoselect(),b=-1===a,g=0===m.length,O=0!==_.length,w=_.length>=i,C=this.props.showNoOptionsFound&&b&&g&&O&&w,x=n+"__wrapper",E=n+"__input",N=null!==a,M=N?" "+E+"--focused":"",I=-1!==a&&null!==a,k=n+"__menu",D=k+"--"+o,L=h||C,S=k+"--"+(L?"visible":"hidden"),T=n+"__option",A=n+"__hint",U=this.templateInputValue(m[v]),P=U&&0===U.toLowerCase().indexOf(_.toLowerCase()),V=P&&y?_+U.substr(_.length):"",j=f&&V;return(0,p.h)("div",{className:x,onKeyDown:this.handleKeyDown},(0,p.h)(d.default,{length:m.length,queryLength:_.length,minQueryLength:i,selectedOption:this.templateInputValue(m[v])}),j&&(0,p.h)("span",null,(0,p.h)("input",{className:A,readonly:!0,tabindex:"-1",value:V})),(0,p.h)("input",{"aria-activedescendant":!!I&&r+"__option--"+a,"aria-expanded":h,"aria-owns":r+"__listbox",autocomplete:"off",className:""+E+M,id:r,onBlur:this.handleInputBlur,onFocus:this.handleInputFocus,onInput:this.handleInputChange,name:l,placeholder:u,ref:function(t){e.elementRefs[-1]=t},role:"combobox",type:"text",value:_}),(0,p.h)("ul",{className:k+" "+D+" "+S,id:r+"__listbox",role:"listbox"},m.map(function(t,n){var o=-1===a?v===n:a===n,i=o&&null===c?" "+T+"--focused":"",l=n%2?" "+T+"--odd":"";return(0,p.h)("li",{"aria-selected":a===n,className:""+T+i+l,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)},id:r+"__option--"+n,onClick:function(t){return e.handleOptionClick(t,n)},onFocusOut:function(t){return e.handleOptionFocusOut(t,n)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,n)},onMouseOut:function(t){return e.handleOptionMouseOut(t,n)},onTouchEnd:function(t){return e.handleOptionTouchEnd(t,n)},ref:function(t){e.elementRefs[n]=t},role:"option",tabindex:"-1"})}),C&&(0,p.h)("li",{className:T+" "+T+"--no-results"},"No results found")))},t}(p.Component),s.defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",id:"autocomplete",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0},a);t.default=m},function(e,t,n){"use strict";function o(e,t){}function r(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){"function"!=typeof t&&null!==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))}t.__esModule=!0,t.default=void 0;var l=n(0),u=function(e){function t(){var n,i,l;o(this,t);for(var u=arguments.length,s=Array(u),a=0;a2;)q.push(arguments[l]);for(n&&n.children&&(q.length||q.push(n.children),delete n.children);q.length;)if((r=q.pop())instanceof Array)for(l=r.length;l--;)q.push(r[l]);else null!=r&&!1!==r&&(\"number\"!=typeof r&&!0!==r||(r=String(r)),i=\"string\"==typeof r,i&&o?u[u.length-1]+=r:(u.push(r),o=i));var a=new t(e,n||void 0,u);return F.vnode&&F.vnode(a),a}function o(e,t){if(t)for(var n in t)e[n]=t[n];return e}function r(e){return o({},e)}function i(e,t){for(var n=t.split(\".\"),o=0;o2?[].slice.call(arguments,2):e.children)}function p(e,t,n){var o=t.split(\".\");return function(t){for(var r=t&&t.target||this,l={},a=l,s=u(n)?i(t,n):r.nodeName?r.type.match(/^che|rad/)?r.checked:r.value:t,p=0;p47&&e<58||32===e||8===e||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223}t.__esModule=!0,t.default=void 0;var a,s,p=n(0),c=n(3),d=function(e){return e&&e.__esModule?e:{default:e}}(c),f={13:\"enter\",27:\"escape\",38:\"up\",40:\"down\"},h=function(){var e=document.createElement(\"x\");return e.style.cssText=\"pointer-events:auto\",\"auto\"===e.style.pointerEvents}(),m=(s=a=function(e){function t(n){o(this,t);var i=r(this,e.call(this,n));return i.elementRefs={},i.state={focused:null,hovered:null,menuOpen:!1,options:n.defaultValue?[n.defaultValue]:[],query:n.defaultValue,selected:null},i.handleComponentBlur=i.handleComponentBlur.bind(i),i.handleKeyDown=i.handleKeyDown.bind(i),i.handleUpArrow=i.handleUpArrow.bind(i),i.handleDownArrow=i.handleDownArrow.bind(i),i.handleEnter=i.handleEnter.bind(i),i.handlePrintableKey=i.handlePrintableKey.bind(i),i.handleOptionClick=i.handleOptionClick.bind(i),i.handleOptionFocusOut=i.handleOptionFocusOut.bind(i),i.handleOptionFocus=i.handleOptionFocus.bind(i),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(i),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(i),i.handleOptionMouseOut=i.handleOptionMouseOut.bind(i),i.handleOptionTouchEnd=i.handleOptionTouchEnd.bind(i),i.handleInputBlur=i.handleInputBlur.bind(i),i.handleInputChange=i.handleInputChange.bind(i),i.handleInputFocus=i.handleInputFocus.bind(i),i.pollInputElement=i.pollInputElement.bind(i),i.getDirectInputChanges=i.getDirectInputChanges.bind(i),i}return i(t,e),t.prototype.componentDidMount=function(){this.pollInputElement()},t.prototype.componentWillUnmount=function(){clearTimeout(this.$pollInput)},t.prototype.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout(function(){e.pollInputElement()},100)},t.prototype.getDirectInputChanges=function(){var e=this.elementRefs[-1];e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})},t.prototype.componentDidUpdate=function(e,t){var n=this.state.focused,o=null===n,r=t.focused!==n;r&&!o&&this.elementRefs[n].focus();var i=-1===n,l=r&&null===t.focused;if(i&&l){var u=this.elementRefs[n];u.setSelectionRange(0,u.value.length)}},t.prototype.hasAutoselect=function(){return!l()&&this.props.autoselect},t.prototype.templateInputValue=function(e){var t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e},t.prototype.templateSuggestion=function(e){var t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e},t.prototype.handleComponentBlur=function(e){var t=this.state,n=t.options,o=t.query,r=t.selected,i=void 0;this.props.confirmOnBlur?(i=e.query||o,this.props.onConfirm(n[r])):i=o,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:i,selected:null})},t.prototype.handleOptionFocusOut=function(e,t){var n=this.state,o=n.focused,r=n.menuOpen,i=n.options,u=n.selected,a=null===e.relatedTarget,s=e.relatedTarget===this.elementRefs[-1],p=o!==t&&-1!==o;if(a||!(p||s)){var c=r&&l();this.handleComponentBlur({menuOpen:c,query:this.templateInputValue(i[u])})}},t.prototype.handleInputBlur=function(e){var t=this.state,n=t.focused,o=t.menuOpen,r=t.options,i=t.query,u=t.selected;if(-1===n){var a=o&&l(),s=l()?i:this.templateInputValue(r[u]);this.handleComponentBlur({menuOpen:a,query:s})}},t.prototype.handleInputChange=function(e){var t=this,n=this.props,o=n.minLength,r=n.source,i=this.hasAutoselect(),l=e.target.value,u=0===l.length,a=this.state.query.length!==l.length,s=l.length>=o;this.setState({query:l}),!u&&a&&s?r(l,function(e){var n=e.length>0;t.setState({menuOpen:n,options:e,selected:i&&n?0:-1})}):!u&&s||this.setState({menuOpen:!1,options:[]})},t.prototype.handleInputFocus=function(e){this.setState({focused:-1})},t.prototype.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e})},t.prototype.handleOptionMouseEnter=function(e,t){this.setState({hovered:t})},t.prototype.handleOptionMouseOut=function(e,t){this.setState({hovered:null})},t.prototype.handleOptionTouchEnd=function(e,t){this.handleOptionClick(e,t)},t.prototype.handleOptionClick=function(e,t){var n=this.state.options[t],o=this.templateInputValue(n);this.props.onConfirm(n),this.setState({focused:-1,menuOpen:!1,query:o,selected:-1})},t.prototype.handleOptionMouseDown=function(e){e.preventDefault()},t.prototype.handleUpArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,o=t.selected;-1!==o&&n&&this.handleOptionFocus(o-1)},t.prototype.handleDownArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,o=t.options,r=t.selected;r!==o.length-1&&n&&this.handleOptionFocus(r+1)},t.prototype.handleEnter=function(e){if(this.state.menuOpen){e.preventDefault();this.state.selected>=0&&this.handleOptionClick(e,this.state.selected)}},t.prototype.handlePrintableKey=function(e){var t=this.elementRefs[-1];e.target===t||this.handleInputFocus()},t.prototype.handleKeyDown=function(e){switch(f[e.keyCode]){case\"up\":this.handleUpArrow(e);break;case\"down\":this.handleDownArrow(e);break;case\"enter\":this.handleEnter(e);break;case\"escape\":this.handleComponentBlur({query:this.state.query});break;default:u(e.keyCode)&&this.handlePrintableKey(e)}},t.prototype.render=function(){var e=this,t=this.props,n=t.cssNamespace,o=t.displayMenu,r=t.id,i=t.minLength,l=t.name,u=this.state,a=u.focused,s=u.hovered,c=u.menuOpen,f=u.options,m=u.query,v=u.selected,y=this.hasAutoselect(),b=-1===a,g=0===f.length,_=0!==m.length,O=m.length>=i,w=this.props.showNoOptionsFound&&b&&g&&_&&O,x=function(t){var o=t.children;return(0,p.h)(\"div\",{className:n+\"__wrapper\",onKeyDown:e.handleKeyDown},o)},C=function(){var t=e.templateInputValue(f[v]),o=t&&0===t.toLowerCase().indexOf(m.toLowerCase()),r=o&&y?m+t.substr(m.length):\"\";return r?(0,p.h)(\"input\",{className:n+\"__hint\",readonly:!0,tabindex:\"-1\",value:r}):null},N=function(){var t=n+\"__input\",o=null!==a,i=o?\" \"+t+\"--focused\":\"\",u=\"\"+t+i;return(0,p.h)(\"input\",{\"aria-activedescendant\":-1!==a&&null!==a&&r+\"__option--\"+a,\"aria-expanded\":c,\"aria-owns\":r+\"__listbox\",autocomplete:\"off\",className:u,id:r,name:l,onBlur:e.handleInputBlur,onFocus:e.handleInputFocus,onInput:e.handleInputChange,placeholder:e.props.placeholder,role:\"combobox\",type:\"text\",value:m})},E=function(e){var t=e.children,i=n+\"__menu\",l=i+\"--\"+(c||w?\"visible\":\"hidden\"),u=i+\" \"+i+\"--\"+o+\" \"+l;return(0,p.h)(\"ul\",{className:u,id:r+\"__listbox\",role:\"listbox\"},t)},S=function(){return(0,p.h)(\"li\",{className:n+\"__option \"+n+\"__option--no-results\"},\"No results found\")},I=function(t){var o=t.dangerouslySetInnerHTML,i=t.idx,l=n+\"__option\",u=-1===a?v===i:a===i,c=u&&null===s?\" \"+l+\"--focused\":\"\",d=i%2?\" \"+l+\"--odd\":\"\",f=\"\"+l+c+d;return(0,p.h)(\"li\",{\"aria-selected\":a===i,className:f,dangerouslySetInnerHTML:o,id:r+\"__option--\"+i,onClick:function(t){return e.handleOptionClick(t,i)},onFocusOut:function(t){return e.handleOptionFocusOut(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},onMouseOut:function(t){return e.handleOptionMouseOut(t,i)},onTouchEnd:function(t){return e.handleOptionTouchEnd(t,i)},role:\"option\",tabindex:\"-1\"})};return(0,p.h)(x,null,(0,p.h)(d.default,{length:f.length,queryLength:m.length,minQueryLength:i,selectedOption:this.templateInputValue(f[v])}),h&&(0,p.h)(C,null),(0,p.h)(N,{ref:function(t){e.elementRefs[-1]=t}}),(0,p.h)(E,null,f.map(function(t,n){return(0,p.h)(I,{dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)},idx:n,ref:function(t){e.elementRefs[n]=t}})}),w&&(0,p.h)(S,null)))},t}(p.Component),a.defaultProps={autoselect:!1,cssNamespace:\"autocomplete\",defaultValue:\"\",displayMenu:\"inline\",id:\"autocomplete\",minLength:0,name:\"input-autocomplete\",placeholder:\"\",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0},s);t.default=m},function(e,t,n){\"use strict\";function o(e,t){if(!(e instanceof t))return;(\"Cannot call a class as a function\")}function r(e,t){if(!e)return;(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function i(e,t){if(\"function\"!=typeof t&&null!==t)return;(\"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)}t.__esModule=!0,t.default=void 0;var l=n(0),u=function(e){function t(){var n,i,l;o(this,t);for(var u=arguments.length,a=Array(u),s=0;s2;)D.push(arguments[l]);for(n&&null!=n.children&&(D.length||D.push(n.children),delete n.children);D.length;)if((r=D.pop())&&void 0!==r.pop)for(l=r.length;l--;)D.push(r[l]);else!0!==r&&!1!==r||(r=null),(i=\"function\"!=typeof e)&&(null==r?r=\"\":\"number\"==typeof r?r=String(r):\"string\"!=typeof r&&(i=!1)),i&&o?u[u.length-1]+=r:u===L?u=[r]:u.push(r),o=i;var s=new t;return s.nodeName=e,s.children=u,s.attributes=null==n?void 0:n,s.key=null==n?void 0:n.key,void 0!==T.vnode&&T.vnode(s),s}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e,t){return n(e.nodeName,o(o({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}function i(e){!e.__d&&(e.__d=!0)&&1==U.push(e)&&(T.debounceRendering||setTimeout)(l)}function l(){var e,t=U;for(U=[];e=t.pop();)e.__d&&N(e)}function u(e,t,n){return\"string\"==typeof t||\"number\"==typeof t?void 0!==e.splitText:\"string\"==typeof t.nodeName?!e._componentConstructor&&s(e,t.nodeName):n||e._componentConstructor===t.nodeName}function s(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function p(e,t){var n=t?document.createElementNS(\"http://www.w3.org/2000/svg\",e):document.createElement(e);return n.__n=e,n}function c(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t,n,o,r){if(\"className\"===t&&(t=\"class\"),\"key\"===t);else if(\"ref\"===t)n&&n(null),o&&o(e);else if(\"class\"!==t||r)if(\"style\"===t){if(o&&\"string\"!=typeof o&&\"string\"!=typeof n||(e.style.cssText=o||\"\"),o&&\"object\"==typeof o){if(\"string\"!=typeof n)for(var i in n)i in o||(e.style[i]=\"\");for(var i in o)e.style[i]=\"number\"==typeof o[i]&&!1===A.test(i)?o[i]+\"px\":o[i]}}else if(\"dangerouslySetInnerHTML\"===t)o&&(e.innerHTML=o.__html||\"\");else if(\"o\"==t[0]&&\"n\"==t[1]){var l=t!==(t=t.replace(/Capture$/,\"\"));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,f,l):e.removeEventListener(t,f,l),(e.__l||(e.__l={}))[t]=o}else if(\"list\"!==t&&\"type\"!==t&&!r&&t in e)h(e,t,null==o?\"\":o),null!=o&&!1!==o||e.removeAttribute(t);else{var u=r&&t!==(t=t.replace(/^xlink\\:?/,\"\"));null==o||!1===o?u?e.removeAttributeNS(\"http://www.w3.org/1999/xlink\",t.toLowerCase()):e.removeAttribute(t):\"function\"!=typeof o&&(u?e.setAttributeNS(\"http://www.w3.org/1999/xlink\",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||\"\"}function h(e,t,n){try{e[t]=n}catch(e){}}function f(e){return this.__l[e.type](T.event&&T.event(e)||e)}function m(){for(var e;e=P.pop();)T.afterMount&&T.afterMount(e),e.componentDidMount&&e.componentDidMount()}function _(e,t,n,o,r,i){V++||(j=null!=r&&void 0!==r.ownerSVGElement,q=null!=e&&!(\"__preactattr_\"in e));var l=v(e,t,n,o,i);return r&&l.parentNode!==r&&r.appendChild(l),--V||(q=!1,i||m()),l}function v(e,t,n,o,r){var i=e,l=j;if(null==t&&(t=\"\"),\"string\"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),b(e,!0))),i.__preactattr_=!0,i;if(\"function\"==typeof t.nodeName)return M(e,t,n,o);if(j=\"svg\"===t.nodeName||\"foreignObject\"!==t.nodeName&&j,(!e||!s(e,String(t.nodeName)))&&(i=p(String(t.nodeName),j),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),b(e,!0)}var u=i.firstChild,a=i.__preactattr_||(i.__preactattr_={}),c=t.children;return!q&&c&&1===c.length&&\"string\"==typeof c[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=c[0]&&(u.nodeValue=c[0]):(c&&c.length||null!=u)&&y(i,c,n,o,q||null!=a.dangerouslySetInnerHTML),w(i,t.attributes,a),j=l,i}function y(e,t,n,o,r){var i,l,s,a,p=e.childNodes,d=[],h={},f=0,m=0,_=p.length,y=0,g=t?t.length:0;if(0!==_)for(var w=0;w<_;w++){var O=p[w],C=O.__preactattr_,x=g&&C?O._component?O._component.__k:C.key:null;null!=x?(f++,h[x]=O):(C||(void 0!==O.splitText?!r||O.nodeValue.trim():r))&&(d[y++]=O)}if(0!==g)for(var w=0;w=_?e.appendChild(a):a!==p[w]&&(a===p[w+1]?c(p[w]):e.insertBefore(a,p[w]||null)))}if(f)for(var w in h)void 0!==h[w]&&b(h[w],!1);for(;m<=y;)void 0!==(a=d[y--])&&b(a,!1)}function b(e,t){var n=e._component;n?I(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||c(e),g(e))}function g(e){for(e=e.lastChild;e;){var t=e.previousSibling;b(e,!0),e=t}}function w(e,t,n){var o;for(o in n)t&&null!=t[o]||null==n[o]||d(e,o,n[o],n[o]=void 0,j);for(o in t)\"children\"===o||\"innerHTML\"===o||o in n&&t[o]===(\"value\"===o||\"checked\"===o?e[o]:n[o])||d(e,o,n[o],n[o]=t[o],j)}function O(e){var t=e.constructor.name;(F[t]||(F[t]=[])).push(e)}function C(e,t,n){var o,r=F[e.name];if(e.prototype&&e.prototype.render?(o=new e(t,n),k.call(o,t,n)):(o=new k(t,n),o.constructor=e,o.render=x),r)for(var i=r.length;i--;)if(r[i].constructor===e){o.__b=r[i].__b,r.splice(i,1);break}return o}function x(e,t,n){return this.constructor(e,n)}function E(e,t,n,o,r){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||r?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===T.syncComponentUpdates&&e.base?i(e):N(e,1,r)),e.__r&&e.__r(e))}function N(e,t,n,r){if(!e.__x){var i,l,u,s=e.props,p=e.state,c=e.context,d=e.__p||s,h=e.__s||p,f=e.__c||c,v=e.base,y=e.__b,g=v||y,w=e._component,O=!1;if(v&&(e.props=d,e.state=h,e.context=f,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(s,p,c)?O=!0:e.componentWillUpdate&&e.componentWillUpdate(s,p,c),e.props=s,e.state=p,e.context=c),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!O){i=e.render(s,p,c),e.getChildContext&&(c=o(o({},c),e.getChildContext()));var x,M,k=i&&i.nodeName;if(\"function\"==typeof k){var S=a(i);l=w,l&&l.constructor===k&&S.key==l.__k?E(l,S,1,c,!1):(x=l,e._component=l=C(k,S,c),l.__b=l.__b||y,l.__u=e,E(l,S,0,c,!1),N(l,1,n,!0)),M=l.base}else u=g,x=w,x&&(u=e._component=null),(g||1===t)&&(u&&(u._component=null),M=_(u,i,c,n||!v,g&&g.parentNode,!0));if(g&&M!==g&&l!==w){var D=g.parentNode;D&&M!==D&&(D.replaceChild(M,g),x||(g._component=null,b(g,!1)))}if(x&&I(x),e.base=M,M&&!r){for(var L=e,A=e;A=A.__u;)(L=A).base=M;M._component=L,M._componentConstructor=L.constructor}}if(!v||n?P.unshift(e):O||(m(),e.componentDidUpdate&&e.componentDidUpdate(d,h,f),T.afterUpdate&&T.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);V||r||m()}}function M(e,t,n,o){for(var r=e&&e._component,i=r,l=e,u=r&&e._componentConstructor===t.nodeName,s=u,p=a(t);r&&!s&&(r=r.__u);)s=r.constructor===t.nodeName;return r&&s&&(!o||r._component)?(E(r,p,3,n,o),e=r.base):(i&&!u&&(I(i),e=l=null),r=C(t.nodeName,p,n),e&&!r.__b&&(r.__b=e,l=null),E(r,p,1,n,o),e=r.base,l&&e!==l&&(l._component=null,b(l,!1))),e}function I(e){T.beforeUnmount&&T.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?I(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,c(t),O(e),g(t)),e.__r&&e.__r(null)}function k(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}function S(e,t,n){return _(n,e,{},!1,t,!1)}var T={},D=[],L=[],A=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,U=[],P=[],V=0,j=!1,q=!1,F={};o(k.prototype,{setState:function(e,t){var n=this.state;this.__s||(this.__s=o({},n)),o(n,\"function\"==typeof e?e(n,this.props):e),t&&(this.__h=this.__h||[]).push(t),i(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),N(this,2)},render:function(){}});var R={h:n,createElement:n,cloneElement:r,Component:k,render:S,rerender:l,options:T};e.exports=R}()},function(e,t,n){\"use strict\";function o(e){if(!e.element)throw new Error(\"element is not defined\");if(!e.id)throw new Error(\"id is not defined\");if(!e.source)throw new Error(\"source is not defined\");(0,i.render)((0,i.h)(u.default,e),e.element)}var r=Object.assign||function(e){for(var t=1;t47&&e<58||32===e||8===e||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223}t.__esModule=!0,t.default=void 0;var s,a,p=n(0),c=n(3),d=function(e){return e&&e.__esModule?e:{default:e}}(c),h={13:\"enter\",27:\"escape\",38:\"up\",40:\"down\"},f=function(){var e=document.createElement(\"x\");return e.style.cssText=\"pointer-events:auto\",\"auto\"===e.style.pointerEvents}(),m=(a=s=function(e){function t(n){o(this,t);var i=r(this,e.call(this,n));return i.elementRefs={},i.state={focused:null,hovered:null,menuOpen:!1,options:n.defaultValue?[n.defaultValue]:[],query:n.defaultValue,selected:null},i.handleComponentBlur=i.handleComponentBlur.bind(i),i.handleKeyDown=i.handleKeyDown.bind(i),i.handleUpArrow=i.handleUpArrow.bind(i),i.handleDownArrow=i.handleDownArrow.bind(i),i.handleEnter=i.handleEnter.bind(i),i.handlePrintableKey=i.handlePrintableKey.bind(i),i.handleOptionClick=i.handleOptionClick.bind(i),i.handleOptionFocusOut=i.handleOptionFocusOut.bind(i),i.handleOptionFocus=i.handleOptionFocus.bind(i),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(i),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(i),i.handleOptionMouseOut=i.handleOptionMouseOut.bind(i),i.handleOptionTouchEnd=i.handleOptionTouchEnd.bind(i),i.handleInputBlur=i.handleInputBlur.bind(i),i.handleInputChange=i.handleInputChange.bind(i),i.handleInputFocus=i.handleInputFocus.bind(i),i.pollInputElement=i.pollInputElement.bind(i),i.getDirectInputChanges=i.getDirectInputChanges.bind(i),i}return i(t,e),t.prototype.componentDidMount=function(){this.pollInputElement()},t.prototype.componentWillUnmount=function(){clearTimeout(this.$pollInput)},t.prototype.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout(function(){e.pollInputElement()},100)},t.prototype.getDirectInputChanges=function(){var e=this.elementRefs[-1];e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})},t.prototype.componentDidUpdate=function(e,t){var n=this.state.focused,o=null===n,r=t.focused!==n;r&&!o&&this.elementRefs[n].focus();var i=-1===n,l=r&&null===t.focused;if(i&&l){var u=this.elementRefs[n];u.setSelectionRange(0,u.value.length)}},t.prototype.hasAutoselect=function(){return!l()&&this.props.autoselect},t.prototype.templateInputValue=function(e){var t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e},t.prototype.templateSuggestion=function(e){var t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e},t.prototype.handleComponentBlur=function(e){var t=this.state,n=t.options,o=t.query,r=t.selected,i=void 0;this.props.confirmOnBlur?(i=e.query||o,this.props.onConfirm(n[r])):i=o,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:i,selected:null})},t.prototype.handleOptionFocusOut=function(e,t){var n=this.state,o=n.focused,r=n.menuOpen,i=n.options,u=n.selected,s=null===e.relatedTarget,a=e.relatedTarget===this.elementRefs[-1],p=o!==t&&-1!==o;if(s||!(p||a)){var c=r&&l();this.handleComponentBlur({menuOpen:c,query:this.templateInputValue(i[u])})}},t.prototype.handleInputBlur=function(e){var t=this.state,n=t.focused,o=t.menuOpen,r=t.options,i=t.query,u=t.selected;if(-1===n){var s=o&&l(),a=l()?i:this.templateInputValue(r[u]);this.handleComponentBlur({menuOpen:s,query:a})}},t.prototype.handleInputChange=function(e){var t=this,n=this.props,o=n.minLength,r=n.source,i=this.hasAutoselect(),l=e.target.value,u=0===l.length,s=this.state.query.length!==l.length,a=l.length>=o;this.setState({query:l}),!u&&s&&a?r(l,function(e){var n=e.length>0;t.setState({menuOpen:n,options:e,selected:i&&n?0:-1})}):!u&&a||this.setState({menuOpen:!1,options:[]})},t.prototype.handleInputFocus=function(e){this.setState({focused:-1})},t.prototype.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e})},t.prototype.handleOptionMouseEnter=function(e,t){this.setState({hovered:t})},t.prototype.handleOptionMouseOut=function(e,t){this.setState({hovered:null})},t.prototype.handleOptionTouchEnd=function(e,t){this.handleOptionClick(e,t)},t.prototype.handleOptionClick=function(e,t){var n=this.state.options[t],o=this.templateInputValue(n);this.props.onConfirm(n),this.setState({focused:-1,menuOpen:!1,query:o,selected:-1})},t.prototype.handleOptionMouseDown=function(e){e.preventDefault()},t.prototype.handleUpArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,o=t.selected;-1!==o&&n&&this.handleOptionFocus(o-1)},t.prototype.handleDownArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,o=t.options,r=t.selected;r!==o.length-1&&n&&this.handleOptionFocus(r+1)},t.prototype.handleEnter=function(e){if(this.state.menuOpen){e.preventDefault();this.state.selected>=0&&this.handleOptionClick(e,this.state.selected)}},t.prototype.handlePrintableKey=function(e){var t=this.elementRefs[-1];e.target===t||this.handleInputFocus()},t.prototype.handleKeyDown=function(e){switch(h[e.keyCode]){case\"up\":this.handleUpArrow(e);break;case\"down\":this.handleDownArrow(e);break;case\"enter\":this.handleEnter(e);break;case\"escape\":this.handleComponentBlur({query:this.state.query});break;default:u(e.keyCode)&&this.handlePrintableKey(e)}},t.prototype.render=function(){var e=this,t=this.props,n=t.cssNamespace,o=t.displayMenu,r=t.id,i=t.minLength,l=t.name,u=t.placeholder,s=this.state,a=s.focused,c=s.hovered,h=s.menuOpen,m=s.options,_=s.query,v=s.selected,y=this.hasAutoselect(),b=-1===a,g=0===m.length,w=0!==_.length,O=_.length>=i,C=this.props.showNoOptionsFound&&b&&g&&w&&O,x=n+\"__wrapper\",E=n+\"__input\",N=null!==a,M=N?\" \"+E+\"--focused\":\"\",I=-1!==a&&null!==a,k=n+\"__menu\",S=k+\"--\"+o,T=h||C,D=k+\"--\"+(T?\"visible\":\"hidden\"),L=n+\"__option\",A=n+\"__hint\",U=this.templateInputValue(m[v]),P=U&&0===U.toLowerCase().indexOf(_.toLowerCase()),V=P&&y?_+U.substr(_.length):\"\",j=f&&V;return(0,p.h)(\"div\",{className:x,onKeyDown:this.handleKeyDown},(0,p.h)(d.default,{length:m.length,queryLength:_.length,minQueryLength:i,selectedOption:this.templateInputValue(m[v])}),j&&(0,p.h)(\"span\",null,(0,p.h)(\"input\",{className:A,readonly:!0,tabindex:\"-1\",value:V})),(0,p.h)(\"input\",{\"aria-activedescendant\":!!I&&r+\"__option--\"+a,\"aria-expanded\":h,\"aria-owns\":r+\"__listbox\",autocomplete:\"off\",className:\"\"+E+M,id:r,onBlur:this.handleInputBlur,onFocus:this.handleInputFocus,onInput:this.handleInputChange,name:l,placeholder:u,ref:function(t){e.elementRefs[-1]=t},role:\"combobox\",type:\"text\",value:_}),(0,p.h)(\"ul\",{className:k+\" \"+S+\" \"+D,id:r+\"__listbox\",role:\"listbox\"},m.map(function(t,n){var o=-1===a?v===n:a===n,i=o&&null===c?\" \"+L+\"--focused\":\"\",l=n%2?\" \"+L+\"--odd\":\"\";return(0,p.h)(\"li\",{\"aria-selected\":a===n,className:\"\"+L+i+l,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)},id:r+\"__option--\"+n,onClick:function(t){return e.handleOptionClick(t,n)},onFocusOut:function(t){return e.handleOptionFocusOut(t,n)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,n)},onMouseOut:function(t){return e.handleOptionMouseOut(t,n)},onTouchEnd:function(t){return e.handleOptionTouchEnd(t,n)},ref:function(t){e.elementRefs[n]=t},role:\"option\",tabindex:\"-1\"})}),C&&(0,p.h)(\"li\",{className:L+\" \"+L+\"--no-results\"},\"No results found\")))},t}(p.Component),s.defaultProps={autoselect:!1,cssNamespace:\"autocomplete\",defaultValue:\"\",displayMenu:\"inline\",id:\"autocomplete\",minLength:0,name:\"input-autocomplete\",placeholder:\"\",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0},a);t.default=m},function(e,t,n){\"use strict\";function o(e,t){if(!(e instanceof t))return;(\"Cannot call a class as a function\")}function r(e,t){if(!e)return;(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function i(e,t){if(\"function\"!=typeof t&&null!==t)return;(\"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)}t.__esModule=!0,t.default=void 0;var l=n(0),u=function(e){function t(){var n,i,l;o(this,t);for(var u=arguments.length,s=Array(u),a=0;a