forked from bombastictranz/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
7254-e88c2241cbd8f9b3.js.download
1 lines (1 loc) · 24.1 KB
/
7254-e88c2241cbd8f9b3.js.download
1
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7254],{35080:function(o,a,l){l.d(a,{A:function(){return FloatingMenu}});var s=l(15504),u=l(3e3),d=l(99029),p=l(39479),c=l(52676),h=l(77293),g=l(28165);let f=(0,p.B)("FloatingMenu",{list:({visibleItems:o})=>[{maxHeight:((o||0)+.5)*40+10,overflow:"auto",padding:10}],menuItem:({isDisabled:o,isHighlighted:a})=>[Object.assign(Object.assign({},u.ZT.paragraph3Medium),{alignItems:"center",borderRadius:3,cursor:"pointer",display:"flex",height:40,padding:"0 10px",color:d.w.neutral700}),o&&(0,c.Q)("disabled",Object.assign(Object.assign({},u.ZT.paragraph3Medium),{color:d.w.neutral500})),a&&(0,c.Q)("enabled-highlighted",Object.assign(Object.assign({},u.ZT.paragraph3Medium),{backgroundColor:d.w.blue10,color:d.w.blue}))],menuItemIcon:(0,g.iv)({display:"flex",alignItems:"center",justifyContent:"center",marginRight:10}),menuItemText:(0,g.iv)({flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})}),FloatingMenu=o=>{let a=Object.assign({align:"stretch",visibleItems:4},o),{align:l,ariaLabel:u,getItemProps:d,getKeyForItem:p,getLabelForItem:c,getMenuProps:g,highlightedIndex:m,items:v,maxWidth:I,minWidth:y}=a;return(0,h.U)(s.f,{align:l,maxWidth:I,minWidth:y},(0,h.U)("ul",Object.assign({css:f.list(a)},g({"aria-label":u})),v.map((o,l)=>(0,h.U)("li",Object.assign({},d({item:o,disabled:o.disabled}),{css:f.menuItem({isDisabled:o.disabled,isHighlighted:m===l}),key:p?p(o):l}),a.renderIcon&&(0,h.U)("span",{css:f.menuItemIcon},a.renderIcon(o,a.getLabelForItem)),(0,h.U)("span",{css:f.menuItemText},c(o))))))}},95945:function(o,a,l){l.d(a,{j:function(){return camelCaseAriaAttrs},v:function(){return kebabCaseAriaAttrs}});var s=l(93594);let u={"aria-activedescendant":"ariaActiveDescendant","aria-atomic":"ariaAtomic","aria-autocomplete":"ariaAutoComplete","aria-busy":"ariaBusy","aria-checked":"ariaChecked","aria-colcount":"ariaColCount","aria-colindex":"ariaColIndex","aria-colspan":"ariaColSpan","aria-controls":"ariaControls","aria-current":"ariaCurrent","aria-describedby":"ariaDescribedBy","aria-details":"ariaDetails","aria-disabled":"ariaDisabled","aria-dropeffect":"ariaDropEffect","aria-errormessage":"ariaErrorMessage","aria-expanded":"ariaExpanded","aria-flowto":"ariaFlowTo","aria-grabbed":"ariaGrabbed","aria-haspopup":"ariaHasPopup","aria-hidden":"ariaHidden","aria-invalid":"ariaInvalid","aria-keyshortcuts":"ariaKeyShortcuts","aria-label":"ariaLabel","aria-labelledby":"ariaLabelledBy","aria-level":"ariaLevel","aria-live":"ariaLive","aria-modal":"ariaModal","aria-multiline":"ariaMultiline","aria-multiselectable":"ariaMultiselectable","aria-orientation":"ariaOrientation","aria-owns":"ariaOwns","aria-placeholder":"ariaPlaceholder","aria-posinset":"ariaPosInset","aria-pressed":"ariaPressed","aria-readonly":"ariaReadOnly","aria-relevant":"ariaRelevant","aria-required":"ariaRequired","aria-roledescription":"ariaRoleDescription","aria-rowcount":"ariaRowCount","aria-rowindex":"ariaRowIndex","aria-rowspan":"ariaRowSpan","aria-selected":"ariaSelected","aria-setsize":"ariaSetSize","aria-sort":"ariaSort","aria-valuemax":"ariaValueMax","aria-valuemin":"ariaValueMin","aria-valuenow":"ariaValueNow","aria-valuetext":"ariaValueText"},d=(0,s.s)(Object.entries(u).map(([o,a])=>[a,o])),camelCaseAriaAttrs=o=>(0,s.s)(Object.entries(o).map(([o,a])=>[u[o]||o,a])),kebabCaseAriaAttrs=o=>(0,s.s)(Object.entries(o).map(([o,a])=>[d[o]||o,a]))},45897:function(o,a,l){l.d(a,{ZP:function(){return x}});var s,u=l(31461),d=l(7896),p=l(80753),c=l(81665),h=l(13980),g=l.n(h),f=l(2784);function t(o){return"object"==typeof o&&null!=o&&1===o.nodeType}function e(o,a){return(!a||"hidden"!==o)&&"visible"!==o&&"clip"!==o}function n(o,a){if(o.clientHeight<o.scrollHeight||o.clientWidth<o.scrollWidth){var l,s=getComputedStyle(o,null);return e(s.overflowY,a)||e(s.overflowX,a)||!!(l=function(o){if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch(o){return null}}(o))&&(l.clientHeight<o.scrollHeight||l.clientWidth<o.scrollWidth)}return!1}function r(o,a,l,s,u,d,p,c){return d<o&&p>a||d>o&&p<a?0:d<=o&&c<=l||p>=a&&c>=l?d-o-s:p>a&&c<l||d<o&&c>l?p-a+u:0}l(48570);var i=function(o,a){var l=window,s=a.scrollMode,u=a.block,d=a.inline,p=a.boundary,c=a.skipOverflowHiddenElements,h="function"==typeof p?p:function(o){return o!==p};if(!t(o))throw TypeError("Invalid target");for(var g,f,m=document.scrollingElement||document.documentElement,v=[],I=o;t(I)&&h(I);){if((I=null==(f=(g=I).parentElement)?g.getRootNode().host||null:f)===m){v.push(I);break}null!=I&&I===document.body&&n(I)&&!n(document.documentElement)||null!=I&&n(I,c)&&v.push(I)}for(var y=l.visualViewport?l.visualViewport.width:innerWidth,b=l.visualViewport?l.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,S=window.scrollY||pageYOffset,x=o.getBoundingClientRect(),C=x.height,H=x.width,O=x.top,E=x.right,D=x.bottom,M=x.left,A="start"===u||"nearest"===u?O:"end"===u?D:O+C/2,P="center"===d?M+H/2:"end"===d?E:M,T=[],k=0;k<v.length;k++){var R=v[k],V=R.getBoundingClientRect(),K=V.height,W=V.width,L=V.top,B=V.right,Z=V.bottom,N=V.left;if("if-needed"===s&&O>=0&&M>=0&&D<=b&&E<=y&&O>=L&&D<=Z&&M>=N&&E<=B)break;var U=getComputedStyle(R),j=parseInt(U.borderLeftWidth,10),_=parseInt(U.borderTopWidth,10),F=parseInt(U.borderRightWidth,10),z=parseInt(U.borderBottomWidth,10),q=0,X=0,Y="offsetWidth"in R?R.offsetWidth-R.clientWidth-j-F:0,Q="offsetHeight"in R?R.offsetHeight-R.clientHeight-_-z:0,$="offsetWidth"in R?0===R.offsetWidth?0:W/R.offsetWidth:0,G="offsetHeight"in R?0===R.offsetHeight?0:K/R.offsetHeight:0;if(m===R)q="start"===u?A:"end"===u?A-b:"nearest"===u?r(S,S+b,b,_,z,S+A,S+A+C,C):A-b/2,X="start"===d?P:"center"===d?P-y/2:"end"===d?P-y:r(w,w+y,y,j,F,w+P,w+P+H,H),q=Math.max(0,q+S),X=Math.max(0,X+w);else{q="start"===u?A-L-_:"end"===u?A-Z+z+Q:"nearest"===u?r(L,Z,K,_,z+Q,A,A+C,C):A-(L+K/2)+Q/2,X="start"===d?P-N-j:"center"===d?P-(N+W/2)+Y/2:"end"===d?P-B+F+Y:r(N,B,W,j,F+Y,P,P+H,H);var J=R.scrollLeft,ee=R.scrollTop;A+=ee-(q=Math.max(0,Math.min(ee+q/G,R.scrollHeight-K/G+Q))),P+=J-(X=Math.max(0,Math.min(J+X/$,R.scrollWidth-W/$+Y)))}T.push({el:R,top:q,left:X})}return T},m=0;function cbToCb(o){return"function"==typeof o?o:noop}function noop(){}function scrollIntoView(o,a){null!==o&&i(o,{boundary:a,block:"nearest",scrollMode:"if-needed"}).forEach(function(o){var a=o.el,l=o.top,s=o.left;a.scrollTop=l,a.scrollLeft=s})}function isOrContainsNode(o,a){return o===a||o.contains&&o.contains(a)}function debounce(o,a){var l;function cancel(){l&&clearTimeout(l)}function wrapper(){for(var s=arguments.length,u=Array(s),d=0;d<s;d++)u[d]=arguments[d];cancel(),l=setTimeout(function(){l=null,o.apply(void 0,u)},a)}return wrapper.cancel=cancel,wrapper}function callAllEventHandlers(){for(var o=arguments.length,a=Array(o),l=0;l<o;l++)a[l]=arguments[l];return function(o){for(var l=arguments.length,s=Array(l>1?l-1:0),u=1;u<l;u++)s[u-1]=arguments[u];return a.some(function(a){return a&&a.apply(void 0,[o].concat(s)),o.preventDownshiftDefault||o.hasOwnProperty("nativeEvent")&&o.nativeEvent.preventDownshiftDefault})}}function handleRefs(){for(var o=arguments.length,a=Array(o),l=0;l<o;l++)a[l]=arguments[l];return function(o){a.forEach(function(a){"function"==typeof a?a(o):a&&(a.current=o)})}}function unwrapArray(o,a){return(o=Array.isArray(o)?o[0]:o)||!a?o:a}var v=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function pickState(o){void 0===o&&(o={});var a={};return v.forEach(function(l){o.hasOwnProperty(l)&&(a[l]=o[l])}),a}function normalizeArrowKey(o){var a=o.key,l=o.keyCode;return l>=37&&l<=40&&0!==a.indexOf("Arrow")?"Arrow"+a:a}function getNextWrappingIndex(o,a,l){var s=l-1;("number"!=typeof a||a<0||a>=l)&&(a=o>0?-1:s+1);var u=a+o;return u<0?u=s:u>s&&(u=0),u}var I=debounce(function(){getStatusDiv().textContent=""},500);function getStatusDiv(o){void 0===o&&(o=document);var a=o.getElementById("a11y-status-message");return a||((a=o.createElement("div")).setAttribute("id","a11y-status-message"),a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-relevant","additions text"),Object.assign(a.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),o.body.appendChild(a)),a}var y=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}),b=((s=function(o){function Downshift(a){var l=o.call(this,a)||this;l.id=l.props.id||"downshift-"+String(m++),l.menuId=l.props.menuId||l.id+"-menu",l.labelId=l.props.labelId||l.id+"-label",l.inputId=l.props.inputId||l.id+"-input",l.getItemId=l.props.getItemId||function(o){return l.id+"-item-"+o},l.input=null,l.items=[],l.itemCount=null,l.previousResultCount=0,l.timeoutIds=[],l.internalSetTimeout=function(o,a){var s=setTimeout(function(){l.timeoutIds=l.timeoutIds.filter(function(o){return o!==s}),o()},a);l.timeoutIds.push(s)},l.setItemCount=function(o){l.itemCount=o},l.unsetItemCount=function(){l.itemCount=null},l.setHighlightedIndex=function(o,a){void 0===o&&(o=l.props.defaultHighlightedIndex),void 0===a&&(a={}),a=pickState(a),l.internalSetState((0,d.Z)({highlightedIndex:o},a))},l.clearSelection=function(o){l.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:l.props.defaultHighlightedIndex,isOpen:l.props.defaultIsOpen},o)},l.selectItem=function(o,a,s){a=pickState(a),l.internalSetState((0,d.Z)({isOpen:l.props.defaultIsOpen,highlightedIndex:l.props.defaultHighlightedIndex,selectedItem:o,inputValue:l.props.itemToString(o)},a),s)},l.selectItemAtIndex=function(o,a,s){var u=l.items[o];null!=u&&l.selectItem(u,a,s)},l.selectHighlightedItem=function(o,a){return l.selectItemAtIndex(l.getState().highlightedIndex,o,a)},l.internalSetState=function(o,a){var s,u,p={},c="function"==typeof o;return!c&&o.hasOwnProperty("inputValue")&&l.props.onInputValueChange(o.inputValue,(0,d.Z)({},l.getStateAndHelpers(),{},o)),l.setState(function(a){a=l.getState(a);var h=c?o(a):o;s=(h=l.props.stateReducer(a,h)).hasOwnProperty("selectedItem");var g={},f={};return s&&h.selectedItem!==a.selectedItem&&(u=h.selectedItem),h.type=h.type||0,Object.keys(h).forEach(function(o){a[o]!==h[o]&&(p[o]=h[o]),"type"!==o&&(f[o]=h[o],l.isControlledProp(o)||(g[o]=h[o]))}),c&&h.hasOwnProperty("inputValue")&&l.props.onInputValueChange(h.inputValue,(0,d.Z)({},l.getStateAndHelpers(),{},h)),g},function(){cbToCb(a)(),Object.keys(p).length>1&&l.props.onStateChange(p,l.getStateAndHelpers()),s&&l.props.onSelect(o.selectedItem,l.getStateAndHelpers()),void 0!==u&&l.props.onChange(u,l.getStateAndHelpers()),l.props.onUserAction(p,l.getStateAndHelpers())})},l.rootRef=function(o){return l._rootNode=o},l.getRootProps=function(o,a){var s,p=void 0===o?{}:o,c=p.refKey,h=void 0===c?"ref":c,g=p.ref,f=(0,u.Z)(p,["refKey","ref"]),m=(void 0===a?{}:a).suppressRefError;l.getRootProps.called=!0,l.getRootProps.refKey=h,l.getRootProps.suppressRefError=void 0!==m&&m;var v=l.getState().isOpen;return(0,d.Z)(((s={})[h]=handleRefs(g,l.rootRef),s.role="combobox",s["aria-expanded"]=v,s["aria-haspopup"]="listbox",s["aria-owns"]=v?l.menuId:null,s["aria-labelledby"]=l.labelId,s),f)},l.keyDownHandlers={ArrowDown:function(o){var a=this;if(o.preventDefault(),this.getState().isOpen){var l=o.shiftKey?5:1;this.moveHighlightedIndex(l,{type:4})}else this.internalSetState({isOpen:!0,type:4},function(){var o=a.getItemCount();o>0&&a.setHighlightedIndex(getNextWrappingIndex(1,a.getState().highlightedIndex,o),{type:4})})},ArrowUp:function(o){var a=this;if(o.preventDefault(),this.getState().isOpen){var l=o.shiftKey?-5:-1;this.moveHighlightedIndex(l,{type:3})}else this.internalSetState({isOpen:!0,type:3},function(){var o=a.getItemCount();o>0&&a.setHighlightedIndex(getNextWrappingIndex(-1,a.getState().highlightedIndex,o),{type:4})})},Enter:function(o){var a=this.getState(),l=a.isOpen,s=a.highlightedIndex;if(l&&null!=s){o.preventDefault();var u=this.items[s],d=this.getItemNodeFromIndex(s);if(null==u||d&&d.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape:function(o){o.preventDefault(),this.reset({type:5,selectedItem:null,inputValue:""})}},l.buttonKeyDownHandlers=(0,d.Z)({},l.keyDownHandlers,{" ":function(o){o.preventDefault(),this.toggleMenu({type:12})}}),l.inputKeyDownHandlers=(0,d.Z)({},l.keyDownHandlers,{Home:function(o){this.highlightFirstOrLastIndex(o,!0,{type:7})},End:function(o){this.highlightFirstOrLastIndex(o,!1,{type:8})}}),l.getToggleButtonProps=function(o){var a=void 0===o?{}:o,s=a.onClick,p=(a.onPress,a.onKeyDown),c=a.onKeyUp,h=a.onBlur,g=(0,u.Z)(a,["onClick","onPress","onKeyDown","onKeyUp","onBlur"]),f=l.getState().isOpen,m={onClick:callAllEventHandlers(s,l.buttonHandleClick),onKeyDown:callAllEventHandlers(p,l.buttonHandleKeyDown),onKeyUp:callAllEventHandlers(c,l.buttonHandleKeyUp),onBlur:callAllEventHandlers(h,l.buttonHandleBlur)},v=g.disabled?{}:m;return(0,d.Z)({type:"button",role:"button","aria-label":f?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},v,{},g)},l.buttonHandleKeyUp=function(o){o.preventDefault()},l.buttonHandleKeyDown=function(o){var a=normalizeArrowKey(o);l.buttonKeyDownHandlers[a]&&l.buttonKeyDownHandlers[a].call((0,p.Z)(l),o)},l.buttonHandleClick=function(o){o.preventDefault(),l.props.environment.document.activeElement===l.props.environment.document.body&&o.target.focus(),l.internalSetTimeout(function(){return l.toggleMenu({type:13})})},l.buttonHandleBlur=function(o){var a=o.target;l.internalSetTimeout(function(){l.isMouseDown||null!=l.props.environment.document.activeElement&&l.props.environment.document.activeElement.id===l.inputId||l.props.environment.document.activeElement===a||l.reset({type:14})})},l.getLabelProps=function(o){return(0,d.Z)({htmlFor:l.inputId,id:l.labelId},o)},l.getInputProps=function(o){var a,s=void 0===o?{}:o,p=s.onKeyDown,c=s.onBlur,h=s.onChange,g=s.onInput,f=(s.onChangeText,(0,u.Z)(s,["onKeyDown","onBlur","onChange","onInput","onChangeText"])),m={},v=l.getState(),I=v.inputValue,y=v.isOpen,b=v.highlightedIndex;return f.disabled||((a={}).onChange=callAllEventHandlers(h,g,l.inputHandleChange),a.onKeyDown=callAllEventHandlers(p,l.inputHandleKeyDown),a.onBlur=callAllEventHandlers(c,l.inputHandleBlur),m=a),(0,d.Z)({"aria-autocomplete":"list","aria-activedescendant":y&&"number"==typeof b&&b>=0?l.getItemId(b):null,"aria-controls":y?l.menuId:null,"aria-labelledby":l.labelId,autoComplete:"off",value:I,id:l.inputId},m,{},f)},l.inputHandleKeyDown=function(o){var a=normalizeArrowKey(o);a&&l.inputKeyDownHandlers[a]&&l.inputKeyDownHandlers[a].call((0,p.Z)(l),o)},l.inputHandleChange=function(o){l.internalSetState({type:11,isOpen:!0,inputValue:o.target.value,highlightedIndex:l.props.defaultHighlightedIndex})},l.inputHandleBlur=function(){l.internalSetTimeout(function(){var o=l.props.environment.document&&!!l.props.environment.document.activeElement&&!!l.props.environment.document.activeElement.dataset&&l.props.environment.document.activeElement.dataset.toggle&&l._rootNode&&l._rootNode.contains(l.props.environment.document.activeElement);l.isMouseDown||o||l.reset({type:10})})},l.menuRef=function(o){l._menuNode=o},l.getMenuProps=function(o,a){var s,p=void 0===o?{}:o,c=p.refKey,h=void 0===c?"ref":c,g=p.ref,f=(0,u.Z)(p,["refKey","ref"]),m=(void 0===a?{}:a).suppressRefError;return l.getMenuProps.called=!0,l.getMenuProps.refKey=h,l.getMenuProps.suppressRefError=void 0!==m&&m,(0,d.Z)(((s={})[h]=handleRefs(g,l.menuRef),s.role="listbox",s["aria-labelledby"]=f&&f["aria-label"]?null:l.labelId,s.id=l.menuId,s),f)},l.getItemProps=function(o){var a,s=void 0===o?{}:o,p=s.onMouseMove,c=s.onMouseDown,h=s.onClick,g=(s.onPress,s.index),f=s.item,m=void 0===f?void 0:f,v=(0,u.Z)(s,["onMouseMove","onMouseDown","onClick","onPress","index","item"]);void 0===g?(l.items.push(m),g=l.items.indexOf(m)):l.items[g]=m;var I=((a={onMouseMove:callAllEventHandlers(p,function(){g!==l.getState().highlightedIndex&&(l.setHighlightedIndex(g,{type:2}),l.avoidScrolling=!0,l.internalSetTimeout(function(){return l.avoidScrolling=!1},250))}),onMouseDown:callAllEventHandlers(c,function(o){o.preventDefault()})}).onClick=callAllEventHandlers(h,function(){l.selectItemAtIndex(g,{type:9})}),a),y=v.disabled?{onMouseDown:I.onMouseDown}:I;return(0,d.Z)({id:l.getItemId(g),role:"option","aria-selected":l.getState().highlightedIndex===g},y,{},v)},l.clearItems=function(){l.items=[]},l.reset=function(o,a){void 0===o&&(o={}),o=pickState(o),l.internalSetState(function(a){var s=a.selectedItem;return(0,d.Z)({isOpen:l.props.defaultIsOpen,highlightedIndex:l.props.defaultHighlightedIndex,inputValue:l.props.itemToString(s)},o)},a)},l.toggleMenu=function(o,a){void 0===o&&(o={}),o=pickState(o),l.internalSetState(function(a){var s=a.isOpen;return(0,d.Z)({isOpen:!s},s&&{highlightedIndex:l.props.defaultHighlightedIndex},{},o)},function(){var s=l.getState(),u=s.isOpen,d=s.highlightedIndex;u&&l.getItemCount()>0&&"number"==typeof d&&l.setHighlightedIndex(d,o),cbToCb(a)()})},l.openMenu=function(o){l.internalSetState({isOpen:!0},o)},l.closeMenu=function(o){l.internalSetState({isOpen:!1},o)},l.updateStatus=debounce(function(){var o,a,s=l.getState(),u=l.items[s.highlightedIndex],p=l.getItemCount(),c=l.props.getA11yStatusMessage((0,d.Z)({itemToString:l.props.itemToString,previousResultCount:l.previousResultCount,resultCount:p,highlightedItem:u},s));l.previousResultCount=p,o=c,a=getStatusDiv(l.props.environment.document),o&&(a.textContent=o,I())},200);var s=l.props,c=s.defaultHighlightedIndex,h=s.initialHighlightedIndex,g=s.defaultIsOpen,f=s.initialIsOpen,v=s.initialInputValue,y=s.initialSelectedItem,b=l.getState({highlightedIndex:void 0===h?c:h,isOpen:void 0===f?g:f,inputValue:void 0===v?"":v,selectedItem:void 0===y?null:y});return null!=b.selectedItem&&void 0===l.props.initialInputValue&&(b.inputValue=l.props.itemToString(b.selectedItem)),l.state=b,l}(0,c.Z)(Downshift,o);var a=Downshift.prototype;return a.internalClearTimeouts=function(){this.timeoutIds.forEach(function(o){clearTimeout(o)}),this.timeoutIds=[]},a.getState=function(o){var a=this;return void 0===o&&(o=this.state),Object.keys(o).reduce(function(l,s){return l[s]=a.isControlledProp(s)?a.props[s]:o[s],l},{})},a.isControlledProp=function(o){return void 0!==this.props[o]},a.getItemCount=function(){var o=this.items.length;return null!=this.itemCount?o=this.itemCount:void 0!==this.props.itemCount&&(o=this.props.itemCount),o},a.getItemNodeFromIndex=function(o){return this.props.environment.document.getElementById(this.getItemId(o))},a.scrollHighlightedItemIntoView=function(){var o=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(o,this._menuNode)},a.moveHighlightedIndex=function(o,a){var l=this.getItemCount();if(l>0){var s=getNextWrappingIndex(o,this.getState().highlightedIndex,l);this.setHighlightedIndex(s,a)}},a.highlightFirstOrLastIndex=function(o,a,l){var s=this.getItemCount()-1;!(s<0)&&this.getState().isOpen&&(o.preventDefault(),this.setHighlightedIndex(a?0:s,l))},a.getStateAndHelpers=function(){var o=this.getState(),a=o.highlightedIndex,l=o.inputValue,s=o.selectedItem,u=o.isOpen,d=this.props.itemToString,p=this.id,c=this.getRootProps,h=this.getToggleButtonProps,g=this.getLabelProps,f=this.getMenuProps,m=this.getInputProps,v=this.getItemProps,I=this.openMenu,y=this.closeMenu,b=this.toggleMenu,w=this.selectItem,S=this.selectItemAtIndex,x=this.selectHighlightedItem,C=this.setHighlightedIndex,H=this.clearSelection,O=this.clearItems;return{getRootProps:c,getToggleButtonProps:h,getLabelProps:g,getMenuProps:f,getInputProps:m,getItemProps:v,reset:this.reset,openMenu:I,closeMenu:y,toggleMenu:b,selectItem:w,selectItemAtIndex:S,selectHighlightedItem:x,setHighlightedIndex:C,clearSelection:H,clearItems:O,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:d,id:p,highlightedIndex:a,inputValue:l,isOpen:u,selectedItem:s}},a.componentDidMount=function(){var o=this,targetWithinDownshift=function(a,l){void 0===l&&(l=!0);var s=o.props.environment.document;return[o._rootNode,o._menuNode].some(function(o){return o&&(isOrContainsNode(o,a)||l&&isOrContainsNode(o,s.activeElement))})},onMouseDown=function(){o.isMouseDown=!0},onMouseUp=function(a){o.isMouseDown=!1,!targetWithinDownshift(a.target)&&o.getState().isOpen&&o.reset({type:1},function(){return o.props.onOuterClick(o.getStateAndHelpers())})},onTouchStart=function(){o.isTouchMove=!1},onTouchMove=function(){o.isTouchMove=!0},onTouchEnd=function(a){var l=targetWithinDownshift(a.target,!1);o.isTouchMove||l||!o.getState().isOpen||o.reset({type:16},function(){return o.props.onOuterClick(o.getStateAndHelpers())})},a=this.props.environment;a.addEventListener("mousedown",onMouseDown),a.addEventListener("mouseup",onMouseUp),a.addEventListener("touchstart",onTouchStart),a.addEventListener("touchmove",onTouchMove),a.addEventListener("touchend",onTouchEnd),this.cleanup=function(){o.internalClearTimeouts(),o.updateStatus.cancel(),a.removeEventListener("mousedown",onMouseDown),a.removeEventListener("mouseup",onMouseUp),a.removeEventListener("touchstart",onTouchStart),a.removeEventListener("touchmove",onTouchMove),a.removeEventListener("touchend",onTouchEnd)}},a.shouldScroll=function(o,a){var l=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,s=(void 0===a.highlightedIndex?o:a).highlightedIndex;return l&&this.getState().isOpen&&!o.isOpen||l!==s},a.componentDidUpdate=function(o,a){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(o.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(a,o)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},a.componentWillUnmount=function(){this.cleanup()},a.render=function(){var o=unwrapArray(this.props.children,noop);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 a=unwrapArray(o(this.getStateAndHelpers()));return a?this.getRootProps.called||this.props.suppressRefError?a:"string"==typeof a.type?(0,f.cloneElement)(a,this.getRootProps(a.props)):void 0:null},Downshift}(f.Component)).defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:function(o){var a=o.isOpen,l=o.selectedItem,s=o.resultCount,u=o.previousResultCount,d=o.itemToString;return a?s?s!==u?s+" result"+(1===s?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":l?d(l):""},itemToString:function(o){return null==o?"":String(o)},onStateChange:noop,onInputValueChange:noop,onUserAction:noop,onChange:noop,onSelect:noop,onOuterClick:noop,selectedItemChanged:function(o,a){return o!==a},environment:"undefined"==typeof window?{}:window,stateReducer:function(o,a){return a},suppressRefError:!1,scrollIntoView:scrollIntoView},s.stateChangeTypes=y,s);function getNextWrappingIndex$1(o,a,l,s){if(-1===a)return o>0?0:l-1;var u=a+o;return u<0?s?l-1:0:u>=l?s?0:l-1:u}function getItemIndexByCharacterKey(o,a,l,s){var u=-1,d=l.map(function(o){return s(o).toLowerCase()}),p=a+1;return(u=d.slice(p).findIndex(function(a){return a.startsWith(o)}))>-1?u+p:d.slice(0,p).findIndex(function(a){return a.startsWith(o)})}function capitalizeString(o){return""+o.slice(0,1).toUpperCase()+o.slice(1)}var w=0,S={highlightedIndex:-1,isOpen:!1,selectedItem:null};function getHighlightedIndexOnOpen(o,a,l){var s=o.items,u=o.initialHighlightedIndex,d=o.defaultHighlightedIndex,p=a.selectedItem,c=a.highlightedIndex;return void 0!==u&&c>-1?u:void 0!==d?d:p?0===l?s.indexOf(p):getNextWrappingIndex$1(l,s.indexOf(p),s.length,!1):0===l?-1:l<0?s.length-1:0}function getDefaultValue(o,a){var l="default"+capitalizeString(a);return l in o?o[l]:S[a]}g().array.isRequired,g().func,g().func,g().func,g().bool,g().number,g().number,g().number,g().bool,g().bool,g().bool,g().any,g().any,g().any,g().string,g().string,g().string,g().func,g().string,g().func,g().func,g().func,g().func,g().func,g().shape({addEventListener:g().func,removeEventListener:g().func,document:g().shape({getElementById:g().func,activeElement:g().any,body:g().any})});"undefined"==typeof window||window;var x=b}}]);