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zB,SAAuBkK,CAIa,EAAE,EAgIE,CAAC,MAnIvCC,EADqBD,CACd,CAAI,UACXxH,CAAQ,CACR,GAAGqH,EAAAA,CAHmB,SAKtB,EAIO,EAJH,CAIG,CAJI,CAIJ,KAAC,EAAQ,IAAIA,CAAL,CAAe,SAAErH,IAHvBA,CAIX,GAD0C,IAHvB,mECxOnB,MAzBoB,CAAC0H,EAAoBC,KACvC,IAAMC,EAAatK,EAAAA,MAAY,CAAgB,KAwBlCuK,CAvBPC,EAAgBxK,EAAAA,MAAY,CAACoK,CAuBV,EAHzB,OAlBApK,EAAAA,SAAe,CAAC,KACdwK,EAAclH,OAAO,CAAG8G,CAC1B,GAEApK,EAAAA,SAAe,CAAC,KAGd,GAAqB,UAAjB,OAAOqK,EAGT,OAFAC,EAAWhH,OAAO,CAAGK,OAAO8G,WAAW,CAH5B,IAAMD,EAAclH,OAAO,GAGQ+G,GAEvC,KACDC,EAAWhH,OAAO,EAAE,OACfoH,aAAa,CAACJ,EAAWhH,OAAO,CAE3C,CAEJ,EAAG,CAAC+G,EAAM,EAEHC,EAAWhH,OAAO,aCvB3B,WAAkB,oECAlB,WAAkB","sources":["webpack://_N_E/./src/hooks/use-or-create-ref.ts","webpack://_N_E/./src/components/Tip/Tip.tsx","webpack://_N_E/./src/components/Tip/index.ts","webpack://_N_E/./src/components/Tooltip/Tooltip.official-stuff.ts","webpack://_N_E/./src/components/Tooltip/Tooltip.helpers.ts","webpack://_N_E/./src/components/Tooltip/Tooltip.tsx","webpack://_N_E/./src/hooks/use-interval.ts","webpack://_N_E/./src/components/Tip/Tip.linaria.module.css","webpack://_N_E/./src/components/Tooltip/Tooltip.linaria.module.css"],"sourcesContent":["import React from 'react';\n\n/*\n There are some situations where we only want to create a new ref if one is not provided to a component or hook as a prop. However, due to the `rules-of-hooks`, we cannot conditionally make a call to `React.useRef` only in the situations where the ref is not provided as a prop.\n This hook aims to encapsulate that logic, so the consumer doesn't need to be concerned with violating `rules-of-hooks`.\n*/\n\nfunction useOrCreateRef(\n providedRef?: React.RefObject\n): React.RefObject {\n const createdRef = React.useRef(null);\n return providedRef ?? createdRef;\n}\n\nexport default useOrCreateRef;\n","import React from 'react';\nimport { styled } from '@linaria/react';\n\ninterface Props extends React.HTMLAttributes {\n width?: number;\n height?: number;\n pointing?: 'down' | 'up';\n}\n\nfunction Tip({\n width = 32,\n height = 12,\n pointing = 'up',\n style = {},\n ...delegated\n}: Props) {\n const tipPointinessFactor = width * 0.2;\n\n const path =\n pointing === 'up'\n ? `\n M 0 ${height}\n C ${width * 0.25} ${height}\n ${width / 2 - tipPointinessFactor} 0\n ${width / 2} 0\n C ${width / 2 + tipPointinessFactor} 0\n ${width * 0.75} ${height}\n ${width} ${height}\n Z\n `\n : `\n M 0 0\n C ${width * 0.25} 0\n ${width / 2 - tipPointinessFactor} ${height}\n ${width / 2} ${height}\n C ${width / 2 + tipPointinessFactor} ${height}\n ${width * 0.75} 0\n ${width} 0\n Z\n `;\n\n return (\n \n \n \n );\n}\n\nconst Svg = styled.svg`\n display: block;\n overflow: visible;\n transform-origin: 50% var(--origin-y);\n will-change: transform;\n\n @media (prefers-reduced-motion: no-preference) {\n animation: expand 500ms;\n }\n\n path {\n fill: currentColor;\n stroke: none;\n }\n\n @keyframes expand {\n /*\n HACK: If I start this from 0%, the end result is pixellated.\n Because the dropdown fades in, it doesn't matter if the tip is full-height for the first frame.\n\n I'm adding this 0% opacity so that there isn't even a slight flicker.\n */\n 0% {\n opacity: 0.1;\n }\n\n 1% {\n opacity: 1;\n transform: scaleY(0.2);\n }\n }\n`;\n\nexport default Tip;\n","export { default } from './Tip';\n","// This content is taken from the Github tooltip, and I haven't gone through it in-depth. I should modify this to fit my typical conventions, and move stuff into Tooltip.helpers.\n\nexport type AnchorAlignment = 'start' | 'center' | 'end';\n\nexport type AnchorSide =\n | 'inside-top'\n | 'inside-bottom'\n | 'inside-left'\n | 'inside-right'\n | 'inside-center'\n | 'outside-top'\n | 'outside-bottom'\n | 'outside-left'\n | 'outside-right';\n\n/**\n * Settings that customize how a floating element is positioned\n * with respect to an anchor element.\n */\nexport interface PositionSettings {\n /**\n * Sets the side of the anchor element that the floating element should be\n * pinned to. This side is given by a string starting with either \"inside\" or\n * \"outside\", followed by a hyphen, followed by either \"top\", \"right\", \"bottom\",\n * or \"left\". Additionally, \"inside-center\" is an allowed value.\n *\n * The first part of this string, \"inside\" or \"outside\", determines whether the\n * floating element should be attempted to be placed \"inside\" the anchor element\n * or \"outside\" of it. Using \"inside\" is useful for making it appear that the\n * anchor _contains_ the floating element, and it can be used for implementing a\n * dialog that is centered on the screen. The \"outside\" value is more common and\n * can be used for tooltips, popovers, menus, etc.\n *\n * The second part of this string determines the _edge_ on the anchor element that\n * the floating element will be anchored to. If side is \"inside-center\", then\n * the floating element will be centered in the X-direction (while align is used\n * to position it in the Y-direction).\n * Note: \"outside-center\" is _not_ a valid value for this property.\n */\n side: AnchorSide;\n\n /**\n * Determines how the floating element should align with the anchor element. If\n * set to \"start\", the floating element's first edge (top or left) will align\n * with the anchor element's first edge. If set to \"center\", the floating\n * element will be centered along the axis of the anchor edge. If set to \"end\",\n * the floating element's last edge will align with the anchor element's last edge.\n */\n align: AnchorAlignment;\n\n /**\n * The number of pixels between the anchor edge and the floating element.\n *\n * Positive values move the floating element farther from the anchor element\n * (for outside positioning) or further inside the anchor element (for inside\n * positioning). Negative values have the opposite effect.\n */\n anchorOffset: number;\n\n /**\n * An additional offset, in pixels, to move the floating element from\n * the aligning edge.\n *\n * Positive values move the floating element in the direction of center-\n * alignment. Negative values move the floating element away from center-\n * alignment. When align is \"center\", positive offsets move the floating\n * element right (top or bottom anchor side) or down (left or right\n * anchor side).\n */\n alignmentOffset: number;\n\n /**\n * If false, when the above settings result in rendering the floating element\n * wholly or partially outside of the bounds of the containing element, attempt\n * to adjust the settings to prevent this. Only applies to \"outside\" positioning.\n *\n * First, attempt to flip to the opposite edge of the anchor if the floating\n * element is getting clipped in that direction. If flipping results in a\n * similar clipping, try moving to the adjacent sides.\n *\n * Once we find a side that does not clip the overlay in its own dimension,\n * check the rest of the sides to see if we need to adjust the alignment offset\n * to fit in other dimensions.\n *\n * If we try all four sides and get clipped each time, settle for overflowing\n * and use the \"bottom\" side, since the ability to scroll is most likely in\n * this direction.\n */\n allowOutOfBounds: boolean;\n}\n\n// For each outside anchor position, list the order of alternate positions to try in\n// the event that the original position overflows. See comment on `allowOutOfBounds`\n// for a more detailed description.\nconst alternateOrders: Partial<\n Record\n> = {\n 'outside-top': [\n 'outside-bottom',\n 'outside-right',\n 'outside-left',\n 'outside-bottom',\n ],\n 'outside-bottom': [\n 'outside-top',\n 'outside-right',\n 'outside-left',\n 'outside-bottom',\n ],\n 'outside-left': [\n 'outside-right',\n 'outside-bottom',\n 'outside-top',\n 'outside-bottom',\n ],\n 'outside-right': [\n 'outside-left',\n 'outside-bottom',\n 'outside-top',\n 'outside-bottom',\n ],\n};\n\n// For each alignment, list the order of alternate alignments to try in\n// the event that the original position overflows.\n// Prefer start or end over center.\nconst alternateAlignments: Partial<\n Record\n> = {\n start: ['end', 'center'],\n end: ['start', 'center'],\n center: ['end', 'start'],\n};\n\ninterface Size {\n width: number;\n height: number;\n}\n\ninterface Position {\n top: number;\n left: number;\n}\n\nexport interface AnchorPosition {\n top: number;\n left: number;\n anchorSide: AnchorSide;\n anchorAlign: AnchorAlignment;\n}\n\ninterface BoxPosition extends Size, Position {}\n\n/**\n * Given a floating element and an anchor element, return coordinates for the top-left\n * of the floating element in order to absolutely position it such that it appears\n * near the anchor element.\n *\n * @param floatingElement Element intended to be positioned near or within an anchor\n * @param anchorElement The element to serve as the position anchor\n * @param settings Settings to determine the rules for positioning the floating element\n * @returns {top: number, left: number} coordinates for the floating element\n */\nexport function getAnchoredPosition(\n floatingElement: Element,\n anchorElement: Element | DOMRect,\n settings: Partial = {}\n): AnchorPosition {\n const parentElement = getPositionedParent(floatingElement);\n const clippingRect = getClippingRect(parentElement);\n\n const parentElementStyle = getComputedStyle(parentElement);\n const parentElementRect = parentElement.getBoundingClientRect();\n const [borderTop, borderLeft] = [\n parentElementStyle.borderTopWidth,\n parentElementStyle.borderLeftWidth,\n ].map((v) => parseInt(v, 10) || 0);\n const relativeRect = {\n top: parentElementRect.top + borderTop,\n left: parentElementRect.left + borderLeft,\n };\n\n return pureCalculateAnchoredPosition(\n clippingRect,\n relativeRect,\n floatingElement.getBoundingClientRect(),\n anchorElement instanceof Element\n ? anchorElement.getBoundingClientRect()\n : anchorElement,\n getDefaultSettings(settings)\n );\n}\n\n/**\n * Returns the nearest proper HTMLElement parent of `element` whose\n * position is not \"static\", or document.body, whichever is closer\n */\nfunction getPositionedParent(element: Element) {\n if (isOnTopLayer(element)) return document.body;\n let parentNode = element.parentNode;\n while (parentNode !== null) {\n if (\n parentNode instanceof HTMLElement &&\n getComputedStyle(parentNode).position !== 'static'\n ) {\n return parentNode;\n }\n parentNode = parentNode.parentNode;\n }\n return document.body;\n}\n\n/**\n * Returns true if the element is likely to be on the `top-layer`.\n */\nfunction isOnTopLayer(element: Element) {\n if (element.tagName === 'DIALOG') {\n return true;\n }\n try {\n if (\n element.matches(':popover-open') &&\n /native code/.test(\n (document.body as any).showPopover?.toString()\n )\n ) {\n return true;\n }\n } catch {\n return false;\n }\n return false;\n}\n\n/**\n * Returns the rectangle (relative to the window) that will clip the given element\n * if it is rendered outside of its bounds.\n * @param element\n * @returns\n */\nfunction getClippingRect(element: Element): BoxPosition {\n let parentNode: typeof element.parentNode = element;\n while (parentNode !== null) {\n if (!(parentNode instanceof Element)) {\n break;\n }\n const parentNodeStyle = getComputedStyle(parentNode as Element);\n if (parentNodeStyle.overflow !== 'visible') {\n break;\n }\n parentNode = parentNode.parentNode;\n }\n const clippingNode =\n parentNode === document.body ||\n !(parentNode instanceof HTMLElement)\n ? document.body\n : parentNode;\n\n const elemRect = clippingNode.getBoundingClientRect();\n const elemStyle = getComputedStyle(clippingNode);\n\n const [borderTop, borderLeft, borderRight, borderBottom] = [\n elemStyle.borderTopWidth,\n elemStyle.borderLeftWidth,\n elemStyle.borderRightWidth,\n elemStyle.borderBottomWidth,\n ].map((v) => parseInt(v, 10) || 0);\n\n return {\n top: elemRect.top + borderTop,\n left: elemRect.left + borderLeft,\n width: elemRect.width - borderRight - borderLeft,\n\n // If the clipping node is document.body, it can expand to the full height of the window\n height: Math.max(\n elemRect.height - borderTop - borderBottom,\n clippingNode === document.body ? window.innerHeight : -Infinity\n ),\n };\n}\n\n// Default settings to position a floating element\nconst positionDefaults: PositionSettings = {\n side: 'outside-bottom',\n align: 'start',\n\n // note: the following default is not applied if side === \"inside-center\"\n anchorOffset: 4,\n\n // note: the following default is only applied if side starts with \"inside\"\n // and align is not center\n alignmentOffset: 4,\n\n allowOutOfBounds: false,\n};\n\n/**\n * Compute a full PositionSettings object from the given partial PositionSettings object\n * by filling in with defaults where applicable.\n * @param settings Partial settings - any omissions will be defaulted\n */\nfunction getDefaultSettings(\n settings: Partial = {}\n): PositionSettings {\n const side = settings.side ?? positionDefaults.side;\n const align = settings.align ?? positionDefaults.align;\n return {\n side,\n align,\n // offsets always default to 0 if their respective side/alignment is centered\n anchorOffset:\n settings.anchorOffset ??\n (side === 'inside-center' ? 0 : positionDefaults.anchorOffset),\n alignmentOffset:\n settings.alignmentOffset ??\n (align !== 'center' && side.startsWith('inside')\n ? positionDefaults.alignmentOffset\n : 0),\n allowOutOfBounds:\n settings.allowOutOfBounds ?? positionDefaults.allowOutOfBounds,\n };\n}\n\n/**\n * Note: This is a pure function with no dependency on DOM APIs.\n * @see getAnchoredPosition\n * @see getDefaultSettings\n * @param viewportRect BoxPosition for the rectangle that will clip the floating element if it is\n * rendered outside of the boundsof the rectangle.\n * @param relativePosition Position for the closest positioned proper parent of the floating element\n * @param floatingRect WidthAndHeight for the floating element\n * @param anchorRect BoxPosition for the anchor element\n * @param PositionSettings to customize the calculated position for the floating element.\n */\nfunction pureCalculateAnchoredPosition(\n viewportRect: BoxPosition,\n relativePosition: Position,\n floatingRect: Size,\n anchorRect: BoxPosition,\n {\n side,\n align,\n allowOutOfBounds,\n anchorOffset,\n alignmentOffset,\n }: PositionSettings\n): AnchorPosition {\n // Compute the relative viewport rect, to bring it into the same coordinate space as `pos`\n const relativeViewportRect: BoxPosition = {\n top: viewportRect.top - relativePosition.top,\n left: viewportRect.left - relativePosition.left,\n width: viewportRect.width,\n height: viewportRect.height,\n };\n\n let pos = calculatePosition(\n floatingRect,\n anchorRect,\n side,\n align,\n anchorOffset,\n alignmentOffset\n );\n let anchorSide = side;\n let anchorAlign = align;\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n\n // Handle screen overflow\n if (!allowOutOfBounds) {\n const alternateOrder = alternateOrders[side];\n\n let positionAttempt = 0;\n if (alternateOrder) {\n let prevSide = side;\n\n // Try all the alternate sides until one does not overflow\n while (\n positionAttempt < alternateOrder.length &&\n shouldRecalculatePosition(\n prevSide,\n pos,\n relativeViewportRect,\n floatingRect\n )\n ) {\n const nextSide = alternateOrder[positionAttempt++];\n prevSide = nextSide;\n\n // If we have cut off in the same dimension as the \"side\" option, try flipping to the opposite side.\n pos = calculatePosition(\n floatingRect,\n anchorRect,\n nextSide,\n align,\n anchorOffset,\n alignmentOffset\n );\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorSide = nextSide;\n }\n }\n\n // If using alternate anchor side does not stop overflow,\n // try using an alternate alignment\n const alternateAlignment = alternateAlignments[align];\n\n let alignmentAttempt = 0;\n if (alternateAlignment) {\n let prevAlign = align;\n\n // Try all the alternate alignments until one does not overflow\n while (\n alignmentAttempt < alternateAlignment.length &&\n shouldRecalculateAlignment(\n prevAlign,\n pos,\n relativeViewportRect,\n floatingRect\n )\n ) {\n const nextAlign = alternateAlignment[alignmentAttempt++];\n prevAlign = nextAlign;\n\n pos = calculatePosition(\n floatingRect,\n anchorRect,\n anchorSide,\n nextAlign,\n anchorOffset,\n alignmentOffset\n );\n pos.top -= relativePosition.top;\n pos.left -= relativePosition.left;\n anchorAlign = nextAlign;\n }\n }\n\n // At this point we've flipped the position if applicable. Now just nudge until it's on-screen.\n if (pos.top < relativeViewportRect.top) {\n pos.top = relativeViewportRect.top;\n }\n if (pos.left < relativeViewportRect.left) {\n pos.left = relativeViewportRect.left;\n }\n if (\n pos.left + floatingRect.width >\n viewportRect.width + relativeViewportRect.left\n ) {\n pos.left =\n viewportRect.width +\n relativeViewportRect.left -\n floatingRect.width;\n }\n // If we have exhausted all possible positions and none of them worked, we\n // say that overflowing the bottom of the screen is acceptable since it is\n // likely to be able to scroll.\n if (alternateOrder && positionAttempt < alternateOrder.length) {\n if (\n pos.top + floatingRect.height >\n viewportRect.height + relativeViewportRect.top\n ) {\n // This prevents top from being a negative value\n pos.top = Math.max(\n viewportRect.height +\n relativeViewportRect.top -\n floatingRect.height,\n 0\n );\n }\n }\n }\n\n return { ...pos, anchorSide, anchorAlign };\n}\n\n/**\n * Given a floating element and an anchor element, return coordinates for the\n * top-left of the floating element in order to absolutely position it such\n * that it appears near the anchor element.\n *\n * @param elementDimensions Dimensions of the floating element\n * @param anchorPosition Position of the anchor element\n * @param side Side of the anchor to position the floating element\n * @param align How to align the floating element with the anchor element\n * @param anchorOffset Absolute pixel offset for anchor positioning\n * @param alignmentOffset Absolute pixel offset for alignment\n * @returns {top: number, left: number} coordinates for the floating element\n */\nfunction calculatePosition(\n elementDimensions: Size,\n anchorPosition: BoxPosition,\n side: AnchorSide,\n align: AnchorAlignment,\n anchorOffset: number,\n alignmentOffset: number\n) {\n const anchorRight = anchorPosition.left + anchorPosition.width;\n const anchorBottom = anchorPosition.top + anchorPosition.height;\n let top = -1;\n let left = -1;\n if (side === 'outside-top') {\n top =\n anchorPosition.top - anchorOffset - elementDimensions.height;\n } else if (side === 'outside-bottom') {\n top = anchorBottom + anchorOffset;\n } else if (side === 'outside-left') {\n left =\n anchorPosition.left - anchorOffset - elementDimensions.width;\n } else if (side === 'outside-right') {\n left = anchorRight + anchorOffset;\n }\n\n if (side === 'outside-top' || side === 'outside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n } else if (align === 'center') {\n left =\n anchorPosition.left -\n (elementDimensions.width - anchorPosition.width) / 2 +\n alignmentOffset;\n } else {\n // end\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n }\n\n if (side === 'outside-left' || side === 'outside-right') {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n } else if (align === 'center') {\n top =\n anchorPosition.top -\n (elementDimensions.height - anchorPosition.height) / 2 +\n alignmentOffset;\n } else {\n // end\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n\n if (side === 'inside-top') {\n top = anchorPosition.top + anchorOffset;\n } else if (side === 'inside-bottom') {\n top = anchorBottom - anchorOffset - elementDimensions.height;\n } else if (side === 'inside-left') {\n left = anchorPosition.left + anchorOffset;\n } else if (side === 'inside-right') {\n left = anchorRight - anchorOffset - elementDimensions.width;\n } else if (side === 'inside-center') {\n left =\n (anchorRight + anchorPosition.left) / 2 -\n elementDimensions.width / 2 +\n anchorOffset;\n }\n\n if (side === 'inside-top' || side === 'inside-bottom') {\n if (align === 'start') {\n left = anchorPosition.left + alignmentOffset;\n } else if (align === 'center') {\n left =\n anchorPosition.left -\n (elementDimensions.width - anchorPosition.width) / 2 +\n alignmentOffset;\n } else {\n // end\n left = anchorRight - elementDimensions.width - alignmentOffset;\n }\n } else if (\n side === 'inside-left' ||\n side === 'inside-right' ||\n side === 'inside-center'\n ) {\n if (align === 'start') {\n top = anchorPosition.top + alignmentOffset;\n } else if (align === 'center') {\n top =\n anchorPosition.top -\n (elementDimensions.height - anchorPosition.height) / 2 +\n alignmentOffset;\n } else {\n // end\n top = anchorBottom - elementDimensions.height - alignmentOffset;\n }\n }\n\n return { top, left };\n}\n\n/**\n * Determines if there is an overflow\n * @param side\n * @param currentPos\n * @param containerDimensions\n * @param elementDimensions\n */\nfunction shouldRecalculatePosition(\n side: AnchorSide,\n currentPos: Position,\n containerDimensions: BoxPosition,\n elementDimensions: Size\n) {\n if (side === 'outside-top' || side === 'outside-bottom') {\n return (\n currentPos.top < containerDimensions.top ||\n currentPos.top + elementDimensions.height >\n containerDimensions.height + containerDimensions.top\n );\n } else {\n return (\n currentPos.left < containerDimensions.left ||\n currentPos.left + elementDimensions.width >\n containerDimensions.width + containerDimensions.left\n );\n }\n}\n\n/**\n * Determines if there is an overflow\n * @param align,\n * @param currentPos\n * @param containerDimensions\n * @param elementDimensions\n */\nfunction shouldRecalculateAlignment(\n align: AnchorAlignment,\n currentPos: Position,\n containerDimensions: BoxPosition,\n elementDimensions: Size\n) {\n if (align === 'end') {\n return currentPos.left < containerDimensions.left;\n } else if (align === 'start' || align === 'center') {\n return (\n // right edge\n currentPos.left + elementDimensions.width >\n containerDimensions.left + containerDimensions.width ||\n // left edge\n currentPos.left < containerDimensions.left\n );\n }\n}\n","import * as React from 'react';\n\nexport function useDismissOnEscape(\n isPopoverOpen: boolean,\n closeTooltip: () => void\n) {\n React.useEffect(() => {\n function handleKeyDown(event: KeyboardEvent) {\n if (isPopoverOpen && event.key === 'Escape') {\n event.stopImmediatePropagation();\n event.preventDefault();\n closeTooltip();\n }\n }\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [isPopoverOpen, closeTooltip]);\n}\n\nexport function useDismissOnResize(\n isPopoverOpen: boolean,\n closeTooltip: () => void\n) {\n React.useEffect(() => {\n function handleResize() {\n if (isPopoverOpen) {\n closeTooltip();\n }\n }\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [isPopoverOpen, closeTooltip]);\n}\n","// Modified from:\n// https://github.com/primer/react/blob/main/packages/react/src/TooltipV2/Tooltip.tsx\n// TODO: There's this complex north-south-east-west positioning logic that I don't love. I should switch this to `position`: \"above\" | \"below\".\n'use client';\n\nimport React from 'react';\nimport { styled } from '@linaria/react';\n\nimport useOrCreateRef from '@/hooks/use-or-create-ref';\n\nimport Tip from '@/components/Tip';\nimport ColorModeContainer from '@/components/ColorModeContainer';\n\nimport {\n getAnchoredPosition,\n AnchorSide,\n AnchorAlignment,\n} from './Tooltip.official-stuff';\nimport {\n useDismissOnEscape,\n useDismissOnResize,\n} from './Tooltip.helpers';\n\nexport type TooltipDirection =\n | 'nw'\n | 'n'\n | 'ne'\n | 'e'\n | 'se'\n | 's'\n | 'sw'\n | 'w';\n\nexport type TriggerPropsType = {\n 'aria-describedby'?: string;\n 'aria-labelledby'?: string;\n 'aria-label'?: string;\n onBlur?: React.FocusEventHandler;\n onFocus?: React.FocusEventHandler;\n onMouseEnter?: React.MouseEventHandler;\n onMouseLeave?: React.MouseEventHandler;\n ref?: React.RefObject;\n};\n\n// map tooltip direction to anchoredPosition props\nconst directionToPosition: Record<\n TooltipDirection,\n { side: AnchorSide; align: AnchorAlignment }\n> = {\n nw: { side: 'outside-top', align: 'end' },\n n: { side: 'outside-top', align: 'center' },\n ne: { side: 'outside-top', align: 'start' },\n e: { side: 'outside-right', align: 'center' },\n se: { side: 'outside-bottom', align: 'start' },\n s: { side: 'outside-bottom', align: 'center' },\n sw: { side: 'outside-bottom', align: 'end' },\n w: { side: 'outside-left', align: 'center' },\n};\n\nconst positionToDirection: Record = {\n 'outside-top-end': 'nw',\n 'outside-top-center': 'n',\n 'outside-top-start': 'ne',\n 'outside-right-center': 'e',\n 'outside-bottom-start': 'se',\n 'outside-bottom-center': 's',\n 'outside-bottom-end': 'sw',\n 'outside-left-center': 'w',\n};\n\nexport const TooltipContext = React.createContext<{\n popoverId?: string;\n}>({});\n\ntype SpanWithoutContent = Omit<\n React.HTMLAttributes,\n 'content'\n>;\ninterface TooltipProps extends SpanWithoutContent {\n direction?: TooltipDirection;\n content: React.ReactNode;\n children: React.ReactNode;\n triggerAs?: React.ElementType | undefined;\n ref?: React.RefObject;\n}\n\nfunction Tooltip({\n direction = 's',\n content,\n children,\n triggerAs = 'button',\n ref,\n ...rest\n}: TooltipProps) {\n const popoverId = React.useId();\n\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const [calculatedDirection, setCalculatedDirection] =\n React.useState(direction);\n\n const triggerRef = useOrCreateRef(\n ref as React.RefObject\n );\n const popoverRef = React.useRef(null);\n const timeoutRef = React.useRef(null);\n\n const openTooltip = () => {\n if (timeoutRef.current) {\n window.clearTimeout(timeoutRef.current);\n }\n\n if (\n popoverRef.current &&\n triggerRef.current &&\n popoverRef.current.hasAttribute('popover') &&\n !popoverRef.current.matches(':popover-open')\n ) {\n const tooltip = popoverRef.current;\n const trigger = triggerRef.current;\n setIsPopoverOpen(true);\n\n tooltip.showPopover();\n // HACK: Ugh so in iOS Safari, this method appears not to work the first time. Calling it again in the next frame seems to fix it.\n window.setTimeout(() => {\n tooltip.showPopover();\n }, 16);\n\n const settings = {\n side: directionToPosition[direction].side,\n align: directionToPosition[direction].align,\n };\n const { top, left, anchorAlign, anchorSide } =\n getAnchoredPosition(tooltip, trigger, settings);\n // This is required to make sure the popover is positioned correctly i.e. when there is not enough space on the specified direction, we set a new direction to position the ::after\n const calculatedDirection =\n positionToDirection[`${anchorSide}-${anchorAlign}` as string];\n setCalculatedDirection(calculatedDirection);\n tooltip.style.top = `${top}px`;\n tooltip.style.left = `${left}px`;\n }\n };\n\n const closeTooltip = React.useCallback(() => {\n setIsPopoverOpen(false);\n\n if (\n popoverRef.current &&\n triggerRef.current &&\n popoverRef.current.hasAttribute('popover') &&\n popoverRef.current.matches(':popover-open')\n ) {\n popoverRef.current.hidePopover();\n }\n }, [triggerRef]);\n\n const closeTooltipAfterDelay = () => {\n timeoutRef.current = window.setTimeout(closeTooltip, 250);\n };\n\n useDismissOnEscape(isPopoverOpen, closeTooltip);\n useDismissOnResize(isPopoverOpen, closeTooltip);\n\n // HACK: For some reason, the popover properties *still* aren't working correctly. This is weird, since they were working for me earlier, I think? But whatever, we can do this.\n React.useEffect(() => {\n triggerRef.current?.setAttribute('popoverTarget', popoverId);\n popoverRef.current?.setAttribute('popover', 'auto');\n }, [popoverId, triggerRef]);\n\n React.useEffect(() => {\n async function loadPolyfill() {\n const { apply } = await import('@oddbird/popover-polyfill/fn');\n apply();\n }\n\n const isPopoverApiSupported =\n typeof HTMLElement !== 'undefined' &&\n typeof HTMLElement.prototype === 'object' &&\n 'popover' in HTMLElement.prototype;\n\n if (!isPopoverApiSupported) {\n loadPolyfill();\n }\n }, []);\n\n const value = React.useMemo(\n () => ({ popoverId, isPopoverOpen }),\n [popoverId, isPopoverOpen]\n );\n\n const isTooltipAboveContent = calculatedDirection.match(/^n/);\n\n // Ugh, so if the tooltip is near the edge of the screen, it switches to \"ne\" instead of \"n\", or whatever, and aligns the right edge of the popover with the right edge of the trigger.\n // I would prefer that it shift over as little as possible, but I don't feel like opening that can of worms now. So instead I'll just hide the tooltip when this happens.\n const includeTip =\n calculatedDirection === 'n' || calculatedDirection === 's';\n\n return (\n \n {\n if (!event.target.matches(':focus-visible')) {\n return;\n }\n\n openTooltip();\n }}\n onClick={() => {\n if (isPopoverOpen) {\n closeTooltip();\n } else {\n openTooltip();\n }\n }}\n onMouseEnter={openTooltip}\n onMouseLeave={closeTooltipAfterDelay}\n >\n {children}\n \n \n \n {content}\n \n {includeTip && (\n \n )}\n \n \n );\n}\n\nfunction WrappedTooltip({\n when = true,\n children,\n ...delegated\n}: TooltipProps & { when?: boolean }) {\n if (!when) {\n return children;\n }\n\n return {children};\n}\n\nconst Trigger = styled.button`\n position: relative;\n display: inline-block;\n cursor: default;\n /* HACK: the button forces the line to expand, when it’s used in an Asterisk or Term. I don't *think* I ever have multi-line content in tooltip triggers, but I'll need to find a better solution if so. */\n line-height: 1;\n`;\n\nexport const Popover = styled(ColorModeContainer)`\n --curve: cubic-bezier(0.17, 0.67, 0.37, 1);\n\n display: none;\n\n &[popover] {\n position: absolute;\n inset: auto;\n flex-direction: column;\n width: max-content;\n height: max-content;\n max-width: 19rem;\n margin: auto;\n border: 0;\n padding: 0;\n background: transparent;\n overflow: hidden;\n overflow: clip;\n }\n\n &[popover]:popover-open {\n display: flex;\n }\n &[popover].\\\\:popover-open {\n display: flex;\n }\n\n html[data-color-mode='dark'] & {\n --tooltip-color: black;\n --tooltip-bg: var(--color-adaptive-white);\n }\n html[data-color-mode='light'] & {\n --tooltip-color: white;\n --tooltip-bg: var(--color-primary);\n }\n\n &[data-direction^='n'] {\n &:popover-open {\n animation: slideUp 450ms both var(--curve);\n @keyframes slideUp {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n }\n }\n }\n &.\\\\:popover-open {\n animation: slideUp 450ms both var(--curve);\n @keyframes slideUp {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n }\n }\n }\n }\n\n &[data-direction^='s'] {\n @keyframes slideDown {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n }\n }\n\n &:popover-open {\n animation: slideDown 450ms both var(--curve);\n }\n &.\\\\:popover-open {\n animation: slideDown 450ms both var(--curve);\n }\n }\n`;\n\nconst PopoverBox = styled.span`\n display: block;\n padding: 1rem 1.5rem;\n border-radius: 4px;\n text-align: center;\n color: var(--tooltip-color);\n background: var(--tooltip-bg);\n\n html[data-color-mode='dark'] & {\n --selection-background-color: hsl(50deg 100% 78%);\n --selection-text-color: black;\n }\n html[data-color-mode='light'] & {\n --selection-background-color: hsl(242deg 75% 40%);\n --selection-text-color: white;\n }\n`;\nconst PopoverContent = styled.span`\n display: block;\n animation: fadeIn 300ms 200ms both;\n /* Allow the text to be selected, for folks who click to dictate */\n user-select: all;\n`;\n\nconst StyledTip = styled(Tip)`\n margin-inline: auto;\n color: var(--tooltip-bg);\n`;\n\nexport default React.memo(WrappedTooltip);\n","import React from 'react';\n\nconst useInterval = (callback: Function, delay: number | null) => {\n const intervalId = React.useRef(null);\n const savedCallback = React.useRef(callback);\n\n React.useEffect(() => {\n savedCallback.current = callback;\n });\n\n React.useEffect(() => {\n const tick = () => savedCallback.current();\n\n if (typeof delay === 'number') {\n intervalId.current = window.setInterval(tick, delay);\n\n return () => {\n if (intervalId.current) {\n window.clearInterval(intervalId.current);\n }\n };\n }\n }, [delay]);\n\n return intervalId.current;\n};\n\nexport default useInterval;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"s1k9z937\":\"s1k9z937\",\"expand-s1k9z937\":\"expand-s1k9z937\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"t1cz8cv8\":\"t1cz8cv8\",\"p1lgzcrp\":\"p1lgzcrp\",\":popover-open\":\":popover-open\",\"slideUp-p1lgzcrp\":\"slideUp-p1lgzcrp\",\"slideDown-p1lgzcrp\":\"slideDown-p1lgzcrp\",\"p833mxt\":\"p833mxt\",\"pj0hw36\":\"pj0hw36\",\"fadeIn\":\"fadeIn\",\"s1vq0yeh\":\"s1vq0yeh\"};"],"names":["providedRef","createdRef","React","useOrCreateRef","Svg","styled","name","class","propsAsIs","alternateOrders","alternateAlignments","start","end","center","positionDefaults","side","align","anchorOffset","alignmentOffset","allowOutOfBounds","calculatePosition","elementDimensions","anchorPosition","anchorRight","left","width","anchorBottom","top","height","directionToPosition","nw","Record","n","ne","e","se","s","sw","w","positionToDirection","TooltipContext","Tooltip","direction","content","children","triggerAs","ref","rest","popoverId","isPopoverOpen","setIsPopoverOpen","calculatedDirection","TooltipDirection","HTMLDivElement","timeoutRef","openTooltip","current","clearTimeout","popoverRef","triggerRef","tooltip","window","setTimeout","showPopover","anchorAlign","anchorSide","getAnchoredPosition","anchorElement","settings","parentElement","getPositionedParent","isOnTopLayer","element","tagName","matches","test","body","toString","document","parentNode","HTMLElement","getComputedStyle","position","floatingElement","clippingRect","getClippingRect","Element","overflow","clippingNode","elemRect","getBoundingClientRect","elemStyle","borderTop","borderLeft","borderRight","borderBottom","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","map","parseInt","v","Math","max","innerHeight","Infinity","parentElementStyle","parentElementRect","pureCalculateAnchoredPosition","relativePosition","floatingRect","anchorRect","relativeViewportRect","viewportRect","pos","alternateOrder","positionAttempt","prevSide","length","shouldRecalculatePosition","currentPos","containerDimensions","nextSide","alternateAlignment","alignmentAttempt","prevAlign","shouldRecalculateAlignment","nextAlign","relativeRect","getDefaultSettings","startsWith","trigger","setCalculatedDirection","style","closeTooltip","closeTooltipAfterDelay","handleKeyDown","event","key","stopImmediatePropagation","preventDefault","addEventListener","removeEventListener","handleResize","setAttribute","loadPolyfill","apply","prototype","isTooltipAboveContent","match","includeTip","target","Trigger","Popover","ColorModeContainer","PopoverBox","PopoverContent","StyledTip","Tip","pointing","delegated","tipPointinessFactor","path","WrappedTooltip","when","callback","delay","intervalId","useInterval","savedCallback","setInterval","clearInterval"],"sourceRoot":"","ignoreList":[]}