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.7-alpha.1 to 9.0.7-alpha.2

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){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=function(e){var t=ce(e,"highlightedIndex");if(t>-1&&e.isItemDisabled(e.items[t],t))return-1;return t}(e),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.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 fe(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return C;var t=i.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(i){o.current.isMouseDown=!1,F(i.target,t,e)||n()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(i){o.current.isTouchEnd=!0,o.current.isTouchMove||F(i.target,t,e,!1)||n()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),console.log("adds events",i),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a),console.log("cleans up events",i)}}),[e,n,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}function xe(e){var t=ae(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var we={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},Se=r({},we,{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 Ce(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: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:xe(u),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 ke=function(){return ke=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},ke.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,ke(ke({},Se),{items:g.array.isRequired,isItemDisabled:g.func});var De=ke(ke({},le),{isItemDisabled:function(){return!1}}),Oe=C,Me=1,Ee=2,Ke=3,Pe=4,Te=5,Re=6,He=7,Ve=8,Be=9,Ae=10,Le=11,_e=14,Fe=19,Ne=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:Me,ToggleButtonKeyDownArrowUp:Ee,ToggleButtonKeyDownCharacter:Ke,ToggleButtonKeyDownEscape:Pe,ToggleButtonKeyDownHome:Te,ToggleButtonKeyDownEnd:Re,ToggleButtonKeyDownEnter:He,ToggleButtonKeyDownSpaceButton:Ve,ToggleButtonKeyDownPageUp:Be,ToggleButtonKeyDownPageDown:Ae,ToggleButtonBlur:Le,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:_e,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Fe,FunctionSetInputValue:20,FunctionReset:21});function je(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case _e:i={isOpen:ae(u,"isOpen"),highlightedIndex:xe(u),selectedItem:u.items[t.index]};break;case Ke: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?L(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:pe(u,e,1),isOpen:!0};break;case Ee: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 He:case Ve:i=ve(u,e.highlightedIndex,!1);break;case Te:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Re:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Be:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case Ae:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case Pe:i={isOpen:!1,highlightedIndex:-1};break;case Le:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case Fe:i={selectedItem:t.selectedItem};break;default:return Ce(e,t,Ne)}return r({},e,i)}var Ue=["onClick"],We=["onMouseLeave","refKey","ref"],$e=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],qe=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function ze(e){void 0===e&&(e={}),Oe();var n=r({},De,e),i=n.scrollIntoView,u=n.environment,s=n.getA11yStatusMessage,l=se(je,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,t.useCallback((function(){b.current.state.isOpen&&c({type:Le})}),[c,b]),t.useMemo((function(){return[g,m]}),[])),C=he();t.useEffect((function(){d||(I.current={})}),[d]);var k=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:Me,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Ee,altKey:e.altKey})},Home:function(e){e.preventDefault(),c({type:Te})},End:function(e){e.preventDefault(),c({type:Re})},Escape:function(){b.current.state.isOpen&&c({type:Pe})},Enter:function(e){e.preventDefault(),c({type:b.current.state.isOpen?He:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Be}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Ae}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?c({type:Ke,key:" "}):c({type:Ve}):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:Fe,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,Ue);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,We),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,$e),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:Le})})),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:Ke,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,qe);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:_e,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}}ze.stateChangeTypes=Ne;var Ye=0,Xe=1,Ge=2,Je=3,Qe=4,Ze=5,et=6,tt=7,nt=8,it=9,ot=10,rt=13,ut=19,st=22,lt=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ye,InputKeyDownArrowUp:Xe,InputKeyDownEscape:Ge,InputKeyDownHome:Je,InputKeyDownEnd:Qe,InputKeyDownPageUp:Ze,InputKeyDownPageDown:et,InputKeyDownEnter:tt,InputChange:nt,InputBlur:it,InputClick:ot,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:rt,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:ut,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:st});function at(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({},Se,{items:g.array.isRequired,isItemDisabled:g.func,inputValue:g.string,defaultInputValue:g.string,initialInputValue:g.string,inputId:g.string,onInputValueChange:g.func});var ct=C,dt=r({},le,{isItemDisabled:function(){return!1}});function pt(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case rt:i={isOpen:ae(u,"isOpen"),highlightedIndex:xe(u),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case Ye: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 Xe: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 tt:i=ve(u,e.highlightedIndex);break;case Ge:i=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ze:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case et:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case Je:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled)};break;case Qe:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case it: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 nt:i={isOpen:!0,highlightedIndex:xe(u),inputValue:t.inputValue};break;case ot:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:pe(u,e,0)};break;case ut:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case st:i={inputValue:t.inputValue};break;default:return Ce(e,t,lt)}return r({},e,i)}var ft=["onMouseLeave","refKey","ref"],ht=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],gt=["onClick","onPress","refKey","ref"],mt=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function It(e){void 0===e&&(e={}),ct();var n=r({},dt,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:st,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[V(s,n),l]}(pt,n,at,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,t.useCallback((function(){S.current.state.isOpen&&d({type:it,selectItem:!1})}),[d,S]),t.useMemo((function(){return[y,m,v]}),[])),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:Ye,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:Xe,altKey:e.altKey})},Home:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Je}))},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:Ge}))},Enter:function(e){S.current.state.isOpen&&229!==e.which&&(e.preventDefault(),d({type:tt}))},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Ze}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:et}))}}}),[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,ft),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,ht);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:rt,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,gt),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,mt),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:nt,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:it,selectItem:!t})}})),y.onClick=M(p,(function(){d({type:ot})})),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:ut,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}}It.stateChangeTypes=lt;var vt={activeIndex:-1,selectedItems:[]};function yt(e,t){return ce(e,t,vt)}function bt(e,t){return ae(e,t,vt)}function xt(e){return{activeIndex:yt(e,"activeIndex"),selectedItems:yt(e,"selectedItems")}}function wt(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 St(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 Ct={itemToKey:le.itemToKey,stateReducer:le.stateReducer,environment:le.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},kt=C,Dt=0,Ot=1,Mt=2,Et=3,Kt=4,Pt=5,Tt=6,Rt=7,Ht=8,Vt=9,Bt=10,At=11,Lt=12,_t=Object.freeze({__proto__:null,SelectedItemClick:Dt,SelectedItemKeyDownDelete:Ot,SelectedItemKeyDownBackspace:Mt,SelectedItemKeyDownNavigationNext:Et,SelectedItemKeyDownNavigationPrevious:Kt,DropdownKeyDownNavigationPrevious:Pt,DropdownKeyDownBackspace:Tt,DropdownClick:Rt,FunctionAddSelectedItem:Ht,FunctionRemoveSelectedItem:Vt,FunctionSetSelectedItems:Bt,FunctionSetActiveIndex:At,FunctionReset:Lt});function Ft(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 Dt:n={activeIndex:o};break;case Kt:n={activeIndex:l-1<0?0:l-1};break;case Et:n={activeIndex:l+1>=a.length?-1:l+1};break;case Mt:case Ot: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 Pt:n={activeIndex:a.length-1};break;case Tt:n={selectedItems:a.slice(0,a.length-1)};break;case Ht:n={selectedItems:[].concat(a,[s])};break;case Rt:n={activeIndex:-1};break;case Vt: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 Bt:n={selectedItems:t.selectedItems};break;case At:n={activeIndex:t.activeIndex};break;case Lt:n={activeIndex:bt(u,"activeIndex"),selectedItems:bt(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}var Nt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],jt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Ut(e){void 0===e&&(e={}),kt();var n=r({},Ct,e),i=n.getA11yStatusMessage,u=n.environment,s=n.keyNavigationNext,l=n.keyNavigationPrevious,a=se(Ft,n,xt,St),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:Kt})},e[s]=function(){d({type:Et})},e.Delete=function(){d({type:Ot})},e.Backspace=function(){d({type:Mt})},e}),[d,s,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){wt(e)&&d({type:Pt})},e.Backspace=function(e){wt(e)&&d({type:Tt})},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,Nt),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:Dt,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,jt),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:Rt})}))},h)}),[d,b,v]),addSelectedItem:t.useCallback((function(e){d({type:Ht,selectedItem:e})}),[d]),removeSelectedItem:t.useCallback((function(e){d({type:Vt,selectedItem:e})}),[d]),setSelectedItems:t.useCallback((function(e){d({type:Bt,selectedItems:e})}),[d]),setActiveIndex:t.useCallback((function(e){d({type:At,activeIndex:e})}),[d]),reset:t.useCallback((function(){d({type:Lt})}),[d]),selectedItems:f,activeIndex:p}}Ut.stateChangeTypes=_t,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=It,e.useMultipleSelection=Ut,e.useSelect=ze,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=function(e){var t=ce(e,"highlightedIndex");if(t>-1&&e.isItemDisabled(e.items[t],t))return-1;return t}(e),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.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 fe(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return C;var t=i.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(i){o.current.isMouseDown=!1,F(i.target,t,e)||n()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(i){o.current.isTouchEnd=!0,o.current.isTouchMove||F(i.target,t,e,!1)||n()}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)}}),[i,e,n]),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}function xe(e){var t=ae(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var we={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},Se=r({},we,{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 Ce(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: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:xe(u),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 ke=function(){return ke=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},ke.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,ke(ke({},Se),{items:g.array.isRequired,isItemDisabled:g.func});var De=ke(ke({},le),{isItemDisabled:function(){return!1}}),Oe=C,Me=1,Ee=2,Ke=3,Pe=4,Te=5,Re=6,He=7,Ve=8,Be=9,Ae=10,Le=11,_e=14,Fe=19,Ne=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:Me,ToggleButtonKeyDownArrowUp:Ee,ToggleButtonKeyDownCharacter:Ke,ToggleButtonKeyDownEscape:Pe,ToggleButtonKeyDownHome:Te,ToggleButtonKeyDownEnd:Re,ToggleButtonKeyDownEnter:He,ToggleButtonKeyDownSpaceButton:Ve,ToggleButtonKeyDownPageUp:Be,ToggleButtonKeyDownPageDown:Ae,ToggleButtonBlur:Le,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:_e,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Fe,FunctionSetInputValue:20,FunctionReset:21});function je(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case _e:i={isOpen:ae(u,"isOpen"),highlightedIndex:xe(u),selectedItem:u.items[t.index]};break;case Ke: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?L(e.highlightedIndex,1,u.items,u.isItemDisabled):s&&null==e.selectedItem?-1:pe(u,e,1),isOpen:!0};break;case Ee: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 He:case Ve:i=ve(u,e.highlightedIndex,!1);break;case Te:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled),isOpen:!0};break;case Re:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled),isOpen:!0};break;case Be:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled)};break;case Ae:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled)};break;case Pe:i={isOpen:!1,highlightedIndex:-1};break;case Le:i=r({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=u.items)?void 0:n.length)&&{selectedItem:u.items[e.highlightedIndex]});break;case Fe:i={selectedItem:t.selectedItem};break;default:return Ce(e,t,Ne)}return r({},e,i)}var Ue=["onClick"],We=["onMouseLeave","refKey","ref"],$e=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],qe=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function ze(e){void 0===e&&(e={}),Oe();var n=r({},De,e),i=n.scrollIntoView,u=n.environment,s=n.getA11yStatusMessage,l=se(je,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,t.useCallback((function(){b.current.state.isOpen&&c({type:Le})}),[c,b]),t.useMemo((function(){return[m,g]}),[])),C=he();t.useEffect((function(){d||(I.current={})}),[d]);var k=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),c({type:Me,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:Ee,altKey:e.altKey})},Home:function(e){e.preventDefault(),c({type:Te})},End:function(e){e.preventDefault(),c({type:Re})},Escape:function(){b.current.state.isOpen&&c({type:Pe})},Enter:function(e){e.preventDefault(),c({type:b.current.state.isOpen?He:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Be}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),c({type:Ae}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?c({type:Ke,key:" "}):c({type:Ve}):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:Fe,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,Ue);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,We),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,$e),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:Le})})),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:Ke,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,qe);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:_e,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}}ze.stateChangeTypes=Ne;var Ye=0,Xe=1,Ge=2,Je=3,Qe=4,Ze=5,et=6,tt=7,nt=8,it=9,ot=10,rt=13,ut=19,st=22,lt=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ye,InputKeyDownArrowUp:Xe,InputKeyDownEscape:Ge,InputKeyDownHome:Je,InputKeyDownEnd:Qe,InputKeyDownPageUp:Ze,InputKeyDownPageDown:et,InputKeyDownEnter:tt,InputChange:nt,InputBlur:it,InputClick:ot,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:rt,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:ut,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:st});function at(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({},Se,{items:g.array.isRequired,isItemDisabled:g.func,inputValue:g.string,defaultInputValue:g.string,initialInputValue:g.string,inputId:g.string,onInputValueChange:g.func});var ct=C,dt=r({},le,{isItemDisabled:function(){return!1}});function pt(e,t){var n,i,o=t.type,u=t.props,s=t.altKey;switch(o){case rt:i={isOpen:ae(u,"isOpen"),highlightedIndex:xe(u),selectedItem:u.items[t.index],inputValue:u.itemToString(u.items[t.index])};break;case Ye: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 Xe: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 tt:i=ve(u,e.highlightedIndex);break;case Ge:i=r({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Ze:i={highlightedIndex:L(e.highlightedIndex,-10,u.items,u.isItemDisabled,!0)};break;case et:i={highlightedIndex:L(e.highlightedIndex,10,u.items,u.isItemDisabled,!0)};break;case Je:i={highlightedIndex:_(0,!1,u.items,u.isItemDisabled)};break;case Qe:i={highlightedIndex:_(u.items.length-1,!0,u.items,u.isItemDisabled)};break;case it: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 nt:i={isOpen:!0,highlightedIndex:xe(u),inputValue:t.inputValue};break;case ot:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:pe(u,e,0)};break;case ut:i={selectedItem:t.selectedItem,inputValue:u.itemToString(t.selectedItem)};break;case st:i={inputValue:t.inputValue};break;default:return Ce(e,t,lt)}return r({},e,i)}var ft=["onMouseLeave","refKey","ref"],ht=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],gt=["onClick","onPress","refKey","ref"],mt=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function It(e){void 0===e&&(e={}),ct();var n=r({},dt,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:st,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[V(s,n),l]}(pt,n,at,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,t.useCallback((function(){S.current.state.isOpen&&d({type:it,selectItem:!1})}),[d,S]),t.useMemo((function(){return[m,y,v]}),[])),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:Ye,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:Xe,altKey:e.altKey})},Home:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Je}))},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:Ge}))},Enter:function(e){S.current.state.isOpen&&229!==e.which&&(e.preventDefault(),d({type:tt}))},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:Ze}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),d({type:et}))}}}),[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,ft),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,ht);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:rt,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,gt),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,mt),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:nt,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:it,selectItem:!t})}})),y.onClick=M(p,(function(){d({type:ot})})),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:ut,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}}It.stateChangeTypes=lt;var vt={activeIndex:-1,selectedItems:[]};function yt(e,t){return ce(e,t,vt)}function bt(e,t){return ae(e,t,vt)}function xt(e){return{activeIndex:yt(e,"activeIndex"),selectedItems:yt(e,"selectedItems")}}function wt(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 St(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 Ct={itemToKey:le.itemToKey,stateReducer:le.stateReducer,environment:le.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},kt=C,Dt=0,Ot=1,Mt=2,Et=3,Kt=4,Pt=5,Tt=6,Rt=7,Ht=8,Vt=9,Bt=10,At=11,Lt=12,_t=Object.freeze({__proto__:null,SelectedItemClick:Dt,SelectedItemKeyDownDelete:Ot,SelectedItemKeyDownBackspace:Mt,SelectedItemKeyDownNavigationNext:Et,SelectedItemKeyDownNavigationPrevious:Kt,DropdownKeyDownNavigationPrevious:Pt,DropdownKeyDownBackspace:Tt,DropdownClick:Rt,FunctionAddSelectedItem:Ht,FunctionRemoveSelectedItem:Vt,FunctionSetSelectedItems:Bt,FunctionSetActiveIndex:At,FunctionReset:Lt});function Ft(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 Dt:n={activeIndex:o};break;case Kt:n={activeIndex:l-1<0?0:l-1};break;case Et:n={activeIndex:l+1>=a.length?-1:l+1};break;case Mt:case Ot: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 Pt:n={activeIndex:a.length-1};break;case Tt:n={selectedItems:a.slice(0,a.length-1)};break;case Ht:n={selectedItems:[].concat(a,[s])};break;case Rt:n={activeIndex:-1};break;case Vt: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 Bt:n={selectedItems:t.selectedItems};break;case At:n={activeIndex:t.activeIndex};break;case Lt:n={activeIndex:bt(u,"activeIndex"),selectedItems:bt(u,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return r({},e,n)}var Nt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],jt=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Ut(e){void 0===e&&(e={}),kt();var n=r({},Ct,e),i=n.getA11yStatusMessage,u=n.environment,s=n.keyNavigationNext,l=n.keyNavigationPrevious,a=se(Ft,n,xt,St),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:Kt})},e[s]=function(){d({type:Et})},e.Delete=function(){d({type:Ot})},e.Backspace=function(){d({type:Mt})},e}),[d,s,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){wt(e)&&d({type:Pt})},e.Backspace=function(e){wt(e)&&d({type:Tt})},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,Nt),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:Dt,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,jt),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:Rt})}))},h)}),[d,b,v]),addSelectedItem:t.useCallback((function(e){d({type:Ht,selectedItem:e})}),[d]),removeSelectedItem:t.useCallback((function(e){d({type:Vt,selectedItem:e})}),[d]),setSelectedItems:t.useCallback((function(e){d({type:Bt,selectedItems:e})}),[d]),setActiveIndex:t.useCallback((function(e){d({type:At,activeIndex:e})}),[d]),reset:t.useCallback((function(){d({type:Lt})}),[d]),selectedItems:f,activeIndex:p}}Ut.stateChangeTypes=_t,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=It,e.useMultipleSelection=Ut,e.useSelect=ze,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=downshift.umd.min.js.map

