{"version":3,"sources":["webpack:///./node_modules/@reach/dialog/dist/reach-dialog.esm.js","webpack:///./node_modules/@reach/descendants/dist/reach-descendants.esm.js","webpack:///./node_modules/@reach/machine/dist/reach-machine.esm.js","webpack:///./node_modules/@reach/listbox/dist/reach-listbox.esm.js","webpack:///./node_modules/@reach/tooltip/styles.css?378c","webpack:///./node_modules/@reach/listbox/styles.css?0d27","webpack:///./node_modules/@reach/visually-hidden/dist/reach-visually-hidden.esm.js","webpack:///./node_modules/@reach/tooltip/dist/reach-tooltip.esm.js","webpack:///./node_modules/@reach/popover/dist/reach-popover.esm.js","webpack:///./node_modules/@reach/listbox/styles.css","webpack:///./node_modules/@reach/tooltip/styles.css","webpack:///./node_modules/@reach/utils/dist/reach-utils.esm.js","webpack:///./node_modules/@reach/portal/dist/reach-portal.esm.js","webpack:///./node_modules/@reach/auto-id/dist/reach-auto-id.esm.js","webpack:///./node_modules/@reach/observe-rect/dist/observe-rect.esm.js","webpack:///./node_modules/@reach/rect/dist/reach-rect.esm.js","webpack:///./node_modules/@reach/dialog/styles.css?0154","webpack:///./node_modules/@reach/dialog/styles.css"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_objectWithoutPropertiesLoose","excluded","sourceKeys","keys","indexOf","bool","func","DialogOverlay","_ref","forwardedRef","_ref$as","as","Comp","_ref$isOpen","isOpen","props","window","__REACH_DISABLE_TOOLTIPS","requestAnimationFrame","DialogInner","ref","_ref2","allowPinchZoom","_ref2$as","_ref2$dangerouslyBypa","dangerouslyBypassFocusLock","_ref2$dangerouslyBypa2","dangerouslyBypassScrollLock","initialFocusRef","onClick","_ref2$onDismiss","onDismiss","onKeyDown","onMouseDown","_ref2$unstable_lockFo","unstable_lockFocusAcrossFrames","mouseDownTarget","overlayNode","activateFocusLock","current","focus","dialogNode","originalValues","rootNodes","ownerDocument","Array","forEach","querySelectorAll","node","_dialogNode$parentNod","_dialogNode$parentNod2","parentNode","attr","getAttribute","push","setAttribute","index","originalValue","removeAttribute","createAriaHider","autoFocus","returnFocus","onActivation","disabled","crossFrame","enabled","event","stopPropagation","DialogContent","_ref3","_ref3$as","role","tabIndex","Dialog","_ref4","_ref4$allowPinchZoom","_ref4$onDismiss","createDescendantContext","name","initialValue","descendants","registerDescendant","unregisterDescendant","DescendantProvider","Ctx","context","children","items","set","element","explicitIndex","rest","newItems","concat","find","item","findIndex","Boolean","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","newItem","slice","map","filter","Provider","value","_commonEvents","ListboxStates","ListboxEvents","useMachine","initialMachine","refs","DEBUG","machineRef","service","start","lastEventType","_React$useState","currentValue","subscribe","state","unsubscribe","getServiceState","setState","send","rawEvent","type","refValues","entries","reduce","unwrapRefs","newState","changed","stop","matches","clearNavigationValue","navigationValue","clearTypeahead","typeaheadQuery","assignValue","_","data","navigateFromCurrentValue","options","_data$options$find","selected","option","undefined","listboxLostFocus","Blur","_event$refs","list","popover","relatedTarget","activeElement","contains","clickedOutsideOfListbox","OutsideMouseDown","OutsideMouseUp","_event$refs2","button","optionIsActive","shouldNavigate","_event$refs3","focusList","focusButton","listboxIsNotDisabled","optionIsNavigable","OptionTouchStart","optionIsSelectable","selectOption","callback","submitForm","KeyDownEnter","hiddenInput","form","submitButton","querySelector","click","setTypeahead","query","setValueFromTypeahead","UpdateAfterTypeahead","match","findOptionFromTypeahead","setNavSelectionFromTypeahead","commonEvents","GetDerivedData","actions","ctx","ValueChange","string","label","toLowerCase","startsWith","ListboxDescendantContext","ListboxContext","ListboxGroupContext","ariaLabelledBy","ariaLabel","defaultValue","_ref$disabled","onChange","required","valueProp","_ref$_componentName","_componentName","isControlled","_useDescendantsInit","setOptions","stableOnChange","buttonRef","hiddenInputRef","highlightedOptionRef","inputRef","listRef","popoverRef","selectedOptionRef","_useMachine","machineDefinition","useCreateMachine","_default2","_default3","_default4","_default5","_default6","_states","id","initial","Idle","states","on","ButtonMouseDown","Open","cond","KeyDownSpace","Navigating","KeyDownSearch","ClearTypeahead","KeyDownNavigate","Interacting","entry","ClearNavSelection","KeyDownEscape","OptionMouseDown","Dragging","OptionMouseEnter","ButtonMouseUp","OptionMouseMove","OptionMouseUp","createMachineDefinition","highlightedOption","input","selectedOption","_id","valueLabel","isExpanded","includes","isListboxExpanded","listboxId","listboxValueLabel","onValueChange","stateData","mounted","first","controlPropValue","internalValue","useControlledStateSync","handleMouseDown","popoverContainsEventTarget","addEventListener","removeEventListener","handleMouseUp","expanded","readOnly","_ref2$arrow","arrow","_ref2$portal","portal","ListboxButtonImpl","_ref4$arrow","_ref4$as","onMouseUp","_React$useContext","listboxValue","handleKeyDown","useKeyDown","join","nativeEvent","preventDefault","ListboxArrowImpl","_ref5","_ref5$as","ListboxPopoverImpl","_ref6","_ref6$as","_ref6$position","position","onBlur","_ref6$portal","unstable_observableRefs","_React$useContext3","commonProps","hidden","targetRef","_ref7","_ref7$as","_React$useContext4","_React$useContext4$st","useOptionId","_ref8","_ref8$as","onMouseEnter","onMouseLeave","onMouseMove","onTouchStart","labelProp","descendant","indexProp","forceUpdate","previousDescendants","someDescendantsHaveChanged","_React$useContext5","_React$useContext5$st","labelState","setLabel","ownRef","some","_previousDescendants$","values","getLabelFromDomNode","prevState","textContent","isHighlighted","isSelected","_ref9","_ref9$as","labelId","_ref10","_ref10$as","useListboxContext","_React$useContext8","_React$useContext9","listboxDisabled","_React$useContext9$st","timeout","setTimeout","clearTimeout","_ref11","isSearching","navOption","eventType","shiftKey","KeyDownShiftTab","KeyDownTab","currentIndex","_options$key","_options$orientation","orientation","_options$rotate","rotate","_options$rtl","rtl","selectableDescendants","next","getNextOption","prev","getPreviousOption","nextOrPrev","prevOrNext","prevOrFirst","ctrlKey","getFirstOption","nextOrLast","getLastOption","last","useDescendantKeyDown","nextIndex","api","content","__esModule","default","module","exports","locals","_ref$style","style","border","clip","height","margin","overflow","padding","width","whiteSpace","wordWrap","_on","_on2","_on3","_on4","_on5","TooltipStates","TooltipEvents","MOUSE_REST_TIMEOUT","LEAVE_TIMEOUT","restTimeout","leavingVisibleTimer","chart","enter","clearContextId","MouseEnter","Focused","Focus","Visible","Rest","leave","MouseMove","MouseLeave","MouseDown","Dismissed","LeavingVisible","SelectWithKeyboard","GlobalMouseMove","TimeComplete","subscriptions","useTooltip","_temp","idProp","onPointerEnter","onPointerMove","onPointerLeave","onPointerDown","onFocus","DEBUG_STYLE","String","isTooltipVisible","isVisible","setIsVisible","triggerRect","observe","wrapMouseEvent","theirHandler","ourHandler","wrapPointerEventHandler","handler","pointerType","handleMouseEnter","handleMouseMove","handleMouseLeave","fn","splice","listener","Element","closest","useDisabledTriggerOnSafari","Tooltip","DEPRECATED_ariaLabel","child","only","_useTooltip","trigger","tooltip","forwardRef","realAriaLabel","_ref4$position","hasAriaLabel","tooltipRect","getStyles","visibility","offset","_getDocumentDimension","windowWidth","windowHeight","collisions","top","right","left","bottom","directionUp","pageXOffset","pageYOffset","_transition","currentState","stateDef","nextState","payload","nextStateValue","nextDef","transition","Popover","PopoverImpl","_ref$position","positionDefault","_ref$unstable_observa","popoverRect","targetRect","triggerRef","elementAfterTrigger","getElementAfterTrigger","shiftTabbedFromElementAfterTrigger","elements","focusLastTabbableInPopover","shiftTabbedOutOfPopover","_triggerRef$current","focusTriggerRef","shiftTabbedToBrowserChrome","disableTabbablesInPopover","focusFirstPopoverTabbable","tabbedOutOfPopover","focusTabbableAfterTrigger","tabbedToBrowserChrome","targetIndex","restoreTabIndexTuplés","enableTabbablesInPopover","useSimulateTabNavigationForReactTree","_len","_key","getTopPosition","getCollisions","directionRight","positionRight","directionLeft","positionMatchWidth","offsetLeft","offsetBottom","innerWidth","innerHeight","directionDown","___CSS_LOADER_API_IMPORT___","useIsomorphicLayoutEffect","canUseDOM","Math","self","assignRef","isFunction","error","Error","document","createElement","createNamedContext","displayName","forwardRefWithAs","render","memoWithAs","Component","propsAreEqual","getDocumentDimensions","_ownerDocument$docume","_ownerDocument$docume2","getOwnerDocument","ownerWindow","defaultView","documentElement","clientWidth","clientHeight","isBoolean","toString","isRightClick","which","isString","makeId","_len2","args","_key2","val","noop","useControlledSwitchWarning","useCheckStyles","useConstant","v","useForceUpdate","dispatch","create","useForkedRef","_len4","_key4","every","usePrevious","useStableCallback","callbackRef","wrapEvent","defaultPrevented","Portal","_ref$type","mountNode","portalNode","body","appendChild","removeChild","serverHandoffComplete","genId","useId","idFromProps","initialId","setId","rafId","observedNodes","Map","run","changedStates","a","b","newRect","getBoundingClientRect","rect","prop","callbacks","cb","wasEmpty","size","has","get","hasRectChanged","unobserve","cancelAnimationFrame","useRect","nodeRef","observeOrOptions","deprecated_onChange","_observeOrOptions$obs","setElement","initialRectIsSet","initialRefIsSet","_React$useState2","setRect","onChangeRef","observer","elem","cleanup"],"mappings":"0FAAA,0MAOA,SAASA,IAeP,OAdAA,EAAWC,OAAOC,QAAU,SAAUC,GACpC,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAASF,UAAUD,GAEvB,IAAK,IAAII,KAAOD,EACVN,OAAOQ,UAAUC,eAAeC,KAAKJ,EAAQC,KAC/CL,EAAOK,GAAOD,EAAOC,IAK3B,OAAOL,IAGOS,MAAMC,KAAMR,WAG9B,SAASS,EAA8BP,EAAQQ,GAC7C,GAAc,MAAVR,EAAgB,MAAO,GAC3B,IAEIC,EAAKJ,EAFLD,EAAS,GACTa,EAAaf,OAAOgB,KAAKV,GAG7B,IAAKH,EAAI,EAAGA,EAAIY,EAAWV,OAAQF,IACjCI,EAAMQ,EAAWZ,GACbW,EAASG,QAAQV,IAAQ,IAC7BL,EAAOK,GAAOD,EAAOC,IAGvB,OAAOL,EAIS,IAAUgB,KACE,IAAUA,KACT,IAAUA,KAK5B,IAAUC,KARvB,IAsBIC,EAA6B,aAAiB,SAAuBC,EAAMC,GAC7E,IAAIC,EAAUF,EAAKG,GACfC,OAAmB,IAAZF,EAAqB,MAAQA,EACpCG,EAAcL,EAAKM,OACnBA,OAAyB,IAAhBD,GAAgCA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AAC9K,EAAS/V,EAASghB,EAAStZ,IACxB0Y,I,oBClJT,IAAIlO,EAAM,EAAQ,IACFC,EAAU,EAAQ,KAIC,iBAFvBA,EAAUA,EAAQC,WAAaD,EAAQE,QAAUF,KAG/CA,EAAU,CAAC,CAACG,EAAOzY,EAAIsY,EAAS,MAG9C,IAAI5O,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEP2O,EAAIC,EAAS5O,GAI1B+O,EAAOC,QAAUJ,EAAQK,QAAU,I,qBChBnCD,EADkC,EAAQ,IAChCiJ,EAA4B,IAE9B3d,KAAK,CAACyU,EAAOzY,EAAI,udAAwd,KAEjfyY,EAAOC,QAAUA","file":"reach.5e774414.js","sourcesContent":["import { useEffect, createElement, useRef, useCallback } from 'react';\nimport { Portal } from '@reach/portal';\nimport { forwardRefWithAs, useCheckStyles, useForkedRef, wrapEvent, getOwnerDocument, noop, isString } from '@reach/utils';\nimport FocusLock from 'react-focus-lock';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport PropTypes from 'prop-types';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar overlayPropTypes = {\n allowPinchZoom: PropTypes.bool,\n dangerouslyBypassFocusLock: PropTypes.bool,\n dangerouslyBypassScrollLock: PropTypes.bool,\n // TODO:\n initialFocusRef: function initialFocusRef() {\n return null;\n },\n onDismiss: PropTypes.func\n}; ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * DialogOverlay\n *\n * Low-level component if you need more control over the styles or rendering of\n * the dialog overlay.\n *\n * Note: You must render a `DialogContent` inside.\n *\n * @see Docs https://reach.tech/dialog#dialogoverlay\n */\n\nvar DialogOverlay = /*#__PURE__*/forwardRefWithAs(function DialogOverlay(_ref, forwardedRef) {\n var _ref$as = _ref.as,\n Comp = _ref$as === void 0 ? \"div\" : _ref$as,\n _ref$isOpen = _ref.isOpen,\n isOpen = _ref$isOpen === void 0 ? true : _ref$isOpen,\n props = _objectWithoutPropertiesLoose(_ref, [\"as\", \"isOpen\"]);\n\n useCheckStyles(\"dialog\"); // We want to ignore the immediate focus of a tooltip so it doesn't pop\n // up again when the menu closes, only pops up when focus returns again\n // to the tooltip (like native OS tooltips).\n\n useEffect(function () {\n if (isOpen) {\n // @ts-ignore\n window.__REACH_DISABLE_TOOLTIPS = true;\n } else {\n window.requestAnimationFrame(function () {\n // Wait a frame so that this doesn't fire before tooltip does\n // @ts-ignore\n window.__REACH_DISABLE_TOOLTIPS = false;\n });\n }\n }, [isOpen]);\n return isOpen ? /*#__PURE__*/createElement(Portal, {\n \"data-reach-dialog-wrapper\": \"\"\n }, /*#__PURE__*/createElement(DialogInner, _extends({\n ref: forwardedRef,\n as: Comp\n }, props))) : null;\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n DialogOverlay.displayName = \"DialogOverlay\";\n DialogOverlay.propTypes = /*#__PURE__*/_extends({}, overlayPropTypes, {\n isOpen: PropTypes.bool\n });\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * DialogInner\n */\nvar DialogInner = /*#__PURE__*/forwardRefWithAs(function DialogInner(_ref2, forwardedRef) {\n var allowPinchZoom = _ref2.allowPinchZoom,\n _ref2$as = _ref2.as,\n Comp = _ref2$as === void 0 ? \"div\" : _ref2$as,\n _ref2$dangerouslyBypa = _ref2.dangerouslyBypassFocusLock,\n dangerouslyBypassFocusLock = _ref2$dangerouslyBypa === void 0 ? false : _ref2$dangerouslyBypa,\n _ref2$dangerouslyBypa2 = _ref2.dangerouslyBypassScrollLock,\n dangerouslyBypassScrollLock = _ref2$dangerouslyBypa2 === void 0 ? false : _ref2$dangerouslyBypa2,\n initialFocusRef = _ref2.initialFocusRef,\n onClick = _ref2.onClick,\n _ref2$onDismiss = _ref2.onDismiss,\n onDismiss = _ref2$onDismiss === void 0 ? noop : _ref2$onDismiss,\n onKeyDown = _ref2.onKeyDown,\n onMouseDown = _ref2.onMouseDown,\n _ref2$unstable_lockFo = _ref2.unstable_lockFocusAcrossFrames,\n unstable_lockFocusAcrossFrames = _ref2$unstable_lockFo === void 0 ? true : _ref2$unstable_lockFo,\n props = _objectWithoutPropertiesLoose(_ref2, [\"allowPinchZoom\", \"as\", \"dangerouslyBypassFocusLock\", \"dangerouslyBypassScrollLock\", \"initialFocusRef\", \"onClick\", \"onDismiss\", \"onKeyDown\", \"onMouseDown\", \"unstable_lockFocusAcrossFrames\"]);\n\n var mouseDownTarget = useRef(null);\n var overlayNode = useRef(null);\n var ref = useForkedRef(overlayNode, forwardedRef);\n var activateFocusLock = useCallback(function () {\n if (initialFocusRef && initialFocusRef.current) {\n initialFocusRef.current.focus();\n }\n }, [initialFocusRef]);\n\n function handleClick(event) {\n if (mouseDownTarget.current === event.target) {\n event.stopPropagation();\n onDismiss(event);\n }\n }\n\n function handleKeyDown(event) {\n if (event.key === \"Escape\") {\n event.stopPropagation();\n onDismiss(event);\n }\n }\n\n function handleMouseDown(event) {\n mouseDownTarget.current = event.target;\n }\n\n useEffect(function () {\n return overlayNode.current ? createAriaHider(overlayNode.current) : void null;\n }, []);\n return /*#__PURE__*/createElement(FocusLock, {\n autoFocus: true,\n returnFocus: true,\n onActivation: activateFocusLock,\n disabled: dangerouslyBypassFocusLock,\n crossFrame: unstable_lockFocusAcrossFrames\n }, /*#__PURE__*/createElement(RemoveScroll, {\n allowPinchZoom: allowPinchZoom,\n enabled: !dangerouslyBypassScrollLock\n }, /*#__PURE__*/createElement(Comp, _extends({}, props, {\n ref: ref,\n \"data-reach-dialog-overlay\": \"\"\n /*\n * We can ignore the `no-static-element-interactions` warning here\n * because our overlay is only designed to capture any outside\n * clicks, not to serve as a clickable element itself.\n */\n ,\n onClick: wrapEvent(onClick, handleClick),\n onKeyDown: wrapEvent(onKeyDown, handleKeyDown),\n onMouseDown: wrapEvent(onMouseDown, handleMouseDown)\n }))));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n DialogOverlay.displayName = \"DialogOverlay\";\n DialogOverlay.propTypes = /*#__PURE__*/_extends({}, overlayPropTypes);\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * DialogContent\n *\n * Low-level component if you need more control over the styles or rendering of\n * the dialog content.\n *\n * Note: Must be a child of `DialogOverlay`.\n *\n * Note: You only need to use this when you are also styling `DialogOverlay`,\n * otherwise you can use the high-level `Dialog` component and pass the props\n * to it. Any props passed to `Dialog` component (besides `isOpen` and\n * `onDismiss`) will be spread onto `DialogContent`.\n *\n * @see Docs https://reach.tech/dialog#dialogcontent\n */\n\n\nvar DialogContent = /*#__PURE__*/forwardRefWithAs(function DialogContent(_ref3, forwardedRef) {\n var _ref3$as = _ref3.as,\n Comp = _ref3$as === void 0 ? \"div\" : _ref3$as,\n onClick = _ref3.onClick;\n _ref3.onKeyDown;\n var props = _objectWithoutPropertiesLoose(_ref3, [\"as\", \"onClick\", \"onKeyDown\"]);\n\n return /*#__PURE__*/createElement(Comp, _extends({\n \"aria-modal\": \"true\",\n role: \"dialog\",\n tabIndex: -1\n }, props, {\n ref: forwardedRef,\n \"data-reach-dialog-content\": \"\",\n onClick: wrapEvent(onClick, function (event) {\n event.stopPropagation();\n })\n }));\n});\n/**\n * @see Docs https://reach.tech/dialog#dialogcontent-props\n */\n\nif (process.env.NODE_ENV !== \"production\") {\n DialogContent.displayName = \"DialogContent\";\n DialogContent.propTypes = {\n \"aria-label\": ariaLabelType,\n \"aria-labelledby\": ariaLabelType\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Dialog\n *\n * High-level component to render a modal dialog window over the top of the page\n * (or another dialog).\n *\n * @see Docs https://reach.tech/dialog#dialog\n */\n\n\nvar Dialog = /*#__PURE__*/forwardRefWithAs(function Dialog(_ref4, forwardedRef) {\n var _ref4$allowPinchZoom = _ref4.allowPinchZoom,\n allowPinchZoom = _ref4$allowPinchZoom === void 0 ? false : _ref4$allowPinchZoom,\n initialFocusRef = _ref4.initialFocusRef,\n isOpen = _ref4.isOpen,\n _ref4$onDismiss = _ref4.onDismiss,\n onDismiss = _ref4$onDismiss === void 0 ? noop : _ref4$onDismiss,\n props = _objectWithoutPropertiesLoose(_ref4, [\"allowPinchZoom\", \"initialFocusRef\", \"isOpen\", \"onDismiss\"]);\n\n return /*#__PURE__*/createElement(DialogOverlay, {\n allowPinchZoom: allowPinchZoom,\n initialFocusRef: initialFocusRef,\n isOpen: isOpen,\n onDismiss: onDismiss\n }, /*#__PURE__*/createElement(DialogContent, _extends({\n ref: forwardedRef\n }, props)));\n});\n/**\n * @see Docs https://reach.tech/dialog#dialog-props\n */\n\nif (process.env.NODE_ENV !== \"production\") {\n Dialog.displayName = \"Dialog\";\n Dialog.propTypes = {\n isOpen: PropTypes.bool,\n onDismiss: PropTypes.func,\n \"aria-label\": ariaLabelType,\n \"aria-labelledby\": ariaLabelType\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\n\nfunction createAriaHider(dialogNode) {\n var originalValues = [];\n var rootNodes = [];\n var ownerDocument = getOwnerDocument(dialogNode);\n\n if (!dialogNode) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"A ref has not yet been attached to a dialog node when attempting to call `createAriaHider`.\");\n }\n\n return noop;\n }\n\n Array.prototype.forEach.call(ownerDocument.querySelectorAll(\"body > *\"), function (node) {\n var _dialogNode$parentNod, _dialogNode$parentNod2;\n\n var portalNode = (_dialogNode$parentNod = dialogNode.parentNode) == null ? void 0 : (_dialogNode$parentNod2 = _dialogNode$parentNod.parentNode) == null ? void 0 : _dialogNode$parentNod2.parentNode;\n\n if (node === portalNode) {\n return;\n }\n\n var attr = node.getAttribute(\"aria-hidden\");\n var alreadyHidden = attr !== null && attr !== \"false\";\n\n if (alreadyHidden) {\n return;\n }\n\n originalValues.push(attr);\n rootNodes.push(node);\n node.setAttribute(\"aria-hidden\", \"true\");\n });\n return function () {\n rootNodes.forEach(function (node, index) {\n var originalValue = originalValues[index];\n\n if (originalValue === null) {\n node.removeAttribute(\"aria-hidden\");\n } else {\n node.setAttribute(\"aria-hidden\", originalValue);\n }\n });\n };\n}\n\nfunction ariaLabelType(props, propName, compName, location, propFullName) {\n var details = \"\\nSee https://www.w3.org/TR/wai-aria/#aria-label for details.\";\n\n if (!props[\"aria-label\"] && !props[\"aria-labelledby\"]) {\n return new Error(\"A <\" + compName + \"> must have either an `aria-label` or `aria-labelledby` prop.\\n \" + details);\n }\n\n if (props[\"aria-label\"] && props[\"aria-labelledby\"]) {\n return new Error(\"You provided both `aria-label` and `aria-labelledby` props to a <\" + compName + \">. If the a label for this component is visible on the screen, that label's component should be given a unique ID prop, and that ID should be passed as the `aria-labelledby` prop into <\" + compName + \">. If the label cannot be determined programmatically from the content of the element, an alternative label should be provided as the `aria-label` prop, which will be used as an `aria-label` on the HTML tag.\" + details);\n } else if (props[propName] != null && !isString(props[propName])) {\n return new Error(\"Invalid prop `\" + propName + \"` supplied to `\" + compName + \"`. Expected `string`, received `\" + (Array.isArray(propFullName) ? \"array\" : typeof propFullName) + \"`.\");\n }\n\n return null;\n} ////////////////////////////////////////////////////////////////////////////////\n\nexport default Dialog;\nexport { Dialog, DialogContent, DialogOverlay };\n","import { useContext, useState, useCallback, createElement, useMemo } from 'react';\nimport { createNamedContext, noop, useForceUpdate, usePrevious, useIsomorphicLayoutEffect } from '@reach/utils';\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction createDescendantContext(name, initialValue) {\n if (initialValue === void 0) {\n initialValue = {};\n }\n\n var descendants = [];\n return createNamedContext(name, _extends({\n descendants: descendants,\n registerDescendant: noop,\n unregisterDescendant: noop\n }, initialValue));\n}\n/**\n * This hook registers our descendant by passing it into an array. We can then\n * search that array by to find its index when registering it in the component.\n * We use this for focus management, keyboard navigation, and typeahead\n * functionality for some components.\n *\n * The hook accepts the element node and (optionally) a key. The key is useful\n * if multiple descendants have identical text values and we need to\n * differentiate siblings for some reason.\n *\n * Our main goals with this are:\n * 1) maximum composability,\n * 2) minimal API friction\n * 3) SSR compatibility*\n * 4) concurrent safe\n * 5) index always up-to-date with the tree despite changes\n * 6) works with memoization of any component in the tree (hopefully)\n *\n * * As for SSR, the good news is that we don't actually need the index on the\n * server for most use-cases, as we are only using it to determine the order of\n * composed descendants for keyboard navigation. However, in the few cases where\n * this is not the case, we can require an explicit index from the app.\n */\n\n\nfunction useDescendant(descendant, context, indexProp) {\n var forceUpdate = useForceUpdate();\n\n var _React$useContext = useContext(context),\n registerDescendant = _React$useContext.registerDescendant,\n unregisterDescendant = _React$useContext.unregisterDescendant,\n descendants = _React$useContext.descendants; // This will initially return -1 because we haven't registered the descendant\n // on the first render. After we register, this will then return the correct\n // index on the following render and we will re-register descendants\n // so that everything is up-to-date before the user interacts with a\n // collection.\n\n\n var index = indexProp != null ? indexProp : descendants.findIndex(function (item) {\n return item.element === descendant.element;\n });\n var previousDescendants = usePrevious(descendants); // We also need to re-register descendants any time ANY of the other\n // descendants have changed. My brain was melting when I wrote this and it\n // feels a little off, but checking in render and using the result in the\n // effect's dependency array works well enough.\n\n var someDescendantsHaveChanged = descendants.some(function (descendant, index) {\n var _previousDescendants$;\n\n return descendant.element !== (previousDescendants == null ? void 0 : (_previousDescendants$ = previousDescendants[index]) == null ? void 0 : _previousDescendants$.element);\n }); // Prevent any flashing\n\n useIsomorphicLayoutEffect(function () {\n if (!descendant.element) forceUpdate();\n registerDescendant(_extends({}, descendant, {\n index: index\n }));\n return function () {\n return unregisterDescendant(descendant.element);\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [forceUpdate, index, registerDescendant, someDescendantsHaveChanged, unregisterDescendant].concat(Object.values(descendant)));\n return index;\n}\n\nfunction useDescendantsInit() {\n return useState([]);\n}\n\nfunction useDescendants(ctx) {\n return useContext(ctx).descendants;\n}\n\nfunction DescendantProvider(_ref) {\n var Ctx = _ref.context,\n children = _ref.children,\n items = _ref.items,\n set = _ref.set;\n var registerDescendant = useCallback(function (_ref2) {\n var element = _ref2.element,\n explicitIndex = _ref2.index,\n rest = _objectWithoutPropertiesLoose(_ref2, [\"element\", \"index\"]);\n\n if (!element) {\n return;\n }\n\n set(function (items) {\n var newItems;\n\n if (explicitIndex != null) {\n newItems = [].concat(items, [_extends({}, rest, {\n element: element,\n index: explicitIndex\n })]);\n } else if (items.length === 0) {\n // If there are no items, register at index 0 and bail.\n newItems = [].concat(items, [_extends({}, rest, {\n element: element,\n index: 0\n })]);\n } else if (items.find(function (item) {\n return item.element === element;\n })) {\n // If the element is already registered, just use the same array\n newItems = items;\n } else {\n // When registering a descendant, we need to make sure we insert in\n // into the array in the same order that it appears in the DOM. So as\n // new descendants are added or maybe some are removed, we always know\n // that the array is up-to-date and correct.\n //\n // So here we look at our registered descendants and see if the new\n // element we are adding appears earlier than an existing descendant's\n // DOM node via `node.compareDocumentPosition`. If it does, we insert\n // the new element at this index. Because `registerDescendant` will be\n // called in an effect every time the descendants state value changes,\n // we should be sure that this index is accurate when descendent\n // elements come or go from our component.\n var index = items.findIndex(function (item) {\n if (!item.element || !element) {\n return false;\n } // Does this element's DOM node appear before another item in the\n // array in our DOM tree? If so, return true to grab the index at\n // this point in the array so we know where to insert the new\n // element.\n\n\n return Boolean(item.element.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_PRECEDING);\n });\n\n var newItem = _extends({}, rest, {\n element: element,\n index: index\n }); // If an index is not found we will push the element to the end.\n\n\n if (index === -1) {\n newItems = [].concat(items, [newItem]);\n } else {\n newItems = [].concat(items.slice(0, index), [newItem], items.slice(index));\n }\n }\n\n return newItems.map(function (item, index) {\n return _extends({}, item, {\n index: index\n });\n });\n });\n }, // set is a state setter initialized by the useDescendantsInit hook.\n // We can safely ignore the lint warning here because it will not change\n // between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n var unregisterDescendant = useCallback(function (element) {\n if (!element) {\n return;\n }\n\n set(function (items) {\n return items.filter(function (item) {\n return element !== item.element;\n });\n });\n }, // set is a state setter initialized by the useDescendantsInit hook.\n // We can safely ignore the lint warning here because it will not change\n // between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n return /*#__PURE__*/createElement(Ctx.Provider, {\n value: useMemo(function () {\n return {\n descendants: items,\n registerDescendant: registerDescendant,\n unregisterDescendant: unregisterDescendant\n };\n }, [items, registerDescendant, unregisterDescendant])\n }, children);\n}\n/**\n * Testing this as an abstraction for compound components that use keyboard\n * navigation. Hoping this will help us prevent bugs and mismatched behavior\n * across various components, but it may also prove to be too messy of an\n * abstraction in the end.\n *\n * Currently used in:\n * - Tabs\n * - Accordion\n *\n * @param context\n * @param options\n */\n\n\nfunction useDescendantKeyDown(context, options) {\n var _React$useContext2 = useContext(context),\n descendants = _React$useContext2.descendants;\n\n var callback = options.callback,\n currentIndex = options.currentIndex,\n filter = options.filter,\n _options$key = options.key,\n key = _options$key === void 0 ? \"index\" : _options$key,\n _options$orientation = options.orientation,\n orientation = _options$orientation === void 0 ? \"vertical\" : _options$orientation,\n _options$rotate = options.rotate,\n rotate = _options$rotate === void 0 ? true : _options$rotate,\n _options$rtl = options.rtl,\n rtl = _options$rtl === void 0 ? false : _options$rtl;\n var index = currentIndex != null ? currentIndex : -1;\n return function handleKeyDown(event) {\n if (![\"ArrowDown\", \"ArrowUp\", \"ArrowLeft\", \"ArrowRight\", \"PageUp\", \"PageDown\", \"Home\", \"End\"].includes(event.key)) {\n return;\n } // If we use a filter function, we need to re-index our descendants array\n // so that filtered descendent elements aren't selected.\n\n\n var selectableDescendants = filter ? descendants.filter(filter) : descendants; // Current index should map to the updated array vs. the original\n // descendants array.\n\n if (filter) {\n index = selectableDescendants.findIndex(function (descendant) {\n return descendant.index === currentIndex;\n });\n } // We need some options for any of this to work!\n\n\n if (!selectableDescendants.length) {\n return;\n }\n\n function getNextOption() {\n var atBottom = index === selectableDescendants.length - 1;\n return atBottom ? rotate ? getFirstOption() : selectableDescendants[index] : selectableDescendants[(index + 1) % selectableDescendants.length];\n }\n\n function getPreviousOption() {\n var atTop = index === 0;\n return atTop ? rotate ? getLastOption() : selectableDescendants[index] : selectableDescendants[(index - 1 + selectableDescendants.length) % selectableDescendants.length];\n }\n\n function getFirstOption() {\n return selectableDescendants[0];\n }\n\n function getLastOption() {\n return selectableDescendants[selectableDescendants.length - 1];\n }\n\n switch (event.key) {\n case \"ArrowDown\":\n if (orientation === \"vertical\" || orientation === \"both\") {\n event.preventDefault();\n var next = getNextOption();\n callback(key === \"option\" ? next : next[key]);\n }\n\n break;\n\n case \"ArrowUp\":\n if (orientation === \"vertical\" || orientation === \"both\") {\n event.preventDefault();\n var prev = getPreviousOption();\n callback(key === \"option\" ? prev : prev[key]);\n }\n\n break;\n\n case \"ArrowLeft\":\n if (orientation === \"horizontal\" || orientation === \"both\") {\n event.preventDefault();\n var nextOrPrev = (rtl ? getNextOption : getPreviousOption)();\n callback(key === \"option\" ? nextOrPrev : nextOrPrev[key]);\n }\n\n break;\n\n case \"ArrowRight\":\n if (orientation === \"horizontal\" || orientation === \"both\") {\n event.preventDefault();\n var prevOrNext = (rtl ? getPreviousOption : getNextOption)();\n callback(key === \"option\" ? prevOrNext : prevOrNext[key]);\n }\n\n break;\n\n case \"PageUp\":\n event.preventDefault();\n var prevOrFirst = (event.ctrlKey ? getPreviousOption : getFirstOption)();\n callback(key === \"option\" ? prevOrFirst : prevOrFirst[key]);\n break;\n\n case \"Home\":\n event.preventDefault();\n var first = getFirstOption();\n callback(key === \"option\" ? first : first[key]);\n break;\n\n case \"PageDown\":\n event.preventDefault();\n var nextOrLast = (event.ctrlKey ? getNextOption : getLastOption)();\n callback(key === \"option\" ? nextOrLast : nextOrLast[key]);\n break;\n\n case \"End\":\n event.preventDefault();\n var last = getLastOption();\n callback(key === \"option\" ? last : last[key]);\n break;\n }\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\nexport { DescendantProvider, createDescendantContext, useDescendant, useDescendantKeyDown, useDescendants, useDescendantsInit };\n","import { useRef, useState, useCallback, useEffect, useMemo } from 'react';\nimport { interpret, createMachine } from '@xstate/fsm';\nexport { InterpreterStatus, assign, createMachine, interpret } from '@xstate/fsm';\nimport { useConstant, isString } from '@reach/utils';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nvar getServiceState = function getServiceState(service) {\n var currentValue;\n service.subscribe(function (state) {\n currentValue = state;\n }).unsubscribe();\n return currentValue;\n};\n/**\n * This `useMachine` works very similiarly to what you get from `@xstate/react`\n * with some additions.\n * - A second argument `refs` is passed to send all of our refs into our\n * machine's contextual data object.\n * - We wrap the `send` function so that refs are updated included in all of\n * our events so we can use their current value (generally DOM nodes)\n * anywhere in our actions.\n * - We initialize the machine inside the component rather than throwing an\n * error if an outside initializer creates a value that doesn't match. This\n * is useful as some components may need a different initial state or some\n * initial data based on props. We should *generally* just update the state\n * with an event via useEffect and depend on a static initial value, but this\n * is difficult if that initial value matters for SSR or to prevent some\n * layout jank before the first paint. I don't think there's a problem with\n * this approach, but we'll see what happens.\n *\n * @param initialMachine\n * @param refs\n */\n\n\nfunction useMachine(initialMachine, refs, DEBUG) {\n // State machine should not change between renders, so let's store it in a\n // ref. This should also help if we need to use a creator function to inject\n // dynamic initial state values based on props.\n var machineRef = useRef(initialMachine);\n var service = useConstant(function () {\n return interpret(machineRef.current).start();\n });\n var lastEventType = useRef(null);\n\n var _React$useState = useState(function () {\n return getServiceState(service);\n }),\n state = _React$useState[0],\n setState = _React$useState[1]; // This function reference will change on every render if we just pass on\n // current.matches, but it shouldn't change unless the current value is\n // updated. This was causing some lagginess when profiling in Listbox but\n // is probably an issue everywhere since the parent components that handle\n // state logic at the top might re-create context on each render as a\n // result of this change.\n // Add refs to every event so we can use them to perform actions.\n\n\n var send = useCallback(function (rawEvent) {\n var event = isString(rawEvent) ? {\n type: rawEvent\n } : rawEvent;\n var refValues = unwrapRefs(refs);\n service.send(_extends({}, event, {\n lastEventType: lastEventType.current,\n refs: refValues\n }));\n lastEventType.current = event.type;\n\n if (process.env.NODE_ENV !== \"production\") {\n if (DEBUG) {\n console.group(\"Event Sent\");\n console.log(\"Event:\", event);\n console.groupEnd();\n }\n }\n }, // We can disable the lint warning here. Refs will always be refs\n // (TypeScript enforced!) and should not trigger a re-render. The state\n // machine service persist for the life of the component.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [DEBUG]);\n useEffect(function () {\n service.subscribe(function setStateIfChanged(newState) {\n if (newState.changed) {\n setState(newState);\n }\n });\n return function () {\n service.stop();\n };\n }, [service]);\n useEffect(function () {\n if (process.env.NODE_ENV !== \"production\") {\n if (DEBUG && state.changed) {\n console.group(\"State Updated\");\n console.log(\"State:\", state);\n console.groupEnd();\n }\n }\n }, [DEBUG, state]); // We are going to pass along our state without the actions to avoid excess\n // renders when the reference changes. We haven't really needed them at this\n // point, but if we do we can maybe reconsider this approach.\n\n var memoizedState = useMemo(function () {\n return _extends({}, state, {\n matches: function matches(value) {\n return value === state.value;\n }\n });\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [state.changed, state.context, state.value]);\n return [memoizedState, send, service];\n}\n/**\n * Converts an object with React refs into an object with the same keys and\n * the current value of those refs.\n *\n * @param refs\n */\n\nfunction unwrapRefs(refs) {\n return Object.entries(refs).reduce(function (value, _ref) {\n var name = _ref[0],\n ref = _ref[1];\n value[name] = ref.current;\n return value;\n }, {});\n}\n/**\n * Most of the time you want to create a static state machine outside of your\n * component, but in some cases we may need data from props in the first render\n * cycle. We can create our machine in each component IF we only create it once\n * and guarantee that it never changes between renders.\n *\n * This hook can take a machine definition created by a function inline to use\n * values defined in the component, and we never change the machine for the\n * life of the component.\n *\n * @param machineDefinition\n * @param options\n */\n\nfunction useCreateMachine(machineDefinition, options) {\n return useConstant(function () {\n return createMachine(machineDefinition, options);\n });\n} ////////////////////////////////////////////////////////////////////////////////\n\nexport { unwrapRefs, useCreateMachine, useMachine };\n","import { useRef, useMemo, useEffect, createElement, Fragment, useContext, useState, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { useId } from '@reach/auto-id';\nimport { Popover, positionMatchWidth } from '@reach/popover';\nimport { createDescendantContext, useDescendantsInit, DescendantProvider, useDescendant, useDescendants, useDescendantKeyDown } from '@reach/descendants';\nimport { getOwnerDocument, createNamedContext, forwardRefWithAs, useStableCallback, makeId, useForkedRef, useControlledSwitchWarning, useIsomorphicLayoutEffect, useCheckStyles, isFunction, wrapEvent, isBoolean, memoWithAs, isString, isRightClick } from '@reach/utils';\nimport { assign, useCreateMachine, useMachine } from '@reach/machine';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar _commonEvents;\n////////////////////////////////////////////////////////////////////////////////\n// States\nvar ListboxStates; ////////////////////////////////////////////////////////////////////////////////\n// Events\n\n(function (ListboxStates) {\n ListboxStates[\"Idle\"] = \"IDLE\";\n ListboxStates[\"Open\"] = \"OPEN\";\n ListboxStates[\"Navigating\"] = \"NAVIGATING\";\n ListboxStates[\"Dragging\"] = \"DRAGGING\";\n ListboxStates[\"Interacting\"] = \"INTERACTING\";\n})(ListboxStates || (ListboxStates = {}));\n\nvar ListboxEvents; ////////////////////////////////////////////////////////////////////////////////\n// Actions and conditions\n\n(function (ListboxEvents) {\n ListboxEvents[\"ButtonMouseDown\"] = \"BUTTON_MOUSE_DOWN\";\n ListboxEvents[\"ButtonMouseUp\"] = \"BUTTON_MOUSE_UP\";\n ListboxEvents[\"Blur\"] = \"BLUR\";\n ListboxEvents[\"ClearNavSelection\"] = \"CLEAR_NAV_SELECTION\";\n ListboxEvents[\"ClearTypeahead\"] = \"CLEAR_TYPEAHEAD\";\n ListboxEvents[\"GetDerivedData\"] = \"GET_DERIVED_DATA\";\n ListboxEvents[\"KeyDownEscape\"] = \"KEY_DOWN_ESCAPE\";\n ListboxEvents[\"KeyDownEnter\"] = \"KEY_DOWN_ENTER\";\n ListboxEvents[\"KeyDownSpace\"] = \"KEY_DOWN_SPACE\";\n ListboxEvents[\"KeyDownNavigate\"] = \"KEY_DOWN_NAVIGATE\";\n ListboxEvents[\"KeyDownSearch\"] = \"KEY_DOWN_SEARCH\";\n ListboxEvents[\"KeyDownTab\"] = \"KEY_DOWN_TAB\";\n ListboxEvents[\"KeyDownShiftTab\"] = \"KEY_DOWN_SHIFT_TAB\";\n ListboxEvents[\"OptionTouchStart\"] = \"OPTION_TOUCH_START\";\n ListboxEvents[\"OptionMouseMove\"] = \"OPTION_MOUSE_MOVE\";\n ListboxEvents[\"OptionMouseEnter\"] = \"OPTION_MOUSE_ENTER\";\n ListboxEvents[\"OutsideMouseDown\"] = \"OUTSIDE_MOUSE_DOWN\";\n ListboxEvents[\"OutsideMouseUp\"] = \"OUTSIDE_MOUSE_UP\";\n ListboxEvents[\"ValueChange\"] = \"VALUE_CHANGE\";\n ListboxEvents[\"OptionMouseDown\"] = \"OPTION_MOUSE_DOWN\";\n ListboxEvents[\"OptionMouseUp\"] = \"OPTION_MOUSE_UP\";\n ListboxEvents[\"PopoverPointerDown\"] = \"POPOVER_POINTER_DOWN\";\n ListboxEvents[\"PopoverPointerUp\"] = \"POPOVER_POINTER_UP\";\n ListboxEvents[\"UpdateAfterTypeahead\"] = \"UPDATE_AFTER_TYPEAHEAD\";\n})(ListboxEvents || (ListboxEvents = {}));\n\nvar clearNavigationValue = /*#__PURE__*/assign({\n navigationValue: null\n});\nvar clearTypeahead = /*#__PURE__*/assign({\n typeaheadQuery: null\n});\nvar assignValue = /*#__PURE__*/assign({\n value: function value(_, event) {\n return event.value;\n }\n});\nvar navigate = /*#__PURE__*/assign({\n navigationValue: function navigationValue(data, event) {\n return event.value;\n }\n});\nvar navigateFromCurrentValue = /*#__PURE__*/assign({\n navigationValue: function navigationValue(data) {\n // Before we navigate based on the current value, we need to make sure the\n // current value is selectable. If not, we should instead navigate to the\n // first selectable option.\n var selected = findOptionFromValue(data.value, data.options);\n\n if (selected && !selected.disabled) {\n return data.value;\n } else {\n var _data$options$find;\n\n return ((_data$options$find = data.options.find(function (option) {\n return !option.disabled;\n })) == null ? void 0 : _data$options$find.value) || null;\n }\n }\n});\n\nfunction listboxLostFocus(data, event) {\n if (event.type === ListboxEvents.Blur) {\n var _event$refs = event.refs,\n list = _event$refs.list,\n popover = _event$refs.popover;\n var relatedTarget = event.relatedTarget;\n var ownerDocument = getOwnerDocument(popover);\n return !!((ownerDocument == null ? void 0 : ownerDocument.activeElement) !== list && popover && !popover.contains(relatedTarget || (ownerDocument == null ? void 0 : ownerDocument.activeElement)));\n }\n\n return false;\n}\n\nfunction clickedOutsideOfListbox(data, event) {\n if (event.type === ListboxEvents.OutsideMouseDown || event.type === ListboxEvents.OutsideMouseUp) {\n var _event$refs2 = event.refs,\n button = _event$refs2.button,\n popover = _event$refs2.popover;\n var relatedTarget = event.relatedTarget; // Close the popover IF:\n\n return !!( // clicked element is not the button\n relatedTarget !== button && // clicked element is not inside the button\n button && !button.contains(relatedTarget) && // clicked element is not inside the popover\n popover && !popover.contains(relatedTarget));\n }\n\n return false;\n}\n\nfunction optionIsActive(data, event) {\n return !!data.options.find(function (option) {\n return option.value === data.navigationValue;\n });\n}\n\nfunction shouldNavigate(data, event) {\n var _event$refs3 = event.refs,\n popover = _event$refs3.popover,\n list = _event$refs3.list;\n var relatedTarget = event.relatedTarget; // When a blur event happens, we want to move to Navigating state unless the\n // user is interacting with elements inside the popover...\n\n if (popover && relatedTarget && popover.contains(relatedTarget) && relatedTarget !== list) {\n return false;\n } // ...otherwise, just make sure the next option is selectable\n\n\n return optionIsActive(data);\n}\n\nfunction focusList(data, event) {\n requestAnimationFrame(function () {\n event.refs.list && event.refs.list.focus();\n });\n}\n\nfunction focusButton(data, event) {\n event.refs.button && event.refs.button.focus();\n}\n\nfunction listboxIsNotDisabled(data, event) {\n return !event.disabled;\n}\n\nfunction optionIsNavigable(data, event) {\n if (event.type === ListboxEvents.OptionTouchStart) {\n if (event && event.disabled) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction optionIsSelectable(data, event) {\n if (event && event.disabled) {\n return false;\n }\n\n return data.navigationValue != null;\n}\n\nfunction selectOption(data, event) {\n event.callback && event.callback(event.value);\n}\n\nfunction submitForm(data, event) {\n if (event.type !== ListboxEvents.KeyDownEnter) {\n return;\n } // So this one is a little weird, but here's what we're doing.\n // When a user presses Enter in the context of a form, the form\n // should submit. Now I know you're probably thinking:\n //\n // \"Aha! I've got it!\"\n // > inputNode.form.submit()\n // ** cracks knuckles ** \"Phew. My work here is done.\"\n //\n // But alas, we are not so lucky. What's really happening when a\n // user presses enter in a normal form field is that the browser\n // looks at the form the input is in, then looks for the first\n // button or input in that form where its type property is `submit`,\n // then it triggers a click event on that button. COOL, CARRY ON.\n //\n // If we were to fire inputNode.form.submit(), this would bypass any\n // onSubmit handler in the form and just do what the browser\n // normally does when you submit a form and trigger a page refresh.\n // No bueno. So we do what the browser does and just go on a duck\n // hunt for the first submit button in the form and we click that\n // sucker.\n\n\n var hiddenInput = event.refs.hiddenInput;\n\n if (hiddenInput && hiddenInput.form) {\n var submitButton = hiddenInput.form.querySelector(\"button,[type='submit']\");\n submitButton && submitButton.click();\n }\n}\n\nvar setTypeahead = /*#__PURE__*/assign({\n typeaheadQuery: function typeaheadQuery(data, event) {\n return (data.typeaheadQuery || \"\") + event.query;\n }\n});\nvar setValueFromTypeahead = /*#__PURE__*/assign({\n value: function value(data, event) {\n if (event.type === ListboxEvents.UpdateAfterTypeahead && event.query) {\n var match = findOptionFromTypeahead(data.options, event.query);\n\n if (match && !match.disabled) {\n event.callback && event.callback(match.value);\n return match.value;\n }\n }\n\n return data.value;\n }\n});\nvar setNavSelectionFromTypeahead = /*#__PURE__*/assign({\n navigationValue: function navigationValue(data, event) {\n if (event.type === ListboxEvents.UpdateAfterTypeahead && event.query) {\n var match = findOptionFromTypeahead(data.options, event.query);\n\n if (match && !match.disabled) {\n return match.value;\n }\n }\n\n return data.navigationValue;\n }\n});\nvar commonEvents = (_commonEvents = {}, _commonEvents[ListboxEvents.GetDerivedData] = {\n actions: /*#__PURE__*/assign(function (ctx, event) {\n return _extends({}, ctx, event.data);\n })\n}, _commonEvents[ListboxEvents.ValueChange] = {\n actions: [assignValue, selectOption]\n}, _commonEvents); ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Initializer for our state machine.\n *\n * @param initial\n * @param props\n */\n\nvar createMachineDefinition = function createMachineDefinition(_ref) {\n var _default2, _default3, _default4, _default5, _default6, _states;\n\n var value = _ref.value;\n return {\n id: \"listbox\",\n initial: ListboxStates.Idle,\n context: {\n value: value,\n options: [],\n navigationValue: null,\n typeaheadQuery: null\n },\n states: (_states = {}, _states[ListboxStates.Idle] = {\n on: _extends({}, commonEvents, (_default2 = {}, _default2[ListboxEvents.ButtonMouseDown] = {\n target: ListboxStates.Open,\n actions: [navigateFromCurrentValue],\n cond: listboxIsNotDisabled\n }, _default2[ListboxEvents.KeyDownSpace] = {\n target: ListboxStates.Navigating,\n actions: [navigateFromCurrentValue, focusList],\n cond: listboxIsNotDisabled\n }, _default2[ListboxEvents.KeyDownSearch] = {\n target: ListboxStates.Idle,\n actions: setTypeahead,\n cond: listboxIsNotDisabled\n }, _default2[ListboxEvents.UpdateAfterTypeahead] = {\n target: ListboxStates.Idle,\n actions: [setValueFromTypeahead],\n cond: listboxIsNotDisabled\n }, _default2[ListboxEvents.ClearTypeahead] = {\n target: ListboxStates.Idle,\n actions: clearTypeahead\n }, _default2[ListboxEvents.KeyDownNavigate] = {\n target: ListboxStates.Navigating,\n actions: [navigateFromCurrentValue, clearTypeahead, focusList],\n cond: listboxIsNotDisabled\n }, _default2[ListboxEvents.KeyDownEnter] = {\n actions: [submitForm],\n cond: listboxIsNotDisabled\n }, _default2))\n }, _states[ListboxStates.Interacting] = {\n entry: [clearNavigationValue],\n on: _extends({}, commonEvents, (_default3 = {}, _default3[ListboxEvents.ClearNavSelection] = {\n actions: [clearNavigationValue, focusList]\n }, _default3[ListboxEvents.KeyDownEnter] = {\n target: ListboxStates.Idle,\n actions: [assignValue, clearTypeahead, focusButton, selectOption],\n cond: optionIsSelectable\n }, _default3[ListboxEvents.KeyDownSpace] = {\n target: ListboxStates.Idle,\n actions: [assignValue, clearTypeahead, focusButton, selectOption],\n cond: optionIsSelectable\n }, _default3[ListboxEvents.ButtonMouseDown] = {\n target: ListboxStates.Idle,\n // When the user triggers a mouseDown event on the button, we call\n // event.preventDefault() because the browser will naturally send a\n // mouseup event and click, which will reopen the button (which we\n // don't want). As such, the click won't blur the open list or\n // re-focus the trigger, so we call `focusButton` to do that manually.\n // We could work around this with deferred transitions with xstate,\n // but @xstate/fsm currently doesn't support that feature and this\n // works good enough for the moment.\n actions: [focusButton]\n }, _default3[ListboxEvents.KeyDownEscape] = {\n target: ListboxStates.Idle,\n actions: [focusButton]\n }, _default3[ListboxEvents.OptionMouseDown] = {\n target: ListboxStates.Dragging\n }, _default3[ListboxEvents.OutsideMouseDown] = [{\n target: ListboxStates.Idle,\n cond: clickedOutsideOfListbox,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Dragging,\n actions: clearTypeahead,\n cond: optionIsActive\n }], _default3[ListboxEvents.OutsideMouseUp] = [{\n target: ListboxStates.Idle,\n cond: clickedOutsideOfListbox,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: optionIsActive\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default3[ListboxEvents.KeyDownEnter] = ListboxStates.Interacting, _default3[ListboxEvents.Blur] = [{\n target: ListboxStates.Idle,\n cond: listboxLostFocus,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: shouldNavigate\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default3[ListboxEvents.OptionTouchStart] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead],\n cond: optionIsNavigable\n }, _default3[ListboxEvents.OptionMouseEnter] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead],\n cond: optionIsNavigable\n }, _default3[ListboxEvents.KeyDownNavigate] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead, focusList]\n }, _default3))\n }, _states[ListboxStates.Open] = {\n on: _extends({}, commonEvents, (_default4 = {}, _default4[ListboxEvents.ClearNavSelection] = {\n actions: [clearNavigationValue]\n }, _default4[ListboxEvents.KeyDownEnter] = {\n target: ListboxStates.Idle,\n actions: [assignValue, clearTypeahead, focusButton, selectOption],\n cond: optionIsSelectable\n }, _default4[ListboxEvents.KeyDownSpace] = {\n target: ListboxStates.Idle,\n actions: [assignValue, clearTypeahead, focusButton, selectOption],\n cond: optionIsSelectable\n }, _default4[ListboxEvents.ButtonMouseDown] = {\n target: ListboxStates.Idle,\n actions: [focusButton]\n }, _default4[ListboxEvents.KeyDownEscape] = {\n target: ListboxStates.Idle,\n actions: [focusButton]\n }, _default4[ListboxEvents.OptionMouseDown] = {\n target: ListboxStates.Dragging\n }, _default4[ListboxEvents.OutsideMouseDown] = [{\n target: ListboxStates.Idle,\n cond: clickedOutsideOfListbox,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Dragging,\n cond: optionIsActive\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default4[ListboxEvents.OutsideMouseUp] = [{\n target: ListboxStates.Idle,\n cond: clickedOutsideOfListbox,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: optionIsActive\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default4[ListboxEvents.Blur] = [{\n target: ListboxStates.Idle,\n cond: listboxLostFocus,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: shouldNavigate\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default4[ListboxEvents.ButtonMouseUp] = {\n target: ListboxStates.Navigating,\n actions: [navigateFromCurrentValue, focusList]\n }, _default4[ListboxEvents.OptionTouchStart] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead],\n cond: optionIsNavigable\n }, _default4[ListboxEvents.KeyDownNavigate] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead, focusList]\n }, _default4[ListboxEvents.KeyDownSearch] = {\n target: ListboxStates.Navigating,\n actions: setTypeahead\n }, _default4[ListboxEvents.UpdateAfterTypeahead] = {\n actions: [setNavSelectionFromTypeahead]\n }, _default4[ListboxEvents.ClearTypeahead] = {\n actions: clearTypeahead\n }, _default4[ListboxEvents.OptionMouseMove] = [{\n target: ListboxStates.Dragging,\n actions: [navigate],\n cond: optionIsNavigable\n }, {\n target: ListboxStates.Dragging\n }], _default4))\n }, _states[ListboxStates.Dragging] = {\n on: _extends({}, commonEvents, (_default5 = {}, _default5[ListboxEvents.ClearNavSelection] = {\n actions: [clearNavigationValue]\n }, _default5[ListboxEvents.KeyDownEnter] = {\n target: ListboxStates.Idle,\n actions: [assignValue, clearTypeahead, focusButton, selectOption],\n cond: optionIsSelectable\n }, _default5[ListboxEvents.KeyDownSpace] = {\n target: ListboxStates.Idle,\n actions: [assignValue, clearTypeahead, focusButton, selectOption],\n cond: optionIsSelectable\n }, _default5[ListboxEvents.ButtonMouseDown] = {\n target: ListboxStates.Idle,\n actions: [focusButton]\n }, _default5[ListboxEvents.KeyDownEscape] = {\n target: ListboxStates.Idle,\n actions: [focusButton]\n }, _default5[ListboxEvents.OptionMouseDown] = {\n target: ListboxStates.Dragging\n }, _default5[ListboxEvents.OutsideMouseDown] = [{\n target: ListboxStates.Idle,\n cond: clickedOutsideOfListbox,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: optionIsActive\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default5[ListboxEvents.OutsideMouseUp] = [{\n target: ListboxStates.Idle,\n cond: clickedOutsideOfListbox,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: optionIsActive,\n actions: focusList\n }, {\n target: ListboxStates.Interacting,\n actions: [clearTypeahead, focusList]\n }], _default5[ListboxEvents.Blur] = [{\n target: ListboxStates.Idle,\n cond: listboxLostFocus,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: shouldNavigate\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default5[ListboxEvents.ButtonMouseUp] = {\n target: ListboxStates.Navigating,\n actions: [navigateFromCurrentValue, focusList]\n }, _default5[ListboxEvents.OptionTouchStart] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead],\n cond: optionIsNavigable\n }, _default5[ListboxEvents.OptionMouseEnter] = {\n target: ListboxStates.Dragging,\n actions: [navigate, clearTypeahead],\n cond: optionIsNavigable\n }, _default5[ListboxEvents.KeyDownNavigate] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead, focusList]\n }, _default5[ListboxEvents.KeyDownSearch] = {\n target: ListboxStates.Navigating,\n actions: setTypeahead\n }, _default5[ListboxEvents.UpdateAfterTypeahead] = {\n actions: [setNavSelectionFromTypeahead]\n }, _default5[ListboxEvents.ClearTypeahead] = {\n actions: clearTypeahead\n }, _default5[ListboxEvents.OptionMouseMove] = [{\n target: ListboxStates.Navigating,\n actions: [navigate],\n cond: optionIsNavigable\n }, {\n target: ListboxStates.Navigating\n }], _default5[ListboxEvents.OptionMouseUp] = {\n target: ListboxStates.Idle,\n actions: [assignValue, clearTypeahead, focusButton, selectOption],\n cond: optionIsSelectable\n }, _default5))\n }, _states[ListboxStates.Navigating] = {\n on: _extends({}, commonEvents, (_default6 = {}, _default6[ListboxEvents.ClearNavSelection] = {\n actions: [clearNavigationValue, focusList]\n }, _default6[ListboxEvents.KeyDownEnter] = {\n target: ListboxStates.Idle,\n actions: [assignValue, clearTypeahead, focusButton, selectOption],\n cond: optionIsSelectable\n }, _default6[ListboxEvents.KeyDownSpace] = {\n target: ListboxStates.Idle,\n actions: [assignValue, clearTypeahead, focusButton, selectOption],\n cond: optionIsSelectable\n }, _default6[ListboxEvents.ButtonMouseDown] = {\n target: ListboxStates.Idle,\n actions: [focusButton]\n }, _default6[ListboxEvents.KeyDownEscape] = {\n target: ListboxStates.Idle,\n actions: [focusButton]\n }, _default6[ListboxEvents.OptionMouseDown] = {\n target: ListboxStates.Dragging\n }, _default6[ListboxEvents.OutsideMouseDown] = [{\n target: ListboxStates.Idle,\n cond: clickedOutsideOfListbox,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: optionIsActive\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default6[ListboxEvents.OutsideMouseUp] = [{\n target: ListboxStates.Idle,\n cond: clickedOutsideOfListbox,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: optionIsActive\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default6[ListboxEvents.Blur] = [{\n target: ListboxStates.Idle,\n cond: listboxLostFocus,\n actions: clearTypeahead\n }, {\n target: ListboxStates.Navigating,\n cond: shouldNavigate\n }, {\n target: ListboxStates.Interacting,\n actions: clearTypeahead\n }], _default6[ListboxEvents.ButtonMouseUp] = {\n target: ListboxStates.Navigating,\n actions: [navigateFromCurrentValue, focusList]\n }, _default6[ListboxEvents.OptionTouchStart] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead],\n cond: optionIsNavigable\n }, _default6[ListboxEvents.OptionMouseEnter] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead],\n cond: optionIsNavigable\n }, _default6[ListboxEvents.KeyDownNavigate] = {\n target: ListboxStates.Navigating,\n actions: [navigate, clearTypeahead, focusList]\n }, _default6[ListboxEvents.KeyDownSearch] = {\n target: ListboxStates.Navigating,\n actions: setTypeahead\n }, _default6[ListboxEvents.UpdateAfterTypeahead] = {\n actions: [setNavSelectionFromTypeahead]\n }, _default6[ListboxEvents.ClearTypeahead] = {\n actions: clearTypeahead\n }, _default6[ListboxEvents.OptionMouseMove] = [{\n target: ListboxStates.Navigating,\n actions: [navigate],\n cond: optionIsNavigable\n }, {\n target: ListboxStates.Navigating\n }], _default6))\n }, _states)\n };\n}; ////////////////////////////////////////////////////////////////////////////////\n\nfunction findOptionFromTypeahead(options, string) {\n if (string === void 0) {\n string = \"\";\n }\n\n if (!string) return null;\n var found = options.find(function (option) {\n return !option.disabled && option.label && option.label.toLowerCase().startsWith(string.toLowerCase());\n });\n return found || null;\n}\n\nfunction findOptionFromValue(value, options) {\n return value ? options.find(function (option) {\n return option.value === value;\n }) : undefined;\n} ////////////////////////////////////////////////////////////////////////////////\n// Types\n\n/**\n * Shared partial interface for all of our event objects.\n */\n\nvar DEBUG = false; ////////////////////////////////////////////////////////////////////////////////\n// ListboxContext\n\nvar ListboxDescendantContext = /*#__PURE__*/createDescendantContext(\"ListboxDescendantContext\");\nvar ListboxContext = /*#__PURE__*/createNamedContext(\"ListboxContext\", {});\nvar ListboxGroupContext = /*#__PURE__*/createNamedContext(\"ListboxGroupContext\", {}); ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ListboxInput\n *\n * The top-level component and context provider for the listbox.\n *\n * @see Docs https://reach.tech/listbox#listboxinput\n */\n\nvar ListboxInput = /*#__PURE__*/forwardRefWithAs(function ListboxInput(_ref, forwardedRef) {\n var _ref$as = _ref.as,\n Comp = _ref$as === void 0 ? \"div\" : _ref$as,\n ariaLabelledBy = _ref[\"aria-labelledby\"],\n ariaLabel = _ref[\"aria-label\"],\n children = _ref.children,\n defaultValue = _ref.defaultValue,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n form = _ref.form,\n name = _ref.name,\n onChange = _ref.onChange,\n required = _ref.required,\n valueProp = _ref.value,\n _ref$_componentName = _ref._componentName,\n _componentName = _ref$_componentName === void 0 ? \"ListboxInput\" : _ref$_componentName,\n props = _objectWithoutPropertiesLoose(_ref, [\"as\", \"aria-labelledby\", \"aria-label\", \"children\", \"defaultValue\", \"disabled\", \"form\", \"name\", \"onChange\", \"required\", \"value\", \"_componentName\"]);\n\n var isControlled = useRef(valueProp != null);\n\n var _useDescendantsInit = useDescendantsInit(),\n options = _useDescendantsInit[0],\n setOptions = _useDescendantsInit[1];\n\n var stableOnChange = useStableCallback(onChange); // DOM refs\n\n var buttonRef = useRef(null);\n var hiddenInputRef = useRef(null);\n var highlightedOptionRef = useRef(null);\n var inputRef = useRef(null);\n var listRef = useRef(null);\n var popoverRef = useRef(null);\n var selectedOptionRef = useRef(null);\n var machine = useCreateMachine(createMachineDefinition({\n // The initial value of our machine should come from the `value` or\n // `defaultValue` props if they exist.\n value: (isControlled.current ? valueProp : defaultValue) || null\n }));\n\n var _useMachine = useMachine(machine, {\n button: buttonRef,\n hiddenInput: hiddenInputRef,\n highlightedOption: highlightedOptionRef,\n input: inputRef,\n list: listRef,\n popover: popoverRef,\n selectedOption: selectedOptionRef\n }, DEBUG),\n state = _useMachine[0],\n send = _useMachine[1]; // IDs for aria attributes\n\n\n var _id = useId(props.id);\n\n var id = props.id || makeId(\"listbox-input\", _id);\n var ref = useForkedRef(inputRef, forwardedRef); // If the button has children, we just render them as the label.\n // Otherwise we'll find the option with a value that matches the listbox value\n // and use its label in the button. We'll get that here and send it to the\n // button via context.\n // If a user needs the label for SSR to prevent hydration mismatch issues,\n // they need to control the state of the component and pass a label directly\n // to the button.\n\n var valueLabel = useMemo(function () {\n var selected = options.find(function (option) {\n return option.value === state.context.value;\n });\n return selected ? selected.label : null;\n }, [options, state.context.value]);\n var isExpanded = isListboxExpanded(state.value); // TODO: Remove duplication and memoize\n\n var context = useMemo(function () {\n return {\n ariaLabel: ariaLabel,\n ariaLabelledBy: ariaLabelledBy,\n disabled: disabled,\n isExpanded: isExpanded,\n listboxId: id,\n listboxValueLabel: valueLabel,\n onValueChange: stableOnChange,\n buttonRef: buttonRef,\n listRef: listRef,\n popoverRef: popoverRef,\n selectedOptionRef: selectedOptionRef,\n highlightedOptionRef: highlightedOptionRef,\n send: send,\n state: state.value,\n stateData: state.context\n };\n }, [ariaLabel, ariaLabelledBy, state.value, state.context, disabled, id, isExpanded, stableOnChange, send, valueLabel]); // For uncontrolled listbox components where no `defaultValue` is provided, we\n // will update the value based on the value of the first selectable option.\n // We call the update directly because:\n // A) we only ever need to do this once, so we can guard with a ref\n // B) useLayoutEffect races useDecendant, so we might not have options yet\n // C) useEffect will cause a flash\n\n var mounted = useRef(false);\n\n if (!isControlled.current && // the app is not controlling state\n defaultValue == null && // there is no default value\n !mounted.current && // we haven't done this already\n options.length // we have some options\n ) {\n mounted.current = true;\n var first = options.find(function (option) {\n return !option.disabled;\n });\n\n if (first && first.value) {\n send({\n type: ListboxEvents.ValueChange,\n value: first.value\n });\n }\n }\n\n useControlledSwitchWarning(valueProp, \"value\", _componentName); // Even if the app controls state, we still need to update it internally to\n // run the state machine transitions\n\n useControlledStateSync(valueProp, state.context.value, function () {\n send({\n type: ListboxEvents.ValueChange,\n value: valueProp\n });\n });\n useIsomorphicLayoutEffect(function () {\n send({\n type: ListboxEvents.GetDerivedData,\n data: {\n options: options\n }\n });\n }, [options, send]);\n useEffect(function () {\n function handleMouseDown(event) {\n var target = event.target,\n relatedTarget = event.relatedTarget;\n\n if (!popoverContainsEventTarget(popoverRef.current, target)) {\n send({\n type: ListboxEvents.OutsideMouseDown,\n relatedTarget: relatedTarget || target\n });\n }\n }\n\n if (isExpanded) {\n window.addEventListener(\"mousedown\", handleMouseDown);\n }\n\n return function () {\n window.removeEventListener(\"mousedown\", handleMouseDown);\n };\n }, [send, isExpanded]);\n useEffect(function () {\n function handleMouseUp(event) {\n var target = event.target,\n relatedTarget = event.relatedTarget;\n\n if (!popoverContainsEventTarget(popoverRef.current, target)) {\n send({\n type: ListboxEvents.OutsideMouseUp,\n relatedTarget: relatedTarget || target\n });\n }\n }\n\n if (isExpanded) {\n window.addEventListener(\"mouseup\", handleMouseUp);\n }\n\n return function () {\n window.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }, [send, isExpanded]);\n useCheckStyles(\"listbox\");\n return /*#__PURE__*/createElement(DescendantProvider, {\n context: ListboxDescendantContext,\n items: options,\n set: setOptions\n }, /*#__PURE__*/createElement(ListboxContext.Provider, {\n value: context\n }, /*#__PURE__*/createElement(Comp, _extends({}, props, {\n ref: ref,\n \"data-reach-listbox-input\": \"\",\n \"data-state\": isExpanded ? \"expanded\" : \"closed\",\n \"data-value\": state.context.value,\n id: id\n }), isFunction(children) ? children({\n id: id,\n isExpanded: isExpanded,\n value: state.context.value,\n selectedOptionRef: selectedOptionRef,\n highlightedOptionRef: highlightedOptionRef,\n valueLabel: valueLabel,\n // TODO: Remove in 1.0\n expanded: isExpanded\n }) : children), (form || name || required) && /*#__PURE__*/createElement(\"input\", {\n ref: hiddenInputRef,\n \"data-reach-listbox-hidden-input\": \"\",\n disabled: disabled,\n form: form,\n name: name,\n readOnly: true,\n required: required,\n tabIndex: -1,\n type: \"hidden\",\n value: state.context.value || \"\"\n })));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ListboxInput.displayName = \"ListboxInput\";\n ListboxInput.propTypes = {\n children: /*#__PURE__*/PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n defaultValue: PropTypes.string,\n disabled: PropTypes.bool,\n form: PropTypes.string,\n name: PropTypes.string,\n onChange: PropTypes.func,\n required: PropTypes.bool,\n value: PropTypes.string\n };\n}\n/**\n * @see Docs https://reach.tech/listbox#listboxinput-props\n */\n\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Listbox\n *\n * High-level listbox API\n *\n * @example\n * <Listbox>\n * <ListboxOption value=\"1\">Option 1</ListboxOption>\n * <ListboxOption value=\"2\">Option 2</ListboxOption>\n * <ListboxOption value=\"3\">Option 3</ListboxOption>\n * </Listbox>\n *\n * @see Docs https://reach.tech/listbox#listbox-1\n */\nvar Listbox = /*#__PURE__*/forwardRefWithAs(function Listbox(_ref2, forwardedRef) {\n var _ref2$arrow = _ref2.arrow,\n arrow = _ref2$arrow === void 0 ? \"▼\" : _ref2$arrow,\n button = _ref2.button,\n children = _ref2.children,\n _ref2$portal = _ref2.portal,\n portal = _ref2$portal === void 0 ? true : _ref2$portal,\n props = _objectWithoutPropertiesLoose(_ref2, [\"arrow\", \"button\", \"children\", \"portal\"]);\n\n return /*#__PURE__*/createElement(ListboxInput, _extends({}, props, {\n _componentName: \"Listbox\",\n ref: forwardedRef\n }), function (_ref3) {\n var value = _ref3.value,\n valueLabel = _ref3.valueLabel;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(ListboxButton, {\n arrow: arrow,\n children: button ? isFunction(button) ? button({\n value: value,\n label: valueLabel\n }) : button : undefined\n }), /*#__PURE__*/createElement(ListboxPopover, {\n portal: portal\n }, /*#__PURE__*/createElement(ListboxList, null, children)));\n });\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n Listbox.displayName = \"Listbox\";\n Listbox.propTypes = /*#__PURE__*/_extends({}, ListboxInput.propTypes, {\n arrow: /*#__PURE__*/PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),\n button: /*#__PURE__*/PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n children: PropTypes.node\n });\n}\n/**\n * @see Docs https://reach.tech/listbox#listbox-props\n */\n\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ListboxButton\n *\n * The interactive toggle button that triggers the popover for the listbox.\n *\n * @see Docs https://reach.tech/listbox#listbox-button\n */\nvar ListboxButtonImpl = /*#__PURE__*/forwardRefWithAs(function ListboxButton(_ref4, forwardedRef) {\n var ariaLabel = _ref4[\"aria-label\"],\n _ref4$arrow = _ref4.arrow,\n arrow = _ref4$arrow === void 0 ? false : _ref4$arrow,\n _ref4$as = _ref4.as,\n Comp = _ref4$as === void 0 ? \"span\" : _ref4$as,\n children = _ref4.children,\n onKeyDown = _ref4.onKeyDown,\n onMouseDown = _ref4.onMouseDown,\n onMouseUp = _ref4.onMouseUp,\n props = _objectWithoutPropertiesLoose(_ref4, [\"aria-label\", \"arrow\", \"as\", \"children\", \"onKeyDown\", \"onMouseDown\", \"onMouseUp\"]);\n\n var _React$useContext = useContext(ListboxContext),\n ariaLabelledBy = _React$useContext.ariaLabelledBy,\n buttonRef = _React$useContext.buttonRef,\n disabled = _React$useContext.disabled,\n isExpanded = _React$useContext.isExpanded,\n listboxId = _React$useContext.listboxId,\n stateData = _React$useContext.stateData,\n send = _React$useContext.send,\n listboxValueLabel = _React$useContext.listboxValueLabel;\n\n var listboxValue = stateData.value;\n var ref = useForkedRef(buttonRef, forwardedRef);\n var handleKeyDown = useKeyDown();\n\n function handleMouseDown(event) {\n if (!isRightClick(event.nativeEvent)) {\n event.preventDefault();\n event.stopPropagation();\n send({\n type: ListboxEvents.ButtonMouseDown,\n disabled: disabled\n });\n }\n }\n\n function handleMouseUp(event) {\n if (!isRightClick(event.nativeEvent)) {\n event.preventDefault();\n event.stopPropagation();\n send({\n type: ListboxEvents.ButtonMouseUp\n });\n }\n }\n\n var id = makeId(\"button\", listboxId); // If the button has children, we just render them as the label\n // If a user needs the label on the server to prevent hydration mismatch\n // errors, they need to control the state of the component and pass a label\n // directly to the button.\n\n var label = useMemo(function () {\n if (!children) {\n return listboxValueLabel;\n } else if (isFunction(children)) {\n return children({\n isExpanded: isExpanded,\n label: listboxValueLabel,\n value: listboxValue,\n // TODO: Remove in 1.0\n expanded: isExpanded\n });\n }\n\n return children;\n }, [children, listboxValueLabel, isExpanded, listboxValue]);\n return /*#__PURE__*/createElement(Comp // Applicable to all host language elements regardless of whether a\n // `role` is applied.\n // https://www.w3.org/WAI/PF/aria/states_and_properties#global_states_header\n , _extends({\n \"aria-disabled\": disabled || undefined // Set by the JavaScript when the listbox is displayed. Otherwise, is\n // not present.\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-collapsible.html\n ,\n \"aria-expanded\": isExpanded || undefined // Indicates that activating the button displays a listbox.\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-collapsible.html\n ,\n \"aria-haspopup\": \"listbox\" // References the two elements whose labels are concatenated by the\n // browser to label the button. The first element is a span containing\n // perceivable label for the listbox component. The second element is\n // the button itself; the button text is set to the name of the\n // currently chosen element.\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-collapsible.html\n // If an `aria-label` is passed, we should skip `aria-labelledby` to\n // avoid confusion.\n ,\n \"aria-labelledby\": ariaLabel ? undefined : [ariaLabelledBy, id].filter(Boolean).join(\" \"),\n \"aria-label\": ariaLabel // Identifies the element as a button widget.\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/button/button.html\n ,\n role: \"button\" // Includes the element in the tab sequence.\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/button/button.html\n ,\n tabIndex: disabled ? -1 : 0\n }, props, {\n ref: ref,\n \"data-reach-listbox-button\": \"\",\n id: id,\n onKeyDown: wrapEvent(onKeyDown, handleKeyDown),\n onMouseDown: wrapEvent(onMouseDown, handleMouseDown),\n onMouseUp: wrapEvent(onMouseUp, handleMouseUp)\n }), label, arrow && /*#__PURE__*/createElement(ListboxArrow, null, isBoolean(arrow) ? null : arrow));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ListboxButtonImpl.displayName = \"ListboxButton\";\n ListboxButtonImpl.propTypes = {\n arrow: /*#__PURE__*/PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),\n children: /*#__PURE__*/PropTypes.oneOfType([PropTypes.node, PropTypes.func])\n };\n}\n\nvar ListboxButton = /*#__PURE__*/memoWithAs(ListboxButtonImpl);\n/**\n * @see Docs https://reach.tech/listbox#listboxbutton-props\n */\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ListboxArrow\n *\n * A wrapper component for an arrow to display in the `ListboxButton`\n *\n * @see Docs https://reach.tech/listbox#listboxarrow\n */\nvar ListboxArrowImpl = /*#__PURE__*/forwardRefWithAs(function ListboxArrow(_ref5, forwardedRef) {\n var _ref5$as = _ref5.as,\n Comp = _ref5$as === void 0 ? \"span\" : _ref5$as,\n children = _ref5.children,\n props = _objectWithoutPropertiesLoose(_ref5, [\"as\", \"children\"]);\n\n var _React$useContext2 = useContext(ListboxContext),\n isExpanded = _React$useContext2.isExpanded;\n\n return /*#__PURE__*/createElement(Comp // The arrow provides no semantic value and its inner content should be\n // hidden from the accessibility tree\n , _extends({\n \"aria-hidden\": true\n }, props, {\n ref: forwardedRef,\n \"data-reach-listbox-arrow\": \"\",\n \"data-expanded\": isExpanded ? \"\" : undefined\n }), isFunction(children) ? children({\n isExpanded: isExpanded,\n // TODO: Remove in 1.0\n expanded: isExpanded\n }) : children || \"▼\");\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ListboxArrowImpl.displayName = \"ListboxArrow\";\n ListboxArrowImpl.propTypes = {\n children: /*#__PURE__*/PropTypes.oneOfType([PropTypes.node, PropTypes.func])\n };\n}\n\nvar ListboxArrow = /*#__PURE__*/memoWithAs(ListboxArrowImpl);\n/**\n * @see Docs https://reach.tech/listbox#listboxarrow-props\n */\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ListboxPopover\n *\n * The popover containing the list of options.\n *\n * @see Docs https://reach.tech/listbox#listboxpopover\n */\nvar ListboxPopoverImpl = /*#__PURE__*/forwardRefWithAs(function ListboxPopover(_ref6, forwardedRef) {\n var _ref6$as = _ref6.as,\n Comp = _ref6$as === void 0 ? \"div\" : _ref6$as,\n _ref6$position = _ref6.position,\n position = _ref6$position === void 0 ? positionMatchWidth : _ref6$position,\n onBlur = _ref6.onBlur,\n onKeyDown = _ref6.onKeyDown,\n _ref6$portal = _ref6.portal,\n portal = _ref6$portal === void 0 ? true : _ref6$portal,\n unstable_observableRefs = _ref6.unstable_observableRefs,\n props = _objectWithoutPropertiesLoose(_ref6, [\"as\", \"position\", \"onBlur\", \"onKeyDown\", \"portal\", \"unstable_observableRefs\"]);\n\n var _React$useContext3 = useContext(ListboxContext),\n buttonRef = _React$useContext3.buttonRef,\n popoverRef = _React$useContext3.popoverRef,\n send = _React$useContext3.send,\n isExpanded = _React$useContext3.isExpanded;\n\n var ref = useForkedRef(popoverRef, forwardedRef);\n var handleKeyDown = useKeyDown();\n\n var commonProps = _extends({\n hidden: !isExpanded,\n tabIndex: -1\n }, props, {\n ref: ref,\n \"data-reach-listbox-popover\": \"\",\n onBlur: wrapEvent(onBlur, handleBlur),\n onKeyDown: wrapEvent(onKeyDown, handleKeyDown)\n });\n\n function handleBlur(event) {\n var nativeEvent = event.nativeEvent;\n requestAnimationFrame(function () {\n send({\n type: ListboxEvents.Blur,\n relatedTarget: nativeEvent.relatedTarget || nativeEvent.target\n });\n });\n }\n\n return portal ? /*#__PURE__*/createElement(Popover, _extends({}, commonProps, {\n as: Comp,\n targetRef: buttonRef,\n position: position,\n unstable_observableRefs: unstable_observableRefs\n })) : /*#__PURE__*/createElement(Comp, commonProps);\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ListboxPopoverImpl.displayName = \"ListboxPopover\";\n ListboxPopoverImpl.propTypes = {\n children: PropTypes.node.isRequired,\n portal: PropTypes.bool,\n position: PropTypes.func\n };\n}\n\nvar ListboxPopover = /*#__PURE__*/memoWithAs(ListboxPopoverImpl);\n/**\n * @see Docs https://reach.tech/listbox#listboxpopover-props\n */\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ListboxList\n *\n * The list containing all listbox options.\n *\n * @see Docs https://reach.tech/listbox#listboxlist\n */\nvar ListboxList = /*#__PURE__*/forwardRefWithAs(function ListboxList(_ref7, forwardedRef) {\n var _ref7$as = _ref7.as,\n Comp = _ref7$as === void 0 ? \"ul\" : _ref7$as,\n props = _objectWithoutPropertiesLoose(_ref7, [\"as\"]);\n\n var _React$useContext4 = useContext(ListboxContext),\n ariaLabel = _React$useContext4.ariaLabel,\n ariaLabelledBy = _React$useContext4.ariaLabelledBy,\n isExpanded = _React$useContext4.isExpanded,\n listboxId = _React$useContext4.listboxId,\n listRef = _React$useContext4.listRef,\n _React$useContext4$st = _React$useContext4.stateData,\n value = _React$useContext4$st.value,\n navigationValue = _React$useContext4$st.navigationValue;\n\n var ref = useForkedRef(forwardedRef, listRef);\n return /*#__PURE__*/createElement(Comp // Tells assistive technologies which of the options, if any, is\n // visually indicated as having keyboard focus. DOM focus remains on the\n // `ul` element and the idref specified for `aria-activedescendant`\n // refers to the `li` element that is visually styled as focused. When\n // navigation keys, such as `Down Arrow`, are pressed, the JavaScript\n // changes the value.\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-grouped.html\n , _extends({\n \"aria-activedescendant\": useOptionId(isExpanded ? navigationValue : value) // If the listbox is not part of another widget, then it has a visible\n // label referenced by `aria-labelledby` on the element with role\n // `listbox`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n // If an `aria-label` is passed, we should skip `aria-labelledby` to\n // avoid confusion.\n ,\n \"aria-labelledby\": ariaLabel ? undefined : ariaLabelledBy,\n \"aria-label\": ariaLabel // An element that contains or owns all the listbox options has role\n // listbox.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n ,\n role: \"listbox\" // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-collapsible.html\n ,\n tabIndex: -1\n }, props, {\n ref: ref,\n \"data-reach-listbox-list\": \"\",\n id: makeId(\"listbox\", listboxId)\n }));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ListboxList.displayName = \"ListboxList\";\n ListboxList.propTypes = {};\n}\n/**\n * @see Docs https://reach.tech/listbox#listboxlist-props\n */\n\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ListboxOption\n *\n * A selectable option for the listbox.\n *\n * @see Docs https://reach.tech/listbox#listboxoption\n */\nvar ListboxOption = /*#__PURE__*/forwardRefWithAs(function ListboxOption(_ref8, forwardedRef) {\n var _ref8$as = _ref8.as,\n Comp = _ref8$as === void 0 ? \"li\" : _ref8$as,\n children = _ref8.children,\n disabled = _ref8.disabled,\n onMouseDown = _ref8.onMouseDown,\n onMouseEnter = _ref8.onMouseEnter,\n onMouseLeave = _ref8.onMouseLeave,\n onMouseMove = _ref8.onMouseMove,\n onMouseUp = _ref8.onMouseUp,\n onTouchStart = _ref8.onTouchStart,\n value = _ref8.value,\n labelProp = _ref8.label,\n props = _objectWithoutPropertiesLoose(_ref8, [\"as\", \"children\", \"disabled\", \"onMouseDown\", \"onMouseEnter\", \"onMouseLeave\", \"onMouseMove\", \"onMouseUp\", \"onTouchStart\", \"value\", \"label\"]);\n\n if (process.env.NODE_ENV !== \"production\" && !value) {\n throw Error(\"A ListboxOption must have a value prop.\");\n }\n\n var _React$useContext5 = useContext(ListboxContext),\n highlightedOptionRef = _React$useContext5.highlightedOptionRef,\n isExpanded = _React$useContext5.isExpanded,\n onValueChange = _React$useContext5.onValueChange,\n selectedOptionRef = _React$useContext5.selectedOptionRef,\n send = _React$useContext5.send,\n state = _React$useContext5.state,\n _React$useContext5$st = _React$useContext5.stateData,\n listboxValue = _React$useContext5$st.value,\n navigationValue = _React$useContext5$st.navigationValue;\n\n var _React$useState = useState(labelProp),\n labelState = _React$useState[0],\n setLabel = _React$useState[1];\n\n var label = labelProp || labelState || \"\";\n var ownRef = useRef(null);\n useDescendant({\n element: ownRef.current,\n value: value,\n label: label,\n disabled: !!disabled\n }, ListboxDescendantContext); // After the ref is mounted to the DOM node, we check to see if we have an\n // explicit label prop before looking for the node's textContent for\n // typeahead functionality.\n\n var getLabelFromDomNode = useCallback(function (node) {\n if (!labelProp && node) {\n setLabel(function (prevState) {\n if (node.textContent && prevState !== node.textContent) {\n return node.textContent;\n }\n\n return prevState || \"\";\n });\n }\n }, [labelProp]);\n var isHighlighted = navigationValue ? navigationValue === value : false;\n var isSelected = listboxValue === value;\n var ref = useForkedRef(getLabelFromDomNode, forwardedRef, ownRef, isSelected ? selectedOptionRef : null, isHighlighted ? highlightedOptionRef : null);\n\n function handleMouseEnter() {\n send({\n type: ListboxEvents.OptionMouseEnter,\n value: value,\n disabled: !!disabled\n });\n }\n\n function handleTouchStart() {\n send({\n type: ListboxEvents.OptionTouchStart,\n value: value,\n disabled: !!disabled\n });\n }\n\n function handleMouseLeave() {\n send({\n type: ListboxEvents.ClearNavSelection\n });\n }\n\n function handleMouseDown(event) {\n // Prevent blur event from firing and bubbling to the popover\n if (!isRightClick(event.nativeEvent)) {\n event.preventDefault();\n send({\n type: ListboxEvents.OptionMouseDown\n });\n }\n }\n\n function handleMouseUp(event) {\n if (!isRightClick(event.nativeEvent)) {\n send({\n type: ListboxEvents.OptionMouseUp,\n value: value,\n callback: onValueChange,\n disabled: !!disabled\n });\n }\n }\n\n function handleMouseMove() {\n // We don't really *need* these guards since we put all of our transition\n // logic in the state machine, but in this case it seems wise not to\n // needlessly run our transitions every time the user's mouse moves. Seems\n // like a lot. 🙃\n if (state === ListboxStates.Open || navigationValue !== value) {\n send({\n type: ListboxEvents.OptionMouseMove,\n value: value,\n disabled: !!disabled\n });\n }\n }\n\n return /*#__PURE__*/createElement(Comp // In a single-select listbox, the selected option has `aria-selected`\n // set to `true`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n , _extends({\n \"aria-selected\": (isExpanded ? isHighlighted : isSelected) || undefined // Applicable to all host language elements regardless of whether a\n // `role` is applied.\n // https://www.w3.org/WAI/PF/aria/states_and_properties#global_states_header\n ,\n \"aria-disabled\": disabled || undefined // Each option in the listbox has role `option` and is a DOM descendant\n // of the element with role `listbox`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n ,\n role: \"option\"\n }, props, {\n ref: ref,\n id: useOptionId(value),\n \"data-reach-listbox-option\": \"\",\n \"data-current\": isSelected ? \"\" : undefined,\n \"data-label\": label,\n \"data-value\": value,\n onMouseDown: wrapEvent(onMouseDown, handleMouseDown),\n onMouseEnter: wrapEvent(onMouseEnter, handleMouseEnter),\n onMouseLeave: wrapEvent(onMouseLeave, handleMouseLeave),\n onMouseMove: wrapEvent(onMouseMove, handleMouseMove),\n onMouseUp: wrapEvent(onMouseUp, handleMouseUp),\n onTouchStart: wrapEvent(onTouchStart, handleTouchStart)\n }), children);\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ListboxOption.displayName = \"ListboxOption\";\n ListboxOption.propTypes = {\n disabled: PropTypes.bool,\n label: PropTypes.string,\n value: PropTypes.string.isRequired\n };\n}\n/**\n * @see Docs https://reach.tech/listbox#listboxoption-props\n */\n\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ListboxGroup\n *\n * A group of related listbox options.\n *\n * @see Docs https://reach.tech/listbox#listboxgroup\n */\nvar ListboxGroup = /*#__PURE__*/forwardRefWithAs(function ListboxGroup(_ref9, forwardedRef) {\n var _ref9$as = _ref9.as,\n Comp = _ref9$as === void 0 ? \"div\" : _ref9$as,\n label = _ref9.label,\n children = _ref9.children,\n props = _objectWithoutPropertiesLoose(_ref9, [\"as\", \"label\", \"children\"]);\n\n var _React$useContext6 = useContext(ListboxContext),\n listboxId = _React$useContext6.listboxId;\n\n var labelId = makeId(\"label\", useId(props.id), listboxId);\n return /*#__PURE__*/createElement(ListboxGroupContext.Provider, {\n value: {\n labelId: labelId\n }\n }, /*#__PURE__*/createElement(Comp // Refers to the element containing the option group label\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-grouped.html\n , _extends({\n \"aria-labelledby\": labelId // Identifies a group of related options\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-grouped.html\n ,\n role: \"group\"\n }, props, {\n \"data-reach-listbox-group\": \"\",\n ref: forwardedRef\n }), label && /*#__PURE__*/createElement(ListboxGroupLabel, null, label), children));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ListboxGroup.displayName = \"ListboxGroup\";\n ListboxGroup.propTypes = {\n label: /*#__PURE__*/PropTypes.oneOfType([PropTypes.string, PropTypes.element])\n };\n}\n/**\n * @see Docs https://reach.tech/listbox#listboxgroup-props\n */\n\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ListboxGroupLabel\n *\n * @see Docs https://reach.tech/listbox#listboxgrouplabel\n */\nvar ListboxGroupLabel = /*#__PURE__*/forwardRefWithAs(function ListboxGroupLabel(_ref10, forwardedRef) {\n var _ref10$as = _ref10.as,\n Comp = _ref10$as === void 0 ? \"span\" : _ref10$as,\n props = _objectWithoutPropertiesLoose(_ref10, [\"as\"]);\n\n var _React$useContext7 = useContext(ListboxGroupContext),\n labelId = _React$useContext7.labelId;\n\n return /*#__PURE__*/createElement(Comp // See examples\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-grouped.html\n , _extends({\n role: \"presentation\"\n }, props, {\n ref: forwardedRef,\n \"data-reach-listbox-group-label\": \"\",\n id: labelId\n }));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ListboxGroupLabel.displayName = \"ListboxGroupLabel\";\n ListboxGroupLabel.propTypes = {};\n}\n/**\n * @see Docs https://reach.tech/listbox#listboxgroup-props\n */\n\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * A hook that exposes data for a given `Listbox` component to its descendants.\n *\n * @see Docs https://reach.tech/listbox#uselistboxcontext\n */\nfunction useListboxContext() {\n var _React$useContext8 = useContext(ListboxContext),\n highlightedOptionRef = _React$useContext8.highlightedOptionRef,\n listboxId = _React$useContext8.listboxId,\n listboxValueLabel = _React$useContext8.listboxValueLabel,\n isExpanded = _React$useContext8.isExpanded,\n selectedOptionRef = _React$useContext8.selectedOptionRef,\n value = _React$useContext8.stateData.value;\n\n return useMemo(function () {\n return {\n id: listboxId,\n isExpanded: isExpanded,\n selectedOptionRef: selectedOptionRef,\n highlightedOptionRef: highlightedOptionRef,\n value: value,\n valueLabel: listboxValueLabel\n };\n }, [listboxId, isExpanded, value, listboxValueLabel, selectedOptionRef, highlightedOptionRef]);\n} ////////////////////////////////////////////////////////////////////////////////\n\n\nfunction isListboxExpanded(state) {\n return [ListboxStates.Navigating, ListboxStates.Open, ListboxStates.Dragging, ListboxStates.Interacting].includes(state);\n}\n\nfunction useKeyDown() {\n var _React$useContext9 = useContext(ListboxContext),\n listboxDisabled = _React$useContext9.disabled,\n onValueChange = _React$useContext9.onValueChange,\n _React$useContext9$st = _React$useContext9.stateData,\n navigationValue = _React$useContext9$st.navigationValue,\n typeaheadQuery = _React$useContext9$st.typeaheadQuery,\n send = _React$useContext9.send;\n\n var options = useDescendants(ListboxDescendantContext);\n useEffect(function () {\n if (typeaheadQuery) {\n send({\n type: ListboxEvents.UpdateAfterTypeahead,\n query: typeaheadQuery,\n callback: onValueChange\n });\n }\n\n var timeout = window.setTimeout(function () {\n if (typeaheadQuery != null) {\n send({\n type: ListboxEvents.ClearTypeahead\n });\n }\n }, 1000);\n return function () {\n window.clearTimeout(timeout);\n };\n }, [onValueChange, send, typeaheadQuery]);\n var index = options.findIndex(function (_ref11) {\n var value = _ref11.value;\n return value === navigationValue;\n });\n var handleKeyDown = wrapEvent(function (event) {\n var key = event.key;\n var isSearching = isString(key) && key.length === 1;\n var navOption = options.find(function (option) {\n return option.value === navigationValue;\n });\n\n switch (key) {\n case \"Enter\":\n send({\n type: ListboxEvents.KeyDownEnter,\n value: navigationValue,\n callback: onValueChange,\n disabled: !!(navOption != null && navOption.disabled || listboxDisabled)\n });\n return;\n\n case \" \":\n // Prevent browser from scrolling down\n event.preventDefault();\n send({\n type: ListboxEvents.KeyDownSpace,\n value: navigationValue,\n callback: onValueChange,\n disabled: !!(navOption != null && navOption.disabled || listboxDisabled)\n });\n return;\n\n case \"Escape\":\n send({\n type: ListboxEvents.KeyDownEscape\n });\n return;\n\n case \"Tab\":\n var eventType = event.shiftKey ? ListboxEvents.KeyDownShiftTab : ListboxEvents.KeyDownTab;\n send({\n type: eventType\n });\n return;\n\n default:\n if (isSearching) {\n send({\n type: ListboxEvents.KeyDownSearch,\n query: key,\n disabled: listboxDisabled\n });\n }\n\n return;\n }\n }, useDescendantKeyDown(ListboxDescendantContext, {\n currentIndex: index,\n orientation: \"vertical\",\n key: \"index\",\n rotate: true,\n filter: function filter(option) {\n return !option.disabled;\n },\n callback: function callback(nextIndex) {\n send({\n type: ListboxEvents.KeyDownNavigate,\n value: options[nextIndex].value,\n disabled: listboxDisabled\n });\n }\n }));\n return handleKeyDown;\n}\n\nfunction useOptionId(value) {\n var _React$useContext10 = useContext(ListboxContext),\n listboxId = _React$useContext10.listboxId;\n\n return value ? makeId(\"option-\" + value, listboxId) : undefined;\n}\n\nfunction popoverContainsEventTarget(popover, target) {\n return !!(popover && popover.contains(target));\n} ////////////////////////////////////////////////////////////////////////////////\n// Types\n\n\nfunction useControlledStateSync(controlPropValue, internalValue, send) {\n var _React$useRef = useRef(controlPropValue != null),\n isControlled = _React$useRef.current;\n\n if (isControlled && controlPropValue !== internalValue) {\n send();\n }\n} ////////////////////////////////////////////////////////////////////////////////\n\nexport { Listbox, ListboxArrow, ListboxButton, ListboxGroup, ListboxGroupLabel, ListboxInput, ListboxList, ListboxOption, ListboxPopover, useListboxContext };\n","var api = require(\"!../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../css-loader/dist/cjs.js!./styles.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","var api = require(\"!../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../css-loader/dist/cjs.js!./styles.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { forwardRef, createElement } from 'react';\nimport PropTypes from 'prop-types';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\n/**\n * VisuallyHidden\n *\n * Provides text for screen readers that is visually hidden.\n * It is the logical opposite of the `aria-hidden` attribute.\n */\n\nvar VisuallyHidden = /*#__PURE__*/forwardRef(function VisuallyHidden(_ref, ref) {\n var _ref$as = _ref.as,\n Comp = _ref$as === void 0 ? \"span\" : _ref$as,\n _ref$style = _ref.style,\n style = _ref$style === void 0 ? {} : _ref$style,\n props = _objectWithoutPropertiesLoose(_ref, [\"as\", \"style\"]);\n\n return /*#__PURE__*/createElement(Comp, _extends({\n ref: ref,\n style: _extends({\n border: 0,\n clip: \"rect(0 0 0 0)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: 0,\n position: \"absolute\",\n width: \"1px\",\n // https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe\n whiteSpace: \"nowrap\",\n wordWrap: \"normal\"\n }, style)\n }, props));\n});\n/**\n * @see Docs https://reach.tech/visually-hidden#visuallyhidden-props\n */\n\nif (process.env.NODE_ENV !== \"production\") {\n VisuallyHidden.displayName = \"VisuallyHidden\";\n VisuallyHidden.propTypes = {\n as: PropTypes.any,\n children: PropTypes.node\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\nexport default VisuallyHidden;\nexport { VisuallyHidden };\n","import { useState, useRef, useEffect, Children, createElement, Fragment, cloneElement } from 'react';\nimport { useId } from '@reach/auto-id';\nimport { useForkedRef, useCheckStyles, getOwnerDocument, makeId, wrapEvent, forwardRefWithAs, warning, getDocumentDimensions } from '@reach/utils';\nimport { Portal } from '@reach/portal';\nimport { VisuallyHidden } from '@reach/visually-hidden';\nimport { useRect } from '@reach/rect';\nimport PropTypes from 'prop-types';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar _on, _on2, _on3, _on4, _on5, _states;\nvar MOUSE_REST_TIMEOUT = 100;\nvar LEAVE_TIMEOUT = 500; ////////////////////////////////////////////////////////////////////////////////\n// States\n\nvar TooltipStates; ////////////////////////////////////////////////////////////////////////////////\n// Events\n\n(function (TooltipStates) {\n TooltipStates[\"Idle\"] = \"IDLE\";\n TooltipStates[\"Focused\"] = \"FOCUSED\";\n TooltipStates[\"Visible\"] = \"VISIBLE\";\n TooltipStates[\"LeavingVisible\"] = \"LEAVING_VISIBLE\";\n TooltipStates[\"Dismissed\"] = \"DISMISSED\";\n})(TooltipStates || (TooltipStates = {}));\n\nvar TooltipEvents;\n\n(function (TooltipEvents) {\n TooltipEvents[\"Blur\"] = \"BLUR\";\n TooltipEvents[\"Focus\"] = \"FOCUS\";\n TooltipEvents[\"GlobalMouseMove\"] = \"GLOBAL_MOUSE_MOVE\";\n TooltipEvents[\"MouseDown\"] = \"MOUSE_DOWN\";\n TooltipEvents[\"MouseEnter\"] = \"MOUSE_ENTER\";\n TooltipEvents[\"MouseLeave\"] = \"MOUSE_LEAVE\";\n TooltipEvents[\"MouseMove\"] = \"MOUSE_MOVE\";\n TooltipEvents[\"Rest\"] = \"REST\";\n TooltipEvents[\"SelectWithKeyboard\"] = \"SELECT_WITH_KEYBOARD\";\n TooltipEvents[\"TimeComplete\"] = \"TIME_COMPLETE\";\n})(TooltipEvents || (TooltipEvents = {}));\n\nvar chart = {\n initial: TooltipStates.Idle,\n states: (_states = {}, _states[TooltipStates.Idle] = {\n enter: clearContextId,\n on: (_on = {}, _on[TooltipEvents.MouseEnter] = TooltipStates.Focused, _on[TooltipEvents.Focus] = TooltipStates.Visible, _on)\n }, _states[TooltipStates.Focused] = {\n enter: startRestTimer,\n leave: clearRestTimer,\n on: (_on2 = {}, _on2[TooltipEvents.MouseMove] = TooltipStates.Focused, _on2[TooltipEvents.MouseLeave] = TooltipStates.Idle, _on2[TooltipEvents.MouseDown] = TooltipStates.Dismissed, _on2[TooltipEvents.Blur] = TooltipStates.Idle, _on2[TooltipEvents.Rest] = TooltipStates.Visible, _on2)\n }, _states[TooltipStates.Visible] = {\n on: (_on3 = {}, _on3[TooltipEvents.Focus] = TooltipStates.Focused, _on3[TooltipEvents.MouseEnter] = TooltipStates.Focused, _on3[TooltipEvents.MouseLeave] = TooltipStates.LeavingVisible, _on3[TooltipEvents.Blur] = TooltipStates.LeavingVisible, _on3[TooltipEvents.MouseDown] = TooltipStates.Dismissed, _on3[TooltipEvents.SelectWithKeyboard] = TooltipStates.Dismissed, _on3[TooltipEvents.GlobalMouseMove] = TooltipStates.LeavingVisible, _on3)\n }, _states[TooltipStates.LeavingVisible] = {\n enter: startLeavingVisibleTimer,\n leave: function leave() {\n clearLeavingVisibleTimer();\n clearContextId();\n },\n on: (_on4 = {}, _on4[TooltipEvents.MouseEnter] = TooltipStates.Visible, _on4[TooltipEvents.Focus] = TooltipStates.Visible, _on4[TooltipEvents.TimeComplete] = TooltipStates.Idle, _on4)\n }, _states[TooltipStates.Dismissed] = {\n leave: function leave() {\n clearContextId();\n },\n on: (_on5 = {}, _on5[TooltipEvents.MouseLeave] = TooltipStates.Idle, _on5[TooltipEvents.Blur] = TooltipStates.Idle, _on5)\n }, _states)\n};\n/*\n * Chart context allows us to persist some data around, in Tooltip all we use\n * is the id of the current tooltip being interacted with.\n */\n\nvar state = {\n value: chart.initial,\n context: {\n id: null\n }\n}; ////////////////////////////////////////////////////////////////////////////////\n// Subscriptions:\n//\n// We could require apps to render a <TooltipProvider> around the app and use\n// React context to notify Tooltips of changes to our state machine, instead\n// we manage subscriptions ourselves and simplify the Tooltip API.\n//\n// Maybe if default context could take a hook (instead of just a static value)\n// that was rendered at the root for us, that'd be cool! But it doesn't.\n\nvar subscriptions = [];\n\nfunction subscribe(fn) {\n subscriptions.push(fn);\n return function () {\n subscriptions.splice(subscriptions.indexOf(fn), 1);\n };\n}\n\nfunction notify() {\n subscriptions.forEach(function (fn) {\n return fn(state);\n });\n} ////////////////////////////////////////////////////////////////////////////////\n// Timeouts:\n// Manages when the user \"rests\" on an element. Keeps the interface from being\n// flashing tooltips all the time as the user moves the mouse around the screen.\n\n\nvar restTimeout;\n\nfunction startRestTimer() {\n window.clearTimeout(restTimeout);\n restTimeout = window.setTimeout(function () {\n send({\n type: TooltipEvents.Rest\n });\n }, MOUSE_REST_TIMEOUT);\n}\n\nfunction clearRestTimer() {\n window.clearTimeout(restTimeout);\n} // Manages the delay to hide the tooltip after rest leaves.\n\n\nvar leavingVisibleTimer;\n\nfunction startLeavingVisibleTimer() {\n window.clearTimeout(leavingVisibleTimer);\n leavingVisibleTimer = window.setTimeout(function () {\n return send({\n type: TooltipEvents.TimeComplete\n });\n }, LEAVE_TIMEOUT);\n}\n\nfunction clearLeavingVisibleTimer() {\n window.clearTimeout(leavingVisibleTimer);\n} // allows us to come on back later w/o entering something else first after the\n// user leaves or dismisses\n\n\nfunction clearContextId() {\n state.context.id = null;\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * useTooltip\n *\n * @param params\n */\n\n\nfunction useTooltip(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n idProp = _ref.id,\n onPointerEnter = _ref.onPointerEnter,\n onPointerMove = _ref.onPointerMove,\n onPointerLeave = _ref.onPointerLeave,\n onPointerDown = _ref.onPointerDown,\n onMouseEnter = _ref.onMouseEnter,\n onMouseMove = _ref.onMouseMove,\n onMouseLeave = _ref.onMouseLeave,\n onMouseDown = _ref.onMouseDown,\n onFocus = _ref.onFocus,\n onBlur = _ref.onBlur,\n onKeyDown = _ref.onKeyDown,\n disabled = _ref.disabled,\n forwardedRef = _ref.ref,\n DEBUG_STYLE = _ref.DEBUG_STYLE;\n\n var id = String(useId(idProp));\n\n var _React$useState = useState(DEBUG_STYLE ? true : isTooltipVisible(id, true)),\n isVisible = _React$useState[0],\n setIsVisible = _React$useState[1]; // hopefully they always pass a ref if they ever pass one\n\n\n var ownRef = useRef(null);\n var ref = useForkedRef(forwardedRef, ownRef);\n var triggerRect = useRect(ownRef, {\n observe: isVisible\n });\n useEffect(function () {\n return subscribe(function () {\n setIsVisible(isTooltipVisible(id));\n });\n }, [id]);\n useCheckStyles(\"tooltip\");\n useEffect(function () {\n var ownerDocument = getOwnerDocument(ownRef.current);\n\n function listener(event) {\n if ((event.key === \"Escape\" || event.key === \"Esc\") && state.value === TooltipStates.Visible) {\n send({\n type: TooltipEvents.SelectWithKeyboard\n });\n }\n }\n\n ownerDocument.addEventListener(\"keydown\", listener);\n return function () {\n return ownerDocument.removeEventListener(\"keydown\", listener);\n };\n }, []);\n useDisabledTriggerOnSafari({\n disabled: disabled,\n isVisible: isVisible,\n ref: ownRef\n });\n\n function wrapMouseEvent(theirHandler, ourHandler) {\n // Use internal MouseEvent handler only if PointerEvent is not supported\n if (typeof window !== \"undefined\" && \"PointerEvent\" in window) {\n return theirHandler;\n }\n\n return wrapEvent(theirHandler, ourHandler);\n }\n\n function wrapPointerEventHandler(handler) {\n return function onPointerEvent(event) {\n // Handle pointer events only from mouse device\n if (event.pointerType !== \"mouse\") {\n return;\n }\n\n handler(event);\n };\n }\n\n function handleMouseEnter() {\n send({\n type: TooltipEvents.MouseEnter,\n id: id\n });\n }\n\n function handleMouseMove() {\n send({\n type: TooltipEvents.MouseMove,\n id: id\n });\n }\n\n function handleMouseLeave() {\n send({\n type: TooltipEvents.MouseLeave\n });\n }\n\n function handleMouseDown() {\n // Allow quick click from one tool to another\n if (state.context.id === id) {\n send({\n type: TooltipEvents.MouseDown\n });\n }\n }\n\n function handleFocus() {\n // @ts-ignore\n if (window.__REACH_DISABLE_TOOLTIPS) {\n return;\n }\n\n send({\n type: TooltipEvents.Focus,\n id: id\n });\n }\n\n function handleBlur() {\n // Allow quick click from one tool to another\n if (state.context.id === id) {\n send({\n type: TooltipEvents.Blur\n });\n }\n }\n\n function handleKeyDown(event) {\n if (event.key === \"Enter\" || event.key === \" \") {\n send({\n type: TooltipEvents.SelectWithKeyboard\n });\n }\n }\n\n var trigger = {\n // The element that triggers the tooltip references the tooltip element with\n // `aria-describedby`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#tooltip\n \"aria-describedby\": isVisible ? makeId(\"tooltip\", id) : undefined,\n \"data-state\": isVisible ? \"tooltip-visible\" : \"tooltip-hidden\",\n \"data-reach-tooltip-trigger\": \"\",\n ref: ref,\n onPointerEnter: wrapEvent(onPointerEnter, wrapPointerEventHandler(handleMouseEnter)),\n onPointerMove: wrapEvent(onPointerMove, wrapPointerEventHandler(handleMouseMove)),\n onPointerLeave: wrapEvent(onPointerLeave, wrapPointerEventHandler(handleMouseLeave)),\n onPointerDown: wrapEvent(onPointerDown, wrapPointerEventHandler(handleMouseDown)),\n onMouseEnter: wrapMouseEvent(onMouseEnter, handleMouseEnter),\n onMouseMove: wrapMouseEvent(onMouseMove, handleMouseMove),\n onMouseLeave: wrapMouseEvent(onMouseLeave, handleMouseLeave),\n onMouseDown: wrapMouseEvent(onMouseDown, handleMouseDown),\n onFocus: wrapEvent(onFocus, handleFocus),\n onBlur: wrapEvent(onBlur, handleBlur),\n onKeyDown: wrapEvent(onKeyDown, handleKeyDown)\n };\n var tooltip = {\n id: id,\n triggerRect: triggerRect,\n isVisible: isVisible\n };\n return [trigger, tooltip, isVisible];\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Tooltip\n *\n * @see Docs https://reach.tech/tooltip#tooltip\n */\n\n\nvar Tooltip = /*#__PURE__*/forwardRefWithAs(function (_ref2, forwardedRef) {\n var children = _ref2.children,\n label = _ref2.label,\n DEPRECATED_ariaLabel = _ref2.ariaLabel,\n id = _ref2.id,\n DEBUG_STYLE = _ref2.DEBUG_STYLE,\n props = _objectWithoutPropertiesLoose(_ref2, [\"children\", \"label\", \"ariaLabel\", \"id\", \"DEBUG_STYLE\"]);\n\n var child = Children.only(children);\n process.env.NODE_ENV !== \"production\" ? warning(!DEPRECATED_ariaLabel, \"The `ariaLabel prop is deprecated and will be removed from @reach/tooltip in a future version of Reach UI. Please use `aria-label` instead.\") : void 0; // We need to pass some properties from the child into useTooltip\n // to make sure users can maintain control over the trigger's ref and events\n\n var _useTooltip = useTooltip({\n id: id,\n onPointerEnter: child.props.onPointerEnter,\n onPointerMove: child.props.onPointerMove,\n onPointerLeave: child.props.onPointerLeave,\n onPointerDown: child.props.onPointerDown,\n onMouseEnter: child.props.onMouseEnter,\n onMouseMove: child.props.onMouseMove,\n onMouseLeave: child.props.onMouseLeave,\n onMouseDown: child.props.onMouseDown,\n onFocus: child.props.onFocus,\n onBlur: child.props.onBlur,\n onKeyDown: child.props.onKeyDown,\n disabled: child.props.disabled,\n ref: child.ref,\n DEBUG_STYLE: DEBUG_STYLE\n }),\n trigger = _useTooltip[0],\n tooltip = _useTooltip[1];\n\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/cloneElement(child, trigger), /*#__PURE__*/createElement(TooltipPopup, _extends({\n ref: forwardedRef,\n label: label,\n \"aria-label\": DEPRECATED_ariaLabel\n }, tooltip, props)));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n Tooltip.displayName = \"Tooltip\";\n Tooltip.propTypes = {\n children: PropTypes.node.isRequired,\n label: PropTypes.node.isRequired,\n ariaLabel: PropTypes.string\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * TooltipPopup\n *\n * @see Docs https://reach.tech/tooltip#tooltippopup\n */\n\n\nvar TooltipPopup = /*#__PURE__*/forwardRefWithAs(function TooltipPopup(_ref3, forwardRef) {\n var label = _ref3.label,\n DEPRECATED_ariaLabel = _ref3.ariaLabel,\n isVisible = _ref3.isVisible,\n id = _ref3.id,\n props = _objectWithoutPropertiesLoose(_ref3, [\"label\", \"ariaLabel\", \"isVisible\", \"id\"]);\n\n return isVisible ? /*#__PURE__*/createElement(Portal, null, /*#__PURE__*/createElement(TooltipContent, _extends({\n ref: forwardRef,\n label: label,\n \"aria-label\": DEPRECATED_ariaLabel,\n isVisible: isVisible\n }, props, {\n id: makeId(\"tooltip\", String(id))\n }))) : null;\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n TooltipPopup.displayName = \"TooltipPopup\";\n TooltipPopup.propTypes = {\n label: PropTypes.node.isRequired,\n ariaLabel: PropTypes.string,\n position: PropTypes.func\n };\n}\n/**\n * TooltipContent\n *\n * We need a separate component so that useRect works inside the portal.\n *\n * @see Docs https://reach.tech/tooltip#tooltipcontent\n */\n\n\nvar TooltipContent = /*#__PURE__*/forwardRefWithAs(function TooltipContent(_ref4, forwardedRef) {\n var ariaLabel = _ref4.ariaLabel,\n realAriaLabel = _ref4[\"aria-label\"],\n _ref4$as = _ref4.as,\n Comp = _ref4$as === void 0 ? \"div\" : _ref4$as,\n id = _ref4.id,\n isVisible = _ref4.isVisible,\n label = _ref4.label,\n _ref4$position = _ref4.position,\n position = _ref4$position === void 0 ? positionTooltip : _ref4$position,\n style = _ref4.style,\n triggerRect = _ref4.triggerRect,\n props = _objectWithoutPropertiesLoose(_ref4, [\"ariaLabel\", \"aria-label\", \"as\", \"id\", \"isVisible\", \"label\", \"position\", \"style\", \"triggerRect\"]);\n\n // The element that serves as the tooltip container has role tooltip.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#tooltip When an app passes\n // an `aria-label`, we actually want to implement `role=\"tooltip\"` on a\n // visually hidden element inside of the trigger. In these cases we want the\n // screen reader user to know both the content in the tooltip, but also the\n // content in the badge. For screen reader users, the only content announced\n // to them is whatever is in the tooltip.\n var hasAriaLabel = (realAriaLabel || ariaLabel) != null;\n var ownRef = useRef(null);\n var ref = useForkedRef(forwardedRef, ownRef);\n var tooltipRect = useRect(ownRef, {\n observe: isVisible\n });\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Comp, _extends({\n role: hasAriaLabel ? undefined : \"tooltip\"\n }, props, {\n ref: ref,\n \"data-reach-tooltip\": \"\",\n id: hasAriaLabel ? undefined : id,\n style: _extends({}, style, getStyles(position, triggerRect, tooltipRect))\n }), label), hasAriaLabel && /*#__PURE__*/createElement(VisuallyHidden, {\n role: \"tooltip\",\n id: id\n }, realAriaLabel || ariaLabel));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n TooltipContent.displayName = \"TooltipContent\";\n TooltipContent.propTypes = {};\n} ////////////////////////////////////////////////////////////////////////////////\n\n\nfunction getStyles(position, triggerRect, tooltipRect) {\n var haventMeasuredTooltipYet = !tooltipRect;\n\n if (haventMeasuredTooltipYet) {\n return {\n visibility: \"hidden\"\n };\n }\n\n return position(triggerRect, tooltipRect);\n} // Default offset from the trigger (e.g., if the tooltip is positioned above,\n// there will be 8px between the bottom of the tooltip and the top of the trigger).\n// It feels awkward when it's perfectly aligned w/ the trigger\n\n\nvar OFFSET_DEFAULT = 8;\nvar positionTooltip = function positionTooltip(triggerRect, tooltipRect, offset) {\n if (offset === void 0) {\n offset = OFFSET_DEFAULT;\n }\n\n var _getDocumentDimension = getDocumentDimensions(),\n windowWidth = _getDocumentDimension.width,\n windowHeight = _getDocumentDimension.height;\n\n if (!triggerRect || !tooltipRect) {\n return {};\n }\n\n var collisions = {\n top: triggerRect.top - tooltipRect.height < 0,\n right: windowWidth < triggerRect.left + tooltipRect.width,\n bottom: windowHeight < triggerRect.bottom + tooltipRect.height + offset,\n left: triggerRect.left - tooltipRect.width < 0\n };\n var directionRight = collisions.right && !collisions.left;\n var directionUp = collisions.bottom && !collisions.top;\n return {\n left: directionRight ? triggerRect.right - tooltipRect.width + window.pageXOffset + \"px\" : triggerRect.left + window.pageXOffset + \"px\",\n top: directionUp ? triggerRect.top - offset - tooltipRect.height + window.pageYOffset + \"px\" : triggerRect.top + offset + triggerRect.height + window.pageYOffset + \"px\"\n };\n};\n/**\n * This is a workaround for using tooltips with disabled controls in Safari.\n * Safari fires `pointerenter` but does not fire `pointerleave`, and\n * `onPointerEventLeave` added to the trigger element will not work.\n *\n * TODO: We may remove or modiify this behavior in a future version. Direction\n * from WAI-ARIA needed for guidance on handling disabled triggers. Tooltips\n * must be accessible by keyboard, and disabled form controls are generally\n * excluded from the tab sequence.\n *\n * @see https://github.com/reach/reach-ui/issues/564\n * @see https://github.com/w3c/aria-practices/issues/128#issuecomment-588625727\n */\n\nfunction useDisabledTriggerOnSafari(_ref5) {\n var disabled = _ref5.disabled,\n isVisible = _ref5.isVisible,\n ref = _ref5.ref;\n useEffect(function () {\n if (!(typeof window !== \"undefined\" && \"PointerEvent\" in window) || !disabled || !isVisible) {\n return;\n }\n\n var ownerDocument = getOwnerDocument(ref.current);\n\n function handleMouseMove(event) {\n if (!isVisible) {\n return;\n }\n\n if (event.target instanceof Element && event.target.closest(\"[data-reach-tooltip-trigger][data-state='tooltip-visible']\")) {\n return;\n }\n\n send({\n type: TooltipEvents.GlobalMouseMove\n });\n }\n\n ownerDocument.addEventListener(\"mousemove\", handleMouseMove);\n return function () {\n ownerDocument.removeEventListener(\"mousemove\", handleMouseMove);\n };\n }, [disabled, isVisible]);\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Send an event to our state machine to find the next state from the current\n * state + action.\n *\n * It also manages lifecycles of the machine, (enter/leave hooks on the state\n * chart)\n *\n * @param event\n * @param payload\n */\n\n\nfunction send(event) {\n var _transition = transition(state, event),\n value = _transition.value,\n context = _transition.context,\n changed = _transition.changed;\n\n if (changed) {\n state = {\n value: value,\n context: context\n };\n notify();\n }\n}\n\nfunction transition(currentState, event) {\n var stateDef = chart.states[currentState.value];\n var nextState = stateDef && stateDef.on && stateDef.on[event.type]; // Really useful for debugging\n // console.log({ event, state, nextState, contextId: context.id });\n // !nextState && console.log(\"no transition taken\");\n\n if (!nextState) {\n return _extends({}, currentState, {\n changed: false\n });\n }\n\n if (stateDef && stateDef.leave) {\n stateDef.leave(currentState.context, event);\n }\n\n event.type;\n var payload = _objectWithoutPropertiesLoose(event, [\"type\"]); // TODO: Use actions instead of directly setting context\n\n\n var context = _extends({}, state.context, payload);\n\n var nextStateValue = typeof nextState === \"string\" ? nextState : nextState.target;\n var nextDef = chart.states[nextStateValue];\n\n if (nextDef && nextDef.enter) {\n nextDef.enter(currentState.context, event);\n }\n\n return {\n value: nextStateValue,\n context: context,\n changed: true\n };\n}\n\nfunction isTooltipVisible(id, initial) {\n return state.context.id === id && (initial ? state.value === TooltipStates.Visible : state.value === TooltipStates.Visible || state.value === TooltipStates.LeavingVisible);\n} ////////////////////////////////////////////////////////////////////////////////\n\nexport default Tooltip;\nexport { LEAVE_TIMEOUT, MOUSE_REST_TIMEOUT, Tooltip, TooltipPopup, positionTooltip, useTooltip };\n","import { createElement, useRef, useEffect } from 'react';\nimport { Portal } from '@reach/portal';\nimport { useRect } from '@reach/rect';\nimport { forwardRefWithAs, useForkedRef, getOwnerDocument } from '@reach/utils';\nimport tabbable from 'tabbable';\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\n/**\n * Popover\n */\n\nvar Popover = /*#__PURE__*/forwardRefWithAs(function Popover(props, ref) {\n return /*#__PURE__*/createElement(Portal, null, /*#__PURE__*/createElement(PopoverImpl, _extends({\n ref: ref\n }, props)));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n Popover.displayName = \"Popover\";\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * PopoverImpl\n *\n * Popover is conditionally rendered so we can't start measuring until it shows\n * up, so useRect needs to live down here not up in Popover\n */\n\n\nvar PopoverImpl = /*#__PURE__*/forwardRefWithAs(function PopoverImpl(_ref, forwardedRef) {\n var _ref$as = _ref.as,\n Comp = _ref$as === void 0 ? \"div\" : _ref$as,\n targetRef = _ref.targetRef,\n _ref$position = _ref.position,\n position = _ref$position === void 0 ? positionDefault : _ref$position,\n _ref$unstable_observa = _ref.unstable_observableRefs,\n unstable_observableRefs = _ref$unstable_observa === void 0 ? [] : _ref$unstable_observa,\n props = _objectWithoutPropertiesLoose(_ref, [\"as\", \"targetRef\", \"position\", \"unstable_observableRefs\"]);\n\n var popoverRef = useRef(null);\n var popoverRect = useRect(popoverRef, {\n observe: !props.hidden\n });\n var targetRect = useRect(targetRef, {\n observe: !props.hidden\n });\n var ref = useForkedRef(popoverRef, forwardedRef);\n useSimulateTabNavigationForReactTree(targetRef, popoverRef);\n return /*#__PURE__*/createElement(Comp, _extends({\n \"data-reach-popover\": \"\",\n ref: ref\n }, props, {\n style: _extends({\n position: \"absolute\"\n }, getStyles.apply(void 0, [position, targetRect, popoverRect].concat(unstable_observableRefs)), props.style)\n }));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n PopoverImpl.displayName = \"PopoverImpl\";\n} ////////////////////////////////////////////////////////////////////////////////\n\n\nfunction getStyles(position, targetRect, popoverRect) {\n for (var _len = arguments.length, unstable_observableRefs = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n unstable_observableRefs[_key - 3] = arguments[_key];\n }\n\n return popoverRect ? position.apply(void 0, [targetRect, popoverRect].concat(unstable_observableRefs.map(function (ref) {\n return ref.current;\n }))) : {\n visibility: \"hidden\"\n };\n}\n\nfunction getTopPosition(targetRect, popoverRect) {\n var _getCollisions = getCollisions(targetRect, popoverRect),\n directionUp = _getCollisions.directionUp;\n\n return {\n top: directionUp ? targetRect.top - popoverRect.height + window.pageYOffset + \"px\" : targetRect.top + targetRect.height + window.pageYOffset + \"px\"\n };\n}\n\nvar positionDefault = function positionDefault(targetRect, popoverRect) {\n if (!targetRect || !popoverRect) {\n return {};\n }\n\n var _getCollisions2 = getCollisions(targetRect, popoverRect),\n directionRight = _getCollisions2.directionRight;\n\n return _extends({\n left: directionRight ? targetRect.right - popoverRect.width + window.pageXOffset + \"px\" : targetRect.left + window.pageXOffset + \"px\"\n }, getTopPosition(targetRect, popoverRect));\n};\n\nvar positionRight = function positionRight(targetRect, popoverRect) {\n if (!targetRect || !popoverRect) {\n return {};\n }\n\n var _getCollisions3 = getCollisions(targetRect, popoverRect),\n directionLeft = _getCollisions3.directionLeft;\n\n return _extends({\n left: directionLeft ? targetRect.left + window.pageXOffset + \"px\" : targetRect.right - popoverRect.width + window.pageXOffset + \"px\"\n }, getTopPosition(targetRect, popoverRect));\n};\n\nvar positionMatchWidth = function positionMatchWidth(targetRect, popoverRect) {\n if (!targetRect || !popoverRect) {\n return {};\n }\n\n return _extends({\n width: targetRect.width,\n left: targetRect.left\n }, getTopPosition(targetRect, popoverRect));\n};\n\nfunction getCollisions(targetRect, popoverRect, offsetLeft, offsetBottom) {\n if (offsetLeft === void 0) {\n offsetLeft = 0;\n }\n\n if (offsetBottom === void 0) {\n offsetBottom = 0;\n }\n\n var collisions = {\n top: targetRect.top - popoverRect.height < 0,\n right: window.innerWidth < targetRect.left + popoverRect.width - offsetLeft,\n bottom: window.innerHeight < targetRect.bottom + popoverRect.height - offsetBottom,\n left: targetRect.left + targetRect.width - popoverRect.width < 0\n };\n var directionRight = collisions.right && !collisions.left;\n var directionLeft = collisions.left && !collisions.right;\n var directionUp = collisions.bottom && !collisions.top;\n var directionDown = collisions.top && !collisions.bottom;\n return {\n directionRight: directionRight,\n directionLeft: directionLeft,\n directionUp: directionUp,\n directionDown: directionDown\n };\n} // Heads up, my jQuery past haunts this function. This hook scopes the tab\n// order to the React element tree, instead of the DOM tree. This way, when the\n// user navigates with tab from the targetRef, the tab order moves into the\n// popup, and then out of the popup back to the rest of the document.\n// (We call targetRef, triggerRef inside this function to avoid confusion with\n// event.target)\n\n\nfunction useSimulateTabNavigationForReactTree(triggerRef, popoverRef) {\n var ownerDocument = getOwnerDocument(triggerRef.current);\n\n function handleKeyDown(event) {\n if (event.key === \"Tab\" && popoverRef.current && tabbable(popoverRef.current).length === 0) {\n return;\n }\n\n if (event.key === \"Tab\" && event.shiftKey) {\n if (shiftTabbedFromElementAfterTrigger(event)) {\n focusLastTabbableInPopover(event);\n } else if (shiftTabbedOutOfPopover(event)) {\n focusTriggerRef(event);\n } else if (shiftTabbedToBrowserChrome(event)) {\n disableTabbablesInPopover();\n }\n } else if (event.key === \"Tab\") {\n if (tabbedFromTriggerToPopover()) {\n focusFirstPopoverTabbable(event);\n } else if (tabbedOutOfPopover()) {\n focusTabbableAfterTrigger(event);\n } else if (tabbedToBrowserChrome(event)) {\n disableTabbablesInPopover();\n }\n }\n }\n\n useEffect(function () {\n ownerDocument.addEventListener(\"keydown\", handleKeyDown);\n return function () {\n ownerDocument.removeEventListener(\"keydown\", handleKeyDown);\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n function getElementAfterTrigger() {\n var elements = tabbable(ownerDocument);\n var targetIndex = elements && triggerRef.current ? elements.indexOf(triggerRef.current) : -1;\n var elementAfterTrigger = elements && elements[targetIndex + 1];\n return popoverRef.current && popoverRef.current.contains(elementAfterTrigger || null) ? false : elementAfterTrigger;\n }\n\n function tabbedFromTriggerToPopover() {\n return triggerRef.current ? triggerRef.current === ownerDocument.activeElement : false;\n }\n\n function focusFirstPopoverTabbable(event) {\n var elements = popoverRef.current && tabbable(popoverRef.current);\n\n if (elements && elements[0]) {\n event.preventDefault();\n elements[0].focus();\n }\n }\n\n function tabbedOutOfPopover() {\n var inPopover = popoverRef.current ? popoverRef.current.contains(ownerDocument.activeElement || null) : false;\n\n if (inPopover) {\n var elements = popoverRef.current && tabbable(popoverRef.current);\n return Boolean(elements && elements[elements.length - 1] === ownerDocument.activeElement);\n }\n\n return false;\n }\n\n function focusTabbableAfterTrigger(event) {\n var elementAfterTrigger = getElementAfterTrigger();\n\n if (elementAfterTrigger) {\n event.preventDefault();\n elementAfterTrigger.focus();\n }\n }\n\n function shiftTabbedFromElementAfterTrigger(event) {\n if (!event.shiftKey) return;\n var elementAfterTrigger = getElementAfterTrigger();\n return event.target === elementAfterTrigger;\n }\n\n function focusLastTabbableInPopover(event) {\n var elements = popoverRef.current && tabbable(popoverRef.current);\n var last = elements && elements[elements.length - 1];\n\n if (last) {\n event.preventDefault();\n last.focus();\n }\n }\n\n function shiftTabbedOutOfPopover(event) {\n var elements = popoverRef.current && tabbable(popoverRef.current);\n\n if (elements) {\n return elements.length === 0 ? false : event.target === elements[0];\n }\n\n return false;\n }\n\n function focusTriggerRef(event) {\n var _triggerRef$current;\n\n event.preventDefault();\n (_triggerRef$current = triggerRef.current) == null ? void 0 : _triggerRef$current.focus();\n }\n\n function tabbedToBrowserChrome(event) {\n var elements = popoverRef.current ? tabbable(ownerDocument).filter(function (element) {\n return !popoverRef.current.contains(element);\n }) : null;\n return elements ? event.target === elements[elements.length - 1] : false;\n }\n\n function shiftTabbedToBrowserChrome(event) {\n // we're assuming the popover will never contain the first tabbable\n // element, and it better not, because the trigger needs to be tabbable!\n return event.target === tabbable(ownerDocument)[0];\n }\n\n var restoreTabIndexTuplés = [];\n\n function disableTabbablesInPopover() {\n var elements = popoverRef.current && tabbable(popoverRef.current);\n\n if (elements) {\n elements.forEach(function (element) {\n restoreTabIndexTuplés.push([element, element.tabIndex]);\n element.tabIndex = -1;\n });\n ownerDocument.addEventListener(\"focusin\", enableTabbablesInPopover);\n }\n }\n\n function enableTabbablesInPopover() {\n ownerDocument.removeEventListener(\"focusin\", enableTabbablesInPopover);\n restoreTabIndexTuplés.forEach(function (_ref2) {\n var element = _ref2[0],\n tabIndex = _ref2[1];\n element.tabIndex = tabIndex;\n });\n }\n} ////////////////////////////////////////////////////////////////////////////////\n\nexport default Popover;\nexport { Popover, getCollisions, positionDefault, positionMatchWidth, positionRight };\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \":root {\\n --reach-listbox: 1;\\n}\\n\\n[data-reach-listbox-popover] {\\n display: block;\\n position: absolute;\\n min-width: -moz-fit-content;\\n min-width: -webkit-min-content;\\n min-width: min-content;\\n padding: 0.25rem 0;\\n background: hsl(0, 0%, 100%);\\n outline: none;\\n border: solid 1px hsla(0, 0%, 0%, 0.25);\\n}\\n\\n[data-reach-listbox-popover]:focus-within {\\n box-shadow: 0 0 4px Highlight;\\n outline: -webkit-focus-ring-color auto 4px;\\n}\\n\\n[data-reach-listbox-popover][hidden] {\\n display: none;\\n}\\n\\n[data-reach-listbox-list] {\\n margin: 0;\\n padding: 0;\\n list-style: none;\\n}\\n\\n[data-reach-listbox-list]:focus {\\n box-shadow: none;\\n outline: none;\\n}\\n\\n[data-reach-listbox-option] {\\n display: block;\\n margin: 0;\\n padding: 0.25rem 0.5rem;\\n white-space: nowrap;\\n user-select: none;\\n}\\n\\n[data-reach-listbox-option][aria-selected=\\\"true\\\"] {\\n background: hsl(211, 81%, 46%);\\n color: hsl(0, 0%, 100%);\\n}\\n\\n[data-reach-listbox-option][data-current] {\\n font-weight: bolder;\\n}\\n\\n[data-reach-listbox-option][data-current][data-confirming] {\\n animation: flash 100ms;\\n animation-iteration-count: 1;\\n}\\n\\n[data-reach-listbox-option][aria-disabled=\\\"true\\\"] {\\n opacity: 0.5;\\n}\\n\\n[data-reach-listbox-button] {\\n display: inline-flex;\\n align-items: center;\\n justify-content: space-between;\\n padding: 1px 10px 2px;\\n border: 1px solid;\\n border-color: rgb(216, 216, 216) rgb(209, 209, 209) rgb(186, 186, 186);\\n cursor: default;\\n user-select: none;\\n}\\n\\n[data-reach-listbox-button][aria-disabled=\\\"true\\\"] {\\n opacity: 0.5;\\n}\\n\\n[data-reach-listbox-arrow] {\\n margin-left: 0.5rem;\\n display: block;\\n font-size: 0.5em;\\n}\\n\\n[data-reach-listbox-group-label] {\\n display: block;\\n margin: 0;\\n padding: 0.25rem 0.5rem;\\n white-space: nowrap;\\n user-select: none;\\n font-weight: bolder;\\n}\\n\\n@keyframes flash {\\n 0% {\\n background: hsla(211, 81%, 36%, 1);\\n color: hsl(0, 0%, 100%);\\n opacity: 1;\\n }\\n 50% {\\n opacity: 0.5;\\n background: inherit;\\n color: inherit;\\n }\\n 100% {\\n background: hsla(211, 81%, 36%, 1);\\n color: hsl(0, 0%, 100%);\\n opacity: 1;\\n }\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \":root {\\n --reach-tooltip: 1;\\n}\\n\\n[data-reach-tooltip] {\\n z-index: 1;\\n pointer-events: none;\\n position: absolute;\\n padding: 0.25em 0.5em;\\n box-shadow: 2px 2px 10px hsla(0, 0%, 0%, 0.1);\\n white-space: nowrap;\\n font-size: 85%;\\n background: #f0f0f0;\\n color: #444;\\n border: solid 1px #ccc;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","import * as React from 'react';\nimport { useLayoutEffect, useEffect, isValidElement, cloneElement, createContext, forwardRef, memo, useRef, useState, useCallback, useMemo } from 'react';\nimport fbWarning from 'warning';\n\n/* eslint-disable no-restricted-globals, eqeqeq */\n\n/**\n * React currently throws a warning when using useLayoutEffect on the server.\n * To get around it, we can conditionally useEffect on the server (no-op) and\n * useLayoutEffect in the browser. We occasionally need useLayoutEffect to\n * ensure we don't get a render flash for certain operations, but we may also\n * need affected components to render on the server. One example is when setting\n * a component's descendants to retrieve their index values.\n *\n * Important to note that using this hook as an escape hatch will break the\n * eslint dependency warnings unless you rename the import to `useLayoutEffect`.\n * Use sparingly only when the effect won't effect the rendered HTML to avoid\n * any server/client mismatch.\n *\n * If a useLayoutEffect is needed and the result would create a mismatch, it's\n * likely that the component in question shouldn't be rendered on the server at\n * all, so a better approach would be to lazily render those in a parent\n * component after client-side hydration.\n *\n * TODO: We are calling useLayoutEffect in a couple of places that will likely\n * cause some issues for SSR users, whether the warning shows or not. Audit and\n * fix these.\n *\n * https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js\n *\n * @param effect\n * @param deps\n */\nvar useIsomorphicLayoutEffect = /*#__PURE__*/canUseDOM() ? useLayoutEffect : useEffect;\nvar checkedPkgs = {};\n/**\n * Copy of Facebook's warning package.\n *\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical paths.\n * Removing the logging code for production environments will keep the same\n * logic and follow the same code paths.\n *\n * @see https://github.com/BerkeleyTrue/warning/blob/master/warning.js\n */\n\nvar warning = fbWarning;\n/**\n * When in dev mode, checks that styles for a given @reach package are loaded.\n *\n * @param packageName Name of the package to check.\n * @example checkStyles(\"dialog\") will check for styles for @reach/dialog\n */\n\nvar checkStyles = noop;\n\nif (process.env.NODE_ENV !== \"production\") {\n // In CJS files, process.env.NODE_ENV is stripped from our build, but we need\n // it to prevent style checks from clogging up user logs while testing.\n // This is a workaround until we can tweak the build a bit to accommodate.\n var _ref = typeof process !== \"undefined\" ? process : {\n env: {\n NODE_ENV: \"development\"\n }\n },\n env = _ref.env;\n\n checkStyles = function checkStyles(packageName) {\n // only check once per package\n if (checkedPkgs[packageName]) return;\n checkedPkgs[packageName] = true;\n\n if (env.NODE_ENV !== \"test\" && parseInt(window.getComputedStyle(document.body).getPropertyValue(\"--reach-\" + packageName), 10) !== 1) {\n console.warn(\"@reach/\" + packageName + \" styles not found. If you are using a bundler like webpack or parcel include this in the entry file of your app before any of your own styles:\\n\\n import \\\"@reach/\" + packageName + \"/styles.css\\\";\\n\\n Otherwise you'll need to include them some other way:\\n\\n <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"node_modules/@reach/\" + packageName + \"/styles.css\\\" />\\n\\n For more information visit https://ui.reach.tech/styling.\\n \");\n }\n };\n}\n/**\n * Ponyfill for the global object in some environments.\n *\n * @link https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n */\n\nvar ponyfillGlobal = typeof window != \"undefined\" && window.Math == Math ? window : typeof self != \"undefined\" && self.Math == Math ? self :\n/*#__PURE__*/\n// eslint-disable-next-line no-new-func\nFunction(\"return this\")();\n/**\n * Passes or assigns an arbitrary value to a ref function or object.\n *\n * @param ref\n * @param value\n */\n\nfunction assignRef(ref, value) {\n if (ref == null) return;\n\n if (isFunction(ref)) {\n ref(value);\n } else {\n try {\n ref.current = value;\n } catch (error) {\n throw new Error(\"Cannot assign value \\\"\" + value + \"\\\" to ref \\\"\" + ref + \"\\\"\");\n }\n }\n}\n/**\n * Checks true|\"true\" vs false|\"false\"\n *\n * @param value\n */\n\nfunction boolOrBoolString(value) {\n return value === \"true\" ? true : isBoolean(value) ? value : false;\n}\nfunction canUseDOM() {\n return !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\n}\n/**\n * Type-safe clone element\n *\n * @param element\n * @param props\n * @param children\n */\n\nfunction cloneValidElement(element, props) {\n for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n children[_key - 2] = arguments[_key];\n }\n\n return /*#__PURE__*/isValidElement(element) ? cloneElement.apply(React, [element, props].concat(children)) : element;\n}\nfunction createNamedContext(name, defaultValue) {\n var Ctx = /*#__PURE__*/createContext(defaultValue);\n Ctx.displayName = name;\n return Ctx;\n}\n/**\n * This is a hack for sure. The thing is, getting a component to intelligently\n * infer props based on a component or JSX string passed into an `as` prop is\n * kind of a huge pain. Getting it to work and satisfy the constraints of\n * `forwardRef` seems dang near impossible. To avoid needing to do this awkward\n * type song-and-dance every time we want to forward a ref into a component\n * that accepts an `as` prop, we abstract all of that mess to this function for\n * the time time being.\n */\n\nfunction forwardRefWithAs(render) {\n return /*#__PURE__*/forwardRef(render);\n}\nfunction memoWithAs(Component, propsAreEqual) {\n return /*#__PURE__*/memo(Component, propsAreEqual);\n}\n/**\n * Get the size of the working document minus the scrollbar offset.\n *\n * @param element\n */\n\nfunction getDocumentDimensions(element) {\n var _ownerDocument$docume, _ownerDocument$docume2;\n\n var ownerDocument = getOwnerDocument(element);\n var ownerWindow = ownerDocument.defaultView || window;\n\n if (!ownerDocument) {\n return {\n width: 0,\n height: 0\n };\n }\n\n return {\n width: (_ownerDocument$docume = ownerDocument.documentElement.clientWidth) != null ? _ownerDocument$docume : ownerWindow.innerWidth,\n height: (_ownerDocument$docume2 = ownerDocument.documentElement.clientHeight) != null ? _ownerDocument$docume2 : ownerWindow.innerHeight\n };\n}\n/**\n * Get the scoll position of the global window object relative to a given node.\n *\n * @param element\n */\n\nfunction getScrollPosition(element) {\n var ownerDocument = getOwnerDocument(element);\n var ownerWindow = ownerDocument.defaultView || window;\n\n if (!ownerDocument) {\n return {\n scrollX: 0,\n scrollY: 0\n };\n }\n\n return {\n scrollX: ownerWindow.scrollX,\n scrollY: ownerWindow.scrollY\n };\n}\n/**\n * Get a computed style value by property.\n *\n * @param element\n * @param styleProp\n */\n\nfunction getElementComputedStyle(element, styleProp) {\n var ownerDocument = getOwnerDocument(element);\n var ownerWindow = (ownerDocument == null ? void 0 : ownerDocument.defaultView) || window;\n\n if (ownerWindow) {\n return ownerWindow.getComputedStyle(element, null).getPropertyValue(styleProp);\n }\n\n return null;\n}\n/**\n * Get an element's owner document. Useful when components are used in iframes\n * or other environments like dev tools.\n *\n * @param element\n */\n\nfunction getOwnerDocument(element) {\n return canUseDOM() ? element ? element.ownerDocument : document : null;\n}\n/**\n * TODO: Remove in 1.0\n */\n\nfunction getOwnerWindow(element) {\n var ownerDocument = getOwnerDocument(element);\n return ownerDocument ? ownerDocument.defaultView || window : null;\n}\n/**\n * Get the scrollbar offset distance.\n *\n * TODO: Remove in 1.0 (we used this in public examples)\n */\n\nfunction getScrollbarOffset() {\n try {\n if (window.innerWidth > document.documentElement.clientWidth) {\n return window.innerWidth - document.documentElement.clientWidth;\n }\n } catch (err) {}\n\n return 0;\n}\n/**\n * Checks whether or not a value is a boolean.\n *\n * @param value\n */\n\nfunction isBoolean(value) {\n return typeof value === \"boolean\";\n}\n/**\n * Checks whether or not a value is a function.\n *\n * @param value\n */\n\nfunction isFunction(value) {\n return !!(value && {}.toString.call(value) == \"[object Function]\");\n}\n/**\n * Checks whether or not a value is a number.\n *\n * @param value\n */\n\nfunction isNumber(value) {\n return typeof value === \"number\" && !isNaN(value);\n}\n/**\n * Detects right clicks\n *\n * @param nativeEvent\n */\n\nfunction isRightClick(nativeEvent) {\n return \"which\" in nativeEvent ? nativeEvent.which === 3 : \"button\" in nativeEvent ? nativeEvent.button === 2 : false;\n}\n/**\n * Checks whether or not a value is a string.\n *\n * @param value\n */\n\nfunction isString(value) {\n return typeof value === \"string\";\n}\n/**\n * Joins strings to format IDs for compound components.\n *\n * @param args\n */\n\nfunction makeId() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return args.filter(function (val) {\n return val != null;\n }).join(\"--\");\n}\n/**\n * No-op function.\n */\n\nfunction noop() {}\n/**\n * Convert our state strings for HTML data attributes.\n * No need for a fancy kebab-caser here, we know what our state strings are!\n *\n * @param state\n */\n\nfunction stateToAttributeString(state) {\n return String(state).replace(/([\\s_]+)/g, \"-\").toLowerCase();\n}\n/**\n * Check if a component is controlled or uncontrolled and return the correct\n * state value and setter accordingly. If the component state is controlled by\n * the app, the setter is a noop.\n *\n * @param controlledValue\n * @param defaultValue\n */\n\nfunction useControlledState(controlledValue, defaultValue) {\n var controlledRef = useRef(controlledValue != null);\n\n var _React$useState = useState(defaultValue),\n valueState = _React$useState[0],\n setValue = _React$useState[1];\n\n var set = useCallback(function (n) {\n if (!controlledRef.current) {\n setValue(n);\n }\n }, []);\n return [controlledRef.current ? controlledValue : valueState, set];\n}\n/**\n * Logs a warning in dev mode when a component switches from controlled to\n * uncontrolled, or vice versa\n *\n * A single prop should typically be used to determine whether or not a\n * component is controlled or not.\n *\n * @param controlledValue\n * @param controlledPropName\n * @param componentName\n */\n\nvar useControlledSwitchWarning = noop;\n\nif (process.env.NODE_ENV !== \"production\") {\n useControlledSwitchWarning = function useControlledSwitchWarning(controlledValue, controlledPropName, componentName) {\n var controlledRef = useRef(controlledValue != null);\n var nameCache = useRef({\n componentName: componentName,\n controlledPropName: controlledPropName\n });\n useEffect(function () {\n nameCache.current = {\n componentName: componentName,\n controlledPropName: controlledPropName\n };\n }, [componentName, controlledPropName]);\n useEffect(function () {\n var wasControlled = controlledRef.current;\n var _nameCache$current = nameCache.current,\n componentName = _nameCache$current.componentName,\n controlledPropName = _nameCache$current.controlledPropName;\n var isControlled = controlledValue != null;\n\n if (wasControlled !== isControlled) {\n console.error(\"A component is changing an \" + (wasControlled ? \"\" : \"un\") + \"controlled `\" + controlledPropName + \"` state of \" + componentName + \" to be \" + (wasControlled ? \"un\" : \"\") + \"controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled \" + componentName + \" element for the lifetime of the component.\\nMore info: https://fb.me/react-controlled-components\");\n }\n }, [controlledValue]);\n };\n}\nvar useCheckStyles = noop;\n\nif (process.env.NODE_ENV !== \"production\") {\n useCheckStyles = function useCheckStyles(pkg) {\n var name = useRef(pkg);\n useEffect(function () {\n return void (name.current = pkg);\n }, [pkg]);\n useEffect(function () {\n return checkStyles(name.current);\n }, []);\n };\n}\n/**\n * React hook for creating a value exactly once.\n * @see https://github.com/Andarist/use-constant\n */\n\nfunction useConstant(fn) {\n var ref = useRef();\n\n if (!ref.current) {\n ref.current = {\n v: fn()\n };\n }\n\n return ref.current.v;\n}\n/**\n * @param callback\n */\n\nfunction useEventCallback(callback) {\n var ref = useRef(callback);\n useIsomorphicLayoutEffect(function () {\n ref.current = callback;\n });\n return useCallback(function (event) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n return ref.current.apply(ref, [event].concat(args));\n }, []);\n}\nfunction useLazyRef(fn) {\n var ref = useRef({\n __internalSet: true\n });\n\n if (ref.current && ref.current.__internalSet === true) {\n ref.current = fn();\n }\n\n return ref;\n}\n/**\n * TODO: Remove in 1.0\n * @alias useStableCallback\n * @param callback\n */\n\nvar useCallbackProp = useStableCallback;\n/**\n * Adds a DOM event listener\n *\n * @param eventName\n * @param listener\n * @param element\n */\n\nfunction useEventListener(eventName, listener, element) {\n if (element === void 0) {\n element = window;\n }\n\n var savedHandler = useRef(listener);\n useEffect(function () {\n savedHandler.current = listener;\n }, [listener]);\n useEffect(function () {\n var isSupported = element && element.addEventListener;\n\n if (!isSupported) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"Event listener not supported on the element provided\");\n }\n\n return;\n }\n\n function eventListener(event) {\n savedHandler.current(event);\n }\n\n element.addEventListener(eventName, eventListener);\n return function () {\n element.removeEventListener(eventName, eventListener);\n };\n }, [eventName, element]);\n}\n/**\n * Detect when focus changes in our document.\n *\n * @param handleChange\n * @param when\n * @param ownerDocument\n */\n\nfunction useFocusChange(handleChange, when, ownerDocument) {\n if (handleChange === void 0) {\n handleChange = console.log;\n }\n\n if (when === void 0) {\n when = \"focus\";\n }\n\n if (ownerDocument === void 0) {\n ownerDocument = document;\n }\n\n var lastActiveElement = useRef(ownerDocument.activeElement);\n useEffect(function () {\n lastActiveElement.current = ownerDocument.activeElement;\n\n function onChange(event) {\n if (lastActiveElement.current !== ownerDocument.activeElement) {\n handleChange(ownerDocument.activeElement, lastActiveElement.current, event);\n lastActiveElement.current = ownerDocument.activeElement;\n }\n }\n\n ownerDocument.addEventListener(when, onChange, true);\n return function () {\n ownerDocument.removeEventListener(when, onChange);\n };\n }, [when, handleChange, ownerDocument]);\n}\n/**\n * Forces a re-render, similar to `forceUpdate` in class components.\n */\n\nfunction useForceUpdate() {\n var _React$useState2 = useState(Object.create(null)),\n dispatch = _React$useState2[1];\n\n return useCallback(function () {\n dispatch(Object.create(null));\n }, []);\n}\n/**\n * Passes or assigns a value to multiple refs (typically a DOM node). Useful for\n * dealing with components that need an explicit ref for DOM calculations but\n * also forwards refs assigned by an app.\n *\n * @param refs Refs to fork\n */\n\nfunction useForkedRef() {\n for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n refs[_key4] = arguments[_key4];\n }\n\n return useMemo(function () {\n if (refs.every(function (ref) {\n return ref == null;\n })) {\n return null;\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n assignRef(ref, node);\n });\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [].concat(refs));\n}\n/**\n * Returns the previous value of a reference after a component update.\n *\n * @param value\n */\n\nfunction usePrevious(value) {\n var ref = useRef(null);\n useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n}\n/**\n * Converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop and exposed as a stable function to avoid executing effects when\n * passed as a dependency.\n */\n\nfunction useStableCallback(callback) {\n var callbackRef = useRef(callback);\n useEffect(function () {\n callbackRef.current = callback;\n }); // eslint-disable-next-line react-hooks/exhaustive-deps\n\n return useCallback(function () {\n callbackRef.current && callbackRef.current.apply(callbackRef, arguments);\n }, []);\n}\n/**\n * Call an effect after a component update, skipping the initial mount.\n *\n * @param effect Effect to call\n * @param deps Effect dependency list\n */\n\nfunction useUpdateEffect(effect, deps) {\n var mounted = useRef(false);\n useEffect(function () {\n if (mounted.current) {\n effect();\n } else {\n mounted.current = true;\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, deps);\n}\n/**\n * Just a lil state logger\n *\n * @param state\n * @param DEBUG\n */\n\nvar useStateLogger = noop;\n\nif (process.env.NODE_ENV !== \"production\") {\n useStateLogger = function useStateLogger(state, DEBUG) {\n if (DEBUG === void 0) {\n DEBUG = false;\n }\n\n var debugRef = useRef(DEBUG);\n useEffect(function () {\n debugRef.current = DEBUG;\n }, [DEBUG]);\n useEffect(function () {\n if (debugRef.current) {\n console.group(\"State Updated\");\n console.log(\"%c\" + state, \"font-weight: normal; font-size: 120%; font-style: italic;\");\n console.groupEnd();\n }\n }, [state]);\n };\n}\n/**\n * Wraps a lib-defined event handler and a user-defined event handler, returning\n * a single handler that allows a user to prevent lib-defined handlers from\n * firing.\n *\n * @param theirHandler User-supplied event handler\n * @param ourHandler Library-supplied event handler\n */\n\nfunction wrapEvent(theirHandler, ourHandler) {\n return function (event) {\n theirHandler && theirHandler(event);\n\n if (!event.defaultPrevented) {\n return ourHandler(event);\n }\n };\n} // Export types\n\nexport { assignRef, boolOrBoolString, canUseDOM, checkStyles, cloneValidElement, createNamedContext, forwardRefWithAs, getDocumentDimensions, getElementComputedStyle, getOwnerDocument, getOwnerWindow, getScrollPosition, getScrollbarOffset, isBoolean, isFunction, isNumber, isRightClick, isString, makeId, memoWithAs, noop, ponyfillGlobal, stateToAttributeString, useCallbackProp, useCheckStyles, useConstant, useControlledState, useControlledSwitchWarning, useEventCallback, useEventListener, useFocusChange, useForceUpdate, useForkedRef, useIsomorphicLayoutEffect, useLazyRef, usePrevious, useStableCallback, useStateLogger, useUpdateEffect, warning, wrapEvent };\n","import { useRef, createElement } from 'react';\nimport { useForceUpdate, useIsomorphicLayoutEffect } from '@reach/utils';\nimport { createPortal } from 'react-dom';\n\n/**\n * Welcome to @reach/portal!\n *\n * Creates and appends a DOM node to the end of `document.body` and renders a\n * React tree into it. Useful for rendering a natural React element hierarchy\n * with a different DOM hierarchy to prevent parent styles from clipping or\n * hiding content (for popovers, dropdowns, and modals).\n *\n * @see Docs https://reach.tech/portal\n * @see Source https://github.com/reach/reach-ui/tree/main/packages/portal\n * @see React https://reactjs.org/docs/portals.html\n */\n/**\n * Portal\n *\n * @see Docs https://reach.tech/portal#portal\n */\n\nvar Portal = function Portal(_ref) {\n var children = _ref.children,\n _ref$type = _ref.type,\n type = _ref$type === void 0 ? \"reach-portal\" : _ref$type;\n var mountNode = useRef(null);\n var portalNode = useRef(null);\n var forceUpdate = useForceUpdate();\n useIsomorphicLayoutEffect(function () {\n // This ref may be null when a hot-loader replaces components on the page\n if (!mountNode.current) return; // It's possible that the content of the portal has, itself, been portaled.\n // In that case, it's important to append to the correct document element.\n\n var ownerDocument = mountNode.current.ownerDocument;\n portalNode.current = ownerDocument == null ? void 0 : ownerDocument.createElement(type);\n ownerDocument.body.appendChild(portalNode.current);\n forceUpdate();\n return function () {\n if (portalNode.current && portalNode.current.ownerDocument) {\n portalNode.current.ownerDocument.body.removeChild(portalNode.current);\n }\n };\n }, [type, forceUpdate]);\n return portalNode.current ? /*#__PURE__*/createPortal(children, portalNode.current) : /*#__PURE__*/createElement(\"span\", {\n ref: mountNode\n });\n};\n/**\n * @see Docs https://reach.tech/portal#portal-props\n */\n\n\nif (process.env.NODE_ENV !== \"production\") {\n Portal.displayName = \"Portal\";\n} ////////////////////////////////////////////////////////////////////////////////\n\nexport default Portal;\nexport { Portal };\n","import { useState, useEffect } from 'react';\nimport { useIsomorphicLayoutEffect } from '@reach/utils';\n\n/*\n * Welcome to @reach/auto-id!\n\n * Let's see if we can make sense of why this hook exists and its\n * implementation.\n *\n * Some background:\n * 1. Accessibiliy APIs rely heavily on element IDs\n * 2. Requiring developers to put IDs on every element in Reach UI is both\n * cumbersome and error-prone\n * 3. With a component model, we can generate IDs for them!\n *\n * Solution 1: Generate random IDs.\n *\n * This works great as long as you don't server render your app. When React (in\n * the client) tries to reuse the markup from the server, the IDs won't match\n * and React will then recreate the entire DOM tree.\n *\n * Solution 2: Increment an integer\n *\n * This sounds great. Since we're rendering the exact same tree on the server\n * and client, we can increment a counter and get a deterministic result between\n * client and server. Also, JS integers can go up to nine-quadrillion. I'm\n * pretty sure the tab will be closed before an app never needs\n * 10 quadrillion IDs!\n *\n * Problem solved, right?\n *\n * Ah, but there's a catch! React's concurrent rendering makes this approach\n * non-deterministic. While the client and server will end up with the same\n * elements in the end, depending on suspense boundaries (and possibly some user\n * input during the initial render) the incrementing integers won't always match\n * up.\n *\n * Solution 3: Don't use IDs at all on the server; patch after first render.\n *\n * What we've done here is solution 2 with some tricks. With this approach, the\n * ID returned is an empty string on the first render. This way the server and\n * client have the same markup no matter how wild the concurrent rendering may\n * have gotten.\n *\n * After the render, we patch up the components with an incremented ID. This\n * causes a double render on any components with `useId`. Shouldn't be a problem\n * since the components using this hook should be small, and we're only updating\n * the ID attribute on the DOM, nothing big is happening.\n *\n * It doesn't have to be an incremented number, though--we could do generate\n * random strings instead, but incrementing a number is probably the cheapest\n * thing we can do.\n *\n * Additionally, we only do this patchup on the very first client render ever.\n * Any calls to `useId` that happen dynamically in the client will be\n * populated immediately with a value. So, we only get the double render after\n * server hydration and never again, SO BACK OFF ALRIGHT?\n */\nvar serverHandoffComplete = false;\nvar id = 0;\n\nvar genId = function genId() {\n return ++id;\n};\n/**\n * useId\n *\n * Autogenerate IDs to facilitate WAI-ARIA and server rendering.\n *\n * Note: The returned ID will initially be `null` and will update after a\n * component mounts. Users may need to supply their own ID if they need\n * consistent values for SSR.\n *\n * @see Docs https://reach.tech/auto-id\n */\n\n\nfunction useId(idFromProps) {\n /*\n * If this instance isn't part of the initial render, we don't have to do the\n * double render/patch-up dance. We can just generate the ID and return it.\n */\n var initialId = idFromProps || (serverHandoffComplete ? genId() : null);\n\n var _React$useState = useState(initialId),\n id = _React$useState[0],\n setId = _React$useState[1];\n\n useIsomorphicLayoutEffect(function () {\n if (id === null) {\n /*\n * Patch the ID after render. We do this in `useLayoutEffect` to avoid any\n * rendering flicker, though it'll make the first render slower (unlikely\n * to matter, but you're welcome to measure your app and let us know if\n * it's a problem).\n */\n setId(genId());\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, []);\n useEffect(function () {\n if (serverHandoffComplete === false) {\n /*\n * Flag all future uses of `useId` to skip the update dance. This is in\n * `useEffect` because it goes after `useLayoutEffect`, ensuring we don't\n * accidentally bail out of the patch-up dance prematurely.\n */\n serverHandoffComplete = true;\n }\n }, []);\n return id != null ? String(id) : undefined;\n}\n\nexport { useId };\n","var props = [\"bottom\", \"height\", \"left\", \"right\", \"top\", \"width\"];\n\nvar rectChanged = function rectChanged(a, b) {\n if (a === void 0) {\n a = {};\n }\n\n if (b === void 0) {\n b = {};\n }\n\n return props.some(function (prop) {\n return a[prop] !== b[prop];\n });\n};\n\nvar observedNodes = /*#__PURE__*/new Map();\nvar rafId;\n\nvar run = function run() {\n var changedStates = [];\n observedNodes.forEach(function (state, node) {\n var newRect = node.getBoundingClientRect();\n\n if (rectChanged(newRect, state.rect)) {\n state.rect = newRect;\n changedStates.push(state);\n }\n });\n changedStates.forEach(function (state) {\n state.callbacks.forEach(function (cb) {\n return cb(state.rect);\n });\n });\n rafId = window.requestAnimationFrame(run);\n};\n\nfunction observeRect(node, cb) {\n return {\n observe: function observe() {\n var wasEmpty = observedNodes.size === 0;\n\n if (observedNodes.has(node)) {\n observedNodes.get(node).callbacks.push(cb);\n } else {\n observedNodes.set(node, {\n rect: undefined,\n hasRectChanged: false,\n callbacks: [cb]\n });\n }\n\n if (wasEmpty) run();\n },\n unobserve: function unobserve() {\n var state = observedNodes.get(node);\n\n if (state) {\n // Remove the callback\n var index = state.callbacks.indexOf(cb);\n if (index >= 0) state.callbacks.splice(index, 1); // Remove the node reference\n\n if (!state.callbacks.length) observedNodes[\"delete\"](node); // Stop the loop\n\n if (!observedNodes.size) cancelAnimationFrame(rafId);\n }\n }\n };\n}\n\nexport default observeRect;\n//# sourceMappingURL=observe-rect.esm.js.map\n","import { useRef, useEffect, useState, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport observeRect from '@reach/observe-rect';\nimport { isBoolean, isFunction, warning, useIsomorphicLayoutEffect } from '@reach/utils';\n\n/**\n * Welcome to @reach/rect!\n *\n * Measures DOM elements (aka. bounding client rect).\n *\n * @see getBoundingClientRect https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect\n * @see Docs https://reach.tech/rect\n * @see Source https://github.com/reach/reach-ui/tree/main/packages/rect\n */\n\n/**\n * Rect\n *\n * @param props\n */\n\nvar Rect = function Rect(_ref) {\n var onChange = _ref.onChange,\n _ref$observe = _ref.observe,\n observe = _ref$observe === void 0 ? true : _ref$observe,\n children = _ref.children;\n var ref = useRef(null);\n var rect = useRect(ref, {\n observe: observe,\n onChange: onChange\n });\n return children({\n ref: ref,\n rect: rect\n });\n};\n/**\n * @see Docs https://reach.tech/rect#rect-props\n */\n\n\nif (process.env.NODE_ENV !== \"production\") {\n Rect.displayName = \"Rect\";\n Rect.propTypes = {\n children: PropTypes.func.isRequired,\n observe: PropTypes.bool,\n onChange: PropTypes.func\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\n\n/**\n * useRect\n *\n * @param nodeRef\n * @param observe\n * @param onChange\n */\nfunction useRect(nodeRef, observeOrOptions, deprecated_onChange) {\n var observe;\n var onChange;\n\n if (isBoolean(observeOrOptions)) {\n observe = observeOrOptions;\n } else {\n var _observeOrOptions$obs;\n\n observe = (_observeOrOptions$obs = observeOrOptions == null ? void 0 : observeOrOptions.observe) != null ? _observeOrOptions$obs : true;\n onChange = observeOrOptions == null ? void 0 : observeOrOptions.onChange;\n }\n\n if (isFunction(deprecated_onChange)) {\n onChange = deprecated_onChange;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(function () {\n process.env.NODE_ENV !== \"production\" ? warning(!isBoolean(observeOrOptions), \"Passing `observe` as the second argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `observe` property as the second argument (`useRect(ref, { observe })`).\\n\" + \"See https://reach.tech/rect#userect-observe\") : void 0;\n }, [observeOrOptions]); // eslint-disable-next-line react-hooks/rules-of-hooks\n\n useEffect(function () {\n process.env.NODE_ENV !== \"production\" ? warning(!isFunction(deprecated_onChange), \"Passing `onChange` as the third argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `onChange` property as the second argument (`useRect(ref, { onChange })`).\\n\" + \"See https://reach.tech/rect#userect-onchange\") : void 0;\n }, [deprecated_onChange]);\n }\n\n var _React$useState = useState(nodeRef.current),\n element = _React$useState[0],\n setElement = _React$useState[1];\n\n var initialRectIsSet = useRef(false);\n var initialRefIsSet = useRef(false);\n\n var _React$useState2 = useState(null),\n rect = _React$useState2[0],\n setRect = _React$useState2[1];\n\n var onChangeRef = useRef(onChange);\n var stableOnChange = useCallback(function (rect) {\n onChangeRef.current && onChangeRef.current(rect);\n }, []); // eslint-disable-next-line react-hooks/exhaustive-deps\n\n useIsomorphicLayoutEffect(function () {\n onChangeRef.current = onChange;\n\n if (nodeRef.current !== element) {\n setElement(nodeRef.current);\n }\n });\n useIsomorphicLayoutEffect(function () {\n if (element && !initialRectIsSet.current) {\n initialRectIsSet.current = true;\n setRect(element.getBoundingClientRect());\n }\n }, [element]);\n useIsomorphicLayoutEffect(function () {\n var observer;\n var elem = element; // State initializes before refs are placed, meaning the element state will\n // be undefined on the first render. We still want the rect on the first\n // render, so initially we'll use the nodeRef that was passed instead of\n // state for our measurements.\n\n if (!initialRefIsSet.current) {\n initialRefIsSet.current = true;\n elem = nodeRef.current;\n }\n\n if (!elem) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"You need to place the ref\");\n }\n\n return cleanup;\n }\n\n observer = observeRect(elem, function (rect) {\n stableOnChange(rect);\n setRect(rect);\n });\n observe && observer.observe();\n return cleanup;\n\n function cleanup() {\n observer && observer.unobserve();\n }\n }, [observe, element, nodeRef, stableOnChange]);\n return rect;\n}\n\nexport default Rect;\nexport { Rect, useRect };\n","var api = require(\"!../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../css-loader/dist/cjs.js!./styles.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \"/* This code is subject to LICENSE in root of this repository */\\n\\n/* Used to detect in JavaScript if apps have loaded styles or not. */\\n:root {\\n --reach-dialog: 1;\\n}\\n\\n[data-reach-dialog-overlay] {\\n background: hsla(0, 0%, 0%, 0.33);\\n position: fixed;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n overflow: auto;\\n}\\n\\n[data-reach-dialog-content] {\\n width: 50vw;\\n margin: 10vh auto;\\n background: white;\\n padding: 2rem;\\n outline: none;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n"],"sourceRoot":""}