downshift
Advanced tools
Comparing version 7.5.0 to 7.6.0
@@ -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,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}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 r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(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,b=l?Symbol.for("react.suspense_list"):60120,x=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 x: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=x,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)===x},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===b||"object"==typeof e&&null!==e&&(e.$$typeof===w||e.$$typeof===x||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,r,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){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,re=H,ie=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=re,T.Profiler=ie,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,r,i,u,s)=>i<e&&u>t||i>e&&u<t?0:i<=e&&s<=n||u>=t&&s>=n?i-e-o:u>t&&s<n||i<e&&s>n?u-t+r:0,pe=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var fe=(e,t)=>{var n,o,r,i,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!=(i=null==(r=window.visualViewport)?void 0:r.height)?i:innerHeight,y=null!=(u=window.scrollX)?u:pageXOffset,b=null!=(s=window.scrollY)?s:pageYOffset,{height:x,width:w,top:S,right:C,bottom:k,left:O}=e.getBoundingClientRect(),M="start"===a||"nearest"===a?S:"end"===a?k:S+x/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:r,right:i,bottom:u,left:s}=t.getBoundingClientRect();if("if-needed"===l&&S>=0&&O>=0&&k<=v&&C<=I&&S>=r&&k<=u&&O>=s&&C<=i)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(b,b+v,v,f,P,b+M,b+M+x,x):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+b),T=Math.max(0,T+y);else{K="start"===a?M-r-f:"end"===a?M-u+P+H:"nearest"===a?de(r,u,n,f,P+H,M,M+x,x):M-(r+n/2)+H/2,T="start"===c?D-s-p:"center"===c?D-(s+o/2)+R/2:"end"===c?D-i+m+R:de(s,i,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 r(){for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];o(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return r.cancel=o,r}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),r=1;r<n;r++)o[r-1]=arguments[r];return t.some((function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function xe(){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,r){if(void 0===r&&(r=!0),0===n)return-1;var i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var u=t+e;u<0?u=r?i:0:u>i&&(u=r?0:i);var s=Ke(e,u,n,o,r);return-1===s?t>=n?-1:t:s}function Ke(e,t,n,o,r){var i=o(t);if(!i||!i.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 r?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 i=e.call(this,t)||this;i.id=i.props.id||"downshift-"+we(),i.menuId=i.props.menuId||i.id+"-menu",i.labelId=i.props.labelId||i.id+"-label",i.inputId=i.props.inputId||i.id+"-input",i.getItemId=i.props.getItemId||function(e){return i.id+"-item-"+e},i.input=null,i.items=[],i.itemCount=null,i.previousResultCount=0,i.timeoutIds=[],i.internalSetTimeout=function(e,t){var n=setTimeout((function(){i.timeoutIds=i.timeoutIds.filter((function(e){return e!==n})),e()}),t);i.timeoutIds.push(n)},i.setItemCount=function(e){i.itemCount=e},i.unsetItemCount=function(){i.itemCount=null},i.setHighlightedIndex=function(e,t){void 0===e&&(e=i.props.defaultHighlightedIndex),void 0===t&&(t={}),t=Oe(t),i.internalSetState(o({highlightedIndex:e},t))},i.clearSelection=function(e){i.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:i.props.defaultHighlightedIndex,isOpen:i.props.defaultIsOpen},e)},i.selectItem=function(e,t,n){t=Oe(t),i.internalSetState(o({isOpen:i.props.defaultIsOpen,highlightedIndex:i.props.defaultHighlightedIndex,selectedItem:e,inputValue:i.props.itemToString(e)},t),n)},i.selectItemAtIndex=function(e,t,n){var o=i.items[e];null!=o&&i.selectItem(o,t,n)},i.selectHighlightedItem=function(e,t){return i.selectItemAtIndex(i.getState().highlightedIndex,e,t)},i.internalSetState=function(e,t){var n,r,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&i.props.onInputValueChange(e.inputValue,o({},i.getStateAndHelpers(),e)),i.setState((function(t){t=i.getState(t);var l=s?e(t):e;l=i.props.stateReducer(t,l),n=l.hasOwnProperty("selectedItem");var a={};return n&&l.selectedItem!==t.selectedItem&&(r=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(i.props,e)||(a[e]=l[e]))})),s&&l.hasOwnProperty("inputValue")&&i.props.onInputValueChange(l.inputValue,o({},i.getStateAndHelpers(),l)),a}),(function(){he(t)(),Object.keys(u).length>1&&i.props.onStateChange(u,i.getStateAndHelpers()),n&&i.props.onSelect(e.selectedItem,i.getStateAndHelpers()),void 0!==r&&i.props.onChange(r,i.getStateAndHelpers()),i.props.onUserAction(u,i.getStateAndHelpers())}))},i.rootRef=function(e){return i._rootNode=e},i.getRootProps=function(e,t){var r,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;i.getRootProps.called=!0,i.getRootProps.refKey=l,i.getRootProps.suppressRefError=p;var f=i.getState().isOpen;return o(((r={})[l]=xe(a,i.rootRef),r.role="combobox",r["aria-expanded"]=f,r["aria-haspopup"]="listbox",r["aria-owns"]=f?i.menuId:null,r["aria-labelledby"]=i.labelId,r),c)},i.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 r=this.items[o],i=this.getItemNodeFromIndex(o);if(null==r||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(o({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},i.buttonKeyDownHandlers=o({},i.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),i.inputKeyDownHandlers=o({},i.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var o=this.getItemCount();if(!(o<=0)&&n){var r=Ke(1,0,o,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(r,{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 r=Ke(-1,o-1,o,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(r,{type:8})}}}}),i.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick;t.onPress;var u=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=n(t,Ne),c=i.getState().isOpen,d={onClick:be(r,i.buttonHandleClick),onKeyDown:be(u,i.buttonHandleKeyDown),onKeyUp:be(s,i.buttonHandleKeyUp),onBlur:be(l,i.buttonHandleBlur)};return o({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},i.buttonHandleKeyUp=function(e){e.preventDefault()},i.buttonHandleKeyDown=function(e){var t=Ee(e);i.buttonKeyDownHandlers[t]&&i.buttonKeyDownHandlers[t].call(r(i),e)},i.buttonHandleClick=function(e){e.preventDefault(),i.props.environment.document.activeElement===i.props.environment.document.body&&e.target.focus(),i.internalSetTimeout((function(){return i.toggleMenu({type:13})}))},i.buttonHandleBlur=function(e){var t=e.target;i.internalSetTimeout((function(){i.isMouseDown||null!=i.props.environment.document.activeElement&&i.props.environment.document.activeElement.id===i.inputId||i.props.environment.document.activeElement===t||i.reset({type:14})}))},i.getLabelProps=function(e){return o({htmlFor:i.inputId,id:i.labelId},e)},i.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=n(t,Be),c={};var d,p=i.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;a.disabled||((d={}).onChange=be(s,l,i.inputHandleChange),d.onKeyDown=be(r,i.inputHandleKeyDown),d.onBlur=be(u,i.inputHandleBlur),c=d);return o({"aria-autocomplete":"list","aria-activedescendant":g&&"number"==typeof h&&h>=0?i.getItemId(h):null,"aria-controls":g?i.menuId:null,"aria-labelledby":i.labelId,autoComplete:"off",value:f,id:i.inputId},c,a)},i.inputHandleKeyDown=function(e){var t=Ee(e);t&&i.inputKeyDownHandlers[t]&&i.inputKeyDownHandlers[t].call(r(i),e)},i.inputHandleChange=function(e){i.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:i.props.defaultHighlightedIndex})},i.inputHandleBlur=function(){i.internalSetTimeout((function(){var e=i.props.environment.document&&!!i.props.environment.document.activeElement&&!!i.props.environment.document.activeElement.dataset&&i.props.environment.document.activeElement.dataset.toggle&&i._rootNode&&i._rootNode.contains(i.props.environment.document.activeElement);i.isMouseDown||e||i.reset({type:10})}))},i.menuRef=function(e){i._menuNode=e},i.getMenuProps=function(e,t){var r,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 i.getMenuProps.called=!0,i.getMenuProps.refKey=l,i.getMenuProps.suppressRefError=p,o(((r={})[l]=xe(a,i.menuRef),r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?null:i.labelId,r.id=i.menuId,r),c)},i.getItemProps=function(e){var t,r=void 0===e?{}:e,u=r.onMouseMove,s=r.onMouseDown,l=r.onClick;r.onPress;var a=r.index,c=r.item,d=void 0===c?void 0:c,p=n(r,_e);void 0===a?(i.items.push(d),a=i.items.indexOf(d)):i.items[a]=d;var f=l,g=((t={onMouseMove:be(u,(function(){a!==i.getState().highlightedIndex&&(i.setHighlightedIndex(a,{type:2}),i.avoidScrolling=!0,i.internalSetTimeout((function(){return i.avoidScrolling=!1}),250))})),onMouseDown:be(s,(function(e){e.preventDefault()}))}).onClick=be(f,(function(){i.selectItemAtIndex(a,{type:9})})),t),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return o({id:i.getItemId(a),role:"option","aria-selected":i.getState().highlightedIndex===a},h,p)},i.clearItems=function(){i.items=[]},i.reset=function(e,t){void 0===e&&(e={}),e=Oe(e),i.internalSetState((function(t){var n=t.selectedItem;return o({isOpen:i.props.defaultIsOpen,highlightedIndex:i.props.defaultHighlightedIndex,inputValue:i.props.itemToString(n)},e)}),t)},i.toggleMenu=function(e,t){void 0===e&&(e={}),e=Oe(e),i.internalSetState((function(t){var n=t.isOpen;return o({isOpen:!n},n&&{highlightedIndex:i.props.defaultHighlightedIndex},e)}),(function(){var n=i.getState(),o=n.isOpen,r=n.highlightedIndex;o&&i.getItemCount()>0&&"number"==typeof r&&i.setHighlightedIndex(r,e),he(t)()}))},i.openMenu=function(e){i.internalSetState({isOpen:!0},e)},i.closeMenu=function(e){i.internalSetState({isOpen:!1},e)},i.updateStatus=ye((function(){var e=i.getState(),t=i.items[e.highlightedIndex],n=i.getItemCount(),r=i.props.getA11yStatusMessage(o({itemToString:i.props.itemToString,previousResultCount:i.previousResultCount,resultCount:n,highlightedItem:t},e));i.previousResultCount=n,He(r,i.props.environment.document)}),200);var u=i.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=i.getState({highlightedIndex:a,isOpen:p,inputValue:g,selectedItem:m});return null!=I.selectedItem&&void 0===i.props.initialInputValue&&(I.inputValue=i.props.itemToString(I.selectedItem)),i.state=I,i}s=e,(u=l).prototype=Object.create(s.prototype),u.prototype.constructor=u,i(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(),r=this.getState().highlightedIndex;if(o>0){var i=Pe(e,r,o,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},a.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,r=e.isOpen,i=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,b=this.clearSelection,x=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:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:u,highlightedIndex:t,inputValue:n,isOpen:r,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},r=function(){e.isTouchMove=!0},i=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",r),u.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",o),u.removeEventListener("touchmove",r),u.removeEventListener("touchend",i)}},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 r=e.props,i=e.type,u={};Object.keys(t).forEach((function(r){!function(e,t,n,r){var i=t.props,u=t.type,s="on"+Je(e)+"Change";i[s]&&void 0!==r[e]&&r[e]!==n[e]&&i[s](o({type:u},r))}(r,e,t,n),n[r]!==t[r]&&(u[r]=n[r])})),r.onStateChange&&Object.keys(u).length&&r.onStateChange(o({type:i},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,r=e.labelId,i=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:r||o+"-label",menuId:i||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 r,i;if(void 0===e){if(void 0===t)throw new Error(o);r=n[t],i=t}else i=void 0===t?n.indexOf(e):t,r=e;return[r,i]}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,r){var i=t.useRef(),u=t.useRef(),s=t.useCallback((function(t,n){u.current=n,t=Me(t,n.props);var r=e(t,n);return n.props.stateReducer(t,o({},n,{changes:r}))}),[e]),l=t.useReducer(s,n),a=l[0],c=l[1],d=Qe(r),p=t.useCallback((function(e){return c(o({props:d.current},e))}),[d]),f=u.current;return t.useEffect((function(){f&&i.current&&i.current!==a&&ze(f,Me(i.current,f.props),a),i.current=a}),[a,r,f]),[a,p]}function et(e,t,n){var o=Ze(e,t,n),r=o[0],i=o[1];return[Me(r,n),i]}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 r=e["initial"+Je(t)];return void 0!==r?r:nt(e,t,n)}function rt(e){var t=ot(e,"selectedItem"),n=ot(e,"isOpen"),o=ot(e,"highlightedIndex"),r=ot(e,"inputValue");return{highlightedIndex:o<0&&t&&n?e.items.indexOf(t):o,isOpen:n,selectedItem:t,inputValue:r}}function it(e,t,n){var o=e.items,r=e.initialHighlightedIndex,i=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===o.length?-1:void 0!==r&&s===r?r:void 0!==i?i:u?o.indexOf(u):0===n?-1:n<0?o.length-1:0}function ut(e,n,o,r){var i=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(null!=(null==o?void 0:o.addEventListener)){var t=function(){i.current.isMouseDown=!0},u=function(t){i.current.isMouseDown=!1,e&&!Te(t.target,n.map((function(e){return e.current})),o)&&r()},s=function(){i.current.isTouchMove=!1},l=function(){i.current.isTouchMove=!0},a=function(t){!e||i.current.isTouchMove||Te(t.target,n.map((function(e){return e.current})),o,!1)||r()};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]),i}var st=function(){return me};function lt(e,r,i){var u=i.isInitialMount,s=i.highlightedIndex,l=i.items,a=i.environment,c=n(i,Ue);t.useEffect((function(){u||qe((function(){return e(o({highlightedIndex:s,highlightedItem:l[s],resultCount:l.length},c))}),a.document)}),r)}function at(e){var n=e.highlightedIndex,o=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return Ye((function(){n<0||!o||!Object.keys(r.current).length||(!1===l.current?l.current=!0:s(i(n),u))}),[n]),l}var ct=me;function dt(e,t,n){var r;return void 0===n&&(n=!0),o({isOpen:!1,highlightedIndex:-1},(null==(r=e.items)?void 0:r.length)&&t>=0&&o({selectedItem:e.items[t],isOpen:nt(e,"isOpen"),highlightedIndex:nt(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function pt(e,t,n){var r,i=t.type,u=t.props;switch(i){case n.ItemMouseMove:r={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:r={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:r={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:it(u,e,0)};break;case n.FunctionOpenMenu:r={isOpen:!0,highlightedIndex:it(u,e,0)};break;case n.FunctionCloseMenu:r={isOpen:!1};break;case n.FunctionSetHighlightedIndex:r={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:r={inputValue:t.inputValue};break;case n.FunctionReset:r={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,r)}var ft=function(){return ft=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ft.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 gt=ft(ft({},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.":""}}),ht=me,mt=0,It=1,vt=2,yt=3,bt=4,xt=5,wt=6,St=7,Ct=8,kt=9,Ot=10,Mt=11,Dt=12,Et=13,Pt=14,Kt=15,Tt=16,Rt=17,Ht=18,Ft=19,Vt=20,At=21,Nt=Object.freeze({__proto__:null,ToggleButtonClick:mt,ToggleButtonKeyDownArrowDown:It,ToggleButtonKeyDownArrowUp:vt,ToggleButtonKeyDownCharacter:yt,ToggleButtonKeyDownEscape:bt,ToggleButtonKeyDownHome:xt,ToggleButtonKeyDownEnd:wt,ToggleButtonKeyDownEnter:St,ToggleButtonKeyDownSpaceButton:Ct,ToggleButtonKeyDownPageUp:kt,ToggleButtonKeyDownPageDown:Ot,ToggleButtonBlur:Mt,MenuMouseLeave:Dt,ItemMouseMove:Et,ItemClick:Pt,FunctionToggleMenu:Kt,FunctionOpenMenu:Tt,FunctionCloseMenu:Rt,FunctionSetHighlightedIndex:Ht,FunctionSelectItem:Ft,FunctionSetInputValue:Vt,FunctionReset:At});function Bt(e,t){var n,r,i=t.type,u=t.props,s=t.altKey;switch(i){case Pt:r={isOpen:nt(u,"isOpen"),highlightedIndex:nt(u,"highlightedIndex"),selectedItem:u.items[t.index]};break;case yt:var l=t.key,a=""+e.inputValue+l,c=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,o=e.items,r=e.itemToString,i=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&&r(a).toLowerCase().startsWith(u)){var c=i(l);if(!(null==c?void 0:c.hasAttribute("disabled")))return l}}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.indexOf(e.selectedItem):e.highlightedIndex,items:u.items,itemToString:u.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});r={inputValue:a,highlightedIndex:c,isOpen:!0};break;case It:r={highlightedIndex:e.isOpen?Pe(1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1):s&&null==e.selectedItem?-1:it(u,e,1),isOpen:!0};break;case vt:if(e.isOpen&&s)r=dt(u,e.highlightedIndex,!1);else r={highlightedIndex:e.isOpen?Pe(-1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1):it(u,e,-1),isOpen:!0};break;case St:case Ct:r=dt(u,e.highlightedIndex,!1);break;case xt:r={highlightedIndex:Ke(1,0,u.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case wt:r={highlightedIndex:Ke(-1,u.items.length-1,u.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case kt:r={highlightedIndex:Pe(-10,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1)};break;case Ot:r={highlightedIndex:Pe(10,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1)};break;case bt:r={isOpen:!1,highlightedIndex:-1};break;case Mt:r=o({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case Ft:r={selectedItem:t.selectedItem};break;default:return pt(e,t,Nt)}return o({},e,r)}var Lt=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],_t=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],$t=["item","index","onMouseMove","onClick","onPress","refKey","ref","disabled"];function jt(e){void 0===e&&(e={}),ht();var r=o({},gt,e),i=r.items,u=r.scrollIntoView,s=r.environment,l=r.itemToString,a=r.getA11ySelectionMessage,c=r.getA11yStatusMessage,d=et(Bt,rt(r),r),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),b=t.useRef({}),x=t.useRef(null),w=Xe(r),S=t.useRef(),C=t.useRef(!0),k=Qe({state:p,props:r}),O=t.useCallback((function(e){return b.current[w.getItemId(e)]}),[w]);lt(c,[g,h,I,i],o({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p)),lt(a,[m],o({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p));var M=at({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:b,scrollIntoView:u,getItemNodeFromIndex:O});t.useEffect((function(){return x.current=ye((function(e){e({type:Vt,inputValue:""})}),500),function(){x.current.cancel()}}),[]),t.useEffect((function(){I&&x.current(f)}),[f,I]),ct({isInitialMount:C.current,props:r,state:p}),t.useEffect((function(){C.current||(S.current=i.length)}));var D=ut(g,[y,v],s,(function(){f({type:Mt})})),E=st();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){g||(b.current={})}),[g]);var P=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:It,getItemNodeFromIndex:O,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:vt,getItemNodeFromIndex:O,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:xt,getItemNodeFromIndex:O})},End:function(e){e.preventDefault(),f({type:wt,getItemNodeFromIndex:O})},Escape:function(){k.current.state.isOpen&&f({type:bt})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?St:mt})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:kt,getItemNodeFromIndex:O}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ot,getItemNodeFromIndex:O}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:yt,key:" ",getItemNodeFromIndex:O}):f({type:Ct}):f({type:mt})}}}),[f,O,k]),K=t.useCallback((function(){f({type:Kt})}),[f]),T=t.useCallback((function(){f({type:Rt})}),[f]),R=t.useCallback((function(){f({type:Tt})}),[f]),H=t.useCallback((function(e){f({type:Ht,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:Ft,selectedItem:e})}),[f]),V=t.useCallback((function(){f({type:At})}),[f]),A=t.useCallback((function(e){f({type:Vt,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 r,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s;i.onKeyDown,i.onBlur;var a=i.ref,c=n(i,Lt),d=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==d&&d,l,y),o(((r={})[l]=xe(a,(function(e){y.current=e})),r.id=w.menuId,r.role="listbox",r["aria-labelledby"]=w.labelId,r.tabIndex=-1,r.onMouseLeave=be(u,(function(){f({type:Dt})})),r),c)}),[f,E,w]);return{getToggleButtonProps:t.useCallback((function(e,t){var r,i=void 0===e?{}:e,u=i.onBlur,s=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,c=void 0===a?"ref":a,d=i.ref,p=n(i,_t),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=k.current.state,I=o(((r={})[c]=xe(d,(function(e){v.current=e})),r["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?w.getItemId(m.highlightedIndex):"",r["aria-controls"]=w.menuId,r["aria-expanded"]=k.current.state.isOpen,r["aria-haspopup"]="listbox",r["aria-labelledby"]=""+w.labelId,r.id=w.toggleButtonId,r.role="combobox",r.tabIndex=0,r.onBlur=be(u,(function(){m.isOpen&&!D.current.isMouseDown&&f({type:Mt})})),r),p);return p.disabled||(I.onClick=be(s,(function(){f({type:mt})})),I.onKeyDown=be(l,(function(e){var t=Ee(e);t&&P[t]?P[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:yt,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,r=void 0===e?{}:e,i=r.item,u=r.index,s=r.onMouseMove,l=r.onClick;r.onPress;var a=r.refKey,c=void 0===a?"ref":a,d=r.ref,p=r.disabled,g=n(r,$t),h=k.current,I=h.state,v=Ge(i,u,h.props.items,"Pass either item or index to getItemProps!"),y=v[0],x=v[1],S=o(((t={disabled:p,role:"option","aria-selected":""+(y===m),id:w.getItemId(x)})[c]=xe(d,(function(e){e&&(b.current[w.getItemId(x)]=e)})),t),g);return p||(S.onClick=be(l,(function(){f({type:Pt,index:x})}))),S.onMouseMove=be(s,(function(){x!==I.highlightedIndex&&(M.current=!1,f({type:Et,index:x,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}}jt.stateChangeTypes=Nt;var Ut=0,Wt=1,zt=2,qt=3,Yt=4,Xt=5,Gt=6,Jt=7,Qt=8,Zt=9,en=10,tn=11,nn=12,on=13,rn=14,un=15,sn=16,ln=17,an=18,cn=19,dn=20,pn=21,fn=22,gn=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ut,InputKeyDownArrowUp:Wt,InputKeyDownEscape:zt,InputKeyDownHome:qt,InputKeyDownEnd:Yt,InputKeyDownPageUp:Xt,InputKeyDownPageDown:Gt,InputKeyDownEnter:Jt,InputChange:Qt,InputBlur:Zt,InputFocus:en,MenuMouseLeave:tn,ItemMouseMove:nn,ItemClick:on,ToggleButtonClick:rn,FunctionToggleMenu:un,FunctionOpenMenu:sn,FunctionCloseMenu:ln,FunctionSetHighlightedIndex:an,FunctionSelectItem:cn,FunctionSetInputValue:dn,FunctionReset:pn,ControlledPropUpdatedSelectedItem:fn});K.array.isRequired,K.func,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 hn=me,mn=o({},tt,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:Se});function In(e,t){var n,r,i=t.type,u=t.props,s=t.altKey;switch(i){case on:r={isOpen:nt(u,"isOpen"),highlightedIndex:nt(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case Ut:r=e.isOpen?{highlightedIndex:Pe(1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:it(u,e,1,t.getItemNodeFromIndex),isOpen:u.items.length>=0};break;case Wt:r=e.isOpen?s?dt(u,e.highlightedIndex):{highlightedIndex:Pe(-1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:it(u,e,-1,t.getItemNodeFromIndex),isOpen:u.items.length>=0};break;case Jt:r=dt(u,e.highlightedIndex);break;case zt:r=o({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Xt:r={highlightedIndex:Pe(-10,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1)};break;case Gt:r={highlightedIndex:Pe(10,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1)};break;case qt:r={highlightedIndex:Ke(1,0,u.items.length,t.getItemNodeFromIndex,!1)};break;case Yt:r={highlightedIndex:Ke(-1,u.items.length-1,u.items.length,t.getItemNodeFromIndex,!1)};break;case Zt:r=o({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&t.selectItem&&{selectedItem:u.items[e.highlightedIndex],inputValue:u.itemToString(u.items[e.highlightedIndex])});break;case Qt:r={isOpen:!0,highlightedIndex:nt(u,"highlightedIndex"),inputValue:t.inputValue};break;case en:r={isOpen:!0,highlightedIndex:it(u,e,0)};break;case cn:r={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case fn:r={inputValue:t.inputValue};break;default:return pt(e,t,gn)}return o({},e,r)}var vn=["onMouseLeave","refKey","ref"],yn=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],bn=["onClick","onPress","refKey","ref"],xn=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function wn(e){void 0===e&&(e={}),hn();var r=o({},mn,e),i=r.initialIsOpen,u=r.defaultIsOpen,s=r.items,l=r.scrollIntoView,a=r.environment,c=r.getA11yStatusMessage,d=r.getA11ySelectionMessage,p=r.itemToString,f=function(e){var t=rt(e),n=t.selectedItem,r=t.inputValue;return""===r&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(r=e.itemToString(n)),o({},t,{inputValue:r})}(r),g=function(e,n,o){var r=t.useRef(),i=Ze(e,n,o),u=i[0],s=i[1];return t.useEffect((function(){De(o,"selectedItem")&&(o.selectedItemChanged(r.current,o.selectedItem)&&s({type:fn,inputValue:o.itemToString(o.selectedItem)}),r.current=u.selectedItem===r.current?o.selectedItem:u.selectedItem)}),[u.selectedItem,o.selectedItem]),[Me(u,o),s]}(In,f,r),h=g[0],m=g[1],I=h.isOpen,v=h.highlightedIndex,y=h.selectedItem,b=h.inputValue,x=t.useRef(null),w=t.useRef({}),S=t.useRef(null),C=t.useRef(null),k=t.useRef(!0),O=Xe(r),M=t.useRef(),D=Qe({state:h,props:r}),E=t.useCallback((function(e){return w.current[O.getItemId(e)]}),[O]);lt(c,[I,v,b,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:x.current,highlightedIndex:v,isOpen:I,itemRefs:w,scrollIntoView:l,getItemNodeFromIndex:E});ct({isInitialMount:k.current,props:r,state:h}),t.useEffect((function(){(i||u||I)&&S.current&&S.current.focus()}),[]),t.useEffect((function(){k.current||(M.current=s.length)}));var K=ut(I,[S,x,C],a,(function(){m({type:Zt,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:Ut,altKey:e.altKey,getItemNodeFromIndex:E})},ArrowUp:function(e){e.preventDefault(),m({type:Wt,altKey:e.altKey,getItemNodeFromIndex:E})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:qt,getItemNodeFromIndex:E}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Yt,getItemNodeFromIndex:E}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),m({type:zt}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),m({type:Jt,getItemNodeFromIndex:E}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Xt,getItemNodeFromIndex:E}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Gt,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 r,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,c=n(i,vn),d=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==d&&d,l,x),o(((r={})[l]=xe(a,(function(e){x.current=e})),r.id=O.menuId,r.role="listbox",r["aria-labelledby"]=O.labelId,r.onMouseLeave=be(u,(function(){m({type:tn})})),r),c)}),[m,T,O]),V=t.useCallback((function(e){var t,r,i=void 0===e?{}:e,u=i.item,s=i.index,l=i.refKey,a=void 0===l?"ref":l,c=i.ref,d=i.onMouseMove,p=i.onMouseDown,f=i.onClick;i.onPress;var g=i.disabled,h=n(i,yn),I=D.current,v=I.props,y=I.state,b=Ge(u,s,v.items,"Pass either item or index to getItemProps!")[1],x=f;return o(((t={})[a]=xe(c,(function(e){e&&(w.current[O.getItemId(b)]=e)})),t.disabled=g,t.role="option",t["aria-selected"]=""+(b===y.highlightedIndex),t.id=O.getItemId(b),t),!g&&((r={}).onClick=be(x,(function(){m({type:on,index:b})})),r),{onMouseMove:be(d,(function(){b!==y.highlightedIndex&&(P.current=!1,m({type:nn,index:b,disabled:g}))})),onMouseDown:be(p,(function(e){return e.preventDefault()}))},h)}),[m,D,P,O]),A=t.useCallback((function(e){var t,r=void 0===e?{}:e,i=r.onClick;r.onPress;var u=r.refKey,s=void 0===u?"ref":u,l=r.ref,a=n(r,bn),c=D.current.state;return o(((t={})[s]=xe(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(i,(function(){m({type:rn})}))}),a)}),[m,D,O]),N=t.useCallback((function(e,t){var r,i=void 0===e?{}:e,u=i.onKeyDown,s=i.onChange,l=i.onInput,a=i.onFocus,c=i.onBlur;i.onChangeText;var d=i.refKey,p=void 0===d?"ref":d,f=i.ref,g=n(i,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=be(s,l,(function(e){m({type:Qt,inputValue:e.target.value})})),I.onKeyDown=be(u,(function(e){var t=Ee(e);t&&R[t]&&R[t](e)})),I.onBlur=be(c,(function(e){v.isOpen&&!K.current.isMouseDown&&m({type:Zt,selectItem:null!==e.relatedTarget})})),I.onFocus=be(a,(function(){v.isOpen||m({type:en})})),y=I);return o(((r={})[p]=xe(f,(function(e){S.current=e})),r["aria-activedescendant"]=v.isOpen&&v.highlightedIndex>-1?O.getItemId(v.highlightedIndex):"",r["aria-autocomplete"]="list",r["aria-controls"]=O.menuId,r["aria-expanded"]=v.isOpen,r["aria-labelledby"]=O.labelId,r.autoComplete="off",r.id=O.inputId,r.role="combobox",r.value=v.inputValue,r),y,g)}),[m,R,D,K,T,O]),B=t.useCallback((function(){m({type:un})}),[m]),L=t.useCallback((function(){m({type:ln})}),[m]),_=t.useCallback((function(){m({type:sn})}),[m]),$=t.useCallback((function(e){m({type:an,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:dn,inputValue:e})}),[m]),selectItem:j,reset:t.useCallback((function(){m({type:pn})}),[m]),highlightedIndex:v,isOpen:I,selectedItem:y,inputValue:b}}wn.stateChangeTypes=gn;var Sn={activeIndex:-1,selectedItems:[]};function Cn(e,t){return ot(e,t,Sn)}function kn(e,t){return nt(e,t,Sn)}function On(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 Mn={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"},Dn=me,En=0,Pn=1,Kn=2,Tn=3,Rn=4,Hn=5,Fn=6,Vn=7,An=8,Nn=9,Bn=10,Ln=11,_n=12,$n=Object.freeze({__proto__:null,SelectedItemClick:En,SelectedItemKeyDownDelete:Pn,SelectedItemKeyDownBackspace:Kn,SelectedItemKeyDownNavigationNext:Tn,SelectedItemKeyDownNavigationPrevious:Rn,DropdownKeyDownNavigationPrevious:Hn,DropdownKeyDownBackspace:Fn,DropdownClick:Vn,FunctionAddSelectedItem:An,FunctionRemoveSelectedItem:Nn,FunctionSetSelectedItems:Bn,FunctionSetActiveIndex:Ln,FunctionReset:_n});function jn(e,t){var n,r=t.type,i=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(r){case En:n={activeIndex:i};break;case Rn:n={activeIndex:l-1<0?0:l-1};break;case Tn:n={activeIndex:l+1>=a.length?-1:l+1};break;case Kn:case Pn: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 Hn:n={activeIndex:a.length-1};break;case Fn:n={selectedItems:a.slice(0,a.length-1)};break;case An:n={selectedItems:[].concat(a,[s])};break;case Vn:n={activeIndex:-1};break;case Nn: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 Bn:n={selectedItems:t.selectedItems};break;case Ln:n={activeIndex:t.activeIndex};break;case _n:n={activeIndex:kn(u,"activeIndex"),selectedItems:kn(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return o({},e,n)}var Un=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Wn=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function zn(e){void 0===e&&(e={}),Dn();var r=o({},Mn,e),i=r.getA11yRemovalMessage,u=r.itemToString,s=r.environment,l=r.keyNavigationNext,a=r.keyNavigationPrevious,c=et(jn,function(e){return{activeIndex:Cn(e,"activeIndex"),selectedItems:Cn(e,"selectedItems")}}(r),r),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:r});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(i({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:r,state:d});var b=st();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var x=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:Rn})},e[l]=function(){p({type:Tn})},e.Delete=function(){p({type:Pn})},e.Backspace=function(){p({type:Kn})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){On(e)&&p({type:Hn})},e.Backspace=function(e){On(e)&&p({type:Fn})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,r=void 0===e?{}:e,i=r.refKey,u=void 0===i?"ref":i,s=r.ref,l=r.onClick,a=r.onKeyDown,c=r.selectedItem,d=r.index,f=n(r,Un),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]=xe(s,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=be(l,(function(){p({type:En,index:h})})),t.onKeyDown=be(a,(function(e){var t=Ee(e);t&&x[t]&&x[t](e)})),t),f)}),[p,y,x]),getDropdownProps:t.useCallback((function(e,t){var r,i=void 0===e?{}:e,u=i.refKey,s=void 0===u?"ref":u,l=i.ref,a=i.onKeyDown,c=i.onClick,d=i.preventKeyAction,f=void 0!==d&&d,g=n(i,Wn),h=(void 0===t?{}:t).suppressRefError;return b("getDropdownProps",void 0!==h&&h,s,m),o(((r={})[s]=xe(l,(function(e){e&&(m.current=e)})),r),!f&&{onKeyDown:be(a,(function(e){var t=Ee(e);t&&w[t]&&w[t](e)})),onClick:be(c,(function(){p({type:Vn})}))},g)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:An,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Nn,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Bn,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Ln,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:_n})}),[p]),selectedItems:g,activeIndex:f}}zn.stateChangeTypes=$n,e.default=je,e.resetIdCounter=function(){ge=0},e.useCombobox=wn,e.useMultipleSelection=zn,e.useSelect=jt,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,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}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 r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(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,b=l?Symbol.for("react.suspense_list"):60120,x=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 x: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=x,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)===x},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===b||"object"==typeof e&&null!==e&&(e.$$typeof===w||e.$$typeof===x||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,r,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){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,re=H,ie=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=re,T.Profiler=ie,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,r,i,u,s)=>i<e&&u>t||i>e&&u<t?0:i<=e&&s<=n||u>=t&&s>=n?i-e-o:u>t&&s<n||i<e&&s>n?u-t+r:0,pe=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var fe=(e,t)=>{var n,o,r,i,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!=(i=null==(r=window.visualViewport)?void 0:r.height)?i:innerHeight,y=null!=(u=window.scrollX)?u:pageXOffset,b=null!=(s=window.scrollY)?s:pageYOffset,{height:x,width:w,top:S,right:C,bottom:k,left:O}=e.getBoundingClientRect(),M="start"===a||"nearest"===a?S:"end"===a?k:S+x/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:r,right:i,bottom:u,left:s}=t.getBoundingClientRect();if("if-needed"===l&&S>=0&&O>=0&&k<=v&&C<=I&&S>=r&&k<=u&&O>=s&&C<=i)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(b,b+v,v,f,P,b+M,b+M+x,x):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+b),T=Math.max(0,T+y);else{K="start"===a?M-r-f:"end"===a?M-u+P+H:"nearest"===a?de(r,u,n,f,P+H,M,M+x,x):M-(r+n/2)+H/2,T="start"===c?D-s-p:"center"===c?D-(s+o/2)+R/2:"end"===c?D-i+m+R:de(s,i,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 r(){for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];o(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return r.cancel=o,r}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),r=1;r<n;r++)o[r-1]=arguments[r];return t.some((function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function xe(){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,r){if(void 0===r&&(r=!0),0===n)return-1;var i=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var u=t+e;u<0?u=r?i:0:u>i&&(u=r?0:i);var s=Ke(e,u,n,o,r);return-1===s?t>=n?-1:t:s}function Ke(e,t,n,o,r){var i=o(t);if(!i||!i.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 r?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 i=e.call(this,t)||this;i.id=i.props.id||"downshift-"+we(),i.menuId=i.props.menuId||i.id+"-menu",i.labelId=i.props.labelId||i.id+"-label",i.inputId=i.props.inputId||i.id+"-input",i.getItemId=i.props.getItemId||function(e){return i.id+"-item-"+e},i.input=null,i.items=[],i.itemCount=null,i.previousResultCount=0,i.timeoutIds=[],i.internalSetTimeout=function(e,t){var n=setTimeout((function(){i.timeoutIds=i.timeoutIds.filter((function(e){return e!==n})),e()}),t);i.timeoutIds.push(n)},i.setItemCount=function(e){i.itemCount=e},i.unsetItemCount=function(){i.itemCount=null},i.setHighlightedIndex=function(e,t){void 0===e&&(e=i.props.defaultHighlightedIndex),void 0===t&&(t={}),t=Oe(t),i.internalSetState(o({highlightedIndex:e},t))},i.clearSelection=function(e){i.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:i.props.defaultHighlightedIndex,isOpen:i.props.defaultIsOpen},e)},i.selectItem=function(e,t,n){t=Oe(t),i.internalSetState(o({isOpen:i.props.defaultIsOpen,highlightedIndex:i.props.defaultHighlightedIndex,selectedItem:e,inputValue:i.props.itemToString(e)},t),n)},i.selectItemAtIndex=function(e,t,n){var o=i.items[e];null!=o&&i.selectItem(o,t,n)},i.selectHighlightedItem=function(e,t){return i.selectItemAtIndex(i.getState().highlightedIndex,e,t)},i.internalSetState=function(e,t){var n,r,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&i.props.onInputValueChange(e.inputValue,o({},i.getStateAndHelpers(),e)),i.setState((function(t){t=i.getState(t);var l=s?e(t):e;l=i.props.stateReducer(t,l),n=l.hasOwnProperty("selectedItem");var a={};return n&&l.selectedItem!==t.selectedItem&&(r=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(i.props,e)||(a[e]=l[e]))})),s&&l.hasOwnProperty("inputValue")&&i.props.onInputValueChange(l.inputValue,o({},i.getStateAndHelpers(),l)),a}),(function(){he(t)(),Object.keys(u).length>1&&i.props.onStateChange(u,i.getStateAndHelpers()),n&&i.props.onSelect(e.selectedItem,i.getStateAndHelpers()),void 0!==r&&i.props.onChange(r,i.getStateAndHelpers()),i.props.onUserAction(u,i.getStateAndHelpers())}))},i.rootRef=function(e){return i._rootNode=e},i.getRootProps=function(e,t){var r,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;i.getRootProps.called=!0,i.getRootProps.refKey=l,i.getRootProps.suppressRefError=p;var f=i.getState().isOpen;return o(((r={})[l]=xe(a,i.rootRef),r.role="combobox",r["aria-expanded"]=f,r["aria-haspopup"]="listbox",r["aria-owns"]=f?i.menuId:null,r["aria-labelledby"]=i.labelId,r),c)},i.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 r=this.items[o],i=this.getItemNodeFromIndex(o);if(null==r||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(o({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},i.buttonKeyDownHandlers=o({},i.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),i.inputKeyDownHandlers=o({},i.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var o=this.getItemCount();if(!(o<=0)&&n){var r=Ke(1,0,o,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(r,{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 r=Ke(-1,o-1,o,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(r,{type:8})}}}}),i.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick;t.onPress;var u=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=n(t,Ne),c=i.getState().isOpen,d={onClick:be(r,i.buttonHandleClick),onKeyDown:be(u,i.buttonHandleKeyDown),onKeyUp:be(s,i.buttonHandleKeyUp),onBlur:be(l,i.buttonHandleBlur)};return o({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},i.buttonHandleKeyUp=function(e){e.preventDefault()},i.buttonHandleKeyDown=function(e){var t=Ee(e);i.buttonKeyDownHandlers[t]&&i.buttonKeyDownHandlers[t].call(r(i),e)},i.buttonHandleClick=function(e){e.preventDefault(),i.props.environment.document.activeElement===i.props.environment.document.body&&e.target.focus(),i.internalSetTimeout((function(){return i.toggleMenu({type:13})}))},i.buttonHandleBlur=function(e){var t=e.target;i.internalSetTimeout((function(){i.isMouseDown||null!=i.props.environment.document.activeElement&&i.props.environment.document.activeElement.id===i.inputId||i.props.environment.document.activeElement===t||i.reset({type:14})}))},i.getLabelProps=function(e){return o({htmlFor:i.inputId,id:i.labelId},e)},i.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=n(t,Be),c={};var d,p=i.getState(),f=p.inputValue,g=p.isOpen,h=p.highlightedIndex;a.disabled||((d={}).onChange=be(s,l,i.inputHandleChange),d.onKeyDown=be(r,i.inputHandleKeyDown),d.onBlur=be(u,i.inputHandleBlur),c=d);return o({"aria-autocomplete":"list","aria-activedescendant":g&&"number"==typeof h&&h>=0?i.getItemId(h):null,"aria-controls":g?i.menuId:null,"aria-labelledby":a&&a["aria-label"]?void 0:i.labelId,autoComplete:"off",value:f,id:i.inputId},c,a)},i.inputHandleKeyDown=function(e){var t=Ee(e);t&&i.inputKeyDownHandlers[t]&&i.inputKeyDownHandlers[t].call(r(i),e)},i.inputHandleChange=function(e){i.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:i.props.defaultHighlightedIndex})},i.inputHandleBlur=function(){i.internalSetTimeout((function(){var e=i.props.environment.document&&!!i.props.environment.document.activeElement&&!!i.props.environment.document.activeElement.dataset&&i.props.environment.document.activeElement.dataset.toggle&&i._rootNode&&i._rootNode.contains(i.props.environment.document.activeElement);i.isMouseDown||e||i.reset({type:10})}))},i.menuRef=function(e){i._menuNode=e},i.getMenuProps=function(e,t){var r,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 i.getMenuProps.called=!0,i.getMenuProps.refKey=l,i.getMenuProps.suppressRefError=p,o(((r={})[l]=xe(a,i.menuRef),r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?null:i.labelId,r.id=i.menuId,r),c)},i.getItemProps=function(e){var t,r=void 0===e?{}:e,u=r.onMouseMove,s=r.onMouseDown,l=r.onClick;r.onPress;var a=r.index,c=r.item,d=void 0===c?void 0:c,p=n(r,_e);void 0===a?(i.items.push(d),a=i.items.indexOf(d)):i.items[a]=d;var f=l,g=((t={onMouseMove:be(u,(function(){a!==i.getState().highlightedIndex&&(i.setHighlightedIndex(a,{type:2}),i.avoidScrolling=!0,i.internalSetTimeout((function(){return i.avoidScrolling=!1}),250))})),onMouseDown:be(s,(function(e){e.preventDefault()}))}).onClick=be(f,(function(){i.selectItemAtIndex(a,{type:9})})),t),h=p.disabled?{onMouseDown:g.onMouseDown}:g;return o({id:i.getItemId(a),role:"option","aria-selected":i.getState().highlightedIndex===a},h,p)},i.clearItems=function(){i.items=[]},i.reset=function(e,t){void 0===e&&(e={}),e=Oe(e),i.internalSetState((function(t){var n=t.selectedItem;return o({isOpen:i.props.defaultIsOpen,highlightedIndex:i.props.defaultHighlightedIndex,inputValue:i.props.itemToString(n)},e)}),t)},i.toggleMenu=function(e,t){void 0===e&&(e={}),e=Oe(e),i.internalSetState((function(t){var n=t.isOpen;return o({isOpen:!n},n&&{highlightedIndex:i.props.defaultHighlightedIndex},e)}),(function(){var n=i.getState(),o=n.isOpen,r=n.highlightedIndex;o&&i.getItemCount()>0&&"number"==typeof r&&i.setHighlightedIndex(r,e),he(t)()}))},i.openMenu=function(e){i.internalSetState({isOpen:!0},e)},i.closeMenu=function(e){i.internalSetState({isOpen:!1},e)},i.updateStatus=ye((function(){var e=i.getState(),t=i.items[e.highlightedIndex],n=i.getItemCount(),r=i.props.getA11yStatusMessage(o({itemToString:i.props.itemToString,previousResultCount:i.previousResultCount,resultCount:n,highlightedItem:t},e));i.previousResultCount=n,He(r,i.props.environment.document)}),200);var u=i.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=i.getState({highlightedIndex:a,isOpen:p,inputValue:g,selectedItem:m});return null!=I.selectedItem&&void 0===i.props.initialInputValue&&(I.inputValue=i.props.itemToString(I.selectedItem)),i.state=I,i}s=e,(u=l).prototype=Object.create(s.prototype),u.prototype.constructor=u,i(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(),r=this.getState().highlightedIndex;if(o>0){var i=Pe(e,r,o,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},a.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,r=e.isOpen,i=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,b=this.clearSelection,x=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:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:u,highlightedIndex:t,inputValue:n,isOpen:r,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},r=function(){e.isTouchMove=!0},i=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",r),u.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),u.removeEventListener("mousedown",t),u.removeEventListener("mouseup",n),u.removeEventListener("touchstart",o),u.removeEventListener("touchmove",r),u.removeEventListener("touchend",i)}},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 r=e.props,i=e.type,u={};Object.keys(t).forEach((function(r){!function(e,t,n,r){var i=t.props,u=t.type,s="on"+Je(e)+"Change";i[s]&&void 0!==r[e]&&r[e]!==n[e]&&i[s](o({type:u},r))}(r,e,t,n),n[r]!==t[r]&&(u[r]=n[r])})),r.onStateChange&&Object.keys(u).length&&r.onStateChange(o({type:i},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,r=e.labelId,i=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId;return t.useRef({labelId:r||o+"-label",menuId:i||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 r,i;if(void 0===e){if(void 0===t)throw new Error(o);r=n[t],i=t}else i=void 0===t?n.indexOf(e):t,r=e;return[r,i]}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,r){var i=t.useRef(),u=t.useRef(),s=t.useCallback((function(t,n){u.current=n,t=Me(t,n.props);var r=e(t,n);return n.props.stateReducer(t,o({},n,{changes:r}))}),[e]),l=t.useReducer(s,n),a=l[0],c=l[1],d=Qe(r),p=t.useCallback((function(e){return c(o({props:d.current},e))}),[d]),f=u.current;return t.useEffect((function(){f&&i.current&&i.current!==a&&ze(f,Me(i.current,f.props),a),i.current=a}),[a,r,f]),[a,p]}function et(e,t,n){var o=Ze(e,t,n),r=o[0],i=o[1];return[Me(r,n),i]}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 r=e["initial"+Je(t)];return void 0!==r?r:nt(e,t,n)}function rt(e){var t=ot(e,"selectedItem"),n=ot(e,"isOpen"),o=ot(e,"highlightedIndex"),r=ot(e,"inputValue");return{highlightedIndex:o<0&&t&&n?e.items.indexOf(t):o,isOpen:n,selectedItem:t,inputValue:r}}function it(e,t,n){var o=e.items,r=e.initialHighlightedIndex,i=e.defaultHighlightedIndex,u=t.selectedItem,s=t.highlightedIndex;return 0===o.length?-1:void 0!==r&&s===r?r:void 0!==i?i:u?o.indexOf(u):0===n?-1:n<0?o.length-1:0}function ut(e,n,o,r){var i=t.useRef({isMouseDown:!1,isTouchMove:!1});return t.useEffect((function(){if(null!=(null==o?void 0:o.addEventListener)){var t=function(){i.current.isMouseDown=!0},u=function(t){i.current.isMouseDown=!1,e&&!Te(t.target,n.map((function(e){return e.current})),o)&&r()},s=function(){i.current.isTouchMove=!1},l=function(){i.current.isTouchMove=!0},a=function(t){!e||i.current.isTouchMove||Te(t.target,n.map((function(e){return e.current})),o,!1)||r()};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]),i}var st=function(){return me};function lt(e,r,i){var u=i.isInitialMount,s=i.highlightedIndex,l=i.items,a=i.environment,c=n(i,Ue);t.useEffect((function(){u||qe((function(){return e(o({highlightedIndex:s,highlightedItem:l[s],resultCount:l.length},c))}),a.document)}),r)}function at(e){var n=e.highlightedIndex,o=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,u=e.menuElement,s=e.scrollIntoView,l=t.useRef(!0);return Ye((function(){n<0||!o||!Object.keys(r.current).length||(!1===l.current?l.current=!0:s(i(n),u))}),[n]),l}var ct=me;function dt(e,t,n){var r;return void 0===n&&(n=!0),o({isOpen:!1,highlightedIndex:-1},(null==(r=e.items)?void 0:r.length)&&t>=0&&o({selectedItem:e.items[t],isOpen:nt(e,"isOpen"),highlightedIndex:nt(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function pt(e,t,n){var r,i=t.type,u=t.props;switch(i){case n.ItemMouseMove:r={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:r={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:r={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:it(u,e,0)};break;case n.FunctionOpenMenu:r={isOpen:!0,highlightedIndex:it(u,e,0)};break;case n.FunctionCloseMenu:r={isOpen:!1};break;case n.FunctionSetHighlightedIndex:r={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:r={inputValue:t.inputValue};break;case n.FunctionReset:r={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,r)}var ft=function(){return ft=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ft.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 gt=ft(ft({},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.":""}}),ht=me,mt=0,It=1,vt=2,yt=3,bt=4,xt=5,wt=6,St=7,Ct=8,kt=9,Ot=10,Mt=11,Dt=12,Et=13,Pt=14,Kt=15,Tt=16,Rt=17,Ht=18,Ft=19,Vt=20,At=21,Nt=Object.freeze({__proto__:null,ToggleButtonClick:mt,ToggleButtonKeyDownArrowDown:It,ToggleButtonKeyDownArrowUp:vt,ToggleButtonKeyDownCharacter:yt,ToggleButtonKeyDownEscape:bt,ToggleButtonKeyDownHome:xt,ToggleButtonKeyDownEnd:wt,ToggleButtonKeyDownEnter:St,ToggleButtonKeyDownSpaceButton:Ct,ToggleButtonKeyDownPageUp:kt,ToggleButtonKeyDownPageDown:Ot,ToggleButtonBlur:Mt,MenuMouseLeave:Dt,ItemMouseMove:Et,ItemClick:Pt,FunctionToggleMenu:Kt,FunctionOpenMenu:Tt,FunctionCloseMenu:Rt,FunctionSetHighlightedIndex:Ht,FunctionSelectItem:Ft,FunctionSetInputValue:Vt,FunctionReset:At});function Bt(e,t){var n,r,i=t.type,u=t.props,s=t.altKey;switch(i){case Pt:r={isOpen:nt(u,"isOpen"),highlightedIndex:nt(u,"highlightedIndex"),selectedItem:u.items[t.index]};break;case yt:var l=t.key,a=""+e.inputValue+l,c=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,o=e.items,r=e.itemToString,i=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&&r(a).toLowerCase().startsWith(u)){var c=i(l);if(!(null==c?void 0:c.hasAttribute("disabled")))return l}}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.indexOf(e.selectedItem):e.highlightedIndex,items:u.items,itemToString:u.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});r={inputValue:a,highlightedIndex:c,isOpen:!0};break;case It:r={highlightedIndex:e.isOpen?Pe(1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1):s&&null==e.selectedItem?-1:it(u,e,1),isOpen:!0};break;case vt:if(e.isOpen&&s)r=dt(u,e.highlightedIndex,!1);else r={highlightedIndex:e.isOpen?Pe(-1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1):it(u,e,-1),isOpen:!0};break;case St:case Ct:r=dt(u,e.highlightedIndex,!1);break;case xt:r={highlightedIndex:Ke(1,0,u.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case wt:r={highlightedIndex:Ke(-1,u.items.length-1,u.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case kt:r={highlightedIndex:Pe(-10,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1)};break;case Ot:r={highlightedIndex:Pe(10,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1)};break;case bt:r={isOpen:!1,highlightedIndex:-1};break;case Mt:r=o({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case Ft:r={selectedItem:t.selectedItem};break;default:return pt(e,t,Nt)}return o({},e,r)}var Lt=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],_t=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],$t=["item","index","onMouseMove","onClick","onPress","refKey","ref","disabled"];function jt(e){void 0===e&&(e={}),ht();var r=o({},gt,e),i=r.items,u=r.scrollIntoView,s=r.environment,l=r.itemToString,a=r.getA11ySelectionMessage,c=r.getA11yStatusMessage,d=et(Bt,rt(r),r),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),b=t.useRef({}),x=t.useRef(null),w=Xe(r),S=t.useRef(),C=t.useRef(!0),k=Qe({state:p,props:r}),O=t.useCallback((function(e){return b.current[w.getItemId(e)]}),[w]);lt(c,[g,h,I,i],o({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p)),lt(a,[m],o({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p));var M=at({menuElement:y.current,highlightedIndex:h,isOpen:g,itemRefs:b,scrollIntoView:u,getItemNodeFromIndex:O});t.useEffect((function(){return x.current=ye((function(e){e({type:Vt,inputValue:""})}),500),function(){x.current.cancel()}}),[]),t.useEffect((function(){I&&x.current(f)}),[f,I]),ct({isInitialMount:C.current,props:r,state:p}),t.useEffect((function(){C.current||(S.current=i.length)}));var D=ut(g,[y,v],s,(function(){f({type:Mt})})),E=st();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){g||(b.current={})}),[g]);var P=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:It,getItemNodeFromIndex:O,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:vt,getItemNodeFromIndex:O,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:xt,getItemNodeFromIndex:O})},End:function(e){e.preventDefault(),f({type:wt,getItemNodeFromIndex:O})},Escape:function(){k.current.state.isOpen&&f({type:bt})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?St:mt})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:kt,getItemNodeFromIndex:O}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:Ot,getItemNodeFromIndex:O}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:yt,key:" ",getItemNodeFromIndex:O}):f({type:Ct}):f({type:mt})}}}),[f,O,k]),K=t.useCallback((function(){f({type:Kt})}),[f]),T=t.useCallback((function(){f({type:Rt})}),[f]),R=t.useCallback((function(){f({type:Tt})}),[f]),H=t.useCallback((function(e){f({type:Ht,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:Ft,selectedItem:e})}),[f]),V=t.useCallback((function(){f({type:At})}),[f]),A=t.useCallback((function(e){f({type:Vt,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 r,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s;i.onKeyDown,i.onBlur;var a=i.ref,c=n(i,Lt),d=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==d&&d,l,y),o(((r={})[l]=xe(a,(function(e){y.current=e})),r.id=w.menuId,r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?void 0:""+w.labelId,r.onMouseLeave=be(u,(function(){f({type:Dt})})),r),c)}),[f,E,w]);return{getToggleButtonProps:t.useCallback((function(e,t){var r,i=void 0===e?{}:e,u=i.onBlur,s=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,c=void 0===a?"ref":a,d=i.ref,p=n(i,_t),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=k.current.state,I=o(((r={})[c]=xe(d,(function(e){v.current=e})),r["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?w.getItemId(m.highlightedIndex):"",r["aria-controls"]=w.menuId,r["aria-expanded"]=k.current.state.isOpen,r["aria-haspopup"]="listbox",r["aria-labelledby"]=p&&p["aria-label"]?void 0:""+w.labelId,r.id=w.toggleButtonId,r.role="combobox",r.tabIndex=0,r.onBlur=be(u,(function(){m.isOpen&&!D.current.isMouseDown&&f({type:Mt})})),r),p);return p.disabled||(I.onClick=be(s,(function(){f({type:mt})})),I.onKeyDown=be(l,(function(e){var t=Ee(e);t&&P[t]?P[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:yt,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,r=void 0===e?{}:e,i=r.item,u=r.index,s=r.onMouseMove,l=r.onClick;r.onPress;var a=r.refKey,c=void 0===a?"ref":a,d=r.ref,p=r.disabled,g=n(r,$t),h=k.current,I=h.state,v=Ge(i,u,h.props.items,"Pass either item or index to getItemProps!"),y=v[0],x=v[1],S=o(((t={disabled:p,role:"option","aria-selected":""+(y===m),id:w.getItemId(x)})[c]=xe(d,(function(e){e&&(b.current[w.getItemId(x)]=e)})),t),g);return p||(S.onClick=be(l,(function(){f({type:Pt,index:x})}))),S.onMouseMove=be(s,(function(){x!==I.highlightedIndex&&(M.current=!1,f({type:Et,index:x,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}}jt.stateChangeTypes=Nt;var Ut=0,Wt=1,zt=2,qt=3,Yt=4,Xt=5,Gt=6,Jt=7,Qt=8,Zt=9,en=10,tn=11,nn=12,on=13,rn=14,un=15,sn=16,ln=17,an=18,cn=19,dn=20,pn=21,fn=22,gn=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ut,InputKeyDownArrowUp:Wt,InputKeyDownEscape:zt,InputKeyDownHome:qt,InputKeyDownEnd:Yt,InputKeyDownPageUp:Xt,InputKeyDownPageDown:Gt,InputKeyDownEnter:Jt,InputChange:Qt,InputBlur:Zt,InputFocus:en,MenuMouseLeave:tn,ItemMouseMove:nn,ItemClick:on,ToggleButtonClick:rn,FunctionToggleMenu:un,FunctionOpenMenu:sn,FunctionCloseMenu:ln,FunctionSetHighlightedIndex:an,FunctionSelectItem:cn,FunctionSetInputValue:dn,FunctionReset:pn,ControlledPropUpdatedSelectedItem:fn});K.array.isRequired,K.func,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 hn=me,mn=o({},tt,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:Se});function In(e,t){var n,r,i=t.type,u=t.props,s=t.altKey;switch(i){case on:r={isOpen:nt(u,"isOpen"),highlightedIndex:nt(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case Ut:r=e.isOpen?{highlightedIndex:Pe(1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:it(u,e,1,t.getItemNodeFromIndex),isOpen:u.items.length>=0};break;case Wt:r=e.isOpen?s?dt(u,e.highlightedIndex):{highlightedIndex:Pe(-1,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:it(u,e,-1,t.getItemNodeFromIndex),isOpen:u.items.length>=0};break;case Jt:r=dt(u,e.highlightedIndex);break;case zt:r=o({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Xt:r={highlightedIndex:Pe(-10,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1)};break;case Gt:r={highlightedIndex:Pe(10,e.highlightedIndex,u.items.length,t.getItemNodeFromIndex,!1)};break;case qt:r={highlightedIndex:Ke(1,0,u.items.length,t.getItemNodeFromIndex,!1)};break;case Yt:r={highlightedIndex:Ke(-1,u.items.length-1,u.items.length,t.getItemNodeFromIndex,!1)};break;case Zt:r=o({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&t.selectItem&&{selectedItem:u.items[e.highlightedIndex],inputValue:u.itemToString(u.items[e.highlightedIndex])});break;case Qt:r={isOpen:!0,highlightedIndex:nt(u,"highlightedIndex"),inputValue:t.inputValue};break;case en:r={isOpen:!0,highlightedIndex:it(u,e,0)};break;case cn:r={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case fn:r={inputValue:t.inputValue};break;default:return pt(e,t,gn)}return o({},e,r)}var vn=["onMouseLeave","refKey","ref"],yn=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],bn=["onClick","onPress","refKey","ref"],xn=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function wn(e){void 0===e&&(e={}),hn();var r=o({},mn,e),i=r.initialIsOpen,u=r.defaultIsOpen,s=r.items,l=r.scrollIntoView,a=r.environment,c=r.getA11yStatusMessage,d=r.getA11ySelectionMessage,p=r.itemToString,f=function(e){var t=rt(e),n=t.selectedItem,r=t.inputValue;return""===r&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(r=e.itemToString(n)),o({},t,{inputValue:r})}(r),g=function(e,n,o){var r=t.useRef(),i=Ze(e,n,o),u=i[0],s=i[1];return t.useEffect((function(){De(o,"selectedItem")&&(o.selectedItemChanged(r.current,o.selectedItem)&&s({type:fn,inputValue:o.itemToString(o.selectedItem)}),r.current=u.selectedItem===r.current?o.selectedItem:u.selectedItem)}),[u.selectedItem,o.selectedItem]),[Me(u,o),s]}(In,f,r),h=g[0],m=g[1],I=h.isOpen,v=h.highlightedIndex,y=h.selectedItem,b=h.inputValue,x=t.useRef(null),w=t.useRef({}),S=t.useRef(null),C=t.useRef(null),k=t.useRef(!0),O=Xe(r),M=t.useRef(),D=Qe({state:h,props:r}),E=t.useCallback((function(e){return w.current[O.getItemId(e)]}),[O]);lt(c,[I,v,b,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:x.current,highlightedIndex:v,isOpen:I,itemRefs:w,scrollIntoView:l,getItemNodeFromIndex:E});ct({isInitialMount:k.current,props:r,state:h}),t.useEffect((function(){(i||u||I)&&S.current&&S.current.focus()}),[]),t.useEffect((function(){k.current||(M.current=s.length)}));var K=ut(I,[S,x,C],a,(function(){m({type:Zt,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:Ut,altKey:e.altKey,getItemNodeFromIndex:E})},ArrowUp:function(e){e.preventDefault(),m({type:Wt,altKey:e.altKey,getItemNodeFromIndex:E})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:qt,getItemNodeFromIndex:E}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Yt,getItemNodeFromIndex:E}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),m({type:zt}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),m({type:Jt,getItemNodeFromIndex:E}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Xt,getItemNodeFromIndex:E}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Gt,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 r,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,c=n(i,vn),d=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==d&&d,l,x),o(((r={})[l]=xe(a,(function(e){x.current=e})),r.id=O.menuId,r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?void 0:""+O.labelId,r.onMouseLeave=be(u,(function(){m({type:tn})})),r),c)}),[m,T,O]),V=t.useCallback((function(e){var t,r,i=void 0===e?{}:e,u=i.item,s=i.index,l=i.refKey,a=void 0===l?"ref":l,c=i.ref,d=i.onMouseMove,p=i.onMouseDown,f=i.onClick;i.onPress;var g=i.disabled,h=n(i,yn),I=D.current,v=I.props,y=I.state,b=Ge(u,s,v.items,"Pass either item or index to getItemProps!")[1],x=f;return o(((t={})[a]=xe(c,(function(e){e&&(w.current[O.getItemId(b)]=e)})),t.disabled=g,t.role="option",t["aria-selected"]=""+(b===y.highlightedIndex),t.id=O.getItemId(b),t),!g&&((r={}).onClick=be(x,(function(){m({type:on,index:b})})),r),{onMouseMove:be(d,(function(){b!==y.highlightedIndex&&(P.current=!1,m({type:nn,index:b,disabled:g}))})),onMouseDown:be(p,(function(e){return e.preventDefault()}))},h)}),[m,D,P,O]),A=t.useCallback((function(e){var t,r=void 0===e?{}:e,i=r.onClick;r.onPress;var u=r.refKey,s=void 0===u?"ref":u,l=r.ref,a=n(r,bn),c=D.current.state;return o(((t={})[s]=xe(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(i,(function(){m({type:rn})}))}),a)}),[m,D,O]),N=t.useCallback((function(e,t){var r,i=void 0===e?{}:e,u=i.onKeyDown,s=i.onChange,l=i.onInput,a=i.onFocus,c=i.onBlur;i.onChangeText;var d=i.refKey,p=void 0===d?"ref":d,f=i.ref,g=n(i,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=be(s,l,(function(e){m({type:Qt,inputValue:e.target.value})})),I.onKeyDown=be(u,(function(e){var t=Ee(e);t&&R[t]&&R[t](e)})),I.onBlur=be(c,(function(e){v.isOpen&&!K.current.isMouseDown&&m({type:Zt,selectItem:null!==e.relatedTarget})})),I.onFocus=be(a,(function(){v.isOpen||m({type:en})})),y=I);return o(((r={})[p]=xe(f,(function(e){S.current=e})),r["aria-activedescendant"]=v.isOpen&&v.highlightedIndex>-1?O.getItemId(v.highlightedIndex):"",r["aria-autocomplete"]="list",r["aria-controls"]=O.menuId,r["aria-expanded"]=v.isOpen,r["aria-labelledby"]=g&&g["aria-label"]?void 0:""+O.labelId,r.autoComplete="off",r.id=O.inputId,r.role="combobox",r.value=v.inputValue,r),y,g)}),[m,R,D,K,T,O]),B=t.useCallback((function(){m({type:un})}),[m]),L=t.useCallback((function(){m({type:ln})}),[m]),_=t.useCallback((function(){m({type:sn})}),[m]),$=t.useCallback((function(e){m({type:an,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:dn,inputValue:e})}),[m]),selectItem:j,reset:t.useCallback((function(){m({type:pn})}),[m]),highlightedIndex:v,isOpen:I,selectedItem:y,inputValue:b}}wn.stateChangeTypes=gn;var Sn={activeIndex:-1,selectedItems:[]};function Cn(e,t){return ot(e,t,Sn)}function kn(e,t){return nt(e,t,Sn)}function On(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 Mn={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"},Dn=me,En=0,Pn=1,Kn=2,Tn=3,Rn=4,Hn=5,Fn=6,Vn=7,An=8,Nn=9,Bn=10,Ln=11,_n=12,$n=Object.freeze({__proto__:null,SelectedItemClick:En,SelectedItemKeyDownDelete:Pn,SelectedItemKeyDownBackspace:Kn,SelectedItemKeyDownNavigationNext:Tn,SelectedItemKeyDownNavigationPrevious:Rn,DropdownKeyDownNavigationPrevious:Hn,DropdownKeyDownBackspace:Fn,DropdownClick:Vn,FunctionAddSelectedItem:An,FunctionRemoveSelectedItem:Nn,FunctionSetSelectedItems:Bn,FunctionSetActiveIndex:Ln,FunctionReset:_n});function jn(e,t){var n,r=t.type,i=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(r){case En:n={activeIndex:i};break;case Rn:n={activeIndex:l-1<0?0:l-1};break;case Tn:n={activeIndex:l+1>=a.length?-1:l+1};break;case Kn:case Pn: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 Hn:n={activeIndex:a.length-1};break;case Fn:n={selectedItems:a.slice(0,a.length-1)};break;case An:n={selectedItems:[].concat(a,[s])};break;case Vn:n={activeIndex:-1};break;case Nn: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 Bn:n={selectedItems:t.selectedItems};break;case Ln:n={activeIndex:t.activeIndex};break;case _n:n={activeIndex:kn(u,"activeIndex"),selectedItems:kn(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return o({},e,n)}var Un=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Wn=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function zn(e){void 0===e&&(e={}),Dn();var r=o({},Mn,e),i=r.getA11yRemovalMessage,u=r.itemToString,s=r.environment,l=r.keyNavigationNext,a=r.keyNavigationPrevious,c=et(jn,function(e){return{activeIndex:Cn(e,"activeIndex"),selectedItems:Cn(e,"selectedItems")}}(r),r),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:r});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(i({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:r,state:d});var b=st();t.useEffect((function(){return h.current=!1,function(){h.current=!0}}),[]);var x=t.useMemo((function(){var e;return(e={})[a]=function(){p({type:Rn})},e[l]=function(){p({type:Tn})},e.Delete=function(){p({type:Pn})},e.Backspace=function(){p({type:Kn})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){On(e)&&p({type:Hn})},e.Backspace=function(e){On(e)&&p({type:Fn})},e}),[p,a]);return{getSelectedItemProps:t.useCallback((function(e){var t,r=void 0===e?{}:e,i=r.refKey,u=void 0===i?"ref":i,s=r.ref,l=r.onClick,a=r.onKeyDown,c=r.selectedItem,d=r.index,f=n(r,Un),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]=xe(s,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=be(l,(function(){p({type:En,index:h})})),t.onKeyDown=be(a,(function(e){var t=Ee(e);t&&x[t]&&x[t](e)})),t),f)}),[p,y,x]),getDropdownProps:t.useCallback((function(e,t){var r,i=void 0===e?{}:e,u=i.refKey,s=void 0===u?"ref":u,l=i.ref,a=i.onKeyDown,c=i.onClick,d=i.preventKeyAction,f=void 0!==d&&d,g=n(i,Wn),h=(void 0===t?{}:t).suppressRefError;return b("getDropdownProps",void 0!==h&&h,s,m),o(((r={})[s]=xe(l,(function(e){e&&(m.current=e)})),r),!f&&{onKeyDown:be(a,(function(e){var t=Ee(e);t&&w[t]&&w[t](e)})),onClick:be(c,(function(){p({type:Vn})}))},g)}),[p,w,b]),addSelectedItem:t.useCallback((function(e){p({type:An,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:Nn,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:Bn,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:Ln,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:_n})}),[p]),selectedItems:g,activeIndex:f}}zn.stateChangeTypes=$n,e.default=je,e.resetIdCounter=function(){ge=0},e.useCombobox=wn,e.useMultipleSelection=zn,e.useSelect=jt,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=downshift.umd.min.js.map |
{ | ||
"name": "downshift", | ||
"version": "7.5.0", | ||
"version": "7.6.0", | ||
"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", |
@@ -1,2 +0,2 @@ | ||
!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,C=60117,k=60129,O=60131; | ||
!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 l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(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,C=60117,k=60129,O=60131; | ||
/** @license React v17.0.2 | ||
@@ -9,3 +9,3 @@ * react-is.production.min.js | ||
* 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"),C=M("react.fundamental"),k=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===k||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===C||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:C,bottom:k,left:O}=e.getBoundingClientRect(),M="start"===a||"nearest"===a?S:"end"===a?k:S+b/2,D="center"===d?O+w/2:"end"===d?C: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&&k<=v&&C<=I&&S>=o&&k<=u&&O>=s&&C<=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 Ce=G((function(e,t){ce(e(),t)}),200),ke="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||Ce((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 ke((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;return void 0===n&&(n=!0),u({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&u({selectedItem:e.items[t],isOpen:Re(e,"isOpen"),highlightedIndex:Re(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function Ue(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 $e=function(){return $e=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},$e.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 We=$e($e({},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.":""}}),ze=q,qe=0,Xe=1,Ye=2,Ge=3,Je=4,Qe=5,Ze=6,et=7,tt=8,nt=9,it=10,ot=11,rt=12,ut=13,st=14,lt=15,at=16,dt=17,ct=18,pt=19,ft=20,gt=21,ht=Object.freeze({__proto__:null,ToggleButtonClick:qe,ToggleButtonKeyDownArrowDown:Xe,ToggleButtonKeyDownArrowUp:Ye,ToggleButtonKeyDownCharacter:Ge,ToggleButtonKeyDownEscape:Je,ToggleButtonKeyDownHome:Qe,ToggleButtonKeyDownEnd:Ze,ToggleButtonKeyDownEnter:et,ToggleButtonKeyDownSpaceButton:tt,ToggleButtonKeyDownPageUp:nt,ToggleButtonKeyDownPageDown:it,ToggleButtonBlur:ot,MenuMouseLeave:rt,ItemMouseMove:ut,ItemClick:st,FunctionToggleMenu:lt,FunctionOpenMenu:at,FunctionCloseMenu:dt,FunctionSetHighlightedIndex:ct,FunctionSelectItem:pt,FunctionSetInputValue:ft,FunctionReset:gt});function mt(e,t){var n,i,o=t.type,r=t.props,s=t.altKey;switch(o){case st:i={isOpen:Re(r,"isOpen"),highlightedIndex:Re(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case Ge:var l=t.key,a=""+e.inputValue+l,d=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:a,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});i={inputValue:a,highlightedIndex:d,isOpen:!0};break;case Xe:i={highlightedIndex:e.isOpen?se(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):s&&null==e.selectedItem?-1:Ve(r,e,1),isOpen:!0};break;case Ye:if(e.isOpen&&s)i=je(r,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?se(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):Ve(r,e,-1),isOpen:!0};break;case et:case tt:i=je(r,e.highlightedIndex,!1);break;case Qe:i={highlightedIndex:le(1,0,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case Ze:i={highlightedIndex:le(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case nt:i={highlightedIndex:se(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case it:i={highlightedIndex:se(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Je:i={isOpen:!1,highlightedIndex:-1};break;case ot:i=u({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case pt:i={selectedItem:t.selectedItem};break;default:return Ue(e,t,ht)}return u({},e,i)}var It=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],vt=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],yt=["item","index","onMouseMove","onClick","onPress","refKey","ref","disabled"];function xt(e){void 0===e&&(e={}),ze();var n=u({},We,e),i=n.items,o=n.scrollIntoView,s=n.environment,l=n.itemToString,a=n.getA11ySelectionMessage,d=n.getA11yStatusMessage,c=Pe(mt,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(),C=t.useRef(!0),k=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:C.current,previousResultCount:S.current,items:i,environment:s,itemToString:l},p)),Be(a,[m],u({isInitialMount:C.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:ft,inputValue:""})}),500),function(){b.current.cancel()}}),[]),t.useEffect((function(){I&&b.current(f)}),[f,I]),_e({isInitialMount:C.current,props:n,state:p}),t.useEffect((function(){C.current||(S.current=i.length)}));var D=Ne(g,[y,v],s,(function(){f({type:ot})})),E=Ae();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){g||(x.current={})}),[g]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:Xe,getItemNodeFromIndex:O,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Ye,getItemNodeFromIndex:O,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:Qe,getItemNodeFromIndex:O})},End:function(e){e.preventDefault(),f({type:Ze,getItemNodeFromIndex:O})},Escape:function(){k.current.state.isOpen&&f({type:Je})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?et:qe})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:nt,getItemNodeFromIndex:O}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:it,getItemNodeFromIndex:O}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:Ge,key:" ",getItemNodeFromIndex:O}):f({type:tt}):f({type:qe})}}}),[f,O,k]),P=t.useCallback((function(){f({type:lt})}),[f]),T=t.useCallback((function(){f({type:dt})}),[f]),R=t.useCallback((function(){f({type:at})}),[f]),H=t.useCallback((function(e){f({type:ct,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:pt,selectedItem:e})}),[f]),V=t.useCallback((function(){f({type:gt})}),[f]),N=t.useCallback((function(e){f({type:ft,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,It),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:rt})})),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,vt),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=k.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"]=k.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:ot})})),n),p);return p.disabled||(I.onClick=J(s,(function(){f({type:qe})})),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:Ge,key:t,getItemNodeFromIndex:O})}))),E("getToggleButtonProps",h,d,v),I}),[k,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,yt),h=k.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:st,index:b})}))),S.onMouseMove=J(s,(function(){b!==I.highlightedIndex&&(M.current=!1,f({type:ut,index:b,disabled:p}))})),S}),[k,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}}xt.stateChangeTypes=ht;var bt=0,wt=1,St=2,Ct=3,kt=4,Ot=5,Mt=6,Dt=7,Et=8,Kt=9,Pt=10,Tt=11,Rt=12,Ht=13,Ft=14,Vt=15,Nt=16,At=17,Bt=18,Lt=19,_t=20,jt=21,Ut=22,$t=Object.freeze({__proto__:null,InputKeyDownArrowDown:bt,InputKeyDownArrowUp:wt,InputKeyDownEscape:St,InputKeyDownHome:Ct,InputKeyDownEnd:kt,InputKeyDownPageUp:Ot,InputKeyDownPageDown:Mt,InputKeyDownEnter:Dt,InputChange:Et,InputBlur:Kt,InputFocus:Pt,MenuMouseLeave:Tt,ItemMouseMove:Rt,ItemClick:Ht,ToggleButtonClick:Ft,FunctionToggleMenu:Vt,FunctionOpenMenu:Nt,FunctionCloseMenu:At,FunctionSetHighlightedIndex:Bt,FunctionSelectItem:Lt,FunctionSetInputValue:_t,FunctionReset:jt,ControlledPropUpdatedSelectedItem:Ut});o.default.array.isRequired,o.default.func,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 Wt=q,zt=u({},Te,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:ee});function qt(e,t){var n,i,o=t.type,r=t.props,s=t.altKey;switch(o){case Ht:i={isOpen:Re(r,"isOpen"),highlightedIndex:Re(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case bt:i=e.isOpen?{highlightedIndex:se(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:Ve(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case wt:i=e.isOpen?s?je(r,e.highlightedIndex):{highlightedIndex:se(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:Ve(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case Dt:i=je(r,e.highlightedIndex);break;case St:i=u({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ot:i={highlightedIndex:se(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Mt:i={highlightedIndex:se(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Ct:i={highlightedIndex:le(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case kt:i={highlightedIndex:le(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case Kt:i=u({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case Et:i={isOpen:!0,highlightedIndex:Re(r,"highlightedIndex"),inputValue:t.inputValue};break;case Pt:i={isOpen:!0,highlightedIndex:Ve(r,e,0)};break;case Lt:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Ut:i={inputValue:t.inputValue};break;default:return Ue(e,t,$t)}return u({},e,i)}var Xt=["onMouseLeave","refKey","ref"],Yt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],Gt=["onClick","onPress","refKey","ref"],Jt=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function Qt(e){void 0===e&&(e={}),Wt();var n=u({},zt,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")&&(i.selectedItemChanged(o.current,i.selectedItem)&&s({type:Ut,inputValue:i.itemToString(i.selectedItem)}),o.current=u.selectedItem===o.current?i.selectedItem:u.selectedItem)}),[u.selectedItem,i.selectedItem]),[oe(u,i),s]}(qt,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),C=t.useRef(null),k=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:k.current,previousResultCount:M.current,items:s,environment:a,itemToString:p},h)),Be(c,[y],u({isInitialMount:k.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:k.current,props:n,state:h}),t.useEffect((function(){(i||o||I)&&S.current&&S.current.focus()}),[]),t.useEffect((function(){k.current||(M.current=s.length)}));var P=Ne(I,[S,b,C],a,(function(){m({type:Kt,selectItem:!1})})),T=Ae();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:bt,altKey:e.altKey,getItemNodeFromIndex:E})},ArrowUp:function(e){e.preventDefault(),m({type:wt,altKey:e.altKey,getItemNodeFromIndex:E})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Ct,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:St}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),m({type:Dt,getItemNodeFromIndex:E}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Ot,getItemNodeFromIndex:E}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Mt,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,Xt),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:Tt})})),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,Yt),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:Ht,index:x})})),n),{onMouseMove:J(c,(function(){x!==y.highlightedIndex&&(K.current=!1,m({type:Rt,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,Gt),d=D.current.state;return u(((t={})[s]=Q(l,(function(e){C.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:Ft})}))}),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,Jt),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:Et,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(e){v.isOpen&&!P.current.isMouseDown&&m({type:Kt,selectItem:null!==e.relatedTarget})})),I.onFocus=J(a,(function(){v.isOpen||m({type:Pt})})),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:Vt})}),[m]),L=t.useCallback((function(){m({type:At})}),[m]),_=t.useCallback((function(){m({type:Nt})}),[m]),j=t.useCallback((function(e){m({type:Bt,highlightedIndex:e})}),[m]),U=t.useCallback((function(e){m({type:Lt,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:_t,inputValue:e})}),[m]),selectItem:U,reset:t.useCallback((function(){m({type:jt})}),[m]),highlightedIndex:v,isOpen:I,selectedItem:y,inputValue:x}}Qt.stateChangeTypes=$t;var Zt={activeIndex:-1,selectedItems:[]};function en(e,t){return He(e,t,Zt)}function tn(e,t){return Re(e,t,Zt)}function nn(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 on={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"},rn=q,un=0,sn=1,ln=2,an=3,dn=4,cn=5,pn=6,fn=7,gn=8,hn=9,mn=10,In=11,vn=12,yn=Object.freeze({__proto__:null,SelectedItemClick:un,SelectedItemKeyDownDelete:sn,SelectedItemKeyDownBackspace:ln,SelectedItemKeyDownNavigationNext:an,SelectedItemKeyDownNavigationPrevious:dn,DropdownKeyDownNavigationPrevious:cn,DropdownKeyDownBackspace:pn,DropdownClick:fn,FunctionAddSelectedItem:gn,FunctionRemoveSelectedItem:hn,FunctionSetSelectedItems:mn,FunctionSetActiveIndex:In,FunctionReset:vn});function xn(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 un:n={activeIndex:o};break;case dn:n={activeIndex:l-1<0?0:l-1};break;case an:n={activeIndex:l+1>=a.length?-1:l+1};break;case ln:case sn: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 cn:n={activeIndex:a.length-1};break;case pn:n={selectedItems:a.slice(0,a.length-1)};break;case gn:n={selectedItems:[].concat(a,[s])};break;case fn:n={activeIndex:-1};break;case hn: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 mn:n={selectedItems:t.selectedItems};break;case In:n={activeIndex:t.activeIndex};break;case vn:n={activeIndex:tn(r,"activeIndex"),selectedItems:tn(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return u({},e,n)}var bn=["refKey","ref","onClick","onKeyDown","selectedItem","index"],wn=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Sn(e){void 0===e&&(e={}),rn();var n=u({},on,e),i=n.getA11yRemovalMessage,o=n.itemToString,s=n.environment,l=n.keyNavigationNext,a=n.keyNavigationPrevious,d=Pe(xn,function(e){return{activeIndex:en(e,"activeIndex"),selectedItems:en(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:dn})},e[l]=function(){p({type:an})},e.Delete=function(){p({type:sn})},e.Backspace=function(){p({type:ln})},e}),[p,l,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){nn(e)&&p({type:cn})},e.Backspace=function(e){nn(e)&&p({type:pn})},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,bn),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:un,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,wn),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:fn})}))},g)}),[p,w,x]),addSelectedItem:t.useCallback((function(e){p({type:gn,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:hn,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:mn,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:In,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:vn})}),[p]),selectedItems:g,activeIndex:f}}Sn.stateChangeTypes=yn,e.default=xe,e.resetIdCounter=function(){W=0},e.useCombobox=Qt,e.useMultipleSelection=Sn,e.useSelect=xt,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"),C=M("react.fundamental"),k=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===k||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===C||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,l)=>r<e&&u>t||r>e&&u<t?0:r<=e&&l<=n||u>=t&&l>=n?r-e-i:u>t&&l<n||r<e&&l>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,l;if("undefined"==typeof document)return[];let{scrollMode:s,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!=(l=window.scrollY)?l: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"===d?O+w/2:"end"===d?C: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:l}=t.getBoundingClientRect();if("if-needed"===s&&S>=0&&O>=0&&k<=v&&C<=I&&S>=o&&k<=u&&O>=l&&C<=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-l-p:"center"===d?D-(l+i/2)+R/2:"end"===d?D-r+m+R:j(l,r,i,p,m+R,D,D+w,w);let{scrollLeft:e,scrollTop:s}=t;P=Math.max(0,Math.min(s+P/V,t.scrollHeight-n/V+H)),T=Math.max(0,Math.min(e+T/F,t.scrollWidth-i/F+R)),M+=s-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 le(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 l=se(e,u,n,i,o);return-1===l?t>=n?-1:t:l}function se(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 l=t-1;l>=0;l--)if(!i(l).hasAttribute("disabled"))return l;return o?e>0?se(1,0,n,i,!1):se(-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={},l="function"==typeof e;return!l&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,u({},n.getStateAndHelpers(),e)),n.setState((function(t){t=n.getState(t);var s=l?e(t):e;s=n.props.stateReducer(t,s),i=s.hasOwnProperty("selectedItem");var a={};return i&&s.selectedItem!==t.selectedItem&&(o=s.selectedItem),s.type=s.type||0,Object.keys(s).forEach((function(e){t[e]!==s[e]&&(r[e]=s[e]),"type"!==e&&(s[e],re(n.props,e)||(a[e]=s[e]))})),l&&s.hasOwnProperty("inputValue")&&n.props.onInputValueChange(s.inputValue,u({},n.getStateAndHelpers(),s)),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,l=o.refKey,s=void 0===l?"ref":l,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=s,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return u(((i={})[s]=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=le(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=le(-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=se(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=se(-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,l=t.onKeyUp,s=t.onBlur,a=r(t,he),d=n.getState().isOpen,c={onClick:J(i,n.buttonHandleClick),onKeyDown:J(o,n.buttonHandleKeyDown),onKeyUp:J(l,n.buttonHandleKeyUp),onBlur:J(s,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(l(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,l=t.onChange,s=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(l,s,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":a&&a["aria-label"]?void 0: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(l(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,l=o.refKey,s=void 0===l?"ref":l,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=s,n.getMenuProps.suppressRefError=p,u(((i={})[s]=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,l=i.onMouseDown,s=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=s,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(l,(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,s=i.initialHighlightedIndex,a=void 0===s?o:s,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,s(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=le(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,l=this.getRootProps,s=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:l,getToggleButtonProps:s,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,l="on"+De(e)+"Change";o[l]&&void 0!==i[e]&&i[e]!==n[e]&&o[l](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 Ce=G((function(e,t){ce(e(),t)}),200),ke="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,l=e.toggleButtonId,s=e.inputId;return t.useRef({labelId:o||i+"-label",menuId:r||i+"-menu",getItemId:u||function(e){return i+"-item-"+e},toggleButtonId:l||i+"-toggle-button",inputId:s||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(),l=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]),s=t.useReducer(l,n),a=s[0],d=s[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,l=t.highlightedIndex;return 0===i.length?-1:void 0!==o&&l===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()},l=function(){r.current.isTouchMove=!1},s=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",l),i.addEventListener("touchmove",s),i.addEventListener("touchend",a),function(){i.removeEventListener("mousedown",t),i.removeEventListener("mouseup",u),i.removeEventListener("touchstart",l),i.removeEventListener("touchmove",s),i.removeEventListener("touchend",a)}}}),[e,i]),r}var Ae=function(){return q};function Be(e,n,i){var o=i.isInitialMount,l=i.highlightedIndex,s=i.items,a=i.environment,d=r(i,be);t.useEffect((function(){o||Ce((function(){return e(u({highlightedIndex:l,highlightedItem:s[l],resultCount:s.length},d))}),a.document)}),n)}function Le(e){var n=e.highlightedIndex,i=e.isOpen,o=e.itemRefs,r=e.getItemNodeFromIndex,u=e.menuElement,l=e.scrollIntoView,s=t.useRef(!0);return ke((function(){n<0||!i||!Object.keys(o.current).length||(!1===s.current?s.current=!0:l(r(n),u))}),[n]),s}var _e=q;function je(e,t,n){var i;return void 0===n&&(n=!0),u({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&u({selectedItem:e.items[t],isOpen:Re(e,"isOpen"),highlightedIndex:Re(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function Ue(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 $e=function(){return $e=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},$e.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 We=$e($e({},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.":""}}),ze=q,qe=0,Xe=1,Ye=2,Ge=3,Je=4,Qe=5,Ze=6,et=7,tt=8,nt=9,it=10,ot=11,rt=12,ut=13,lt=14,st=15,at=16,dt=17,ct=18,pt=19,ft=20,gt=21,ht=Object.freeze({__proto__:null,ToggleButtonClick:qe,ToggleButtonKeyDownArrowDown:Xe,ToggleButtonKeyDownArrowUp:Ye,ToggleButtonKeyDownCharacter:Ge,ToggleButtonKeyDownEscape:Je,ToggleButtonKeyDownHome:Qe,ToggleButtonKeyDownEnd:Ze,ToggleButtonKeyDownEnter:et,ToggleButtonKeyDownSpaceButton:tt,ToggleButtonKeyDownPageUp:nt,ToggleButtonKeyDownPageDown:it,ToggleButtonBlur:ot,MenuMouseLeave:rt,ItemMouseMove:ut,ItemClick:lt,FunctionToggleMenu:st,FunctionOpenMenu:at,FunctionCloseMenu:dt,FunctionSetHighlightedIndex:ct,FunctionSelectItem:pt,FunctionSetInputValue:ft,FunctionReset:gt});function mt(e,t){var n,i,o=t.type,r=t.props,l=t.altKey;switch(o){case lt:i={isOpen:Re(r,"isOpen"),highlightedIndex:Re(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case Ge:var s=t.key,a=""+e.inputValue+s,d=function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.getItemNodeFromIndex,u=t.toLowerCase(),l=0;l<i.length;l++){var s=(l+n+(t.length<2?1:0))%i.length,a=i[s];if(void 0!==a&&o(a).toLowerCase().startsWith(u)){var d=r(s);if(!(null==d?void 0:d.hasAttribute("disabled")))return s}}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex});i={inputValue:a,highlightedIndex:d,isOpen:!0};break;case Xe:i={highlightedIndex:e.isOpen?le(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):l&&null==e.selectedItem?-1:Ve(r,e,1),isOpen:!0};break;case Ye:if(e.isOpen&&l)i=je(r,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?le(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):Ve(r,e,-1),isOpen:!0};break;case et:case tt:i=je(r,e.highlightedIndex,!1);break;case Qe:i={highlightedIndex:se(1,0,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case Ze:i={highlightedIndex:se(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case nt:i={highlightedIndex:le(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case it:i={highlightedIndex:le(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Je:i={isOpen:!1,highlightedIndex:-1};break;case ot:i=u({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case pt:i={selectedItem:t.selectedItem};break;default:return Ue(e,t,ht)}return u({},e,i)}var It=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],vt=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],yt=["item","index","onMouseMove","onClick","onPress","refKey","ref","disabled"];function xt(e){void 0===e&&(e={}),ze();var n=u({},We,e),i=n.items,o=n.scrollIntoView,l=n.environment,s=n.itemToString,a=n.getA11ySelectionMessage,d=n.getA11yStatusMessage,c=Pe(mt,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(),C=t.useRef(!0),k=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:C.current,previousResultCount:S.current,items:i,environment:l,itemToString:s},p)),Be(a,[m],u({isInitialMount:C.current,previousResultCount:S.current,items:i,environment:l,itemToString:s},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:ft,inputValue:""})}),500),function(){b.current.cancel()}}),[]),t.useEffect((function(){I&&b.current(f)}),[f,I]),_e({isInitialMount:C.current,props:n,state:p}),t.useEffect((function(){C.current||(S.current=i.length)}));var D=Ne(g,[y,v],l,(function(){f({type:ot})})),E=Ae();t.useEffect((function(){return C.current=!1,function(){C.current=!0}}),[]),t.useEffect((function(){g||(x.current={})}),[g]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),f({type:Xe,getItemNodeFromIndex:O,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),f({type:Ye,getItemNodeFromIndex:O,altKey:e.altKey})},Home:function(e){e.preventDefault(),f({type:Qe,getItemNodeFromIndex:O})},End:function(e){e.preventDefault(),f({type:Ze,getItemNodeFromIndex:O})},Escape:function(){k.current.state.isOpen&&f({type:Je})},Enter:function(e){e.preventDefault(),f({type:k.current.state.isOpen?et:qe})},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:nt,getItemNodeFromIndex:O}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),f({type:it,getItemNodeFromIndex:O}))}," ":function(e){e.preventDefault();var t=k.current.state;t.isOpen?t.inputValue?f({type:Ge,key:" ",getItemNodeFromIndex:O}):f({type:tt}):f({type:qe})}}}),[f,O,k]),P=t.useCallback((function(){f({type:st})}),[f]),T=t.useCallback((function(){f({type:dt})}),[f]),R=t.useCallback((function(){f({type:at})}),[f]),H=t.useCallback((function(e){f({type:ct,highlightedIndex:e})}),[f]),F=t.useCallback((function(e){f({type:pt,selectedItem:e})}),[f]),V=t.useCallback((function(){f({type:gt})}),[f]),N=t.useCallback((function(e){f({type:ft,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,l=i.refKey,s=void 0===l?"ref":l;i.onKeyDown,i.onBlur;var a=i.ref,d=r(i,It),c=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==c&&c,s,y),u(((n={})[s]=Q(a,(function(e){y.current=e})),n.id=w.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+w.labelId,n.onMouseLeave=J(o,(function(){f({type:rt})})),n),d)}),[f,E,w]);return{getToggleButtonProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onBlur,l=i.onClick;i.onPress;var s=i.onKeyDown,a=i.refKey,d=void 0===a?"ref":a,c=i.ref,p=r(i,vt),g=(void 0===t?{}:t).suppressRefError,h=void 0!==g&&g,m=k.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"]=k.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=p&&p["aria-label"]?void 0:""+w.labelId,n.id=w.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=J(o,(function(){m.isOpen&&!D.current.isMouseDown&&f({type:ot})})),n),p);return p.disabled||(I.onClick=J(l,(function(){f({type:qe})})),I.onKeyDown=J(s,(function(e){var t=ue(e);t&&K[t]?K[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&f({type:Ge,key:t,getItemNodeFromIndex:O})}))),E("getToggleButtonProps",h,d,v),I}),[k,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,l=n.onMouseMove,s=n.onClick;n.onPress;var a=n.refKey,d=void 0===a?"ref":a,c=n.ref,p=n.disabled,g=r(n,yt),h=k.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(s,(function(){f({type:lt,index:b})}))),S.onMouseMove=J(l,(function(){b!==I.highlightedIndex&&(M.current=!1,f({type:ut,index:b,disabled:p}))})),S}),[k,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}}xt.stateChangeTypes=ht;var bt=0,wt=1,St=2,Ct=3,kt=4,Ot=5,Mt=6,Dt=7,Et=8,Kt=9,Pt=10,Tt=11,Rt=12,Ht=13,Ft=14,Vt=15,Nt=16,At=17,Bt=18,Lt=19,_t=20,jt=21,Ut=22,$t=Object.freeze({__proto__:null,InputKeyDownArrowDown:bt,InputKeyDownArrowUp:wt,InputKeyDownEscape:St,InputKeyDownHome:Ct,InputKeyDownEnd:kt,InputKeyDownPageUp:Ot,InputKeyDownPageDown:Mt,InputKeyDownEnter:Dt,InputChange:Et,InputBlur:Kt,InputFocus:Pt,MenuMouseLeave:Tt,ItemMouseMove:Rt,ItemClick:Ht,ToggleButtonClick:Ft,FunctionToggleMenu:Vt,FunctionOpenMenu:Nt,FunctionCloseMenu:At,FunctionSetHighlightedIndex:Bt,FunctionSelectItem:Lt,FunctionSetInputValue:_t,FunctionReset:jt,ControlledPropUpdatedSelectedItem:Ut});o.default.array.isRequired,o.default.func,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 Wt=q,zt=u({},Te,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:ee});function qt(e,t){var n,i,o=t.type,r=t.props,l=t.altKey;switch(o){case Ht:i={isOpen:Re(r,"isOpen"),highlightedIndex:Re(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case bt:i=e.isOpen?{highlightedIndex:le(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:l&&null==e.selectedItem?-1:Ve(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case wt:i=e.isOpen?l?je(r,e.highlightedIndex):{highlightedIndex:le(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:Ve(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case Dt:i=je(r,e.highlightedIndex);break;case St:i=u({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ot:i={highlightedIndex:le(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Mt:i={highlightedIndex:le(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case Ct:i={highlightedIndex:se(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case kt:i={highlightedIndex:se(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case Kt:i=u({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case Et:i={isOpen:!0,highlightedIndex:Re(r,"highlightedIndex"),inputValue:t.inputValue};break;case Pt:i={isOpen:!0,highlightedIndex:Ve(r,e,0)};break;case Lt:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case Ut:i={inputValue:t.inputValue};break;default:return Ue(e,t,$t)}return u({},e,i)}var Xt=["onMouseLeave","refKey","ref"],Yt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],Gt=["onClick","onPress","refKey","ref"],Jt=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];function Qt(e){void 0===e&&(e={}),Wt();var n=u({},zt,e),i=n.initialIsOpen,o=n.defaultIsOpen,l=n.items,s=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],l=r[1];return t.useEffect((function(){re(i,"selectedItem")&&(i.selectedItemChanged(o.current,i.selectedItem)&&l({type:Ut,inputValue:i.itemToString(i.selectedItem)}),o.current=u.selectedItem===o.current?i.selectedItem:u.selectedItem)}),[u.selectedItem,i.selectedItem]),[oe(u,i),l]}(qt,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),C=t.useRef(null),k=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,l],u({isInitialMount:k.current,previousResultCount:M.current,items:l,environment:a,itemToString:p},h)),Be(c,[y],u({isInitialMount:k.current,previousResultCount:M.current,items:l,environment:a,itemToString:p},h));var K=Le({menuElement:b.current,highlightedIndex:v,isOpen:I,itemRefs:w,scrollIntoView:s,getItemNodeFromIndex:E});_e({isInitialMount:k.current,props:n,state:h}),t.useEffect((function(){(i||o||I)&&S.current&&S.current.focus()}),[]),t.useEffect((function(){k.current||(M.current=l.length)}));var P=Ne(I,[S,b,C],a,(function(){m({type:Kt,selectItem:!1})})),T=Ae();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:bt,altKey:e.altKey,getItemNodeFromIndex:E})},ArrowUp:function(e){e.preventDefault(),m({type:wt,altKey:e.altKey,getItemNodeFromIndex:E})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Ct,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:St}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),m({type:Dt,getItemNodeFromIndex:E}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Ot,getItemNodeFromIndex:E}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),m({type:Mt,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,l=i.refKey,s=void 0===l?"ref":l,a=i.ref,d=r(i,Xt),c=(void 0===t?{}:t).suppressRefError;return T("getMenuProps",void 0!==c&&c,s,b),u(((n={})[s]=Q(a,(function(e){b.current=e})),n.id=O.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+O.labelId,n.onMouseLeave=J(o,(function(){m({type:Tt})})),n),d)}),[m,T,O]),V=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,o=i.item,l=i.index,s=i.refKey,a=void 0===s?"ref":s,d=i.ref,c=i.onMouseMove,p=i.onMouseDown,f=i.onClick;i.onPress;var g=i.disabled,h=r(i,Yt),I=D.current,v=I.props,y=I.state,x=Me(o,l,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:Ht,index:x})})),n),{onMouseMove:J(c,(function(){x!==y.highlightedIndex&&(K.current=!1,m({type:Rt,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,l=void 0===o?"ref":o,s=n.ref,a=r(n,Gt),d=D.current.state;return u(((t={})[l]=Q(s,(function(e){C.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:Ft})}))}),a)}),[m,D,O]),A=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onKeyDown,l=i.onChange,s=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,Jt),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(l,s,(function(e){m({type:Et,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(e){v.isOpen&&!P.current.isMouseDown&&m({type:Kt,selectItem:null!==e.relatedTarget})})),I.onFocus=J(a,(function(){v.isOpen||m({type:Pt})})),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"]=g&&g["aria-label"]?void 0:""+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:Vt})}),[m]),L=t.useCallback((function(){m({type:At})}),[m]),_=t.useCallback((function(){m({type:Nt})}),[m]),j=t.useCallback((function(e){m({type:Bt,highlightedIndex:e})}),[m]),U=t.useCallback((function(e){m({type:Lt,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:_t,inputValue:e})}),[m]),selectItem:U,reset:t.useCallback((function(){m({type:jt})}),[m]),highlightedIndex:v,isOpen:I,selectedItem:y,inputValue:x}}Qt.stateChangeTypes=$t;var Zt={activeIndex:-1,selectedItems:[]};function en(e,t){return He(e,t,Zt)}function tn(e,t){return Re(e,t,Zt)}function nn(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 on={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"},rn=q,un=0,ln=1,sn=2,an=3,dn=4,cn=5,pn=6,fn=7,gn=8,hn=9,mn=10,In=11,vn=12,yn=Object.freeze({__proto__:null,SelectedItemClick:un,SelectedItemKeyDownDelete:ln,SelectedItemKeyDownBackspace:sn,SelectedItemKeyDownNavigationNext:an,SelectedItemKeyDownNavigationPrevious:dn,DropdownKeyDownNavigationPrevious:cn,DropdownKeyDownBackspace:pn,DropdownClick:fn,FunctionAddSelectedItem:gn,FunctionRemoveSelectedItem:hn,FunctionSetSelectedItems:mn,FunctionSetActiveIndex:In,FunctionReset:vn});function xn(e,t){var n,i=t.type,o=t.index,r=t.props,l=t.selectedItem,s=e.activeIndex,a=e.selectedItems;switch(i){case un:n={activeIndex:o};break;case dn:n={activeIndex:s-1<0?0:s-1};break;case an:n={activeIndex:s+1>=a.length?-1:s+1};break;case sn:case ln:if(s<0)break;var d=s;1===a.length?d=-1:s===a.length-1&&(d=a.length-2),n=u({selectedItems:[].concat(a.slice(0,s),a.slice(s+1))},{activeIndex:d});break;case cn:n={activeIndex:a.length-1};break;case pn:n={selectedItems:a.slice(0,a.length-1)};break;case gn:n={selectedItems:[].concat(a,[l])};break;case fn:n={activeIndex:-1};break;case hn:var c=s,p=a.indexOf(l);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 mn:n={selectedItems:t.selectedItems};break;case In:n={activeIndex:t.activeIndex};break;case vn:n={activeIndex:tn(r,"activeIndex"),selectedItems:tn(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return u({},e,n)}var bn=["refKey","ref","onClick","onKeyDown","selectedItem","index"],wn=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Sn(e){void 0===e&&(e={}),rn();var n=u({},on,e),i=n.getA11yRemovalMessage,o=n.itemToString,l=n.environment,s=n.keyNavigationNext,a=n.keyNavigationPrevious,d=Pe(xn,function(e){return{activeIndex:en(e,"activeIndex"),selectedItems:en(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]}),l.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:dn})},e[s]=function(){p({type:an})},e.Delete=function(){p({type:ln})},e.Backspace=function(){p({type:sn})},e}),[p,s,a]),w=t.useMemo((function(){var e;return(e={})[a]=function(e){nn(e)&&p({type:cn})},e.Backspace=function(e){nn(e)&&p({type:pn})},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,l=n.ref,s=n.onClick,a=n.onKeyDown,d=n.selectedItem,c=n.index,f=r(n,bn),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(l,(function(e){e&&v.current.push(e)})),t.tabIndex=m?0:-1,t.onClick=J(s,(function(){p({type:un,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,l=void 0===o?"ref":o,s=i.ref,a=i.onKeyDown,d=i.onClick,c=i.preventKeyAction,f=void 0!==c&&c,g=r(i,wn),h=(void 0===t?{}:t).suppressRefError;return x("getDropdownProps",void 0!==h&&h,l,m),u(((n={})[l]=Q(s,(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:fn})}))},g)}),[p,w,x]),addSelectedItem:t.useCallback((function(e){p({type:gn,selectedItem:e})}),[p]),removeSelectedItem:t.useCallback((function(e){p({type:hn,selectedItem:e})}),[p]),setSelectedItems:t.useCallback((function(e){p({type:mn,selectedItems:e})}),[p]),setActiveIndex:t.useCallback((function(e){p({type:In,activeIndex:e})}),[p]),reset:t.useCallback((function(){p({type:vn})}),[p]),selectedItems:g,activeIndex:f}}Sn.stateChangeTypes=yn,e.default=xe,e.resetIdCounter=function(){W=0},e.useCombobox=Qt,e.useMultipleSelection=Sn,e.useSelect=xt,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 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
Sorry, the diff of this file is too big to display
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
2785215
32886
1523
27