@@ -20,6 +20,6 @@ export let useControlPropsValidator: typeof noop;

* @param {() => void} handleBlur The function that is called if mouseDown or touchEnd occured outside the downshiftElements.
* @param {Array<{current: HTMLElement}>} downshiftElementRefs The refs for the element that should not trigger a blur action from mouseDown or touchEnd.
* @param {Array<{current: HTMLElement}>} downshiftElementsRefs The refs for the elements that should not trigger a blur action from mouseDown or touchEnd.
* @returns {{isMouseDown: boolean, isTouchMove: boolean, isTouchEnd: boolean}} The mouse and touch events information, if any of are happening.
*/
export function useMouseAndTouchTracker(environment: Window, handleBlur: () => void, downshiftElementRefs: Array<{
export function useMouseAndTouchTracker(environment: Window, handleBlur: () => void, downshiftElementsRefs: Array<{
current: HTMLElement;

@@ -26,0 +26,0 @@ }>): {

{
"name": "downshift",
"version": "9.0.7-alpha.1",
"version": "9.0.7-alpha.2",
"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",

@@ -10,3 +10,3 @@ !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={};

* LICENSE file in the root directory of this source tree.
*/!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:D,right:k,bottom:O,left:M}=e.getBoundingClientRect();let E="start"===s||"nearest"===s?D:"end"===s?O:D+S/2,K="center"===l?M+C/2:"end"===l?k: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&&D>=0&&M>=0&&O<=b&&k<=y&&D>=o&&O<=a&&M>=d&&k<=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 D(){return String(I++)}function k(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-"+D(),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:k,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-"+D():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=function(e){var t=re(e,"highlightedIndex");if(t>-1&&e.isItemDisabled(e.items[t],t))return-1;return t}(e),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.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 le(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return y;var t=i.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(i){o.current.isMouseDown=!1,V(i.target,t,e)||n()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(i){o.current.isTouchEnd=!0,o.current.isTouchMove||V(i.target,t,e,!1)||n()}return e.addEventListener("mousedown",r),e.addEventListener("mouseup",u),e.addEventListener("touchstart",s),e.addEventListener("touchmove",l),e.addEventListener("touchend",a),console.log("adds events",i),function(){e.removeEventListener("mousedown",r),e.removeEventListener("mouseup",u),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",l),e.removeEventListener("touchend",a),console.log("cleans up events",i)}}),[e,n,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}function me(e){var t=oe(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var Ie={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},ve=s({},Ie,{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 ye(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:r.isItemDisabled(r.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:me(r),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 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:r.default.array.isRequired,isItemDisabled:r.default.func});var xe=be(be({},ie),{isItemDisabled:function(){return!1}}),we=y,Se=1,Ce=2,De=3,ke=4,Oe=5,Me=6,Ee=7,Ke=8,Pe=9,Te=10,He=11,Re=14,Ve=19,Be=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:Se,ToggleButtonKeyDownArrowUp:Ce,ToggleButtonKeyDownCharacter:De,ToggleButtonKeyDownEscape:ke,ToggleButtonKeyDownHome:Oe,ToggleButtonKeyDownEnd:Me,ToggleButtonKeyDownEnter:Ee,ToggleButtonKeyDownSpaceButton:Ke,ToggleButtonKeyDownPageUp:Pe,ToggleButtonKeyDownPageDown:Te,ToggleButtonBlur:He,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Re,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Ve,FunctionSetInputValue:20,FunctionReset:21});function Ae(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Re:i={isOpen:oe(r,"isOpen"),highlightedIndex:me(r),selectedItem:r.items[t.index]};break;case De: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 Se: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 Ce: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 Ee:case Ke:i=fe(r,e.highlightedIndex,!1);break;case Oe:i={highlightedIndex:R(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case Me:i={highlightedIndex:R(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case Pe:i={highlightedIndex:H(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case Te:i={highlightedIndex:H(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case ke:i={isOpen:!1,highlightedIndex:-1};break;case He:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case Ve:i={selectedItem:t.selectedItem};break;default:return ye(e,t,Be)}return s({},e,i)}var Le=["onClick"],Fe=["onMouseLeave","refKey","ref"],_e=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Ne=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function je(e){void 0===e&&(e={}),we();var n=s({},xe,e),i=n.scrollIntoView,o=n.environment,r=n.getA11yStatusMessage,l=ne(Ae,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 D=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 k=le(o,t.useCallback((function(){b.current.state.isOpen&&d({type:He})}),[d,b]),t.useMemo((function(){return[g,m]}),[])),O=ae();t.useEffect((function(){c||(I.current={})}),[c]);var M=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:Se,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:Ce,altKey:e.altKey})},Home:function(e){e.preventDefault(),d({type:Oe})},End:function(e){e.preventDefault(),d({type:Me})},Escape:function(){b.current.state.isOpen&&d({type:ke})},Enter:function(e){e.preventDefault(),d({type:b.current.state.isOpen?Ee:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Pe}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Te}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?d({type:De,key:" "}):d({type:Ke}):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:Ve,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,Le);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,Fe),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,_e),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&&!k.isMouseDown&&d({type:He})})),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:De,key:t})}))),O("getToggleButtonProps",m,c,g),v}),[d,y,b,k,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,Ne);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:Re,index:M})}))),K.onMouseMove=S(r,(function(){k.isTouchEnd||M===v.highlightedIndex||(D.current=!1,d({type:13,index:M,disabled:E}))})),K.onMouseDown=S(a,(function(e){return e.preventDefault()})),K}),[b,y,k,D,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}}je.stateChangeTypes=Be;var Ue=0,$e=1,We=2,qe=3,ze=4,Xe=5,Ye=6,Ge=7,Je=8,Qe=9,Ze=10,et=13,tt=19,nt=22,it=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ue,InputKeyDownArrowUp:$e,InputKeyDownEscape:We,InputKeyDownHome:qe,InputKeyDownEnd:ze,InputKeyDownPageUp:Xe,InputKeyDownPageDown:Ye,InputKeyDownEnter:Ge,InputChange:Je,InputBlur:Qe,InputClick:Ze,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:et,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:tt,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:nt});function ot(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({},ve,{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 rt=y,ut=s({},ie,{isItemDisabled:function(){return!1}});function st(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case et:i={isOpen:oe(r,"isOpen"),highlightedIndex:me(r),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case Ue: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 $e: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 Ge:i=fe(r,e.highlightedIndex);break;case We:i=s({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Xe:i={highlightedIndex:H(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case Ye:i={highlightedIndex:H(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case qe:i={highlightedIndex:R(0,!1,r.items,r.isItemDisabled)};break;case ze:i={highlightedIndex:R(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Qe: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 Je:i={isOpen:!0,highlightedIndex:me(r),inputValue:t.inputValue};break;case Ze:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:se(r,e,0)};break;case tt:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case nt:i={inputValue:t.inputValue};break;default:return ye(e,t,it)}return s({},e,i)}var lt=["onMouseLeave","refKey","ref"],at=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],dt=["onClick","onPress","refKey","ref"],ct=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function pt(e){void 0===e&&(e={}),rt();var n=s({},ut,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:nt,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[K(s,n),l]}(st,n,ot,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(),D=ee({state:d,props:n}),k=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:k});pe(),t.useEffect((function(){re(n,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){b||(w.current=i.length)}));var M=le(r,t.useCallback((function(){D.current.state.isOpen&&c({type:Qe,selectItem:!1})}),[c,D]),t.useMemo((function(){return[y,m,v]}),[])),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:Ue,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:$e,altKey:e.altKey})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),c({type:qe}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),c({type:ze}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:We}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),c({type:Ge}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),c({type:Xe}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),c({type:Ye}))}}}),[c,D]),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,lt),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,at);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,y=v.props,b=v.state,w=Q(o,r,y.items,"Pass either item or index to getItemProps!"),k=w[0],E=w[1],K=y.isItemDisabled(k,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:et,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,D,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,dt),d=D.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,D,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,ct),I=(void 0===t?{}:t).suppressRefError;E("getInputProps",void 0!==I&&I,h,v);var y,b=D.current.state,w={};m.disabled||((y={}).onInput=S(l,a,(function(e){c({type:Je,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:Qe,selectItem:!t})}})),y.onClick=S(p,(function(){c({type:Ze})})),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,D,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:tt,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}}pt.stateChangeTypes=it;var ft={activeIndex:-1,selectedItems:[]};function ht(e,t){return re(e,t,ft)}function gt(e,t){return oe(e,t,ft)}function mt(e){return{activeIndex:ht(e,"activeIndex"),selectedItems:ht(e,"selectedItems")}}function It(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 vt(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 yt={itemToKey:ie.itemToKey,stateReducer:ie.stateReducer,environment:ie.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},bt=y,xt=0,wt=1,St=2,Ct=3,Dt=4,kt=5,Ot=6,Mt=7,Et=8,Kt=9,Pt=10,Tt=11,Ht=12,Rt=Object.freeze({__proto__:null,SelectedItemClick:xt,SelectedItemKeyDownDelete:wt,SelectedItemKeyDownBackspace:St,SelectedItemKeyDownNavigationNext:Ct,SelectedItemKeyDownNavigationPrevious:Dt,DropdownKeyDownNavigationPrevious:kt,DropdownKeyDownBackspace:Ot,DropdownClick:Mt,FunctionAddSelectedItem:Et,FunctionRemoveSelectedItem:Kt,FunctionSetSelectedItems:Pt,FunctionSetActiveIndex:Tt,FunctionReset:Ht});function Vt(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 xt:n={activeIndex:o};break;case Dt:n={activeIndex:l-1<0?0:l-1};break;case Ct:n={activeIndex:l+1>=a.length?-1:l+1};break;case St:case wt: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 Ot:n={selectedItems:a.slice(0,a.length-1)};break;case Et:n={selectedItems:[].concat(a,[u])};break;case Mt:n={activeIndex:-1};break;case Kt: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 Pt:n={selectedItems:t.selectedItems};break;case Tt:n={activeIndex:t.activeIndex};break;case Ht:n={activeIndex:gt(r,"activeIndex"),selectedItems:gt(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,n)}var Bt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],At=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Lt(e){void 0===e&&(e={}),bt();var n=s({},yt,e),i=n.getA11yStatusMessage,o=n.environment,r=n.keyNavigationNext,l=n.keyNavigationPrevious,a=ne(Vt,n,mt,vt),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:Dt})},e[r]=function(){c({type:Ct})},e.Delete=function(){c({type:wt})},e.Backspace=function(){c({type:St})},e}),[c,r,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){It(e)&&c({type:kt})},e.Backspace=function(e){It(e)&&c({type:Ot})},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,Bt),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:xt,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,At),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:Mt})}))},h)}),[c,b,v]),addSelectedItem:t.useCallback((function(e){c({type:Et,selectedItem:e})}),[c]),removeSelectedItem:t.useCallback((function(e){c({type:Kt,selectedItem:e})}),[c]),setSelectedItems:t.useCallback((function(e){c({type:Pt,selectedItems:e})}),[c]),setActiveIndex:t.useCallback((function(e){c({type:Tt,activeIndex:e})}),[c]),reset:t.useCallback((function(){c({type:Ht})}),[c]),selectedItems:f,activeIndex:p}}Lt.stateChangeTypes=Rt,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=pt,e.useMultipleSelection=Lt,e.useSelect=je,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:D,right:k,bottom:O,left:M}=e.getBoundingClientRect();let E="start"===s||"nearest"===s?D:"end"===s?O:D+S/2,K="center"===l?M+C/2:"end"===l?k: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&&D>=0&&M>=0&&O<=b&&k<=y&&D>=o&&O<=a&&M>=d&&k<=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 D(){return String(I++)}function k(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-"+D(),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:k,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-"+D():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=function(e){var t=re(e,"highlightedIndex");if(t>-1&&e.isItemDisabled(e.items[t],t))return-1;return t}(e),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.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 le(e,n,i){var o=t.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return t.useEffect((function(){if(!e)return y;var t=i.map((function(e){return e.current}));function r(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function u(i){o.current.isMouseDown=!1,V(i.target,t,e)||n()}function s(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function l(){o.current.isTouchMove=!0}function a(i){o.current.isTouchEnd=!0,o.current.isTouchMove||V(i.target,t,e,!1)||n()}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)}}),[i,e,n]),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}function me(e){var t=oe(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var Ie={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},ve=s({},Ie,{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 ye(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:r.isItemDisabled(r.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case n.FunctionSetInputValue:i={inputValue:t.inputValue};break;case n.FunctionReset:i={highlightedIndex:me(r),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 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:r.default.array.isRequired,isItemDisabled:r.default.func});var xe=be(be({},ie),{isItemDisabled:function(){return!1}}),we=y,Se=1,Ce=2,De=3,ke=4,Oe=5,Me=6,Ee=7,Ke=8,Pe=9,Te=10,He=11,Re=14,Ve=19,Be=Object.freeze({__proto__:null,ToggleButtonClick:0,ToggleButtonKeyDownArrowDown:Se,ToggleButtonKeyDownArrowUp:Ce,ToggleButtonKeyDownCharacter:De,ToggleButtonKeyDownEscape:ke,ToggleButtonKeyDownHome:Oe,ToggleButtonKeyDownEnd:Me,ToggleButtonKeyDownEnter:Ee,ToggleButtonKeyDownSpaceButton:Ke,ToggleButtonKeyDownPageUp:Pe,ToggleButtonKeyDownPageDown:Te,ToggleButtonBlur:He,MenuMouseLeave:12,ItemMouseMove:13,ItemClick:Re,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:Ve,FunctionSetInputValue:20,FunctionReset:21});function Ae(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case Re:i={isOpen:oe(r,"isOpen"),highlightedIndex:me(r),selectedItem:r.items[t.index]};break;case De: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 Se: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 Ce: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 Ee:case Ke:i=fe(r,e.highlightedIndex,!1);break;case Oe:i={highlightedIndex:R(0,!1,r.items,r.isItemDisabled),isOpen:!0};break;case Me:i={highlightedIndex:R(r.items.length-1,!0,r.items,r.isItemDisabled),isOpen:!0};break;case Pe:i={highlightedIndex:H(e.highlightedIndex,-10,r.items,r.isItemDisabled)};break;case Te:i={highlightedIndex:H(e.highlightedIndex,10,r.items,r.isItemDisabled)};break;case ke:i={isOpen:!1,highlightedIndex:-1};break;case He:i=s({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&(null==(n=r.items)?void 0:n.length)&&{selectedItem:r.items[e.highlightedIndex]});break;case Ve:i={selectedItem:t.selectedItem};break;default:return ye(e,t,Be)}return s({},e,i)}var Le=["onClick"],Fe=["onMouseLeave","refKey","ref"],_e=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],Ne=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function je(e){void 0===e&&(e={}),we();var n=s({},xe,e),i=n.scrollIntoView,o=n.environment,r=n.getA11yStatusMessage,l=ne(Ae,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 D=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 k=le(o,t.useCallback((function(){b.current.state.isOpen&&d({type:He})}),[d,b]),t.useMemo((function(){return[m,g]}),[])),O=ae();t.useEffect((function(){c||(I.current={})}),[c]);var M=t.useMemo((function(){return{ArrowDown:function(e){e.preventDefault(),d({type:Se,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),d({type:Ce,altKey:e.altKey})},Home:function(e){e.preventDefault(),d({type:Oe})},End:function(e){e.preventDefault(),d({type:Me})},Escape:function(){b.current.state.isOpen&&d({type:ke})},Enter:function(e){e.preventDefault(),d({type:b.current.state.isOpen?Ee:0})},PageUp:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Pe}))},PageDown:function(e){b.current.state.isOpen&&(e.preventDefault(),d({type:Te}))}," ":function(e){e.preventDefault();var t=b.current.state;t.isOpen?t.inputValue?d({type:De,key:" "}):d({type:Ke}):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:Ve,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,Le);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,Fe),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,_e),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&&!k.isMouseDown&&d({type:He})})),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:De,key:t})}))),O("getToggleButtonProps",m,c,g),v}),[d,y,b,k,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,Ne);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:Re,index:M})}))),K.onMouseMove=S(r,(function(){k.isTouchEnd||M===v.highlightedIndex||(D.current=!1,d({type:13,index:M,disabled:E}))})),K.onMouseDown=S(a,(function(e){return e.preventDefault()})),K}),[b,y,k,D,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}}je.stateChangeTypes=Be;var Ue=0,$e=1,We=2,qe=3,ze=4,Xe=5,Ye=6,Ge=7,Je=8,Qe=9,Ze=10,et=13,tt=19,nt=22,it=Object.freeze({__proto__:null,InputKeyDownArrowDown:Ue,InputKeyDownArrowUp:$e,InputKeyDownEscape:We,InputKeyDownHome:qe,InputKeyDownEnd:ze,InputKeyDownPageUp:Xe,InputKeyDownPageDown:Ye,InputKeyDownEnter:Ge,InputChange:Je,InputBlur:Qe,InputClick:Ze,MenuMouseLeave:11,ItemMouseMove:12,ItemClick:et,ToggleButtonClick:14,FunctionToggleMenu:15,FunctionOpenMenu:16,FunctionCloseMenu:17,FunctionSetHighlightedIndex:18,FunctionSelectItem:tt,FunctionSetInputValue:20,FunctionReset:21,ControlledPropUpdatedSelectedItem:nt});function ot(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({},ve,{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 rt=y,ut=s({},ie,{isItemDisabled:function(){return!1}});function st(e,t){var n,i,o=t.type,r=t.props,u=t.altKey;switch(o){case et:i={isOpen:oe(r,"isOpen"),highlightedIndex:me(r),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case Ue: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 $e: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 Ge:i=fe(r,e.highlightedIndex);break;case We:i=s({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case Xe:i={highlightedIndex:H(e.highlightedIndex,-10,r.items,r.isItemDisabled,!0)};break;case Ye:i={highlightedIndex:H(e.highlightedIndex,10,r.items,r.isItemDisabled,!0)};break;case qe:i={highlightedIndex:R(0,!1,r.items,r.isItemDisabled)};break;case ze:i={highlightedIndex:R(r.items.length-1,!0,r.items,r.isItemDisabled)};break;case Qe: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 Je:i={isOpen:!0,highlightedIndex:me(r),inputValue:t.inputValue};break;case Ze:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:se(r,e,0)};break;case tt:i={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case nt:i={inputValue:t.inputValue};break;default:return ye(e,t,it)}return s({},e,i)}var lt=["onMouseLeave","refKey","ref"],at=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],dt=["onClick","onPress","refKey","ref"],ct=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];function pt(e){void 0===e&&(e={}),rt();var n=s({},ut,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:nt,inputValue:n.itemToString(n.selectedItem)}),r.current=s.selectedItem===r.current?n.selectedItem:s.selectedItem)}),[s.selectedItem,n.selectedItem]),[K(s,n),l]}(st,n,ot,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(),D=ee({state:d,props:n}),k=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:k});pe(),t.useEffect((function(){re(n,"isOpen")&&v.current&&v.current.focus()}),[]),t.useEffect((function(){b||(w.current=i.length)}));var M=le(r,t.useCallback((function(){D.current.state.isOpen&&c({type:Qe,selectItem:!1})}),[c,D]),t.useMemo((function(){return[m,y,v]}),[])),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:Ue,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),c({type:$e,altKey:e.altKey})},Home:function(e){D.current.state.isOpen&&(e.preventDefault(),c({type:qe}))},End:function(e){D.current.state.isOpen&&(e.preventDefault(),c({type:ze}))},Escape:function(e){var t=D.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),c({type:We}))},Enter:function(e){D.current.state.isOpen&&229!==e.which&&(e.preventDefault(),c({type:Ge}))},PageUp:function(e){D.current.state.isOpen&&(e.preventDefault(),c({type:Xe}))},PageDown:function(e){D.current.state.isOpen&&(e.preventDefault(),c({type:Ye}))}}}),[c,D]),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,lt),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,at);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,y=v.props,b=v.state,w=Q(o,r,y.items,"Pass either item or index to getItemProps!"),k=w[0],E=w[1],K=y.isItemDisabled(k,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:et,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,D,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,dt),d=D.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,D,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,ct),I=(void 0===t?{}:t).suppressRefError;E("getInputProps",void 0!==I&&I,h,v);var y,b=D.current.state,w={};m.disabled||((y={}).onInput=S(l,a,(function(e){c({type:Je,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:Qe,selectItem:!t})}})),y.onClick=S(p,(function(){c({type:Ze})})),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,D,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:tt,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}}pt.stateChangeTypes=it;var ft={activeIndex:-1,selectedItems:[]};function ht(e,t){return re(e,t,ft)}function gt(e,t){return oe(e,t,ft)}function mt(e){return{activeIndex:ht(e,"activeIndex"),selectedItems:ht(e,"selectedItems")}}function It(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 vt(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 yt={itemToKey:ie.itemToKey,stateReducer:ie.stateReducer,environment:ie.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},bt=y,xt=0,wt=1,St=2,Ct=3,Dt=4,kt=5,Ot=6,Mt=7,Et=8,Kt=9,Pt=10,Tt=11,Ht=12,Rt=Object.freeze({__proto__:null,SelectedItemClick:xt,SelectedItemKeyDownDelete:wt,SelectedItemKeyDownBackspace:St,SelectedItemKeyDownNavigationNext:Ct,SelectedItemKeyDownNavigationPrevious:Dt,DropdownKeyDownNavigationPrevious:kt,DropdownKeyDownBackspace:Ot,DropdownClick:Mt,FunctionAddSelectedItem:Et,FunctionRemoveSelectedItem:Kt,FunctionSetSelectedItems:Pt,FunctionSetActiveIndex:Tt,FunctionReset:Ht});function Vt(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 xt:n={activeIndex:o};break;case Dt:n={activeIndex:l-1<0?0:l-1};break;case Ct:n={activeIndex:l+1>=a.length?-1:l+1};break;case St:case wt: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 Ot:n={selectedItems:a.slice(0,a.length-1)};break;case Et:n={selectedItems:[].concat(a,[u])};break;case Mt:n={activeIndex:-1};break;case Kt: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 Pt:n={selectedItems:t.selectedItems};break;case Tt:n={activeIndex:t.activeIndex};break;case Ht:n={activeIndex:gt(r,"activeIndex"),selectedItems:gt(r,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return s({},e,n)}var Bt=["refKey","ref","onClick","onKeyDown","selectedItem","index"],At=["refKey","ref","onKeyDown","onClick","preventKeyAction"];function Lt(e){void 0===e&&(e={}),bt();var n=s({},yt,e),i=n.getA11yStatusMessage,o=n.environment,r=n.keyNavigationNext,l=n.keyNavigationPrevious,a=ne(Vt,n,mt,vt),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:Dt})},e[r]=function(){c({type:Ct})},e.Delete=function(){c({type:wt})},e.Backspace=function(){c({type:St})},e}),[c,r,l]),b=t.useMemo((function(){var e;return(e={})[l]=function(e){It(e)&&c({type:kt})},e.Backspace=function(e){It(e)&&c({type:Ot})},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,Bt),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:xt,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,At),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:Mt})}))},h)}),[c,b,v]),addSelectedItem:t.useCallback((function(e){c({type:Et,selectedItem:e})}),[c]),removeSelectedItem:t.useCallback((function(e){c({type:Kt,selectedItem:e})}),[c]),setSelectedItems:t.useCallback((function(e){c({type:Pt,selectedItems:e})}),[c]),setActiveIndex:t.useCallback((function(e){c({type:Tt,activeIndex:e})}),[c]),reset:t.useCallback((function(){c({type:Ht})}),[c]),selectedItems:f,activeIndex:p}}Lt.stateChangeTypes=Rt,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=pt,e.useMultipleSelection=Lt,e.useSelect=je,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