{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"register\"],\n    _excluded2 = [\"onPress\", \"onPressChange\", \"onPressStart\", \"onPressEnd\", \"onPressUp\", \"isDisabled\", \"isPressed\", \"preventFocusOnPress\", \"shouldCancelOnPointerExit\", \"allowTextSelectionOnPress\", \"ref\"],\n    _excluded3 = [\"children\"],\n    _excluded4 = [\"children\"];\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nimport { mergeProps as $7R3Av$mergeProps, useSyncRef as $7R3Av$useSyncRef, useGlobalListeners as $7R3Av$useGlobalListeners, focusWithoutScrolling as $7R3Av$focusWithoutScrolling, isIOS as $7R3Av$isIOS, runAfterTransition as $7R3Av$runAfterTransition, isMac as $7R3Av$isMac, useEvent as $7R3Av$useEvent, useDescription as $7R3Av$useDescription } from \"@react-aria/utils\";\nimport $7R3Av$react, { useRef as $7R3Av$useRef, useContext as $7R3Av$useContext, useState as $7R3Av$useState, useMemo as $7R3Av$useMemo, useEffect as $7R3Av$useEffect, useCallback as $7R3Av$useCallback } from \"react\";\n\nfunction $parcel$export(e, n, v, s) {\n  Object.defineProperty(e, n, {\n    get: v,\n    set: s,\n    enumerable: true,\n    configurable: true\n  });\n}\n\nvar $acf5f8872229f2cb$exports = {};\n$parcel$export($acf5f8872229f2cb$exports, \"Pressable\", function () {\n  return $acf5f8872229f2cb$export$27c701ed9e449e99;\n});\nvar $bb70d401e0bbab2b$exports = {};\n$parcel$export($bb70d401e0bbab2b$exports, \"usePress\", function () {\n  return $bb70d401e0bbab2b$export$45712eceda6fad21;\n});\nvar $8714dea79b55b9da$var$state = 'default';\nvar $8714dea79b55b9da$var$savedUserSelect = '';\nvar $8714dea79b55b9da$var$modifiedElementMap = new WeakMap();\n\nfunction $8714dea79b55b9da$export$16a4697467175487(target) {\n  if ($7R3Av$isIOS()) {\n    if ($8714dea79b55b9da$var$state === 'default') {\n      $8714dea79b55b9da$var$savedUserSelect = document.documentElement.style.webkitUserSelect;\n      document.documentElement.style.webkitUserSelect = 'none';\n    }\n\n    $8714dea79b55b9da$var$state = 'disabled';\n  } else if (target) {\n    $8714dea79b55b9da$var$modifiedElementMap.set(target, target.style.userSelect);\n    target.style.userSelect = 'none';\n  }\n}\n\nfunction $8714dea79b55b9da$export$b0d6fa1ab32e3295(target) {\n  if ($7R3Av$isIOS()) {\n    if ($8714dea79b55b9da$var$state !== 'disabled') return;\n    $8714dea79b55b9da$var$state = 'restoring';\n    setTimeout(function () {\n      $7R3Av$runAfterTransition(function () {\n        if ($8714dea79b55b9da$var$state === 'restoring') {\n          if (document.documentElement.style.webkitUserSelect === 'none') document.documentElement.style.webkitUserSelect = $8714dea79b55b9da$var$savedUserSelect || '';\n          $8714dea79b55b9da$var$savedUserSelect = '';\n          $8714dea79b55b9da$var$state = 'default';\n        }\n      });\n    }, 300);\n  } else if (target && $8714dea79b55b9da$var$modifiedElementMap.has(target)) {\n      var targetOldUserSelect = $8714dea79b55b9da$var$modifiedElementMap.get(target);\n      if (target.style.userSelect === 'none') target.style.userSelect = targetOldUserSelect;\n      if (target.getAttribute('style') === '') target.removeAttribute('style');\n      $8714dea79b55b9da$var$modifiedElementMap.delete(target);\n    }\n}\n\nfunction $e0ce205c97c9e771$export$60278871457622de(event) {\n  if (event.mozInputSource === 0 && event.isTrusted) return true;\n  return event.detail === 0 && !event.pointerType;\n}\n\nvar $60f869ba95814a99$export$5165eccb35aaadb5 = $7R3Av$react.createContext(null);\n$60f869ba95814a99$export$5165eccb35aaadb5.displayName = 'PressResponderContext';\n\nfunction $bb70d401e0bbab2b$var$usePressResponderContext(props) {\n  var context = $7R3Av$useContext($60f869ba95814a99$export$5165eccb35aaadb5);\n\n  if (context) {\n    var register = context.register,\n        contextProps = _objectWithoutProperties(context, _excluded);\n\n    props = $7R3Av$mergeProps(contextProps, props);\n    register();\n  }\n\n  $7R3Av$useSyncRef(context, props.ref);\n  return props;\n}\n\nfunction $bb70d401e0bbab2b$export$45712eceda6fad21(props) {\n  var _$bb70d401e0bbab2b$va = $bb70d401e0bbab2b$var$usePressResponderContext(props),\n      onPress1 = _$bb70d401e0bbab2b$va.onPress,\n      onPressChange1 = _$bb70d401e0bbab2b$va.onPressChange,\n      onPressStart1 = _$bb70d401e0bbab2b$va.onPressStart,\n      onPressEnd1 = _$bb70d401e0bbab2b$va.onPressEnd,\n      onPressUp1 = _$bb70d401e0bbab2b$va.onPressUp,\n      isDisabled1 = _$bb70d401e0bbab2b$va.isDisabled,\n      isPressedProp = _$bb70d401e0bbab2b$va.isPressed,\n      preventFocusOnPress = _$bb70d401e0bbab2b$va.preventFocusOnPress,\n      shouldCancelOnPointerExit = _$bb70d401e0bbab2b$va.shouldCancelOnPointerExit,\n      allowTextSelectionOnPress = _$bb70d401e0bbab2b$va.allowTextSelectionOnPress,\n      _ = _$bb70d401e0bbab2b$va.ref,\n      domProps = _objectWithoutProperties(_$bb70d401e0bbab2b$va, _excluded2);\n\n  var propsRef = $7R3Av$useRef(null);\n  propsRef.current = {\n    onPress: onPress1,\n    onPressChange: onPressChange1,\n    onPressStart: onPressStart1,\n    onPressEnd: onPressEnd1,\n    onPressUp: onPressUp1,\n    isDisabled: isDisabled1,\n    shouldCancelOnPointerExit: shouldCancelOnPointerExit\n  };\n\n  var _$7R3Av$useState = $7R3Av$useState(false),\n      _$7R3Av$useState2 = _slicedToArray(_$7R3Av$useState, 2),\n      isPressed = _$7R3Av$useState2[0],\n      setPressed = _$7R3Av$useState2[1];\n\n  var ref = $7R3Av$useRef({\n    isPressed: false,\n    ignoreEmulatedMouseEvents: false,\n    ignoreClickAfterPress: false,\n    didFirePressStart: false,\n    activePointerId: null,\n    target: null,\n    isOverTarget: false,\n    pointerType: null\n  });\n\n  var _$7R3Av$useGlobalList = $7R3Av$useGlobalListeners(),\n      addGlobalListener = _$7R3Av$useGlobalList.addGlobalListener,\n      removeAllGlobalListeners = _$7R3Av$useGlobalList.removeAllGlobalListeners;\n\n  var pressProps1 = $7R3Av$useMemo(function () {\n    var state = ref.current;\n\n    var triggerPressStart = function triggerPressStart(originalEvent, pointerType) {\n      var _propsRef$current = propsRef.current,\n          onPressStart = _propsRef$current.onPressStart,\n          onPressChange = _propsRef$current.onPressChange,\n          isDisabled = _propsRef$current.isDisabled;\n      if (isDisabled || state.didFirePressStart) return;\n      if (onPressStart) onPressStart({\n        type: 'pressstart',\n        pointerType: pointerType,\n        target: originalEvent.currentTarget,\n        shiftKey: originalEvent.shiftKey,\n        metaKey: originalEvent.metaKey,\n        ctrlKey: originalEvent.ctrlKey,\n        altKey: originalEvent.altKey\n      });\n      if (onPressChange) onPressChange(true);\n      state.didFirePressStart = true;\n      setPressed(true);\n    };\n\n    var triggerPressEnd = function triggerPressEnd(originalEvent, pointerType) {\n      var wasPressed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n      var _propsRef$current2 = propsRef.current,\n          onPressEnd = _propsRef$current2.onPressEnd,\n          onPressChange = _propsRef$current2.onPressChange,\n          onPress = _propsRef$current2.onPress,\n          isDisabled = _propsRef$current2.isDisabled;\n      if (!state.didFirePressStart) return;\n      state.ignoreClickAfterPress = true;\n      state.didFirePressStart = false;\n      if (onPressEnd) onPressEnd({\n        type: 'pressend',\n        pointerType: pointerType,\n        target: originalEvent.currentTarget,\n        shiftKey: originalEvent.shiftKey,\n        metaKey: originalEvent.metaKey,\n        ctrlKey: originalEvent.ctrlKey,\n        altKey: originalEvent.altKey\n      });\n      if (onPressChange) onPressChange(false);\n      setPressed(false);\n      if (onPress && wasPressed && !isDisabled) onPress({\n        type: 'press',\n        pointerType: pointerType,\n        target: originalEvent.currentTarget,\n        shiftKey: originalEvent.shiftKey,\n        metaKey: originalEvent.metaKey,\n        ctrlKey: originalEvent.ctrlKey,\n        altKey: originalEvent.altKey\n      });\n    };\n\n    var triggerPressUp = function triggerPressUp(originalEvent, pointerType) {\n      var _propsRef$current3 = propsRef.current,\n          onPressUp = _propsRef$current3.onPressUp,\n          isDisabled = _propsRef$current3.isDisabled;\n      if (isDisabled) return;\n      if (onPressUp) onPressUp({\n        type: 'pressup',\n        pointerType: pointerType,\n        target: originalEvent.currentTarget,\n        shiftKey: originalEvent.shiftKey,\n        metaKey: originalEvent.metaKey,\n        ctrlKey: originalEvent.ctrlKey,\n        altKey: originalEvent.altKey\n      });\n    };\n\n    var cancel = function cancel(e) {\n      if (state.isPressed) {\n        if (state.isOverTarget) triggerPressEnd($bb70d401e0bbab2b$var$createEvent(state.target, e), state.pointerType, false);\n        state.isPressed = false;\n        state.isOverTarget = false;\n        state.activePointerId = null;\n        state.pointerType = null;\n        removeAllGlobalListeners();\n        if (!allowTextSelectionOnPress) $8714dea79b55b9da$export$b0d6fa1ab32e3295(state.target);\n      }\n    };\n\n    var pressProps = {\n      onKeyDown: function onKeyDown(e) {\n        if ($bb70d401e0bbab2b$var$isValidKeyboardEvent(e.nativeEvent) && e.currentTarget.contains(e.target)) {\n          if ($bb70d401e0bbab2b$var$shouldPreventDefaultKeyboard(e.target)) e.preventDefault();\n          e.stopPropagation();\n\n          if (!state.isPressed && !e.repeat) {\n            state.target = e.currentTarget;\n            state.isPressed = true;\n            triggerPressStart(e, 'keyboard');\n            addGlobalListener(document, 'keyup', onKeyUp, false);\n          }\n        }\n      },\n      onKeyUp: function onKeyUp(e) {\n        if ($bb70d401e0bbab2b$var$isValidKeyboardEvent(e.nativeEvent) && !e.repeat && e.currentTarget.contains(e.target)) triggerPressUp($bb70d401e0bbab2b$var$createEvent(state.target, e), 'keyboard');\n      },\n      onClick: function onClick(e) {\n        if (e && !e.currentTarget.contains(e.target)) return;\n\n        if (e && e.button === 0) {\n          e.stopPropagation();\n          if (isDisabled1) e.preventDefault();\n\n          if (!state.ignoreClickAfterPress && !state.ignoreEmulatedMouseEvents && (state.pointerType === 'virtual' || $e0ce205c97c9e771$export$60278871457622de(e.nativeEvent))) {\n            if (!isDisabled1 && !preventFocusOnPress) $7R3Av$focusWithoutScrolling(e.currentTarget);\n            triggerPressStart(e, 'virtual');\n            triggerPressUp(e, 'virtual');\n            triggerPressEnd(e, 'virtual');\n          }\n\n          state.ignoreEmulatedMouseEvents = false;\n          state.ignoreClickAfterPress = false;\n        }\n      }\n    };\n\n    var onKeyUp = function onKeyUp(e) {\n      if (state.isPressed && $bb70d401e0bbab2b$var$isValidKeyboardEvent(e)) {\n        if ($bb70d401e0bbab2b$var$shouldPreventDefaultKeyboard(e.target)) e.preventDefault();\n        e.stopPropagation();\n        state.isPressed = false;\n        var target = e.target;\n        triggerPressEnd($bb70d401e0bbab2b$var$createEvent(state.target, e), 'keyboard', state.target.contains(target));\n        removeAllGlobalListeners();\n        if (state.target.contains(target) && $bb70d401e0bbab2b$var$isHTMLAnchorLink(state.target) || state.target.getAttribute('role') === 'link') state.target.click();\n      }\n    };\n\n    if (typeof PointerEvent !== 'undefined') {\n      pressProps.onPointerDown = function (e) {\n        if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;\n\n        if ($bb70d401e0bbab2b$var$isVirtualPointerEvent(e.nativeEvent)) {\n          state.pointerType = 'virtual';\n          return;\n        }\n\n        if ($bb70d401e0bbab2b$var$shouldPreventDefault(e.target)) e.preventDefault();\n        state.pointerType = e.pointerType;\n        e.stopPropagation();\n\n        if (!state.isPressed) {\n          state.isPressed = true;\n          state.isOverTarget = true;\n          state.activePointerId = e.pointerId;\n          state.target = e.currentTarget;\n          if (!isDisabled1 && !preventFocusOnPress) $7R3Av$focusWithoutScrolling(e.currentTarget);\n          if (!allowTextSelectionOnPress) $8714dea79b55b9da$export$16a4697467175487(state.target);\n          triggerPressStart(e, state.pointerType);\n          addGlobalListener(document, 'pointermove', onPointerMove, false);\n          addGlobalListener(document, 'pointerup', onPointerUp, false);\n          addGlobalListener(document, 'pointercancel', onPointerCancel, false);\n        }\n      };\n\n      pressProps.onMouseDown = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n\n        if (e.button === 0) {\n          if ($bb70d401e0bbab2b$var$shouldPreventDefault(e.target)) e.preventDefault();\n          e.stopPropagation();\n        }\n      };\n\n      pressProps.onPointerUp = function (e) {\n        if (!e.currentTarget.contains(e.target) || state.pointerType === 'virtual') return;\n        if (e.button === 0 && $bb70d401e0bbab2b$var$isOverTarget(e, e.currentTarget)) triggerPressUp(e, state.pointerType || e.pointerType);\n      };\n\n      var onPointerMove = function onPointerMove(e) {\n        if (e.pointerId !== state.activePointerId) return;\n\n        if ($bb70d401e0bbab2b$var$isOverTarget(e, state.target)) {\n          if (!state.isOverTarget) {\n            state.isOverTarget = true;\n            triggerPressStart($bb70d401e0bbab2b$var$createEvent(state.target, e), state.pointerType);\n          }\n        } else if (state.isOverTarget) {\n          state.isOverTarget = false;\n          triggerPressEnd($bb70d401e0bbab2b$var$createEvent(state.target, e), state.pointerType, false);\n          if (propsRef.current.shouldCancelOnPointerExit) cancel(e);\n        }\n      };\n\n      var onPointerUp = function onPointerUp(e) {\n        if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0) {\n          if ($bb70d401e0bbab2b$var$isOverTarget(e, state.target)) triggerPressEnd($bb70d401e0bbab2b$var$createEvent(state.target, e), state.pointerType);else if (state.isOverTarget) triggerPressEnd($bb70d401e0bbab2b$var$createEvent(state.target, e), state.pointerType, false);\n          state.isPressed = false;\n          state.isOverTarget = false;\n          state.activePointerId = null;\n          state.pointerType = null;\n          removeAllGlobalListeners();\n          if (!allowTextSelectionOnPress) $8714dea79b55b9da$export$b0d6fa1ab32e3295(state.target);\n        }\n      };\n\n      var onPointerCancel = function onPointerCancel(e) {\n        cancel(e);\n      };\n\n      pressProps.onDragStart = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n        cancel(e);\n      };\n    } else {\n      pressProps.onMouseDown = function (e) {\n        if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;\n        if ($bb70d401e0bbab2b$var$shouldPreventDefault(e.target)) e.preventDefault();\n        e.stopPropagation();\n        if (state.ignoreEmulatedMouseEvents) return;\n        state.isPressed = true;\n        state.isOverTarget = true;\n        state.target = e.currentTarget;\n        state.pointerType = $e0ce205c97c9e771$export$60278871457622de(e.nativeEvent) ? 'virtual' : 'mouse';\n        if (!isDisabled1 && !preventFocusOnPress) $7R3Av$focusWithoutScrolling(e.currentTarget);\n        triggerPressStart(e, state.pointerType);\n        addGlobalListener(document, 'mouseup', onMouseUp, false);\n      };\n\n      pressProps.onMouseEnter = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n        e.stopPropagation();\n\n        if (state.isPressed && !state.ignoreEmulatedMouseEvents) {\n          state.isOverTarget = true;\n          triggerPressStart(e, state.pointerType);\n        }\n      };\n\n      pressProps.onMouseLeave = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n        e.stopPropagation();\n\n        if (state.isPressed && !state.ignoreEmulatedMouseEvents) {\n          state.isOverTarget = false;\n          triggerPressEnd(e, state.pointerType, false);\n          if (propsRef.current.shouldCancelOnPointerExit) cancel(e);\n        }\n      };\n\n      pressProps.onMouseUp = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n        if (!state.ignoreEmulatedMouseEvents && e.button === 0) triggerPressUp(e, state.pointerType);\n      };\n\n      var onMouseUp = function onMouseUp(e) {\n        if (e.button !== 0) return;\n        state.isPressed = false;\n        removeAllGlobalListeners();\n\n        if (state.ignoreEmulatedMouseEvents) {\n          state.ignoreEmulatedMouseEvents = false;\n          return;\n        }\n\n        if ($bb70d401e0bbab2b$var$isOverTarget(e, state.target)) triggerPressEnd($bb70d401e0bbab2b$var$createEvent(state.target, e), state.pointerType);else if (state.isOverTarget) triggerPressEnd($bb70d401e0bbab2b$var$createEvent(state.target, e), state.pointerType, false);\n        state.isOverTarget = false;\n      };\n\n      pressProps.onTouchStart = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n        e.stopPropagation();\n        var touch = $bb70d401e0bbab2b$var$getTouchFromEvent(e.nativeEvent);\n        if (!touch) return;\n        state.activePointerId = touch.identifier;\n        state.ignoreEmulatedMouseEvents = true;\n        state.isOverTarget = true;\n        state.isPressed = true;\n        state.target = e.currentTarget;\n        state.pointerType = 'touch';\n        if (!isDisabled1 && !preventFocusOnPress) $7R3Av$focusWithoutScrolling(e.currentTarget);\n        if (!allowTextSelectionOnPress) $8714dea79b55b9da$export$16a4697467175487(state.target);\n        triggerPressStart(e, state.pointerType);\n        addGlobalListener(window, 'scroll', onScroll, true);\n      };\n\n      pressProps.onTouchMove = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n        e.stopPropagation();\n        if (!state.isPressed) return;\n        var touch = $bb70d401e0bbab2b$var$getTouchById(e.nativeEvent, state.activePointerId);\n\n        if (touch && $bb70d401e0bbab2b$var$isOverTarget(touch, e.currentTarget)) {\n          if (!state.isOverTarget) {\n            state.isOverTarget = true;\n            triggerPressStart(e, state.pointerType);\n          }\n        } else if (state.isOverTarget) {\n          state.isOverTarget = false;\n          triggerPressEnd(e, state.pointerType, false);\n          if (propsRef.current.shouldCancelOnPointerExit) cancel(e);\n        }\n      };\n\n      pressProps.onTouchEnd = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n        e.stopPropagation();\n        if (!state.isPressed) return;\n        var touch = $bb70d401e0bbab2b$var$getTouchById(e.nativeEvent, state.activePointerId);\n\n        if (touch && $bb70d401e0bbab2b$var$isOverTarget(touch, e.currentTarget)) {\n          triggerPressUp(e, state.pointerType);\n          triggerPressEnd(e, state.pointerType);\n        } else if (state.isOverTarget) triggerPressEnd(e, state.pointerType, false);\n\n        state.isPressed = false;\n        state.activePointerId = null;\n        state.isOverTarget = false;\n        state.ignoreEmulatedMouseEvents = true;\n        if (!allowTextSelectionOnPress) $8714dea79b55b9da$export$b0d6fa1ab32e3295(state.target);\n        removeAllGlobalListeners();\n      };\n\n      pressProps.onTouchCancel = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n        e.stopPropagation();\n        if (state.isPressed) cancel(e);\n      };\n\n      var onScroll = function onScroll(e) {\n        if (state.isPressed && e.target.contains(state.target)) cancel({\n          currentTarget: state.target,\n          shiftKey: false,\n          ctrlKey: false,\n          metaKey: false,\n          altKey: false\n        });\n      };\n\n      pressProps.onDragStart = function (e) {\n        if (!e.currentTarget.contains(e.target)) return;\n        cancel(e);\n      };\n    }\n\n    return pressProps;\n  }, [addGlobalListener, isDisabled1, preventFocusOnPress, removeAllGlobalListeners, allowTextSelectionOnPress]);\n  $7R3Av$useEffect(function () {\n    return function () {\n      if (!allowTextSelectionOnPress) $8714dea79b55b9da$export$b0d6fa1ab32e3295(ref.current.target);\n    };\n  }, [allowTextSelectionOnPress]);\n  return {\n    isPressed: isPressedProp || isPressed,\n    pressProps: $7R3Av$mergeProps(domProps, pressProps1)\n  };\n}\n\nfunction $bb70d401e0bbab2b$var$isHTMLAnchorLink(target) {\n  return target.tagName === 'A' && target.hasAttribute('href');\n}\n\nfunction $bb70d401e0bbab2b$var$isValidKeyboardEvent(event) {\n  var key = event.key,\n      code = event.code,\n      target = event.target;\n  var element = target;\n  var tagName = element.tagName,\n      isContentEditable = element.isContentEditable;\n  var role = element.getAttribute('role');\n  return (key === 'Enter' || key === ' ' || key === 'Spacebar' || code === 'Space') && tagName !== 'INPUT' && tagName !== 'TEXTAREA' && isContentEditable !== true && (!$bb70d401e0bbab2b$var$isHTMLAnchorLink(element) || role === 'button' && key !== 'Enter') && !(role === 'link' && key !== 'Enter');\n}\n\nfunction $bb70d401e0bbab2b$var$getTouchFromEvent(event) {\n  var targetTouches = event.targetTouches;\n  if (targetTouches.length > 0) return targetTouches[0];\n  return null;\n}\n\nfunction $bb70d401e0bbab2b$var$getTouchById(event, pointerId) {\n  var changedTouches = event.changedTouches;\n\n  for (var i = 0; i < changedTouches.length; i++) {\n    var touch = changedTouches[i];\n    if (touch.identifier === pointerId) return touch;\n  }\n\n  return null;\n}\n\nfunction $bb70d401e0bbab2b$var$createEvent(target, e) {\n  return {\n    currentTarget: target,\n    shiftKey: e.shiftKey,\n    ctrlKey: e.ctrlKey,\n    metaKey: e.metaKey,\n    altKey: e.altKey\n  };\n}\n\nfunction $bb70d401e0bbab2b$var$getPointClientRect(point) {\n  var offsetX = point.width / 2 || point.radiusX || 0;\n  var offsetY = point.height / 2 || point.radiusY || 0;\n  return {\n    top: point.clientY - offsetY,\n    right: point.clientX + offsetX,\n    bottom: point.clientY + offsetY,\n    left: point.clientX - offsetX\n  };\n}\n\nfunction $bb70d401e0bbab2b$var$areRectanglesOverlapping(a, b) {\n  if (a.left > b.right || b.left > a.right) return false;\n  if (a.top > b.bottom || b.top > a.bottom) return false;\n  return true;\n}\n\nfunction $bb70d401e0bbab2b$var$isOverTarget(point, target) {\n  var rect = target.getBoundingClientRect();\n  var pointRect = $bb70d401e0bbab2b$var$getPointClientRect(point);\n  return $bb70d401e0bbab2b$var$areRectanglesOverlapping(rect, pointRect);\n}\n\nfunction $bb70d401e0bbab2b$var$shouldPreventDefault(target) {\n  return !target.closest('[draggable=\"true\"]');\n}\n\nfunction $bb70d401e0bbab2b$var$shouldPreventDefaultKeyboard(target) {\n  return !((target.tagName === 'INPUT' || target.tagName === 'BUTTON') && target.type === 'submit');\n}\n\nfunction $bb70d401e0bbab2b$var$isVirtualPointerEvent(event) {\n  return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0;\n}\n\nvar $acf5f8872229f2cb$export$27c701ed9e449e99 = $7R3Av$react.forwardRef(function (_ref, ref) {\n  var _ref2;\n\n  var children = _ref.children,\n      props = _objectWithoutProperties(_ref, _excluded3);\n\n  var newRef = $7R3Av$useRef();\n  ref = (_ref2 = ref) != null ? _ref2 : newRef;\n\n  var _$bb70d401e0bbab2b$ex = $bb70d401e0bbab2b$export$45712eceda6fad21(_objectSpread(_objectSpread({}, props), {}, {\n    ref: ref\n  })),\n      pressProps = _$bb70d401e0bbab2b$ex.pressProps;\n\n  var child = $7R3Av$react.Children.only(children);\n  return $7R3Av$react.cloneElement(child, _objectSpread({\n    ref: ref\n  }, $7R3Av$mergeProps(child.props, pressProps)));\n});\nvar $36b2a54c41893e87$exports = {};\n$parcel$export($36b2a54c41893e87$exports, \"PressResponder\", function () {\n  return $36b2a54c41893e87$export$3351871ee4b288b8;\n});\nvar $36b2a54c41893e87$export$3351871ee4b288b8 = $7R3Av$react.forwardRef(function (_ref3, ref) {\n  var children = _ref3.children,\n      props = _objectWithoutProperties(_ref3, _excluded4);\n\n  var isRegistered = $7R3Av$useRef(false);\n  var prevContext = $7R3Av$useContext($60f869ba95814a99$export$5165eccb35aaadb5);\n  var context = $7R3Av$mergeProps(prevContext || {}, _objectSpread(_objectSpread({}, props), {}, {\n    ref: ref || (prevContext == null ? void 0 : prevContext.ref),\n    register: function register() {\n      isRegistered.current = true;\n      if (prevContext) prevContext.register();\n    }\n  }));\n  $7R3Av$useSyncRef(prevContext, ref);\n  $7R3Av$useEffect(function () {\n    if (!isRegistered.current) console.warn(\"A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component.\");\n  }, []);\n  return $7R3Av$react.createElement($60f869ba95814a99$export$5165eccb35aaadb5.Provider, {\n    value: context\n  }, children);\n});\nvar $96cd623b8d5dd15d$exports = {};\n$parcel$export($96cd623b8d5dd15d$exports, \"useFocus\", function () {\n  return $96cd623b8d5dd15d$export$f8168d8dd8fd66e6;\n});\n\nfunction $96cd623b8d5dd15d$export$f8168d8dd8fd66e6(props) {\n  if (props.isDisabled) return {\n    focusProps: {}\n  };\n  var onFocus, onBlur;\n  if (props.onFocus || props.onFocusChange) onFocus = function onFocus(e) {\n    if (e.target === e.currentTarget) {\n      if (props.onFocus) props.onFocus(e);\n      if (props.onFocusChange) props.onFocusChange(true);\n    }\n  };\n  if (props.onBlur || props.onFocusChange) onBlur = function onBlur(e) {\n    if (e.target === e.currentTarget) {\n      if (props.onBlur) props.onBlur(e);\n      if (props.onFocusChange) props.onFocusChange(false);\n    }\n  };\n  return {\n    focusProps: {\n      onFocus: onFocus,\n      onBlur: onBlur\n    }\n  };\n}\n\nvar $d2dd66cff767efeb$exports = {};\n$parcel$export($d2dd66cff767efeb$exports, \"isFocusVisible\", function () {\n  return $d2dd66cff767efeb$export$b9b3dfddab17db27;\n});\n$parcel$export($d2dd66cff767efeb$exports, \"getInteractionModality\", function () {\n  return $d2dd66cff767efeb$export$630ff653c5ada6a9;\n});\n$parcel$export($d2dd66cff767efeb$exports, \"setInteractionModality\", function () {\n  return $d2dd66cff767efeb$export$8397ddfc504fdb9a;\n});\n$parcel$export($d2dd66cff767efeb$exports, \"useInteractionModality\", function () {\n  return $d2dd66cff767efeb$export$98e20ec92f614cfe;\n});\n$parcel$export($d2dd66cff767efeb$exports, \"useFocusVisible\", function () {\n  return $d2dd66cff767efeb$export$ffd9e5021c1fb2d6;\n});\n$parcel$export($d2dd66cff767efeb$exports, \"useFocusVisibleListener\", function () {\n  return $d2dd66cff767efeb$export$ec71b4b83ac08ec3;\n});\nvar $d2dd66cff767efeb$var$currentModality = null;\nvar $d2dd66cff767efeb$var$changeHandlers = new Set();\nvar $d2dd66cff767efeb$var$hasSetupGlobalListeners = false;\nvar $d2dd66cff767efeb$var$hasEventBeforeFocus = false;\nvar $d2dd66cff767efeb$var$hasBlurredWindowRecently = false;\nvar $d2dd66cff767efeb$var$FOCUS_VISIBLE_INPUT_KEYS = {\n  Tab: true,\n  Escape: true\n};\n\nfunction $d2dd66cff767efeb$var$triggerChangeHandlers(modality, e) {\n  for (var _iterator = _createForOfIteratorHelperLoose($d2dd66cff767efeb$var$changeHandlers), _step; !(_step = _iterator()).done;) {\n    var handler = _step.value;\n    handler(modality, e);\n  }\n}\n\nfunction $d2dd66cff767efeb$var$isValidKey(e) {\n  return !(e.metaKey || !$7R3Av$isMac() && e.altKey || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta');\n}\n\nfunction $d2dd66cff767efeb$var$handleKeyboardEvent(e) {\n  $d2dd66cff767efeb$var$hasEventBeforeFocus = true;\n\n  if ($d2dd66cff767efeb$var$isValidKey(e)) {\n    $d2dd66cff767efeb$var$currentModality = 'keyboard';\n    $d2dd66cff767efeb$var$triggerChangeHandlers('keyboard', e);\n  }\n}\n\nfunction $d2dd66cff767efeb$var$handlePointerEvent(e) {\n  $d2dd66cff767efeb$var$currentModality = 'pointer';\n\n  if (e.type === 'mousedown' || e.type === 'pointerdown') {\n    $d2dd66cff767efeb$var$hasEventBeforeFocus = true;\n    $d2dd66cff767efeb$var$triggerChangeHandlers('pointer', e);\n  }\n}\n\nfunction $d2dd66cff767efeb$var$handleClickEvent(e) {\n  if ($e0ce205c97c9e771$export$60278871457622de(e)) {\n    $d2dd66cff767efeb$var$hasEventBeforeFocus = true;\n    $d2dd66cff767efeb$var$currentModality = 'virtual';\n  }\n}\n\nfunction $d2dd66cff767efeb$var$handleFocusEvent(e) {\n  if (e.target === window || e.target === document) return;\n\n  if (!$d2dd66cff767efeb$var$hasEventBeforeFocus && !$d2dd66cff767efeb$var$hasBlurredWindowRecently) {\n    $d2dd66cff767efeb$var$currentModality = 'virtual';\n    $d2dd66cff767efeb$var$triggerChangeHandlers('virtual', e);\n  }\n\n  $d2dd66cff767efeb$var$hasEventBeforeFocus = false;\n  $d2dd66cff767efeb$var$hasBlurredWindowRecently = false;\n}\n\nfunction $d2dd66cff767efeb$var$handleWindowBlur() {\n  $d2dd66cff767efeb$var$hasEventBeforeFocus = false;\n  $d2dd66cff767efeb$var$hasBlurredWindowRecently = true;\n}\n\nfunction $d2dd66cff767efeb$var$setupGlobalFocusEvents() {\n  if (typeof window === 'undefined' || $d2dd66cff767efeb$var$hasSetupGlobalListeners) return;\n  var focus = HTMLElement.prototype.focus;\n\n  HTMLElement.prototype.focus = function () {\n    $d2dd66cff767efeb$var$hasEventBeforeFocus = true;\n    focus.apply(this, arguments);\n  };\n\n  document.addEventListener('keydown', $d2dd66cff767efeb$var$handleKeyboardEvent, true);\n  document.addEventListener('keyup', $d2dd66cff767efeb$var$handleKeyboardEvent, true);\n  document.addEventListener('click', $d2dd66cff767efeb$var$handleClickEvent, true);\n  window.addEventListener('focus', $d2dd66cff767efeb$var$handleFocusEvent, true);\n  window.addEventListener('blur', $d2dd66cff767efeb$var$handleWindowBlur, false);\n\n  if (typeof PointerEvent !== 'undefined') {\n    document.addEventListener('pointerdown', $d2dd66cff767efeb$var$handlePointerEvent, true);\n    document.addEventListener('pointermove', $d2dd66cff767efeb$var$handlePointerEvent, true);\n    document.addEventListener('pointerup', $d2dd66cff767efeb$var$handlePointerEvent, true);\n  } else {\n    document.addEventListener('mousedown', $d2dd66cff767efeb$var$handlePointerEvent, true);\n    document.addEventListener('mousemove', $d2dd66cff767efeb$var$handlePointerEvent, true);\n    document.addEventListener('mouseup', $d2dd66cff767efeb$var$handlePointerEvent, true);\n  }\n\n  $d2dd66cff767efeb$var$hasSetupGlobalListeners = true;\n}\n\nif (typeof document !== 'undefined') {\n  if (document.readyState !== 'loading') $d2dd66cff767efeb$var$setupGlobalFocusEvents();else document.addEventListener('DOMContentLoaded', $d2dd66cff767efeb$var$setupGlobalFocusEvents);\n}\n\nfunction $d2dd66cff767efeb$export$b9b3dfddab17db27() {\n  return $d2dd66cff767efeb$var$currentModality !== 'pointer';\n}\n\nfunction $d2dd66cff767efeb$export$630ff653c5ada6a9() {\n  return $d2dd66cff767efeb$var$currentModality;\n}\n\nfunction $d2dd66cff767efeb$export$8397ddfc504fdb9a(modality) {\n  $d2dd66cff767efeb$var$currentModality = modality;\n  $d2dd66cff767efeb$var$triggerChangeHandlers(modality, null);\n}\n\nfunction $d2dd66cff767efeb$export$98e20ec92f614cfe() {\n  $d2dd66cff767efeb$var$setupGlobalFocusEvents();\n\n  var _$7R3Av$useState3 = $7R3Av$useState($d2dd66cff767efeb$var$currentModality),\n      _$7R3Av$useState4 = _slicedToArray(_$7R3Av$useState3, 2),\n      modality = _$7R3Av$useState4[0],\n      setModality = _$7R3Av$useState4[1];\n\n  $7R3Av$useEffect(function () {\n    var handler = function handler() {\n      setModality($d2dd66cff767efeb$var$currentModality);\n    };\n\n    $d2dd66cff767efeb$var$changeHandlers.add(handler);\n    return function () {\n      $d2dd66cff767efeb$var$changeHandlers.delete(handler);\n    };\n  }, []);\n  return modality;\n}\n\nfunction $d2dd66cff767efeb$var$isKeyboardFocusEvent(isTextInput, modality, e) {\n  return !(isTextInput && modality === 'keyboard' && e instanceof KeyboardEvent && !$d2dd66cff767efeb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);\n}\n\nfunction $d2dd66cff767efeb$export$ffd9e5021c1fb2d6() {\n  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var isTextInput = props.isTextInput,\n      autoFocus = props.autoFocus;\n\n  var _$7R3Av$useState5 = $7R3Av$useState(autoFocus || $d2dd66cff767efeb$export$b9b3dfddab17db27()),\n      _$7R3Av$useState6 = _slicedToArray(_$7R3Av$useState5, 2),\n      isFocusVisibleState = _$7R3Av$useState6[0],\n      setFocusVisible = _$7R3Av$useState6[1];\n\n  $d2dd66cff767efeb$export$ec71b4b83ac08ec3(function ($d2dd66cff767efeb$export$b9b3dfddab17db27) {\n    setFocusVisible($d2dd66cff767efeb$export$b9b3dfddab17db27);\n  }, [isTextInput], {\n    isTextInput: isTextInput\n  });\n  return {\n    isFocusVisible: isFocusVisibleState\n  };\n}\n\nfunction $d2dd66cff767efeb$export$ec71b4b83ac08ec3(fn, deps, opts) {\n  $d2dd66cff767efeb$var$setupGlobalFocusEvents();\n  $7R3Av$useEffect(function () {\n    var handler = function handler(modality, e) {\n      if (!$d2dd66cff767efeb$var$isKeyboardFocusEvent(opts == null ? void 0 : opts.isTextInput, modality, e)) return;\n      fn($d2dd66cff767efeb$export$b9b3dfddab17db27());\n    };\n\n    $d2dd66cff767efeb$var$changeHandlers.add(handler);\n    return function () {\n      $d2dd66cff767efeb$var$changeHandlers.delete(handler);\n    };\n  }, deps);\n}\n\nvar $d2acb2e6011484f7$exports = {};\n$parcel$export($d2acb2e6011484f7$exports, \"useFocusWithin\", function () {\n  return $d2acb2e6011484f7$export$420e68273165f4ec;\n});\n\nfunction $d2acb2e6011484f7$export$420e68273165f4ec(props) {\n  var state = $7R3Av$useRef({\n    isFocusWithin: false\n  }).current;\n  if (props.isDisabled) return {\n    focusWithinProps: {}\n  };\n\n  var onFocus = function onFocus(e) {\n    if (!state.isFocusWithin) {\n      if (props.onFocusWithin) props.onFocusWithin(e);\n      if (props.onFocusWithinChange) props.onFocusWithinChange(true);\n      state.isFocusWithin = true;\n    }\n  };\n\n  var onBlur = function onBlur(e) {\n    if (state.isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {\n      if (props.onBlurWithin) props.onBlurWithin(e);\n      if (props.onFocusWithinChange) props.onFocusWithinChange(false);\n      state.isFocusWithin = false;\n    }\n  };\n\n  return {\n    focusWithinProps: {\n      onFocus: onFocus,\n      onBlur: onBlur\n    }\n  };\n}\n\nvar $52a70f66afabebbb$exports = {};\n$parcel$export($52a70f66afabebbb$exports, \"useHover\", function () {\n  return $52a70f66afabebbb$export$ae780daf29e6d456;\n});\nvar $52a70f66afabebbb$var$globalIgnoreEmulatedMouseEvents = false;\nvar $52a70f66afabebbb$var$hoverCount = 0;\n\nfunction $52a70f66afabebbb$var$setGlobalIgnoreEmulatedMouseEvents() {\n  $52a70f66afabebbb$var$globalIgnoreEmulatedMouseEvents = true;\n  setTimeout(function () {\n    $52a70f66afabebbb$var$globalIgnoreEmulatedMouseEvents = false;\n  }, 50);\n}\n\nfunction $52a70f66afabebbb$var$handleGlobalPointerEvent(e) {\n  if (e.pointerType === 'touch') $52a70f66afabebbb$var$setGlobalIgnoreEmulatedMouseEvents();\n}\n\nfunction $52a70f66afabebbb$var$setupGlobalTouchEvents() {\n  if (typeof document === 'undefined') return;\n  if (typeof PointerEvent !== 'undefined') document.addEventListener('pointerup', $52a70f66afabebbb$var$handleGlobalPointerEvent);else document.addEventListener('touchend', $52a70f66afabebbb$var$setGlobalIgnoreEmulatedMouseEvents);\n  $52a70f66afabebbb$var$hoverCount++;\n  return function () {\n    $52a70f66afabebbb$var$hoverCount--;\n    if ($52a70f66afabebbb$var$hoverCount > 0) return;\n    if (typeof PointerEvent !== 'undefined') document.removeEventListener('pointerup', $52a70f66afabebbb$var$handleGlobalPointerEvent);else document.removeEventListener('touchend', $52a70f66afabebbb$var$setGlobalIgnoreEmulatedMouseEvents);\n  };\n}\n\nfunction $52a70f66afabebbb$export$ae780daf29e6d456(props) {\n  var onHoverStart = props.onHoverStart,\n      onHoverChange = props.onHoverChange,\n      onHoverEnd = props.onHoverEnd,\n      isDisabled = props.isDisabled;\n\n  var _$7R3Av$useState7 = $7R3Av$useState(false),\n      _$7R3Av$useState8 = _slicedToArray(_$7R3Av$useState7, 2),\n      isHovered = _$7R3Av$useState8[0],\n      setHovered = _$7R3Av$useState8[1];\n\n  var state = $7R3Av$useRef({\n    isHovered: false,\n    ignoreEmulatedMouseEvents: false,\n    pointerType: '',\n    target: null\n  }).current;\n  $7R3Av$useEffect($52a70f66afabebbb$var$setupGlobalTouchEvents, []);\n\n  var _$7R3Av$useMemo = $7R3Av$useMemo(function () {\n    var triggerHoverStart = function triggerHoverStart(event, pointerType) {\n      state.pointerType = pointerType;\n      if (isDisabled || pointerType === 'touch' || state.isHovered || !event.currentTarget.contains(event.target)) return;\n      state.isHovered = true;\n      var target = event.currentTarget;\n      state.target = target;\n      if (onHoverStart) onHoverStart({\n        type: 'hoverstart',\n        target: target,\n        pointerType: pointerType\n      });\n      if (onHoverChange) onHoverChange(true);\n      setHovered(true);\n    };\n\n    var triggerHoverEnd = function triggerHoverEnd(event, pointerType) {\n      state.pointerType = '';\n      state.target = null;\n      if (pointerType === 'touch' || !state.isHovered) return;\n      state.isHovered = false;\n      var target = event.currentTarget;\n      if (onHoverEnd) onHoverEnd({\n        type: 'hoverend',\n        target: target,\n        pointerType: pointerType\n      });\n      if (onHoverChange) onHoverChange(false);\n      setHovered(false);\n    };\n\n    var hoverProps = {};\n\n    if (typeof PointerEvent !== 'undefined') {\n      hoverProps.onPointerEnter = function (e) {\n        if ($52a70f66afabebbb$var$globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') return;\n        triggerHoverStart(e, e.pointerType);\n      };\n\n      hoverProps.onPointerLeave = function (e) {\n        if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, e.pointerType);\n      };\n    } else {\n      hoverProps.onTouchStart = function () {\n        state.ignoreEmulatedMouseEvents = true;\n      };\n\n      hoverProps.onMouseEnter = function (e) {\n        if (!state.ignoreEmulatedMouseEvents && !$52a70f66afabebbb$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e, 'mouse');\n        state.ignoreEmulatedMouseEvents = false;\n      };\n\n      hoverProps.onMouseLeave = function (e) {\n        if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, 'mouse');\n      };\n    }\n\n    return {\n      hoverProps: hoverProps,\n      triggerHoverEnd: triggerHoverEnd\n    };\n  }, [onHoverStart, onHoverChange, onHoverEnd, isDisabled, state]),\n      hoverProps1 = _$7R3Av$useMemo.hoverProps,\n      triggerHoverEnd1 = _$7R3Av$useMemo.triggerHoverEnd;\n\n  $7R3Av$useEffect(function () {\n    if (isDisabled) triggerHoverEnd1({\n      currentTarget: state.target\n    }, state.pointerType);\n  }, [isDisabled]);\n  return {\n    hoverProps: hoverProps1,\n    isHovered: isHovered\n  };\n}\n\nvar $ba9bc027ba236f10$exports = {};\n$parcel$export($ba9bc027ba236f10$exports, \"useInteractOutside\", function () {\n  return $ba9bc027ba236f10$export$872b660ac5a1ff98;\n});\n\nfunction $ba9bc027ba236f10$export$872b660ac5a1ff98(props) {\n  var ref = props.ref,\n      onInteractOutside = props.onInteractOutside,\n      isDisabled = props.isDisabled,\n      onInteractOutsideStart = props.onInteractOutsideStart;\n  var stateRef = $7R3Av$useRef({\n    isPointerDown: false,\n    ignoreEmulatedMouseEvents: false,\n    onInteractOutside: onInteractOutside,\n    onInteractOutsideStart: onInteractOutsideStart\n  });\n  var state = stateRef.current;\n  state.onInteractOutside = onInteractOutside;\n  state.onInteractOutsideStart = onInteractOutsideStart;\n  $7R3Av$useEffect(function () {\n    if (isDisabled) return;\n\n    var onPointerDown = function onPointerDown(e) {\n      if ($ba9bc027ba236f10$var$isValidEvent(e, ref) && state.onInteractOutside) {\n        if (state.onInteractOutsideStart) state.onInteractOutsideStart(e);\n        state.isPointerDown = true;\n      }\n    };\n\n    if (typeof PointerEvent !== 'undefined') {\n      var onPointerUp = function onPointerUp(e) {\n        if (state.isPointerDown && state.onInteractOutside && $ba9bc027ba236f10$var$isValidEvent(e, ref)) {\n          state.isPointerDown = false;\n          state.onInteractOutside(e);\n        }\n      };\n\n      document.addEventListener('pointerdown', onPointerDown, true);\n      document.addEventListener('pointerup', onPointerUp, true);\n      return function () {\n        document.removeEventListener('pointerdown', onPointerDown, true);\n        document.removeEventListener('pointerup', onPointerUp, true);\n      };\n    } else {\n      var onMouseUp = function onMouseUp(e) {\n        if (state.ignoreEmulatedMouseEvents) state.ignoreEmulatedMouseEvents = false;else if (state.isPointerDown && state.onInteractOutside && $ba9bc027ba236f10$var$isValidEvent(e, ref)) {\n          state.isPointerDown = false;\n          state.onInteractOutside(e);\n        }\n      };\n\n      var onTouchEnd = function onTouchEnd(e) {\n        state.ignoreEmulatedMouseEvents = true;\n\n        if (state.onInteractOutside && state.isPointerDown && $ba9bc027ba236f10$var$isValidEvent(e, ref)) {\n          state.isPointerDown = false;\n          state.onInteractOutside(e);\n        }\n      };\n\n      document.addEventListener('mousedown', onPointerDown, true);\n      document.addEventListener('mouseup', onMouseUp, true);\n      document.addEventListener('touchstart', onPointerDown, true);\n      document.addEventListener('touchend', onTouchEnd, true);\n      return function () {\n        document.removeEventListener('mousedown', onPointerDown, true);\n        document.removeEventListener('mouseup', onMouseUp, true);\n        document.removeEventListener('touchstart', onPointerDown, true);\n        document.removeEventListener('touchend', onTouchEnd, true);\n      };\n    }\n  }, [ref, state, isDisabled]);\n}\n\nfunction $ba9bc027ba236f10$var$isValidEvent(event, ref) {\n  if (event.button > 0) return false;\n\n  if (event.target) {\n    var ownerDocument = event.target.ownerDocument;\n    if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) return false;\n  }\n\n  return ref.current && !ref.current.contains(event.target);\n}\n\nvar $a866ba1020241f41$exports = {};\n$parcel$export($a866ba1020241f41$exports, \"useKeyboard\", function () {\n  return $a866ba1020241f41$export$8f71654801c2f7cd;\n});\n\nfunction $23f3ec5b42541cce$export$48d1ea6320830260(handler) {\n  if (!handler) return;\n  var shouldStopPropagation = true;\n  return function (e) {\n    var event = _objectSpread(_objectSpread({}, e), {}, {\n      preventDefault: function preventDefault() {\n        e.preventDefault();\n      },\n      isDefaultPrevented: function isDefaultPrevented() {\n        return e.isDefaultPrevented();\n      },\n      stopPropagation: function stopPropagation() {\n        console.error('stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.');\n      },\n      continuePropagation: function continuePropagation() {\n        shouldStopPropagation = false;\n      }\n    });\n\n    handler(event);\n    if (shouldStopPropagation) e.stopPropagation();\n  };\n}\n\nfunction $a866ba1020241f41$export$8f71654801c2f7cd(props) {\n  return {\n    keyboardProps: props.isDisabled ? {} : {\n      onKeyDown: $23f3ec5b42541cce$export$48d1ea6320830260(props.onKeyDown),\n      onKeyUp: $23f3ec5b42541cce$export$48d1ea6320830260(props.onKeyUp)\n    }\n  };\n}\n\nvar $75f78fec52a57cf7$exports = {};\n$parcel$export($75f78fec52a57cf7$exports, \"useMove\", function () {\n  return $75f78fec52a57cf7$export$36da96379f79f245;\n});\n\nfunction $75f78fec52a57cf7$export$36da96379f79f245(props) {\n  var onMoveStart = props.onMoveStart,\n      onMove = props.onMove,\n      onMoveEnd = props.onMoveEnd;\n  var state = $7R3Av$useRef({\n    didMove: false,\n    lastPosition: null,\n    id: null\n  });\n\n  var _$7R3Av$useGlobalList2 = $7R3Av$useGlobalListeners(),\n      addGlobalListener = _$7R3Av$useGlobalList2.addGlobalListener,\n      removeGlobalListener = _$7R3Av$useGlobalList2.removeGlobalListener;\n\n  var moveProps1 = $7R3Av$useMemo(function () {\n    var moveProps = {};\n\n    var start = function start() {\n      $8714dea79b55b9da$export$16a4697467175487();\n      state.current.didMove = false;\n    };\n\n    var move = function move(originalEvent, pointerType, deltaX, deltaY) {\n      if (deltaX === 0 && deltaY === 0) return;\n\n      if (!state.current.didMove) {\n        state.current.didMove = true;\n        onMoveStart == null ? void 0 : onMoveStart({\n          type: 'movestart',\n          pointerType: pointerType,\n          shiftKey: originalEvent.shiftKey,\n          metaKey: originalEvent.metaKey,\n          ctrlKey: originalEvent.ctrlKey,\n          altKey: originalEvent.altKey\n        });\n      }\n\n      onMove({\n        type: 'move',\n        pointerType: pointerType,\n        deltaX: deltaX,\n        deltaY: deltaY,\n        shiftKey: originalEvent.shiftKey,\n        metaKey: originalEvent.metaKey,\n        ctrlKey: originalEvent.ctrlKey,\n        altKey: originalEvent.altKey\n      });\n    };\n\n    var end = function end(originalEvent, pointerType) {\n      $8714dea79b55b9da$export$b0d6fa1ab32e3295();\n      if (state.current.didMove) onMoveEnd == null ? void 0 : onMoveEnd({\n        type: 'moveend',\n        pointerType: pointerType,\n        shiftKey: originalEvent.shiftKey,\n        metaKey: originalEvent.metaKey,\n        ctrlKey: originalEvent.ctrlKey,\n        altKey: originalEvent.altKey\n      });\n    };\n\n    if (typeof PointerEvent === 'undefined') {\n      var onMouseMove = function onMouseMove(e) {\n        if (e.button === 0) {\n          move(e, 'mouse', e.pageX - state.current.lastPosition.pageX, e.pageY - state.current.lastPosition.pageY);\n          state.current.lastPosition = {\n            pageX: e.pageX,\n            pageY: e.pageY\n          };\n        }\n      };\n\n      var onMouseUp = function onMouseUp(e) {\n        if (e.button === 0) {\n          end(e, 'mouse');\n          removeGlobalListener(window, 'mousemove', onMouseMove, false);\n          removeGlobalListener(window, 'mouseup', onMouseUp, false);\n        }\n      };\n\n      moveProps.onMouseDown = function (e) {\n        if (e.button === 0) {\n          start();\n          e.stopPropagation();\n          e.preventDefault();\n          state.current.lastPosition = {\n            pageX: e.pageX,\n            pageY: e.pageY\n          };\n          addGlobalListener(window, 'mousemove', onMouseMove, false);\n          addGlobalListener(window, 'mouseup', onMouseUp, false);\n        }\n      };\n\n      var onTouchMove = function onTouchMove(e) {\n        var touch = _toConsumableArray(e.changedTouches).findIndex(function (_ref4) {\n          var identifier = _ref4.identifier;\n          return identifier === state.current.id;\n        });\n\n        if (touch >= 0) {\n          var _e$changedTouches$tou = e.changedTouches[touch],\n              pageX = _e$changedTouches$tou.pageX,\n              pageY = _e$changedTouches$tou.pageY;\n          move(e, 'touch', pageX - state.current.lastPosition.pageX, pageY - state.current.lastPosition.pageY);\n          state.current.lastPosition = {\n            pageX: pageX,\n            pageY: pageY\n          };\n        }\n      };\n\n      var onTouchEnd = function onTouchEnd(e) {\n        var touch = _toConsumableArray(e.changedTouches).findIndex(function (_ref5) {\n          var identifier = _ref5.identifier;\n          return identifier === state.current.id;\n        });\n\n        if (touch >= 0) {\n          end(e, 'touch');\n          state.current.id = null;\n          removeGlobalListener(window, 'touchmove', onTouchMove);\n          removeGlobalListener(window, 'touchend', onTouchEnd);\n          removeGlobalListener(window, 'touchcancel', onTouchEnd);\n        }\n      };\n\n      moveProps.onTouchStart = function (e) {\n        if (e.changedTouches.length === 0 || state.current.id != null) return;\n        var _e$changedTouches$ = e.changedTouches[0],\n            pageX = _e$changedTouches$.pageX,\n            pageY = _e$changedTouches$.pageY,\n            identifier = _e$changedTouches$.identifier;\n        start();\n        e.stopPropagation();\n        e.preventDefault();\n        state.current.lastPosition = {\n          pageX: pageX,\n          pageY: pageY\n        };\n        state.current.id = identifier;\n        addGlobalListener(window, 'touchmove', onTouchMove, false);\n        addGlobalListener(window, 'touchend', onTouchEnd, false);\n        addGlobalListener(window, 'touchcancel', onTouchEnd, false);\n      };\n    } else {\n      var onPointerMove = function onPointerMove(e) {\n        if (e.pointerId === state.current.id) {\n          var pointerType = e.pointerType || 'mouse';\n          move(e, pointerType, e.pageX - state.current.lastPosition.pageX, e.pageY - state.current.lastPosition.pageY);\n          state.current.lastPosition = {\n            pageX: e.pageX,\n            pageY: e.pageY\n          };\n        }\n      };\n\n      var onPointerUp = function onPointerUp(e) {\n        if (e.pointerId === state.current.id) {\n          var pointerType = e.pointerType || 'mouse';\n          end(e, pointerType);\n          state.current.id = null;\n          removeGlobalListener(window, 'pointermove', onPointerMove, false);\n          removeGlobalListener(window, 'pointerup', onPointerUp, false);\n          removeGlobalListener(window, 'pointercancel', onPointerUp, false);\n        }\n      };\n\n      moveProps.onPointerDown = function (e) {\n        if (e.button === 0 && state.current.id == null) {\n          start();\n          e.stopPropagation();\n          e.preventDefault();\n          state.current.lastPosition = {\n            pageX: e.pageX,\n            pageY: e.pageY\n          };\n          state.current.id = e.pointerId;\n          addGlobalListener(window, 'pointermove', onPointerMove, false);\n          addGlobalListener(window, 'pointerup', onPointerUp, false);\n          addGlobalListener(window, 'pointercancel', onPointerUp, false);\n        }\n      };\n    }\n\n    var triggerKeyboardMove = function triggerKeyboardMove(e, deltaX, deltaY) {\n      start();\n      move(e, 'keyboard', deltaX, deltaY);\n      end(e, 'keyboard');\n    };\n\n    moveProps.onKeyDown = function (e) {\n      switch (e.key) {\n        case 'Left':\n        case 'ArrowLeft':\n          e.preventDefault();\n          e.stopPropagation();\n          triggerKeyboardMove(e, -1, 0);\n          break;\n\n        case 'Right':\n        case 'ArrowRight':\n          e.preventDefault();\n          e.stopPropagation();\n          triggerKeyboardMove(e, 1, 0);\n          break;\n\n        case 'Up':\n        case 'ArrowUp':\n          e.preventDefault();\n          e.stopPropagation();\n          triggerKeyboardMove(e, 0, -1);\n          break;\n\n        case 'Down':\n        case 'ArrowDown':\n          e.preventDefault();\n          e.stopPropagation();\n          triggerKeyboardMove(e, 0, 1);\n          break;\n      }\n    };\n\n    return moveProps;\n  }, [state, onMoveStart, onMove, onMoveEnd, addGlobalListener, removeGlobalListener]);\n  return {\n    moveProps: moveProps1\n  };\n}\n\nvar $d19e70b846cd84a0$exports = {};\n$parcel$export($d19e70b846cd84a0$exports, \"useScrollWheel\", function () {\n  return $d19e70b846cd84a0$export$2123ff2b87c81ca;\n});\n\nfunction $d19e70b846cd84a0$export$2123ff2b87c81ca(props, ref) {\n  var onScroll = props.onScroll,\n      isDisabled = props.isDisabled;\n  var onScrollHandler = $7R3Av$useCallback(function (e) {\n    if (e.ctrlKey) return;\n    e.preventDefault();\n    e.stopPropagation();\n    if (onScroll) onScroll({\n      deltaX: e.deltaX,\n      deltaY: e.deltaY\n    });\n  }, [onScroll]);\n  $7R3Av$useEvent(ref, 'wheel', isDisabled ? null : onScrollHandler);\n}\n\nvar $ea9746f03755d5ba$exports = {};\n$parcel$export($ea9746f03755d5ba$exports, \"useLongPress\", function () {\n  return $ea9746f03755d5ba$export$c24ed0104d07eab9;\n});\nvar $ea9746f03755d5ba$var$DEFAULT_THRESHOLD = 500;\n\nfunction $ea9746f03755d5ba$export$c24ed0104d07eab9(props) {\n  var isDisabled = props.isDisabled,\n      onLongPressStart = props.onLongPressStart,\n      onLongPressEnd = props.onLongPressEnd,\n      onLongPress = props.onLongPress,\n      _props$threshold = props.threshold,\n      threshold = _props$threshold === void 0 ? $ea9746f03755d5ba$var$DEFAULT_THRESHOLD : _props$threshold,\n      accessibilityDescription = props.accessibilityDescription;\n  var timeRef = $7R3Av$useRef(null);\n\n  var _$7R3Av$useGlobalList3 = $7R3Av$useGlobalListeners(),\n      addGlobalListener = _$7R3Av$useGlobalList3.addGlobalListener,\n      removeGlobalListener = _$7R3Av$useGlobalList3.removeGlobalListener;\n\n  var _$bb70d401e0bbab2b$ex2 = $bb70d401e0bbab2b$export$45712eceda6fad21({\n    isDisabled: isDisabled,\n    onPressStart: function onPressStart(e1) {\n      if (e1.pointerType === 'mouse' || e1.pointerType === 'touch') {\n        if (onLongPressStart) onLongPressStart(_objectSpread(_objectSpread({}, e1), {}, {\n          type: 'longpressstart'\n        }));\n        timeRef.current = setTimeout(function () {\n          e1.target.dispatchEvent(new PointerEvent('pointercancel', {\n            bubbles: true\n          }));\n          if (onLongPress) onLongPress(_objectSpread(_objectSpread({}, e1), {}, {\n            type: 'longpress'\n          }));\n          timeRef.current = null;\n        }, threshold);\n\n        if (e1.pointerType === 'touch') {\n          var onContextMenu = function onContextMenu(e) {\n            e.preventDefault();\n          };\n\n          addGlobalListener(e1.target, 'contextmenu', onContextMenu, {\n            once: true\n          });\n          addGlobalListener(window, 'pointerup', function () {\n            setTimeout(function () {\n              removeGlobalListener(e1.target, 'contextmenu', onContextMenu);\n            }, 30);\n          }, {\n            once: true\n          });\n        }\n      }\n    },\n    onPressEnd: function onPressEnd(e) {\n      if (timeRef.current) clearTimeout(timeRef.current);\n      if (onLongPressEnd && (e.pointerType === 'mouse' || e.pointerType === 'touch')) onLongPressEnd(_objectSpread(_objectSpread({}, e), {}, {\n        type: 'longpressend'\n      }));\n    }\n  }),\n      pressProps = _$bb70d401e0bbab2b$ex2.pressProps;\n\n  var descriptionProps = $7R3Av$useDescription(onLongPress && !isDisabled ? accessibilityDescription : null);\n  return {\n    longPressProps: $7R3Av$mergeProps(pressProps, descriptionProps)\n  };\n}\n\nexport { $acf5f8872229f2cb$export$27c701ed9e449e99 as Pressable, $36b2a54c41893e87$export$3351871ee4b288b8 as PressResponder, $96cd623b8d5dd15d$export$f8168d8dd8fd66e6 as useFocus, $d2dd66cff767efeb$export$b9b3dfddab17db27 as isFocusVisible, $d2dd66cff767efeb$export$630ff653c5ada6a9 as getInteractionModality, $d2dd66cff767efeb$export$8397ddfc504fdb9a as setInteractionModality, $d2dd66cff767efeb$export$98e20ec92f614cfe as useInteractionModality, $d2dd66cff767efeb$export$ffd9e5021c1fb2d6 as useFocusVisible, $d2dd66cff767efeb$export$ec71b4b83ac08ec3 as useFocusVisibleListener, $d2acb2e6011484f7$export$420e68273165f4ec as useFocusWithin, $52a70f66afabebbb$export$ae780daf29e6d456 as useHover, $ba9bc027ba236f10$export$872b660ac5a1ff98 as useInteractOutside, $a866ba1020241f41$export$8f71654801c2f7cd as useKeyboard, $75f78fec52a57cf7$export$36da96379f79f245 as useMove, $bb70d401e0bbab2b$export$45712eceda6fad21 as usePress, $d19e70b846cd84a0$export$2123ff2b87c81ca as useScrollWheel, $ea9746f03755d5ba$export$c24ed0104d07eab9 as useLongPress };","map":{"version":3,"sources":["packages/@react-aria/interactions/src/Pressable.tsx","packages/@react-aria/interactions/src/usePress.ts","packages/@react-aria/interactions/src/textSelection.ts","packages/@react-aria/interactions/src/utils.ts","packages/@react-aria/interactions/src/context.ts","packages/@react-aria/interactions/src/PressResponder.tsx","packages/@react-aria/interactions/src/useFocus.ts","packages/@react-aria/interactions/src/useFocusVisible.ts","packages/@react-aria/interactions/src/useFocusWithin.ts","packages/@react-aria/interactions/src/useHover.ts","packages/@react-aria/interactions/src/useInteractOutside.ts","packages/@react-aria/interactions/src/useKeyboard.ts","packages/@react-aria/interactions/src/createEventHandler.ts","packages/@react-aria/interactions/src/useMove.ts","packages/@react-aria/interactions/src/useScrollWheel.ts","packages/@react-aria/interactions/src/useLongPress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AE+BA,IAAI,2BAAK,GAAU,SAAnB;AACA,IAAI,qCAAe,GAAG,EAAtB;AACA,IAAI,wCAAkB,GAAG,IAAI,OAAJ,EAAzB;;SAEgB,yC,CAAqB,M,EAAsB;AACzD,MAAI,YAAK,EAAT,EAAa;AACX,QAAI,2BAAK,KAAK,SAAd,EAAyB;AACvB,MAAA,qCAAe,GAAG,QAAQ,CAAC,eAAT,CAAyB,KAAzB,CAA+B,gBAAjD;AACA,MAAA,QAAQ,CAAC,eAAT,CAAyB,KAAzB,CAA+B,gBAA/B,GAAkD,MAAlD;AACD;;AAED,IAAA,2BAAK,GAAG,UAAR;AACD,GAPD,MAOO,IAAI,MAAJ,EAAY;AAGjB,IAAA,wCAAkB,CAAC,GAAnB,CAAuB,MAAvB,EAA+B,MAAM,CAAC,KAAP,CAAa,UAA5C;AACA,IAAA,MAAM,CAAC,KAAP,CAAa,UAAb,GAA0B,MAA1B;AACD;AACF;;SAEe,yC,CAAqB,M,EAAsB;AACzD,MAAI,Y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AAF,KAAkB,OAApD,CAAlB,EACE,cAAc,iCACT,CADS;AAEZ,QAAA,IAAI,EAAE;AAFM,SAAd;AAKH;AAnDyB,GAAD,CAA3B;AAAA,MAAK,UAAL,0BAAK,UAAL;;AAsDA,MAAI,gBAAgB,GAAG,qBAAc,CAAC,WAAW,IAAA,CAAK,UAAhB,GAA6B,wBAA7B,GAAwD,IAAzD,CAArC;AAEA,SAAO;AACL,IAAA,cAAc,EAAE,iBAAU,CAAC,UAAD,EAAa,gBAAb;AADrB,GAAP;AAGD","sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {mergeProps} from '@react-aria/utils';\nimport {PressProps, usePress} from './usePress';\nimport React, {HTMLAttributes, ReactElement, RefObject, useRef} from 'react';\n\ninterface PressableProps extends PressProps {\n  children: ReactElement<HTMLAttributes<HTMLElement>, string>\n}\n\nexport const Pressable = React.forwardRef(({children, ...props}: PressableProps, ref: RefObject<HTMLElement>) => {\n  let newRef = useRef();\n  ref = ref ?? newRef;\n  let {pressProps} = usePress({...props, ref});\n  let child = React.Children.only(children);\n  return React.cloneElement(\n    child,\n    // @ts-ignore\n    {ref, ...mergeProps(child.props, pressProps)}\n  );\n});\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {disableTextSelection, restoreTextSelection} from './textSelection';\nimport {focusWithoutScrolling, mergeProps, useGlobalListeners, useSyncRef} from '@react-aria/utils';\nimport {HTMLAttributes, RefObject, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {isVirtualClick} from './utils';\nimport {PointerType, PressEvents} from '@react-types/shared';\nimport {PressResponderContext} from './context';\n\nexport interface PressProps extends PressEvents {\n  /** Whether the target is in a controlled press state (e.g. an overlay it triggers is open). */\n  isPressed?: boolean,\n  /** Whether the press events should be disabled. */\n  isDisabled?: boolean,\n  /** Whether the target should not receive focus on press. */\n  preventFocusOnPress?: boolean,\n  /**\n   * Whether press events should be canceled when the pointer leaves the target while pressed.\n   * By default, this is `false`, which means if the pointer returns back over the target while\n   * still pressed, onPressStart will be fired again. If set to `true`, the press is canceled\n   * when the pointer leaves the target and onPressStart will not be fired if the pointer returns.\n   */\n  shouldCancelOnPointerExit?: boolean,\n  /** Whether text selection should be enabled on the pressable element. */\n  allowTextSelectionOnPress?: boolean\n}\n\nexport interface PressHookProps extends PressProps {\n  /** A ref to the target element. */\n  ref?: RefObject<HTMLElement>\n}\n\ninterface PressState {\n  isPressed: boolean,\n  ignoreEmulatedMouseEvents: boolean,\n  ignoreClickAfterPress: boolean,\n  didFirePressStart: boolean,\n  activePointerId: any,\n  target: HTMLElement | null,\n  isOverTarget: boolean,\n  pointerType: PointerType,\n  userSelect?: string\n}\n\ninterface EventBase {\n  currentTarget: EventTarget,\n  shiftKey: boolean,\n  ctrlKey: boolean,\n  metaKey: boolean,\n  altKey: boolean\n}\n\nexport interface PressResult {\n  /** Whether the target is currently pressed. */\n  isPressed: boolean,\n  /** Props to spread on the target element. */\n  pressProps: HTMLAttributes<HTMLElement>\n}\n\nfunction usePressResponderContext(props: PressHookProps): PressHookProps {\n  // Consume context from <PressResponder> and merge with props.\n  let context = useContext(PressResponderContext);\n  if (context) {\n    let {register, ...contextProps} = context;\n    props = mergeProps(contextProps, props) as PressHookProps;\n    register();\n  }\n  useSyncRef(context, props.ref);\n\n  return props;\n}\n\n/**\n * Handles press interactions across mouse, touch, keyboard, and screen readers.\n * It normalizes behavior across browsers and platforms, and handles many nuances\n * of dealing with pointer and keyboard events.\n */\nexport function usePress(props: PressHookProps): PressResult {\n  let {\n    onPress,\n    onPressChange,\n    onPressStart,\n    onPressEnd,\n    onPressUp,\n    isDisabled,\n    isPressed: isPressedProp,\n    preventFocusOnPress,\n    shouldCancelOnPointerExit,\n    allowTextSelectionOnPress,\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    ref: _, // Removing `ref` from `domProps` because TypeScript is dumb\n    ...domProps\n  } = usePressResponderContext(props);\n  let propsRef = useRef<PressHookProps>(null);\n  propsRef.current = {onPress, onPressChange, onPressStart, onPressEnd, onPressUp, isDisabled, shouldCancelOnPointerExit};\n\n  let [isPressed, setPressed] = useState(false);\n  let ref = useRef<PressState>({\n    isPressed: false,\n    ignoreEmulatedMouseEvents: false,\n    ignoreClickAfterPress: false,\n    didFirePressStart: false,\n    activePointerId: null,\n    target: null,\n    isOverTarget: false,\n    pointerType: null\n  });\n\n  let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n\n  let pressProps = useMemo(() => {\n    let state = ref.current;\n    let triggerPressStart = (originalEvent: EventBase, pointerType: PointerType) => {\n      let {onPressStart, onPressChange, isDisabled} = propsRef.current;\n      if (isDisabled || state.didFirePressStart) {\n        return;\n      }\n\n      if (onPressStart) {\n        onPressStart({\n          type: 'pressstart',\n          pointerType,\n          target: originalEvent.currentTarget as HTMLElement,\n          shiftKey: originalEvent.shiftKey,\n          metaKey: originalEvent.metaKey,\n          ctrlKey: originalEvent.ctrlKey,\n          altKey: originalEvent.altKey\n        });\n      }\n\n      if (onPressChange) {\n        onPressChange(true);\n      }\n\n      state.didFirePressStart = true;\n      setPressed(true);\n    };\n\n    let triggerPressEnd = (originalEvent: EventBase, pointerType: PointerType, wasPressed = true) => {\n      let {onPressEnd, onPressChange, onPress, isDisabled} = propsRef.current;\n      if (!state.didFirePressStart) {\n        return;\n      }\n\n      state.ignoreClickAfterPress = true;\n      state.didFirePressStart = false;\n\n      if (onPressEnd) {\n        onPressEnd({\n          type: 'pressend',\n          pointerType,\n          target: originalEvent.currentTarget as HTMLElement,\n          shiftKey: originalEvent.shiftKey,\n          metaKey: originalEvent.metaKey,\n          ctrlKey: originalEvent.ctrlKey,\n          altKey: originalEvent.altKey\n        });\n      }\n\n      if (onPressChange) {\n        onPressChange(false);\n      }\n\n      setPressed(false);\n\n      if (onPress && wasPressed && !isDisabled) {\n        onPress({\n          type: 'press',\n          pointerType,\n          target: originalEvent.currentTarget as HTMLElement,\n          shiftKey: originalEvent.shiftKey,\n          metaKey: originalEvent.metaKey,\n          ctrlKey: originalEvent.ctrlKey,\n          altKey: originalEvent.altKey\n        });\n      }\n    };\n\n    let triggerPressUp = (originalEvent: EventBase, pointerType: PointerType) => {\n      let {onPressUp, isDisabled} = propsRef.current;\n      if (isDisabled) {\n        return;\n      }\n\n      if (onPressUp) {\n        onPressUp({\n          type: 'pressup',\n          pointerType,\n          target: originalEvent.currentTarget as HTMLElement,\n          shiftKey: originalEvent.shiftKey,\n          metaKey: originalEvent.metaKey,\n          ctrlKey: originalEvent.ctrlKey,\n          altKey: originalEvent.altKey\n        });\n      }\n    };\n\n    let cancel = (e: EventBase) => {\n      if (state.isPressed) {\n        if (state.isOverTarget) {\n          triggerPressEnd(createEvent(state.target, e), state.pointerType, false);\n        }\n        state.isPressed = false;\n        state.isOverTarget = false;\n        state.activePointerId = null;\n        state.pointerType = null;\n        removeAllGlobalListeners();\n        if (!allowTextSelectionOnPress) {\n          restoreTextSelection(state.target);\n        }\n      }\n    };\n\n    let pressProps: HTMLAttributes<HTMLElement> = {\n      onKeyDown(e) {\n        if (isValidKeyboardEvent(e.nativeEvent) && e.currentTarget.contains(e.target as HTMLElement)) {\n          if (shouldPreventDefaultKeyboard(e.target as Element)) {\n            e.preventDefault();\n          }\n          e.stopPropagation();\n\n          // If the event is repeating, it may have started on a different element\n          // after which focus moved to the current element. Ignore these events and\n          // only handle the first key down event.\n          if (!state.isPressed && !e.repeat) {\n            state.target = e.currentTarget as HTMLElement;\n            state.isPressed = true;\n            triggerPressStart(e, 'keyboard');\n\n            // Focus may move before the key up event, so register the event on the document\n            // instead of the same element where the key down event occurred.\n            addGlobalListener(document, 'keyup', onKeyUp, false);\n          }\n        }\n      },\n      onKeyUp(e) {\n        if (isValidKeyboardEvent(e.nativeEvent) && !e.repeat && e.currentTarget.contains(e.target as HTMLElement)) {\n          triggerPressUp(createEvent(state.target, e), 'keyboard');\n        }\n      },\n      onClick(e) {\n        if (e && !e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        if (e && e.button === 0) {\n          e.stopPropagation();\n          if (isDisabled) {\n            e.preventDefault();\n          }\n\n          // If triggered from a screen reader or by using element.click(),\n          // trigger as if it were a keyboard click.\n          if (!state.ignoreClickAfterPress && !state.ignoreEmulatedMouseEvents && (state.pointerType === 'virtual' || isVirtualClick(e.nativeEvent))) {\n            // Ensure the element receives focus (VoiceOver on iOS does not do this)\n            if (!isDisabled && !preventFocusOnPress) {\n              focusWithoutScrolling(e.currentTarget);\n            }\n\n            triggerPressStart(e, 'virtual');\n            triggerPressUp(e, 'virtual');\n            triggerPressEnd(e, 'virtual');\n          }\n\n          state.ignoreEmulatedMouseEvents = false;\n          state.ignoreClickAfterPress = false;\n        }\n      }\n    };\n\n    let onKeyUp = (e: KeyboardEvent) => {\n      if (state.isPressed && isValidKeyboardEvent(e)) {\n        if (shouldPreventDefaultKeyboard(e.target as Element)) {\n          e.preventDefault();\n        }\n        e.stopPropagation();\n\n        state.isPressed = false;\n        let target = e.target as HTMLElement;\n        triggerPressEnd(createEvent(state.target, e), 'keyboard', state.target.contains(target));\n        removeAllGlobalListeners();\n\n        // If the target is a link, trigger the click method to open the URL,\n        // but defer triggering pressEnd until onClick event handler.\n        if (state.target.contains(target) && isHTMLAnchorLink(state.target) || state.target.getAttribute('role') === 'link') {\n          state.target.click();\n        }\n      }\n    };\n\n    if (typeof PointerEvent !== 'undefined') {\n      pressProps.onPointerDown = (e) => {\n        // Only handle left clicks, and ignore events that bubbled through portals.\n        if (e.button !== 0 || !e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        // iOS safari fires pointer events from VoiceOver with incorrect coordinates/target.\n        // Ignore and let the onClick handler take care of it instead.\n        // https://bugs.webkit.org/show_bug.cgi?id=222627\n        // https://bugs.webkit.org/show_bug.cgi?id=223202\n        if (isVirtualPointerEvent(e.nativeEvent)) {\n          state.pointerType = 'virtual';\n          return;\n        }\n\n        // Due to browser inconsistencies, especially on mobile browsers, we prevent\n        // default on pointer down and handle focusing the pressable element ourselves.\n        if (shouldPreventDefault(e.target as Element)) {\n          e.preventDefault();\n        }\n\n        state.pointerType = e.pointerType;\n\n        e.stopPropagation();\n        if (!state.isPressed) {\n          state.isPressed = true;\n          state.isOverTarget = true;\n          state.activePointerId = e.pointerId;\n          state.target = e.currentTarget;\n\n          if (!isDisabled && !preventFocusOnPress) {\n            focusWithoutScrolling(e.currentTarget);\n          }\n\n          if (!allowTextSelectionOnPress) {\n            disableTextSelection(state.target);\n          }\n\n          triggerPressStart(e, state.pointerType);\n\n          addGlobalListener(document, 'pointermove', onPointerMove, false);\n          addGlobalListener(document, 'pointerup', onPointerUp, false);\n          addGlobalListener(document, 'pointercancel', onPointerCancel, false);\n        }\n      };\n\n      pressProps.onMouseDown = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        if (e.button === 0) {\n          // Chrome and Firefox on touch Windows devices require mouse down events\n          // to be canceled in addition to pointer events, or an extra asynchronous\n          // focus event will be fired.\n          if (shouldPreventDefault(e.target as Element)) {\n            e.preventDefault();\n          }\n\n          e.stopPropagation();\n        }\n      };\n\n      pressProps.onPointerUp = (e) => {\n        // iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.\n        if (!e.currentTarget.contains(e.target as HTMLElement) || state.pointerType === 'virtual') {\n          return;\n        }\n\n        // Only handle left clicks\n        // Safari on iOS sometimes fires pointerup events, even\n        // when the touch isn't over the target, so double check.\n        if (e.button === 0 && isOverTarget(e, e.currentTarget)) {\n          triggerPressUp(e, state.pointerType || e.pointerType);\n        }\n      };\n\n      // Safari on iOS < 13.2 does not implement pointerenter/pointerleave events correctly.\n      // Use pointer move events instead to implement our own hit testing.\n      // See https://bugs.webkit.org/show_bug.cgi?id=199803\n      let onPointerMove = (e: PointerEvent) => {\n        if (e.pointerId !== state.activePointerId) {\n          return;\n        }\n\n        if (isOverTarget(e, state.target)) {\n          if (!state.isOverTarget) {\n            state.isOverTarget = true;\n            triggerPressStart(createEvent(state.target, e), state.pointerType);\n          }\n        } else if (state.isOverTarget) {\n          state.isOverTarget = false;\n          triggerPressEnd(createEvent(state.target, e), state.pointerType, false);\n          if (propsRef.current.shouldCancelOnPointerExit) {\n            cancel(e);\n          }\n        }\n      };\n\n      let onPointerUp = (e: PointerEvent) => {\n        if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0) {\n          if (isOverTarget(e, state.target)) {\n            triggerPressEnd(createEvent(state.target, e), state.pointerType);\n          } else if (state.isOverTarget) {\n            triggerPressEnd(createEvent(state.target, e), state.pointerType, false);\n          }\n\n          state.isPressed = false;\n          state.isOverTarget = false;\n          state.activePointerId = null;\n          state.pointerType = null;\n          removeAllGlobalListeners();\n          if (!allowTextSelectionOnPress) {\n            restoreTextSelection(state.target);\n          }\n        }\n      };\n\n      let onPointerCancel = (e: PointerEvent) => {\n        cancel(e);\n      };\n\n      pressProps.onDragStart = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        // Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.\n        cancel(e);\n      };\n    } else {\n      pressProps.onMouseDown = (e) => {\n        // Only handle left clicks\n        if (e.button !== 0 || !e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        // Due to browser inconsistencies, especially on mobile browsers, we prevent\n        // default on mouse down and handle focusing the pressable element ourselves.\n        if (shouldPreventDefault(e.target as Element)) {\n          e.preventDefault();\n        }\n\n        e.stopPropagation();\n        if (state.ignoreEmulatedMouseEvents) {\n          return;\n        }\n\n        state.isPressed = true;\n        state.isOverTarget = true;\n        state.target = e.currentTarget;\n        state.pointerType = isVirtualClick(e.nativeEvent) ? 'virtual' : 'mouse';\n\n        if (!isDisabled && !preventFocusOnPress) {\n          focusWithoutScrolling(e.currentTarget);\n        }\n\n        triggerPressStart(e, state.pointerType);\n\n        addGlobalListener(document, 'mouseup', onMouseUp, false);\n      };\n\n      pressProps.onMouseEnter = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        e.stopPropagation();\n        if (state.isPressed && !state.ignoreEmulatedMouseEvents) {\n          state.isOverTarget = true;\n          triggerPressStart(e, state.pointerType);\n        }\n      };\n\n      pressProps.onMouseLeave = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        e.stopPropagation();\n        if (state.isPressed && !state.ignoreEmulatedMouseEvents) {\n          state.isOverTarget = false;\n          triggerPressEnd(e, state.pointerType, false);\n          if (propsRef.current.shouldCancelOnPointerExit) {\n            cancel(e);\n          }\n        }\n      };\n\n      pressProps.onMouseUp = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        if (!state.ignoreEmulatedMouseEvents && e.button === 0) {\n          triggerPressUp(e, state.pointerType);\n        }\n      };\n\n      let onMouseUp = (e: MouseEvent) => {\n        // Only handle left clicks\n        if (e.button !== 0) {\n          return;\n        }\n\n        state.isPressed = false;\n        removeAllGlobalListeners();\n\n        if (state.ignoreEmulatedMouseEvents) {\n          state.ignoreEmulatedMouseEvents = false;\n          return;\n        }\n\n        if (isOverTarget(e, state.target)) {\n          triggerPressEnd(createEvent(state.target, e), state.pointerType);\n        } else if (state.isOverTarget) {\n          triggerPressEnd(createEvent(state.target, e), state.pointerType, false);\n        }\n\n        state.isOverTarget = false;\n      };\n\n      pressProps.onTouchStart = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        e.stopPropagation();\n        let touch = getTouchFromEvent(e.nativeEvent);\n        if (!touch) {\n          return;\n        }\n        state.activePointerId = touch.identifier;\n        state.ignoreEmulatedMouseEvents = true;\n        state.isOverTarget = true;\n        state.isPressed = true;\n        state.target = e.currentTarget;\n        state.pointerType = 'touch';\n\n        // Due to browser inconsistencies, especially on mobile browsers, we prevent default\n        // on the emulated mouse event and handle focusing the pressable element ourselves.\n        if (!isDisabled && !preventFocusOnPress) {\n          focusWithoutScrolling(e.currentTarget);\n        }\n\n        if (!allowTextSelectionOnPress) {\n          disableTextSelection(state.target);\n        }\n\n        triggerPressStart(e, state.pointerType);\n\n        addGlobalListener(window, 'scroll', onScroll, true);\n      };\n\n      pressProps.onTouchMove = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        e.stopPropagation();\n        if (!state.isPressed) {\n          return;\n        }\n\n        let touch = getTouchById(e.nativeEvent, state.activePointerId);\n        if (touch && isOverTarget(touch, e.currentTarget)) {\n          if (!state.isOverTarget) {\n            state.isOverTarget = true;\n            triggerPressStart(e, state.pointerType);\n          }\n        } else if (state.isOverTarget) {\n          state.isOverTarget = false;\n          triggerPressEnd(e, state.pointerType, false);\n          if (propsRef.current.shouldCancelOnPointerExit) {\n            cancel(e);\n          }\n        }\n      };\n\n      pressProps.onTouchEnd = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        e.stopPropagation();\n        if (!state.isPressed) {\n          return;\n        }\n\n        let touch = getTouchById(e.nativeEvent, state.activePointerId);\n        if (touch && isOverTarget(touch, e.currentTarget)) {\n          triggerPressUp(e, state.pointerType);\n          triggerPressEnd(e, state.pointerType);\n        } else if (state.isOverTarget) {\n          triggerPressEnd(e, state.pointerType, false);\n        }\n\n        state.isPressed = false;\n        state.activePointerId = null;\n        state.isOverTarget = false;\n        state.ignoreEmulatedMouseEvents = true;\n        if (!allowTextSelectionOnPress) {\n          restoreTextSelection(state.target);\n        }\n        removeAllGlobalListeners();\n      };\n\n      pressProps.onTouchCancel = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        e.stopPropagation();\n        if (state.isPressed) {\n          cancel(e);\n        }\n      };\n\n      let onScroll = (e: Event) => {\n        if (state.isPressed && (e.target as HTMLElement).contains(state.target)) {\n          cancel({\n            currentTarget: state.target,\n            shiftKey: false,\n            ctrlKey: false,\n            metaKey: false,\n            altKey: false\n          });\n        }\n      };\n\n      pressProps.onDragStart = (e) => {\n        if (!e.currentTarget.contains(e.target as HTMLElement)) {\n          return;\n        }\n\n        cancel(e);\n      };\n    }\n\n    return pressProps;\n  }, [addGlobalListener, isDisabled, preventFocusOnPress, removeAllGlobalListeners, allowTextSelectionOnPress]);\n\n  // Remove user-select: none in case component unmounts immediately after pressStart\n  // eslint-disable-next-line arrow-body-style\n  useEffect(() => {\n    return () => {\n      if (!allowTextSelectionOnPress) {\n        restoreTextSelection(ref.current.target);\n      }\n    };\n  }, [allowTextSelectionOnPress]);\n\n  return {\n    isPressed: isPressedProp || isPressed,\n    pressProps: mergeProps(domProps, pressProps)\n  };\n}\n\nfunction isHTMLAnchorLink(target: HTMLElement): boolean {\n  return target.tagName === 'A' && target.hasAttribute('href');\n}\n\nfunction isValidKeyboardEvent(event: KeyboardEvent): boolean {\n  const {key, code, target} = event;\n  const element = target as HTMLElement;\n  const {tagName, isContentEditable} = element;\n  const role = element.getAttribute('role');\n  // Accessibility for keyboards. Space and Enter only.\n  // \"Spacebar\" is for IE 11\n  return (\n    (key === 'Enter' || key === ' ' || key === 'Spacebar' || code === 'Space') &&\n    (tagName !== 'INPUT' &&\n      tagName !== 'TEXTAREA' &&\n      isContentEditable !== true) &&\n    // A link with a valid href should be handled natively,\n    // unless it also has role='button' and was triggered using Space.\n    (!isHTMLAnchorLink(element) || (role === 'button' && key !== 'Enter')) &&\n    // An element with role='link' should only trigger with Enter key\n    !(role === 'link' && key !== 'Enter')\n  );\n}\n\nfunction getTouchFromEvent(event: TouchEvent): Touch | null {\n  const {targetTouches} = event;\n  if (targetTouches.length > 0) {\n    return targetTouches[0];\n  }\n  return null;\n}\n\nfunction getTouchById(\n  event: TouchEvent,\n  pointerId: null | number\n): null | Touch {\n  const changedTouches = event.changedTouches;\n  for (let i = 0; i < changedTouches.length; i++) {\n    const touch = changedTouches[i];\n    if (touch.identifier === pointerId) {\n      return touch;\n    }\n  }\n  return null;\n}\n\nfunction createEvent(target: HTMLElement, e: EventBase): EventBase {\n  return {\n    currentTarget: target,\n    shiftKey: e.shiftKey,\n    ctrlKey: e.ctrlKey,\n    metaKey: e.metaKey,\n    altKey: e.altKey\n  };\n}\n\ninterface Rect {\n  top: number,\n  right: number,\n  bottom: number,\n  left: number\n}\n\ninterface EventPoint {\n  clientX: number,\n  clientY: number,\n  width?: number,\n  height?: number,\n  radiusX?: number,\n  radiusY?: number\n}\n\nfunction getPointClientRect(point: EventPoint): Rect {\n  let offsetX = (point.width / 2) || point.radiusX || 0;\n  let offsetY = (point.height / 2) || point.radiusY || 0;\n\n  return {\n    top: point.clientY - offsetY,\n    right: point.clientX + offsetX,\n    bottom: point.clientY + offsetY,\n    left: point.clientX - offsetX\n  };\n}\n\nfunction areRectanglesOverlapping(a: Rect, b: Rect) {\n  // check if they cannot overlap on x axis\n  if (a.left > b.right || b.left > a.right) {\n    return false;\n  }\n  // check if they cannot overlap on y axis\n  if (a.top > b.bottom || b.top > a.bottom) {\n    return false;\n  }\n  return true;\n}\n\nfunction isOverTarget(point: EventPoint, target: HTMLElement) {\n  let rect = target.getBoundingClientRect();\n  let pointRect = getPointClientRect(point);\n  return areRectanglesOverlapping(rect, pointRect);\n}\n\nfunction shouldPreventDefault(target: Element) {\n  // We cannot prevent default if the target is inside a draggable element.\n  return !target.closest('[draggable=\"true\"]');\n}\n\nfunction shouldPreventDefaultKeyboard(target: Element) {\n  return !((target.tagName === 'INPUT' || target.tagName === 'BUTTON') && (target as HTMLButtonElement | HTMLInputElement).type === 'submit');\n}\n\nfunction isVirtualPointerEvent(event: PointerEvent) {\n  // If the pointer size is zero, then we assume it's from a screen reader.\n  // Android TalkBack double tap will sometimes return a event with width and height of 1\n  // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.\n  // Cannot use \"event.pressure === 0\" as the sole check due to Safari pointer events always returning pressure === 0\n  // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216\n  return (\n    (event.width === 0 && event.height === 0) ||\n    (event.width === 1 &&\n      event.height === 1 &&\n      event.pressure === 0 &&\n      event.detail === 0\n    )\n  );\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isIOS, runAfterTransition} from '@react-aria/utils';\n\n// Safari on iOS starts selecting text on long press. The only way to avoid this, it seems,\n// is to add user-select: none to the entire page. Adding it to the pressable element prevents\n// that element from being selected, but nearby elements may still receive selection. We add\n// user-select: none on touch start, and remove it again on touch end to prevent this.\n// This must be implemented using global state to avoid race conditions between multiple elements.\n\n// There are three possible states due to the delay before removing user-select: none after\n// pointer up. The 'default' state always transitions to the 'disabled' state, which transitions\n// to 'restoring'. The 'restoring' state can either transition back to 'disabled' or 'default'.\n\n// For non-iOS devices, we apply user-select: none to the pressed element instead to avoid possible\n// performance issues that arise from applying and removing user-select: none to the entire page\n// (see https://github.com/adobe/react-spectrum/issues/1609).\ntype State = 'default' | 'disabled' | 'restoring';\n\n// Note that state only matters here for iOS. Non-iOS gets user-select: none applied to the target element\n// rather than at the document level so we just need to apply/remove user-select: none for each pressed element individually\nlet state: State = 'default';\nlet savedUserSelect = '';\nlet modifiedElementMap = new WeakMap<HTMLElement, string>();\n\nexport function disableTextSelection(target?: HTMLElement) {\n  if (isIOS()) {\n    if (state === 'default') {\n      savedUserSelect = document.documentElement.style.webkitUserSelect;\n      document.documentElement.style.webkitUserSelect = 'none';\n    }\n\n    state = 'disabled';\n  } else if (target) {\n    // If not iOS, store the target's original user-select and change to user-select: none\n    // Ignore state since it doesn't apply for non iOS\n    modifiedElementMap.set(target, target.style.userSelect);\n    target.style.userSelect = 'none';\n  }\n}\n\nexport function restoreTextSelection(target?: HTMLElement) {\n  if (isIOS()) {\n    // If the state is already default, there's nothing to do.\n    // If it is restoring, then there's no need to queue a second restore.\n    if (state !== 'disabled') {\n      return;\n    }\n\n    state = 'restoring';\n\n    // There appears to be a delay on iOS where selection still might occur\n    // after pointer up, so wait a bit before removing user-select.\n    setTimeout(() => {\n      // Wait for any CSS transitions to complete so we don't recompute style\n      // for the whole page in the middle of the animation and cause jank.\n      runAfterTransition(() => {\n        // Avoid race conditions\n        if (state === 'restoring') {\n          if (document.documentElement.style.webkitUserSelect === 'none') {\n            document.documentElement.style.webkitUserSelect = savedUserSelect || '';\n          }\n\n          savedUserSelect = '';\n          state = 'default';\n        }\n      });\n    }, 300);\n  } else {\n    // If not iOS, restore the target's original user-select if any\n    // Ignore state since it doesn't apply for non iOS\n    if (target && modifiedElementMap.has(target)) {\n      let targetOldUserSelect = modifiedElementMap.get(target);\n\n      if (target.style.userSelect === 'none') {\n        target.style.userSelect = targetOldUserSelect;\n      }\n\n      if (target.getAttribute('style') === '') {\n        target.removeAttribute('style');\n      }\n      modifiedElementMap.delete(target);\n    }\n  }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Original licensing for the following method can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/blob/3c713d513195a53788b3f8bb4b70279d68b15bcc/packages/react-interactions/events/src/dom/shared/index.js#L74-L87\n\n// Keyboards, Assistive Technologies, and element.click() all produce a \"virtual\"\n// click event. This is a method of inferring such clicks. Every browser except\n// IE 11 only sets a zero value of \"detail\" for click events that are \"virtual\".\n// However, IE 11 uses a zero value for all click events. For IE 11 we rely on\n// the quirk that it produces click events that are of type PointerEvent, and\n// where only the \"virtual\" click lacks a pointerType field.\n\nexport function isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n  // JAWS/NVDA with Firefox.\n  if ((event as any).mozInputSource === 0 && event.isTrusted) {\n    return true;\n  }\n\n  return event.detail === 0 && !(event as PointerEvent).pointerType;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PressProps} from './usePress';\nimport React, {MutableRefObject} from 'react';\n\ninterface IPressResponderContext extends PressProps {\n  register(): void,\n  ref?: MutableRefObject<HTMLElement>\n}\n\nexport const PressResponderContext = React.createContext<IPressResponderContext>(null);\nPressResponderContext.displayName = 'PressResponderContext';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {mergeProps, useSyncRef} from '@react-aria/utils';\nimport {PressProps} from './usePress';\nimport {PressResponderContext} from './context';\nimport React, {ReactNode, RefObject, useContext, useEffect, useRef} from 'react';\n\ninterface PressResponderProps extends PressProps {\n  children: ReactNode\n}\n\nexport const PressResponder = React.forwardRef(({children, ...props}: PressResponderProps, ref: RefObject<HTMLElement>) => {\n  let isRegistered = useRef(false);\n  let prevContext = useContext(PressResponderContext);\n  let context = mergeProps(prevContext || {}, {\n    ...props,\n    ref: ref || prevContext?.ref,\n    register() {\n      isRegistered.current = true;\n      if (prevContext) {\n        prevContext.register();\n      }\n    }\n  });\n\n  useSyncRef(prevContext, ref);\n\n  useEffect(() => {\n    if (!isRegistered.current) {\n      console.warn(\n        'A PressResponder was rendered without a pressable child. ' +\n        'Either call the usePress hook, or wrap your DOM node with <Pressable> component.'\n      );\n    }\n  }, []);\n\n  return (\n    <PressResponderContext.Provider value={context}>\n      {children}\n    </PressResponderContext.Provider>\n  );\n});\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {FocusEvent, HTMLAttributes} from 'react';\nimport {FocusEvents} from '@react-types/shared';\n\ninterface FocusProps extends FocusEvents {\n  /** Whether the focus events should be disabled. */\n  isDisabled?: boolean\n}\n\ninterface FocusResult {\n  /** Props to spread onto the target element. */\n  focusProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Handles focus events for the immediate target.\n * Focus events on child elements will be ignored.\n */\nexport function useFocus(props: FocusProps): FocusResult {\n  if (props.isDisabled) {\n    return {focusProps: {}};\n  }\n\n  let onFocus, onBlur;\n  if (props.onFocus || props.onFocusChange) {\n    onFocus = (e: FocusEvent) => {\n      if (e.target === e.currentTarget) {\n        if (props.onFocus) {\n          props.onFocus(e);\n        }\n\n        if (props.onFocusChange) {\n          props.onFocusChange(true);\n        }\n      }\n    };\n  }\n\n  if (props.onBlur || props.onFocusChange) {\n    onBlur = (e: FocusEvent) => {\n      if (e.target === e.currentTarget) {\n        if (props.onBlur) {\n          props.onBlur(e);\n        }\n\n        if (props.onFocusChange) {\n          props.onFocusChange(false);\n        }\n      }\n    };\n  }\n\n  return {\n    focusProps: {\n      onFocus,\n      onBlur\n    }\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {isMac} from '@react-aria/utils';\nimport {isVirtualClick} from './utils';\nimport {useEffect, useState} from 'react';\n\ntype Modality = 'keyboard' | 'pointer' | 'virtual';\ntype HandlerEvent = PointerEvent | MouseEvent | KeyboardEvent | FocusEvent;\ntype Handler = (modality: Modality, e: HandlerEvent) => void;\ntype FocusVisibleHandler = (isFocusVisible: boolean) => void;\ninterface FocusVisibleProps {\n  /** Whether the element is a text input. */\n  isTextInput?: boolean,\n  /** Whether the element will be auto focused. */\n  autoFocus?: boolean\n}\n\ninterface FocusVisibleResult {\n  /** Whether keyboard focus is visible globally. */\n  isFocusVisible: boolean\n}\n\nlet currentModality = null;\nlet changeHandlers = new Set<Handler>();\nlet hasSetupGlobalListeners = false;\nlet hasEventBeforeFocus = false;\nlet hasBlurredWindowRecently = false;\n\n// Only Tab or Esc keys will make focus visible on text input elements\nconst FOCUS_VISIBLE_INPUT_KEYS = {\n  Tab: true,\n  Escape: true\n};\n\nfunction triggerChangeHandlers(modality: Modality, e: HandlerEvent) {\n  for (let handler of changeHandlers) {\n    handler(modality, e);\n  }\n}\n\n/**\n * Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus styles visible.\n */\nfunction isValidKey(e: KeyboardEvent) {\n  // Control and Shift keys trigger when navigating back to the tab with keyboard.\n  return !(e.metaKey || (!isMac() && e.altKey) || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta');\n}\n\n\nfunction handleKeyboardEvent(e: KeyboardEvent) {\n  hasEventBeforeFocus = true;\n  if (isValidKey(e)) {\n    currentModality = 'keyboard';\n    triggerChangeHandlers('keyboard', e);\n  }\n}\n\nfunction handlePointerEvent(e: PointerEvent | MouseEvent) {\n  currentModality = 'pointer';\n  if (e.type === 'mousedown' || e.type === 'pointerdown') {\n    hasEventBeforeFocus = true;\n    triggerChangeHandlers('pointer', e);\n  }\n}\n\nfunction handleClickEvent(e: MouseEvent) {\n  if (isVirtualClick(e)) {\n    hasEventBeforeFocus = true;\n    currentModality = 'virtual';\n  }\n}\n\nfunction handleFocusEvent(e: FocusEvent) {\n  // Firefox fires two extra focus events when the user first clicks into an iframe:\n  // first on the window, then on the document. We ignore these events so they don't\n  // cause keyboard focus rings to appear.\n  if (e.target === window || e.target === document) {\n    return;\n  }\n\n  // If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.\n  // This occurs, for example, when navigating a form with the next/previous buttons on iOS.\n  if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {\n    currentModality = 'virtual';\n    triggerChangeHandlers('virtual', e);\n  }\n\n  hasEventBeforeFocus = false;\n  hasBlurredWindowRecently = false;\n}\n\nfunction handleWindowBlur() {\n  // When the window is blurred, reset state. This is necessary when tabbing out of the window,\n  // for example, since a subsequent focus event won't be fired.\n  hasEventBeforeFocus = false;\n  hasBlurredWindowRecently = true;\n}\n\n/**\n * Setup global event listeners to control when keyboard focus style should be visible.\n */\nfunction setupGlobalFocusEvents() {\n  if (typeof window === 'undefined' || hasSetupGlobalListeners) {\n    return;\n  }\n\n  // Programmatic focus() calls shouldn't affect the current input modality.\n  // However, we need to detect other cases when a focus event occurs without\n  // a preceding user event (e.g. screen reader focus). Overriding the focus\n  // method on HTMLElement.prototype is a bit hacky, but works.\n  let focus = HTMLElement.prototype.focus;\n  HTMLElement.prototype.focus = function () {\n    hasEventBeforeFocus = true;\n    focus.apply(this, arguments);\n  };\n\n  document.addEventListener('keydown', handleKeyboardEvent, true);\n  document.addEventListener('keyup', handleKeyboardEvent, true);\n  document.addEventListener('click', handleClickEvent, true);\n\n  // Register focus events on the window so they are sure to happen\n  // before React's event listeners (registered on the document).\n  window.addEventListener('focus', handleFocusEvent, true);\n  window.addEventListener('blur', handleWindowBlur, false);\n\n  if (typeof PointerEvent !== 'undefined') {\n    document.addEventListener('pointerdown', handlePointerEvent, true);\n    document.addEventListener('pointermove', handlePointerEvent, true);\n    document.addEventListener('pointerup', handlePointerEvent, true);\n  } else {\n    document.addEventListener('mousedown', handlePointerEvent, true);\n    document.addEventListener('mousemove', handlePointerEvent, true);\n    document.addEventListener('mouseup', handlePointerEvent, true);\n  }\n\n  hasSetupGlobalListeners = true;\n}\n\nif (typeof document !== 'undefined') {\n  if (document.readyState !== 'loading') {\n    setupGlobalFocusEvents();\n  } else {\n    document.addEventListener('DOMContentLoaded', setupGlobalFocusEvents);\n  }\n}\n\n/**\n * If true, keyboard focus is visible.\n */\nexport function isFocusVisible(): boolean {\n  return currentModality !== 'pointer';\n}\n\nexport function getInteractionModality(): Modality {\n  return currentModality;\n}\n\nexport function setInteractionModality(modality: Modality) {\n  currentModality = modality;\n  triggerChangeHandlers(modality, null);\n}\n\n/**\n * Keeps state of the current modality.\n */\nexport function useInteractionModality(): Modality {\n  setupGlobalFocusEvents();\n\n  let [modality, setModality] = useState(currentModality);\n  useEffect(() => {\n    let handler = () => {\n      setModality(currentModality);\n    };\n\n    changeHandlers.add(handler);\n    return () => {\n      changeHandlers.delete(handler);\n    };\n  }, []);\n\n  return modality;\n}\n\n/**\n * If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that\n * focus visible style can be properly set.\n */\nfunction isKeyboardFocusEvent(isTextInput: boolean, modality: Modality, e: HandlerEvent) {\n  return !(isTextInput && modality === 'keyboard' && e instanceof KeyboardEvent && !FOCUS_VISIBLE_INPUT_KEYS[e.key]);\n}\n\n/**\n * Manages focus visible state for the page, and subscribes individual components for updates.\n */\nexport function useFocusVisible(props: FocusVisibleProps = {}): FocusVisibleResult {\n  let {isTextInput, autoFocus} = props;\n  let [isFocusVisibleState, setFocusVisible] = useState(autoFocus || isFocusVisible());\n  useFocusVisibleListener((isFocusVisible) => {\n    setFocusVisible(isFocusVisible);\n  }, [isTextInput], {isTextInput});\n\n  return {isFocusVisible: isFocusVisibleState};\n}\n\n/**\n * Listens for trigger change and reports if focus is visible (i.e., modality is not pointer).\n */\nexport function useFocusVisibleListener(fn: FocusVisibleHandler, deps: ReadonlyArray<any>, opts?: {isTextInput?: boolean}): void {\n  setupGlobalFocusEvents();\n\n  useEffect(() => {\n    let handler = (modality: Modality, e: HandlerEvent) => {\n      if (!isKeyboardFocusEvent(opts?.isTextInput, modality, e)) {\n        return;\n      }\n      fn(isFocusVisible());\n    };\n    changeHandlers.add(handler);\n    return () => {\n      changeHandlers.delete(handler);\n    };\n  }, deps);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {FocusEvent, HTMLAttributes, useRef} from 'react';\n\ninterface FocusWithinProps {\n  /** Whether the focus within events should be disabled. */\n  isDisabled?: boolean,\n  /** Handler that is called when the target element or a descendant receives focus. */\n  onFocusWithin?: (e: FocusEvent) => void,\n  /** Handler that is called when the target element and all descendants lose focus. */\n  onBlurWithin?: (e: FocusEvent) => void,\n  /** Handler that is called when the the focus within state changes. */\n  onFocusWithinChange?: (isFocusWithin: boolean) => void\n}\n\ninterface FocusWithinResult {\n  /** Props to spread onto the target element. */\n  focusWithinProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Handles focus events for the target and its descendants.\n */\nexport function useFocusWithin(props: FocusWithinProps): FocusWithinResult {\n  let state = useRef({\n    isFocusWithin: false\n  }).current;\n\n  if (props.isDisabled) {\n    return {focusWithinProps: {}};\n  }\n\n  let onFocus = (e: FocusEvent) => {\n    if (!state.isFocusWithin) {\n      if (props.onFocusWithin) {\n        props.onFocusWithin(e);\n      }\n\n      if (props.onFocusWithinChange) {\n        props.onFocusWithinChange(true);\n      }\n\n      state.isFocusWithin = true;\n    }\n  };\n\n  let onBlur = (e: FocusEvent) => {\n    // We don't want to trigger onBlurWithin and then immediately onFocusWithin again\n    // when moving focus inside the element. Only trigger if the currentTarget doesn't\n    // include the relatedTarget (where focus is moving).\n    if (state.isFocusWithin && !e.currentTarget.contains(e.relatedTarget as HTMLElement)) {\n      if (props.onBlurWithin) {\n        props.onBlurWithin(e);\n      }\n\n      if (props.onFocusWithinChange) {\n        props.onFocusWithinChange(false);\n      }\n\n      state.isFocusWithin = false;\n    }\n  };\n\n  return {\n    focusWithinProps: {\n      onFocus: onFocus,\n      onBlur: onBlur\n    }\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {HoverEvents} from '@react-types/shared';\nimport {HTMLAttributes, useEffect, useMemo, useRef, useState} from 'react';\n\nexport interface HoverProps extends HoverEvents {\n  /** Whether the hover events should be disabled. */\n  isDisabled?: boolean\n}\n\ninterface HoverResult {\n  /** Props to spread on the target element. */\n  hoverProps: HTMLAttributes<HTMLElement>,\n  isHovered: boolean\n}\n\n// iOS fires onPointerEnter twice: once with pointerType=\"touch\" and again with pointerType=\"mouse\".\n// We want to ignore these emulated events so they do not trigger hover behavior.\n// See https://bugs.webkit.org/show_bug.cgi?id=214609.\nlet globalIgnoreEmulatedMouseEvents = false;\nlet hoverCount = 0;\n\nfunction setGlobalIgnoreEmulatedMouseEvents() {\n  globalIgnoreEmulatedMouseEvents = true;\n\n  // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n  // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n  // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n  // the distant future because a user previously touched the element.\n  setTimeout(() => {\n    globalIgnoreEmulatedMouseEvents = false;\n  }, 50);\n}\n\nfunction handleGlobalPointerEvent(e) {\n  if (e.pointerType === 'touch') {\n    setGlobalIgnoreEmulatedMouseEvents();\n  }\n}\n\nfunction setupGlobalTouchEvents() {\n  if (typeof document === 'undefined') {\n    return;\n  }\n\n  if (typeof PointerEvent !== 'undefined') {\n    document.addEventListener('pointerup', handleGlobalPointerEvent);\n  } else {\n    document.addEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n  }\n\n  hoverCount++;\n  return () => {\n    hoverCount--;\n    if (hoverCount > 0) {\n      return;\n    }\n\n    if (typeof PointerEvent !== 'undefined') {\n      document.removeEventListener('pointerup', handleGlobalPointerEvent);\n    } else {\n      document.removeEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n    }\n  };\n}\n\n/**\n * Handles pointer hover interactions for an element. Normalizes behavior\n * across browsers and platforms, and ignores emulated mouse events on touch devices.\n */\nexport function useHover(props: HoverProps): HoverResult {\n  let {\n    onHoverStart,\n    onHoverChange,\n    onHoverEnd,\n    isDisabled\n  } = props;\n\n  let [isHovered, setHovered] = useState(false);\n  let state = useRef({\n    isHovered: false,\n    ignoreEmulatedMouseEvents: false,\n    pointerType: '',\n    target: null\n  }).current;\n\n  useEffect(setupGlobalTouchEvents, []);\n\n  let {hoverProps, triggerHoverEnd} = useMemo(() => {\n    let triggerHoverStart = (event, pointerType) => {\n      state.pointerType = pointerType;\n      if (isDisabled || pointerType === 'touch' || state.isHovered || !event.currentTarget.contains(event.target)) {\n        return;\n      }\n\n      state.isHovered = true;\n      let target = event.currentTarget;\n      state.target = target;\n\n      if (onHoverStart) {\n        onHoverStart({\n          type: 'hoverstart',\n          target,\n          pointerType\n        });\n      }\n\n      if (onHoverChange) {\n        onHoverChange(true);\n      }\n\n      setHovered(true);\n    };\n\n    let triggerHoverEnd = (event, pointerType) => {\n      state.pointerType = '';\n      state.target = null;\n\n      if (pointerType === 'touch' || !state.isHovered) {\n        return;\n      }\n\n      state.isHovered = false;\n      let target = event.currentTarget;\n      if (onHoverEnd) {\n        onHoverEnd({\n          type: 'hoverend',\n          target,\n          pointerType\n        });\n      }\n\n      if (onHoverChange) {\n        onHoverChange(false);\n      }\n\n      setHovered(false);\n    };\n\n    let hoverProps: HTMLAttributes<HTMLElement> = {};\n\n    if (typeof PointerEvent !== 'undefined') {\n      hoverProps.onPointerEnter = (e) => {\n        if (globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') {\n          return;\n        }\n\n        triggerHoverStart(e, e.pointerType);\n      };\n\n      hoverProps.onPointerLeave = (e) => {\n        if (!isDisabled && e.currentTarget.contains(e.target as HTMLElement)) {\n          triggerHoverEnd(e, e.pointerType);\n        }\n      };\n    } else {\n      hoverProps.onTouchStart = () => {\n        state.ignoreEmulatedMouseEvents = true;\n      };\n\n      hoverProps.onMouseEnter = (e) => {\n        if (!state.ignoreEmulatedMouseEvents && !globalIgnoreEmulatedMouseEvents) {\n          triggerHoverStart(e, 'mouse');\n        }\n\n        state.ignoreEmulatedMouseEvents = false;\n      };\n\n      hoverProps.onMouseLeave = (e) => {\n        if (!isDisabled && e.currentTarget.contains(e.target as HTMLElement)) {\n          triggerHoverEnd(e, 'mouse');\n        }\n      };\n    }\n    return {hoverProps, triggerHoverEnd};\n  }, [onHoverStart, onHoverChange, onHoverEnd, isDisabled, state]);\n\n  useEffect(() => {\n    // Call the triggerHoverEnd as soon as isDisabled changes to true\n    // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering\n    if (isDisabled) {\n      triggerHoverEnd({currentTarget: state.target}, state.pointerType);\n    }\n  }, [isDisabled]);\n\n  return {\n    hoverProps,\n    isHovered\n  };\n}\n\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {RefObject, SyntheticEvent, useEffect, useRef} from 'react';\n\ninterface InteractOutsideProps {\n  ref: RefObject<Element>,\n  onInteractOutside?: (e: SyntheticEvent) => void,\n  onInteractOutsideStart?: (e: SyntheticEvent) => void,\n  /** Whether the interact outside events should be disabled. */\n  isDisabled?: boolean\n}\n\n/**\n * Example, used in components like Dialogs and Popovers so they can close\n * when a user clicks outside them.\n */\nexport function useInteractOutside(props: InteractOutsideProps) {\n  let {ref, onInteractOutside, isDisabled, onInteractOutsideStart} = props;\n  let stateRef = useRef({\n    isPointerDown: false,\n    ignoreEmulatedMouseEvents: false,\n    onInteractOutside,\n    onInteractOutsideStart\n  });\n  let state = stateRef.current;\n  state.onInteractOutside = onInteractOutside;\n  state.onInteractOutsideStart = onInteractOutsideStart;\n\n  useEffect(() => {\n    if (isDisabled) {\n      return;\n    }\n\n    let onPointerDown = (e) => {\n      if (isValidEvent(e, ref) && state.onInteractOutside) {\n        if (state.onInteractOutsideStart) {\n          state.onInteractOutsideStart(e);\n        }\n        state.isPointerDown = true;\n      }\n    };\n\n    // Use pointer events if available. Otherwise, fall back to mouse and touch events.\n    if (typeof PointerEvent !== 'undefined') {\n      let onPointerUp = (e) => {\n        if (state.isPointerDown && state.onInteractOutside && isValidEvent(e, ref)) {\n          state.isPointerDown = false;\n          state.onInteractOutside(e);\n        }\n      };\n\n      // changing these to capture phase fixed combobox\n      document.addEventListener('pointerdown', onPointerDown, true);\n      document.addEventListener('pointerup', onPointerUp, true);\n\n      return () => {\n        document.removeEventListener('pointerdown', onPointerDown, true);\n        document.removeEventListener('pointerup', onPointerUp, true);\n      };\n    } else {\n      let onMouseUp = (e) => {\n        if (state.ignoreEmulatedMouseEvents) {\n          state.ignoreEmulatedMouseEvents = false;\n        } else if (state.isPointerDown && state.onInteractOutside && isValidEvent(e, ref)) {\n          state.isPointerDown = false;\n          state.onInteractOutside(e);\n        }\n      };\n\n      let onTouchEnd = (e) => {\n        state.ignoreEmulatedMouseEvents = true;\n        if (state.onInteractOutside && state.isPointerDown && isValidEvent(e, ref)) {\n          state.isPointerDown = false;\n          state.onInteractOutside(e);\n        }\n      };\n\n      document.addEventListener('mousedown', onPointerDown, true);\n      document.addEventListener('mouseup', onMouseUp, true);\n      document.addEventListener('touchstart', onPointerDown, true);\n      document.addEventListener('touchend', onTouchEnd, true);\n\n      return () => {\n        document.removeEventListener('mousedown', onPointerDown, true);\n        document.removeEventListener('mouseup', onMouseUp, true);\n        document.removeEventListener('touchstart', onPointerDown, true);\n        document.removeEventListener('touchend', onTouchEnd, true);\n      };\n    }\n  }, [ref, state, isDisabled]);\n}\n\nfunction isValidEvent(event, ref) {\n  if (event.button > 0) {\n    return false;\n  }\n\n  // if the event target is no longer in the document\n  if (event.target) {\n    const ownerDocument = event.target.ownerDocument;\n    if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) {\n      return false;\n    }\n  }\n\n  return ref.current && !ref.current.contains(event.target);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {createEventHandler} from './createEventHandler';\nimport {HTMLAttributes} from 'react';\nimport {KeyboardEvents} from '@react-types/shared';\n\nexport interface KeyboardProps extends KeyboardEvents {\n  /** Whether the keyboard events should be disabled. */\n  isDisabled?: boolean\n}\n\ninterface KeyboardResult {\n  /** Props to spread onto the target element. */\n  keyboardProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Handles keyboard interactions for a focusable element.\n */\nexport function useKeyboard(props: KeyboardProps): KeyboardResult {\n  return {\n    keyboardProps: props.isDisabled ? {} : {\n      onKeyDown: createEventHandler(props.onKeyDown),\n      onKeyUp: createEventHandler(props.onKeyUp)\n    }\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {BaseEvent} from '@react-types/shared';\nimport {SyntheticEvent} from 'react';\n\n/**\n * This function wraps a React event handler to make stopPropagation the default, and support continuePropagation instead.\n */\nexport function createEventHandler<T extends SyntheticEvent>(handler: (e: BaseEvent<T>) => void): (e: T) => void {\n  if (!handler) {\n    return;\n  }\n\n  let shouldStopPropagation = true;\n  return (e: T) => {\n    let event: BaseEvent<T> = {\n      ...e,\n      preventDefault() {\n        e.preventDefault();\n      },\n      isDefaultPrevented() {\n        return e.isDefaultPrevented();\n      },\n      stopPropagation() {\n        console.error('stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.');\n      },\n      continuePropagation() {\n        shouldStopPropagation = false;\n      }\n    };\n\n    handler(event);\n\n    if (shouldStopPropagation) {\n      e.stopPropagation();\n    }\n  };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {disableTextSelection, restoreTextSelection}  from './textSelection';\nimport {MoveEvents, PointerType} from '@react-types/shared';\nimport React, {HTMLAttributes, useMemo, useRef} from 'react';\nimport {useGlobalListeners} from '@react-aria/utils';\n\ninterface MoveResult {\n  /** Props to spread on the target element. */\n  moveProps: HTMLAttributes<HTMLElement>\n}\n\ninterface EventBase {\n  shiftKey: boolean,\n  ctrlKey: boolean,\n  metaKey: boolean,\n  altKey: boolean\n}\n\n/**\n * Handles move interactions across mouse, touch, and keyboard, including dragging with\n * the mouse or touch, and using the arrow keys. Normalizes behavior across browsers and\n * platforms, and ignores emulated mouse events on touch devices.\n */\nexport function useMove(props: MoveEvents): MoveResult {\n  let {onMoveStart, onMove, onMoveEnd} = props;\n\n  let state = useRef<{\n    didMove: boolean,\n    lastPosition: {pageX: number, pageY: number} | null,\n    id: number | null\n  }>({didMove: false, lastPosition: null, id: null});\n\n  let {addGlobalListener, removeGlobalListener} = useGlobalListeners();\n\n  let moveProps = useMemo(() => {\n    let moveProps: HTMLAttributes<HTMLElement> = {};\n\n    let start = () => {\n      disableTextSelection();\n      state.current.didMove = false;\n    };\n    let move = (originalEvent: EventBase, pointerType: PointerType, deltaX: number, deltaY: number) => {\n      if (deltaX === 0 && deltaY === 0) {\n        return;\n      }\n\n      if (!state.current.didMove) {\n        state.current.didMove = true;\n        onMoveStart?.({\n          type: 'movestart',\n          pointerType,\n          shiftKey: originalEvent.shiftKey,\n          metaKey: originalEvent.metaKey,\n          ctrlKey: originalEvent.ctrlKey,\n          altKey: originalEvent.altKey\n        });\n      }\n      onMove({\n        type: 'move',\n        pointerType,\n        deltaX: deltaX,\n        deltaY: deltaY,\n        shiftKey: originalEvent.shiftKey,\n        metaKey: originalEvent.metaKey,\n        ctrlKey: originalEvent.ctrlKey,\n        altKey: originalEvent.altKey\n      });\n    };\n    let end = (originalEvent: EventBase, pointerType: PointerType) => {\n      restoreTextSelection();\n      if (state.current.didMove) {\n        onMoveEnd?.({\n          type: 'moveend',\n          pointerType,\n          shiftKey: originalEvent.shiftKey,\n          metaKey: originalEvent.metaKey,\n          ctrlKey: originalEvent.ctrlKey,\n          altKey: originalEvent.altKey\n        });\n      }\n    };\n\n    if (typeof PointerEvent === 'undefined') {\n      let onMouseMove = (e: MouseEvent) => {\n        if (e.button === 0) {\n          move(e, 'mouse', e.pageX - state.current.lastPosition.pageX, e.pageY - state.current.lastPosition.pageY);\n          state.current.lastPosition = {pageX: e.pageX, pageY: e.pageY};\n        }\n      };\n      let onMouseUp = (e: MouseEvent) => {\n        if (e.button === 0) {\n          end(e, 'mouse');\n          removeGlobalListener(window, 'mousemove', onMouseMove, false);\n          removeGlobalListener(window, 'mouseup', onMouseUp, false);\n        }\n      };\n      moveProps.onMouseDown = (e: React.MouseEvent) => {\n        if (e.button === 0) {\n          start();\n          e.stopPropagation();\n          e.preventDefault();\n          state.current.lastPosition = {pageX: e.pageX, pageY: e.pageY};\n          addGlobalListener(window, 'mousemove', onMouseMove, false);\n          addGlobalListener(window, 'mouseup', onMouseUp, false);\n        }\n      };\n\n      let onTouchMove = (e: TouchEvent) => {\n        let touch = [...e.changedTouches].findIndex(({identifier}) => identifier === state.current.id);\n        if (touch >= 0) {\n          let {pageX, pageY} = e.changedTouches[touch];\n          move(e, 'touch', pageX - state.current.lastPosition.pageX, pageY - state.current.lastPosition.pageY);\n          state.current.lastPosition = {pageX, pageY};\n        }\n      };\n      let onTouchEnd = (e: TouchEvent) => {\n        let touch = [...e.changedTouches].findIndex(({identifier}) => identifier === state.current.id);\n        if (touch >= 0) {\n          end(e, 'touch');\n          state.current.id = null;\n          removeGlobalListener(window, 'touchmove', onTouchMove);\n          removeGlobalListener(window, 'touchend', onTouchEnd);\n          removeGlobalListener(window, 'touchcancel', onTouchEnd);\n        }\n      };\n      moveProps.onTouchStart = (e: React.TouchEvent) => {\n        if (e.changedTouches.length === 0 || state.current.id != null) {\n          return;\n        }\n\n        let {pageX, pageY, identifier} = e.changedTouches[0];\n        start();\n        e.stopPropagation();\n        e.preventDefault();\n        state.current.lastPosition = {pageX, pageY};\n        state.current.id = identifier;\n        addGlobalListener(window, 'touchmove', onTouchMove, false);\n        addGlobalListener(window, 'touchend', onTouchEnd, false);\n        addGlobalListener(window, 'touchcancel', onTouchEnd, false);\n      };\n    } else {\n      let onPointerMove = (e: PointerEvent) => {\n        if (e.pointerId === state.current.id) {\n          let pointerType = (e.pointerType || 'mouse') as PointerType;\n\n          // Problems with PointerEvent#movementX/movementY:\n          // 1. it is always 0 on macOS Safari.\n          // 2. On Chrome Android, it's scaled by devicePixelRatio, but not on Chrome macOS\n          move(e, pointerType, e.pageX - state.current.lastPosition.pageX, e.pageY - state.current.lastPosition.pageY);\n          state.current.lastPosition = {pageX: e.pageX, pageY: e.pageY};\n        }\n      };\n\n      let onPointerUp = (e: PointerEvent) => {\n        if (e.pointerId === state.current.id) {\n          let pointerType = (e.pointerType || 'mouse') as PointerType;\n          end(e, pointerType);\n          state.current.id = null;\n          removeGlobalListener(window, 'pointermove', onPointerMove, false);\n          removeGlobalListener(window, 'pointerup', onPointerUp, false);\n          removeGlobalListener(window, 'pointercancel', onPointerUp, false);\n        }\n      };\n\n      moveProps.onPointerDown = (e: React.PointerEvent) => {\n        if (e.button === 0 && state.current.id == null) {\n          start();\n          e.stopPropagation();\n          e.preventDefault();\n          state.current.lastPosition = {pageX: e.pageX, pageY: e.pageY};\n          state.current.id = e.pointerId;\n          addGlobalListener(window, 'pointermove', onPointerMove, false);\n          addGlobalListener(window, 'pointerup', onPointerUp, false);\n          addGlobalListener(window, 'pointercancel', onPointerUp, false);\n        }\n      };\n    }\n\n    let triggerKeyboardMove = (e: EventBase, deltaX: number, deltaY: number) => {\n      start();\n      move(e, 'keyboard', deltaX, deltaY);\n      end(e, 'keyboard');\n    };\n\n    moveProps.onKeyDown = (e) => {\n      switch (e.key) {\n        case 'Left':\n        case 'ArrowLeft':\n          e.preventDefault();\n          e.stopPropagation();\n          triggerKeyboardMove(e, -1, 0);\n          break;\n        case 'Right':\n        case 'ArrowRight':\n          e.preventDefault();\n          e.stopPropagation();\n          triggerKeyboardMove(e, 1, 0);\n          break;\n        case 'Up':\n        case 'ArrowUp':\n          e.preventDefault();\n          e.stopPropagation();\n          triggerKeyboardMove(e, 0, -1);\n          break;\n        case 'Down':\n        case 'ArrowDown':\n          e.preventDefault();\n          e.stopPropagation();\n          triggerKeyboardMove(e, 0, 1);\n          break;\n      }\n    };\n\n    return moveProps;\n  }, [state, onMoveStart, onMove, onMoveEnd, addGlobalListener, removeGlobalListener]);\n\n  return {moveProps};\n}\n","/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject, useCallback} from 'react';\nimport {ScrollEvents} from '@react-types/shared';\nimport {useEvent} from '@react-aria/utils';\n\nexport interface ScrollWheelProps extends ScrollEvents {\n  /** Whether the scroll listener should be disabled. */\n  isDisabled?: boolean\n}\n\n// scroll wheel needs to be added not passively so it's cancelable, small helper hook to remember that\nexport function useScrollWheel(props: ScrollWheelProps, ref: RefObject<HTMLElement>): void {\n  let {onScroll, isDisabled} = props;\n  let onScrollHandler = useCallback((e) => {\n    // If the ctrlKey is pressed, this is a zoom event, do nothing.\n    if (e.ctrlKey) {\n      return;\n    }\n\n    // stop scrolling the page\n    e.preventDefault();\n    e.stopPropagation();\n\n    if (onScroll) {\n      onScroll({deltaX: e.deltaX, deltaY: e.deltaY});\n    }\n  }, [onScroll]);\n\n  useEvent(ref, 'wheel', isDisabled ? null : onScrollHandler);\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {HTMLAttributes, useRef} from 'react';\nimport {LongPressEvent} from '@react-types/shared';\nimport {mergeProps, useDescription, useGlobalListeners} from '@react-aria/utils';\nimport {usePress} from './usePress';\n\ninterface LongPressProps {\n  /** Whether long press events should be disabled. */\n  isDisabled?: boolean,\n  /** Handler that is called when a long press interaction starts. */\n  onLongPressStart?: (e: LongPressEvent) => void,\n  /**\n   * Handler that is called when a long press interaction ends, either\n   * over the target or when the pointer leaves the target.\n   */\n  onLongPressEnd?: (e: LongPressEvent) => void,\n  /**\n   * Handler that is called when the threshold time is met while\n   * the press is over the target.\n   */\n  onLongPress?: (e: LongPressEvent) => void,\n  /**\n   * The amount of time in milliseconds to wait before triggering a long press.\n   * @default 500ms\n   */\n  threshold?: number,\n  /**\n   * A description for assistive techology users indicating that a long press\n   * action is available, e.g. \"Long press to open menu\".\n   */\n  accessibilityDescription?: string\n}\n\ninterface LongPressResult {\n  /** Props to spread on the target element. */\n  longPressProps: HTMLAttributes<HTMLElement>\n}\n\nconst DEFAULT_THRESHOLD = 500;\n\n/**\n * Handles long press interactions across mouse and touch devices. Supports a customizable time threshold,\n * accessibility description, and normalizes behavior across browsers and devices.\n */\nexport function useLongPress(props: LongPressProps): LongPressResult {\n  let {\n    isDisabled,\n    onLongPressStart,\n    onLongPressEnd,\n    onLongPress,\n    threshold = DEFAULT_THRESHOLD,\n    accessibilityDescription\n  } = props;\n\n  const timeRef = useRef(null);\n  let {addGlobalListener, removeGlobalListener} = useGlobalListeners();\n\n  let {pressProps} = usePress({\n    isDisabled,\n    onPressStart(e) {\n      if (e.pointerType === 'mouse' || e.pointerType === 'touch') {\n        if (onLongPressStart) {\n          onLongPressStart({\n            ...e,\n            type: 'longpressstart'\n          });\n        }\n\n        timeRef.current = setTimeout(() => {\n          // Prevent other usePress handlers from also handling this event.\n          e.target.dispatchEvent(new PointerEvent('pointercancel', {bubbles: true}));\n          if (onLongPress) {\n            onLongPress({\n              ...e,\n              type: 'longpress'\n            });\n          }\n          timeRef.current = null;\n        }, threshold);\n\n        // Prevent context menu, which may be opened on long press on touch devices\n        if (e.pointerType === 'touch') {\n          let onContextMenu = e => {\n            e.preventDefault();\n          };\n\n          addGlobalListener(e.target, 'contextmenu', onContextMenu, {once: true});\n          addGlobalListener(window, 'pointerup', () => {\n            // If no contextmenu event is fired quickly after pointerup, remove the handler\n            // so future context menu events outside a long press are not prevented.\n            setTimeout(() => {\n              removeGlobalListener(e.target, 'contextmenu', onContextMenu);\n            }, 30);\n          }, {once: true});\n        }\n      }\n    },\n    onPressEnd(e) {\n      if (timeRef.current) {\n        clearTimeout(timeRef.current);\n      }\n\n      if (onLongPressEnd && (e.pointerType === 'mouse' || e.pointerType === 'touch')) {\n        onLongPressEnd({\n          ...e,\n          type: 'longpressend'\n        });\n      }\n    }\n  });\n\n  let descriptionProps = useDescription(onLongPress && !isDisabled ? accessibilityDescription : null);\n\n  return {\n    longPressProps: mergeProps(pressProps, descriptionProps)\n  };\n}\n"]},"metadata":{},"sourceType":"module"}