downshift
Advanced tools
Comparing version 7.3.2 to 7.3.3
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React)}(this,(function(e,t){"use strict";function n(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}function o(){return o=Object.assign?Object.assign.bind():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},o.apply(this,arguments)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}var u={exports:{}},s={},l="function"==typeof Symbol&&Symbol.for,a=l?Symbol.for("react.element"):60103,c=l?Symbol.for("react.portal"):60106,d=l?Symbol.for("react.fragment"):60107,p=l?Symbol.for("react.strict_mode"):60108,f=l?Symbol.for("react.profiler"):60114,g=l?Symbol.for("react.provider"):60109,h=l?Symbol.for("react.context"):60110,m=l?Symbol.for("react.async_mode"):60111,I=l?Symbol.for("react.concurrent_mode"):60111,v=l?Symbol.for("react.forward_ref"):60112,y=l?Symbol.for("react.suspense"):60113,x=l?Symbol.for("react.suspense_list"):60120,b=l?Symbol.for("react.memo"):60115,w=l?Symbol.for("react.lazy"):60116,S=l?Symbol.for("react.block"):60121,C=l?Symbol.for("react.fundamental"):60117,k=l?Symbol.for("react.responder"):60118,O=l?Symbol.for("react.scope"):60119;function M(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case m:case I:case d:case f:case p:case y:return e;default:switch(e=e&&e.$$typeof){case h:case v:case w:case b:case g:return e;default:return t}}case c:return t}}}function E(e){return M(e)===I}s.AsyncMode=m,s.ConcurrentMode=I,s.ContextConsumer=h,s.ContextProvider=g,s.Element=a,s.ForwardRef=v,s.Fragment=d,s.Lazy=w,s.Memo=b,s.Portal=c,s.Profiler=f,s.StrictMode=p,s.Suspense=y,s.isAsyncMode=function(e){return E(e)||M(e)===m},s.isConcurrentMode=E,s.isContextConsumer=function(e){return M(e)===h},s.isContextProvider=function(e){return M(e)===g},s.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},s.isForwardRef=function(e){return M(e)===v},s.isFragment=function(e){return M(e)===d},s.isLazy=function(e){return M(e)===w},s.isMemo=function(e){return M(e)===b},s.isPortal=function(e){return M(e)===c},s.isProfiler=function(e){return M(e)===f},s.isStrictMode=function(e){return M(e)===p},s.isSuspense=function(e){return M(e)===y},s.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===d||e===I||e===f||e===p||e===y||e===x||"object"==typeof e&&null!==e&&(e.$$typeof===w||e.$$typeof===b||e.$$typeof===g||e.$$typeof===h||e.$$typeof===v||e.$$typeof===C||e.$$typeof===k||e.$$typeof===O||e.$$typeof===S)},s.typeOf=M;var D="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function P(){}function K(){}K.resetWarningCache=P;u.exports=function(){function e(e,t,n,o,i,r){if(r!==D){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:K,resetWarningCache:P};return n.PropTypes=n,n}();var T=u.exports,R={},H=60103,F=60106,V=60107,A=60108,N=60114,B=60109,L=60110,_=60112,$=60113,j=60120,U=60115,W=60116,z=60121,q=60122,Y=60117,X=60129,G=60131;if("function"==typeof Symbol&&Symbol.for){var J=Symbol.for;H=J("react.element"),F=J("react.portal"),V=J("react.fragment"),A=J("react.strict_mode"),N=J("react.profiler"),B=J("react.provider"),L=J("react.context"),_=J("react.forward_ref"),$=J("react.suspense"),j=J("react.suspense_list"),U=J("react.memo"),W=J("react.lazy"),z=J("react.block"),q=J("react.server.block"),Y=J("react.fundamental"),X=J("react.debug_trace_mode"),G=J("react.legacy_hidden")}function Q(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case H:switch(e=e.type){case V:case N:case A:case $:case j:return e;default:switch(e=e&&e.$$typeof){case L:case _:case W:case U:case B:return e;default:return t}}case F:return t}}}var Z=B,ee=H,te=_,ne=V,oe=W,ie=U,re=F,ue=N,se=A,le=$;R.ContextConsumer=L,R.ContextProvider=Z,R.Element=ee,R.ForwardRef=te,R.Fragment=ne,R.Lazy=oe,R.Memo=ie,R.Portal=re,R.Profiler=ue,R.StrictMode=se,R.Suspense=le,R.isAsyncMode=function(){return!1},R.isConcurrentMode=function(){return!1},R.isContextConsumer=function(e){return Q(e)===L},R.isContextProvider=function(e){return Q(e)===B},R.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===H},R.isForwardRef=function(e){return Q(e)===_},R.isFragment=function(e){return Q(e)===V},R.isLazy=function(e){return Q(e)===W},R.isMemo=function(e){return Q(e)===U},R.isPortal=function(e){return Q(e)===F},R.isProfiler=function(e){return Q(e)===N},R.isStrictMode=function(e){return Q(e)===A},R.isSuspense=function(e){return Q(e)===$},R.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===V||e===N||e===X||e===A||e===$||e===j||e===G||"object"==typeof e&&null!==e&&(e.$$typeof===W||e.$$typeof===U||e.$$typeof===B||e.$$typeof===L||e.$$typeof===_||e.$$typeof===Y||e.$$typeof===z||e[0]===q)},R.typeOf=Q;let ae=e=>"object"==typeof e&&null!=e&&1===e.nodeType,ce=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,de=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return ce(n.overflowY,t)||ce(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},pe=(e,t,n,o,i,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-o:u>t&&s<n||r<e&&s>n?u-t+i:0,fe=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var ge=(e,t)=>{var n,o,i,r,u,s;if("undefined"==typeof document)return[];let{scrollMode:l,block:a,inline:c,boundary:d,skipOverflowHiddenElements:p}=t,f="function"==typeof d?d:e=>e!==d;if(!ae(e))throw new TypeError("Invalid target");let g=document.scrollingElement||document.documentElement,h=[],m=e;for(;ae(m)&&f(m);){if(m=fe(m),m===g){h.push(m);break}null!=m&&m===document.body&&de(m)&&!de(document.documentElement)||null!=m&&de(m,p)&&h.push(m)}let I=null!=(o=null==(n=window.visualViewport)?void 0:n.width)?o:innerWidth,v=null!=(r=null==(i=window.visualViewport)?void 0:i.height)?r:innerHeight,y=null!=(u=window.scrollX)?u:pageXOffset,x=null!=(s=window.scrollY)?s:pageYOffset,{height:b,width:w,top:S,right:C,bottom:k,left:O}=e.getBoundingClientRect(),M="start"===a||"nearest"===a?S:"end"===a?k:S+b/2,E="center"===c?O+w/2:"end"===c?C:O,D=[];for(let e=0;e<h.length;e++){let t=h[e],{height:n,width:o,top:i,right:r,bottom:u,left:s}=t.getBoundingClientRect();if("if-needed"===l&&S>=0&&O>=0&&k<=v&&C<=I&&S>=i&&k<=u&&O>=s&&C<=r)return D;let d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),f=parseInt(d.borderTopWidth,10),m=parseInt(d.borderRightWidth,10),P=parseInt(d.borderBottomWidth,10),K=0,T=0,R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-m:0,H="offsetHeight"in t?t.offsetHeight-t.clientHeight-f-P:0,F="offsetWidth"in t?0===t.offsetWidth?0:o/t.offsetWidth:0,V="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(g===t)K="start"===a?M:"end"===a?M-v:"nearest"===a?pe(x,x+v,v,f,P,x+M,x+M+b,b):M-v/2,T="start"===c?E:"center"===c?E-I/2:"end"===c?E-I:pe(y,y+I,I,p,m,y+E,y+E+w,w),K=Math.max(0,K+x),T=Math.max(0,T+y);else{K="start"===a?M-i-f:"end"===a?M-u+P+H:"nearest"===a?pe(i,u,n,f,P+H,M,M+b,b):M-(i+n/2)+H/2,T="start"===c?E-s-p:"center"===c?E-(s+o/2)+R/2:"end"===c?E-r+m+R:pe(s,r,o,p,m+R,E,E+w,w);let{scrollLeft:e,scrollTop:l}=t;K=Math.max(0,Math.min(l+K/V,t.scrollHeight-n/V+H)),T=Math.max(0,Math.min(e+T/F,t.scrollWidth-o/F+R)),M+=l-K,E+=e-T}D.push({el:t,top:K,left:T})}return D},he=0;function me(e){return"function"==typeof e?e:Ie}function Ie(){}function ve(e,t){e&&ge(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,o=e.left;t.scrollTop=n,t.scrollLeft=o}))}function ye(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function xe(e,t){var n;function o(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,r=new Array(i),u=0;u<i;u++)r[u]=arguments[u];o(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return i.cancel=o,i}function be(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.some((function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function we(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function Se(){return String(he++)}function Ce(e){var t=e.isOpen,n=e.resultCount,o=e.previousResultCount;return t?n?n!==o?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function ke(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var Oe=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Me(e){void 0===e&&(e={});var t={};return Oe.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function Ee(e,t){return Object.keys(e).reduce((function(n,o){return n[o]=De(t,o)?t[o]:e[o],n}),{})}function De(e,t){return void 0!==e[t]}function Pe(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function Ke(e,t,n,o,i){if(void 0===i&&(i=!0),0===n)return-1;var r=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:r+1);var u=t+e;u<0?u=i?r:0:u>r&&(u=i?0:r);var s=Te(e,u,n,o,i);return-1===s?t>=n?-1:t:s}function Te(e,t,n,o,i){var r=o(t);if(!r||!r.hasAttribute("disabled"))return t;if(e>0){for(var u=t+1;u<n;u++)if(!o(u).hasAttribute("disabled"))return u}else for(var s=t-1;s>=0;s--)if(!o(s).hasAttribute("disabled"))return s;return i?e>0?Te(1,0,n,o,!1):Te(-1,n-1,n,o,!1):-1}function Re(e,t,n,o){return void 0===o&&(o=!0),t.some((function(t){return t&&(ye(t,e,n)||o&&ye(t,n.document.activeElement,n))}))}var He=xe((function(e){Ve(e).textContent=""}),500);function Fe(e,t){var n=Ve(t);e&&(n.textContent=e,He(t))}function Ve(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var Ae=0,Ne=2,Be=3,Le=4,_e=5,$e=6,je=7,Ue=8,We=9,ze=10,qe=11,Ye=12,Xe=13,Ge=14,Je=Object.freeze({__proto__:null,unknown:Ae,mouseUp:1,itemMouseEnter:Ne,keyDownArrowUp:Be,keyDownArrowDown:Le,keyDownEscape:_e,keyDownEnter:$e,keyDownHome:je,keyDownEnd:Ue,clickItem:We,blurInput:ze,changeInput:qe,keyDownSpaceButton:Ye,clickButton:Xe,blurButton:Ge,controlledPropUpdatedSelectedItem:15,touchEnd:16}),Qe=["refKey","ref"],Ze=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],et=["onKeyDown","onBlur","onChange","onInput","onChangeText"],tt=["refKey","ref"],nt=["onMouseMove","onMouseDown","onClick","onPress","index","item"],ot=function(){var e=function(e){var u,s;function l(t){var r=e.call(this,t)||this;r.id=r.props.id||"downshift-"+Se(),r.menuId=r.props.menuId||r.id+"-menu",r.labelId=r.props.labelId||r.id+"-label",r.inputId=r.props.inputId||r.id+"-input",r.getItemId=r.props.getItemId||function(e){return r.id+"-item-"+e},r.input=null,r.items=[],r.itemCount=null,r.previousResultCount=0,r.timeoutIds=[],r.internalSetTimeout=function(e,t){var n=setTimeout((function(){r.timeoutIds=r.timeoutIds.filter((function(e){return e!==n})),e()}),t);r.timeoutIds.push(n)},r.setItemCount=function(e){r.itemCount=e},r.unsetItemCount=function(){r.itemCount=null},r.setHighlightedIndex=function(e,t){void 0===e&&(e=r.props.defaultHighlightedIndex),void 0===t&&(t={}),t=Me(t),r.internalSetState(o({highlightedIndex:e},t))},r.clearSelection=function(e){r.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:r.props.defaultHighlightedIndex,isOpen:r.props.defaultIsOpen},e)},r.selectItem=function(e,t,n){t=Me(t),r.internalSetState(o({isOpen:r.props.defaultIsOpen,highlightedIndex:r.props.defaultHighlightedIndex,selectedItem:e,inputValue:r.props.itemToString(e)},t),n)},r.selectItemAtIndex=function(e,t,n){var o=r.items[e];null!=o&&r.selectItem(o,t,n)},r.selectHighlightedItem=function(e,t){return r.selectItemAtIndex(r.getState().highlightedIndex,e,t)},r.internalSetState=function(e,t){var n,i,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&r.props.onInputValueChange(e.inputValue,o({},r.getStateAndHelpers(),e)),r.setState((function(t){t=r.getState(t);var l=s?e(t):e;l=r.props.stateReducer(t,l),n=l.hasOwnProperty("selectedItem");var a={};return n&&l.selectedItem!==t.selectedItem&&(i=l.selectedItem),l.type=l.type||Ae,Object.keys(l).forEach((function(e){t[e]!==l[e]&&(u[e]=l[e]),"type"!==e&&(l[e],De(r.props,e)||(a[e]=l[e]))})),s&&l.hasOwnProperty("inputValue")&&r.props.onInputValueChange(l.inputValue,o({},r.getStateAndHelpers(),l)),a}),(function(){me(t)(),Object.keys(u).length>1&&r.props.onStateChange(u,r.getStateAndHelpers()),n&&r.props.onSelect(e.selectedItem,r.getStateAndHelpers()),void 0!==i&&r.props.onChange(i,r.getStateAndHelpers()),r.props.onUserAction(u,r.getStateAndHelpers())}))},r.rootRef=function(e){return r._rootNode=e},r.getRootProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=n(u,Qe),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;r.getRootProps.called=!0,r.getRootProps.refKey=l,r.getRootProps.suppressRefError=p;var f=r.getState().isOpen;return o(((i={})[l]=we(a,r.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?r.menuId:null,i["aria-labelledby"]=r.labelId,i),c)},r.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:Le})}else this.internalSetState({isOpen:!0,type:Le},(function(){var e=t.getItemCount();if(e>0){var n=Ke(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:Le})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:Be})}else this.internalSetState({isOpen:!0,type:Be},(function(){var e=t.getItemCount();if(e>0){var n=Ke(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:Be})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,o=t.highlightedIndex;if(n&&null!=o){e.preventDefault();var i=this.items[o],r=this.getItemNodeFromIndex(o);if(null==i||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:$e})}}},Escape:function(e){e.preventDefault(),this.reset(o({type:_e},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},r.buttonKeyDownHandlers=o({},r.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:Ye})}}),r.inputKeyDownHandlers=o({},r.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var o=this.getItemCount();if(!(o<=0)&&n){var i=Te(1,0,o,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(i,{type:je})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var o=this.getItemCount();if(!(o<=0)&&n){var i=Te(-1,o-1,o,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(i,{type:Ue})}}}}),r.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var u=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=n(t,Ze),c=r.getState().isOpen,d={onClick:be(i,r.buttonHandleClick),onKeyDown:be(u,r.buttonHandleKeyDown),onKeyUp:be(s,r.buttonHandleKeyUp),onBlur:be(l,r.buttonHandleBlur)};return o({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},r.buttonHandleKeyUp=function(e){e.preventDefault()},r.buttonHandleKeyDown=function(e){var t=Pe(e);r.buttonKeyDownHandlers[t]&&r.buttonKeyDownHandlers[t].call(i(r),e)},r.buttonHandleClick=function(e){e.preventDefault(),r.props.environment.document.activeElement===r.props.environment.document.body&&e.target.focus(),r.internalSetTimeout((function(){return r.toggleMenu({type:Xe})}))},r.buttonHandleBlur=function(e){var t=e.target;r.internalSetTimeout((function(){r.isMouseDown||null!=r.props.environment.document.activeElement&&r.props.environment.document.activeElement.id===r.inputId||r.props.environment.document.activeElement===t||r.reset({type:Ge})}))},r.getLabelProps=function(e){return o({htmlFor:r.inputId,id:r.labelId},e)},r.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=n(t,et),c={};var d,p=r.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;a.disabled||((d={}).onChange=be(s,l,r.inputHandleChange),d.onKeyDown=be(i,r.inputHandleKeyDown),d.onBlur=be(u,r.inputHandleBlur),c=d);return o({"aria-autocomplete":"list","aria-activedescendant":g&&"number"==typeof h&&h>=0?r.getItemId(h):null,"aria-controls":g?r.menuId:null,"aria-labelledby":r.labelId,autoComplete:"off",value:f,id:r.inputId},c,a)},r.inputHandleKeyDown=function(e){var t=Pe(e);t&&r.inputKeyDownHandlers[t]&&r.inputKeyDownHandlers[t].call(i(r),e)},r.inputHandleChange=function(e){r.internalSetState({type:qe,isOpen:!0,inputValue:e.target.value,highlightedIndex:r.props.defaultHighlightedIndex})},r.inputHandleBlur=function(){r.internalSetTimeout((function(){var e=r.props.environment.document&&!!r.props.environment.document.activeElement&&!!r.props.environment.document.activeElement.dataset&&r.props.environment.document.activeElement.dataset.toggle&&r._rootNode&&r._rootNode.contains(r.props.environment.document.activeElement);r.isMouseDown||e||r.reset({type:ze})}))},r.menuRef=function(e){r._menuNode=e},r.getMenuProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=n(u,tt),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return r.getMenuProps.called=!0,r.getMenuProps.refKey=l,r.getMenuProps.suppressRefError=p,o(((i={})[l]=we(a,r.menuRef),i.role="listbox",i["aria-labelledby"]=c&&c["aria-label"]?null:r.labelId,i.id=r.menuId,i),c)},r.getItemProps=function(e){var t,i=void 0===e?{}:e,u=i.onMouseMove,s=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,c=i.item,d=void 0===c?void 0:c,p=n(i,nt);void 0===a?(r.items.push(d),a=r.items.indexOf(d)):r.items[a]=d;var f=l,g=((t={onMouseMove:be(u,(function(){a!==r.getState().highlightedIndex&&(r.setHighlightedIndex(a,{type:Ne}),r.avoidScrolling=!0,r.internalSetTimeout((function(){return r.avoidScrolling=!1}),250))})),onMouseDown:be(s,(function(e){e.preventDefault()}))}).onClick=be(f,(function(){r.selectItemAtIndex(a,{type:We})})),t),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return o({id:r.getItemId(a),role:"option","aria-selected":r.getState().highlightedIndex===a},h,p)},r.clearItems=function(){r.items=[]},r.reset=function(e,t){void 0===e&&(e={}),e=Me(e),r.internalSetState((function(t){var n=t.selectedItem;return o({isOpen:r.props.defaultIsOpen,highlightedIndex:r.props.defaultHighlightedIndex,inputValue:r.props.itemToString(n)},e)}),t)},r.toggleMenu=function(e,t){void 0===e&&(e={}),e=Me(e),r.internalSetState((function(t){var n=t.isOpen;return o({isOpen:!n},n&&{highlightedIndex:r.props.defaultHighlightedIndex},e)}),(function(){var n=r.getState(),o=n.isOpen,i=n.highlightedIndex;o&&r.getItemCount()>0&&"number"==typeof i&&r.setHighlightedIndex(i,e),me(t)()}))},r.openMenu=function(e){r.internalSetState({isOpen:!0},e)},r.closeMenu=function(e){r.internalSetState({isOpen:!1},e)},r.updateStatus=xe((function(){var e=r.getState(),t=r.items[e.highlightedIndex],n=r.getItemCount(),i=r.props.getA11yStatusMessage(o({itemToString:r.props.itemToString,previousResultCount:r.previousResultCount,resultCount:n,highlightedItem:t},e));r.previousResultCount=n,Fe(i,r.props.environment.document)}),200);var u=r.props,s=u.defaultHighlightedIndex,l=u.initialHighlightedIndex,a=void 0===l?s:l,c=u.defaultIsOpen,d=u.initialIsOpen,p=void 0===d?c:d,f=u.initialInputValue,g=void 0===f?"":f,h=u.initialSelectedItem,m=void 0===h?null:h,I=r.getState({highlightedIndex:a,isOpen:p,inputValue:g,selectedItem:m});return null!=I.selectedItem&&void 0===r.props.initialInputValue&&(I.inputValue=r.props.itemToString(I.selectedItem)),r.state=I,r}s=e,(u=l).prototype=Object.create(s.prototype),u.prototype.constructor=u,r(u,s);var a=l.prototype;return a.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},a.getState=function(e){return void 0===e&&(e=this.state),Ee(e,this.props)},a.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},a.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},a.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},a.moveHighlightedIndex=function(e,t){var n=this,o=this.getItemCount(),i=this.getState().highlightedIndex;if(o>0){var r=Ke(e,i,o,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(r,t)}},a.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,i=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,g=this.closeMenu,h=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,x=this.clearSelection,b=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:c,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:g,toggleMenu:h,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:x,clearItems:b,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:i,selectedItem:o}},a.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!Re(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},o=function(){e.isTouchMove=!1},i=function(){e.isTouchMove=!0},r=function(t){var n=Re(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",o),u.addEventListener("touchmove",i),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",o),u.removeEventListener("touchmove",i),u.removeEventListener("touchend",r)}},a.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,o=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==o},a.componentDidUpdate=function(e,t){De(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},a.componentWillUnmount=function(){this.cleanup()},a.render=function(){var e=ke(this.props.children,Ie);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=ke(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props}(n))):void 0:null},l}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:Ce,itemToString:function(e){return null==e?"":String(e)},onStateChange:Ie,onInputValueChange:Ie,onUserAction:Ie,onChange:Ie,onSelect:Ie,onOuterClick:Ie,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:ve},e.stateChangeTypes=Je,e}(),it=ot,rt=["isInitialMount","highlightedIndex","items","environment"],ut={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function st(e,t,n){var i=e.props,r=e.type,u={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var r=t.props,u=t.type,s="on"+pt(e)+"Change";r[s]&&void 0!==i[e]&&i[e]!==n[e]&&r[s](o({type:u},i))}(i,e,t,n),n[i]!==t[i]&&(u[i]=n[i])})),i.onStateChange&&Object.keys(u).length&&i.onStateChange(o({type:r},u))}var lt=xe((function(e,t){Fe(e(),t)}),200),at="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function ct(e){var n=e.id,o=void 0===n?"downshift-"+Se():n,i=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:i||o+"-label",menuId:r||o+"-menu",getItemId:u||function(e){return o+"-item-"+e},toggleButtonId:s||o+"-toggle-button",inputId:l||o+"-input"}).current}function dt(e,t,n){return void 0!==e?e:0===n.length?-1:n.indexOf(t)}function pt(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function ft(e){var n=t.useRef(e);return n.current=e,n}function gt(e,n,i){var r=t.useRef(),u=t.useRef(),s=t.useCallback((function(t,n){u.current=n,t=Ee(t,n.props);var i=e(t,n);return n.props.stateReducer(t,o({},n,{changes:i}))}),[e]),l=t.useReducer(s,n),a=l[0],c=l[1],d=ft(i),p=t.useCallback((function(e){return c(o({props:d.current},e))}),[d]),f=u.current;return t.useEffect((function(){f&&r.current&&r.current!==a&&st(f,Ee(r.current,f.props),a),r.current=a}),[a,i,f]),[a,p]}function ht(e,t,n){var o=gt(e,t,n),i=o[0],r=o[1];return[Ee(i,n),r]}var mt={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:ve,environment:"undefined"==typeof window?{}:window};function It(e,t,n){void 0===n&&(n=ut);var o=e["default"+pt(t)];return void 0!==o?o:n[t]}function vt(e,t,n){void 0===n&&(n=ut);var o=e[t];if(void 0!==o)return o;var i=e["initial"+pt(t)];return void 0!==i?i:It(e,t,n)}function yt(e){var t=vt(e,"selectedItem"),n=vt(e,"isOpen"),o=vt(e,"highlightedIndex"),i=vt(e,"inputValue");return{highlightedIndex:o<0&&t&&n?e.items.indexOf(t):o,isOpen:n,selectedItem:t,inputValue:i}}function xt(e,t,n){var o=e.items,i=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===o.length?-1:void 0!==i&&s===i?i:void 0!==r?r:u?o.indexOf(u):0===n?-1:n<0?o.length-1:0}function bt(e,n,o,i){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(null!=(null==o?void 0:o.addEventListener)){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!Re(t.target,n.map((function(e){return e.current})),o)&&i()},s=function(){r.current.isTouchMove=!1},l=function(){r.current.isTouchMove=!0},a=function(t){!e||r.current.isTouchMove||Re(t.target,n.map((function(e){return e.current})),o,!1)||i()};return o.addEventListener("mousedown",t),o.addEventListener("mouseup",u),o.addEventListener("touchstart",s),o.addEventListener("touchmove",l),o.addEventListener("touchend",a),function(){o.removeEventListener("mousedown",t),o.removeEventListener("mouseup",u),o.removeEventListener("touchstart",s),o.removeEventListener("touchmove",l),o.removeEventListener("touchend",a)}}}),[e,o]),r}var wt=function(){return Ie};function St(e,i,r){var u=r.isInitialMount,s=r.highlightedIndex,l=r.items,a=r.environment,c=n(r,rt);t.useEffect((function(){u||lt((function(){return e(o({highlightedIndex:s,highlightedItem:l[s],resultCount:l.length},c))}),a.document)}),i)}function Ct(e){var n=e.highlightedIndex,o=e.isOpen,i=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return at((function(){n<0||!o||!Object.keys(i.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var kt=Ie;function Ot(e,t,n){var i,r=t.type,u=t.props;switch(r){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:xt(u,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:xt(u,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:It(u,"highlightedIndex"),isOpen:It(u,"isOpen"),selectedItem:It(u,"selectedItem"),inputValue:It(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return o({},e,i)}var Mt=function(){return Mt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Mt.apply(this,arguments)};T.array.isRequired,T.func,T.func,T.func,T.number,T.number,T.number,T.bool,T.bool,T.bool,T.any,T.any,T.any,T.string,T.string,T.string,T.func,T.string,T.func,T.func,T.func,T.func,T.func,T.shape({addEventListener:T.func,removeEventListener:T.func,document:T.shape({getElementById:T.func,activeElement:T.any,body:T.any})});var Et=Mt(Mt({},mt),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,o=e.previousResultCount;return t?n?n!==o?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}}),Dt=Ie,Pt=0,Kt=1,Tt=2,Rt=3,Ht=4,Ft=5,Vt=6,At=7,Nt=8,Bt=9,Lt=10,_t=11,$t=12,jt=13,Ut=14,Wt=15,zt=16,qt=17,Yt=18,Xt=19,Gt=20,Jt=21,Qt=Object.freeze({__proto__:null,ToggleButtonClick:Pt,ToggleButtonKeyDownArrowDown:Kt,ToggleButtonKeyDownArrowUp:Tt,ToggleButtonKeyDownCharacter:Rt,ToggleButtonKeyDownEscape:Ht,ToggleButtonKeyDownHome:Ft,ToggleButtonKeyDownEnd:Vt,ToggleButtonKeyDownEnter:At,ToggleButtonKeyDownSpaceButton:Nt,ToggleButtonKeyDownPageUp:Bt,ToggleButtonKeyDownPageDown:Lt,ToggleButtonBlur:_t,MenuMouseLeave:$t,ItemMouseMove:jt,ItemClick:Ut,FunctionToggleMenu:Wt,FunctionOpenMenu:zt,FunctionCloseMenu:qt,FunctionSetHighlightedIndex:Yt,FunctionSelectItem:Xt,FunctionSetInputValue:Gt,FunctionReset:Jt});function Zt(e,t){var n,i=t.type,r=t.props,u=t.altKey;switch(i){case Ut:n={isOpen:It(r,"isOpen"),highlightedIndex:It(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case Rt:var s=t.key,l=""+e.inputValue+s,a=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,o=e.items,i=e.itemToString,r=e.getItemNodeFromIndex,u=t.toLowerCase(),s=0;s<o.length;s++){var l=(s+n+(t.length<2?1:0))%o.length,a=o[l];if(void 0!==a&&i(a).toLowerCase().startsWith(u)){var c=r(l);if(!(null==c?void 0:c.hasAttribute("disabled")))return l}}return n}({keysSoFar:l,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});n={inputValue:l,highlightedIndex:a,isOpen:!0};break;case Kt:n={highlightedIndex:e.isOpen?Ke(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):u&&null==e.selectedItem?-1:xt(r,e,1),isOpen:!0};break;case Tt:if(e.isOpen&&u)n=o({isOpen:It(r,"isOpen"),highlightedIndex:It(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex]});else n={highlightedIndex:e.isOpen?Ke(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):xt(r,e,-1),isOpen:!0};break;case At:case Nt:n=o({isOpen:It(r,"isOpen"),highlightedIndex:It(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex]});break;case Ft:n={highlightedIndex:Te(1,0,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case Vt:n={highlightedIndex:Te(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case Bt:n={highlightedIndex:Ke(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Lt:n={highlightedIndex:Ke(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Ht:n={isOpen:!1,highlightedIndex:-1};break;case _t:n=o({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex]});break;case Xt:n={selectedItem:t.selectedItem};break;default:return Ot(e,t,Qt)}return o({},e,n)}var en=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],tn=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],nn=["item","index","onMouseMove","onClick","onPress","refKey","ref","disabled"];function on(e){void 0===e&&(e={}),Dt();var i=o({},Et,e),r=i.items,u=i.scrollIntoView,s=i.environment,l=i.itemToString,a=i.getA11ySelectionMessage,c=i.getA11yStatusMessage,d=ht(Zt,yt(i),i),p=d[0],f=d[1],g=p.isOpen,h=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef(null),x=t.useRef({}),b=t.useRef(null),w=ct(i),S=t.useRef(),C=t.useRef(!0),k=ft({state:p,props:i}),O=t.useCallback((function(e){return x.current[w.getItemId(e)]}),[w]);St(c,[g,h,I,r],o({isInitialMount:C.current,previousResultCount:S.current,items:r,environment:s,itemToString:l},p)),St(a,[m],o({isInitialMount:C.current,previousResultCount:S.current,items:r,environment:s,itemToString:l},p));var M=Ct({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:x,scrollIntoView:u,getItemNodeFromIndex:O});t.useEffect((function(){return b.current=xe((function(e){e({type:Gt,inputValue:""})}),500),function(){b.current.cancel()}}),[]),t.useEffect((function(){I&&b.current(f)}),[f,I]),kt({isInitialMount:C.current,props:i,state:p}),t.useEffect((function(){C.current||(S.current=r.length)}));var E=bt(g,[y,v],s,(function(){f({type:_t})})),D=wt();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){g||(x.current={})}),[g]);var P=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:Kt,getItemNodeFromIndex:O,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Tt,getItemNodeFromIndex:O,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:Ft,getItemNodeFromIndex:O})},End:function(e){e.preventDefault(),f({type:Vt,getItemNodeFromIndex:O})},Escape:function(){k.current.state.isOpen&&f({type:Ht})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?At:Pt})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Bt,getItemNodeFromIndex:O}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Lt,getItemNodeFromIndex:O}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:Rt,key:" ",getItemNodeFromIndex:O}):f({type:Nt}):f({type:Pt})}}}),[f,O,k]),K=t.useCallback((function(){f({type:Wt})}),[f]),T=t.useCallback((function(){f({type:qt})}),[f]),R=t.useCallback((function(){f({type:zt})}),[f]),H=t.useCallback((function(e){f({type:Yt,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:Xt,selectedItem:e})}),[f]),V=t.useCallback((function(){f({type:Jt})}),[f]),A=t.useCallback((function(e){f({type:Gt,inputValue:e})}),[f]),N=t.useCallback((function(e){return o({id:w.labelId,htmlFor:w.toggleButtonId},e)}),[w]),B=t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.onMouseLeave,s=r.refKey,l=void 0===s?"ref":s;r.onKeyDown,r.onBlur;var a=r.ref,c=n(r,en),d=(void 0===t?{}:t).suppressRefError;return D("getMenuProps",void 0!==d&&d,l,y),o(((i={})[l]=we(a,(function(e){y.current=e})),i.id=w.menuId,i.role="listbox",i["aria-labelledby"]=w.labelId,i.tabIndex=-1,i.onMouseLeave=be(u,(function(){f({type:$t})})),i),c)}),[f,D,w]);return{getToggleButtonProps:t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.onBlur,s=r.onClick;r.onPress;var l=r.onKeyDown,a=r.refKey,c=void 0===a?"ref":a,d=r.ref,p=n(r,tn),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=k.current.state,I=o(((i={})[c]=we(d,(function(e){v.current=e})),i["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?w.getItemId(m.highlightedIndex):"",i["aria-controls"]=w.menuId,i["aria-expanded"]=k.current.state.isOpen,i["aria-haspopup"]="listbox",i["aria-labelledby"]=""+w.labelId,i.id=w.toggleButtonId,i.role="combobox",i.tabIndex=0,i.onBlur=be(u,(function(){m.isOpen&&!E.current.isMouseDown&&f({type:_t})})),i),p);return p.disabled||(I.onClick=be(s,(function(){f({type:Pt})})),I.onKeyDown=be(l,(function(e){var t=Pe(e);t&&P[t]?P[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:Rt,key:t,getItemNodeFromIndex:O})}))),D("getToggleButtonProps",h,c,v),I}),[k,w,D,f,E,P,O]),getLabelProps:N,getMenuProps:B,getItemProps:t.useCallback((function(e){var t,i=void 0===e?{}:e,u=i.item,s=i.index,l=i.onMouseMove,a=i.onClick;i.onPress;var c=i.refKey,d=void 0===c?"ref":c,p=i.ref,g=i.disabled,h=n(i,nn),I=k.current,v=I.state,y=I.props,b=null!=u?u:r[s],S=dt(s,b,y.items),C=dt(S,b,y.items);if(C<0)throw new Error("Pass either item or item index in getItemProps!");var O=o(((t={disabled:g,role:"option","aria-selected":""+(b===m),id:w.getItemId(C)})[d]=we(p,(function(e){e&&(x.current[w.getItemId(C)]=e)})),t),h);return g||(O.onClick=be(a,(function(){f({type:Ut,index:S})}))),O.onMouseMove=be(l,(function(){S!==v.highlightedIndex&&(M.current=!1,f({type:jt,index:S,disabled:g}))})),O}),[k,r,m,w,M,f]),toggleMenu:K,openMenu:R,closeMenu:T,setHighlightedIndex:H,selectItem:F,reset:V,setInputValue:A,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}on.stateChangeTypes=Qt;var rn=0,un=1,sn=2,ln=3,an=4,cn=5,dn=6,pn=7,fn=8,gn=9,hn=10,mn=11,In=12,vn=13,yn=14,xn=15,bn=16,wn=17,Sn=18,Cn=19,kn=20,On=21,Mn=22,En=Object.freeze({__proto__:null,InputKeyDownArrowDown:rn,InputKeyDownArrowUp:un,InputKeyDownEscape:sn,InputKeyDownHome:ln,InputKeyDownEnd:an,InputKeyDownPageUp:cn,InputKeyDownPageDown:dn,InputKeyDownEnter:pn,InputChange:fn,InputBlur:gn,InputFocus:hn,MenuMouseLeave:mn,ItemMouseMove:In,ItemClick:vn,ToggleButtonClick:yn,FunctionToggleMenu:xn,FunctionOpenMenu:bn,FunctionCloseMenu:wn,FunctionSetHighlightedIndex:Sn,FunctionSelectItem:Cn,FunctionSetInputValue:kn,FunctionReset:On,ControlledPropUpdatedSelectedItem:Mn});T.array.isRequired,T.func,T.func,T.func,T.number,T.number,T.number,T.bool,T.bool,T.bool,T.any,T.any,T.any,T.string,T.string,T.string,T.string,T.string,T.string,T.func,T.string,T.string,T.func,T.func,T.func,T.func,T.func,T.func,T.shape({addEventListener:T.func,removeEventListener:T.func,document:T.shape({getElementById:T.func,activeElement:T.any,body:T.any})});var Dn=Ie,Pn=o({},mt,{getA11yStatusMessage:Ce});function Kn(e,t){var n,i=t.type,r=t.props,u=t.altKey;switch(i){case vn:n={isOpen:It(r,"isOpen"),highlightedIndex:It(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case rn:n=e.isOpen?{highlightedIndex:Ke(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:u&&null==e.selectedItem?-1:xt(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case un:n=e.isOpen?u?o({isOpen:It(r,"isOpen"),highlightedIndex:It(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])}):{highlightedIndex:Ke(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:xt(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case pn:n=o({isOpen:It(r,"isOpen"),highlightedIndex:It(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case sn:n=o({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case cn:n={highlightedIndex:Ke(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case dn:n={highlightedIndex:Ke(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case ln:n={highlightedIndex:Te(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case an:n={highlightedIndex:Te(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case gn:n=o({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case fn:n={isOpen:!0,highlightedIndex:It(r,"highlightedIndex"),inputValue:t.inputValue};break;case hn:n={isOpen:!0,highlightedIndex:xt(r,e,0)};break;case Cn:n={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Mn:n={inputValue:t.inputValue};break;default:return Ot(e,t,En)}return o({},e,n)}var Tn=["onMouseLeave","refKey","ref"],Rn=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],Hn=["onClick","onPress","refKey","ref"],Fn=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function Vn(e){void 0===e&&(e={}),Dn();var i=o({},Pn,e),r=i.initialIsOpen,u=i.defaultIsOpen,s=i.items,l=i.scrollIntoView,a=i.environment,c=i.getA11yStatusMessage,d=i.getA11ySelectionMessage,p=i.itemToString,f=function(e){var t=yt(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),o({},t,{inputValue:i})}(i),g=function(e,n,o){var i=t.useRef(),r=gt(e,n,o),u=r[0],s=r[1];return t.useEffect((function(){De(o,"selectedItem")&&(i.current!==o.selectedItem&&s({type:Mn,inputValue:o.itemToString(o.selectedItem)}),i.current=u.selectedItem===i.current?o.selectedItem:u.selectedItem)}),[o.selectedItem,u.selectedItem]),[Ee(u,o),s]}(Kn,f,i),h=g[0],m=g[1],I=h.isOpen,v=h.highlightedIndex,y=h.selectedItem,x=h.inputValue,b=t.useRef(null),w=t.useRef({}),S=t.useRef(null),C=t.useRef(null),k=t.useRef(!0),O=ct(i),M=t.useRef(),E=ft({state:h,props:i}),D=t.useCallback((function(e){return w.current[O.getItemId(e)]}),[O]);St(c,[I,v,x,s],o({isInitialMount:k.current,previousResultCount:M.current,items:s,environment:a,itemToString:p},h)),St(d,[y],o({isInitialMount:k.current,previousResultCount:M.current,items:s,environment:a,itemToString:p},h));var P=Ct({menuElement:b.current,highlightedIndex:v,isOpen:I,itemRefs:w,scrollIntoView:l,getItemNodeFromIndex:D});kt({isInitialMount:k.current,props:i,state:h}),t.useEffect((function(){(r||u||I)&&S.current&&S.current.focus()}),[]),t.useEffect((function(){k.current||(M.current=s.length)}));var K=bt(I,[S,b,C],a,(function(){m({type:gn,selectItem:!1})})),T=wt();t.useEffect((function(){return k.current=!1,function(){k.current=!0}}),[]),t.useEffect((function(){var e;if(I){if((null==(e=a.document)?void 0:e.activeElement)!==S.current){var t;null==S||null==(t=S.current)||t.focus()}}else w.current={}}),[I,a]);var R=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),m({type:rn,altKey:e.altKey,getItemNodeFromIndex:D})},ArrowUp:function(e){e.preventDefault(),m({type:un,altKey:e.altKey,getItemNodeFromIndex:D})},Home:function(e){E.current.state.isOpen&&(e.preventDefault(),m({type:ln,getItemNodeFromIndex:D}))},End:function(e){E.current.state.isOpen&&(e.preventDefault(),m({type:an,getItemNodeFromIndex:D}))},Escape:function(e){var t=E.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),m({type:sn}))},Enter:function(e){E.current.state.isOpen&&229!==e.which&&(e.preventDefault(),m({type:pn,getItemNodeFromIndex:D}))},PageUp:function(e){E.current.state.isOpen&&(e.preventDefault(),m({type:cn,getItemNodeFromIndex:D}))},PageDown:function(e){E.current.state.isOpen&&(e.preventDefault(),m({type:dn,getItemNodeFromIndex:D}))}}}),[m,E,D]),H=t.useCallback((function(e){return o({id:O.labelId,htmlFor:O.inputId},e)}),[O]),F=t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.onMouseLeave,s=r.refKey,l=void 0===s?"ref":s,a=r.ref,c=n(r,Tn),d=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==d&&d,l,b),o(((i={})[l]=we(a,(function(e){b.current=e})),i.id=O.menuId,i.role="listbox",i["aria-labelledby"]=O.labelId,i.onMouseLeave=be(u,(function(){m({type:mn})})),i),c)}),[m,T,O]),V=t.useCallback((function(e){var t,i,r=void 0===e?{}:e,u=r.item,s=r.index,l=r.refKey,a=void 0===l?"ref":l,c=r.ref,d=r.onMouseMove,p=r.onMouseDown,f=r.onClick;r.onPress;var g=r.disabled,h=n(r,Rn),I=E.current,v=I.props,y=I.state,x=dt(s,u,v.items);if(x<0)throw new Error("Pass either item or item index in getItemProps!");var b=f;return o(((t={})[a]=we(c,(function(e){e&&(w.current[O.getItemId(x)]=e)})),t.disabled=g,t.role="option",t["aria-selected"]=""+(x===y.highlightedIndex),t.id=O.getItemId(x),t),!g&&((i={}).onClick=be(b,(function(){m({type:vn,index:s})})),i),{onMouseMove:be(d,(function(){s!==y.highlightedIndex&&(P.current=!1,m({type:In,index:s,disabled:g}))})),onMouseDown:be(p,(function(e){return e.preventDefault()}))},h)}),[m,E,P,O]),A=t.useCallback((function(e){var t,i=void 0===e?{}:e,r=i.onClick;i.onPress;var u=i.refKey,s=void 0===u?"ref":u,l=i.ref,a=n(i,Hn),c=E.current.state;return o(((t={})[s]=we(l,(function(e){C.current=e})),t["aria-controls"]=O.menuId,t["aria-expanded"]=c.isOpen,t.id=O.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&o({},{onClick:be(r,(function(){m({type:yn})}))}),a)}),[m,E,O]),N=t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.onKeyDown,s=r.onChange,l=r.onInput,a=r.onFocus,c=r.onBlur;r.onChangeText;var d=r.refKey,p=void 0===d?"ref":d,f=r.ref,g=n(r,Fn),h=(void 0===t?{}:t).suppressRefError;T("getInputProps",void 0!==h&&h,p,S);var I,v=E.current.state,y={};g.disabled||((I={}).onChange=be(s,l,(function(e){m({type:fn,inputValue:e.target.value})})),I.onKeyDown=be(u,(function(e){var t=Pe(e);t&&R[t]&&R[t](e)})),I.onBlur=be(c,(function(){v.isOpen&&!K.current.isMouseDown&&m({type:gn,selectItem:!0})})),I.onFocus=be(a,(function(){v.isOpen||m({type:hn})})),y=I);return o(((i={})[p]=we(f,(function(e){S.current=e})),i["aria-activedescendant"]=v.isOpen&&v.highlightedIndex>-1?O.getItemId(v.highlightedIndex):"",i["aria-autocomplete"]="list",i["aria-controls"]=O.menuId,i["aria-expanded"]=v.isOpen,i["aria-labelledby"]=O.labelId,i.autoComplete="off",i.id=O.inputId,i.role="combobox",i.value=v.inputValue,i),y,g)}),[m,R,E,K,T,O]),B=t.useCallback((function(){m({type:xn})}),[m]),L=t.useCallback((function(){m({type:wn})}),[m]),_=t.useCallback((function(){m({type:bn})}),[m]),$=t.useCallback((function(e){m({type:Sn,highlightedIndex:e})}),[m]),j=t.useCallback((function(e){m({type:Cn,selectedItem:e})}),[m]);return{getItemProps:V,getLabelProps:H,getMenuProps:F,getInputProps:N,getToggleButtonProps:A,toggleMenu:B,openMenu:_,closeMenu:L,setHighlightedIndex:$,setInputValue:t.useCallback((function(e){m({type:kn,inputValue:e})}),[m]),selectItem:j,reset:t.useCallback((function(){m({type:On})}),[m]),highlightedIndex:v,isOpen:I,selectedItem:y,inputValue:x}}Vn.stateChangeTypes=En;var An={activeIndex:-1,selectedItems:[]};function Nn(e,t){return vt(e,t,An)}function Bn(e,t){return It(e,t,An)}function Ln(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}T.array,T.array,T.array,T.func,T.func,T.func,T.number,T.number,T.number,T.func,T.func,T.string,T.string,T.shape({addEventListener:T.func,removeEventListener:T.func,document:T.shape({getElementById:T.func,activeElement:T.any,body:T.any})});var _n={itemToString:mt.itemToString,stateReducer:mt.stateReducer,environment:mt.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},$n=Ie,jn=0,Un=1,Wn=2,zn=3,qn=4,Yn=5,Xn=6,Gn=7,Jn=8,Qn=9,Zn=10,eo=11,to=12,no=Object.freeze({__proto__:null,SelectedItemClick:jn,SelectedItemKeyDownDelete:Un,SelectedItemKeyDownBackspace:Wn,SelectedItemKeyDownNavigationNext:zn,SelectedItemKeyDownNavigationPrevious:qn,DropdownKeyDownNavigationPrevious:Yn,DropdownKeyDownBackspace:Xn,DropdownClick:Gn,FunctionAddSelectedItem:Jn,FunctionRemoveSelectedItem:Qn,FunctionSetSelectedItems:Zn,FunctionSetActiveIndex:eo,FunctionReset:to});function oo(e,t){var n,i=t.type,r=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case jn:n={activeIndex:r};break;case qn:n={activeIndex:l-1<0?0:l-1};break;case zn:n={activeIndex:l+1>=a.length?-1:l+1};break;case Wn:case Un:if(l<0)break;var c=l;1===a.length?c=-1:l===a.length-1&&(c=a.length-2),n=o({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:c});break;case Yn:n={activeIndex:a.length-1};break;case Xn:n={selectedItems:a.slice(0,a.length-1)};break;case Jn:n={selectedItems:[].concat(a,[s])};break;case Gn:n={activeIndex:-1};break;case Qn:var d=l,p=a.indexOf(s);if(p<0)break;1===a.length?d=-1:p===a.length-1&&(d=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:d};break;case Zn:n={selectedItems:t.selectedItems};break;case eo:n={activeIndex:t.activeIndex};break;case to:n={activeIndex:Bn(u,"activeIndex"),selectedItems:Bn(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return o({},e,n)}var io=["refKey","ref","onClick","onKeyDown","selectedItem","index"],ro=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function uo(e){void 0===e&&(e={}),$n();var i=o({},_n,e),r=i.getA11yRemovalMessage,u=i.itemToString,s=i.environment,l=i.keyNavigationNext,a=i.keyNavigationPrevious,c=ht(oo,function(e){return{activeIndex:Nn(e,"activeIndex"),selectedItems:Nn(e,"selectedItems")}}(i),i),d=c[0],p=c[1],f=d.activeIndex,g=d.selectedItems,h=t.useRef(!0),m=t.useRef(null),I=t.useRef(g),v=t.useRef();v.current=[];var y=ft({state:d,props:i});t.useEffect((function(){if(!h.current){if(g.length<I.current.length){var e=I.current.find((function(e){return g.indexOf(e)<0}));Fe(r({itemToString:u,resultCount:g.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:g[f]}),s.document)}I.current=g}}),[g.length]),t.useEffect((function(){h.current||(-1===f&&m.current?m.current.focus():v.current[f]&&v.current[f].focus())}),[f]),kt({isInitialMount:h.current,props:i,state:d});var x=wt();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var b=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:qn})},e[l]=function(){p({type:zn})},e.Delete=function(){p({type:Un})},e.Backspace=function(){p({type:Wn})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){Ln(e)&&p({type:Yn})},e.Backspace=function(e){Ln(e)&&p({type:Xn})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,i=void 0===e?{}:e,r=i.refKey,u=void 0===r?"ref":r,s=i.ref,l=i.onClick,a=i.onKeyDown,c=i.selectedItem,d=i.index,f=n(i,io),g=y.current.state;if(dt(d,c,g.selectedItems)<0)throw new Error("Pass either selectedItem or index in getSelectedItemProps!");return o(((t={})[u]=we(s,(function(e){e&&v.current.push(e)})),t.tabIndex=d===g.activeIndex?0:-1,t.onClick=be(l,(function(){p({type:jn,index:d})})),t.onKeyDown=be(a,(function(e){var t=Pe(e);t&&b[t]&&b[t](e)})),t),f)}),[p,y,b]),getDropdownProps:t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.refKey,s=void 0===u?"ref":u,l=r.ref,a=r.onKeyDown,c=r.onClick,d=r.preventKeyAction,f=void 0!==d&&d,g=n(r,ro),h=(void 0===t?{}:t).suppressRefError;return x("getDropdownProps",void 0!==h&&h,s,m),o(((i={})[s]=we(l,(function(e){e&&(m.current=e)})),i),!f&&{onKeyDown:be(a,(function(e){var t=Pe(e);t&&w[t]&&w[t](e)})),onClick:be(c,(function(){p({type:Gn})}))},g)}),[p,w,x]),addSelectedItem:t.useCallback((function(e){p({type:Jn,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Qn,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Zn,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:eo,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:to})}),[p]),selectedItems:g,activeIndex:f}}uo.stateChangeTypes=no,e.default=it,e.resetIdCounter=function(){he=0},e.useCombobox=Vn,e.useMultipleSelection=uo,e.useSelect=on,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React)}(this,(function(e,t){"use strict";function n(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}function o(){return o=Object.assign?Object.assign.bind():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},o.apply(this,arguments)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}var u={exports:{}},s={},l="function"==typeof Symbol&&Symbol.for,a=l?Symbol.for("react.element"):60103,c=l?Symbol.for("react.portal"):60106,d=l?Symbol.for("react.fragment"):60107,p=l?Symbol.for("react.strict_mode"):60108,f=l?Symbol.for("react.profiler"):60114,g=l?Symbol.for("react.provider"):60109,h=l?Symbol.for("react.context"):60110,m=l?Symbol.for("react.async_mode"):60111,I=l?Symbol.for("react.concurrent_mode"):60111,v=l?Symbol.for("react.forward_ref"):60112,y=l?Symbol.for("react.suspense"):60113,x=l?Symbol.for("react.suspense_list"):60120,b=l?Symbol.for("react.memo"):60115,w=l?Symbol.for("react.lazy"):60116,S=l?Symbol.for("react.block"):60121,C=l?Symbol.for("react.fundamental"):60117,k=l?Symbol.for("react.responder"):60118,O=l?Symbol.for("react.scope"):60119;function M(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case m:case I:case d:case f:case p:case y:return e;default:switch(e=e&&e.$$typeof){case h:case v:case w:case b:case g:return e;default:return t}}case c:return t}}}function D(e){return M(e)===I}s.AsyncMode=m,s.ConcurrentMode=I,s.ContextConsumer=h,s.ContextProvider=g,s.Element=a,s.ForwardRef=v,s.Fragment=d,s.Lazy=w,s.Memo=b,s.Portal=c,s.Profiler=f,s.StrictMode=p,s.Suspense=y,s.isAsyncMode=function(e){return D(e)||M(e)===m},s.isConcurrentMode=D,s.isContextConsumer=function(e){return M(e)===h},s.isContextProvider=function(e){return M(e)===g},s.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},s.isForwardRef=function(e){return M(e)===v},s.isFragment=function(e){return M(e)===d},s.isLazy=function(e){return M(e)===w},s.isMemo=function(e){return M(e)===b},s.isPortal=function(e){return M(e)===c},s.isProfiler=function(e){return M(e)===f},s.isStrictMode=function(e){return M(e)===p},s.isSuspense=function(e){return M(e)===y},s.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===d||e===I||e===f||e===p||e===y||e===x||"object"==typeof e&&null!==e&&(e.$$typeof===w||e.$$typeof===b||e.$$typeof===g||e.$$typeof===h||e.$$typeof===v||e.$$typeof===C||e.$$typeof===k||e.$$typeof===O||e.$$typeof===S)},s.typeOf=M;function E(){}function P(){}P.resetWarningCache=E;u.exports=function(){function e(e,t,n,o,i,r){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:P,resetWarningCache:E};return n.PropTypes=n,n}();var K=u.exports,T={},R=60103,H=60106,F=60107,V=60108,A=60114,N=60109,B=60110,L=60112,_=60113,$=60120,j=60115,U=60116,W=60121,z=60122,q=60117,Y=60129,X=60131;if("function"==typeof Symbol&&Symbol.for){var G=Symbol.for;R=G("react.element"),H=G("react.portal"),F=G("react.fragment"),V=G("react.strict_mode"),A=G("react.profiler"),N=G("react.provider"),B=G("react.context"),L=G("react.forward_ref"),_=G("react.suspense"),$=G("react.suspense_list"),j=G("react.memo"),U=G("react.lazy"),W=G("react.block"),z=G("react.server.block"),q=G("react.fundamental"),Y=G("react.debug_trace_mode"),X=G("react.legacy_hidden")}function J(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case R:switch(e=e.type){case F:case A:case V:case _:case $:return e;default:switch(e=e&&e.$$typeof){case B:case L:case U:case j:case N:return e;default:return t}}case H:return t}}}var Q=N,Z=R,ee=L,te=F,ne=U,oe=j,ie=H,re=A,ue=V,se=_;T.ContextConsumer=B,T.ContextProvider=Q,T.Element=Z,T.ForwardRef=ee,T.Fragment=te,T.Lazy=ne,T.Memo=oe,T.Portal=ie,T.Profiler=re,T.StrictMode=ue,T.Suspense=se,T.isAsyncMode=function(){return!1},T.isConcurrentMode=function(){return!1},T.isContextConsumer=function(e){return J(e)===B},T.isContextProvider=function(e){return J(e)===N},T.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===R},T.isForwardRef=function(e){return J(e)===L},T.isFragment=function(e){return J(e)===F},T.isLazy=function(e){return J(e)===U},T.isMemo=function(e){return J(e)===j},T.isPortal=function(e){return J(e)===H},T.isProfiler=function(e){return J(e)===A},T.isStrictMode=function(e){return J(e)===V},T.isSuspense=function(e){return J(e)===_},T.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===F||e===A||e===Y||e===V||e===_||e===$||e===X||"object"==typeof e&&null!==e&&(e.$$typeof===U||e.$$typeof===j||e.$$typeof===N||e.$$typeof===B||e.$$typeof===L||e.$$typeof===q||e.$$typeof===W||e[0]===z)},T.typeOf=J;let le=e=>"object"==typeof e&&null!=e&&1===e.nodeType,ae=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,ce=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return ae(n.overflowY,t)||ae(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},de=(e,t,n,o,i,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-o:u>t&&s<n||r<e&&s>n?u-t+i:0,pe=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var fe=(e,t)=>{var n,o,i,r,u,s;if("undefined"==typeof document)return[];let{scrollMode:l,block:a,inline:c,boundary:d,skipOverflowHiddenElements:p}=t,f="function"==typeof d?d:e=>e!==d;if(!le(e))throw new TypeError("Invalid target");let g=document.scrollingElement||document.documentElement,h=[],m=e;for(;le(m)&&f(m);){if(m=pe(m),m===g){h.push(m);break}null!=m&&m===document.body&&ce(m)&&!ce(document.documentElement)||null!=m&&ce(m,p)&&h.push(m)}let I=null!=(o=null==(n=window.visualViewport)?void 0:n.width)?o:innerWidth,v=null!=(r=null==(i=window.visualViewport)?void 0:i.height)?r:innerHeight,y=null!=(u=window.scrollX)?u:pageXOffset,x=null!=(s=window.scrollY)?s:pageYOffset,{height:b,width:w,top:S,right:C,bottom:k,left:O}=e.getBoundingClientRect(),M="start"===a||"nearest"===a?S:"end"===a?k:S+b/2,D="center"===c?O+w/2:"end"===c?C:O,E=[];for(let e=0;e<h.length;e++){let t=h[e],{height:n,width:o,top:i,right:r,bottom:u,left:s}=t.getBoundingClientRect();if("if-needed"===l&&S>=0&&O>=0&&k<=v&&C<=I&&S>=i&&k<=u&&O>=s&&C<=r)return E;let d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),f=parseInt(d.borderTopWidth,10),m=parseInt(d.borderRightWidth,10),P=parseInt(d.borderBottomWidth,10),K=0,T=0,R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-m:0,H="offsetHeight"in t?t.offsetHeight-t.clientHeight-f-P:0,F="offsetWidth"in t?0===t.offsetWidth?0:o/t.offsetWidth:0,V="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(g===t)K="start"===a?M:"end"===a?M-v:"nearest"===a?de(x,x+v,v,f,P,x+M,x+M+b,b):M-v/2,T="start"===c?D:"center"===c?D-I/2:"end"===c?D-I:de(y,y+I,I,p,m,y+D,y+D+w,w),K=Math.max(0,K+x),T=Math.max(0,T+y);else{K="start"===a?M-i-f:"end"===a?M-u+P+H:"nearest"===a?de(i,u,n,f,P+H,M,M+b,b):M-(i+n/2)+H/2,T="start"===c?D-s-p:"center"===c?D-(s+o/2)+R/2:"end"===c?D-r+m+R:de(s,r,o,p,m+R,D,D+w,w);let{scrollLeft:e,scrollTop:l}=t;K=Math.max(0,Math.min(l+K/V,t.scrollHeight-n/V+H)),T=Math.max(0,Math.min(e+T/F,t.scrollWidth-o/F+R)),M+=l-K,D+=e-T}E.push({el:t,top:K,left:T})}return E},ge=0;function he(e){return"function"==typeof e?e:me}function me(){}function Ie(e,t){e&&fe(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,o=e.left;t.scrollTop=n,t.scrollLeft=o}))}function ve(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function ye(e,t){var n;function o(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,r=new Array(i),u=0;u<i;u++)r[u]=arguments[u];o(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return i.cancel=o,i}function xe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return t.some((function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function be(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function we(){return String(ge++)}function Se(e){var t=e.isOpen,n=e.resultCount,o=e.previousResultCount;return t?n?n!==o?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function Ce(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var ke=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Oe(e){void 0===e&&(e={});var t={};return ke.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function Me(e,t){return Object.keys(e).reduce((function(n,o){return n[o]=De(t,o)?t[o]:e[o],n}),{})}function De(e,t){return void 0!==e[t]}function Ee(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function Pe(e,t,n,o,i){if(void 0===i&&(i=!0),0===n)return-1;var r=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:r+1);var u=t+e;u<0?u=i?r:0:u>r&&(u=i?0:r);var s=Ke(e,u,n,o,i);return-1===s?t>=n?-1:t:s}function Ke(e,t,n,o,i){var r=o(t);if(!r||!r.hasAttribute("disabled"))return t;if(e>0){for(var u=t+1;u<n;u++)if(!o(u).hasAttribute("disabled"))return u}else for(var s=t-1;s>=0;s--)if(!o(s).hasAttribute("disabled"))return s;return i?e>0?Ke(1,0,n,o,!1):Ke(-1,n-1,n,o,!1):-1}function Te(e,t,n,o){return void 0===o&&(o=!0),t.some((function(t){return t&&(ve(t,e,n)||o&&ve(t,n.document.activeElement,n))}))}var Re=ye((function(e){Fe(e).textContent=""}),500);function He(e,t){var n=Fe(t);e&&(n.textContent=e,Re(t))}function Fe(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var Ve=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),Ae=["refKey","ref"],Ne=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],Be=["onKeyDown","onBlur","onChange","onInput","onChangeText"],Le=["refKey","ref"],_e=["onMouseMove","onMouseDown","onClick","onPress","index","item"],$e=function(){var e=function(e){var u,s;function l(t){var r=e.call(this,t)||this;r.id=r.props.id||"downshift-"+we(),r.menuId=r.props.menuId||r.id+"-menu",r.labelId=r.props.labelId||r.id+"-label",r.inputId=r.props.inputId||r.id+"-input",r.getItemId=r.props.getItemId||function(e){return r.id+"-item-"+e},r.input=null,r.items=[],r.itemCount=null,r.previousResultCount=0,r.timeoutIds=[],r.internalSetTimeout=function(e,t){var n=setTimeout((function(){r.timeoutIds=r.timeoutIds.filter((function(e){return e!==n})),e()}),t);r.timeoutIds.push(n)},r.setItemCount=function(e){r.itemCount=e},r.unsetItemCount=function(){r.itemCount=null},r.setHighlightedIndex=function(e,t){void 0===e&&(e=r.props.defaultHighlightedIndex),void 0===t&&(t={}),t=Oe(t),r.internalSetState(o({highlightedIndex:e},t))},r.clearSelection=function(e){r.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:r.props.defaultHighlightedIndex,isOpen:r.props.defaultIsOpen},e)},r.selectItem=function(e,t,n){t=Oe(t),r.internalSetState(o({isOpen:r.props.defaultIsOpen,highlightedIndex:r.props.defaultHighlightedIndex,selectedItem:e,inputValue:r.props.itemToString(e)},t),n)},r.selectItemAtIndex=function(e,t,n){var o=r.items[e];null!=o&&r.selectItem(o,t,n)},r.selectHighlightedItem=function(e,t){return r.selectItemAtIndex(r.getState().highlightedIndex,e,t)},r.internalSetState=function(e,t){var n,i,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&r.props.onInputValueChange(e.inputValue,o({},r.getStateAndHelpers(),e)),r.setState((function(t){t=r.getState(t);var l=s?e(t):e;l=r.props.stateReducer(t,l),n=l.hasOwnProperty("selectedItem");var a={};return n&&l.selectedItem!==t.selectedItem&&(i=l.selectedItem),l.type=l.type||0,Object.keys(l).forEach((function(e){t[e]!==l[e]&&(u[e]=l[e]),"type"!==e&&(l[e],De(r.props,e)||(a[e]=l[e]))})),s&&l.hasOwnProperty("inputValue")&&r.props.onInputValueChange(l.inputValue,o({},r.getStateAndHelpers(),l)),a}),(function(){he(t)(),Object.keys(u).length>1&&r.props.onStateChange(u,r.getStateAndHelpers()),n&&r.props.onSelect(e.selectedItem,r.getStateAndHelpers()),void 0!==i&&r.props.onChange(i,r.getStateAndHelpers()),r.props.onUserAction(u,r.getStateAndHelpers())}))},r.rootRef=function(e){return r._rootNode=e},r.getRootProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=n(u,Ae),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;r.getRootProps.called=!0,r.getRootProps.refKey=l,r.getRootProps.suppressRefError=p;var f=r.getState().isOpen;return o(((i={})[l]=be(a,r.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?r.menuId:null,i["aria-labelledby"]=r.labelId,i),c)},r.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=Pe(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=Pe(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,o=t.highlightedIndex;if(n&&null!=o){e.preventDefault();var i=this.items[o],r=this.getItemNodeFromIndex(o);if(null==i||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(o({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},r.buttonKeyDownHandlers=o({},r.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),r.inputKeyDownHandlers=o({},r.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var o=this.getItemCount();if(!(o<=0)&&n){var i=Ke(1,0,o,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var o=this.getItemCount();if(!(o<=0)&&n){var i=Ke(-1,o-1,o,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(i,{type:8})}}}}),r.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var u=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=n(t,Ne),c=r.getState().isOpen,d={onClick:xe(i,r.buttonHandleClick),onKeyDown:xe(u,r.buttonHandleKeyDown),onKeyUp:xe(s,r.buttonHandleKeyUp),onBlur:xe(l,r.buttonHandleBlur)};return o({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},r.buttonHandleKeyUp=function(e){e.preventDefault()},r.buttonHandleKeyDown=function(e){var t=Ee(e);r.buttonKeyDownHandlers[t]&&r.buttonKeyDownHandlers[t].call(i(r),e)},r.buttonHandleClick=function(e){e.preventDefault(),r.props.environment.document.activeElement===r.props.environment.document.body&&e.target.focus(),r.internalSetTimeout((function(){return r.toggleMenu({type:13})}))},r.buttonHandleBlur=function(e){var t=e.target;r.internalSetTimeout((function(){r.isMouseDown||null!=r.props.environment.document.activeElement&&r.props.environment.document.activeElement.id===r.inputId||r.props.environment.document.activeElement===t||r.reset({type:14})}))},r.getLabelProps=function(e){return o({htmlFor:r.inputId,id:r.labelId},e)},r.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=n(t,Be),c={};var d,p=r.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;a.disabled||((d={}).onChange=xe(s,l,r.inputHandleChange),d.onKeyDown=xe(i,r.inputHandleKeyDown),d.onBlur=xe(u,r.inputHandleBlur),c=d);return o({"aria-autocomplete":"list","aria-activedescendant":g&&"number"==typeof h&&h>=0?r.getItemId(h):null,"aria-controls":g?r.menuId:null,"aria-labelledby":r.labelId,autoComplete:"off",value:f,id:r.inputId},c,a)},r.inputHandleKeyDown=function(e){var t=Ee(e);t&&r.inputKeyDownHandlers[t]&&r.inputKeyDownHandlers[t].call(i(r),e)},r.inputHandleChange=function(e){r.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:r.props.defaultHighlightedIndex})},r.inputHandleBlur=function(){r.internalSetTimeout((function(){var e=r.props.environment.document&&!!r.props.environment.document.activeElement&&!!r.props.environment.document.activeElement.dataset&&r.props.environment.document.activeElement.dataset.toggle&&r._rootNode&&r._rootNode.contains(r.props.environment.document.activeElement);r.isMouseDown||e||r.reset({type:10})}))},r.menuRef=function(e){r._menuNode=e},r.getMenuProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=n(u,Le),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return r.getMenuProps.called=!0,r.getMenuProps.refKey=l,r.getMenuProps.suppressRefError=p,o(((i={})[l]=be(a,r.menuRef),i.role="listbox",i["aria-labelledby"]=c&&c["aria-label"]?null:r.labelId,i.id=r.menuId,i),c)},r.getItemProps=function(e){var t,i=void 0===e?{}:e,u=i.onMouseMove,s=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,c=i.item,d=void 0===c?void 0:c,p=n(i,_e);void 0===a?(r.items.push(d),a=r.items.indexOf(d)):r.items[a]=d;var f=l,g=((t={onMouseMove:xe(u,(function(){a!==r.getState().highlightedIndex&&(r.setHighlightedIndex(a,{type:2}),r.avoidScrolling=!0,r.internalSetTimeout((function(){return r.avoidScrolling=!1}),250))})),onMouseDown:xe(s,(function(e){e.preventDefault()}))}).onClick=xe(f,(function(){r.selectItemAtIndex(a,{type:9})})),t),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return o({id:r.getItemId(a),role:"option","aria-selected":r.getState().highlightedIndex===a},h,p)},r.clearItems=function(){r.items=[]},r.reset=function(e,t){void 0===e&&(e={}),e=Oe(e),r.internalSetState((function(t){var n=t.selectedItem;return o({isOpen:r.props.defaultIsOpen,highlightedIndex:r.props.defaultHighlightedIndex,inputValue:r.props.itemToString(n)},e)}),t)},r.toggleMenu=function(e,t){void 0===e&&(e={}),e=Oe(e),r.internalSetState((function(t){var n=t.isOpen;return o({isOpen:!n},n&&{highlightedIndex:r.props.defaultHighlightedIndex},e)}),(function(){var n=r.getState(),o=n.isOpen,i=n.highlightedIndex;o&&r.getItemCount()>0&&"number"==typeof i&&r.setHighlightedIndex(i,e),he(t)()}))},r.openMenu=function(e){r.internalSetState({isOpen:!0},e)},r.closeMenu=function(e){r.internalSetState({isOpen:!1},e)},r.updateStatus=ye((function(){var e=r.getState(),t=r.items[e.highlightedIndex],n=r.getItemCount(),i=r.props.getA11yStatusMessage(o({itemToString:r.props.itemToString,previousResultCount:r.previousResultCount,resultCount:n,highlightedItem:t},e));r.previousResultCount=n,He(i,r.props.environment.document)}),200);var u=r.props,s=u.defaultHighlightedIndex,l=u.initialHighlightedIndex,a=void 0===l?s:l,c=u.defaultIsOpen,d=u.initialIsOpen,p=void 0===d?c:d,f=u.initialInputValue,g=void 0===f?"":f,h=u.initialSelectedItem,m=void 0===h?null:h,I=r.getState({highlightedIndex:a,isOpen:p,inputValue:g,selectedItem:m});return null!=I.selectedItem&&void 0===r.props.initialInputValue&&(I.inputValue=r.props.itemToString(I.selectedItem)),r.state=I,r}s=e,(u=l).prototype=Object.create(s.prototype),u.prototype.constructor=u,r(u,s);var a=l.prototype;return a.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},a.getState=function(e){return void 0===e&&(e=this.state),Me(e,this.props)},a.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},a.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},a.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},a.moveHighlightedIndex=function(e,t){var n=this,o=this.getItemCount(),i=this.getState().highlightedIndex;if(o>0){var r=Pe(e,i,o,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(r,t)}},a.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,i=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,g=this.closeMenu,h=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,x=this.clearSelection,b=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:c,getInputProps:d,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:g,toggleMenu:h,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:x,clearItems:b,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:i,selectedItem:o}},a.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!Te(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},o=function(){e.isTouchMove=!1},i=function(){e.isTouchMove=!0},r=function(t){var n=Te(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",o),u.addEventListener("touchmove",i),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",o),u.removeEventListener("touchmove",i),u.removeEventListener("touchend",r)}},a.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,o=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==o},a.componentDidUpdate=function(e,t){De(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},a.componentWillUnmount=function(){this.cleanup()},a.render=function(){var e=Ce(this.props.children,me);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=Ce(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props}(n))):void 0:null},l}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:Se,itemToString:function(e){return null==e?"":String(e)},onStateChange:me,onInputValueChange:me,onUserAction:me,onChange:me,onSelect:me,onOuterClick:me,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:Ie},e.stateChangeTypes=Ve,e}(),je=$e,Ue=["isInitialMount","highlightedIndex","items","environment"],We={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function ze(e,t,n){var i=e.props,r=e.type,u={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var r=t.props,u=t.type,s="on"+Je(e)+"Change";r[s]&&void 0!==i[e]&&i[e]!==n[e]&&r[s](o({type:u},i))}(i,e,t,n),n[i]!==t[i]&&(u[i]=n[i])})),i.onStateChange&&Object.keys(u).length&&i.onStateChange(o({type:r},u))}var qe=ye((function(e,t){He(e(),t)}),200),Ye="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function Xe(e){var n=e.id,o=void 0===n?"downshift-"+we():n,i=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:i||o+"-label",menuId:r||o+"-menu",getItemId:u||function(e){return o+"-item-"+e},toggleButtonId:s||o+"-toggle-button",inputId:l||o+"-input"}).current}function Ge(e,t,n,o){var i,r;if(void 0===e){if(void 0===t)throw new Error(o);i=n[t],r=t}else r=void 0===t?n.indexOf(e):t,i=e;return[i,r]}function Je(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Qe(e){var n=t.useRef(e);return n.current=e,n}function Ze(e,n,i){var r=t.useRef(),u=t.useRef(),s=t.useCallback((function(t,n){u.current=n,t=Me(t,n.props);var i=e(t,n);return n.props.stateReducer(t,o({},n,{changes:i}))}),[e]),l=t.useReducer(s,n),a=l[0],c=l[1],d=Qe(i),p=t.useCallback((function(e){return c(o({props:d.current},e))}),[d]),f=u.current;return t.useEffect((function(){f&&r.current&&r.current!==a&&ze(f,Me(r.current,f.props),a),r.current=a}),[a,i,f]),[a,p]}function et(e,t,n){var o=Ze(e,t,n),i=o[0],r=o[1];return[Me(i,n),r]}var tt={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:Ie,environment:"undefined"==typeof window?{}:window};function nt(e,t,n){void 0===n&&(n=We);var o=e["default"+Je(t)];return void 0!==o?o:n[t]}function ot(e,t,n){void 0===n&&(n=We);var o=e[t];if(void 0!==o)return o;var i=e["initial"+Je(t)];return void 0!==i?i:nt(e,t,n)}function it(e){var t=ot(e,"selectedItem"),n=ot(e,"isOpen"),o=ot(e,"highlightedIndex"),i=ot(e,"inputValue");return{highlightedIndex:o<0&&t&&n?e.items.indexOf(t):o,isOpen:n,selectedItem:t,inputValue:i}}function rt(e,t,n){var o=e.items,i=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===o.length?-1:void 0!==i&&s===i?i:void 0!==r?r:u?o.indexOf(u):0===n?-1:n<0?o.length-1:0}function ut(e,n,o,i){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(null!=(null==o?void 0:o.addEventListener)){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!Te(t.target,n.map((function(e){return e.current})),o)&&i()},s=function(){r.current.isTouchMove=!1},l=function(){r.current.isTouchMove=!0},a=function(t){!e||r.current.isTouchMove||Te(t.target,n.map((function(e){return e.current})),o,!1)||i()};return o.addEventListener("mousedown",t),o.addEventListener("mouseup",u),o.addEventListener("touchstart",s),o.addEventListener("touchmove",l),o.addEventListener("touchend",a),function(){o.removeEventListener("mousedown",t),o.removeEventListener("mouseup",u),o.removeEventListener("touchstart",s),o.removeEventListener("touchmove",l),o.removeEventListener("touchend",a)}}}),[e,o]),r}var st=function(){return me};function lt(e,i,r){var u=r.isInitialMount,s=r.highlightedIndex,l=r.items,a=r.environment,c=n(r,Ue);t.useEffect((function(){u||qe((function(){return e(o({highlightedIndex:s,highlightedItem:l[s],resultCount:l.length},c))}),a.document)}),i)}function at(e){var n=e.highlightedIndex,o=e.isOpen,i=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return Ye((function(){n<0||!o||!Object.keys(i.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var ct=me;function dt(e,t,n){var i,r=t.type,u=t.props;switch(r){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:rt(u,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:rt(u,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:nt(u,"highlightedIndex"),isOpen:nt(u,"isOpen"),selectedItem:nt(u,"selectedItem"),inputValue:nt(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return o({},e,i)}var pt=function(){return pt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pt.apply(this,arguments)};K.array.isRequired,K.func,K.func,K.func,K.number,K.number,K.number,K.bool,K.bool,K.bool,K.any,K.any,K.any,K.string,K.string,K.string,K.func,K.string,K.func,K.func,K.func,K.func,K.func,K.shape({addEventListener:K.func,removeEventListener:K.func,document:K.shape({getElementById:K.func,activeElement:K.any,body:K.any})});var ft=pt(pt({},tt),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,o=e.previousResultCount;return t?n?n!==o?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}}),gt=me,ht=0,mt=1,It=2,vt=3,yt=4,xt=5,bt=6,wt=7,St=8,Ct=9,kt=10,Ot=11,Mt=12,Dt=13,Et=14,Pt=15,Kt=16,Tt=17,Rt=18,Ht=19,Ft=20,Vt=21,At=Object.freeze({__proto__:null,ToggleButtonClick:ht,ToggleButtonKeyDownArrowDown:mt,ToggleButtonKeyDownArrowUp:It,ToggleButtonKeyDownCharacter:vt,ToggleButtonKeyDownEscape:yt,ToggleButtonKeyDownHome:xt,ToggleButtonKeyDownEnd:bt,ToggleButtonKeyDownEnter:wt,ToggleButtonKeyDownSpaceButton:St,ToggleButtonKeyDownPageUp:Ct,ToggleButtonKeyDownPageDown:kt,ToggleButtonBlur:Ot,MenuMouseLeave:Mt,ItemMouseMove:Dt,ItemClick:Et,FunctionToggleMenu:Pt,FunctionOpenMenu:Kt,FunctionCloseMenu:Tt,FunctionSetHighlightedIndex:Rt,FunctionSelectItem:Ht,FunctionSetInputValue:Ft,FunctionReset:Vt});function Nt(e,t){var n,i=t.type,r=t.props,u=t.altKey;switch(i){case Et:n={isOpen:nt(r,"isOpen"),highlightedIndex:nt(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case vt:var s=t.key,l=""+e.inputValue+s,a=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,o=e.items,i=e.itemToString,r=e.getItemNodeFromIndex,u=t.toLowerCase(),s=0;s<o.length;s++){var l=(s+n+(t.length<2?1:0))%o.length,a=o[l];if(void 0!==a&&i(a).toLowerCase().startsWith(u)){var c=r(l);if(!(null==c?void 0:c.hasAttribute("disabled")))return l}}return n}({keysSoFar:l,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});n={inputValue:l,highlightedIndex:a,isOpen:!0};break;case mt:n={highlightedIndex:e.isOpen?Pe(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):u&&null==e.selectedItem?-1:rt(r,e,1),isOpen:!0};break;case It:if(e.isOpen&&u)n=o({isOpen:nt(r,"isOpen"),highlightedIndex:nt(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex]});else n={highlightedIndex:e.isOpen?Pe(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):rt(r,e,-1),isOpen:!0};break;case wt:case St:n=o({isOpen:nt(r,"isOpen"),highlightedIndex:nt(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex]});break;case xt:n={highlightedIndex:Ke(1,0,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case bt:n={highlightedIndex:Ke(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case Ct:n={highlightedIndex:Pe(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case kt:n={highlightedIndex:Pe(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case yt:n={isOpen:!1,highlightedIndex:-1};break;case Ot:n=o({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex]});break;case Ht:n={selectedItem:t.selectedItem};break;default:return dt(e,t,At)}return o({},e,n)}var Bt=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],Lt=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],_t=["item","index","onMouseMove","onClick","onPress","refKey","ref","disabled"];function $t(e){void 0===e&&(e={}),gt();var i=o({},ft,e),r=i.items,u=i.scrollIntoView,s=i.environment,l=i.itemToString,a=i.getA11ySelectionMessage,c=i.getA11yStatusMessage,d=et(Nt,it(i),i),p=d[0],f=d[1],g=p.isOpen,h=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef(null),x=t.useRef({}),b=t.useRef(null),w=Xe(i),S=t.useRef(),C=t.useRef(!0),k=Qe({state:p,props:i}),O=t.useCallback((function(e){return x.current[w.getItemId(e)]}),[w]);lt(c,[g,h,I,r],o({isInitialMount:C.current,previousResultCount:S.current,items:r,environment:s,itemToString:l},p)),lt(a,[m],o({isInitialMount:C.current,previousResultCount:S.current,items:r,environment:s,itemToString:l},p));var M=at({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:x,scrollIntoView:u,getItemNodeFromIndex:O});t.useEffect((function(){return b.current=ye((function(e){e({type:Ft,inputValue:""})}),500),function(){b.current.cancel()}}),[]),t.useEffect((function(){I&&b.current(f)}),[f,I]),ct({isInitialMount:C.current,props:i,state:p}),t.useEffect((function(){C.current||(S.current=r.length)}));var D=ut(g,[y,v],s,(function(){f({type:Ot})})),E=st();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){g||(x.current={})}),[g]);var P=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:mt,getItemNodeFromIndex:O,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:It,getItemNodeFromIndex:O,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:xt,getItemNodeFromIndex:O})},End:function(e){e.preventDefault(),f({type:bt,getItemNodeFromIndex:O})},Escape:function(){k.current.state.isOpen&&f({type:yt})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?wt:ht})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ct,getItemNodeFromIndex:O}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:kt,getItemNodeFromIndex:O}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:vt,key:" ",getItemNodeFromIndex:O}):f({type:St}):f({type:ht})}}}),[f,O,k]),K=t.useCallback((function(){f({type:Pt})}),[f]),T=t.useCallback((function(){f({type:Tt})}),[f]),R=t.useCallback((function(){f({type:Kt})}),[f]),H=t.useCallback((function(e){f({type:Rt,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:Ht,selectedItem:e})}),[f]),V=t.useCallback((function(){f({type:Vt})}),[f]),A=t.useCallback((function(e){f({type:Ft,inputValue:e})}),[f]),N=t.useCallback((function(e){return o({id:w.labelId,htmlFor:w.toggleButtonId},e)}),[w]),B=t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.onMouseLeave,s=r.refKey,l=void 0===s?"ref":s;r.onKeyDown,r.onBlur;var a=r.ref,c=n(r,Bt),d=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==d&&d,l,y),o(((i={})[l]=be(a,(function(e){y.current=e})),i.id=w.menuId,i.role="listbox",i["aria-labelledby"]=w.labelId,i.tabIndex=-1,i.onMouseLeave=xe(u,(function(){f({type:Mt})})),i),c)}),[f,E,w]);return{getToggleButtonProps:t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.onBlur,s=r.onClick;r.onPress;var l=r.onKeyDown,a=r.refKey,c=void 0===a?"ref":a,d=r.ref,p=n(r,Lt),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=k.current.state,I=o(((i={})[c]=be(d,(function(e){v.current=e})),i["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?w.getItemId(m.highlightedIndex):"",i["aria-controls"]=w.menuId,i["aria-expanded"]=k.current.state.isOpen,i["aria-haspopup"]="listbox",i["aria-labelledby"]=""+w.labelId,i.id=w.toggleButtonId,i.role="combobox",i.tabIndex=0,i.onBlur=xe(u,(function(){m.isOpen&&!D.current.isMouseDown&&f({type:Ot})})),i),p);return p.disabled||(I.onClick=xe(s,(function(){f({type:ht})})),I.onKeyDown=xe(l,(function(e){var t=Ee(e);t&&P[t]?P[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:vt,key:t,getItemNodeFromIndex:O})}))),E("getToggleButtonProps",h,c,v),I}),[k,w,E,f,D,P,O]),getLabelProps:N,getMenuProps:B,getItemProps:t.useCallback((function(e){var t,i=void 0===e?{}:e,r=i.item,u=i.index,s=i.onMouseMove,l=i.onClick;i.onPress;var a=i.refKey,c=void 0===a?"ref":a,d=i.ref,p=i.disabled,g=n(i,_t),h=k.current,I=h.state,v=Ge(r,u,h.props.items,"Pass either item or index to getItemProps!"),y=v[0],b=v[1],S=o(((t={disabled:p,role:"option","aria-selected":""+(y===m),id:w.getItemId(b)})[c]=be(d,(function(e){e&&(x.current[w.getItemId(b)]=e)})),t),g);return p||(S.onClick=xe(l,(function(){f({type:Et,index:b})}))),S.onMouseMove=xe(s,(function(){b!==I.highlightedIndex&&(M.current=!1,f({type:Dt,index:b,disabled:p}))})),S}),[k,m,w,M,f]),toggleMenu:K,openMenu:R,closeMenu:T,setHighlightedIndex:H,selectItem:F,reset:V,setInputValue:A,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}$t.stateChangeTypes=At;var jt=0,Ut=1,Wt=2,zt=3,qt=4,Yt=5,Xt=6,Gt=7,Jt=8,Qt=9,Zt=10,en=11,tn=12,nn=13,on=14,rn=15,un=16,sn=17,ln=18,an=19,cn=20,dn=21,pn=22,fn=Object.freeze({__proto__:null,InputKeyDownArrowDown:jt,InputKeyDownArrowUp:Ut,InputKeyDownEscape:Wt,InputKeyDownHome:zt,InputKeyDownEnd:qt,InputKeyDownPageUp:Yt,InputKeyDownPageDown:Xt,InputKeyDownEnter:Gt,InputChange:Jt,InputBlur:Qt,InputFocus:Zt,MenuMouseLeave:en,ItemMouseMove:tn,ItemClick:nn,ToggleButtonClick:on,FunctionToggleMenu:rn,FunctionOpenMenu:un,FunctionCloseMenu:sn,FunctionSetHighlightedIndex:ln,FunctionSelectItem:an,FunctionSetInputValue:cn,FunctionReset:dn,ControlledPropUpdatedSelectedItem:pn});K.array.isRequired,K.func,K.func,K.func,K.number,K.number,K.number,K.bool,K.bool,K.bool,K.any,K.any,K.any,K.string,K.string,K.string,K.string,K.string,K.string,K.func,K.string,K.string,K.func,K.func,K.func,K.func,K.func,K.func,K.shape({addEventListener:K.func,removeEventListener:K.func,document:K.shape({getElementById:K.func,activeElement:K.any,body:K.any})});var gn=me,hn=o({},tt,{getA11yStatusMessage:Se});function mn(e,t){var n,i=t.type,r=t.props,u=t.altKey;switch(i){case nn:n={isOpen:nt(r,"isOpen"),highlightedIndex:nt(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case jt:n=e.isOpen?{highlightedIndex:Pe(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:u&&null==e.selectedItem?-1:rt(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case Ut:n=e.isOpen?u?o({isOpen:nt(r,"isOpen"),highlightedIndex:nt(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])}):{highlightedIndex:Pe(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:rt(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case Gt:n=o({isOpen:nt(r,"isOpen"),highlightedIndex:nt(r,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case Wt:n=o({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Yt:n={highlightedIndex:Pe(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Xt:n={highlightedIndex:Pe(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case zt:n={highlightedIndex:Ke(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case qt:n={highlightedIndex:Ke(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case Qt:n=o({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case Jt:n={isOpen:!0,highlightedIndex:nt(r,"highlightedIndex"),inputValue:t.inputValue};break;case Zt:n={isOpen:!0,highlightedIndex:rt(r,e,0)};break;case an:n={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case pn:n={inputValue:t.inputValue};break;default:return dt(e,t,fn)}return o({},e,n)}var In=["onMouseLeave","refKey","ref"],vn=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],yn=["onClick","onPress","refKey","ref"],xn=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function bn(e){void 0===e&&(e={}),gn();var i=o({},hn,e),r=i.initialIsOpen,u=i.defaultIsOpen,s=i.items,l=i.scrollIntoView,a=i.environment,c=i.getA11yStatusMessage,d=i.getA11ySelectionMessage,p=i.itemToString,f=function(e){var t=it(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),o({},t,{inputValue:i})}(i),g=function(e,n,o){var i=t.useRef(),r=Ze(e,n,o),u=r[0],s=r[1];return t.useEffect((function(){De(o,"selectedItem")&&(i.current!==o.selectedItem&&s({type:pn,inputValue:o.itemToString(o.selectedItem)}),i.current=u.selectedItem===i.current?o.selectedItem:u.selectedItem)}),[o.selectedItem,u.selectedItem]),[Me(u,o),s]}(mn,f,i),h=g[0],m=g[1],I=h.isOpen,v=h.highlightedIndex,y=h.selectedItem,x=h.inputValue,b=t.useRef(null),w=t.useRef({}),S=t.useRef(null),C=t.useRef(null),k=t.useRef(!0),O=Xe(i),M=t.useRef(),D=Qe({state:h,props:i}),E=t.useCallback((function(e){return w.current[O.getItemId(e)]}),[O]);lt(c,[I,v,x,s],o({isInitialMount:k.current,previousResultCount:M.current,items:s,environment:a,itemToString:p},h)),lt(d,[y],o({isInitialMount:k.current,previousResultCount:M.current,items:s,environment:a,itemToString:p},h));var P=at({menuElement:b.current,highlightedIndex:v,isOpen:I,itemRefs:w,scrollIntoView:l,getItemNodeFromIndex:E});ct({isInitialMount:k.current,props:i,state:h}),t.useEffect((function(){(r||u||I)&&S.current&&S.current.focus()}),[]),t.useEffect((function(){k.current||(M.current=s.length)}));var K=ut(I,[S,b,C],a,(function(){m({type:Qt,selectItem:!1})})),T=st();t.useEffect((function(){return k.current=!1,function(){k.current=!0}}),[]),t.useEffect((function(){var e;if(I){if((null==(e=a.document)?void 0:e.activeElement)!==S.current){var t;null==S||null==(t=S.current)||t.focus()}}else w.current={}}),[I,a]);var R=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),m({type:jt,altKey:e.altKey,getItemNodeFromIndex:E})},ArrowUp:function(e){e.preventDefault(),m({type:Ut,altKey:e.altKey,getItemNodeFromIndex:E})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:zt,getItemNodeFromIndex:E}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:qt,getItemNodeFromIndex:E}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),m({type:Wt}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),m({type:Gt,getItemNodeFromIndex:E}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Yt,getItemNodeFromIndex:E}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Xt,getItemNodeFromIndex:E}))}}}),[m,D,E]),H=t.useCallback((function(e){return o({id:O.labelId,htmlFor:O.inputId},e)}),[O]),F=t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.onMouseLeave,s=r.refKey,l=void 0===s?"ref":s,a=r.ref,c=n(r,In),d=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==d&&d,l,b),o(((i={})[l]=be(a,(function(e){b.current=e})),i.id=O.menuId,i.role="listbox",i["aria-labelledby"]=O.labelId,i.onMouseLeave=xe(u,(function(){m({type:en})})),i),c)}),[m,T,O]),V=t.useCallback((function(e){var t,i,r=void 0===e?{}:e,u=r.item,s=r.index,l=r.refKey,a=void 0===l?"ref":l,c=r.ref,d=r.onMouseMove,p=r.onMouseDown,f=r.onClick;r.onPress;var g=r.disabled,h=n(r,vn),I=D.current,v=I.props,y=I.state,x=Ge(u,s,v.items,"Pass either item or index to getItemProps!")[1],b=f;return o(((t={})[a]=be(c,(function(e){e&&(w.current[O.getItemId(x)]=e)})),t.disabled=g,t.role="option",t["aria-selected"]=""+(x===y.highlightedIndex),t.id=O.getItemId(x),t),!g&&((i={}).onClick=xe(b,(function(){m({type:nn,index:x})})),i),{onMouseMove:xe(d,(function(){x!==y.highlightedIndex&&(P.current=!1,m({type:tn,index:x,disabled:g}))})),onMouseDown:xe(p,(function(e){return e.preventDefault()}))},h)}),[m,D,P,O]),A=t.useCallback((function(e){var t,i=void 0===e?{}:e,r=i.onClick;i.onPress;var u=i.refKey,s=void 0===u?"ref":u,l=i.ref,a=n(i,yn),c=D.current.state;return o(((t={})[s]=be(l,(function(e){C.current=e})),t["aria-controls"]=O.menuId,t["aria-expanded"]=c.isOpen,t.id=O.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&o({},{onClick:xe(r,(function(){m({type:on})}))}),a)}),[m,D,O]),N=t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.onKeyDown,s=r.onChange,l=r.onInput,a=r.onFocus,c=r.onBlur;r.onChangeText;var d=r.refKey,p=void 0===d?"ref":d,f=r.ref,g=n(r,xn),h=(void 0===t?{}:t).suppressRefError;T("getInputProps",void 0!==h&&h,p,S);var I,v=D.current.state,y={};g.disabled||((I={}).onChange=xe(s,l,(function(e){m({type:Jt,inputValue:e.target.value})})),I.onKeyDown=xe(u,(function(e){var t=Ee(e);t&&R[t]&&R[t](e)})),I.onBlur=xe(c,(function(){v.isOpen&&!K.current.isMouseDown&&m({type:Qt,selectItem:!0})})),I.onFocus=xe(a,(function(){v.isOpen||m({type:Zt})})),y=I);return o(((i={})[p]=be(f,(function(e){S.current=e})),i["aria-activedescendant"]=v.isOpen&&v.highlightedIndex>-1?O.getItemId(v.highlightedIndex):"",i["aria-autocomplete"]="list",i["aria-controls"]=O.menuId,i["aria-expanded"]=v.isOpen,i["aria-labelledby"]=O.labelId,i.autoComplete="off",i.id=O.inputId,i.role="combobox",i.value=v.inputValue,i),y,g)}),[m,R,D,K,T,O]),B=t.useCallback((function(){m({type:rn})}),[m]),L=t.useCallback((function(){m({type:sn})}),[m]),_=t.useCallback((function(){m({type:un})}),[m]),$=t.useCallback((function(e){m({type:ln,highlightedIndex:e})}),[m]),j=t.useCallback((function(e){m({type:an,selectedItem:e})}),[m]);return{getItemProps:V,getLabelProps:H,getMenuProps:F,getInputProps:N,getToggleButtonProps:A,toggleMenu:B,openMenu:_,closeMenu:L,setHighlightedIndex:$,setInputValue:t.useCallback((function(e){m({type:cn,inputValue:e})}),[m]),selectItem:j,reset:t.useCallback((function(){m({type:dn})}),[m]),highlightedIndex:v,isOpen:I,selectedItem:y,inputValue:x}}bn.stateChangeTypes=fn;var wn={activeIndex:-1,selectedItems:[]};function Sn(e,t){return ot(e,t,wn)}function Cn(e,t){return nt(e,t,wn)}function kn(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}K.array,K.array,K.array,K.func,K.func,K.func,K.number,K.number,K.number,K.func,K.func,K.string,K.string,K.shape({addEventListener:K.func,removeEventListener:K.func,document:K.shape({getElementById:K.func,activeElement:K.any,body:K.any})});var On={itemToString:tt.itemToString,stateReducer:tt.stateReducer,environment:tt.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},Mn=me,Dn=0,En=1,Pn=2,Kn=3,Tn=4,Rn=5,Hn=6,Fn=7,Vn=8,An=9,Nn=10,Bn=11,Ln=12,_n=Object.freeze({__proto__:null,SelectedItemClick:Dn,SelectedItemKeyDownDelete:En,SelectedItemKeyDownBackspace:Pn,SelectedItemKeyDownNavigationNext:Kn,SelectedItemKeyDownNavigationPrevious:Tn,DropdownKeyDownNavigationPrevious:Rn,DropdownKeyDownBackspace:Hn,DropdownClick:Fn,FunctionAddSelectedItem:Vn,FunctionRemoveSelectedItem:An,FunctionSetSelectedItems:Nn,FunctionSetActiveIndex:Bn,FunctionReset:Ln});function $n(e,t){var n,i=t.type,r=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case Dn:n={activeIndex:r};break;case Tn:n={activeIndex:l-1<0?0:l-1};break;case Kn:n={activeIndex:l+1>=a.length?-1:l+1};break;case Pn:case En:if(l<0)break;var c=l;1===a.length?c=-1:l===a.length-1&&(c=a.length-2),n=o({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:c});break;case Rn:n={activeIndex:a.length-1};break;case Hn:n={selectedItems:a.slice(0,a.length-1)};break;case Vn:n={selectedItems:[].concat(a,[s])};break;case Fn:n={activeIndex:-1};break;case An:var d=l,p=a.indexOf(s);if(p<0)break;1===a.length?d=-1:p===a.length-1&&(d=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:d};break;case Nn:n={selectedItems:t.selectedItems};break;case Bn:n={activeIndex:t.activeIndex};break;case Ln:n={activeIndex:Cn(u,"activeIndex"),selectedItems:Cn(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return o({},e,n)}var jn=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Un=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Wn(e){void 0===e&&(e={}),Mn();var i=o({},On,e),r=i.getA11yRemovalMessage,u=i.itemToString,s=i.environment,l=i.keyNavigationNext,a=i.keyNavigationPrevious,c=et($n,function(e){return{activeIndex:Sn(e,"activeIndex"),selectedItems:Sn(e,"selectedItems")}}(i),i),d=c[0],p=c[1],f=d.activeIndex,g=d.selectedItems,h=t.useRef(!0),m=t.useRef(null),I=t.useRef(g),v=t.useRef();v.current=[];var y=Qe({state:d,props:i});t.useEffect((function(){if(!h.current){if(g.length<I.current.length){var e=I.current.find((function(e){return g.indexOf(e)<0}));He(r({itemToString:u,resultCount:g.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:g[f]}),s.document)}I.current=g}}),[g.length]),t.useEffect((function(){h.current||(-1===f&&m.current?m.current.focus():v.current[f]&&v.current[f].focus())}),[f]),ct({isInitialMount:h.current,props:i,state:d});var x=st();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var b=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:Tn})},e[l]=function(){p({type:Kn})},e.Delete=function(){p({type:En})},e.Backspace=function(){p({type:Pn})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){kn(e)&&p({type:Rn})},e.Backspace=function(e){kn(e)&&p({type:Hn})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,i=void 0===e?{}:e,r=i.refKey,u=void 0===r?"ref":r,s=i.ref,l=i.onClick,a=i.onKeyDown,c=i.selectedItem,d=i.index,f=n(i,jn),g=y.current.state,h=Ge(c,d,g.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],m=h>-1&&h===g.activeIndex;return o(((t={})[u]=be(s,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=xe(l,(function(){p({type:Dn,index:h})})),t.onKeyDown=xe(a,(function(e){var t=Ee(e);t&&b[t]&&b[t](e)})),t),f)}),[p,y,b]),getDropdownProps:t.useCallback((function(e,t){var i,r=void 0===e?{}:e,u=r.refKey,s=void 0===u?"ref":u,l=r.ref,a=r.onKeyDown,c=r.onClick,d=r.preventKeyAction,f=void 0!==d&&d,g=n(r,Un),h=(void 0===t?{}:t).suppressRefError;return x("getDropdownProps",void 0!==h&&h,s,m),o(((i={})[s]=be(l,(function(e){e&&(m.current=e)})),i),!f&&{onKeyDown:xe(a,(function(e){var t=Ee(e);t&&w[t]&&w[t](e)})),onClick:xe(c,(function(){p({type:Fn})}))},g)}),[p,w,x]),addSelectedItem:t.useCallback((function(e){p({type:Vn,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:An,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Nn,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Bn,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:Ln})}),[p]),selectedItems:g,activeIndex:f}}Wn.stateChangeTypes=_n,e.default=je,e.resetIdCounter=function(){ge=0},e.useCombobox=bn,e.useMultipleSelection=Wn,e.useSelect=$t,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=downshift.umd.min.js.map |
@@ -78,3 +78,3 @@ export let useControlPropsValidator: typeof noop; | ||
export function isAcceptedCharacterKey(key: any): boolean; | ||
export function getItemIndex(index: any, item: any, items: any): any; | ||
export function getItemAndIndex(itemProp: any, indexProp: any, items: any, errorMessage: any): any[]; | ||
export function useElementIds({ id, labelId, menuId, getItemId, toggleButtonId, inputId, }: { | ||
@@ -81,0 +81,0 @@ id?: string | undefined; |
{ | ||
"name": "downshift", | ||
"version": "7.3.2", | ||
"version": "7.3.3", | ||
"description": "🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.", | ||
@@ -5,0 +5,0 @@ "main": "dist/downshift.cjs.js", |
@@ -9,3 +9,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","preact","prop-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.preact,e.PropTypes)}(this,(function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(n);function r(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u.apply(this,arguments)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var a={},d=60103,c=60106,p=60107,f=60108,g=60114,h=60109,m=60110,I=60112,v=60113,y=60120,x=60115,b=60116,w=60121,S=60122,k=60117,C=60129,O=60131; | ||
* LICENSE file in the root directory of this source tree. | ||
*/if("function"==typeof Symbol&&Symbol.for){var M=Symbol.for;d=M("react.element"),c=M("react.portal"),p=M("react.fragment"),f=M("react.strict_mode"),g=M("react.profiler"),h=M("react.provider"),m=M("react.context"),I=M("react.forward_ref"),v=M("react.suspense"),y=M("react.suspense_list"),x=M("react.memo"),b=M("react.lazy"),w=M("react.block"),S=M("react.server.block"),k=M("react.fundamental"),C=M("react.debug_trace_mode"),O=M("react.legacy_hidden")}function D(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case d:switch(e=e.type){case p:case g:case f:case v:case y:return e;default:switch(e=e&&e.$$typeof){case m:case I:case b:case x:case h:return e;default:return t}}case c:return t}}}var E=h,K=d,P=I,T=p,R=b,H=x,F=c,V=g,N=f,A=v;a.ContextConsumer=m,a.ContextProvider=E,a.Element=K,a.ForwardRef=P,a.Fragment=T,a.Lazy=R,a.Memo=H,a.Portal=F,a.Profiler=V,a.StrictMode=N,a.Suspense=A,a.isAsyncMode=function(){return!1},a.isConcurrentMode=function(){return!1},a.isContextConsumer=function(e){return D(e)===m},a.isContextProvider=function(e){return D(e)===h},a.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===d},a.isForwardRef=function(e){return D(e)===I},a.isFragment=function(e){return D(e)===p},a.isLazy=function(e){return D(e)===b},a.isMemo=function(e){return D(e)===x},a.isPortal=function(e){return D(e)===c},a.isProfiler=function(e){return D(e)===g},a.isStrictMode=function(e){return D(e)===f},a.isSuspense=function(e){return D(e)===v},a.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===p||e===g||e===C||e===f||e===v||e===y||e===O||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===x||e.$$typeof===h||e.$$typeof===m||e.$$typeof===I||e.$$typeof===k||e.$$typeof===w||e[0]===S)},a.typeOf=D;let B=e=>"object"==typeof e&&null!=e&&1===e.nodeType,L=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,_=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return L(n.overflowY,t)||L(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},j=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,U=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var $=(e,t)=>{var n,i,o,r,u,s;if("undefined"==typeof document)return[];let{scrollMode:l,block:a,inline:d,boundary:c,skipOverflowHiddenElements:p}=t,f="function"==typeof c?c:e=>e!==c;if(!B(e))throw new TypeError("Invalid target");let g=document.scrollingElement||document.documentElement,h=[],m=e;for(;B(m)&&f(m);){if(m=U(m),m===g){h.push(m);break}null!=m&&m===document.body&&_(m)&&!_(document.documentElement)||null!=m&&_(m,p)&&h.push(m)}let I=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,v=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,y=null!=(u=window.scrollX)?u:pageXOffset,x=null!=(s=window.scrollY)?s:pageYOffset,{height:b,width:w,top:S,right:k,bottom:C,left:O}=e.getBoundingClientRect(),M="start"===a||"nearest"===a?S:"end"===a?C:S+b/2,D="center"===d?O+w/2:"end"===d?k:O,E=[];for(let e=0;e<h.length;e++){let t=h[e],{height:n,width:i,top:o,right:r,bottom:u,left:s}=t.getBoundingClientRect();if("if-needed"===l&&S>=0&&O>=0&&C<=v&&k<=I&&S>=o&&C<=u&&O>=s&&k<=r)return E;let c=getComputedStyle(t),p=parseInt(c.borderLeftWidth,10),f=parseInt(c.borderTopWidth,10),m=parseInt(c.borderRightWidth,10),K=parseInt(c.borderBottomWidth,10),P=0,T=0,R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-m:0,H="offsetHeight"in t?t.offsetHeight-t.clientHeight-f-K:0,F="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,V="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(g===t)P="start"===a?M:"end"===a?M-v:"nearest"===a?j(x,x+v,v,f,K,x+M,x+M+b,b):M-v/2,T="start"===d?D:"center"===d?D-I/2:"end"===d?D-I:j(y,y+I,I,p,m,y+D,y+D+w,w),P=Math.max(0,P+x),T=Math.max(0,T+y);else{P="start"===a?M-o-f:"end"===a?M-u+K+H:"nearest"===a?j(o,u,n,f,K+H,M,M+b,b):M-(o+n/2)+H/2,T="start"===d?D-s-p:"center"===d?D-(s+i/2)+R/2:"end"===d?D-r+m+R:j(s,r,i,p,m+R,D,D+w,w);let{scrollLeft:e,scrollTop:l}=t;P=Math.max(0,Math.min(l+P/V,t.scrollHeight-n/V+H)),T=Math.max(0,Math.min(e+T/F,t.scrollWidth-i/F+R)),M+=l-P,D+=e-T}E.push({el:t,top:P,left:T})}return E},W=0;function z(e){return"function"==typeof e?e:q}function q(){}function X(e,t){e&&$(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}function Y(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function G(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function Z(){return String(W++)}function ee(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function te(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var ne=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function ie(e){void 0===e&&(e={});var t={};return ne.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function oe(e,t){return Object.keys(e).reduce((function(n,i){return n[i]=re(t,i)?t[i]:e[i],n}),{})}function re(e,t){return void 0!==e[t]}function ue(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function se(e,t,n,i,o){if(void 0===o&&(o=!0),0===n)return-1;var r=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:r+1);var u=t+e;u<0?u=o?r:0:u>r&&(u=o?0:r);var s=le(e,u,n,i,o);return-1===s?t>=n?-1:t:s}function le(e,t,n,i,o){var r=i(t);if(!r||!r.hasAttribute("disabled"))return t;if(e>0){for(var u=t+1;u<n;u++)if(!i(u).hasAttribute("disabled"))return u}else for(var s=t-1;s>=0;s--)if(!i(s).hasAttribute("disabled"))return s;return o?e>0?le(1,0,n,i,!1):le(-1,n-1,n,i,!1):-1}function ae(e,t,n,i){return void 0===i&&(i=!0),t.some((function(t){return t&&(Y(t,e,n)||i&&Y(t,n.document.activeElement,n))}))}var de=G((function(e){pe(e).textContent=""}),500);function ce(e,t){var n=pe(t);e&&(n.textContent=e,de(t))}function pe(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var fe=0,ge=2,he=3,me=4,Ie=5,ve=6,ye=7,xe=8,be=9,we=10,Se=11,ke=12,Ce=13,Oe=14,Me=Object.freeze({__proto__:null,unknown:fe,mouseUp:1,itemMouseEnter:ge,keyDownArrowUp:he,keyDownArrowDown:me,keyDownEscape:Ie,keyDownEnter:ve,keyDownHome:ye,keyDownEnd:xe,clickItem:be,blurInput:we,changeInput:Se,keyDownSpaceButton:ke,clickButton:Ce,blurButton:Oe,controlledPropUpdatedSelectedItem:15,touchEnd:16}),De=["refKey","ref"],Ee=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],Ke=["onKeyDown","onBlur","onChange","onInput","onChangeText"],Pe=["refKey","ref"],Te=["onMouseMove","onMouseDown","onClick","onPress","index","item"],Re=function(){var e=function(e){var n,i;function o(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+Z(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=ie(t),n.internalSetState(u({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=ie(t),n.internalSetState(u({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,r={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,u({},n.getStateAndHelpers(),e)),n.setState((function(t){t=n.getState(t);var l=s?e(t):e;l=n.props.stateReducer(t,l),i=l.hasOwnProperty("selectedItem");var a={};return i&&l.selectedItem!==t.selectedItem&&(o=l.selectedItem),l.type=l.type||fe,Object.keys(l).forEach((function(e){t[e]!==l[e]&&(r[e]=l[e]),"type"!==e&&(l[e],re(n.props,e)||(a[e]=l[e]))})),s&&l.hasOwnProperty("inputValue")&&n.props.onInputValueChange(l.inputValue,u({},n.getStateAndHelpers(),l)),a}),(function(){z(t)(),Object.keys(r).length>1&&n.props.onStateChange(r,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(r,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,o=void 0===e?{}:e,s=o.refKey,l=void 0===s?"ref":s,a=o.ref,d=r(o,De),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return u(((i={})[l]=Q(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:null,i["aria-labelledby"]=n.labelId,i),d)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:me})}else this.internalSetState({isOpen:!0,type:me},(function(){var e=t.getItemCount();if(e>0){var n=se(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:me})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:he})}else this.internalSetState({isOpen:!0,type:he},(function(){var e=t.getItemCount();if(e>0){var n=se(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:he})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:ve})}}},Escape:function(e){e.preventDefault(),this.reset(u({type:Ie},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=u({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:ke})}}),n.inputKeyDownHandlers=u({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var i=this.getItemCount();if(!(i<=0)&&n){var o=le(1,0,i,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:ye})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var i=this.getItemCount();if(!(i<=0)&&n){var o=le(-1,i-1,i,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:xe})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var o=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=r(t,Ee),d=n.getState().isOpen,c={onClick:J(i,n.buttonHandleClick),onKeyDown:J(o,n.buttonHandleKeyDown),onKeyUp:J(s,n.buttonHandleKeyUp),onBlur:J(l,n.buttonHandleBlur)};return u({type:"button",role:"button","aria-label":d?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:c,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=ue(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(s(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:Ce})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:Oe})}))},n.getLabelProps=function(e){return u({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,o=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=r(t,Ke),d={};var c,p=n.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;a.disabled||((c={}).onInput=J(s,l,n.inputHandleChange),c.onKeyDown=J(i,n.inputHandleKeyDown),c.onBlur=J(o,n.inputHandleBlur),d=c);return u({"aria-autocomplete":"list","aria-activedescendant":g&&"number"==typeof h&&h>=0?n.getItemId(h):null,"aria-controls":g?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:f,id:n.inputId},d,a)},n.inputHandleKeyDown=function(e){var t=ue(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(s(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:Se,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:we})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,o=void 0===e?{}:e,s=o.refKey,l=void 0===s?"ref":s,a=o.ref,d=r(o,Pe),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,u(((i={})[l]=Q(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=d&&d["aria-label"]?null:n.labelId,i.id=n.menuId,i),d)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,o=i.onMouseMove,s=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,d=i.item,c=void 0===d?void 0:d,p=r(i,Te);void 0===a?(n.items.push(c),a=n.items.indexOf(c)):n.items[a]=c;var f=l,g=((t={onMouseMove:J(o,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:ge}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:J(s,(function(e){e.preventDefault()}))}).onClick=J(f,(function(){n.selectItemAtIndex(a,{type:be})})),t),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return u({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},h,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=ie(e),n.internalSetState((function(t){var i=t.selectedItem;return u({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=ie(e),n.internalSetState((function(t){var i=t.isOpen;return u({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),z(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=G((function(){var e=n.getState(),t=n.items[e.highlightedIndex],i=n.getItemCount(),o=n.props.getA11yStatusMessage(u({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:i,highlightedItem:t},e));n.previousResultCount=i,ce(o,n.props.environment.document)}),200);var i=n.props,o=i.defaultHighlightedIndex,l=i.initialHighlightedIndex,a=void 0===l?o:l,d=i.defaultIsOpen,c=i.initialIsOpen,p=void 0===c?d:c,f=i.initialInputValue,g=void 0===f?"":f,h=i.initialSelectedItem,m=void 0===h?null:h,I=n.getState({highlightedIndex:a,isOpen:p,inputValue:g,selectedItem:m});return null!=I.selectedItem&&void 0===n.props.initialInputValue&&(I.inputValue=n.props.itemToString(I.selectedItem)),n.state=I,n}i=e,(n=o).prototype=Object.create(i.prototype),n.prototype.constructor=n,l(n,i);var a=o.prototype;return a.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},a.getState=function(e){return void 0===e&&(e=this.state),oe(e,this.props)},a.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},a.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},a.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},a.moveHighlightedIndex=function(e,t){var n=this,i=this.getItemCount(),o=this.getState().highlightedIndex;if(i>0){var r=se(e,o,i,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(r,t)}},a.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,d=this.getMenuProps,c=this.getInputProps,p=this.getItemProps,f=this.openMenu,g=this.closeMenu,h=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,x=this.clearSelection,b=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:d,getInputProps:c,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:g,toggleMenu:h,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:x,clearItems:b,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},a.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!ae(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=ae(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}},a.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},a.componentDidUpdate=function(e,t){re(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},a.componentWillUnmount=function(){this.cleanup()},a.render=function(){var e=te(this.props.children,q);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=te(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type||"string"==typeof e.nodeName}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props||e.attributes}(n))):void 0:null},o}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:ee,itemToString:function(e){return null==e?"":String(e)},onStateChange:q,onInputValueChange:q,onUserAction:q,onChange:q,onSelect:q,onOuterClick:q,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:X},e.stateChangeTypes=Me,e}(),He=Re,Fe=["isInitialMount","highlightedIndex","items","environment"],Ve={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function Ne(e,t,n){var i=e.props,o=e.type,r={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,r=t.type,s="on"+je(e)+"Change";o[s]&&void 0!==i[e]&&i[e]!==n[e]&&o[s](u({type:r},i))}(i,e,t,n),n[i]!==t[i]&&(r[i]=n[i])})),i.onStateChange&&Object.keys(r).length&&i.onStateChange(u({type:o},r))}var Ae=G((function(e,t){ce(e(),t)}),200),Be="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function Le(e){var n=e.id,i=void 0===n?"downshift-"+Z():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current}function _e(e,t,n){return void 0!==e?e:0===n.length?-1:n.indexOf(t)}function je(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Ue(e){var n=t.useRef(e);return n.current=e,n}function $e(e,n,i){var o=t.useRef(),r=t.useRef(),s=t.useCallback((function(t,n){r.current=n,t=oe(t,n.props);var i=e(t,n);return n.props.stateReducer(t,u({},n,{changes:i}))}),[e]),l=t.useReducer(s,n),a=l[0],d=l[1],c=Ue(i),p=t.useCallback((function(e){return d(u({props:c.current},e))}),[c]),f=r.current;return t.useEffect((function(){f&&o.current&&o.current!==a&&Ne(f,oe(o.current,f.props),a),o.current=a}),[a,i,f]),[a,p]}function We(e,t,n){var i=$e(e,t,n),o=i[0],r=i[1];return[oe(o,n),r]}var ze={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:X,environment:"undefined"==typeof window?{}:window};function qe(e,t,n){void 0===n&&(n=Ve);var i=e["default"+je(t)];return void 0!==i?i:n[t]}function Xe(e,t,n){void 0===n&&(n=Ve);var i=e[t];if(void 0!==i)return i;var o=e["initial"+je(t)];return void 0!==o?o:qe(e,t,n)}function Ye(e){var t=Xe(e,"selectedItem"),n=Xe(e,"isOpen"),i=Xe(e,"highlightedIndex"),o=Xe(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.indexOf(t):i,isOpen:n,selectedItem:t,inputValue:o}}function Ge(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===i.length?-1:void 0!==o&&s===o?o:void 0!==r?r:u?i.indexOf(u):0===n?-1:n<0?i.length-1:0}function Je(e,n,i,o){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(null!=(null==i?void 0:i.addEventListener)){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!ae(t.target,n.map((function(e){return e.current})),i)&&o()},s=function(){r.current.isTouchMove=!1},l=function(){r.current.isTouchMove=!0},a=function(t){!e||r.current.isTouchMove||ae(t.target,n.map((function(e){return e.current})),i,!1)||o()};return i.addEventListener("mousedown",t),i.addEventListener("mouseup",u),i.addEventListener("touchstart",s),i.addEventListener("touchmove",l),i.addEventListener("touchend",a),function(){i.removeEventListener("mousedown",t),i.removeEventListener("mouseup",u),i.removeEventListener("touchstart",s),i.removeEventListener("touchmove",l),i.removeEventListener("touchend",a)}}}),[e,i]),r}var Qe=function(){return q};function Ze(e,n,i){var o=i.isInitialMount,s=i.highlightedIndex,l=i.items,a=i.environment,d=r(i,Fe);t.useEffect((function(){o||Ae((function(){return e(u({highlightedIndex:s,highlightedItem:l[s],resultCount:l.length},d))}),a.document)}),n)}function et(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return Be((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var tt=q;function nt(e,t,n){var i,o=t.type,r=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ge(r,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:Ge(r,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:qe(r,"highlightedIndex"),isOpen:qe(r,"isOpen"),selectedItem:qe(r,"selectedItem"),inputValue:qe(r,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return u({},e,i)}var it=function(){return it=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},it.apply(this,arguments)};o.default.array.isRequired,o.default.func,o.default.func,o.default.func,o.default.number,o.default.number,o.default.number,o.default.bool,o.default.bool,o.default.bool,o.default.any,o.default.any,o.default.any,o.default.string,o.default.string,o.default.string,o.default.func,o.default.string,o.default.func,o.default.func,o.default.func,o.default.func,o.default.func,o.default.shape({addEventListener:o.default.func,removeEventListener:o.default.func,document:o.default.shape({getElementById:o.default.func,activeElement:o.default.any,body:o.default.any})});var ot=it(it({},ze),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}}),rt=q,ut=0,st=1,lt=2,at=3,dt=4,ct=5,pt=6,ft=7,gt=8,ht=9,mt=10,It=11,vt=12,yt=13,xt=14,bt=15,wt=16,St=17,kt=18,Ct=19,Ot=20,Mt=21,Dt=Object.freeze({__proto__:null,ToggleButtonClick:ut,ToggleButtonKeyDownArrowDown:st,ToggleButtonKeyDownArrowUp:lt,ToggleButtonKeyDownCharacter:at,ToggleButtonKeyDownEscape:dt,ToggleButtonKeyDownHome:ct,ToggleButtonKeyDownEnd:pt,ToggleButtonKeyDownEnter:ft,ToggleButtonKeyDownSpaceButton:gt,ToggleButtonKeyDownPageUp:ht,ToggleButtonKeyDownPageDown:mt,ToggleButtonBlur:It,MenuMouseLeave:vt,ItemMouseMove:yt,ItemClick:xt,FunctionToggleMenu:bt,FunctionOpenMenu:wt,FunctionCloseMenu:St,FunctionSetHighlightedIndex:kt,FunctionSelectItem:Ct,FunctionSetInputValue:Ot,FunctionReset:Mt});function Et(e,t){var n,i=t.type,o=t.props,r=t.altKey;switch(i){case xt:n={isOpen:qe(o,"isOpen"),highlightedIndex:qe(o,"highlightedIndex"),selectedItem:o.items[t.index]};break;case at:var s=t.key,l=""+e.inputValue+s,a=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.getItemNodeFromIndex,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)){var d=r(l);if(!(null==d?void 0:d.hasAttribute("disabled")))return l}}return n}({keysSoFar:l,highlightedIndex:!e.isOpen&&e.selectedItem?o.items.indexOf(e.selectedItem):e.highlightedIndex,items:o.items,itemToString:o.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});n={inputValue:l,highlightedIndex:a,isOpen:!0};break;case st:n={highlightedIndex:e.isOpen?se(1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1):r&&null==e.selectedItem?-1:Ge(o,e,1),isOpen:!0};break;case lt:if(e.isOpen&&r)n=u({isOpen:qe(o,"isOpen"),highlightedIndex:qe(o,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex]});else n={highlightedIndex:e.isOpen?se(-1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1):Ge(o,e,-1),isOpen:!0};break;case ft:case gt:n=u({isOpen:qe(o,"isOpen"),highlightedIndex:qe(o,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex]});break;case ct:n={highlightedIndex:le(1,0,o.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case pt:n={highlightedIndex:le(-1,o.items.length-1,o.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case ht:n={highlightedIndex:se(-10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case mt:n={highlightedIndex:se(10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case dt:n={isOpen:!1,highlightedIndex:-1};break;case It:n=u({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex]});break;case Ct:n={selectedItem:t.selectedItem};break;default:return nt(e,t,Dt)}return u({},e,n)}var Kt=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],Pt=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Tt=["item","index","onMouseMove","onClick","onPress","refKey","ref","disabled"];function Rt(e){void 0===e&&(e={}),rt();var n=u({},ot,e),i=n.items,o=n.scrollIntoView,s=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,d=n.getA11yStatusMessage,c=We(Et,Ye(n),n),p=c[0],f=c[1],g=p.isOpen,h=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef(null),x=t.useRef({}),b=t.useRef(null),w=Le(n),S=t.useRef(),k=t.useRef(!0),C=Ue({state:p,props:n}),O=t.useCallback((function(e){return x.current[w.getItemId(e)]}),[w]);Ze(d,[g,h,I,i],u({isInitialMount:k.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p)),Ze(a,[m],u({isInitialMount:k.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p));var M=et({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:x,scrollIntoView:o,getItemNodeFromIndex:O});t.useEffect((function(){return b.current=G((function(e){e({type:Ot,inputValue:""})}),500),function(){b.current.cancel()}}),[]),t.useEffect((function(){I&&b.current(f)}),[f,I]),tt({isInitialMount:k.current,props:n,state:p}),t.useEffect((function(){k.current||(S.current=i.length)}));var D=Je(g,[y,v],s,(function(){f({type:It})})),E=Qe();t.useEffect((function(){return k.current=!1,function(){k.current=!0}}),[]),t.useEffect((function(){g||(x.current={})}),[g]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:st,getItemNodeFromIndex:O,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:lt,getItemNodeFromIndex:O,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:ct,getItemNodeFromIndex:O})},End:function(e){e.preventDefault(),f({type:pt,getItemNodeFromIndex:O})},Escape:function(){C.current.state.isOpen&&f({type:dt})},Enter:function(e){e.preventDefault(),f({type:C.current.state.isOpen?ft:ut})},PageUp:function(e){C.current.state.isOpen&&(e.preventDefault(),f({type:ht,getItemNodeFromIndex:O}))},PageDown:function(e){C.current.state.isOpen&&(e.preventDefault(),f({type:mt,getItemNodeFromIndex:O}))}," ":function(e){e.preventDefault();var t=C.current.state;t.isOpen?t.inputValue?f({type:at,key:" ",getItemNodeFromIndex:O}):f({type:gt}):f({type:ut})}}}),[f,O,C]),P=t.useCallback((function(){f({type:bt})}),[f]),T=t.useCallback((function(){f({type:St})}),[f]),R=t.useCallback((function(){f({type:wt})}),[f]),H=t.useCallback((function(e){f({type:kt,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:Ct,selectedItem:e})}),[f]),V=t.useCallback((function(){f({type:Mt})}),[f]),N=t.useCallback((function(e){f({type:Ot,inputValue:e})}),[f]),A=t.useCallback((function(e){return u({id:w.labelId,htmlFor:w.toggleButtonId},e)}),[w]),B=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s;i.onKeyDown,i.onBlur;var a=i.ref,d=r(i,Kt),c=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==c&&c,l,y),u(((n={})[l]=Q(a,(function(e){y.current=e})),n.id=w.menuId,n.role="listbox",n["aria-labelledby"]=w.labelId,n.tabIndex=-1,n.onMouseLeave=J(o,(function(){f({type:vt})})),n),d)}),[f,E,w]);return{getToggleButtonProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onBlur,s=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,d=void 0===a?"ref":a,c=i.ref,p=r(i,Pt),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=C.current.state,I=u(((n={})[d]=Q(c,(function(e){v.current=e})),n["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?w.getItemId(m.highlightedIndex):"",n["aria-controls"]=w.menuId,n["aria-expanded"]=C.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=""+w.labelId,n.id=w.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=J(o,(function(){m.isOpen&&!D.current.isMouseDown&&f({type:It})})),n),p);return p.disabled||(I.onClick=J(s,(function(){f({type:ut})})),I.onKeyDown=J(l,(function(e){var t=ue(e);t&&K[t]?K[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:at,key:t,getItemNodeFromIndex:O})}))),E("getToggleButtonProps",h,d,v),I}),[C,w,E,f,D,K,O]),getLabelProps:A,getMenuProps:B,getItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,o=n.item,s=n.index,l=n.onMouseMove,a=n.onClick;n.onPress;var d=n.refKey,c=void 0===d?"ref":d,p=n.ref,g=n.disabled,h=r(n,Tt),I=C.current,v=I.state,y=I.props,b=null!=o?o:i[s],S=_e(s,b,y.items),k=_e(S,b,y.items);if(k<0)throw new Error("Pass either item or item index in getItemProps!");var O=u(((t={disabled:g,role:"option","aria-selected":""+(b===m),id:w.getItemId(k)})[c]=Q(p,(function(e){e&&(x.current[w.getItemId(k)]=e)})),t),h);return g||(O.onClick=J(a,(function(){f({type:xt,index:S})}))),O.onMouseMove=J(l,(function(){S!==v.highlightedIndex&&(M.current=!1,f({type:yt,index:S,disabled:g}))})),O}),[C,i,m,w,M,f]),toggleMenu:P,openMenu:R,closeMenu:T,setHighlightedIndex:H,selectItem:F,reset:V,setInputValue:N,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}Rt.stateChangeTypes=Dt;var Ht=0,Ft=1,Vt=2,Nt=3,At=4,Bt=5,Lt=6,_t=7,jt=8,Ut=9,$t=10,Wt=11,zt=12,qt=13,Xt=14,Yt=15,Gt=16,Jt=17,Qt=18,Zt=19,en=20,tn=21,nn=22,on=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ht,InputKeyDownArrowUp:Ft,InputKeyDownEscape:Vt,InputKeyDownHome:Nt,InputKeyDownEnd:At,InputKeyDownPageUp:Bt,InputKeyDownPageDown:Lt,InputKeyDownEnter:_t,InputChange:jt,InputBlur:Ut,InputFocus:$t,MenuMouseLeave:Wt,ItemMouseMove:zt,ItemClick:qt,ToggleButtonClick:Xt,FunctionToggleMenu:Yt,FunctionOpenMenu:Gt,FunctionCloseMenu:Jt,FunctionSetHighlightedIndex:Qt,FunctionSelectItem:Zt,FunctionSetInputValue:en,FunctionReset:tn,ControlledPropUpdatedSelectedItem:nn});o.default.array.isRequired,o.default.func,o.default.func,o.default.func,o.default.number,o.default.number,o.default.number,o.default.bool,o.default.bool,o.default.bool,o.default.any,o.default.any,o.default.any,o.default.string,o.default.string,o.default.string,o.default.string,o.default.string,o.default.string,o.default.func,o.default.string,o.default.string,o.default.func,o.default.func,o.default.func,o.default.func,o.default.func,o.default.func,o.default.shape({addEventListener:o.default.func,removeEventListener:o.default.func,document:o.default.shape({getElementById:o.default.func,activeElement:o.default.any,body:o.default.any})});var rn=q,un=u({},ze,{getA11yStatusMessage:ee});function sn(e,t){var n,i=t.type,o=t.props,r=t.altKey;switch(i){case qt:n={isOpen:qe(o,"isOpen"),highlightedIndex:qe(o,"highlightedIndex"),selectedItem:o.items[t.index],inputValue:o.itemToString(o.items[t.index])};break;case Ht:n=e.isOpen?{highlightedIndex:se(1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:r&&null==e.selectedItem?-1:Ge(o,e,1,t.getItemNodeFromIndex),isOpen:o.items.length>=0};break;case Ft:n=e.isOpen?r?u({isOpen:qe(o,"isOpen"),highlightedIndex:qe(o,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex],inputValue:o.itemToString(o.items[e.highlightedIndex])}):{highlightedIndex:se(-1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:Ge(o,e,-1,t.getItemNodeFromIndex),isOpen:o.items.length>=0};break;case _t:n=u({isOpen:qe(o,"isOpen"),highlightedIndex:qe(o,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex],inputValue:o.itemToString(o.items[e.highlightedIndex])});break;case Vt:n=u({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Bt:n={highlightedIndex:se(-10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case Lt:n={highlightedIndex:se(10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case Nt:n={highlightedIndex:le(1,0,o.items.length,t.getItemNodeFromIndex,!1)};break;case At:n={highlightedIndex:le(-1,o.items.length-1,o.items.length,t.getItemNodeFromIndex,!1)};break;case Ut:n=u({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:o.items[e.highlightedIndex],inputValue:o.itemToString(o.items[e.highlightedIndex])});break;case jt:n={isOpen:!0,highlightedIndex:qe(o,"highlightedIndex"),inputValue:t.inputValue};break;case $t:n={isOpen:!0,highlightedIndex:Ge(o,e,0)};break;case Zt:n={selectedItem:t.selectedItem,inputValue:o.itemToString(t.selectedItem)};break;case nn:n={inputValue:t.inputValue};break;default:return nt(e,t,on)}return u({},e,n)}var ln=["onMouseLeave","refKey","ref"],an=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],dn=["onClick","onPress","refKey","ref"],cn=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function pn(e){void 0===e&&(e={}),rn();var n=u({},un,e),i=n.initialIsOpen,o=n.defaultIsOpen,s=n.items,l=n.scrollIntoView,a=n.environment,d=n.getA11yStatusMessage,c=n.getA11ySelectionMessage,p=n.itemToString,f=function(e){var t=Ye(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),u({},t,{inputValue:i})}(n),g=function(e,n,i){var o=t.useRef(),r=$e(e,n,i),u=r[0],s=r[1];return t.useEffect((function(){re(i,"selectedItem")&&(o.current!==i.selectedItem&&s({type:nn,inputValue:i.itemToString(i.selectedItem)}),o.current=u.selectedItem===o.current?i.selectedItem:u.selectedItem)}),[i.selectedItem,u.selectedItem]),[oe(u,i),s]}(sn,f,n),h=g[0],m=g[1],I=h.isOpen,v=h.highlightedIndex,y=h.selectedItem,x=h.inputValue,b=t.useRef(null),w=t.useRef({}),S=t.useRef(null),k=t.useRef(null),C=t.useRef(!0),O=Le(n),M=t.useRef(),D=Ue({state:h,props:n}),E=t.useCallback((function(e){return w.current[O.getItemId(e)]}),[O]);Ze(d,[I,v,x,s],u({isInitialMount:C.current,previousResultCount:M.current,items:s,environment:a,itemToString:p},h)),Ze(c,[y],u({isInitialMount:C.current,previousResultCount:M.current,items:s,environment:a,itemToString:p},h));var K=et({menuElement:b.current,highlightedIndex:v,isOpen:I,itemRefs:w,scrollIntoView:l,getItemNodeFromIndex:E});tt({isInitialMount:C.current,props:n,state:h}),t.useEffect((function(){(i||o||I)&&S.current&&S.current.focus()}),[]),t.useEffect((function(){C.current||(M.current=s.length)}));var P=Je(I,[S,b,k],a,(function(){m({type:Ut,selectItem:!1})})),T=Qe();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){var e;if(I){if((null==(e=a.document)?void 0:e.activeElement)!==S.current){var t;null==S||null==(t=S.current)||t.focus()}}else w.current={}}),[I,a]);var R=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),m({type:Ht,altKey:e.altKey,getItemNodeFromIndex:E})},ArrowUp:function(e){e.preventDefault(),m({type:Ft,altKey:e.altKey,getItemNodeFromIndex:E})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Nt,getItemNodeFromIndex:E}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:At,getItemNodeFromIndex:E}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),m({type:Vt}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),m({type:_t,getItemNodeFromIndex:E}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Bt,getItemNodeFromIndex:E}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Lt,getItemNodeFromIndex:E}))}}}),[m,D,E]),H=t.useCallback((function(e){return u({id:O.labelId,htmlFor:O.inputId},e)}),[O]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,d=r(i,ln),c=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==c&&c,l,b),u(((n={})[l]=Q(a,(function(e){b.current=e})),n.id=O.menuId,n.role="listbox",n["aria-labelledby"]=O.labelId,n.onMouseLeave=J(o,(function(){m({type:Wt})})),n),d)}),[m,T,O]),V=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,o=i.item,s=i.index,l=i.refKey,a=void 0===l?"ref":l,d=i.ref,c=i.onMouseMove,p=i.onMouseDown,f=i.onClick;i.onPress;var g=i.disabled,h=r(i,an),I=D.current,v=I.props,y=I.state,x=_e(s,o,v.items);if(x<0)throw new Error("Pass either item or item index in getItemProps!");var b=f;return u(((t={})[a]=Q(d,(function(e){e&&(w.current[O.getItemId(x)]=e)})),t.disabled=g,t.role="option",t["aria-selected"]=""+(x===y.highlightedIndex),t.id=O.getItemId(x),t),!g&&((n={}).onClick=J(b,(function(){m({type:qt,index:s})})),n),{onMouseMove:J(c,(function(){s!==y.highlightedIndex&&(K.current=!1,m({type:zt,index:s,disabled:g}))})),onMouseDown:J(p,(function(e){return e.preventDefault()}))},h)}),[m,D,K,O]),N=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var o=n.refKey,s=void 0===o?"ref":o,l=n.ref,a=r(n,dn),d=D.current.state;return u(((t={})[s]=Q(l,(function(e){k.current=e})),t["aria-controls"]=O.menuId,t["aria-expanded"]=d.isOpen,t.id=O.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&u({},{onClick:J(i,(function(){m({type:Xt})}))}),a)}),[m,D,O]),A=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onKeyDown,s=i.onChange,l=i.onInput,a=i.onFocus,d=i.onBlur;i.onChangeText;var c=i.refKey,p=void 0===c?"ref":c,f=i.ref,g=r(i,cn),h=(void 0===t?{}:t).suppressRefError;T("getInputProps",void 0!==h&&h,p,S);var I,v=D.current.state,y={};g.disabled||((I={}).onInput=J(s,l,(function(e){m({type:jt,inputValue:e.target.value})})),I.onKeyDown=J(o,(function(e){var t=ue(e);t&&R[t]&&R[t](e)})),I.onBlur=J(d,(function(){v.isOpen&&!P.current.isMouseDown&&m({type:Ut,selectItem:!0})})),I.onFocus=J(a,(function(){v.isOpen||m({type:$t})})),y=I);return u(((n={})[p]=Q(f,(function(e){S.current=e})),n["aria-activedescendant"]=v.isOpen&&v.highlightedIndex>-1?O.getItemId(v.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=O.menuId,n["aria-expanded"]=v.isOpen,n["aria-labelledby"]=O.labelId,n.autoComplete="off",n.id=O.inputId,n.role="combobox",n.value=v.inputValue,n),y,g)}),[m,R,D,P,T,O]),B=t.useCallback((function(){m({type:Yt})}),[m]),L=t.useCallback((function(){m({type:Jt})}),[m]),_=t.useCallback((function(){m({type:Gt})}),[m]),j=t.useCallback((function(e){m({type:Qt,highlightedIndex:e})}),[m]),U=t.useCallback((function(e){m({type:Zt,selectedItem:e})}),[m]);return{getItemProps:V,getLabelProps:H,getMenuProps:F,getInputProps:A,getToggleButtonProps:N,toggleMenu:B,openMenu:_,closeMenu:L,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){m({type:en,inputValue:e})}),[m]),selectItem:U,reset:t.useCallback((function(){m({type:tn})}),[m]),highlightedIndex:v,isOpen:I,selectedItem:y,inputValue:x}}pn.stateChangeTypes=on;var fn={activeIndex:-1,selectedItems:[]};function gn(e,t){return Xe(e,t,fn)}function hn(e,t){return qe(e,t,fn)}function mn(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}o.default.array,o.default.array,o.default.array,o.default.func,o.default.func,o.default.func,o.default.number,o.default.number,o.default.number,o.default.func,o.default.func,o.default.string,o.default.string,o.default.shape({addEventListener:o.default.func,removeEventListener:o.default.func,document:o.default.shape({getElementById:o.default.func,activeElement:o.default.any,body:o.default.any})});var In={itemToString:ze.itemToString,stateReducer:ze.stateReducer,environment:ze.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},vn=q,yn=0,xn=1,bn=2,wn=3,Sn=4,kn=5,Cn=6,On=7,Mn=8,Dn=9,En=10,Kn=11,Pn=12,Tn=Object.freeze({__proto__:null,SelectedItemClick:yn,SelectedItemKeyDownDelete:xn,SelectedItemKeyDownBackspace:bn,SelectedItemKeyDownNavigationNext:wn,SelectedItemKeyDownNavigationPrevious:Sn,DropdownKeyDownNavigationPrevious:kn,DropdownKeyDownBackspace:Cn,DropdownClick:On,FunctionAddSelectedItem:Mn,FunctionRemoveSelectedItem:Dn,FunctionSetSelectedItems:En,FunctionSetActiveIndex:Kn,FunctionReset:Pn});function Rn(e,t){var n,i=t.type,o=t.index,r=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case yn:n={activeIndex:o};break;case Sn:n={activeIndex:l-1<0?0:l-1};break;case wn:n={activeIndex:l+1>=a.length?-1:l+1};break;case bn:case xn:if(l<0)break;var d=l;1===a.length?d=-1:l===a.length-1&&(d=a.length-2),n=u({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:d});break;case kn:n={activeIndex:a.length-1};break;case Cn:n={selectedItems:a.slice(0,a.length-1)};break;case Mn:n={selectedItems:[].concat(a,[s])};break;case On:n={activeIndex:-1};break;case Dn:var c=l,p=a.indexOf(s);if(p<0)break;1===a.length?c=-1:p===a.length-1&&(c=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:c};break;case En:n={selectedItems:t.selectedItems};break;case Kn:n={activeIndex:t.activeIndex};break;case Pn:n={activeIndex:hn(r,"activeIndex"),selectedItems:hn(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return u({},e,n)}var Hn=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Fn=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Vn(e){void 0===e&&(e={}),vn();var n=u({},In,e),i=n.getA11yRemovalMessage,o=n.itemToString,s=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,d=We(Rn,function(e){return{activeIndex:gn(e,"activeIndex"),selectedItems:gn(e,"selectedItems")}}(n),n),c=d[0],p=d[1],f=c.activeIndex,g=c.selectedItems,h=t.useRef(!0),m=t.useRef(null),I=t.useRef(g),v=t.useRef();v.current=[];var y=Ue({state:c,props:n});t.useEffect((function(){if(!h.current){if(g.length<I.current.length){var e=I.current.find((function(e){return g.indexOf(e)<0}));ce(i({itemToString:o,resultCount:g.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:g[f]}),s.document)}I.current=g}}),[g.length]),t.useEffect((function(){h.current||(-1===f&&m.current?m.current.focus():v.current[f]&&v.current[f].focus())}),[f]),tt({isInitialMount:h.current,props:n,state:c});var x=Qe();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var b=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:Sn})},e[l]=function(){p({type:wn})},e.Delete=function(){p({type:xn})},e.Backspace=function(){p({type:bn})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){mn(e)&&p({type:kn})},e.Backspace=function(e){mn(e)&&p({type:Cn})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,o=void 0===i?"ref":i,s=n.ref,l=n.onClick,a=n.onKeyDown,d=n.selectedItem,c=n.index,f=r(n,Hn),g=y.current.state;if(_e(c,d,g.selectedItems)<0)throw new Error("Pass either selectedItem or index in getSelectedItemProps!");return u(((t={})[o]=Q(s,(function(e){e&&v.current.push(e)})),t.tabIndex=c===g.activeIndex?0:-1,t.onClick=J(l,(function(){p({type:yn,index:c})})),t.onKeyDown=J(a,(function(e){var t=ue(e);t&&b[t]&&b[t](e)})),t),f)}),[p,y,b]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.refKey,s=void 0===o?"ref":o,l=i.ref,a=i.onKeyDown,d=i.onClick,c=i.preventKeyAction,f=void 0!==c&&c,g=r(i,Fn),h=(void 0===t?{}:t).suppressRefError;return x("getDropdownProps",void 0!==h&&h,s,m),u(((n={})[s]=Q(l,(function(e){e&&(m.current=e)})),n),!f&&{onKeyDown:J(a,(function(e){var t=ue(e);t&&w[t]&&w[t](e)})),onClick:J(d,(function(){p({type:On})}))},g)}),[p,w,x]),addSelectedItem:t.useCallback((function(e){p({type:Mn,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Dn,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:En,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Kn,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:Pn})}),[p]),selectedItems:g,activeIndex:f}}Vn.stateChangeTypes=Tn,e.default=He,e.resetIdCounter=function(){W=0},e.useCombobox=pn,e.useMultipleSelection=Vn,e.useSelect=Rt,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
*/if("function"==typeof Symbol&&Symbol.for){var M=Symbol.for;d=M("react.element"),c=M("react.portal"),p=M("react.fragment"),f=M("react.strict_mode"),g=M("react.profiler"),h=M("react.provider"),m=M("react.context"),I=M("react.forward_ref"),v=M("react.suspense"),y=M("react.suspense_list"),x=M("react.memo"),b=M("react.lazy"),w=M("react.block"),S=M("react.server.block"),k=M("react.fundamental"),C=M("react.debug_trace_mode"),O=M("react.legacy_hidden")}function D(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case d:switch(e=e.type){case p:case g:case f:case v:case y:return e;default:switch(e=e&&e.$$typeof){case m:case I:case b:case x:case h:return e;default:return t}}case c:return t}}}var E=h,K=d,P=I,T=p,R=b,H=x,F=c,V=g,N=f,A=v;a.ContextConsumer=m,a.ContextProvider=E,a.Element=K,a.ForwardRef=P,a.Fragment=T,a.Lazy=R,a.Memo=H,a.Portal=F,a.Profiler=V,a.StrictMode=N,a.Suspense=A,a.isAsyncMode=function(){return!1},a.isConcurrentMode=function(){return!1},a.isContextConsumer=function(e){return D(e)===m},a.isContextProvider=function(e){return D(e)===h},a.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===d},a.isForwardRef=function(e){return D(e)===I},a.isFragment=function(e){return D(e)===p},a.isLazy=function(e){return D(e)===b},a.isMemo=function(e){return D(e)===x},a.isPortal=function(e){return D(e)===c},a.isProfiler=function(e){return D(e)===g},a.isStrictMode=function(e){return D(e)===f},a.isSuspense=function(e){return D(e)===v},a.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===p||e===g||e===C||e===f||e===v||e===y||e===O||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===x||e.$$typeof===h||e.$$typeof===m||e.$$typeof===I||e.$$typeof===k||e.$$typeof===w||e[0]===S)},a.typeOf=D;let B=e=>"object"==typeof e&&null!=e&&1===e.nodeType,L=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,_=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return L(n.overflowY,t)||L(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},j=(e,t,n,i,o,r,u,s)=>r<e&&u>t||r>e&&u<t?0:r<=e&&s<=n||u>=t&&s>=n?r-e-i:u>t&&s<n||r<e&&s>n?u-t+o:0,U=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var $=(e,t)=>{var n,i,o,r,u,s;if("undefined"==typeof document)return[];let{scrollMode:l,block:a,inline:d,boundary:c,skipOverflowHiddenElements:p}=t,f="function"==typeof c?c:e=>e!==c;if(!B(e))throw new TypeError("Invalid target");let g=document.scrollingElement||document.documentElement,h=[],m=e;for(;B(m)&&f(m);){if(m=U(m),m===g){h.push(m);break}null!=m&&m===document.body&&_(m)&&!_(document.documentElement)||null!=m&&_(m,p)&&h.push(m)}let I=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,v=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,y=null!=(u=window.scrollX)?u:pageXOffset,x=null!=(s=window.scrollY)?s:pageYOffset,{height:b,width:w,top:S,right:k,bottom:C,left:O}=e.getBoundingClientRect(),M="start"===a||"nearest"===a?S:"end"===a?C:S+b/2,D="center"===d?O+w/2:"end"===d?k:O,E=[];for(let e=0;e<h.length;e++){let t=h[e],{height:n,width:i,top:o,right:r,bottom:u,left:s}=t.getBoundingClientRect();if("if-needed"===l&&S>=0&&O>=0&&C<=v&&k<=I&&S>=o&&C<=u&&O>=s&&k<=r)return E;let c=getComputedStyle(t),p=parseInt(c.borderLeftWidth,10),f=parseInt(c.borderTopWidth,10),m=parseInt(c.borderRightWidth,10),K=parseInt(c.borderBottomWidth,10),P=0,T=0,R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-m:0,H="offsetHeight"in t?t.offsetHeight-t.clientHeight-f-K:0,F="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,V="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(g===t)P="start"===a?M:"end"===a?M-v:"nearest"===a?j(x,x+v,v,f,K,x+M,x+M+b,b):M-v/2,T="start"===d?D:"center"===d?D-I/2:"end"===d?D-I:j(y,y+I,I,p,m,y+D,y+D+w,w),P=Math.max(0,P+x),T=Math.max(0,T+y);else{P="start"===a?M-o-f:"end"===a?M-u+K+H:"nearest"===a?j(o,u,n,f,K+H,M,M+b,b):M-(o+n/2)+H/2,T="start"===d?D-s-p:"center"===d?D-(s+i/2)+R/2:"end"===d?D-r+m+R:j(s,r,i,p,m+R,D,D+w,w);let{scrollLeft:e,scrollTop:l}=t;P=Math.max(0,Math.min(l+P/V,t.scrollHeight-n/V+H)),T=Math.max(0,Math.min(e+T/F,t.scrollWidth-i/F+R)),M+=l-P,D+=e-T}E.push({el:t,top:P,left:T})}return E},W=0;function z(e){return"function"==typeof e?e:q}function q(){}function X(e,t){e&&$(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}function Y(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function G(e,t){var n;function i(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];i(),n=setTimeout((function(){n=null,e.apply(void 0,r)}),t)}return o.cancel=i,o}function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(i)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"==typeof t?t(e):t&&(t.current=e)}))}}function Z(){return String(W++)}function ee(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function te(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var ne=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function ie(e){void 0===e&&(e={});var t={};return ne.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function oe(e,t){return Object.keys(e).reduce((function(n,i){return n[i]=re(t,i)?t[i]:e[i],n}),{})}function re(e,t){return void 0!==e[t]}function ue(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function se(e,t,n,i,o){if(void 0===o&&(o=!0),0===n)return-1;var r=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:r+1);var u=t+e;u<0?u=o?r:0:u>r&&(u=o?0:r);var s=le(e,u,n,i,o);return-1===s?t>=n?-1:t:s}function le(e,t,n,i,o){var r=i(t);if(!r||!r.hasAttribute("disabled"))return t;if(e>0){for(var u=t+1;u<n;u++)if(!i(u).hasAttribute("disabled"))return u}else for(var s=t-1;s>=0;s--)if(!i(s).hasAttribute("disabled"))return s;return o?e>0?le(1,0,n,i,!1):le(-1,n-1,n,i,!1):-1}function ae(e,t,n,i){return void 0===i&&(i=!0),t.some((function(t){return t&&(Y(t,e,n)||i&&Y(t,n.document.activeElement,n))}))}var de=G((function(e){pe(e).textContent=""}),500);function ce(e,t){var n=pe(t);e&&(n.textContent=e,de(t))}function pe(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var fe=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16}),ge=["refKey","ref"],he=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],me=["onKeyDown","onBlur","onChange","onInput","onChangeText"],Ie=["refKey","ref"],ve=["onMouseMove","onMouseDown","onClick","onPress","index","item"],ye=function(){var e=function(e){var n,i;function o(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+Z(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var i=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==i})),e()}),t);n.timeoutIds.push(i)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=ie(t),n.internalSetState(u({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,i){t=ie(t),n.internalSetState(u({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),i)},n.selectItemAtIndex=function(e,t,i){var o=n.items[e];null!=o&&n.selectItem(o,t,i)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var i,o,r={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,u({},n.getStateAndHelpers(),e)),n.setState((function(t){t=n.getState(t);var l=s?e(t):e;l=n.props.stateReducer(t,l),i=l.hasOwnProperty("selectedItem");var a={};return i&&l.selectedItem!==t.selectedItem&&(o=l.selectedItem),l.type=l.type||0,Object.keys(l).forEach((function(e){t[e]!==l[e]&&(r[e]=l[e]),"type"!==e&&(l[e],re(n.props,e)||(a[e]=l[e]))})),s&&l.hasOwnProperty("inputValue")&&n.props.onInputValueChange(l.inputValue,u({},n.getStateAndHelpers(),l)),a}),(function(){z(t)(),Object.keys(r).length>1&&n.props.onStateChange(r,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(r,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,o=void 0===e?{}:e,s=o.refKey,l=void 0===s?"ref":s,a=o.ref,d=r(o,ge),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return u(((i={})[l]=Q(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:null,i["aria-labelledby"]=n.labelId,i),d)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},(function(){var e=t.getItemCount();if(e>0){var n=se(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:4})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},(function(){var e=t.getItemCount();if(e>0){var n=se(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:3})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,i=t.highlightedIndex;if(n&&null!=i){e.preventDefault();var o=this.items[i],r=this.getItemNodeFromIndex(i);if(null==o||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(u({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=u({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=u({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var i=this.getItemCount();if(!(i<=0)&&n){var o=le(1,0,i,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var i=this.getItemCount();if(!(i<=0)&&n){var o=le(-1,i-1,i,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var o=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=r(t,he),d=n.getState().isOpen,c={onClick:J(i,n.buttonHandleClick),onKeyDown:J(o,n.buttonHandleKeyDown),onKeyUp:J(s,n.buttonHandleKeyUp),onBlur:J(l,n.buttonHandleBlur)};return u({type:"button",role:"button","aria-label":d?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:c,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=ue(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(s(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:14})}))},n.getLabelProps=function(e){return u({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,o=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=r(t,me),d={};var c,p=n.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;a.disabled||((c={}).onInput=J(s,l,n.inputHandleChange),c.onKeyDown=J(i,n.inputHandleKeyDown),c.onBlur=J(o,n.inputHandleBlur),d=c);return u({"aria-autocomplete":"list","aria-activedescendant":g&&"number"==typeof h&&h>=0?n.getItemId(h):null,"aria-controls":g?n.menuId:null,"aria-labelledby":n.labelId,autoComplete:"off",value:f,id:n.inputId},d,a)},n.inputHandleKeyDown=function(e){var t=ue(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(s(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:10})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,o=void 0===e?{}:e,s=o.refKey,l=void 0===s?"ref":s,a=o.ref,d=r(o,Ie),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,u(((i={})[l]=Q(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=d&&d["aria-label"]?null:n.labelId,i.id=n.menuId,i),d)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,o=i.onMouseMove,s=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,d=i.item,c=void 0===d?void 0:d,p=r(i,ve);void 0===a?(n.items.push(c),a=n.items.indexOf(c)):n.items[a]=c;var f=l,g=((t={onMouseMove:J(o,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:J(s,(function(e){e.preventDefault()}))}).onClick=J(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return u({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},h,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=ie(e),n.internalSetState((function(t){var i=t.selectedItem;return u({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(i)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=ie(e),n.internalSetState((function(t){var i=t.isOpen;return u({isOpen:!i},i&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var i=n.getState(),o=i.isOpen,r=i.highlightedIndex;o&&n.getItemCount()>0&&"number"==typeof r&&n.setHighlightedIndex(r,e),z(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=G((function(){var e=n.getState(),t=n.items[e.highlightedIndex],i=n.getItemCount(),o=n.props.getA11yStatusMessage(u({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:i,highlightedItem:t},e));n.previousResultCount=i,ce(o,n.props.environment.document)}),200);var i=n.props,o=i.defaultHighlightedIndex,l=i.initialHighlightedIndex,a=void 0===l?o:l,d=i.defaultIsOpen,c=i.initialIsOpen,p=void 0===c?d:c,f=i.initialInputValue,g=void 0===f?"":f,h=i.initialSelectedItem,m=void 0===h?null:h,I=n.getState({highlightedIndex:a,isOpen:p,inputValue:g,selectedItem:m});return null!=I.selectedItem&&void 0===n.props.initialInputValue&&(I.inputValue=n.props.itemToString(I.selectedItem)),n.state=I,n}i=e,(n=o).prototype=Object.create(i.prototype),n.prototype.constructor=n,l(n,i);var a=o.prototype;return a.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},a.getState=function(e){return void 0===e&&(e=this.state),oe(e,this.props)},a.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},a.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},a.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},a.moveHighlightedIndex=function(e,t){var n=this,i=this.getItemCount(),o=this.getState().highlightedIndex;if(i>0){var r=se(e,o,i,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(r,t)}},a.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,i=e.selectedItem,o=e.isOpen,r=this.props.itemToString,u=this.id,s=this.getRootProps,l=this.getToggleButtonProps,a=this.getLabelProps,d=this.getMenuProps,c=this.getInputProps,p=this.getItemProps,f=this.openMenu,g=this.closeMenu,h=this.toggleMenu,m=this.selectItem,I=this.selectItemAtIndex,v=this.selectHighlightedItem,y=this.setHighlightedIndex,x=this.clearSelection,b=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:a,getMenuProps:d,getInputProps:c,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:g,toggleMenu:h,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:x,clearItems:b,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},a.componentDidMount=function(){var e=this,t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!ae(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},i=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},r=function(t){var n=ae(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},u=this.props.environment;u.addEventListener("mousedown",t),u.addEventListener("mouseup",n),u.addEventListener("touchstart",i),u.addEventListener("touchmove",o),u.addEventListener("touchend",r),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",i),u.removeEventListener("touchmove",o),u.removeEventListener("touchend",r)}},a.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,i=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==i},a.componentDidUpdate=function(e,t){re(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},a.componentWillUnmount=function(){this.cleanup()},a.render=function(){var e=te(this.props.children,q);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var n=te(e(this.getStateAndHelpers()));return n?this.getRootProps.called||this.props.suppressRefError?n:function(e){return"string"==typeof e.type||"string"==typeof e.nodeName}(n)?t.cloneElement(n,this.getRootProps(function(e){return e.props||e.attributes}(n))):void 0:null},o}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:ee,itemToString:function(e){return null==e?"":String(e)},onStateChange:q,onInputValueChange:q,onUserAction:q,onChange:q,onSelect:q,onOuterClick:q,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:X},e.stateChangeTypes=fe,e}(),xe=ye,be=["isInitialMount","highlightedIndex","items","environment"],we={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function Se(e,t,n){var i=e.props,o=e.type,r={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,r=t.type,s="on"+De(e)+"Change";o[s]&&void 0!==i[e]&&i[e]!==n[e]&&o[s](u({type:r},i))}(i,e,t,n),n[i]!==t[i]&&(r[i]=n[i])})),i.onStateChange&&Object.keys(r).length&&i.onStateChange(u({type:o},r))}var ke=G((function(e,t){ce(e(),t)}),200),Ce="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function Oe(e){var n=e.id,i=void 0===n?"downshift-"+Z():n,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:s||i+"-toggle-button",inputId:l||i+"-input"}).current}function Me(e,t,n,i){var o,r;if(void 0===e){if(void 0===t)throw new Error(i);o=n[t],r=t}else r=void 0===t?n.indexOf(e):t,o=e;return[o,r]}function De(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Ee(e){var n=t.useRef(e);return n.current=e,n}function Ke(e,n,i){var o=t.useRef(),r=t.useRef(),s=t.useCallback((function(t,n){r.current=n,t=oe(t,n.props);var i=e(t,n);return n.props.stateReducer(t,u({},n,{changes:i}))}),[e]),l=t.useReducer(s,n),a=l[0],d=l[1],c=Ee(i),p=t.useCallback((function(e){return d(u({props:c.current},e))}),[c]),f=r.current;return t.useEffect((function(){f&&o.current&&o.current!==a&&Se(f,oe(o.current,f.props),a),o.current=a}),[a,i,f]),[a,p]}function Pe(e,t,n){var i=Ke(e,t,n),o=i[0],r=i[1];return[oe(o,n),r]}var Te={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:X,environment:"undefined"==typeof window?{}:window};function Re(e,t,n){void 0===n&&(n=we);var i=e["default"+De(t)];return void 0!==i?i:n[t]}function He(e,t,n){void 0===n&&(n=we);var i=e[t];if(void 0!==i)return i;var o=e["initial"+De(t)];return void 0!==o?o:Re(e,t,n)}function Fe(e){var t=He(e,"selectedItem"),n=He(e,"isOpen"),i=He(e,"highlightedIndex"),o=He(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.indexOf(t):i,isOpen:n,selectedItem:t,inputValue:o}}function Ve(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===i.length?-1:void 0!==o&&s===o?o:void 0!==r?r:u?i.indexOf(u):0===n?-1:n<0?i.length-1:0}function Ne(e,n,i,o){var r=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(null!=(null==i?void 0:i.addEventListener)){var t=function(){r.current.isMouseDown=!0},u=function(t){r.current.isMouseDown=!1,e&&!ae(t.target,n.map((function(e){return e.current})),i)&&o()},s=function(){r.current.isTouchMove=!1},l=function(){r.current.isTouchMove=!0},a=function(t){!e||r.current.isTouchMove||ae(t.target,n.map((function(e){return e.current})),i,!1)||o()};return i.addEventListener("mousedown",t),i.addEventListener("mouseup",u),i.addEventListener("touchstart",s),i.addEventListener("touchmove",l),i.addEventListener("touchend",a),function(){i.removeEventListener("mousedown",t),i.removeEventListener("mouseup",u),i.removeEventListener("touchstart",s),i.removeEventListener("touchmove",l),i.removeEventListener("touchend",a)}}}),[e,i]),r}var Ae=function(){return q};function Be(e,n,i){var o=i.isInitialMount,s=i.highlightedIndex,l=i.items,a=i.environment,d=r(i,be);t.useEffect((function(){o||ke((function(){return e(u({highlightedIndex:s,highlightedItem:l[s],resultCount:l.length},d))}),a.document)}),n)}function Le(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return Ce((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var _e=q;function je(e,t,n){var i,o=t.type,r=t.props;switch(o){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ve(r,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:Ve(r,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:Re(r,"highlightedIndex"),isOpen:Re(r,"isOpen"),selectedItem:Re(r,"selectedItem"),inputValue:Re(r,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return u({},e,i)}var Ue=function(){return Ue=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ue.apply(this,arguments)};o.default.array.isRequired,o.default.func,o.default.func,o.default.func,o.default.number,o.default.number,o.default.number,o.default.bool,o.default.bool,o.default.bool,o.default.any,o.default.any,o.default.any,o.default.string,o.default.string,o.default.string,o.default.func,o.default.string,o.default.func,o.default.func,o.default.func,o.default.func,o.default.func,o.default.shape({addEventListener:o.default.func,removeEventListener:o.default.func,document:o.default.shape({getElementById:o.default.func,activeElement:o.default.any,body:o.default.any})});var $e=Ue(Ue({},Te),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,i=e.previousResultCount;return t?n?n!==i?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}}),We=q,ze=0,qe=1,Xe=2,Ye=3,Ge=4,Je=5,Qe=6,Ze=7,et=8,tt=9,nt=10,it=11,ot=12,rt=13,ut=14,st=15,lt=16,at=17,dt=18,ct=19,pt=20,ft=21,gt=Object.freeze({__proto__:null,ToggleButtonClick:ze,ToggleButtonKeyDownArrowDown:qe,ToggleButtonKeyDownArrowUp:Xe,ToggleButtonKeyDownCharacter:Ye,ToggleButtonKeyDownEscape:Ge,ToggleButtonKeyDownHome:Je,ToggleButtonKeyDownEnd:Qe,ToggleButtonKeyDownEnter:Ze,ToggleButtonKeyDownSpaceButton:et,ToggleButtonKeyDownPageUp:tt,ToggleButtonKeyDownPageDown:nt,ToggleButtonBlur:it,MenuMouseLeave:ot,ItemMouseMove:rt,ItemClick:ut,FunctionToggleMenu:st,FunctionOpenMenu:lt,FunctionCloseMenu:at,FunctionSetHighlightedIndex:dt,FunctionSelectItem:ct,FunctionSetInputValue:pt,FunctionReset:ft});function ht(e,t){var n,i=t.type,o=t.props,r=t.altKey;switch(i){case ut:n={isOpen:Re(o,"isOpen"),highlightedIndex:Re(o,"highlightedIndex"),selectedItem:o.items[t.index]};break;case Ye:var s=t.key,l=""+e.inputValue+s,a=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.getItemNodeFromIndex,u=t.toLowerCase(),s=0;s<i.length;s++){var l=(s+n+(t.length<2?1:0))%i.length,a=i[l];if(void 0!==a&&o(a).toLowerCase().startsWith(u)){var d=r(l);if(!(null==d?void 0:d.hasAttribute("disabled")))return l}}return n}({keysSoFar:l,highlightedIndex:!e.isOpen&&e.selectedItem?o.items.indexOf(e.selectedItem):e.highlightedIndex,items:o.items,itemToString:o.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});n={inputValue:l,highlightedIndex:a,isOpen:!0};break;case qe:n={highlightedIndex:e.isOpen?se(1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1):r&&null==e.selectedItem?-1:Ve(o,e,1),isOpen:!0};break;case Xe:if(e.isOpen&&r)n=u({isOpen:Re(o,"isOpen"),highlightedIndex:Re(o,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex]});else n={highlightedIndex:e.isOpen?se(-1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1):Ve(o,e,-1),isOpen:!0};break;case Ze:case et:n=u({isOpen:Re(o,"isOpen"),highlightedIndex:Re(o,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex]});break;case Je:n={highlightedIndex:le(1,0,o.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case Qe:n={highlightedIndex:le(-1,o.items.length-1,o.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case tt:n={highlightedIndex:se(-10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case nt:n={highlightedIndex:se(10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case Ge:n={isOpen:!1,highlightedIndex:-1};break;case it:n=u({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex]});break;case ct:n={selectedItem:t.selectedItem};break;default:return je(e,t,gt)}return u({},e,n)}var mt=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],It=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],vt=["item","index","onMouseMove","onClick","onPress","refKey","ref","disabled"];function yt(e){void 0===e&&(e={}),We();var n=u({},$e,e),i=n.items,o=n.scrollIntoView,s=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,d=n.getA11yStatusMessage,c=Pe(ht,Fe(n),n),p=c[0],f=c[1],g=p.isOpen,h=p.highlightedIndex,m=p.selectedItem,I=p.inputValue,v=t.useRef(null),y=t.useRef(null),x=t.useRef({}),b=t.useRef(null),w=Oe(n),S=t.useRef(),k=t.useRef(!0),C=Ee({state:p,props:n}),O=t.useCallback((function(e){return x.current[w.getItemId(e)]}),[w]);Be(d,[g,h,I,i],u({isInitialMount:k.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p)),Be(a,[m],u({isInitialMount:k.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p));var M=Le({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:x,scrollIntoView:o,getItemNodeFromIndex:O});t.useEffect((function(){return b.current=G((function(e){e({type:pt,inputValue:""})}),500),function(){b.current.cancel()}}),[]),t.useEffect((function(){I&&b.current(f)}),[f,I]),_e({isInitialMount:k.current,props:n,state:p}),t.useEffect((function(){k.current||(S.current=i.length)}));var D=Ne(g,[y,v],s,(function(){f({type:it})})),E=Ae();t.useEffect((function(){return k.current=!1,function(){k.current=!0}}),[]),t.useEffect((function(){g||(x.current={})}),[g]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:qe,getItemNodeFromIndex:O,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Xe,getItemNodeFromIndex:O,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:Je,getItemNodeFromIndex:O})},End:function(e){e.preventDefault(),f({type:Qe,getItemNodeFromIndex:O})},Escape:function(){C.current.state.isOpen&&f({type:Ge})},Enter:function(e){e.preventDefault(),f({type:C.current.state.isOpen?Ze:ze})},PageUp:function(e){C.current.state.isOpen&&(e.preventDefault(),f({type:tt,getItemNodeFromIndex:O}))},PageDown:function(e){C.current.state.isOpen&&(e.preventDefault(),f({type:nt,getItemNodeFromIndex:O}))}," ":function(e){e.preventDefault();var t=C.current.state;t.isOpen?t.inputValue?f({type:Ye,key:" ",getItemNodeFromIndex:O}):f({type:et}):f({type:ze})}}}),[f,O,C]),P=t.useCallback((function(){f({type:st})}),[f]),T=t.useCallback((function(){f({type:at})}),[f]),R=t.useCallback((function(){f({type:lt})}),[f]),H=t.useCallback((function(e){f({type:dt,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:ct,selectedItem:e})}),[f]),V=t.useCallback((function(){f({type:ft})}),[f]),N=t.useCallback((function(e){f({type:pt,inputValue:e})}),[f]),A=t.useCallback((function(e){return u({id:w.labelId,htmlFor:w.toggleButtonId},e)}),[w]),B=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s;i.onKeyDown,i.onBlur;var a=i.ref,d=r(i,mt),c=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==c&&c,l,y),u(((n={})[l]=Q(a,(function(e){y.current=e})),n.id=w.menuId,n.role="listbox",n["aria-labelledby"]=w.labelId,n.tabIndex=-1,n.onMouseLeave=J(o,(function(){f({type:ot})})),n),d)}),[f,E,w]);return{getToggleButtonProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onBlur,s=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,d=void 0===a?"ref":a,c=i.ref,p=r(i,It),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=C.current.state,I=u(((n={})[d]=Q(c,(function(e){v.current=e})),n["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?w.getItemId(m.highlightedIndex):"",n["aria-controls"]=w.menuId,n["aria-expanded"]=C.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=""+w.labelId,n.id=w.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=J(o,(function(){m.isOpen&&!D.current.isMouseDown&&f({type:it})})),n),p);return p.disabled||(I.onClick=J(s,(function(){f({type:ze})})),I.onKeyDown=J(l,(function(e){var t=ue(e);t&&K[t]?K[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:Ye,key:t,getItemNodeFromIndex:O})}))),E("getToggleButtonProps",h,d,v),I}),[C,w,E,f,D,K,O]),getLabelProps:A,getMenuProps:B,getItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,o=n.index,s=n.onMouseMove,l=n.onClick;n.onPress;var a=n.refKey,d=void 0===a?"ref":a,c=n.ref,p=n.disabled,g=r(n,vt),h=C.current,I=h.state,v=Me(i,o,h.props.items,"Pass either item or index to getItemProps!"),y=v[0],b=v[1],S=u(((t={disabled:p,role:"option","aria-selected":""+(y===m),id:w.getItemId(b)})[d]=Q(c,(function(e){e&&(x.current[w.getItemId(b)]=e)})),t),g);return p||(S.onClick=J(l,(function(){f({type:ut,index:b})}))),S.onMouseMove=J(s,(function(){b!==I.highlightedIndex&&(M.current=!1,f({type:rt,index:b,disabled:p}))})),S}),[C,m,w,M,f]),toggleMenu:P,openMenu:R,closeMenu:T,setHighlightedIndex:H,selectItem:F,reset:V,setInputValue:N,highlightedIndex:h,isOpen:g,selectedItem:m,inputValue:I}}yt.stateChangeTypes=gt;var xt=0,bt=1,wt=2,St=3,kt=4,Ct=5,Ot=6,Mt=7,Dt=8,Et=9,Kt=10,Pt=11,Tt=12,Rt=13,Ht=14,Ft=15,Vt=16,Nt=17,At=18,Bt=19,Lt=20,_t=21,jt=22,Ut=Object.freeze({__proto__:null,InputKeyDownArrowDown:xt,InputKeyDownArrowUp:bt,InputKeyDownEscape:wt,InputKeyDownHome:St,InputKeyDownEnd:kt,InputKeyDownPageUp:Ct,InputKeyDownPageDown:Ot,InputKeyDownEnter:Mt,InputChange:Dt,InputBlur:Et,InputFocus:Kt,MenuMouseLeave:Pt,ItemMouseMove:Tt,ItemClick:Rt,ToggleButtonClick:Ht,FunctionToggleMenu:Ft,FunctionOpenMenu:Vt,FunctionCloseMenu:Nt,FunctionSetHighlightedIndex:At,FunctionSelectItem:Bt,FunctionSetInputValue:Lt,FunctionReset:_t,ControlledPropUpdatedSelectedItem:jt});o.default.array.isRequired,o.default.func,o.default.func,o.default.func,o.default.number,o.default.number,o.default.number,o.default.bool,o.default.bool,o.default.bool,o.default.any,o.default.any,o.default.any,o.default.string,o.default.string,o.default.string,o.default.string,o.default.string,o.default.string,o.default.func,o.default.string,o.default.string,o.default.func,o.default.func,o.default.func,o.default.func,o.default.func,o.default.func,o.default.shape({addEventListener:o.default.func,removeEventListener:o.default.func,document:o.default.shape({getElementById:o.default.func,activeElement:o.default.any,body:o.default.any})});var $t=q,Wt=u({},Te,{getA11yStatusMessage:ee});function zt(e,t){var n,i=t.type,o=t.props,r=t.altKey;switch(i){case Rt:n={isOpen:Re(o,"isOpen"),highlightedIndex:Re(o,"highlightedIndex"),selectedItem:o.items[t.index],inputValue:o.itemToString(o.items[t.index])};break;case xt:n=e.isOpen?{highlightedIndex:se(1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:r&&null==e.selectedItem?-1:Ve(o,e,1,t.getItemNodeFromIndex),isOpen:o.items.length>=0};break;case bt:n=e.isOpen?r?u({isOpen:Re(o,"isOpen"),highlightedIndex:Re(o,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex],inputValue:o.itemToString(o.items[e.highlightedIndex])}):{highlightedIndex:se(-1,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:Ve(o,e,-1,t.getItemNodeFromIndex),isOpen:o.items.length>=0};break;case Mt:n=u({isOpen:Re(o,"isOpen"),highlightedIndex:Re(o,"highlightedIndex")},e.highlightedIndex>=0&&{selectedItem:o.items[e.highlightedIndex],inputValue:o.itemToString(o.items[e.highlightedIndex])});break;case wt:n=u({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ct:n={highlightedIndex:se(-10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case Ot:n={highlightedIndex:se(10,e.highlightedIndex,o.items.length,t.getItemNodeFromIndex,!1)};break;case St:n={highlightedIndex:le(1,0,o.items.length,t.getItemNodeFromIndex,!1)};break;case kt:n={highlightedIndex:le(-1,o.items.length-1,o.items.length,t.getItemNodeFromIndex,!1)};break;case Et:n=u({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&t.selectItem&&{selectedItem:o.items[e.highlightedIndex],inputValue:o.itemToString(o.items[e.highlightedIndex])});break;case Dt:n={isOpen:!0,highlightedIndex:Re(o,"highlightedIndex"),inputValue:t.inputValue};break;case Kt:n={isOpen:!0,highlightedIndex:Ve(o,e,0)};break;case Bt:n={selectedItem:t.selectedItem,inputValue:o.itemToString(t.selectedItem)};break;case jt:n={inputValue:t.inputValue};break;default:return je(e,t,Ut)}return u({},e,n)}var qt=["onMouseLeave","refKey","ref"],Xt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],Yt=["onClick","onPress","refKey","ref"],Gt=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function Jt(e){void 0===e&&(e={}),$t();var n=u({},Wt,e),i=n.initialIsOpen,o=n.defaultIsOpen,s=n.items,l=n.scrollIntoView,a=n.environment,d=n.getA11yStatusMessage,c=n.getA11ySelectionMessage,p=n.itemToString,f=function(e){var t=Fe(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),u({},t,{inputValue:i})}(n),g=function(e,n,i){var o=t.useRef(),r=Ke(e,n,i),u=r[0],s=r[1];return t.useEffect((function(){re(i,"selectedItem")&&(o.current!==i.selectedItem&&s({type:jt,inputValue:i.itemToString(i.selectedItem)}),o.current=u.selectedItem===o.current?i.selectedItem:u.selectedItem)}),[i.selectedItem,u.selectedItem]),[oe(u,i),s]}(zt,f,n),h=g[0],m=g[1],I=h.isOpen,v=h.highlightedIndex,y=h.selectedItem,x=h.inputValue,b=t.useRef(null),w=t.useRef({}),S=t.useRef(null),k=t.useRef(null),C=t.useRef(!0),O=Oe(n),M=t.useRef(),D=Ee({state:h,props:n}),E=t.useCallback((function(e){return w.current[O.getItemId(e)]}),[O]);Be(d,[I,v,x,s],u({isInitialMount:C.current,previousResultCount:M.current,items:s,environment:a,itemToString:p},h)),Be(c,[y],u({isInitialMount:C.current,previousResultCount:M.current,items:s,environment:a,itemToString:p},h));var K=Le({menuElement:b.current,highlightedIndex:v,isOpen:I,itemRefs:w,scrollIntoView:l,getItemNodeFromIndex:E});_e({isInitialMount:C.current,props:n,state:h}),t.useEffect((function(){(i||o||I)&&S.current&&S.current.focus()}),[]),t.useEffect((function(){C.current||(M.current=s.length)}));var P=Ne(I,[S,b,k],a,(function(){m({type:Et,selectItem:!1})})),T=Ae();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){var e;if(I){if((null==(e=a.document)?void 0:e.activeElement)!==S.current){var t;null==S||null==(t=S.current)||t.focus()}}else w.current={}}),[I,a]);var R=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),m({type:xt,altKey:e.altKey,getItemNodeFromIndex:E})},ArrowUp:function(e){e.preventDefault(),m({type:bt,altKey:e.altKey,getItemNodeFromIndex:E})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:St,getItemNodeFromIndex:E}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:kt,getItemNodeFromIndex:E}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),m({type:wt}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),m({type:Mt,getItemNodeFromIndex:E}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Ct,getItemNodeFromIndex:E}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Ot,getItemNodeFromIndex:E}))}}}),[m,D,E]),H=t.useCallback((function(e){return u({id:O.labelId,htmlFor:O.inputId},e)}),[O]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,d=r(i,qt),c=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==c&&c,l,b),u(((n={})[l]=Q(a,(function(e){b.current=e})),n.id=O.menuId,n.role="listbox",n["aria-labelledby"]=O.labelId,n.onMouseLeave=J(o,(function(){m({type:Pt})})),n),d)}),[m,T,O]),V=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,o=i.item,s=i.index,l=i.refKey,a=void 0===l?"ref":l,d=i.ref,c=i.onMouseMove,p=i.onMouseDown,f=i.onClick;i.onPress;var g=i.disabled,h=r(i,Xt),I=D.current,v=I.props,y=I.state,x=Me(o,s,v.items,"Pass either item or index to getItemProps!")[1],b=f;return u(((t={})[a]=Q(d,(function(e){e&&(w.current[O.getItemId(x)]=e)})),t.disabled=g,t.role="option",t["aria-selected"]=""+(x===y.highlightedIndex),t.id=O.getItemId(x),t),!g&&((n={}).onClick=J(b,(function(){m({type:Rt,index:x})})),n),{onMouseMove:J(c,(function(){x!==y.highlightedIndex&&(K.current=!1,m({type:Tt,index:x,disabled:g}))})),onMouseDown:J(p,(function(e){return e.preventDefault()}))},h)}),[m,D,K,O]),N=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var o=n.refKey,s=void 0===o?"ref":o,l=n.ref,a=r(n,Yt),d=D.current.state;return u(((t={})[s]=Q(l,(function(e){k.current=e})),t["aria-controls"]=O.menuId,t["aria-expanded"]=d.isOpen,t.id=O.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&u({},{onClick:J(i,(function(){m({type:Ht})}))}),a)}),[m,D,O]),A=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onKeyDown,s=i.onChange,l=i.onInput,a=i.onFocus,d=i.onBlur;i.onChangeText;var c=i.refKey,p=void 0===c?"ref":c,f=i.ref,g=r(i,Gt),h=(void 0===t?{}:t).suppressRefError;T("getInputProps",void 0!==h&&h,p,S);var I,v=D.current.state,y={};g.disabled||((I={}).onInput=J(s,l,(function(e){m({type:Dt,inputValue:e.target.value})})),I.onKeyDown=J(o,(function(e){var t=ue(e);t&&R[t]&&R[t](e)})),I.onBlur=J(d,(function(){v.isOpen&&!P.current.isMouseDown&&m({type:Et,selectItem:!0})})),I.onFocus=J(a,(function(){v.isOpen||m({type:Kt})})),y=I);return u(((n={})[p]=Q(f,(function(e){S.current=e})),n["aria-activedescendant"]=v.isOpen&&v.highlightedIndex>-1?O.getItemId(v.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=O.menuId,n["aria-expanded"]=v.isOpen,n["aria-labelledby"]=O.labelId,n.autoComplete="off",n.id=O.inputId,n.role="combobox",n.value=v.inputValue,n),y,g)}),[m,R,D,P,T,O]),B=t.useCallback((function(){m({type:Ft})}),[m]),L=t.useCallback((function(){m({type:Nt})}),[m]),_=t.useCallback((function(){m({type:Vt})}),[m]),j=t.useCallback((function(e){m({type:At,highlightedIndex:e})}),[m]),U=t.useCallback((function(e){m({type:Bt,selectedItem:e})}),[m]);return{getItemProps:V,getLabelProps:H,getMenuProps:F,getInputProps:A,getToggleButtonProps:N,toggleMenu:B,openMenu:_,closeMenu:L,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){m({type:Lt,inputValue:e})}),[m]),selectItem:U,reset:t.useCallback((function(){m({type:_t})}),[m]),highlightedIndex:v,isOpen:I,selectedItem:y,inputValue:x}}Jt.stateChangeTypes=Ut;var Qt={activeIndex:-1,selectedItems:[]};function Zt(e,t){return He(e,t,Qt)}function en(e,t){return Re(e,t,Qt)}function tn(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&""!==t.value)||0===t.selectionStart&&0===t.selectionEnd}o.default.array,o.default.array,o.default.array,o.default.func,o.default.func,o.default.func,o.default.number,o.default.number,o.default.number,o.default.func,o.default.func,o.default.string,o.default.string,o.default.shape({addEventListener:o.default.func,removeEventListener:o.default.func,document:o.default.shape({getElementById:o.default.func,activeElement:o.default.any,body:o.default.any})});var nn={itemToString:Te.itemToString,stateReducer:Te.stateReducer,environment:Te.environment,getA11yRemovalMessage:function(e){var t=e.removedSelectedItem;return(0,e.itemToString)(t)+" has been removed."},keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},on=q,rn=0,un=1,sn=2,ln=3,an=4,dn=5,cn=6,pn=7,fn=8,gn=9,hn=10,mn=11,In=12,vn=Object.freeze({__proto__:null,SelectedItemClick:rn,SelectedItemKeyDownDelete:un,SelectedItemKeyDownBackspace:sn,SelectedItemKeyDownNavigationNext:ln,SelectedItemKeyDownNavigationPrevious:an,DropdownKeyDownNavigationPrevious:dn,DropdownKeyDownBackspace:cn,DropdownClick:pn,FunctionAddSelectedItem:fn,FunctionRemoveSelectedItem:gn,FunctionSetSelectedItems:hn,FunctionSetActiveIndex:mn,FunctionReset:In});function yn(e,t){var n,i=t.type,o=t.index,r=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case rn:n={activeIndex:o};break;case an:n={activeIndex:l-1<0?0:l-1};break;case ln:n={activeIndex:l+1>=a.length?-1:l+1};break;case sn:case un:if(l<0)break;var d=l;1===a.length?d=-1:l===a.length-1&&(d=a.length-2),n=u({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:d});break;case dn:n={activeIndex:a.length-1};break;case cn:n={selectedItems:a.slice(0,a.length-1)};break;case fn:n={selectedItems:[].concat(a,[s])};break;case pn:n={activeIndex:-1};break;case gn:var c=l,p=a.indexOf(s);if(p<0)break;1===a.length?c=-1:p===a.length-1&&(c=a.length-2),n={selectedItems:[].concat(a.slice(0,p),a.slice(p+1)),activeIndex:c};break;case hn:n={selectedItems:t.selectedItems};break;case mn:n={activeIndex:t.activeIndex};break;case In:n={activeIndex:en(r,"activeIndex"),selectedItems:en(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return u({},e,n)}var xn=["refKey","ref","onClick","onKeyDown","selectedItem","index"],bn=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function wn(e){void 0===e&&(e={}),on();var n=u({},nn,e),i=n.getA11yRemovalMessage,o=n.itemToString,s=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,d=Pe(yn,function(e){return{activeIndex:Zt(e,"activeIndex"),selectedItems:Zt(e,"selectedItems")}}(n),n),c=d[0],p=d[1],f=c.activeIndex,g=c.selectedItems,h=t.useRef(!0),m=t.useRef(null),I=t.useRef(g),v=t.useRef();v.current=[];var y=Ee({state:c,props:n});t.useEffect((function(){if(!h.current){if(g.length<I.current.length){var e=I.current.find((function(e){return g.indexOf(e)<0}));ce(i({itemToString:o,resultCount:g.length,removedSelectedItem:e,activeIndex:f,activeSelectedItem:g[f]}),s.document)}I.current=g}}),[g.length]),t.useEffect((function(){h.current||(-1===f&&m.current?m.current.focus():v.current[f]&&v.current[f].focus())}),[f]),_e({isInitialMount:h.current,props:n,state:c});var x=Ae();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var b=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:an})},e[l]=function(){p({type:ln})},e.Delete=function(){p({type:un})},e.Backspace=function(){p({type:sn})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){tn(e)&&p({type:dn})},e.Backspace=function(e){tn(e)&&p({type:cn})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,o=void 0===i?"ref":i,s=n.ref,l=n.onClick,a=n.onKeyDown,d=n.selectedItem,c=n.index,f=r(n,xn),g=y.current.state,h=Me(d,c,g.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],m=h>-1&&h===g.activeIndex;return u(((t={})[o]=Q(s,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=J(l,(function(){p({type:rn,index:h})})),t.onKeyDown=J(a,(function(e){var t=ue(e);t&&b[t]&&b[t](e)})),t),f)}),[p,y,b]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.refKey,s=void 0===o?"ref":o,l=i.ref,a=i.onKeyDown,d=i.onClick,c=i.preventKeyAction,f=void 0!==c&&c,g=r(i,bn),h=(void 0===t?{}:t).suppressRefError;return x("getDropdownProps",void 0!==h&&h,s,m),u(((n={})[s]=Q(l,(function(e){e&&(m.current=e)})),n),!f&&{onKeyDown:J(a,(function(e){var t=ue(e);t&&w[t]&&w[t](e)})),onClick:J(d,(function(){p({type:pn})}))},g)}),[p,w,x]),addSelectedItem:t.useCallback((function(e){p({type:fn,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:gn,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:hn,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:mn,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:In})}),[p]),selectedItems:g,activeIndex:f}}wn.stateChangeTypes=vn,e.default=xe,e.resetIdCounter=function(){W=0},e.useCombobox=Jt,e.useMultipleSelection=wn,e.useSelect=yt,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=downshift.umd.min.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2617830
29025