Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

downshift

Package Overview
Dependencies
Maintainers
2
Versions
354
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

downshift - npm Package Compare versions

Comparing version 9.0.6 to 9.0.7-alpha.0

2

dist/downshift.umd.min.js

@@ -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={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function i(){return i=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},i.apply(this,arguments)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u,s,l,a,c={exports:{}};c.exports=function(){if(a)return l;a=1;var e=s?u:(s=1,u="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,l=function(){function i(t,n,i,o,r,u){if(u!==e){var s=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 s.name="Invariant Violation",s}}function o(){return i}i.isRequired=i;var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return r.PropTypes=r,r}}()();var d,p=r(c.exports),f={};!function(){if(d)return f;d=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case i:case r:case o:case c:case p:return e;default:switch(e=e&&e.$$typeof){case l:case s:case a:case g:case h:case u:return e;default:return d}}case n:return d}}}e=Symbol.for("react.module.reference"),f.ContextConsumer=s,f.ContextProvider=u,f.Element=t,f.ForwardRef=a,f.Fragment=i,f.Lazy=g,f.Memo=h,f.Portal=n,f.Profiler=r,f.StrictMode=o,f.Suspense=c,f.SuspenseList=p,f.isAsyncMode=function(){return!1},f.isConcurrentMode=function(){return!1},f.isContextConsumer=function(e){return I(e)===s},f.isContextProvider=function(e){return I(e)===u},f.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},f.isForwardRef=function(e){return I(e)===a},f.isFragment=function(e){return I(e)===i},f.isLazy=function(e){return I(e)===g},f.isMemo=function(e){return I(e)===h},f.isPortal=function(e){return I(e)===n},f.isProfiler=function(e){return I(e)===r},f.isStrictMode=function(e){return I(e)===o},f.isSuspense=function(e){return I(e)===c},f.isSuspenseList=function(e){return I(e)===p},f.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===c||t===p||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===h||t.$$typeof===u||t.$$typeof===s||t.$$typeof===a||t.$$typeof===e||void 0!==t.getModuleId)},f.typeOf=I}();const h=e=>"object"==typeof e&&null!=e&&1===e.nodeType,g=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,m=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return g(n.overflowY,t)||g(n.overflowX,t)||(e=>{const 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},I=(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,v=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var y=0;function b(e){return"function"==typeof e?e:x}function x(){}function w(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:c}=t,d="function"==typeof a?a:e=>e!==a;if(!h(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let g=e;for(;h(g)&&d(g);){if(g=v(g),g===p){f.push(g);break}null!=g&&g===document.body&&m(g)&&!m(document.documentElement)||null!=g&&m(g,c)&&f.push(g)}const y=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,b=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:x,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect(),{top:E,right:K,bottom:P,left:T}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let R="start"===s||"nearest"===s?k-E:"end"===s?O+P:k+S/2-E+P,H="center"===l?M+C/2-T+K:"end"===l?D+K:M-T;const V=[];for(let e=0;e<f.length;e++){const t=f[e],{height:n,width:i,top:o,right:r,bottom:a,left:c}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=b&&D<=y&&k>=o&&O<=a&&M>=c&&D<=r)return V;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),g=parseInt(d.borderTopWidth,10),m=parseInt(d.borderRightWidth,10),v=parseInt(d.borderBottomWidth,10);let E=0,K=0;const P="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-m:0,T="offsetHeight"in t?t.offsetHeight-t.clientHeight-g-v:0,B="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(p===t)E="start"===s?R:"end"===s?R-b:"nearest"===s?I(w,w+b,b,g,v,w+R,w+R+S,S):R-b/2,K="start"===l?H:"center"===l?H-y/2:"end"===l?H-y:I(x,x+y,y,h,m,x+H,x+H+C,C),E=Math.max(0,E+w),K=Math.max(0,K+x);else{E="start"===s?R-o-g:"end"===s?R-a+v+T:"nearest"===s?I(o,a,n,g,v+T,R,R+S,S):R-(o+n/2)+T/2,K="start"===l?H-c-h:"center"===l?H-(c+i/2)+P/2:"end"===l?H-r+m+P:I(c,r,i,h,m+P,H,H+C,C);const{scrollLeft:e,scrollTop:u}=t;E=0===A?0:Math.max(0,Math.min(u+E/A,t.scrollHeight-n/A+T)),K=0===B?0:Math.max(0,Math.min(e+K/B,t.scrollWidth-i/B+P)),R+=u-E,H+=e-K}V.push({el:t,top:E,left:K})}return V})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function S(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function C(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 k(){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 D(){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 O(){return String(y++)}function M(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 E(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var K=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function P(e){void 0===e&&(e={});var t={};return K.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function T(e,t){return e&&t?Object.keys(e).reduce((function(n,i){return n[i]=R(t,i)?t[i]:e[i],n}),{}):e}function R(e,t){return void 0!==e[t]}function H(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function V(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=B(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function B(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?B(t?r-1:0,t,n,i):-1}function A(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(S(t,e,n)||i&&S(t,n.document.activeElement,n))}))}var L=C((function(e){F(e).textContent=""}),500);function F(e){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)}function _(e,t){e&&t&&(F(t).textContent=e,L(t))}var N=Object.freeze({__proto__:null,blurButton:14,blurInput:10,changeInput:11,clickButton:13,clickItem:9,controlledPropUpdatedSelectedItem:15,itemMouseEnter:2,keyDownArrowDown:4,keyDownArrowUp:3,keyDownEnd:8,keyDownEnter:6,keyDownEscape:5,keyDownHome:7,keyDownSpaceButton:12,mouseUp:1,touchEnd:16,unknown:0}),j=["refKey","ref"],U=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],W=["onKeyDown","onBlur","onChange","onInput","onChangeText"],$=["refKey","ref"],q=["onMouseMove","onMouseDown","onClick","onPress","index","item"],z=function(){var e=function(e){function r(t){var o=e.call(this,t)||this;o.id=o.props.id||"downshift-"+O(),o.menuId=o.props.menuId||o.id+"-menu",o.labelId=o.props.labelId||o.id+"-label",o.inputId=o.props.inputId||o.id+"-input",o.getItemId=o.props.getItemId||function(e){return o.id+"-item-"+e},o.items=[],o.itemCount=null,o.previousResultCount=0,o.timeoutIds=[],o.internalSetTimeout=function(e,t){var n=setTimeout((function(){o.timeoutIds=o.timeoutIds.filter((function(e){return e!==n})),e()}),t);o.timeoutIds.push(n)},o.setItemCount=function(e){o.itemCount=e},o.unsetItemCount=function(){o.itemCount=null},o.isItemDisabled=function(e,t){var n=o.getItemNodeFromIndex(t);return n&&n.hasAttribute("disabled")},o.setHighlightedIndex=function(e,t){void 0===e&&(e=o.props.defaultHighlightedIndex),void 0===t&&(t={}),t=P(t),o.internalSetState(i({highlightedIndex:e},t))},o.clearSelection=function(e){o.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:o.props.defaultHighlightedIndex,isOpen:o.props.defaultIsOpen},e)},o.selectItem=function(e,t,n){t=P(t),o.internalSetState(i({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,selectedItem:e,inputValue:o.props.itemToString(e)},t),n)},o.selectItemAtIndex=function(e,t,n){var i=o.items[e];null!=i&&o.selectItem(i,t,n)},o.selectHighlightedItem=function(e,t){return o.selectItemAtIndex(o.getState().highlightedIndex,e,t)},o.internalSetState=function(e,t){var n,r,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&o.props.onInputValueChange(e.inputValue,i({},o.getStateAndHelpers(),e)),o.setState((function(t){var l;t=o.getState(t);var a=s?e(t):e;a=o.props.stateReducer(t,a),n=a.hasOwnProperty("selectedItem");var c={};return n&&a.selectedItem!==t.selectedItem&&(r=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(u[e]=a[e]),"type"!==e&&(a[e],R(o.props,e)||(c[e]=a[e]))})),s&&a.hasOwnProperty("inputValue")&&o.props.onInputValueChange(a.inputValue,i({},o.getStateAndHelpers(),a)),c}),(function(){b(t)(),Object.keys(u).length>1&&o.props.onStateChange(u,o.getStateAndHelpers()),n&&o.props.onSelect(e.selectedItem,o.getStateAndHelpers()),void 0!==r&&o.props.onChange(r,o.getStateAndHelpers()),o.props.onUserAction(u,o.getStateAndHelpers())}))},o.rootRef=function(e){return o._rootNode=e},o.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,j),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;o.getRootProps.called=!0,o.getRootProps.refKey=l,o.getRootProps.suppressRefError=p;var f=o.getState().isOpen;return i(((r={})[l]=D(a,o.rootRef),r.role="combobox",r["aria-expanded"]=f,r["aria-haspopup"]="listbox",r["aria-owns"]=f?o.menuId:void 0,r["aria-labelledby"]=o.labelId,r),c)},o.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=V(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);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=V(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);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(i({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},o.buttonKeyDownHandlers=i({},o.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),o.inputKeyDownHandlers=i({},o.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=B(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=B(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),o.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,U),c=o.getState().isOpen,d={onClick:k(r,o.buttonHandleClick),onKeyDown:k(u,o.buttonHandleKeyDown),onKeyUp:k(s,o.buttonHandleKeyUp),onBlur:k(l,o.buttonHandleBlur)};return i({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},o.buttonHandleKeyUp=function(e){e.preventDefault()},o.buttonHandleKeyDown=function(e){var t=H(e);o.buttonKeyDownHandlers[t]&&o.buttonKeyDownHandlers[t].call(o,e)},o.buttonHandleClick=function(e){if(e.preventDefault(),o.props.environment){var t=o.props.environment.document,n=t.body,i=t.activeElement;n&&n===i&&e.target.focus()}o.internalSetTimeout((function(){return o.toggleMenu({type:13})}))},o.buttonHandleBlur=function(e){var t=e.target;o.internalSetTimeout((function(){if(!o.isMouseDown&&o.props.environment){var e=o.props.environment.document.activeElement;null!=e&&e.id===o.inputId||e===t||o.reset({type:14})}}))},o.getLabelProps=function(e){return i({htmlFor:o.inputId,id:o.labelId},e)},o.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,W),c={};var d,p=o.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((d={}).onChange=k(s,l,o.inputHandleChange),d.onKeyDown=k(r,o.inputHandleKeyDown),d.onBlur=k(u,o.inputHandleBlur),c=d);return i({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?o.getItemId(g):void 0,"aria-controls":h?o.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:o.labelId,autoComplete:"off",value:f,id:o.inputId},c,a)},o.inputHandleKeyDown=function(e){var t=H(e);t&&o.inputKeyDownHandlers[t]&&o.inputKeyDownHandlers[t].call(o,e)},o.inputHandleChange=function(e){o.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:o.props.defaultHighlightedIndex})},o.inputHandleBlur=function(){o.internalSetTimeout((function(){var e;if(!o.isMouseDown&&o.props.environment){var t=o.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&o._rootNode&&o._rootNode.contains(t)||o.reset({type:10})}}))},o.menuRef=function(e){o._menuNode=e},o.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,$),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return o.getMenuProps.called=!0,o.getMenuProps.refKey=l,o.getMenuProps.suppressRefError=p,i(((r={})[l]=D(a,o.menuRef),r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?void 0:o.labelId,r.id=o.menuId,r),c)},o.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,q);void 0===a?(o.items.push(d),a=o.items.indexOf(d)):o.items[a]=d;var f=l,h=((t={onMouseMove:k(u,(function(){a!==o.getState().highlightedIndex&&(o.setHighlightedIndex(a,{type:2}),o.avoidScrolling=!0,o.internalSetTimeout((function(){return o.avoidScrolling=!1}),250))})),onMouseDown:k(s,(function(e){e.preventDefault()}))}).onClick=k(f,(function(){o.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return i({id:o.getItemId(a),role:"option","aria-selected":o.getState().highlightedIndex===a},g,p)},o.clearItems=function(){o.items=[]},o.reset=function(e,t){void 0===e&&(e={}),e=P(e),o.internalSetState((function(t){var n=t.selectedItem;return i({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,inputValue:o.props.itemToString(n)},e)}),t)},o.toggleMenu=function(e,t){void 0===e&&(e={}),e=P(e),o.internalSetState((function(t){var n=t.isOpen;return i({isOpen:!n},n&&{highlightedIndex:o.props.defaultHighlightedIndex},e)}),(function(){var n=o.getState(),i=n.isOpen,r=n.highlightedIndex;i&&o.getItemCount()>0&&"number"==typeof r&&o.setHighlightedIndex(r,e),b(t)()}))},o.openMenu=function(e){o.internalSetState({isOpen:!0},e)},o.closeMenu=function(e){o.internalSetState({isOpen:!1},e)},o.updateStatus=C((function(){var e;if(null!=(e=o.props)&&null!=(e=e.environment)&&e.document){var t=o.getState(),n=o.items[t.highlightedIndex],r=o.getItemCount(),u=o.props.getA11yStatusMessage(i({itemToString:o.props.itemToString,previousResultCount:o.previousResultCount,resultCount:r,highlightedItem:n},t));o.previousResultCount=r,_(u,o.props.environment.document)}}),200);var r=o.props,u=r.defaultHighlightedIndex,s=r.initialHighlightedIndex,l=void 0===s?u:s,a=r.defaultIsOpen,c=r.initialIsOpen,d=void 0===c?a:c,p=r.initialInputValue,f=void 0===p?"":p,h=r.initialSelectedItem,g=void 0===h?null:h,m=o.getState({highlightedIndex:l,isOpen:d,inputValue:f,selectedItem:g});return null!=m.selectedItem&&void 0===o.props.initialInputValue&&(m.inputValue=o.props.itemToString(m.selectedItem)),o.state=m,o}var u,s;s=e,(u=r).prototype=Object.create(s.prototype),u.prototype.constructor=u,o(u,s);var l=r.prototype;return l.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},l.getState=function(e){return void 0===e&&(e=this.state),T(e,this.props)},l.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},l.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},l.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},l.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=V(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},l.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,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=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:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},l.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!A(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=A(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)}}else this.cleanup=function(){e.internalClearTimeouts()}},l.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},l.componentDidUpdate=function(e,t){R(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()},l.componentWillUnmount=function(){this.cleanup()},l.render=function(){var e=E(this.props.children,x);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=E(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},r}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:M,itemToString:function(e){return null==e?"":String(e)},onStateChange:x,onInputValueChange:x,onUserAction:x,onChange:x,onSelect:x,onOuterClick:x,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:w},e.stateChangeTypes=N,e}(),Y={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function X(e,t,n){var o=e.props,r=e.type,u={};Object.keys(t).forEach((function(o){!function(e,t,n,o){var r=t.props,u=t.type,s="on"+ee(e)+"Change";r[s]&&void 0!==o[e]&&o[e]!==n[e]&&r[s](i({type:u},o))}(o,e,t,n),n[o]!==t[o]&&(u[o]=n[o])})),o.onStateChange&&Object.keys(u).length&&o.onStateChange(i({type:r},u))}var G=C((function(e,t){_(e,t)}),200),J="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,Q="useId"in t?function(e){var n=e.id,i=e.labelId,o=e.menuId,r=e.getItemId,u=e.toggleButtonId,s=e.inputId,l="downshift-"+t.useId();return n||(n=l),t.useRef({labelId:i||n+"-label",menuId:o||n+"-menu",getItemId:r||function(e){return n+"-item-"+e},toggleButtonId:u||n+"-toggle-button",inputId:s||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+O():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 Z(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 ee(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function te(e){var n=t.useRef(e);return n.current=e,n}function ne(e,n,o,r){var u=t.useRef(),s=t.useRef(),l=t.useCallback((function(t,n){s.current=n,t=T(t,n.props);var o=e(t,n);return n.props.stateReducer(t,i({},n,{changes:o}))}),[e]),a=t.useReducer(l,n,o),c=a[0],d=a[1],p=te(n),f=t.useCallback((function(e){return d(i({props:p.current},e))}),[p]),h=s.current;return t.useEffect((function(){var e=T(u.current,null==h?void 0:h.props);h&&u.current&&!r(e,c)&&X(h,e,c),u.current=c}),[c,h,r]),[c,f]}function ie(e,t,n,i){var o=ne(e,t,n,i),r=o[0],u=o[1];return[T(r,t),u]}var oe={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:w,environment:"undefined"==typeof window?void 0:window};function re(e,t,n){void 0===n&&(n=Y);var i=e["default"+ee(t)];return void 0!==i?i:n[t]}function ue(e,t,n){void 0===n&&(n=Y);var i=e[t];if(void 0!==i)return i;var o=e["initial"+ee(t)];return void 0!==o?o:re(e,t,n)}function se(e){var t=ue(e,"selectedItem"),n=ue(e,"isOpen"),i=function(e){var t=ue(e,"highlightedIndex");if(t>-1&&e.isItemDisabled(e.items[t],t))return-1;return t}(e),o=ue(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.findIndex((function(n){return e.itemToKey(n)===e.itemToKey(t)})):i,isOpen:n,selectedItem:t,inputValue:o}}function le(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=e.isItemDisabled,s=e.itemToKey,l=t.selectedItem,a=t.highlightedIndex;return 0===i.length?-1:void 0===o||a!==o||u(i[o],o)?void 0===r||u(i[r],r)?l?i.findIndex((function(e){return s(l)===s(e)})):n<0&&!u(i[i.length-1],i.length-1)?i.length-1:n>0&&!u(i[0],0)?0:-1:r:o}function ae(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return x;var t=n.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(n){o.current.isMouseDown=!1,A(n.target,t,e)||i()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(n){o.current.isTouchEnd=!0,o.current.isTouchMove||A(n.target,t,e,!1)||i()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a)}}),[e,i]),o.current}var ce=function(){return x};function de(e,n,i,o){void 0===o&&(o={});var r=o.document,u=ge();t.useEffect((function(){if(e&&!u&&r){var t=e(n);G(t,r)}}),i),t.useEffect((function(){return function(){var e,t;G.cancel(),(t=null==(e=r)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[r])}function pe(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 J((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}function fe(e,t,n){var o;return void 0===n&&(n=!0),i({isOpen:!1,highlightedIndex:-1},(null==(o=e.items)?void 0:o.length)&&t>=0&&i({selectedItem:e.items[t],isOpen:re(e,"isOpen"),highlightedIndex:re(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function he(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function ge(){var e=t.useRef(!0);return t.useEffect((function(){return e.current=!1,function(){e.current=!0}}),[]),e.current}function me(e){var t=re(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var Ie={environment:p.shape({addEventListener:p.func.isRequired,removeEventListener:p.func.isRequired,document:p.shape({createElement:p.func.isRequired,getElementById:p.func.isRequired,activeElement:p.any.isRequired,body:p.any.isRequired}).isRequired,Node:p.func.isRequired}),itemToString:p.func,itemToKey:p.func,stateReducer:p.func},ve=i({},Ie,{getA11yStatusMessage:p.func,highlightedIndex:p.number,defaultHighlightedIndex:p.number,initialHighlightedIndex:p.number,isOpen:p.bool,defaultIsOpen:p.bool,initialIsOpen:p.bool,selectedItem:p.any,initialSelectedItem:p.any,defaultSelectedItem:p.any,id:p.string,labelId:p.string,menuId:p.string,getItemId:p.func,toggleButtonId:p.string,onSelectedItemChange:p.func,onHighlightedIndexChange:p.func,onStateChange:p.func,onIsOpenChange:p.func,scrollIntoView:p.func});function ye(e,t,n){var o,r=t.type,u=t.props;switch(r){case n.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:le(u,e,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:le(u,e,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:u.isItemDisabled(u.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:t.inputValue};break;case n.FunctionReset:o={highlightedIndex:me(u),isOpen:re(u,"isOpen"),selectedItem:re(u,"selectedItem"),inputValue:re(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return i({},e,o)}var be=function(){return be=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},be.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,be(be({},ve),{items:p.array.isRequired,isItemDisabled:p.func});var xe=be(be({},oe),{isItemDisabled:function(){return!1}}),we=1,Se=2,Ce=3,ke=4,De=5,Oe=6,Me=7,Ee=8,Ke=9,Pe=10,Te=11,Re=14,He=19,Ve=Object.freeze({__proto__:null,FunctionCloseMenu:17,FunctionOpenMenu:16,FunctionReset:21,FunctionSelectItem:He,FunctionSetHighlightedIndex:18,FunctionSetInputValue:20,FunctionToggleMenu:15,ItemClick:Re,ItemMouseMove:13,MenuMouseLeave:12,ToggleButtonBlur:Te,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:we,ToggleButtonKeyDownArrowUp:Se,ToggleButtonKeyDownCharacter:Ce,ToggleButtonKeyDownEnd:Oe,ToggleButtonKeyDownEnter:Me,ToggleButtonKeyDownEscape:ke,ToggleButtonKeyDownHome:De,ToggleButtonKeyDownPageDown:Pe,ToggleButtonKeyDownPageUp:Ke,ToggleButtonKeyDownSpaceButton:Ee});function Be(e,t){var n,o,r=t.type,u=t.props,s=t.altKey;switch(r){case Re:o={isOpen:re(u,"isOpen"),highlightedIndex:me(u),selectedItem:u.items[t.index]};break;case Ce:var l=t.key,a=""+e.inputValue+l;o={inputValue:a,highlightedIndex:function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,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)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.findIndex((function(t){return u.itemToKey(t)===u.itemToKey(e.selectedItem)})):e.highlightedIndex,items:u.items,itemToString:u.itemToString,isItemDisabled:u.isItemDisabled}),isOpen:!0};break;case we:o={highlightedIndex:e.isOpen?V(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:le(u,e,1),isOpen:!0};break;case Se:if(e.isOpen&&s)o=fe(u,e.highlightedIndex,!1);else o={highlightedIndex:e.isOpen?V(e.highlightedIndex,-1,u.items,u.isItemDisabled):le(u,e,-1),isOpen:!0};break;case Me:case Ee:o=fe(u,e.highlightedIndex,!1);break;case De:o={highlightedIndex:B(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Oe:o={highlightedIndex:B(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Ke:o={highlightedIndex:V(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case Pe:o={highlightedIndex:V(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case ke:o={isOpen:!1,highlightedIndex:-1};break;case Te:o=i({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case He:o={selectedItem:t.selectedItem};break;default:return ye(e,t,Ve)}return i({},e,o)}var Ae=["onClick"],Le=["onMouseLeave","refKey","ref"],Fe=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],_e=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function Ne(e){void 0===e&&(e={});var o=i({},xe,e),r=o.scrollIntoView,u=o.environment,s=o.getA11yStatusMessage,l=ie(Be,o,se,he),a=l[0],c=l[1],d=a.isOpen,p=a.highlightedIndex,f=a.selectedItem,h=a.inputValue,g=t.useRef(null),m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=Q(o),b=te({state:a,props:o}),x=t.useCallback((function(e){return I.current[y.getItemId(e)]}),[y]);de(s,a,[d,p,f,h],u);var w=pe({menuElement:m.current,highlightedIndex:p,isOpen:d,itemRefs:I,scrollIntoView:r,getItemNodeFromIndex:x});t.useEffect((function(){return v.current=C((function(e){e({type:20,inputValue:""})}),500),function(){v.current.cancel()}}),[]),t.useEffect((function(){h&&v.current(c)}),[c,h]),t.useEffect((function(){ue(o,"isOpen")&&g.current&&g.current.focus()}),[]);var S=ae(u,[g,m],t.useCallback((function(){b.current.state.isOpen&&c({type:Te})}),[c,b])),O=ce();t.useEffect((function(){d||(I.current={})}),[d]);var M=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:we,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Se,altKey:e.altKey})},Home:function(e){e.preventDefault(),c({type:De})},End:function(e){e.preventDefault(),c({type:Oe})},Escape:function(){b.current.state.isOpen&&c({type:ke})},Enter:function(e){e.preventDefault(),c({type:b.current.state.isOpen?Me:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Ke}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Pe}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?c({type:Ce,key:" "}):c({type:Ee}):c({type:0})}}}),[c,b]),E=t.useCallback((function(){c({type:15})}),[c]),K=t.useCallback((function(){c({type:17})}),[c]),P=t.useCallback((function(){c({type:16})}),[c]),T=t.useCallback((function(e){c({type:18,highlightedIndex:e})}),[c]),R=t.useCallback((function(e){c({type:He,selectedItem:e})}),[c]),V=t.useCallback((function(){c({type:21})}),[c]),B=t.useCallback((function(e){c({type:20,inputValue:e})}),[c]),A=t.useCallback((function(e){var t=void 0===e?{}:e,o=t.onClick,r=n(t,Ae);return i({id:y.labelId,htmlFor:y.toggleButtonId,onClick:k(o,(function(){var e;null==(e=g.current)||e.focus()}))},r)}),[y]),L=t.useCallback((function(e,t){var o,r=void 0===e?{}:e,u=r.onMouseLeave,s=r.refKey,l=void 0===s?"ref":s,a=r.ref,d=n(r,Le);return(void 0===t?{}:t).suppressRefError,i(((o={})[l]=D(a,(function(e){m.current=e})),o.id=y.menuId,o.role="listbox",o["aria-labelledby"]=d&&d["aria-label"]?void 0:""+y.labelId,o.onMouseLeave=k(u,(function(){c({type:12})})),o),d)}),[c,O,y]),F=t.useCallback((function(e,t){var o,r=void 0===e?{}:e,u=r.onBlur,s=r.onClick;r.onPress;var l=r.onKeyDown,a=r.refKey,d=void 0===a?"ref":a,p=r.ref,f=n(r,Fe);(void 0===t?{}:t).suppressRefError;var h=b.current.state,m=i(((o={})[d]=D(p,(function(e){g.current=e})),o["aria-activedescendant"]=h.isOpen&&h.highlightedIndex>-1?y.getItemId(h.highlightedIndex):"",o["aria-controls"]=y.menuId,o["aria-expanded"]=b.current.state.isOpen,o["aria-haspopup"]="listbox",o["aria-labelledby"]=f&&f["aria-label"]?void 0:""+y.labelId,o.id=y.toggleButtonId,o.role="combobox",o.tabIndex=0,o.onBlur=k(u,(function(){h.isOpen&&!S.isMouseDown&&c({type:Te})})),o),f);return f.disabled||(m.onClick=k(s,(function(){c({type:0})})),m.onKeyDown=k(l,(function(e){var t=H(e);t&&M[t]?M[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&c({type:Ce,key:t})}))),m}),[c,y,b,S,O,M]),_=t.useCallback((function(e){var t,o=void 0===e?{}:e,r=o.item,u=o.index,s=o.onMouseMove,l=o.onClick,a=o.onMouseDown;o.onPress;var d=o.refKey,p=void 0===d?"ref":d,f=o.disabled,h=o.ref,g=n(o,_e);void 0!==f&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=b.current,v=m.state,x=m.props,C=Z(r,u,x.items,"Pass either item or index to getItemProps!"),O=C[0],M=C[1],E=x.isItemDisabled(O,M),K=i(((t={})[p]=D(h,(function(e){e&&(I.current[y.getItemId(M)]=e)})),t["aria-disabled"]=E,t["aria-selected"]=O===v.selectedItem,t.id=y.getItemId(M),t.role="option",t),g);return E||(K.onClick=k(l,(function(){c({type:Re,index:M})}))),K.onMouseMove=k(s,(function(){S.isTouchEnd||M===v.highlightedIndex||(w.current=!1,c({type:13,index:M,disabled:E}))})),K.onMouseDown=k(a,(function(e){return e.preventDefault()})),K}),[b,y,S,w,c]);return{getToggleButtonProps:F,getLabelProps:A,getMenuProps:L,getItemProps:_,toggleMenu:E,openMenu:P,closeMenu:K,setHighlightedIndex:T,selectItem:R,reset:V,setInputValue:B,highlightedIndex:p,isOpen:d,selectedItem:f,inputValue:h}}Ne.stateChangeTypes=Ve;var je=0,Ue=1,We=2,$e=3,qe=4,ze=5,Ye=6,Xe=7,Ge=8,Je=9,Qe=10,Ze=13,et=19,tt=22,nt=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:tt,FunctionCloseMenu:17,FunctionOpenMenu:16,FunctionReset:21,FunctionSelectItem:et,FunctionSetHighlightedIndex:18,FunctionSetInputValue:20,FunctionToggleMenu:15,InputBlur:Je,InputChange:Ge,InputClick:Qe,InputKeyDownArrowDown:je,InputKeyDownArrowUp:Ue,InputKeyDownEnd:qe,InputKeyDownEnter:Xe,InputKeyDownEscape:We,InputKeyDownHome:$e,InputKeyDownPageDown:Ye,InputKeyDownPageUp:ze,ItemClick:Ze,ItemMouseMove:12,MenuMouseLeave:11,ToggleButtonClick:14});function it(e){var t=se(e),n=t.selectedItem,o=t.inputValue;return""===o&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(o=e.itemToString(n)),i({},t,{inputValue:o})}i({},ve,{items:p.array.isRequired,isItemDisabled:p.func,inputValue:p.string,defaultInputValue:p.string,initialInputValue:p.string,inputId:p.string,onInputValueChange:p.func});var ot=i({},oe,{isItemDisabled:function(){return!1}});function rt(e,t){var n,o,r=t.type,u=t.props,s=t.altKey;switch(r){case Ze:o={isOpen:re(u,"isOpen"),highlightedIndex:me(u),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case je:o=e.isOpen?{highlightedIndex:V(e.highlightedIndex,1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:le(u,e,1),isOpen:u.items.length>=0};break;case Ue:o=e.isOpen?s?fe(u,e.highlightedIndex):{highlightedIndex:V(e.highlightedIndex,-1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:le(u,e,-1),isOpen:u.items.length>=0};break;case Xe:o=fe(u,e.highlightedIndex);break;case We:o=i({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case ze:o={highlightedIndex:V(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case Ye:o={highlightedIndex:V(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case $e:o={highlightedIndex:B(0,!1,u.items,u.isItemDisabled)};break;case qe:o={highlightedIndex:B(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case Je:o=i({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 Ge:o={isOpen:!0,highlightedIndex:me(u),inputValue:t.inputValue};break;case Qe:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:le(u,e,0)};break;case et:o={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case tt:o={inputValue:t.inputValue};break;default:return ye(e,t,nt)}return i({},e,o)}var ut=["onMouseLeave","refKey","ref"],st=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],lt=["onClick","onPress","refKey","ref"],at=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function ct(e){void 0===e&&(e={});var o=i({},ot,e),r=o.items,u=o.scrollIntoView,s=o.environment,l=o.getA11yStatusMessage,a=function(e,n,i,o){var r=t.useRef(),u=ne(e,n,i,o),s=u[0],l=u[1],a=ge();return t.useEffect((function(){R(n,"selectedItem")&&(a||n.itemToKey(n.selectedItem)!==n.itemToKey(r.current)&&l({type:tt,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[T(s,n),l]}(rt,o,it,he),c=a[0],d=a[1],p=c.isOpen,f=c.highlightedIndex,h=c.selectedItem,g=c.inputValue,m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=t.useRef(null),b=ge(),x=Q(o),w=t.useRef(),S=te({state:c,props:o}),C=t.useCallback((function(e){return I.current[x.getItemId(e)]}),[x]);de(l,c,[p,f,h,g],s);var O=pe({menuElement:m.current,highlightedIndex:f,isOpen:p,itemRefs:I,scrollIntoView:u,getItemNodeFromIndex:C});t.useEffect((function(){ue(o,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){b||(w.current=r.length)}));var M=ae(s,[y,m,v],t.useCallback((function(){S.current.state.isOpen&&d({type:Je,selectItem:!1})}),[d,S])),E=ce();t.useEffect((function(){p||(I.current={})}),[p]),t.useEffect((function(){var e;p&&null!=s&&s.document&&null!=v&&null!=(e=v.current)&&e.focus&&s.document.activeElement!==v.current&&v.current.focus()}),[p,s]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:je,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:Ue,altKey:e.altKey})},Home:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:$e}))},End:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:qe}))},Escape:function(e){var t=S.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),d({type:We}))},Enter:function(e){S.current.state.isOpen&&229!==e.which&&(e.preventDefault(),d({type:Xe}))},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:ze}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Ye}))}}}),[d,S]),P=t.useCallback((function(e){return i({id:x.labelId,htmlFor:x.inputId},e)}),[x]),V=t.useCallback((function(e,t){var o,r=void 0===e?{}:e,u=r.onMouseLeave,s=r.refKey,l=void 0===s?"ref":s,a=r.ref,c=n(r,ut);return(void 0===t?{}:t).suppressRefError,i(((o={})[l]=D(a,(function(e){m.current=e})),o.id=x.menuId,o.role="listbox",o["aria-labelledby"]=c&&c["aria-label"]?void 0:""+x.labelId,o.onMouseLeave=k(u,(function(){d({type:11})})),o),c)}),[d,E,x]),B=t.useCallback((function(e){var t,o,r=void 0===e?{}:e,u=r.item,s=r.index,l=r.refKey,a=void 0===l?"ref":l,c=r.ref,p=r.onMouseMove,f=r.onMouseDown,h=r.onClick;r.onPress;var g=r.disabled,m=n(r,st);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var v=S.current,y=v.props,b=v.state,w=Z(u,s,y.items,"Pass either item or index to getItemProps!"),C=w[0],E=w[1],K=y.isItemDisabled(C,E),P=h;return i(((t={})[a]=D(c,(function(e){e&&(I.current[x.getItemId(E)]=e)})),t["aria-disabled"]=K,t["aria-selected"]=E===b.highlightedIndex,t.id=x.getItemId(E),t.role="option",t),!K&&((o={}).onClick=k(P,(function(){d({type:Ze,index:E})})),o),{onMouseMove:k(p,(function(){M.isTouchEnd||E===b.highlightedIndex||(O.current=!1,d({type:12,index:E,disabled:K}))})),onMouseDown:k(f,(function(e){return e.preventDefault()}))},m)}),[d,x,S,M,O]),A=t.useCallback((function(e){var t,o=void 0===e?{}:e,r=o.onClick;o.onPress;var u=o.refKey,s=void 0===u?"ref":u,l=o.ref,a=n(o,lt),c=S.current.state;return i(((t={})[s]=D(l,(function(e){y.current=e})),t["aria-controls"]=x.menuId,t["aria-expanded"]=c.isOpen,t.id=x.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&i({},{onClick:k(r,(function(){d({type:14})}))}),a)}),[d,S,x]),L=t.useCallback((function(e,t){var o,r=void 0===e?{}:e,u=r.onKeyDown,l=r.onChange,a=r.onInput,c=r.onBlur;r.onChangeText;var p=r.onClick,f=r.refKey,h=void 0===f?"ref":f,g=r.ref,m=n(r,at);(void 0===t?{}:t).suppressRefError;var I,y=S.current.state,b={};m.disabled||((I={}).onChange=k(l,a,(function(e){d({type:Ge,inputValue:e.target.value})})),I.onKeyDown=k(u,(function(e){var t=H(e);t&&K[t]&&K[t](e)})),I.onBlur=k(c,(function(e){if(null!=s&&s.document&&y.isOpen&&!M.isMouseDown){var t=null===e.relatedTarget&&s.document.activeElement!==s.document.body;d({type:Je,selectItem:!t})}})),I.onClick=k(p,(function(){d({type:Qe})})),b=I);return i(((o={})[h]=D(g,(function(e){v.current=e})),o["aria-activedescendant"]=y.isOpen&&y.highlightedIndex>-1?x.getItemId(y.highlightedIndex):"",o["aria-autocomplete"]="list",o["aria-controls"]=x.menuId,o["aria-expanded"]=y.isOpen,o["aria-labelledby"]=m&&m["aria-label"]?void 0:x.labelId,o.autoComplete="off",o.id=x.inputId,o.role="combobox",o.value=y.inputValue,o),b,m)}),[d,x,s,K,S,M,E]),F=t.useCallback((function(){d({type:15})}),[d]),_=t.useCallback((function(){d({type:17})}),[d]),N=t.useCallback((function(){d({type:16})}),[d]),j=t.useCallback((function(e){d({type:18,highlightedIndex:e})}),[d]),U=t.useCallback((function(e){d({type:et,selectedItem:e})}),[d]);return{getItemProps:B,getLabelProps:P,getMenuProps:V,getInputProps:L,getToggleButtonProps:A,toggleMenu:F,openMenu:N,closeMenu:_,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){d({type:20,inputValue:e})}),[d]),selectItem:U,reset:t.useCallback((function(){d({type:21})}),[d]),highlightedIndex:f,isOpen:p,selectedItem:h,inputValue:g}}ct.stateChangeTypes=nt;var dt={activeIndex:-1,selectedItems:[]};function pt(e,t){return ue(e,t,dt)}function ft(e,t){return re(e,t,dt)}function ht(e){return{activeIndex:pt(e,"activeIndex"),selectedItems:pt(e,"selectedItems")}}function gt(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}function mt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}p.array,p.array,p.array,p.func,p.number,p.number,p.number,p.func,p.func,p.string,p.string;var It={itemToKey:oe.itemToKey,stateReducer:oe.stateReducer,environment:oe.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},vt=0,yt=1,bt=2,xt=3,wt=4,St=5,Ct=6,kt=7,Dt=8,Ot=9,Mt=10,Et=11,Kt=12,Pt=Object.freeze({__proto__:null,DropdownClick:kt,DropdownKeyDownBackspace:Ct,DropdownKeyDownNavigationPrevious:St,FunctionAddSelectedItem:Dt,FunctionRemoveSelectedItem:Ot,FunctionReset:Kt,FunctionSetActiveIndex:Et,FunctionSetSelectedItems:Mt,SelectedItemClick:vt,SelectedItemKeyDownBackspace:bt,SelectedItemKeyDownDelete:yt,SelectedItemKeyDownNavigationNext:xt,SelectedItemKeyDownNavigationPrevious:wt});function Tt(e,t){var n,o=t.type,r=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(o){case vt:n={activeIndex:r};break;case wt:n={activeIndex:l-1<0?0:l-1};break;case xt:n={activeIndex:l+1>=a.length?-1:l+1};break;case bt:case yt:if(l<0)break;var c=l;1===a.length?c=-1:l===a.length-1&&(c=a.length-2),n=i({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:c});break;case St:n={activeIndex:a.length-1};break;case Ct:n={selectedItems:a.slice(0,a.length-1)};break;case Dt:n={selectedItems:[].concat(a,[s])};break;case kt:n={activeIndex:-1};break;case Ot:var d=l,p=a.findIndex((function(e){return u.itemToKey(e)===u.itemToKey(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 Mt:n={selectedItems:t.selectedItems};break;case Et:n={activeIndex:t.activeIndex};break;case Kt:n={activeIndex:ft(u,"activeIndex"),selectedItems:ft(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return i({},e,n)}var Rt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Ht=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Vt(e){void 0===e&&(e={});var o=i({},It,e),r=o.getA11yStatusMessage,u=o.environment,s=o.keyNavigationNext,l=o.keyNavigationPrevious,a=ie(Tt,o,ht,mt),c=a[0],d=a[1],p=c.activeIndex,f=c.selectedItems,h=ge(),g=t.useRef(null),m=t.useRef();m.current=[];var I=te({state:c,props:o});de(r,c,[p,f],u),t.useEffect((function(){h||(-1===p&&g.current?g.current.focus():m.current[p]&&m.current[p].focus())}),[p]);var v=ce(),y=t.useMemo((function(){var e;return(e={})[l]=function(){d({type:wt})},e[s]=function(){d({type:xt})},e.Delete=function(){d({type:yt})},e.Backspace=function(){d({type:bt})},e}),[d,s,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){gt(e)&&d({type:St})},e.Backspace=function(e){gt(e)&&d({type:Ct})},e}),[d,l]);return{getSelectedItemProps:t.useCallback((function(e){var t,o=void 0===e?{}:e,r=o.refKey,u=void 0===r?"ref":r,s=o.ref,l=o.onClick,a=o.onKeyDown,c=o.selectedItem,p=o.index,f=n(o,Rt),h=I.current.state,g=Z(c,p,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],v=g>-1&&g===h.activeIndex;return i(((t={})[u]=D(s,(function(e){e&&m.current.push(e)})),t.tabIndex=v?0:-1,t.onClick=k(l,(function(){d({type:vt,index:g})})),t.onKeyDown=k(a,(function(e){var t=H(e);t&&y[t]&&y[t](e)})),t),f)}),[d,I,y]),getDropdownProps:t.useCallback((function(e,t){var o,r=void 0===e?{}:e,u=r.refKey,s=void 0===u?"ref":u,l=r.ref,a=r.onKeyDown,c=r.onClick,p=r.preventKeyAction,f=void 0!==p&&p,h=n(r,Ht);return(void 0===t?{}:t).suppressRefError,i(((o={})[s]=D(l,(function(e){e&&(g.current=e)})),o),!f&&{onKeyDown:k(a,(function(e){var t=H(e);t&&b[t]&&b[t](e)})),onClick:k(c,(function(){d({type:kt})}))},h)}),[d,b,v]),addSelectedItem:t.useCallback((function(e){d({type:Dt,selectedItem:e})}),[d]),removeSelectedItem:t.useCallback((function(e){d({type:Ot,selectedItem:e})}),[d]),setSelectedItems:t.useCallback((function(e){d({type:Mt,selectedItems:e})}),[d]),setActiveIndex:t.useCallback((function(e){d({type:Et,activeIndex:e})}),[d]),reset:t.useCallback((function(){d({type:Kt})}),[d]),selectedItems:f,activeIndex:p}}Vt.stateChangeTypes=Pt,e.default=z,e.resetIdCounter=function(){"useId"in t?console.warn("It is not necessary to call resetIdCounter when using React 18+"):y=0},e.useCombobox=ct,e.useMultipleSelection=Vt,e.useSelect=Ne,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){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(t);function o(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 r(){return r=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},r.apply(this,arguments)}function u(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)}function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a,c,d,p,f={exports:{}};f.exports=function(){if(p)return d;p=1;var e=c?a:(c=1,a="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,d=function(){function i(t,n,i,o,r,u){if(u!==e){var s=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 s.name="Invariant Violation",s}}function o(){return i}i.isRequired=i;var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return r.PropTypes=r,r}}()();var h,g=l(f.exports),m={};!function(){if(h)return m;h=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case i:case r:case o:case c:case d:return e;default:switch(e=e&&e.$$typeof){case l:case s:case a:case f:case p:case u:return e;default:return h}}case n:return h}}}e=Symbol.for("react.module.reference"),m.ContextConsumer=s,m.ContextProvider=u,m.Element=t,m.ForwardRef=a,m.Fragment=i,m.Lazy=f,m.Memo=p,m.Portal=n,m.Profiler=r,m.StrictMode=o,m.Suspense=c,m.SuspenseList=d,m.isAsyncMode=function(){return!1},m.isConcurrentMode=function(){return!1},m.isContextConsumer=function(e){return I(e)===s},m.isContextProvider=function(e){return I(e)===u},m.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},m.isForwardRef=function(e){return I(e)===a},m.isFragment=function(e){return I(e)===i},m.isLazy=function(e){return I(e)===f},m.isMemo=function(e){return I(e)===p},m.isPortal=function(e){return I(e)===n},m.isProfiler=function(e){return I(e)===r},m.isStrictMode=function(e){return I(e)===o},m.isSuspense=function(e){return I(e)===c},m.isSuspenseList=function(e){return I(e)===d},m.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===c||t===d||t===g||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===p||t.$$typeof===u||t.$$typeof===s||t.$$typeof===a||t.$$typeof===e||void 0!==t.getModuleId)},m.typeOf=I}();const I=e=>"object"==typeof e&&null!=e&&1===e.nodeType,v=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,y=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return v(n.overflowY,t)||v(n.overflowX,t)||(e=>{const 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},b=(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,x=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var w=0;function S(e){return"function"==typeof e?e:C}function C(){}function k(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:c}=t,d="function"==typeof a?a:e=>e!==a;if(!I(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let h=e;for(;I(h)&&d(h);){if(h=x(h),h===p){f.push(h);break}null!=h&&h===document.body&&y(h)&&!y(document.documentElement)||null!=h&&y(h,c)&&f.push(h)}const g=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,m=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:v,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect();let E="start"===s||"nearest"===s?k:"end"===s?O:k+S/2,K="center"===l?M+C/2:"end"===l?D:M;const P=[];for(let e=0;e<f.length;e++){const t=f[e],{height:n,width:i,top:o,right:r,bottom:a,left:c}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=m&&D<=g&&k>=o&&O<=a&&M>=c&&D<=r)return P;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),I=parseInt(d.borderTopWidth,10),y=parseInt(d.borderRightWidth,10),x=parseInt(d.borderBottomWidth,10);let T=0,R=0;const H="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-y:0,V="offsetHeight"in t?t.offsetHeight-t.clientHeight-I-x:0,B="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(p===t)T="start"===s?E:"end"===s?E-m:"nearest"===s?b(w,w+m,m,I,x,w+E,w+E+S,S):E-m/2,R="start"===l?K:"center"===l?K-g/2:"end"===l?K-g:b(v,v+g,g,h,y,v+K,v+K+C,C),T=Math.max(0,T+w),R=Math.max(0,R+v);else{T="start"===s?E-o-I:"end"===s?E-a+x+V:"nearest"===s?b(o,a,n,I,x+V,E,E+S,S):E-(o+n/2)+V/2,R="start"===l?K-c-h:"center"===l?K-(c+i/2)+H/2:"end"===l?K-r+y+H:b(c,r,i,h,y+H,K,K+C,C);const{scrollLeft:e,scrollTop:u}=t;T=Math.max(0,Math.min(u+T/A,t.scrollHeight-n/A+V)),R=Math.max(0,Math.min(e+R/B,t.scrollWidth-i/B+H)),E+=u-T,K+=e-R}P.push({el:t,top:T,left:R})}return P})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function D(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function O(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 M(){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 E(){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 K(){return String(w++)}function P(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 T(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var R=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function H(e){void 0===e&&(e={});var t={};return R.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function V(e,t){return e&&t?Object.keys(e).reduce((function(n,i){return n[i]=B(t,i)?t[i]:e[i],n}),{}):e}function B(e,t){return void 0!==e[t]}function A(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function L(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=_(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function _(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?_(t?r-1:0,t,n,i):-1}function F(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(D(t,e,n)||i&&D(t,n.document.activeElement,n))}))}var N=O((function(e){j(e).textContent=""}),500);function j(e){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)}function U(e,t){e&&t&&(j(t).textContent=e,N(t))}var W=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}),$=["refKey","ref"],q=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],z=["onKeyDown","onBlur","onChange","onInput","onChangeText"],Y=["refKey","ref"],X=["onMouseMove","onMouseDown","onClick","onPress","index","item"],G=function(){var e=function(e){var n,i;function l(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+K(),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.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.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=H(t),n.internalSetState(r({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=H(t),n.internalSetState(r({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,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,r({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=s?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var c={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(u[e]=a[e]),"type"!==e&&(a[e],B(n.props,e)||(c[e]=a[e]))})),s&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,r({},n.getStateAndHelpers(),a)),c}),(function(){S(t)(),Object.keys(u).length>1&&n.props.onStateChange(u,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(u,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,$),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return r(((i={})[l]=E(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,i["aria-labelledby"]=n.labelId,i),c)},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=L(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);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=L(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);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(r({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=r({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=r({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=_(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=_(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var u=t.onKeyDown,s=t.onKeyUp,l=t.onBlur,a=o(t,q),c=n.getState().isOpen,d={onClick:M(i,n.buttonHandleClick),onKeyDown:M(u,n.buttonHandleKeyDown),onKeyUp:M(s,n.buttonHandleKeyUp),onBlur:M(l,n.buttonHandleBlur)};return r({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=A(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(u(n),e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return r({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,u=t.onBlur,s=t.onChange,l=t.onInput;t.onChangeText;var a=o(t,z),c={};var d,p=n.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((d={}).onChange=M(s,l,n.inputHandleChange),d.onKeyDown=M(i,n.inputHandleKeyDown),d.onBlur=M(u,n.inputHandleBlur),c=d);return r({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?n.getItemId(g):void 0,"aria-controls":h?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},c,a)},n.inputHandleKeyDown=function(e){var t=A(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(u(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;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=o(u,Y),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,r(((i={})[l]=E(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=c&&c["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),c)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,u=i.onMouseMove,s=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,c=i.item,d=void 0===c?void 0:c,p=o(i,X);void 0===a?(n.items.push(d),a=n.items.indexOf(d)):n.items[a]=d;var f=l,h=((t={onMouseMove:M(u,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:M(s,(function(e){e.preventDefault()}))}).onClick=M(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return r({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=H(e),n.internalSetState((function(t){var i=t.selectedItem;return r({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=H(e),n.internalSetState((function(t){var i=t.isOpen;return r({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),S(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=O((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),u=n.props.getA11yStatusMessage(r({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,U(u,n.props.environment.document)}}),200);var i=n.props,s=i.defaultHighlightedIndex,l=i.initialHighlightedIndex,a=void 0===l?s:l,c=i.defaultIsOpen,d=i.initialIsOpen,p=void 0===d?c:d,f=i.initialInputValue,h=void 0===f?"":f,g=i.initialSelectedItem,m=void 0===g?null:g,I=n.getState({highlightedIndex:a,isOpen:p,inputValue:h,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=l).prototype=Object.create(i.prototype),n.prototype.constructor=n,s(n,i);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),V(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?this.props.environment.document.getElementById(this.getItemId(e)):null},a.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},a.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=L(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,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,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=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:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,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;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!F(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=F(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)}}else this.cleanup=function(){e.internalClearTimeouts()}},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){B(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=T(this.props.children,C);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=T(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:P,itemToString:function(e){return null==e?"":String(e)},onStateChange:C,onInputValueChange:C,onUserAction:C,onChange:C,onSelect:C,onOuterClick:C,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:k},e.stateChangeTypes=W,e}(),J=G,Q={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function Z(e,t,n){var i=e.props,o=e.type,u={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var o=t.props,u=t.type,s="on"+oe(e)+"Change";o[s]&&void 0!==i[e]&&i[e]!==n[e]&&o[s](r({type:u},i))}(i,e,t,n),n[i]!==t[i]&&(u[i]=n[i])})),i.onStateChange&&Object.keys(u).length&&i.onStateChange(r({type:o},u))}var ee=O((function(e,t){U(e,t)}),200),te="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,ne="useId"in i.default?function(e){var n=e.id,o=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+i.default.useId();return n||(n=a),t.useRef({labelId:o||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+K():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 ie(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 oe(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function re(e){var n=t.useRef(e);return n.current=e,n}function ue(e,n,i,o){var u=t.useRef(),s=t.useRef(),l=t.useCallback((function(t,n){s.current=n,t=V(t,n.props);var i=e(t,n);return n.props.stateReducer(t,r({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),c=a[0],d=a[1],p=re(n),f=t.useCallback((function(e){return d(r({props:p.current},e))}),[p]),h=s.current;return t.useEffect((function(){var e=V(u.current,null==h?void 0:h.props);h&&u.current&&!o(e,c)&&Z(h,e,c),u.current=c}),[c,h,o]),[c,f]}function se(e,t,n,i){var o=ue(e,t,n,i),r=o[0],u=o[1];return[V(r,t),u]}var le={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:k,environment:"undefined"==typeof window?void 0:window};function ae(e,t,n){void 0===n&&(n=Q);var i=e["default"+oe(t)];return void 0!==i?i:n[t]}function ce(e,t,n){void 0===n&&(n=Q);var i=e[t];if(void 0!==i)return i;var o=e["initial"+oe(t)];return void 0!==o?o:ae(e,t,n)}function de(e){var t=ce(e,"selectedItem"),n=ce(e,"isOpen"),i=ce(e,"highlightedIndex"),o=ce(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.findIndex((function(n){return e.itemToKey(n)===e.itemToKey(t)})):i,isOpen:n,selectedItem:t,inputValue:o}}function pe(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=e.itemToKey,s=t.selectedItem,l=t.highlightedIndex;return 0===i.length?-1:void 0!==o&&l===o?o:void 0!==r?r:s?i.findIndex((function(e){return u(s)===u(e)})):0===n?-1:n<0?i.length-1:0}function fe(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return C;var t=n.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(n){o.current.isMouseDown=!1,F(n.target,t,e)||i()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(n){o.current.isTouchEnd=!0,o.current.isTouchMove||F(n.target,t,e,!1)||i()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a)}}),[e,i]),o.current}var he=function(){return C};function ge(e,n,i,o){void 0===o&&(o={});var r=o.document,u=be();t.useEffect((function(){if(e&&!u&&r){var t=e(n);ee(t,r)}}),[i]),t.useEffect((function(){return function(){var e,t;ee.cancel(),(t=null==(e=r)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[r])}function me(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 te((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var Ie=C;function ve(e,t,n){var i;return void 0===n&&(n=!0),r({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&r({selectedItem:e.items[t],isOpen:ae(e,"isOpen"),highlightedIndex:ae(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function ye(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function be(){var e=i.default.useRef(!0);return i.default.useEffect((function(){return e.current=!1,function(){e.current=!0}}),[]),e.current}var xe={environment:g.shape({addEventListener:g.func.isRequired,removeEventListener:g.func.isRequired,document:g.shape({createElement:g.func.isRequired,getElementById:g.func.isRequired,activeElement:g.any.isRequired,body:g.any.isRequired}).isRequired,Node:g.func.isRequired}),itemToString:g.func,itemToKey:g.func,stateReducer:g.func},we=r({},xe,{getA11yStatusMessage:g.func,highlightedIndex:g.number,defaultHighlightedIndex:g.number,initialHighlightedIndex:g.number,isOpen:g.bool,defaultIsOpen:g.bool,initialIsOpen:g.bool,selectedItem:g.any,initialSelectedItem:g.any,defaultSelectedItem:g.any,id:g.string,labelId:g.string,menuId:g.string,getItemId:g.func,toggleButtonId:g.string,onSelectedItemChange:g.func,onHighlightedIndexChange:g.func,onStateChange:g.func,onIsOpenChange:g.func,scrollIntoView:g.func});function Se(e,t,n){var i,o=t.type,u=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:pe(u,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:pe(u,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:ae(u,"highlightedIndex"),isOpen:ae(u,"isOpen"),selectedItem:ae(u,"selectedItem"),inputValue:ae(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,i)}var Ce=function(){return Ce=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},Ce.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,Ce(Ce({},we),{items:g.array.isRequired,isItemDisabled:g.func});var ke=Ce(Ce({},le),{isItemDisabled:function(){return!1}}),De=C,Oe=1,Me=2,Ee=3,Ke=4,Pe=5,Te=6,Re=7,He=8,Ve=9,Be=10,Ae=11,Le=14,_e=19,Fe=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:Oe,ToggleButtonKeyDownArrowUp:Me,ToggleButtonKeyDownCharacter:Ee,ToggleButtonKeyDownEscape:Ke,ToggleButtonKeyDownHome:Pe,ToggleButtonKeyDownEnd:Te,ToggleButtonKeyDownEnter:Re,ToggleButtonKeyDownSpaceButton:He,ToggleButtonKeyDownPageUp:Ve,ToggleButtonKeyDownPageDown:Be,ToggleButtonBlur:Ae,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Le,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:_e,FunctionSetInputValue:20,FunctionReset:21});function Ne(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case Le:i={isOpen:ae(u,"isOpen"),highlightedIndex:ae(u,"highlightedIndex"),selectedItem:u.items[t.index]};break;case Ee:var l=t.key,a=""+e.inputValue+l;i={inputValue:a,highlightedIndex:function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,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)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.findIndex((function(t){return u.itemToKey(t)===u.itemToKey(e.selectedItem)})):e.highlightedIndex,items:u.items,itemToString:u.itemToString,isItemDisabled:u.isItemDisabled}),isOpen:!0};break;case Oe:i={highlightedIndex:e.isOpen?L(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:pe(u,e,1),isOpen:!0};break;case Me:if(e.isOpen&&s)i=ve(u,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?L(e.highlightedIndex,-1,u.items,u.isItemDisabled):pe(u,e,-1),isOpen:!0};break;case Re:case He:i=ve(u,e.highlightedIndex,!1);break;case Pe:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Te:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Ve:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case Be:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case Ke:i={isOpen:!1,highlightedIndex:-1};break;case Ae:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case _e:i={selectedItem:t.selectedItem};break;default:return Se(e,t,Fe)}return r({},e,i)}var je=["onClick"],Ue=["onMouseLeave","refKey","ref"],We=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],$e=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function qe(e){void 0===e&&(e={}),De();var n=r({},ke,e),i=n.scrollIntoView,u=n.environment,s=n.getA11yStatusMessage,l=se(Ne,n,de,ye),a=l[0],c=l[1],d=a.isOpen,p=a.highlightedIndex,f=a.selectedItem,h=a.inputValue,g=t.useRef(null),m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=ne(n),b=re({state:a,props:n}),x=t.useCallback((function(e){return I.current[y.getItemId(e)]}),[y]);ge(s,a,[d,p,f,h],u);var w=me({menuElement:m.current,highlightedIndex:p,isOpen:d,itemRefs:I,scrollIntoView:i,getItemNodeFromIndex:x});t.useEffect((function(){return v.current=O((function(e){e({type:20,inputValue:""})}),500),function(){v.current.cancel()}}),[]),t.useEffect((function(){h&&v.current(c)}),[c,h]),Ie(),t.useEffect((function(){ce(n,"isOpen")&&g.current&&g.current.focus()}),[]);var S=fe(u,[g,m],t.useCallback((function(){b.current.state.isOpen&&c({type:Ae})}),[c,b])),C=he();t.useEffect((function(){d||(I.current={})}),[d]);var k=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:Oe,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Me,altKey:e.altKey})},Home:function(e){e.preventDefault(),c({type:Pe})},End:function(e){e.preventDefault(),c({type:Te})},Escape:function(){b.current.state.isOpen&&c({type:Ke})},Enter:function(e){e.preventDefault(),c({type:b.current.state.isOpen?Re:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Ve}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Be}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?c({type:Ee,key:" "}):c({type:He}):c({type:0})}}}),[c,b]),D=t.useCallback((function(){c({type:15})}),[c]),K=t.useCallback((function(){c({type:17})}),[c]),P=t.useCallback((function(){c({type:16})}),[c]),T=t.useCallback((function(e){c({type:18,highlightedIndex:e})}),[c]),R=t.useCallback((function(e){c({type:_e,selectedItem:e})}),[c]),H=t.useCallback((function(){c({type:21})}),[c]),V=t.useCallback((function(e){c({type:20,inputValue:e})}),[c]),B=t.useCallback((function(e){var t=void 0===e?{}:e,n=t.onClick,i=o(t,je);return r({id:y.labelId,htmlFor:y.toggleButtonId,onClick:M(n,(function(){var e;null==(e=g.current)||e.focus()}))},i)}),[y]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,d=o(i,Ue),p=(void 0===t?{}:t).suppressRefError;return C("getMenuProps",void 0!==p&&p,l,m),r(((n={})[l]=E(a,(function(e){m.current=e})),n.id=y.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+y.labelId,n.onMouseLeave=M(u,(function(){c({type:12})})),n),d)}),[c,C,y]),_=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onBlur,s=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,d=void 0===a?"ref":a,p=i.ref,f=o(i,We),h=(void 0===t?{}:t).suppressRefError,m=void 0!==h&&h,I=b.current.state,v=r(((n={})[d]=E(p,(function(e){g.current=e})),n["aria-activedescendant"]=I.isOpen&&I.highlightedIndex>-1?y.getItemId(I.highlightedIndex):"",n["aria-controls"]=y.menuId,n["aria-expanded"]=b.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=f&&f["aria-label"]?void 0:""+y.labelId,n.id=y.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=M(u,(function(){I.isOpen&&!S.isMouseDown&&c({type:Ae})})),n),f);return f.disabled||(v.onClick=M(s,(function(){c({type:0})})),v.onKeyDown=M(l,(function(e){var t=A(e);t&&k[t]?k[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&c({type:Ee,key:t})}))),C("getToggleButtonProps",m,d,g),v}),[c,y,b,S,C,k]),F=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,u=n.index,s=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var d=n.refKey,p=void 0===d?"ref":d,f=n.disabled,h=n.ref,g=o(n,$e);void 0!==f&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=b.current,v=m.state,x=m.props,C=ie(i,u,x.items,"Pass either item or index to getItemProps!"),k=C[0],D=C[1],O=x.isItemDisabled(k,D),K=r(((t={})[p]=E(h,(function(e){e&&(I.current[y.getItemId(D)]=e)})),t["aria-disabled"]=O,t["aria-selected"]=""+(k===v.selectedItem),t.id=y.getItemId(D),t.role="option",t),g);return O||(K.onClick=M(l,(function(){c({type:Le,index:D})}))),K.onMouseMove=M(s,(function(){S.isTouchEnd||D===v.highlightedIndex||(w.current=!1,c({type:13,index:D,disabled:O}))})),K.onMouseDown=M(a,(function(e){return e.preventDefault()})),K}),[b,y,S,w,c]);return{getToggleButtonProps:_,getLabelProps:B,getMenuProps:L,getItemProps:F,toggleMenu:D,openMenu:P,closeMenu:K,setHighlightedIndex:T,selectItem:R,reset:H,setInputValue:V,highlightedIndex:p,isOpen:d,selectedItem:f,inputValue:h}}qe.stateChangeTypes=Fe;var ze=0,Ye=1,Xe=2,Ge=3,Je=4,Qe=5,Ze=6,et=7,tt=8,nt=9,it=10,ot=13,rt=19,ut=22,st=Object.freeze({__proto__:null,InputKeyDownArrowDown:ze,InputKeyDownArrowUp:Ye,InputKeyDownEscape:Xe,InputKeyDownHome:Ge,InputKeyDownEnd:Je,InputKeyDownPageUp:Qe,InputKeyDownPageDown:Ze,InputKeyDownEnter:et,InputChange:tt,InputBlur:nt,InputClick:it,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:ot,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:rt,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:ut});function lt(e){var t=de(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)),r({},t,{inputValue:i})}r({},we,{items:g.array.isRequired,isItemDisabled:g.func,inputValue:g.string,defaultInputValue:g.string,initialInputValue:g.string,inputId:g.string,onInputValueChange:g.func});var at=C,ct=r({},le,{isItemDisabled:function(){return!1}});function dt(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case ot:i={isOpen:ae(u,"isOpen"),highlightedIndex:ae(u,"highlightedIndex"),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case ze:i=e.isOpen?{highlightedIndex:L(e.highlightedIndex,1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:pe(u,e,1),isOpen:u.items.length>=0};break;case Ye:i=e.isOpen?s?ve(u,e.highlightedIndex):{highlightedIndex:L(e.highlightedIndex,-1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:pe(u,e,-1),isOpen:u.items.length>=0};break;case et:i=ve(u,e.highlightedIndex);break;case Xe:i=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Qe:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case Ze:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case Ge:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled)};break;case Je:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case nt:i=r({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 tt:i={isOpen:!0,highlightedIndex:ae(u,"highlightedIndex"),inputValue:t.inputValue};break;case it:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:pe(u,e,0)};break;case rt:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case ut:i={inputValue:t.inputValue};break;default:return Se(e,t,st)}return r({},e,i)}var pt=["onMouseLeave","refKey","ref"],ft=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],ht=["onClick","onPress","refKey","ref"],gt=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function mt(e){void 0===e&&(e={}),at();var n=r({},ct,e),i=n.items,u=n.scrollIntoView,s=n.environment,l=n.getA11yStatusMessage,a=function(e,n,i,o){var r=t.useRef(),u=ue(e,n,i,o),s=u[0],l=u[1],a=be();return t.useEffect((function(){B(n,"selectedItem")&&(a||n.itemToKey(n.selectedItem)!==n.itemToKey(r.current)&&l({type:ut,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[V(s,n),l]}(dt,n,lt,ye),c=a[0],d=a[1],p=c.isOpen,f=c.highlightedIndex,h=c.selectedItem,g=c.inputValue,m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=t.useRef(null),b=be(),x=ne(n),w=t.useRef(),S=re({state:c,props:n}),C=t.useCallback((function(e){return I.current[x.getItemId(e)]}),[x]);ge(l,c,[p,f,h,g],s);var k=me({menuElement:m.current,highlightedIndex:f,isOpen:p,itemRefs:I,scrollIntoView:u,getItemNodeFromIndex:C});Ie(),t.useEffect((function(){ce(n,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){b||(w.current=i.length)}));var D=fe(s,[y,m,v],t.useCallback((function(){S.current.state.isOpen&&d({type:nt,selectItem:!1})}),[d,S])),O=he();t.useEffect((function(){p||(I.current={})}),[p]),t.useEffect((function(){var e;p&&null!=s&&s.document&&null!=v&&null!=(e=v.current)&&e.focus&&s.document.activeElement!==v.current&&v.current.focus()}),[p,s]);var K=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:ze,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:Ye,altKey:e.altKey})},Home:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Ge}))},End:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Je}))},Escape:function(e){var t=S.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),d({type:Xe}))},Enter:function(e){S.current.state.isOpen&&229!==e.which&&(e.preventDefault(),d({type:et}))},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Qe}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Ze}))}}}),[d,S]),P=t.useCallback((function(e){return r({id:x.labelId,htmlFor:x.inputId},e)}),[x]),T=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onMouseLeave,s=i.refKey,l=void 0===s?"ref":s,a=i.ref,c=o(i,pt),p=(void 0===t?{}:t).suppressRefError;return O("getMenuProps",void 0!==p&&p,l,m),r(((n={})[l]=E(a,(function(e){m.current=e})),n.id=x.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+x.labelId,n.onMouseLeave=M(u,(function(){d({type:11})})),n),c)}),[d,O,x]),R=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,u=i.item,s=i.index,l=i.refKey,a=void 0===l?"ref":l,c=i.ref,p=i.onMouseMove,f=i.onMouseDown,h=i.onClick;i.onPress;var g=i.disabled,m=o(i,ft);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var v=S.current,y=v.props,b=v.state,w=ie(u,s,y.items,"Pass either item or index to getItemProps!"),C=w[0],O=w[1],K=y.isItemDisabled(C,O),P=h;return r(((t={})[a]=E(c,(function(e){e&&(I.current[x.getItemId(O)]=e)})),t["aria-disabled"]=K,t["aria-selected"]=""+(O===b.highlightedIndex),t.id=x.getItemId(O),t.role="option",t),!K&&((n={}).onClick=M(P,(function(){d({type:ot,index:O})})),n),{onMouseMove:M(p,(function(){D.isTouchEnd||O===b.highlightedIndex||(k.current=!1,d({type:12,index:O,disabled:K}))})),onMouseDown:M(f,(function(e){return e.preventDefault()}))},m)}),[d,x,S,D,k]),H=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var u=n.refKey,s=void 0===u?"ref":u,l=n.ref,a=o(n,ht),c=S.current.state;return r(((t={})[s]=E(l,(function(e){y.current=e})),t["aria-controls"]=x.menuId,t["aria-expanded"]=c.isOpen,t.id=x.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&r({},{onClick:M(i,(function(){d({type:14})}))}),a)}),[d,S,x]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.onKeyDown,l=i.onChange,a=i.onInput,c=i.onBlur;i.onChangeText;var p=i.onClick,f=i.refKey,h=void 0===f?"ref":f,g=i.ref,m=o(i,gt),I=(void 0===t?{}:t).suppressRefError;O("getInputProps",void 0!==I&&I,h,v);var y,b=S.current.state,w={};m.disabled||((y={}).onChange=M(l,a,(function(e){d({type:tt,inputValue:e.target.value})})),y.onKeyDown=M(u,(function(e){var t=A(e);t&&K[t]&&K[t](e)})),y.onBlur=M(c,(function(e){if(null!=s&&s.document&&b.isOpen&&!D.isMouseDown){var t=null===e.relatedTarget&&s.document.activeElement!==s.document.body;d({type:nt,selectItem:!t})}})),y.onClick=M(p,(function(){d({type:it})})),w=y);return r(((n={})[h]=E(g,(function(e){v.current=e})),n["aria-activedescendant"]=b.isOpen&&b.highlightedIndex>-1?x.getItemId(b.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=x.menuId,n["aria-expanded"]=b.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:x.labelId,n.autoComplete="off",n.id=x.inputId,n.role="combobox",n.value=b.inputValue,n),w,m)}),[d,x,s,K,S,D,O]),_=t.useCallback((function(){d({type:15})}),[d]),F=t.useCallback((function(){d({type:17})}),[d]),N=t.useCallback((function(){d({type:16})}),[d]),j=t.useCallback((function(e){d({type:18,highlightedIndex:e})}),[d]),U=t.useCallback((function(e){d({type:rt,selectedItem:e})}),[d]);return{getItemProps:R,getLabelProps:P,getMenuProps:T,getInputProps:L,getToggleButtonProps:H,toggleMenu:_,openMenu:N,closeMenu:F,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){d({type:20,inputValue:e})}),[d]),selectItem:U,reset:t.useCallback((function(){d({type:21})}),[d]),highlightedIndex:f,isOpen:p,selectedItem:h,inputValue:g}}mt.stateChangeTypes=st;var It={activeIndex:-1,selectedItems:[]};function vt(e,t){return ce(e,t,It)}function yt(e,t){return ae(e,t,It)}function bt(e){return{activeIndex:vt(e,"activeIndex"),selectedItems:vt(e,"selectedItems")}}function xt(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}function wt(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}g.array,g.array,g.array,g.func,g.number,g.number,g.number,g.func,g.func,g.string,g.string;var St={itemToKey:le.itemToKey,stateReducer:le.stateReducer,environment:le.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},Ct=C,kt=0,Dt=1,Ot=2,Mt=3,Et=4,Kt=5,Pt=6,Tt=7,Rt=8,Ht=9,Vt=10,Bt=11,At=12,Lt=Object.freeze({__proto__:null,SelectedItemClick:kt,SelectedItemKeyDownDelete:Dt,SelectedItemKeyDownBackspace:Ot,SelectedItemKeyDownNavigationNext:Mt,SelectedItemKeyDownNavigationPrevious:Et,DropdownKeyDownNavigationPrevious:Kt,DropdownKeyDownBackspace:Pt,DropdownClick:Tt,FunctionAddSelectedItem:Rt,FunctionRemoveSelectedItem:Ht,FunctionSetSelectedItems:Vt,FunctionSetActiveIndex:Bt,FunctionReset:At});function _t(e,t){var n,i=t.type,o=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case kt:n={activeIndex:o};break;case Et:n={activeIndex:l-1<0?0:l-1};break;case Mt:n={activeIndex:l+1>=a.length?-1:l+1};break;case Ot:case Dt:if(l<0)break;var c=l;1===a.length?c=-1:l===a.length-1&&(c=a.length-2),n=r({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:c});break;case Kt:n={activeIndex:a.length-1};break;case Pt:n={selectedItems:a.slice(0,a.length-1)};break;case Rt:n={selectedItems:[].concat(a,[s])};break;case Tt:n={activeIndex:-1};break;case Ht:var d=l,p=a.findIndex((function(e){return u.itemToKey(e)===u.itemToKey(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 Vt:n={selectedItems:t.selectedItems};break;case Bt:n={activeIndex:t.activeIndex};break;case At:n={activeIndex:yt(u,"activeIndex"),selectedItems:yt(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}var Ft=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Nt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function jt(e){void 0===e&&(e={}),Ct();var n=r({},St,e),i=n.getA11yStatusMessage,u=n.environment,s=n.keyNavigationNext,l=n.keyNavigationPrevious,a=se(_t,n,bt,wt),c=a[0],d=a[1],p=c.activeIndex,f=c.selectedItems,h=be(),g=t.useRef(null),m=t.useRef();m.current=[];var I=re({state:c,props:n});ge(i,c,[p,f],u),t.useEffect((function(){h||(-1===p&&g.current?g.current.focus():m.current[p]&&m.current[p].focus())}),[p]),Ie();var v=he(),y=t.useMemo((function(){var e;return(e={})[l]=function(){d({type:Et})},e[s]=function(){d({type:Mt})},e.Delete=function(){d({type:Dt})},e.Backspace=function(){d({type:Ot})},e}),[d,s,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){xt(e)&&d({type:Kt})},e.Backspace=function(e){xt(e)&&d({type:Pt})},e}),[d,l]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,u=void 0===i?"ref":i,s=n.ref,l=n.onClick,a=n.onKeyDown,c=n.selectedItem,p=n.index,f=o(n,Ft),h=I.current.state,g=ie(c,p,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],v=g>-1&&g===h.activeIndex;return r(((t={})[u]=E(s,(function(e){e&&m.current.push(e)})),t.tabIndex=v?0:-1,t.onClick=M(l,(function(){d({type:kt,index:g})})),t.onKeyDown=M(a,(function(e){var t=A(e);t&&y[t]&&y[t](e)})),t),f)}),[d,I,y]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,u=i.refKey,s=void 0===u?"ref":u,l=i.ref,a=i.onKeyDown,c=i.onClick,p=i.preventKeyAction,f=void 0!==p&&p,h=o(i,Nt),m=(void 0===t?{}:t).suppressRefError;return v("getDropdownProps",void 0!==m&&m,s,g),r(((n={})[s]=E(l,(function(e){e&&(g.current=e)})),n),!f&&{onKeyDown:M(a,(function(e){var t=A(e);t&&b[t]&&b[t](e)})),onClick:M(c,(function(){d({type:Tt})}))},h)}),[d,b,v]),addSelectedItem:t.useCallback((function(e){d({type:Rt,selectedItem:e})}),[d]),removeSelectedItem:t.useCallback((function(e){d({type:Ht,selectedItem:e})}),[d]),setSelectedItems:t.useCallback((function(e){d({type:Vt,selectedItems:e})}),[d]),setActiveIndex:t.useCallback((function(e){d({type:Bt,activeIndex:e})}),[d]),reset:t.useCallback((function(){d({type:At})}),[d]),selectedItems:f,activeIndex:p}}jt.stateChangeTypes=Lt,e.default=J,e.resetIdCounter=function(){"useId"in i.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):w=0},e.useCombobox=mt,e.useMultipleSelection=jt,e.useSelect=qe,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=downshift.umd.min.js.map

@@ -176,9 +176,2 @@ export let useControlPropsValidator: typeof noop;

}): void;
/**
* Returns the new highlightedIndex based on the defaultHighlightedIndex prop, if it's not disabled.
*
* @param {Object} props Props from useCombobox or useSelect.
* @returns {number} The highlighted index.
*/
export function getDefaultHighlightedIndex(props: Object): number;
import { noop } from "../utils";

@@ -185,0 +178,0 @@ import React from "react";

{
"name": "downshift",
"version": "9.0.6",
"version": "9.0.7-alpha.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/compat"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","preact/compat","prop-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React,e.PropTypes)}(this,(function(e,t,n){"use strict";function i(e,t){if(null==e)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}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 i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o.apply(this,arguments)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}var u,s={};
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact/compat"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","preact/compat","prop-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Downshift={},e.React,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(t),r=i(n);function u(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 s(){return s=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},s.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 a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}var d,c={};
/**

@@ -10,3 +10,3 @@ * @license React

* LICENSE file in the root directory of this source tree.
*/!function(){if(u)return s;u=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var u=e.$$typeof;switch(u){case t:switch(e=e.type){case i:case r:case o:case p:case f:return e;default:switch(e=e&&e.$$typeof){case c:case a:case d:case g:case h:case l:return e;default:return u}}case n:return u}}}e=Symbol.for("react.module.reference"),s.ContextConsumer=a,s.ContextProvider=l,s.Element=t,s.ForwardRef=d,s.Fragment=i,s.Lazy=g,s.Memo=h,s.Portal=n,s.Profiler=r,s.StrictMode=o,s.Suspense=p,s.SuspenseList=f,s.isAsyncMode=function(){return!1},s.isConcurrentMode=function(){return!1},s.isContextConsumer=function(e){return I(e)===a},s.isContextProvider=function(e){return I(e)===l},s.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},s.isForwardRef=function(e){return I(e)===d},s.isFragment=function(e){return I(e)===i},s.isLazy=function(e){return I(e)===g},s.isMemo=function(e){return I(e)===h},s.isPortal=function(e){return I(e)===n},s.isProfiler=function(e){return I(e)===r},s.isStrictMode=function(e){return I(e)===o},s.isSuspense=function(e){return I(e)===p},s.isSuspenseList=function(e){return I(e)===f},s.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===p||t===f||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===h||t.$$typeof===l||t.$$typeof===a||t.$$typeof===d||t.$$typeof===e||void 0!==t.getModuleId)},s.typeOf=I}();const l=e=>"object"==typeof e&&null!=e&&1===e.nodeType,a=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,c=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return a(n.overflowY,t)||a(n.overflowX,t)||(e=>{const 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},d=(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,p=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var f=0;function h(e){return"function"==typeof e?e:g}function g(){}function m(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:a,boundary:f,skipOverflowHiddenElements:h}=t,g="function"==typeof f?f:e=>e!==f;if(!l(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,I=[];let v=e;for(;l(v)&&g(v);){if(v=p(v),v===m){I.push(v);break}null!=v&&v===document.body&&c(v)&&!c(document.documentElement)||null!=v&&c(v,h)&&I.push(v)}const y=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,b=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:x,scrollY:w}=window,{height:S,width:C,top:D,right:k,bottom:O,left:M}=e.getBoundingClientRect(),{top:E,right:K,bottom:P,left:T}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let H="start"===s||"nearest"===s?D-E:"end"===s?O+P:D+S/2-E+P,R="center"===a?M+C/2-T+K:"end"===a?k+K:M-T;const V=[];for(let e=0;e<I.length;e++){const t=I[e],{height:n,width:i,top:o,right:r,bottom:l,left:c}=t.getBoundingClientRect();if("if-needed"===u&&D>=0&&M>=0&&O<=b&&k<=y&&D>=o&&O<=l&&M>=c&&k<=r)return V;const p=getComputedStyle(t),f=parseInt(p.borderLeftWidth,10),h=parseInt(p.borderTopWidth,10),g=parseInt(p.borderRightWidth,10),v=parseInt(p.borderBottomWidth,10);let E=0,K=0;const P="offsetWidth"in t?t.offsetWidth-t.clientWidth-f-g:0,T="offsetHeight"in t?t.offsetHeight-t.clientHeight-h-v:0,B="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(m===t)E="start"===s?H:"end"===s?H-b:"nearest"===s?d(w,w+b,b,h,v,w+H,w+H+S,S):H-b/2,K="start"===a?R:"center"===a?R-y/2:"end"===a?R-y:d(x,x+y,y,f,g,x+R,x+R+C,C),E=Math.max(0,E+w),K=Math.max(0,K+x);else{E="start"===s?H-o-h:"end"===s?H-l+v+T:"nearest"===s?d(o,l,n,h,v+T,H,H+S,S):H-(o+n/2)+T/2,K="start"===a?R-c-f:"center"===a?R-(c+i/2)+P/2:"end"===a?R-r+g+P:d(c,r,i,f,g+P,R,R+C,C);const{scrollLeft:e,scrollTop:u}=t;E=0===A?0:Math.max(0,Math.min(u+E/A,t.scrollHeight-n/A+T)),K=0===B?0:Math.max(0,Math.min(e+K/B,t.scrollWidth-i/B+P)),H+=u-E,R+=e-K}V.push({el:t,top:E,left:K})}return V})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function I(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function v(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 y(){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 b(){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 x(){return String(f++)}function w(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 S(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var C=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function D(e){void 0===e&&(e={});var t={};return C.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function k(e,t){return e&&t?Object.keys(e).reduce((function(n,i){return n[i]=O(t,i)?t[i]:e[i],n}),{}):e}function O(e,t){return void 0!==e[t]}function M(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function E(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=K(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function K(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?K(t?r-1:0,t,n,i):-1}function P(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(I(t,e,n)||i&&I(t,n.document.activeElement,n))}))}var T=v((function(e){H(e).textContent=""}),500);function H(e){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)}function R(e,t){e&&t&&(H(t).textContent=e,T(t))}var V=Object.freeze({__proto__:null,blurButton:14,blurInput:10,changeInput:11,clickButton:13,clickItem:9,controlledPropUpdatedSelectedItem:15,itemMouseEnter:2,keyDownArrowDown:4,keyDownArrowUp:3,keyDownEnd:8,keyDownEnter:6,keyDownEscape:5,keyDownHome:7,keyDownSpaceButton:12,mouseUp:1,touchEnd:16,unknown:0}),B=["refKey","ref"],A=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],L=["onKeyDown","onBlur","onChange","onInput","onChangeText"],F=["refKey","ref"],_=["onMouseMove","onMouseDown","onClick","onPress","index","item"],N=function(){var e=function(e){function n(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+x(),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.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.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=D(t),n.internalSetState(o({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=D(t),n.internalSetState(o({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,r,u={},s="function"==typeof e;return!s&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,o({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=s?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var c={};return i&&a.selectedItem!==t.selectedItem&&(r=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(u[e]=a[e]),"type"!==e&&(a[e],O(n.props,e)||(c[e]=a[e]))})),s&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,o({},n.getStateAndHelpers(),a)),c}),(function(){h(t)(),Object.keys(u).length>1&&n.props.onStateChange(u,n.getStateAndHelpers()),i&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==r&&n.props.onChange(r,n.getStateAndHelpers()),n.props.onUserAction(u,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=i(u,B),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;n.getRootProps.called=!0,n.getRootProps.refKey=l,n.getRootProps.suppressRefError=p;var f=n.getState().isOpen;return o(((r={})[l]=b(a,n.rootRef),r.role="combobox",r["aria-expanded"]=f,r["aria-haspopup"]="listbox",r["aria-owns"]=f?n.menuId:void 0,r["aria-labelledby"]=n.labelId,r),c)},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=E(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);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=E(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);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(o({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=o({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=o({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=K(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=K(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.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=i(t,A),c=n.getState().isOpen,d={onClick:y(r,n.buttonHandleClick),onKeyDown:y(u,n.buttonHandleKeyDown),onKeyUp:y(s,n.buttonHandleKeyUp),onBlur:y(l,n.buttonHandleBlur)};return o({type:"button",role:"button","aria-label":c?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},a.disabled?{}:d,a)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=M(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(n,e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return o({htmlFor:n.inputId,id:n.labelId},e)},n.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=i(t,L),c={};var d,p=n.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((d={}).onInput=y(s,l,n.inputHandleChange),d.onKeyDown=y(r,n.inputHandleKeyDown),d.onBlur=y(u,n.inputHandleBlur),c=d);return o({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?n.getItemId(g):void 0,"aria-controls":h?n.menuId:void 0,"aria-labelledby":a&&a["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},c,a)},n.inputHandleKeyDown=function(e){var t=M(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(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;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,u=void 0===e?{}:e,s=u.refKey,l=void 0===s?"ref":s,a=u.ref,c=i(u,F),d=(void 0===t?{}:t).suppressRefError,p=void 0!==d&&d;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,o(((r={})[l]=b(a,n.menuRef),r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?void 0:n.labelId,r.id=n.menuId,r),c)},n.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=i(r,_);void 0===a?(n.items.push(d),a=n.items.indexOf(d)):n.items[a]=d;var f=l,h=((t={onMouseMove:y(u,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:y(s,(function(e){e.preventDefault()}))}).onClick=y(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return o({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=D(e),n.internalSetState((function(t){var i=t.selectedItem;return o({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=D(e),n.internalSetState((function(t){var i=t.isOpen;return o({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),h(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=v((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],r=n.getItemCount(),u=n.props.getA11yStatusMessage(o({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:i},t));n.previousResultCount=r,R(u,n.props.environment.document)}}),200);var r=n.props,u=r.defaultHighlightedIndex,s=r.initialHighlightedIndex,l=void 0===s?u:s,a=r.defaultIsOpen,c=r.initialIsOpen,d=void 0===c?a:c,p=r.initialInputValue,f=void 0===p?"":p,g=r.initialSelectedItem,m=void 0===g?null:g,I=n.getState({highlightedIndex:l,isOpen:d,inputValue:f,selectedItem:m});return null!=I.selectedItem&&void 0===n.props.initialInputValue&&(I.inputValue=n.props.itemToString(I.selectedItem)),n.state=I,n}var u,s;s=e,(u=n).prototype=Object.create(s.prototype),u.prototype.constructor=u,r(u,s);var l=n.prototype;return l.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},l.getState=function(e){return void 0===e&&(e=this.state),k(e,this.props)},l.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},l.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},l.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},l.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=E(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},l.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,c=this.getMenuProps,d=this.getInputProps,p=this.getItemProps,f=this.openMenu,h=this.closeMenu,g=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:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},l.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!P(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=P(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)}}else this.cleanup=function(){e.internalClearTimeouts()}},l.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},l.componentDidUpdate=function(e,t){O(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()},l.componentWillUnmount=function(){this.cleanup()},l.render=function(){var e=S(this.props.children,g);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=S(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},n}(t.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:w,itemToString:function(e){return null==e?"":String(e)},onStateChange:g,onInputValueChange:g,onUserAction:g,onChange:g,onSelect:g,onOuterClick:g,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:m},e.stateChangeTypes=V,e}(),j={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function U(e,t,n){var i=e.props,r=e.type,u={};Object.keys(t).forEach((function(i){!function(e,t,n,i){var r=t.props,u=t.type,s="on"+X(e)+"Change";r[s]&&void 0!==i[e]&&i[e]!==n[e]&&r[s](o({type:u},i))}(i,e,t,n),n[i]!==t[i]&&(u[i]=n[i])})),i.onStateChange&&Object.keys(u).length&&i.onStateChange(o({type:r},u))}var $=v((function(e,t){R(e,t)}),200),W="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,q="useId"in t?function(e){var n=e.id,i=e.labelId,o=e.menuId,r=e.getItemId,u=e.toggleButtonId,s=e.inputId,l="downshift-"+t.useId();return n||(n=l),t.useRef({labelId:i||n+"-label",menuId:o||n+"-menu",getItemId:r||function(e){return n+"-item-"+e},toggleButtonId:u||n+"-toggle-button",inputId:s||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+x():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 z(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 X(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Y(e){var n=t.useRef(e);return n.current=e,n}function G(e,n,i,r){var u=t.useRef(),s=t.useRef(),l=t.useCallback((function(t,n){s.current=n,t=k(t,n.props);var i=e(t,n);return n.props.stateReducer(t,o({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),c=a[0],d=a[1],p=Y(n),f=t.useCallback((function(e){return d(o({props:p.current},e))}),[p]),h=s.current;return t.useEffect((function(){var e=k(u.current,null==h?void 0:h.props);h&&u.current&&!r(e,c)&&U(h,e,c),u.current=c}),[c,h,r]),[c,f]}function J(e,t,n,i){var o=G(e,t,n,i),r=o[0],u=o[1];return[k(r,t),u]}var Q={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:m,environment:"undefined"==typeof window?void 0:window};function Z(e,t,n){void 0===n&&(n=j);var i=e["default"+X(t)];return void 0!==i?i:n[t]}function ee(e,t,n){void 0===n&&(n=j);var i=e[t];if(void 0!==i)return i;var o=e["initial"+X(t)];return void 0!==o?o:Z(e,t,n)}function te(e){var t=ee(e,"selectedItem"),n=ee(e,"isOpen"),i=function(e){var t=ee(e,"highlightedIndex");if(t>-1&&e.isItemDisabled(e.items[t],t))return-1;return t}(e),o=ee(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.findIndex((function(n){return e.itemToKey(n)===e.itemToKey(t)})):i,isOpen:n,selectedItem:t,inputValue:o}}function ne(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=e.isItemDisabled,s=e.itemToKey,l=t.selectedItem,a=t.highlightedIndex;return 0===i.length?-1:void 0===o||a!==o||u(i[o],o)?void 0===r||u(i[r],r)?l?i.findIndex((function(e){return s(l)===s(e)})):n<0&&!u(i[i.length-1],i.length-1)?i.length-1:n>0&&!u(i[0],0)?0:-1:r:o}function ie(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return g;var t=n.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(n){o.current.isMouseDown=!1,P(n.target,t,e)||i()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(n){o.current.isTouchEnd=!0,o.current.isTouchMove||P(n.target,t,e,!1)||i()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a)}}),[e,i]),o.current}var oe=function(){return g};function re(e,n,i,o){void 0===o&&(o={});var r=o.document,u=ae();t.useEffect((function(){if(e&&!u&&r){var t=e(n);$(t,r)}}),i),t.useEffect((function(){return function(){var e,t;$.cancel(),(t=null==(e=r)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[r])}function ue(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 W((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}function se(e,t,n){var i;return void 0===n&&(n=!0),o({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&o({selectedItem:e.items[t],isOpen:Z(e,"isOpen"),highlightedIndex:Z(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function le(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function ae(){var e=t.useRef(!0);return t.useEffect((function(){return e.current=!1,function(){e.current=!0}}),[]),e.current}function ce(e){var t=Z(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var de={environment:n.shape({addEventListener:n.func.isRequired,removeEventListener:n.func.isRequired,document:n.shape({createElement:n.func.isRequired,getElementById:n.func.isRequired,activeElement:n.any.isRequired,body:n.any.isRequired}).isRequired,Node:n.func.isRequired}),itemToString:n.func,itemToKey:n.func,stateReducer:n.func},pe=o({},de,{getA11yStatusMessage:n.func,highlightedIndex:n.number,defaultHighlightedIndex:n.number,initialHighlightedIndex:n.number,isOpen:n.bool,defaultIsOpen:n.bool,initialIsOpen:n.bool,selectedItem:n.any,initialSelectedItem:n.any,defaultSelectedItem:n.any,id:n.string,labelId:n.string,menuId:n.string,getItemId:n.func,toggleButtonId:n.string,onSelectedItemChange:n.func,onHighlightedIndexChange:n.func,onStateChange:n.func,onIsOpenChange:n.func,scrollIntoView:n.func});function fe(e,t,n){var i,r=t.type,u=t.props;switch(r){case n.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:i={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:ne(u,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:ne(u,e,0)};break;case n.FunctionCloseMenu:i={isOpen:!1};break;case n.FunctionSetHighlightedIndex:i={highlightedIndex:u.isItemDisabled(u.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:ce(u),isOpen:Z(u,"isOpen"),selectedItem:Z(u,"selectedItem"),inputValue:Z(u,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return o({},e,i)}var he=function(){return he=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},he.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,he(he({},pe),{items:n.array.isRequired,isItemDisabled:n.func});var ge=he(he({},Q),{isItemDisabled:function(){return!1}}),me=1,Ie=2,ve=3,ye=4,be=5,xe=6,we=7,Se=8,Ce=9,De=10,ke=11,Oe=14,Me=19,Ee=Object.freeze({__proto__:null,FunctionCloseMenu:17,FunctionOpenMenu:16,FunctionReset:21,FunctionSelectItem:Me,FunctionSetHighlightedIndex:18,FunctionSetInputValue:20,FunctionToggleMenu:15,ItemClick:Oe,ItemMouseMove:13,MenuMouseLeave:12,ToggleButtonBlur:ke,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:me,ToggleButtonKeyDownArrowUp:Ie,ToggleButtonKeyDownCharacter:ve,ToggleButtonKeyDownEnd:xe,ToggleButtonKeyDownEnter:we,ToggleButtonKeyDownEscape:ye,ToggleButtonKeyDownHome:be,ToggleButtonKeyDownPageDown:De,ToggleButtonKeyDownPageUp:Ce,ToggleButtonKeyDownSpaceButton:Se});function Ke(e,t){var n,i,r=t.type,u=t.props,s=t.altKey;switch(r){case Oe:i={isOpen:Z(u,"isOpen"),highlightedIndex:ce(u),selectedItem:u.items[t.index]};break;case ve:var l=t.key,a=""+e.inputValue+l;i={inputValue:a,highlightedIndex:function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,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)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?u.items.findIndex((function(t){return u.itemToKey(t)===u.itemToKey(e.selectedItem)})):e.highlightedIndex,items:u.items,itemToString:u.itemToString,isItemDisabled:u.isItemDisabled}),isOpen:!0};break;case me:i={highlightedIndex:e.isOpen?E(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:ne(u,e,1),isOpen:!0};break;case Ie:if(e.isOpen&&s)i=se(u,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?E(e.highlightedIndex,-1,u.items,u.isItemDisabled):ne(u,e,-1),isOpen:!0};break;case we:case Se:i=se(u,e.highlightedIndex,!1);break;case be:i={highlightedIndex:K(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case xe:i={highlightedIndex:K(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Ce:i={highlightedIndex:E(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case De:i={highlightedIndex:E(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case ye:i={isOpen:!1,highlightedIndex:-1};break;case ke:i=o({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case Me:i={selectedItem:t.selectedItem};break;default:return fe(e,t,Ee)}return o({},e,i)}var Pe=["onClick"],Te=["onMouseLeave","refKey","ref"],He=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Re=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function Ve(e){void 0===e&&(e={});var n=o({},ge,e),r=n.scrollIntoView,u=n.environment,s=n.getA11yStatusMessage,l=J(Ke,n,te,le),a=l[0],c=l[1],d=a.isOpen,p=a.highlightedIndex,f=a.selectedItem,h=a.inputValue,g=t.useRef(null),m=t.useRef(null),I=t.useRef({}),x=t.useRef(null),w=q(n),S=Y({state:a,props:n}),C=t.useCallback((function(e){return I.current[w.getItemId(e)]}),[w]);re(s,a,[d,p,f,h],u);var D=ue({menuElement:m.current,highlightedIndex:p,isOpen:d,itemRefs:I,scrollIntoView:r,getItemNodeFromIndex:C});t.useEffect((function(){return x.current=v((function(e){e({type:20,inputValue:""})}),500),function(){x.current.cancel()}}),[]),t.useEffect((function(){h&&x.current(c)}),[c,h]),t.useEffect((function(){ee(n,"isOpen")&&g.current&&g.current.focus()}),[]);var k=ie(u,[g,m],t.useCallback((function(){S.current.state.isOpen&&c({type:ke})}),[c,S])),O=oe();t.useEffect((function(){d||(I.current={})}),[d]);var E=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:me,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Ie,altKey:e.altKey})},Home:function(e){e.preventDefault(),c({type:be})},End:function(e){e.preventDefault(),c({type:xe})},Escape:function(){S.current.state.isOpen&&c({type:ye})},Enter:function(e){e.preventDefault(),c({type:S.current.state.isOpen?we:0})},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),c({type:Ce}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),c({type:De}))}," ":function(e){e.preventDefault();var t=S.current.state;t.isOpen?t.inputValue?c({type:ve,key:" "}):c({type:Se}):c({type:0})}}}),[c,S]),K=t.useCallback((function(){c({type:15})}),[c]),P=t.useCallback((function(){c({type:17})}),[c]),T=t.useCallback((function(){c({type:16})}),[c]),H=t.useCallback((function(e){c({type:18,highlightedIndex:e})}),[c]),R=t.useCallback((function(e){c({type:Me,selectedItem:e})}),[c]),V=t.useCallback((function(){c({type:21})}),[c]),B=t.useCallback((function(e){c({type:20,inputValue:e})}),[c]),A=t.useCallback((function(e){var t=void 0===e?{}:e,n=t.onClick,r=i(t,Pe);return o({id:w.labelId,htmlFor:w.toggleButtonId,onClick:y(n,(function(){var e;null==(e=g.current)||e.focus()}))},r)}),[w]),L=t.useCallback((function(e,t){var n,r=void 0===e?{}:e,u=r.onMouseLeave,s=r.refKey,l=void 0===s?"ref":s,a=r.ref,d=i(r,Te);return(void 0===t?{}:t).suppressRefError,o(((n={})[l]=b(a,(function(e){m.current=e})),n.id=w.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+w.labelId,n.onMouseLeave=y(u,(function(){c({type:12})})),n),d)}),[c,O,w]),F=t.useCallback((function(e,t){var n,r=void 0===e?{}:e,u=r.onBlur,s=r.onClick;r.onPress;var l=r.onKeyDown,a=r.refKey,d=void 0===a?"ref":a,p=r.ref,f=i(r,He);(void 0===t?{}:t).suppressRefError;var h=S.current.state,m=o(((n={})[d]=b(p,(function(e){g.current=e})),n["aria-activedescendant"]=h.isOpen&&h.highlightedIndex>-1?w.getItemId(h.highlightedIndex):"",n["aria-controls"]=w.menuId,n["aria-expanded"]=S.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=f&&f["aria-label"]?void 0:""+w.labelId,n.id=w.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=y(u,(function(){h.isOpen&&!k.isMouseDown&&c({type:ke})})),n),f);return f.disabled||(m.onClick=y(s,(function(){c({type:0})})),m.onKeyDown=y(l,(function(e){var t=M(e);t&&E[t]?E[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&c({type:ve,key:t})}))),m}),[c,w,S,k,O,E]),_=t.useCallback((function(e){var t,n=void 0===e?{}:e,r=n.item,u=n.index,s=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var d=n.refKey,p=void 0===d?"ref":d,f=n.disabled,h=n.ref,g=i(n,Re);void 0!==f&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=S.current,v=m.state,x=m.props,C=z(r,u,x.items,"Pass either item or index to getItemProps!"),O=C[0],M=C[1],E=x.isItemDisabled(O,M),K=o(((t={})[p]=b(h,(function(e){e&&(I.current[w.getItemId(M)]=e)})),t["aria-disabled"]=E,t["aria-selected"]=O===v.selectedItem,t.id=w.getItemId(M),t.role="option",t),g);return E||(K.onClick=y(l,(function(){c({type:Oe,index:M})}))),K.onMouseMove=y(s,(function(){k.isTouchEnd||M===v.highlightedIndex||(D.current=!1,c({type:13,index:M,disabled:E}))})),K.onMouseDown=y(a,(function(e){return e.preventDefault()})),K}),[S,w,k,D,c]);return{getToggleButtonProps:F,getLabelProps:A,getMenuProps:L,getItemProps:_,toggleMenu:K,openMenu:T,closeMenu:P,setHighlightedIndex:H,selectItem:R,reset:V,setInputValue:B,highlightedIndex:p,isOpen:d,selectedItem:f,inputValue:h}}Ve.stateChangeTypes=Ee;var Be=0,Ae=1,Le=2,Fe=3,_e=4,Ne=5,je=6,Ue=7,$e=8,We=9,qe=10,ze=13,Xe=19,Ye=22,Ge=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:Ye,FunctionCloseMenu:17,FunctionOpenMenu:16,FunctionReset:21,FunctionSelectItem:Xe,FunctionSetHighlightedIndex:18,FunctionSetInputValue:20,FunctionToggleMenu:15,InputBlur:We,InputChange:$e,InputClick:qe,InputKeyDownArrowDown:Be,InputKeyDownArrowUp:Ae,InputKeyDownEnd:_e,InputKeyDownEnter:Ue,InputKeyDownEscape:Le,InputKeyDownHome:Fe,InputKeyDownPageDown:je,InputKeyDownPageUp:Ne,ItemClick:ze,ItemMouseMove:12,MenuMouseLeave:11,ToggleButtonClick:14});function Je(e){var t=te(e),n=t.selectedItem,i=t.inputValue;return""===i&&n&&void 0===e.defaultInputValue&&void 0===e.initialInputValue&&void 0===e.inputValue&&(i=e.itemToString(n)),o({},t,{inputValue:i})}o({},pe,{items:n.array.isRequired,isItemDisabled:n.func,inputValue:n.string,defaultInputValue:n.string,initialInputValue:n.string,inputId:n.string,onInputValueChange:n.func});var Qe=o({},Q,{isItemDisabled:function(){return!1}});function Ze(e,t){var n,i,r=t.type,u=t.props,s=t.altKey;switch(r){case ze:i={isOpen:Z(u,"isOpen"),highlightedIndex:ce(u),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case Be:i=e.isOpen?{highlightedIndex:E(e.highlightedIndex,1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:s&&null==e.selectedItem?-1:ne(u,e,1),isOpen:u.items.length>=0};break;case Ae:i=e.isOpen?s?se(u,e.highlightedIndex):{highlightedIndex:E(e.highlightedIndex,-1,u.items,u.isItemDisabled,!0)}:{highlightedIndex:ne(u,e,-1),isOpen:u.items.length>=0};break;case Ue:i=se(u,e.highlightedIndex);break;case Le:i=o({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ne:i={highlightedIndex:E(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case je:i={highlightedIndex:E(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case Fe:i={highlightedIndex:K(0,!1,u.items,u.isItemDisabled)};break;case _e:i={highlightedIndex:K(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case We:i=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 $e:i={isOpen:!0,highlightedIndex:ce(u),inputValue:t.inputValue};break;case qe:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:ne(u,e,0)};break;case Xe:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case Ye:i={inputValue:t.inputValue};break;default:return fe(e,t,Ge)}return o({},e,i)}var et=["onMouseLeave","refKey","ref"],tt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],nt=["onClick","onPress","refKey","ref"],it=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function ot(e){void 0===e&&(e={});var n=o({},Qe,e),r=n.items,u=n.scrollIntoView,s=n.environment,l=n.getA11yStatusMessage,a=function(e,n,i,o){var r=t.useRef(),u=G(e,n,i,o),s=u[0],l=u[1],a=ae();return t.useEffect((function(){O(n,"selectedItem")&&(a||n.itemToKey(n.selectedItem)!==n.itemToKey(r.current)&&l({type:Ye,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[k(s,n),l]}(Ze,n,Je,le),c=a[0],d=a[1],p=c.isOpen,f=c.highlightedIndex,h=c.selectedItem,g=c.inputValue,m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),x=t.useRef(null),w=ae(),S=q(n),C=t.useRef(),D=Y({state:c,props:n}),E=t.useCallback((function(e){return I.current[S.getItemId(e)]}),[S]);re(l,c,[p,f,h,g],s);var K=ue({menuElement:m.current,highlightedIndex:f,isOpen:p,itemRefs:I,scrollIntoView:u,getItemNodeFromIndex:E});t.useEffect((function(){ee(n,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){w||(C.current=r.length)}));var P=ie(s,[x,m,v],t.useCallback((function(){D.current.state.isOpen&&d({type:We,selectItem:!1})}),[d,D])),T=oe();t.useEffect((function(){p||(I.current={})}),[p]),t.useEffect((function(){var e;p&&null!=s&&s.document&&null!=v&&null!=(e=v.current)&&e.focus&&s.document.activeElement!==v.current&&v.current.focus()}),[p,s]);var H=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:Be,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:Ae,altKey:e.altKey})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),d({type:Fe}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),d({type:_e}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),d({type:Le}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),d({type:Ue}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),d({type:Ne}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),d({type:je}))}}}),[d,D]),R=t.useCallback((function(e){return o({id:S.labelId,htmlFor:S.inputId},e)}),[S]),V=t.useCallback((function(e,t){var n,r=void 0===e?{}:e,u=r.onMouseLeave,s=r.refKey,l=void 0===s?"ref":s,a=r.ref,c=i(r,et);return(void 0===t?{}:t).suppressRefError,o(((n={})[l]=b(a,(function(e){m.current=e})),n.id=S.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+S.labelId,n.onMouseLeave=y(u,(function(){d({type:11})})),n),c)}),[d,T,S]),B=t.useCallback((function(e){var t,n,r=void 0===e?{}:e,u=r.item,s=r.index,l=r.refKey,a=void 0===l?"ref":l,c=r.ref,p=r.onMouseMove,f=r.onMouseDown,h=r.onClick;r.onPress;var g=r.disabled,m=i(r,tt);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var v=D.current,x=v.props,w=v.state,C=z(u,s,x.items,"Pass either item or index to getItemProps!"),k=C[0],O=C[1],M=x.isItemDisabled(k,O),E=h;return o(((t={})[a]=b(c,(function(e){e&&(I.current[S.getItemId(O)]=e)})),t["aria-disabled"]=M,t["aria-selected"]=O===w.highlightedIndex,t.id=S.getItemId(O),t.role="option",t),!M&&((n={}).onClick=y(E,(function(){d({type:ze,index:O})})),n),{onMouseMove:y(p,(function(){P.isTouchEnd||O===w.highlightedIndex||(K.current=!1,d({type:12,index:O,disabled:M}))})),onMouseDown:y(f,(function(e){return e.preventDefault()}))},m)}),[d,S,D,P,K]),A=t.useCallback((function(e){var t,n=void 0===e?{}:e,r=n.onClick;n.onPress;var u=n.refKey,s=void 0===u?"ref":u,l=n.ref,a=i(n,nt),c=D.current.state;return o(((t={})[s]=b(l,(function(e){x.current=e})),t["aria-controls"]=S.menuId,t["aria-expanded"]=c.isOpen,t.id=S.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&o({},{onClick:y(r,(function(){d({type:14})}))}),a)}),[d,D,S]),L=t.useCallback((function(e,t){var n,r=void 0===e?{}:e,u=r.onKeyDown,l=r.onChange,a=r.onInput,c=r.onBlur;r.onChangeText;var p=r.onClick,f=r.refKey,h=void 0===f?"ref":f,g=r.ref,m=i(r,it);(void 0===t?{}:t).suppressRefError;var I,x=D.current.state,w={};m.disabled||((I={}).onInput=y(l,a,(function(e){d({type:$e,inputValue:e.target.value})})),I.onKeyDown=y(u,(function(e){var t=M(e);t&&H[t]&&H[t](e)})),I.onBlur=y(c,(function(e){if(null!=s&&s.document&&x.isOpen&&!P.isMouseDown){var t=null===e.relatedTarget&&s.document.activeElement!==s.document.body;d({type:We,selectItem:!t})}})),I.onClick=y(p,(function(){d({type:qe})})),w=I);return o(((n={})[h]=b(g,(function(e){v.current=e})),n["aria-activedescendant"]=x.isOpen&&x.highlightedIndex>-1?S.getItemId(x.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=S.menuId,n["aria-expanded"]=x.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:S.labelId,n.autoComplete="off",n.id=S.inputId,n.role="combobox",n.value=x.inputValue,n),w,m)}),[d,S,s,H,D,P,T]),F=t.useCallback((function(){d({type:15})}),[d]),_=t.useCallback((function(){d({type:17})}),[d]),N=t.useCallback((function(){d({type:16})}),[d]),j=t.useCallback((function(e){d({type:18,highlightedIndex:e})}),[d]),U=t.useCallback((function(e){d({type:Xe,selectedItem:e})}),[d]);return{getItemProps:B,getLabelProps:R,getMenuProps:V,getInputProps:L,getToggleButtonProps:A,toggleMenu:F,openMenu:N,closeMenu:_,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){d({type:20,inputValue:e})}),[d]),selectItem:U,reset:t.useCallback((function(){d({type:21})}),[d]),highlightedIndex:f,isOpen:p,selectedItem:h,inputValue:g}}ot.stateChangeTypes=Ge;var rt={activeIndex:-1,selectedItems:[]};function ut(e,t){return ee(e,t,rt)}function st(e,t){return Z(e,t,rt)}function lt(e){return{activeIndex:ut(e,"activeIndex"),selectedItems:ut(e,"selectedItems")}}function at(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}function ct(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}n.array,n.array,n.array,n.func,n.number,n.number,n.number,n.func,n.func,n.string,n.string;var dt={itemToKey:Q.itemToKey,stateReducer:Q.stateReducer,environment:Q.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},pt=0,ft=1,ht=2,gt=3,mt=4,It=5,vt=6,yt=7,bt=8,xt=9,wt=10,St=11,Ct=12,Dt=Object.freeze({__proto__:null,DropdownClick:yt,DropdownKeyDownBackspace:vt,DropdownKeyDownNavigationPrevious:It,FunctionAddSelectedItem:bt,FunctionRemoveSelectedItem:xt,FunctionReset:Ct,FunctionSetActiveIndex:St,FunctionSetSelectedItems:wt,SelectedItemClick:pt,SelectedItemKeyDownBackspace:ht,SelectedItemKeyDownDelete:ft,SelectedItemKeyDownNavigationNext:gt,SelectedItemKeyDownNavigationPrevious:mt});function kt(e,t){var n,i=t.type,r=t.index,u=t.props,s=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case pt:n={activeIndex:r};break;case mt:n={activeIndex:l-1<0?0:l-1};break;case gt:n={activeIndex:l+1>=a.length?-1:l+1};break;case ht:case ft: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 It:n={activeIndex:a.length-1};break;case vt:n={selectedItems:a.slice(0,a.length-1)};break;case bt:n={selectedItems:[].concat(a,[s])};break;case yt:n={activeIndex:-1};break;case xt:var d=l,p=a.findIndex((function(e){return u.itemToKey(e)===u.itemToKey(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 wt:n={selectedItems:t.selectedItems};break;case St:n={activeIndex:t.activeIndex};break;case Ct:n={activeIndex:st(u,"activeIndex"),selectedItems:st(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return o({},e,n)}var Ot=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Mt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Et(e){void 0===e&&(e={});var n=o({},dt,e),r=n.getA11yStatusMessage,u=n.environment,s=n.keyNavigationNext,l=n.keyNavigationPrevious,a=J(kt,n,lt,ct),c=a[0],d=a[1],p=c.activeIndex,f=c.selectedItems,h=ae(),g=t.useRef(null),m=t.useRef();m.current=[];var I=Y({state:c,props:n});re(r,c,[p,f],u),t.useEffect((function(){h||(-1===p&&g.current?g.current.focus():m.current[p]&&m.current[p].focus())}),[p]);var v=oe(),x=t.useMemo((function(){var e;return(e={})[l]=function(){d({type:mt})},e[s]=function(){d({type:gt})},e.Delete=function(){d({type:ft})},e.Backspace=function(){d({type:ht})},e}),[d,s,l]),w=t.useMemo((function(){var e;return(e={})[l]=function(e){at(e)&&d({type:It})},e.Backspace=function(e){at(e)&&d({type:vt})},e}),[d,l]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,r=n.refKey,u=void 0===r?"ref":r,s=n.ref,l=n.onClick,a=n.onKeyDown,c=n.selectedItem,p=n.index,f=i(n,Ot),h=I.current.state,g=z(c,p,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],v=g>-1&&g===h.activeIndex;return o(((t={})[u]=b(s,(function(e){e&&m.current.push(e)})),t.tabIndex=v?0:-1,t.onClick=y(l,(function(){d({type:pt,index:g})})),t.onKeyDown=y(a,(function(e){var t=M(e);t&&x[t]&&x[t](e)})),t),f)}),[d,I,x]),getDropdownProps:t.useCallback((function(e,t){var n,r=void 0===e?{}:e,u=r.refKey,s=void 0===u?"ref":u,l=r.ref,a=r.onKeyDown,c=r.onClick,p=r.preventKeyAction,f=void 0!==p&&p,h=i(r,Mt);return(void 0===t?{}:t).suppressRefError,o(((n={})[s]=b(l,(function(e){e&&(g.current=e)})),n),!f&&{onKeyDown:y(a,(function(e){var t=M(e);t&&w[t]&&w[t](e)})),onClick:y(c,(function(){d({type:yt})}))},h)}),[d,w,v]),addSelectedItem:t.useCallback((function(e){d({type:bt,selectedItem:e})}),[d]),removeSelectedItem:t.useCallback((function(e){d({type:xt,selectedItem:e})}),[d]),setSelectedItems:t.useCallback((function(e){d({type:wt,selectedItems:e})}),[d]),setActiveIndex:t.useCallback((function(e){d({type:St,activeIndex:e})}),[d]),reset:t.useCallback((function(){d({type:Ct})}),[d]),selectedItems:f,activeIndex:p}}Et.stateChangeTypes=Dt,e.default=N,e.resetIdCounter=function(){"useId"in t?console.warn("It is not necessary to call resetIdCounter when using React 18+"):f=0},e.useCombobox=ot,e.useMultipleSelection=Et,e.useSelect=Ve,Object.defineProperty(e,"__esModule",{value:!0})}));
*/!function(){if(d)return c;d=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),a=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function I(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case i:case r:case o:case p:case f:return e;default:switch(e=e&&e.$$typeof){case l:case s:case a:case g:case h:case u:return e;default:return d}}case n:return d}}}e=Symbol.for("react.module.reference"),c.ContextConsumer=s,c.ContextProvider=u,c.Element=t,c.ForwardRef=a,c.Fragment=i,c.Lazy=g,c.Memo=h,c.Portal=n,c.Profiler=r,c.StrictMode=o,c.Suspense=p,c.SuspenseList=f,c.isAsyncMode=function(){return!1},c.isConcurrentMode=function(){return!1},c.isContextConsumer=function(e){return I(e)===s},c.isContextProvider=function(e){return I(e)===u},c.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},c.isForwardRef=function(e){return I(e)===a},c.isFragment=function(e){return I(e)===i},c.isLazy=function(e){return I(e)===g},c.isMemo=function(e){return I(e)===h},c.isPortal=function(e){return I(e)===n},c.isProfiler=function(e){return I(e)===r},c.isStrictMode=function(e){return I(e)===o},c.isSuspense=function(e){return I(e)===p},c.isSuspenseList=function(e){return I(e)===f},c.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===i||t===r||t===o||t===p||t===f||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===h||t.$$typeof===u||t.$$typeof===s||t.$$typeof===a||t.$$typeof===e||void 0!==t.getModuleId)},c.typeOf=I}();const p=e=>"object"==typeof e&&null!=e&&1===e.nodeType,f=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,h=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return f(n.overflowY,t)||f(n.overflowX,t)||(e=>{const 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},g=(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,m=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var I=0;function v(e){return"function"==typeof e?e:y}function y(){}function b(e,t){if(e){var n=((e,t)=>{var n,i,o,r;if("undefined"==typeof document)return[];const{scrollMode:u,block:s,inline:l,boundary:a,skipOverflowHiddenElements:d}=t,c="function"==typeof a?a:e=>e!==a;if(!p(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,I=[];let v=e;for(;p(v)&&c(v);){if(v=m(v),v===f){I.push(v);break}null!=v&&v===document.body&&h(v)&&!h(document.documentElement)||null!=v&&h(v,d)&&I.push(v)}const y=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,b=null!=(r=null==(o=window.visualViewport)?void 0:o.height)?r:innerHeight,{scrollX:x,scrollY:w}=window,{height:S,width:C,top:k,right:D,bottom:O,left:M}=e.getBoundingClientRect();let E="start"===s||"nearest"===s?k:"end"===s?O:k+S/2,K="center"===l?M+C/2:"end"===l?D:M;const P=[];for(let e=0;e<I.length;e++){const t=I[e],{height:n,width:i,top:o,right:r,bottom:a,left:d}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&M>=0&&O<=b&&D<=y&&k>=o&&O<=a&&M>=d&&D<=r)return P;const c=getComputedStyle(t),p=parseInt(c.borderLeftWidth,10),h=parseInt(c.borderTopWidth,10),m=parseInt(c.borderRightWidth,10),v=parseInt(c.borderBottomWidth,10);let T=0,H=0;const R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-m:0,V="offsetHeight"in t?t.offsetHeight-t.clientHeight-h-v:0,B="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,A="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)T="start"===s?E:"end"===s?E-b:"nearest"===s?g(w,w+b,b,h,v,w+E,w+E+S,S):E-b/2,H="start"===l?K:"center"===l?K-y/2:"end"===l?K-y:g(x,x+y,y,p,m,x+K,x+K+C,C),T=Math.max(0,T+w),H=Math.max(0,H+x);else{T="start"===s?E-o-h:"end"===s?E-a+v+V:"nearest"===s?g(o,a,n,h,v+V,E,E+S,S):E-(o+n/2)+V/2,H="start"===l?K-d-p:"center"===l?K-(d+i/2)+R/2:"end"===l?K-r+m+R:g(d,r,i,p,m+R,K,K+C,C);const{scrollLeft:e,scrollTop:u}=t;T=Math.max(0,Math.min(u+T/A,t.scrollHeight-n/A+V)),H=Math.max(0,Math.min(e+H/B,t.scrollWidth-i/B+R)),E+=u-T,K+=e-H}P.push({el:t,top:T,left:H})}return P})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach((function(e){var t=e.el,n=e.top,i=e.left;t.scrollTop=n,t.scrollLeft=i}))}}function x(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function w(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 S(){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 C(){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 k(){return String(I++)}function D(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 O(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}var M=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function E(e){void 0===e&&(e={});var t={};return M.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function K(e,t){return e&&t?Object.keys(e).reduce((function(n,i){return n[i]=P(t,i)?t[i]:e[i],n}),{}):e}function P(e,t){return void 0!==e[t]}function T(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function H(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(0===r)return-1;var u=r-1;("number"!=typeof e||e<0||e>u)&&(e=t>0?-1:u+1);var s=e+t;s<0?s=o?u:0:s>u&&(s=o?0:u);var l=R(s,t<0,n,i,o);return-1===l?e>=r?-1:e:l}function R(e,t,n,i,o){void 0===o&&(o=!1);var r=n.length;if(t){for(var u=e;u>=0;u--)if(!i(n[u],u))return u}else for(var s=e;s<r;s++)if(!i(n[s],s))return s;return o?R(t?r-1:0,t,n,i):-1}function V(e,t,n,i){return void 0===i&&(i=!0),n&&t.some((function(t){return t&&(x(t,e,n)||i&&x(t,n.document.activeElement,n))}))}var B=w((function(e){A(e).textContent=""}),500);function A(e){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)}function L(e,t){e&&t&&(A(t).textContent=e,B(t))}var F=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}),_=["refKey","ref"],N=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],j=["onKeyDown","onBlur","onChange","onInput","onChangeText"],U=["refKey","ref"],$=["onMouseMove","onMouseDown","onClick","onPress","index","item"],W=function(){var e=function(e){var n,i;function o(t){var n=e.call(this,t)||this;n.id=n.props.id||"downshift-"+k(),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.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.isItemDisabled=function(e,t){var i=n.getItemNodeFromIndex(t);return i&&i.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=E(t),n.internalSetState(s({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=E(t),n.internalSetState(s({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={},u="function"==typeof e;return!u&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,s({},n.getStateAndHelpers(),e)),n.setState((function(t){var l;t=n.getState(t);var a=u?e(t):e;a=n.props.stateReducer(t,a),i=a.hasOwnProperty("selectedItem");var d={};return i&&a.selectedItem!==t.selectedItem&&(o=a.selectedItem),(l=a).type||(l.type=0),Object.keys(a).forEach((function(e){t[e]!==a[e]&&(r[e]=a[e]),"type"!==e&&(a[e],P(n.props,e)||(d[e]=a[e]))})),u&&a.hasOwnProperty("inputValue")&&n.props.onInputValueChange(a.inputValue,s({},n.getStateAndHelpers(),a)),d}),(function(){v(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,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,_),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 s(((i={})[l]=C(a,n.rootRef),i.role="combobox",i["aria-expanded"]=f,i["aria-haspopup"]="listbox",i["aria-owns"]=f?n.menuId:void 0,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=H(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);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=H(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);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(s({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=s({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=s({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=R(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var i=R(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(i,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,i=t.onClick;t.onPress;var o=t.onKeyDown,r=t.onKeyUp,l=t.onBlur,a=u(t,N),d=n.getState().isOpen,c={onClick:S(i,n.buttonHandleClick),onKeyDown:S(o,n.buttonHandleKeyDown),onKeyUp:S(r,n.buttonHandleKeyUp),onBlur:S(l,n.buttonHandleBlur)};return s({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=T(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(l(n),e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,i=t.body,o=t.activeElement;i&&i===o&&e.target.focus()}n.internalSetTimeout((function(){return n.toggleMenu({type:13})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}}))},n.getLabelProps=function(e){return s({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,i=t.onKeyDown,o=t.onBlur,r=t.onChange,l=t.onInput;t.onChangeText;var a=u(t,j),d={};var c,p=n.getState(),f=p.inputValue,h=p.isOpen,g=p.highlightedIndex;a.disabled||((c={}).onInput=S(r,l,n.inputHandleChange),c.onKeyDown=S(i,n.inputHandleKeyDown),c.onBlur=S(o,n.inputHandleBlur),d=c);return s({"aria-autocomplete":"list","aria-activedescendant":h&&"number"==typeof g&&g>=0?n.getItemId(g):void 0,"aria-controls":h?n.menuId:void 0,"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=T(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;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var i,o=void 0===e?{}:e,r=o.refKey,l=void 0===r?"ref":r,a=o.ref,d=u(o,U),c=(void 0===t?{}:t).suppressRefError,p=void 0!==c&&c;return n.getMenuProps.called=!0,n.getMenuProps.refKey=l,n.getMenuProps.suppressRefError=p,s(((i={})[l]=C(a,n.menuRef),i.role="listbox",i["aria-labelledby"]=d&&d["aria-label"]?void 0:n.labelId,i.id=n.menuId,i),d)},n.getItemProps=function(e){var t,i=void 0===e?{}:e,o=i.onMouseMove,r=i.onMouseDown,l=i.onClick;i.onPress;var a=i.index,d=i.item,c=void 0===d?void 0:d,p=u(i,$);void 0===a?(n.items.push(c),a=n.items.indexOf(c)):n.items[a]=c;var f=l,h=((t={onMouseMove:S(o,(function(){a!==n.getState().highlightedIndex&&(n.setHighlightedIndex(a,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:S(r,(function(e){e.preventDefault()}))}).onClick=S(f,(function(){n.selectItemAtIndex(a,{type:9})})),t),g=p.disabled?{onMouseDown:h.onMouseDown}:h;return s({id:n.getItemId(a),role:"option","aria-selected":n.getState().highlightedIndex===a},g,p)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=E(e),n.internalSetState((function(t){var i=t.selectedItem;return s({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=E(e),n.internalSetState((function(t){var i=t.isOpen;return s({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),v(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=w((function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),i=n.items[t.highlightedIndex],o=n.getItemCount(),r=n.props.getA11yStatusMessage(s({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:o,highlightedItem:i},t));n.previousResultCount=o,L(r,n.props.environment.document)}}),200);var i=n.props,o=i.defaultHighlightedIndex,r=i.initialHighlightedIndex,a=void 0===r?o:r,d=i.defaultIsOpen,c=i.initialIsOpen,p=void 0===c?d:c,f=i.initialInputValue,h=void 0===f?"":f,g=i.initialSelectedItem,m=void 0===g?null:g,I=n.getState({highlightedIndex:a,isOpen:p,inputValue:h,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,a(n,i);var r=o.prototype;return r.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},r.getState=function(e){return void 0===e&&(e=this.state),K(e,this.props)},r.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},r.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},r.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},r.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),i=this.getState().highlightedIndex;if(n>0){var o=H(i,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(o,t)}},r.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,h=this.closeMenu,g=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:d,getInputProps:c,getItemProps:p,reset:this.reset,openMenu:f,closeMenu:h,toggleMenu:g,selectItem:m,selectItemAtIndex:I,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:r,id:u,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:i}},r.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!V(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=V(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)}}else this.cleanup=function(){e.internalClearTimeouts()}},r.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},r.componentDidUpdate=function(e,t){P(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()},r.componentWillUnmount=function(){this.cleanup()},r.render=function(){var e=O(this.props.children,y);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=O(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:D,itemToString:function(e){return null==e?"":String(e)},onStateChange:y,onInputValueChange:y,onUserAction:y,onChange:y,onSelect:y,onOuterClick:y,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:b},e.stateChangeTypes=F,e}(),q=W,z={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function X(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,u="on"+Z(e)+"Change";o[u]&&void 0!==i[e]&&i[e]!==n[e]&&o[u](s({type:r},i))}(i,e,t,n),n[i]!==t[i]&&(r[i]=n[i])})),i.onStateChange&&Object.keys(r).length&&i.onStateChange(s({type:o},r))}var Y=w((function(e,t){L(e,t)}),200),G="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect,J="useId"in o.default?function(e){var n=e.id,i=e.labelId,r=e.menuId,u=e.getItemId,s=e.toggleButtonId,l=e.inputId,a="downshift-"+o.default.useId();return n||(n=a),t.useRef({labelId:i||n+"-label",menuId:r||n+"-menu",getItemId:u||function(e){return n+"-item-"+e},toggleButtonId:s||n+"-toggle-button",inputId:l||n+"-input"}).current}:function(e){var n=e.id,i=void 0===n?"downshift-"+k():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 Q(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 Z(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function ee(e){var n=t.useRef(e);return n.current=e,n}function te(e,n,i,o){var r=t.useRef(),u=t.useRef(),l=t.useCallback((function(t,n){u.current=n,t=K(t,n.props);var i=e(t,n);return n.props.stateReducer(t,s({},n,{changes:i}))}),[e]),a=t.useReducer(l,n,i),d=a[0],c=a[1],p=ee(n),f=t.useCallback((function(e){return c(s({props:p.current},e))}),[p]),h=u.current;return t.useEffect((function(){var e=K(r.current,null==h?void 0:h.props);h&&r.current&&!o(e,d)&&X(h,e,d),r.current=d}),[d,h,o]),[d,f]}function ne(e,t,n,i){var o=te(e,t,n,i),r=o[0],u=o[1];return[K(r,t),u]}var ie={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:b,environment:"undefined"==typeof window?void 0:window};function oe(e,t,n){void 0===n&&(n=z);var i=e["default"+Z(t)];return void 0!==i?i:n[t]}function re(e,t,n){void 0===n&&(n=z);var i=e[t];if(void 0!==i)return i;var o=e["initial"+Z(t)];return void 0!==o?o:oe(e,t,n)}function ue(e){var t=re(e,"selectedItem"),n=re(e,"isOpen"),i=re(e,"highlightedIndex"),o=re(e,"inputValue");return{highlightedIndex:i<0&&t&&n?e.items.findIndex((function(n){return e.itemToKey(n)===e.itemToKey(t)})):i,isOpen:n,selectedItem:t,inputValue:o}}function se(e,t,n){var i=e.items,o=e.initialHighlightedIndex,r=e.defaultHighlightedIndex,u=e.itemToKey,s=t.selectedItem,l=t.highlightedIndex;return 0===i.length?-1:void 0!==o&&l===o?o:void 0!==r?r:s?i.findIndex((function(e){return u(s)===u(e)})):0===n?-1:n<0?i.length-1:0}function le(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return y;var t=n.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(n){o.current.isMouseDown=!1,V(n.target,t,e)||i()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(n){o.current.isTouchEnd=!0,o.current.isTouchMove||V(n.target,t,e,!1)||i()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a)}}),[e,i]),o.current}var ae=function(){return y};function de(e,n,i,o){void 0===o&&(o={});var r=o.document,u=ge();t.useEffect((function(){if(e&&!u&&r){var t=e(n);Y(t,r)}}),[i]),t.useEffect((function(){return function(){var e,t;Y.cancel(),(t=null==(e=r)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[r])}function ce(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 G((function(){n<0||!i||!Object.keys(o.current).length||(!1===l.current?l.current=!0:s(r(n),u))}),[n]),l}var pe=y;function fe(e,t,n){var i;return void 0===n&&(n=!0),s({isOpen:!1,highlightedIndex:-1},(null==(i=e.items)?void 0:i.length)&&t>=0&&s({selectedItem:e.items[t],isOpen:oe(e,"isOpen"),highlightedIndex:oe(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function he(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function ge(){var e=o.default.useRef(!0);return o.default.useEffect((function(){return e.current=!1,function(){e.current=!0}}),[]),e.current}var me={environment:r.default.shape({addEventListener:r.default.func.isRequired,removeEventListener:r.default.func.isRequired,document:r.default.shape({createElement:r.default.func.isRequired,getElementById:r.default.func.isRequired,activeElement:r.default.any.isRequired,body:r.default.any.isRequired}).isRequired,Node:r.default.func.isRequired}),itemToString:r.default.func,itemToKey:r.default.func,stateReducer:r.default.func},Ie=s({},me,{getA11yStatusMessage:r.default.func,highlightedIndex:r.default.number,defaultHighlightedIndex:r.default.number,initialHighlightedIndex:r.default.number,isOpen:r.default.bool,defaultIsOpen:r.default.bool,initialIsOpen:r.default.bool,selectedItem:r.default.any,initialSelectedItem:r.default.any,defaultSelectedItem:r.default.any,id:r.default.string,labelId:r.default.string,menuId:r.default.string,getItemId:r.default.func,toggleButtonId:r.default.string,onSelectedItemChange:r.default.func,onHighlightedIndexChange:r.default.func,onStateChange:r.default.func,onIsOpenChange:r.default.func,scrollIntoView:r.default.func});function ve(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:se(r,e,0)};break;case n.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:se(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:oe(r,"highlightedIndex"),isOpen:oe(r,"isOpen"),selectedItem:oe(r,"selectedItem"),inputValue:oe(r,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,i)}var ye=function(){return ye=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},ye.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,ye(ye({},Ie),{items:r.default.array.isRequired,isItemDisabled:r.default.func});var be=ye(ye({},ie),{isItemDisabled:function(){return!1}}),xe=y,we=1,Se=2,Ce=3,ke=4,De=5,Oe=6,Me=7,Ee=8,Ke=9,Pe=10,Te=11,He=14,Re=19,Ve=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:we,ToggleButtonKeyDownArrowUp:Se,ToggleButtonKeyDownCharacter:Ce,ToggleButtonKeyDownEscape:ke,ToggleButtonKeyDownHome:De,ToggleButtonKeyDownEnd:Oe,ToggleButtonKeyDownEnter:Me,ToggleButtonKeyDownSpaceButton:Ee,ToggleButtonKeyDownPageUp:Ke,ToggleButtonKeyDownPageDown:Pe,ToggleButtonBlur:Te,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:He,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Re,FunctionSetInputValue:20,FunctionReset:21});function Be(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case He:i={isOpen:oe(r,"isOpen"),highlightedIndex:oe(r,"highlightedIndex"),selectedItem:r.items[t.index]};break;case Ce:var l=t.key,a=""+e.inputValue+l;i={inputValue:a,highlightedIndex:function(e){for(var t=e.keysSoFar,n=e.highlightedIndex,i=e.items,o=e.itemToString,r=e.isItemDisabled,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)&&!r(a,l))return l}return n}({keysSoFar:a,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.findIndex((function(t){return r.itemToKey(t)===r.itemToKey(e.selectedItem)})):e.highlightedIndex,items:r.items,itemToString:r.itemToString,isItemDisabled:r.isItemDisabled}),isOpen:!0};break;case we:i={highlightedIndex:e.isOpen?H(e.highlightedIndex,1,r.items,r.isItemDisabled):u&&null==e.selectedItem?-1:se(r,e,1),isOpen:!0};break;case Se:if(e.isOpen&&u)i=fe(r,e.highlightedIndex,!1);else i={highlightedIndex:e.isOpen?H(e.highlightedIndex,-1,r.items,r.isItemDisabled):se(r,e,-1),isOpen:!0};break;case Me:case Ee:i=fe(r,e.highlightedIndex,!1);break;case De:i={highlightedIndex:R(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case Oe:i={highlightedIndex:R(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case Ke:i={highlightedIndex:H(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case Pe:i={highlightedIndex:H(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case ke:i={isOpen:!1,highlightedIndex:-1};break;case Te:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case Re:i={selectedItem:t.selectedItem};break;default:return ve(e,t,Ve)}return s({},e,i)}var Ae=["onClick"],Le=["onMouseLeave","refKey","ref"],Fe=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],_e=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function Ne(e){void 0===e&&(e={}),xe();var n=s({},be,e),i=n.scrollIntoView,o=n.environment,r=n.getA11yStatusMessage,l=ne(Be,n,ue,he),a=l[0],d=l[1],c=a.isOpen,p=a.highlightedIndex,f=a.selectedItem,h=a.inputValue,g=t.useRef(null),m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=J(n),b=ee({state:a,props:n}),x=t.useCallback((function(e){return I.current[y.getItemId(e)]}),[y]);de(r,a,[c,p,f,h],o);var k=ce({menuElement:m.current,highlightedIndex:p,isOpen:c,itemRefs:I,scrollIntoView:i,getItemNodeFromIndex:x});t.useEffect((function(){return v.current=w((function(e){e({type:20,inputValue:""})}),500),function(){v.current.cancel()}}),[]),t.useEffect((function(){h&&v.current(d)}),[d,h]),pe(),t.useEffect((function(){re(n,"isOpen")&&g.current&&g.current.focus()}),[]);var D=le(o,[g,m],t.useCallback((function(){b.current.state.isOpen&&d({type:Te})}),[d,b])),O=ae();t.useEffect((function(){c||(I.current={})}),[c]);var M=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:we,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:Se,altKey:e.altKey})},Home:function(e){e.preventDefault(),d({type:De})},End:function(e){e.preventDefault(),d({type:Oe})},Escape:function(){b.current.state.isOpen&&d({type:ke})},Enter:function(e){e.preventDefault(),d({type:b.current.state.isOpen?Me:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Ke}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Pe}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?d({type:Ce,key:" "}):d({type:Ee}):d({type:0})}}}),[d,b]),E=t.useCallback((function(){d({type:15})}),[d]),K=t.useCallback((function(){d({type:17})}),[d]),P=t.useCallback((function(){d({type:16})}),[d]),H=t.useCallback((function(e){d({type:18,highlightedIndex:e})}),[d]),R=t.useCallback((function(e){d({type:Re,selectedItem:e})}),[d]),V=t.useCallback((function(){d({type:21})}),[d]),B=t.useCallback((function(e){d({type:20,inputValue:e})}),[d]),A=t.useCallback((function(e){var t=void 0===e?{}:e,n=t.onClick,i=u(t,Ae);return s({id:y.labelId,htmlFor:y.toggleButtonId,onClick:S(n,(function(){var e;null==(e=g.current)||e.focus()}))},i)}),[y]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,c=u(i,Le),p=(void 0===t?{}:t).suppressRefError;return O("getMenuProps",void 0!==p&&p,l,m),s(((n={})[l]=C(a,(function(e){m.current=e})),n.id=y.menuId,n.role="listbox",n["aria-labelledby"]=c&&c["aria-label"]?void 0:""+y.labelId,n.onMouseLeave=S(o,(function(){d({type:12})})),n),c)}),[d,O,y]),F=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onBlur,r=i.onClick;i.onPress;var l=i.onKeyDown,a=i.refKey,c=void 0===a?"ref":a,p=i.ref,f=u(i,Fe),h=(void 0===t?{}:t).suppressRefError,m=void 0!==h&&h,I=b.current.state,v=s(((n={})[c]=C(p,(function(e){g.current=e})),n["aria-activedescendant"]=I.isOpen&&I.highlightedIndex>-1?y.getItemId(I.highlightedIndex):"",n["aria-controls"]=y.menuId,n["aria-expanded"]=b.current.state.isOpen,n["aria-haspopup"]="listbox",n["aria-labelledby"]=f&&f["aria-label"]?void 0:""+y.labelId,n.id=y.toggleButtonId,n.role="combobox",n.tabIndex=0,n.onBlur=S(o,(function(){I.isOpen&&!D.isMouseDown&&d({type:Te})})),n),f);return f.disabled||(v.onClick=S(r,(function(){d({type:0})})),v.onKeyDown=S(l,(function(e){var t=T(e);t&&M[t]?M[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&d({type:Ce,key:t})}))),O("getToggleButtonProps",m,c,g),v}),[d,y,b,D,O,M]),_=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.item,o=n.index,r=n.onMouseMove,l=n.onClick,a=n.onMouseDown;n.onPress;var c=n.refKey,p=void 0===c?"ref":c,f=n.disabled,h=n.ref,g=u(n,_e);void 0!==f&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var m=b.current,v=m.state,x=m.props,w=Q(i,o,x.items,"Pass either item or index to getItemProps!"),O=w[0],M=w[1],E=x.isItemDisabled(O,M),K=s(((t={})[p]=C(h,(function(e){e&&(I.current[y.getItemId(M)]=e)})),t["aria-disabled"]=E,t["aria-selected"]=""+(O===v.selectedItem),t.id=y.getItemId(M),t.role="option",t),g);return E||(K.onClick=S(l,(function(){d({type:He,index:M})}))),K.onMouseMove=S(r,(function(){D.isTouchEnd||M===v.highlightedIndex||(k.current=!1,d({type:13,index:M,disabled:E}))})),K.onMouseDown=S(a,(function(e){return e.preventDefault()})),K}),[b,y,D,k,d]);return{getToggleButtonProps:F,getLabelProps:A,getMenuProps:L,getItemProps:_,toggleMenu:E,openMenu:P,closeMenu:K,setHighlightedIndex:H,selectItem:R,reset:V,setInputValue:B,highlightedIndex:p,isOpen:c,selectedItem:f,inputValue:h}}Ne.stateChangeTypes=Ve;var je=0,Ue=1,$e=2,We=3,qe=4,ze=5,Xe=6,Ye=7,Ge=8,Je=9,Qe=10,Ze=13,et=19,tt=22,nt=Object.freeze({__proto__:null,InputKeyDownArrowDown:je,InputKeyDownArrowUp:Ue,InputKeyDownEscape:$e,InputKeyDownHome:We,InputKeyDownEnd:qe,InputKeyDownPageUp:ze,InputKeyDownPageDown:Xe,InputKeyDownEnter:Ye,InputChange:Ge,InputBlur:Je,InputClick:Qe,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:Ze,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:et,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:tt});function it(e){var t=ue(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)),s({},t,{inputValue:i})}s({},Ie,{items:r.default.array.isRequired,isItemDisabled:r.default.func,inputValue:r.default.string,defaultInputValue:r.default.string,initialInputValue:r.default.string,inputId:r.default.string,onInputValueChange:r.default.func});var ot=y,rt=s({},ie,{isItemDisabled:function(){return!1}});function ut(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Ze:i={isOpen:oe(r,"isOpen"),highlightedIndex:oe(r,"highlightedIndex"),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case je:i=e.isOpen?{highlightedIndex:H(e.highlightedIndex,1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:u&&null==e.selectedItem?-1:se(r,e,1),isOpen:r.items.length>=0};break;case Ue:i=e.isOpen?u?fe(r,e.highlightedIndex):{highlightedIndex:H(e.highlightedIndex,-1,r.items,r.isItemDisabled,!0)}:{highlightedIndex:se(r,e,-1),isOpen:r.items.length>=0};break;case Ye:i=fe(r,e.highlightedIndex);break;case $e:i=s({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case ze:i={highlightedIndex:H(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case Xe:i={highlightedIndex:H(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case We:i={highlightedIndex:R(0,!1,r.items,r.isItemDisabled)};break;case qe:i={highlightedIndex:R(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Je:i=s({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 Ge:i={isOpen:!0,highlightedIndex:oe(r,"highlightedIndex"),inputValue:t.inputValue};break;case Qe:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:se(r,e,0)};break;case et:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case tt:i={inputValue:t.inputValue};break;default:return ve(e,t,nt)}return s({},e,i)}var st=["onMouseLeave","refKey","ref"],lt=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],at=["onClick","onPress","refKey","ref"],dt=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function ct(e){void 0===e&&(e={}),ot();var n=s({},rt,e),i=n.items,o=n.scrollIntoView,r=n.environment,l=n.getA11yStatusMessage,a=function(e,n,i,o){var r=t.useRef(),u=te(e,n,i,o),s=u[0],l=u[1],a=ge();return t.useEffect((function(){P(n,"selectedItem")&&(a||n.itemToKey(n.selectedItem)!==n.itemToKey(r.current)&&l({type:tt,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[K(s,n),l]}(ut,n,it,he),d=a[0],c=a[1],p=d.isOpen,f=d.highlightedIndex,h=d.selectedItem,g=d.inputValue,m=t.useRef(null),I=t.useRef({}),v=t.useRef(null),y=t.useRef(null),b=ge(),x=J(n),w=t.useRef(),k=ee({state:d,props:n}),D=t.useCallback((function(e){return I.current[x.getItemId(e)]}),[x]);de(l,d,[p,f,h,g],r);var O=ce({menuElement:m.current,highlightedIndex:f,isOpen:p,itemRefs:I,scrollIntoView:o,getItemNodeFromIndex:D});pe(),t.useEffect((function(){re(n,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){b||(w.current=i.length)}));var M=le(r,[y,m,v],t.useCallback((function(){k.current.state.isOpen&&c({type:Je,selectItem:!1})}),[c,k])),E=ae();t.useEffect((function(){p||(I.current={})}),[p]),t.useEffect((function(){var e;p&&null!=r&&r.document&&null!=v&&null!=(e=v.current)&&e.focus&&r.document.activeElement!==v.current&&v.current.focus()}),[p,r]);var H=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:je,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Ue,altKey:e.altKey})},Home:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:We}))},End:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:qe}))},Escape:function(e){var t=k.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:$e}))},Enter:function(e){k.current.state.isOpen&&229!==e.which&&(e.preventDefault(),c({type:Ye}))},PageUp:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:ze}))},PageDown:function(e){k.current.state.isOpen&&(e.preventDefault(),c({type:Xe}))}}}),[c,k]),R=t.useCallback((function(e){return s({id:x.labelId,htmlFor:x.inputId},e)}),[x]),V=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onMouseLeave,r=i.refKey,l=void 0===r?"ref":r,a=i.ref,d=u(i,st),p=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==p&&p,l,m),s(((n={})[l]=C(a,(function(e){m.current=e})),n.id=x.menuId,n.role="listbox",n["aria-labelledby"]=d&&d["aria-label"]?void 0:""+x.labelId,n.onMouseLeave=S(o,(function(){c({type:11})})),n),d)}),[c,E,x]),B=t.useCallback((function(e){var t,n,i=void 0===e?{}:e,o=i.item,r=i.index,l=i.refKey,a=void 0===l?"ref":l,d=i.ref,p=i.onMouseMove,f=i.onMouseDown,h=i.onClick;i.onPress;var g=i.disabled,m=u(i,lt);void 0!==g&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var v=k.current,y=v.props,b=v.state,w=Q(o,r,y.items,"Pass either item or index to getItemProps!"),D=w[0],E=w[1],K=y.isItemDisabled(D,E),P=h;return s(((t={})[a]=C(d,(function(e){e&&(I.current[x.getItemId(E)]=e)})),t["aria-disabled"]=K,t["aria-selected"]=""+(E===b.highlightedIndex),t.id=x.getItemId(E),t.role="option",t),!K&&((n={}).onClick=S(P,(function(){c({type:Ze,index:E})})),n),{onMouseMove:S(p,(function(){M.isTouchEnd||E===b.highlightedIndex||(O.current=!1,c({type:12,index:E,disabled:K}))})),onMouseDown:S(f,(function(e){return e.preventDefault()}))},m)}),[c,x,k,M,O]),A=t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.onClick;n.onPress;var o=n.refKey,r=void 0===o?"ref":o,l=n.ref,a=u(n,at),d=k.current.state;return s(((t={})[r]=C(l,(function(e){y.current=e})),t["aria-controls"]=x.menuId,t["aria-expanded"]=d.isOpen,t.id=x.toggleButtonId,t.tabIndex=-1,t),!a.disabled&&s({},{onClick:S(i,(function(){c({type:14})}))}),a)}),[c,k,x]),L=t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.onKeyDown,l=i.onChange,a=i.onInput,d=i.onBlur;i.onChangeText;var p=i.onClick,f=i.refKey,h=void 0===f?"ref":f,g=i.ref,m=u(i,dt),I=(void 0===t?{}:t).suppressRefError;E("getInputProps",void 0!==I&&I,h,v);var y,b=k.current.state,w={};m.disabled||((y={}).onInput=S(l,a,(function(e){c({type:Ge,inputValue:e.target.value})})),y.onKeyDown=S(o,(function(e){var t=T(e);t&&H[t]&&H[t](e)})),y.onBlur=S(d,(function(e){if(null!=r&&r.document&&b.isOpen&&!M.isMouseDown){var t=null===e.relatedTarget&&r.document.activeElement!==r.document.body;c({type:Je,selectItem:!t})}})),y.onClick=S(p,(function(){c({type:Qe})})),w=y);return s(((n={})[h]=C(g,(function(e){v.current=e})),n["aria-activedescendant"]=b.isOpen&&b.highlightedIndex>-1?x.getItemId(b.highlightedIndex):"",n["aria-autocomplete"]="list",n["aria-controls"]=x.menuId,n["aria-expanded"]=b.isOpen,n["aria-labelledby"]=m&&m["aria-label"]?void 0:x.labelId,n.autoComplete="off",n.id=x.inputId,n.role="combobox",n.value=b.inputValue,n),w,m)}),[c,x,r,H,k,M,E]),F=t.useCallback((function(){c({type:15})}),[c]),_=t.useCallback((function(){c({type:17})}),[c]),N=t.useCallback((function(){c({type:16})}),[c]),j=t.useCallback((function(e){c({type:18,highlightedIndex:e})}),[c]),U=t.useCallback((function(e){c({type:et,selectedItem:e})}),[c]);return{getItemProps:B,getLabelProps:R,getMenuProps:V,getInputProps:L,getToggleButtonProps:A,toggleMenu:F,openMenu:N,closeMenu:_,setHighlightedIndex:j,setInputValue:t.useCallback((function(e){c({type:20,inputValue:e})}),[c]),selectItem:U,reset:t.useCallback((function(){c({type:21})}),[c]),highlightedIndex:f,isOpen:p,selectedItem:h,inputValue:g}}ct.stateChangeTypes=nt;var pt={activeIndex:-1,selectedItems:[]};function ft(e,t){return re(e,t,pt)}function ht(e,t){return oe(e,t,pt)}function gt(e){return{activeIndex:ft(e,"activeIndex"),selectedItems:ft(e,"selectedItems")}}function mt(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}function It(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}r.default.array,r.default.array,r.default.array,r.default.func,r.default.number,r.default.number,r.default.number,r.default.func,r.default.func,r.default.string,r.default.string;var vt={itemToKey:ie.itemToKey,stateReducer:ie.stateReducer,environment:ie.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},yt=y,bt=0,xt=1,wt=2,St=3,Ct=4,kt=5,Dt=6,Ot=7,Mt=8,Et=9,Kt=10,Pt=11,Tt=12,Ht=Object.freeze({__proto__:null,SelectedItemClick:bt,SelectedItemKeyDownDelete:xt,SelectedItemKeyDownBackspace:wt,SelectedItemKeyDownNavigationNext:St,SelectedItemKeyDownNavigationPrevious:Ct,DropdownKeyDownNavigationPrevious:kt,DropdownKeyDownBackspace:Dt,DropdownClick:Ot,FunctionAddSelectedItem:Mt,FunctionRemoveSelectedItem:Et,FunctionSetSelectedItems:Kt,FunctionSetActiveIndex:Pt,FunctionReset:Tt});function Rt(e,t){var n,i=t.type,o=t.index,r=t.props,u=t.selectedItem,l=e.activeIndex,a=e.selectedItems;switch(i){case bt:n={activeIndex:o};break;case Ct:n={activeIndex:l-1<0?0:l-1};break;case St:n={activeIndex:l+1>=a.length?-1:l+1};break;case wt:case xt:if(l<0)break;var d=l;1===a.length?d=-1:l===a.length-1&&(d=a.length-2),n=s({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:d});break;case kt:n={activeIndex:a.length-1};break;case Dt:n={selectedItems:a.slice(0,a.length-1)};break;case Mt:n={selectedItems:[].concat(a,[u])};break;case Ot:n={activeIndex:-1};break;case Et:var c=l,p=a.findIndex((function(e){return r.itemToKey(e)===r.itemToKey(u)}));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 Kt:n={selectedItems:t.selectedItems};break;case Pt:n={activeIndex:t.activeIndex};break;case Tt:n={activeIndex:ht(r,"activeIndex"),selectedItems:ht(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,n)}var Vt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],Bt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function At(e){void 0===e&&(e={}),yt();var n=s({},vt,e),i=n.getA11yStatusMessage,o=n.environment,r=n.keyNavigationNext,l=n.keyNavigationPrevious,a=ne(Rt,n,gt,It),d=a[0],c=a[1],p=d.activeIndex,f=d.selectedItems,h=ge(),g=t.useRef(null),m=t.useRef();m.current=[];var I=ee({state:d,props:n});de(i,d,[p,f],o),t.useEffect((function(){h||(-1===p&&g.current?g.current.focus():m.current[p]&&m.current[p].focus())}),[p]),pe();var v=ae(),y=t.useMemo((function(){var e;return(e={})[l]=function(){c({type:Ct})},e[r]=function(){c({type:St})},e.Delete=function(){c({type:xt})},e.Backspace=function(){c({type:wt})},e}),[c,r,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){mt(e)&&c({type:kt})},e.Backspace=function(e){mt(e)&&c({type:Dt})},e}),[c,l]);return{getSelectedItemProps:t.useCallback((function(e){var t,n=void 0===e?{}:e,i=n.refKey,o=void 0===i?"ref":i,r=n.ref,l=n.onClick,a=n.onKeyDown,d=n.selectedItem,p=n.index,f=u(n,Vt),h=I.current.state,g=Q(d,p,h.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],v=g>-1&&g===h.activeIndex;return s(((t={})[o]=C(r,(function(e){e&&m.current.push(e)})),t.tabIndex=v?0:-1,t.onClick=S(l,(function(){c({type:bt,index:g})})),t.onKeyDown=S(a,(function(e){var t=T(e);t&&y[t]&&y[t](e)})),t),f)}),[c,I,y]),getDropdownProps:t.useCallback((function(e,t){var n,i=void 0===e?{}:e,o=i.refKey,r=void 0===o?"ref":o,l=i.ref,a=i.onKeyDown,d=i.onClick,p=i.preventKeyAction,f=void 0!==p&&p,h=u(i,Bt),m=(void 0===t?{}:t).suppressRefError;return v("getDropdownProps",void 0!==m&&m,r,g),s(((n={})[r]=C(l,(function(e){e&&(g.current=e)})),n),!f&&{onKeyDown:S(a,(function(e){var t=T(e);t&&b[t]&&b[t](e)})),onClick:S(d,(function(){c({type:Ot})}))},h)}),[c,b,v]),addSelectedItem:t.useCallback((function(e){c({type:Mt,selectedItem:e})}),[c]),removeSelectedItem:t.useCallback((function(e){c({type:Et,selectedItem:e})}),[c]),setSelectedItems:t.useCallback((function(e){c({type:Kt,selectedItems:e})}),[c]),setActiveIndex:t.useCallback((function(e){c({type:Pt,activeIndex:e})}),[c]),reset:t.useCallback((function(){c({type:Tt})}),[c]),selectedItems:f,activeIndex:p}}At.stateChangeTypes=Ht,e.default=q,e.resetIdCounter=function(){"useId"in o.default?console.warn("It is not necessary to call resetIdCounter when using React 18+"):I=0},e.useCombobox=ct,e.useMultipleSelection=At,e.useSelect=Ne,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc