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hC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GAC3C,IAAI,IAAAshC,EACFzkB,aAAa0kB,WAAW7jB,GACpBsjB,IAAa,QAAPM,EAAAlB,SAAO,IAAAkB,GAAPA,EAASN,KAAKtjB,OAAKxd,GAC/B,CAAE,MAAO,CACX,CAKO,SAASshC,EACd9jB,EAKA+jB,EACApY,GAEA,IACE,MAAMqY,EAAWlB,EAAgC9iB,OAAKxd,GACtD,QAAwB,IAAbwhC,EAA0B,OAErCzX,EAASvM,EADa+jB,aAA0BN,SAAWM,EAAeC,GAAYD,EACzDpY,GAAc,EAC7C,CAAE,MAAO,CACX,C,+BCtGO,SAAS9tB,EAAuBF,GACrC,IAAIsmC,EAA+C,KAEnD,OAAO1lC,iBACmB,OAApB0lC,IAEJA,EAAkBtmC,UACZsmC,EACNA,EAAkB,KACpB,CACF,C","sources":["webpack://@finviz/website/../config/colors.js","webpack://@finviz/website/./js/app/quote/save-to-portfolio/async-modules.ts","webpack://@finviz/website/./js/app/shared/documentVisibility.ts","webpack://@finviz/website/./js/main/components/button-group/button-group.tsx","webpack://@finviz/website/./js/main/components/checkbox.tsx","webpack://@finviz/website/./js/main/components/color-picker/draggable.tsx","webpack://@finviz/website/./js/main/components/color-picker/pointer.tsx","webpack://@finviz/website/./js/main/components/color-picker/util.ts","webpack://@finviz/website/./js/main/components/color-picker/alpha.tsx","webpack://@finviz/website/./js/main/components/color-picker/color-palette.tsx","webpack://@finviz/website/./js/main/components/color-picker/hue-saturation.tsx","webpack://@finviz/website/./js/main/components/color-picker/lightness.tsx","webpack://@finviz/website/./js/main/components/color-picker/color-preview.tsx","webpack://@finviz/website/./js/main/components/color-picker/picker-input.tsx","webpack://@finviz/website/./js/main/components/color-picker/picker.tsx","webpack://@finviz/website/./js/main/components/color-picker/picker-button.tsx","webpack://@finviz/website/./js/main/components/copy-to-clipboard/copy-to-clipboard.tsx","webpack://@finviz/website/./js/main/components/date-picker/index.tsx","webpack://@finviz/website/./js/main/components/dropdown/hooks.ts","webpack://@finviz/website/./js/main/components/dropdown/dropdown.tsx","webpack://@finviz/website/./js/main/components/dropdown/dropdown-item.tsx","webpack://@finviz/website/./js/main/components/dropdown/dropdown-separator.tsx","webpack://@finviz/website/./js/main/components/context-menu/context-menu.tsx","webpack://@finviz/website/./js/main/components/grid/grid.tsx","webpack://@finviz/website/./js/main/components/inner-state/inner-state.tsx","webpack://@finviz/website/./js/main/components/range.tsx","webpack://@finviz/website/./js/main/components/toolbar/interfaces.ts","webpack://@finviz/website/./js/main/components/toolbar/hooks.ts","webpack://@finviz/website/./js/main/components/toolbar/toolbar.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-button.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-group.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-item.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-divider.tsx","webpack://@finviz/website/./js/main/components/tour/step-content.tsx","webpack://@finviz/website/./js/main/components/tour/utils.ts","webpack://@finviz/website/./js/main/components/tour/hooks.tsx","webpack://@finviz/website/./js/main/components/tabs/tab.tsx","webpack://@finviz/website/./js/main/components/tabs/tab-list.tsx","webpack://@finviz/website/./js/main/components/tabs/tab-panel.tsx","webpack://@finviz/website/./js/main/components/tabs/tabs.tsx","webpack://@finviz/website/./js/main/components/badge.tsx","webpack://@finviz/website/./js/main/components/popover/popover.tsx","webpack://@finviz/website/./js/main/components/popover/hooks.ts","webpack://@finviz/website/./js/main/components/popover/popover-trigger.tsx","webpack://@finviz/website/./js/main/components/select/NativeSelect.tsx","webpack://@finviz/website/./js/main/components/select/ItemsGroup.tsx","webpack://@finviz/website/./js/main/components/select/SelectOption.tsx","webpack://@finviz/website/./js/main/components/select/SelectItems.tsx","webpack://@finviz/website/./js/main/components/select/SelectList.tsx","webpack://@finviz/website/./js/main/components/select/SelectTooltipWrapper.tsx","webpack://@finviz/website/./js/main/components/select/DesktopSelect.tsx","webpack://@finviz/website/./js/main/components/select/SelectButton.tsx","webpack://@finviz/website/./js/main/components/select/Select.tsx","webpack://@finviz/website/./js/main/components/select/utils.ts","webpack://@finviz/website/./js/main/components/timeframe-bar/daterange-select.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/label-with-delayed-spinner.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/timeframe-select.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/timeframe-bar.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/utils.ts","webpack://@finviz/website/./js/main/components/timeframe-bar/custom-date-range-utils.ts","webpack://@finviz/website/./js/main/components/timeframe-bar/custom-date-range.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/use-custom-date-range-dialog.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/use-favorite-timeframes.tsx","webpack://@finviz/website/./js/main/hooks/use-sync-local-storage.ts","webpack://@finviz/website/./js/main/components/tooltip-input.tsx","webpack://@finviz/website/./js/main/hooks/use-popover-maxHeight.ts","webpack://@finviz/website/./js/main/hooks/use-window-size.tsx","webpack://@finviz/website/./js/main/modules/portfolio/types.tsx","webpack://@finviz/website/./js/main/services/async-modules-utils.tsx","webpack://@finviz/website/./js/main/services/import-with-retry.ts","webpack://@finviz/website/./js/main/services/local-storage.ts","webpack://@finviz/website/./js/main/services/wait-for-previous-promise.ts"],"sourcesContent":["// Keep in sync with charts repository colors.js file in: app/constants/colors.js\r\n\r\nmodule.exports = {\r\n white: '#fff',\r\n black: '#000',\r\n inherit: 'inherit',\r\n transparent: 'transparent',\r\n current: 'currentColor',\r\n finviz: {\r\n 'blue-gray': '#262931',\r\n blue: '#4fa4f4',\r\n },\r\n gray: {\r\n 50: '#f3f3f5',\r\n 100: '#dedfe5',\r\n 200: '#c3c6d0',\r\n 300: '#a3a8b9',\r\n 400: '#868ea5',\r\n 500: '#676f85',\r\n 600: '#4c5263',\r\n 700: '#353945',\r\n 750: '#2c303b',\r\n 800: '#22262f',\r\n 900: '#14161d',\r\n },\r\n red: {\r\n 50: '#fef0f0',\r\n 100: '#fcd6d6',\r\n 200: '#fbb4b4',\r\n 300: '#fd8487',\r\n 400: '#fb5057',\r\n 500: '#d91e2b',\r\n 600: '#9f1f2a',\r\n 700: '#691f24',\r\n 800: '#45171a',\r\n 900: '#280e0f',\r\n },\r\n orange: {\r\n 50: '#fef2eb',\r\n 100: '#fdd9c5',\r\n 200: '#fab889',\r\n 300: '#ef9323',\r\n 400: '#ca7b14',\r\n 500: '#a0600e',\r\n 600: '#79460a',\r\n 700: '#583006',\r\n 800: '#3d1e03',\r\n 900: '#261101',\r\n },\r\n amber: {\r\n 50: '#fef2e7',\r\n 100: '#fedab5',\r\n 200: '#fbba56',\r\n 300: '#de9c1a',\r\n 400: '#bb830f',\r\n 500: '#956600',\r\n 600: '#704b00',\r\n 700: '#4f3400',\r\n 800: '#372200',\r\n 900: '#211300',\r\n },\r\n yellow: {\r\n 50: '#fdf2df',\r\n 100: '#fcdc86',\r\n 200: '#f3c736',\r\n 300: '#cda30b',\r\n 400: '#b08900',\r\n 500: '#8b6a00',\r\n 600: '#664e21',\r\n 700: '#46371e',\r\n 800: '#2f2516',\r\n 900: '#1b150d',\r\n },\r\n brightYellow: {\r\n 50: '#fff699',\r\n 100: '#fff200',\r\n },\r\n lime: {\r\n 50: '#ebfad6',\r\n 100: '#caec90',\r\n 200: '#aad547',\r\n 300: '#8db61e',\r\n 400: '#769913',\r\n 500: '#5b7800',\r\n 600: '#435900',\r\n 700: '#2e3e00',\r\n 800: '#1e2a00',\r\n 900: '#111900',\r\n },\r\n green: {\r\n 50: '#e7f7e8',\r\n 100: '#beeac1',\r\n 200: '#86d895',\r\n 300: '#34c062',\r\n 400: '#00a449',\r\n 500: '#19803d',\r\n 600: '#265d35',\r\n 700: '#1e4027',\r\n 800: '#162b1b',\r\n 900: '#0d1810',\r\n },\r\n emerald: {\r\n 50: '#ddfaee',\r\n 100: '#a2f0d2',\r\n 200: '#4dddaf',\r\n 300: '#25be93',\r\n 400: '#1d9f7b',\r\n 500: '#157e60',\r\n 600: '#035d47',\r\n 700: '#004139',\r\n 800: '#002c22',\r\n 900: '#001a13',\r\n },\r\n teal: {\r\n 50: '#e0f8fc',\r\n 100: '#9beef7',\r\n 200: '#4fd8e5',\r\n 300: '#27b9c4',\r\n 400: '#109ba5',\r\n 500: '#007c83',\r\n 600: '#005b62',\r\n 700: '#004045',\r\n 800: '#002b2e',\r\n 900: '#00191b',\r\n },\r\n blue: {\r\n 50: '#ebf4fe',\r\n 100: '#cae2fc',\r\n 200: '#9bcbfa',\r\n 300: '#57aefb',\r\n 400: '#2f91ef',\r\n 500: '#306dca',\r\n 600: '#2f5091',\r\n 700: '#263766',\r\n 800: '#1b2542',\r\n 900: '#101527',\r\n },\r\n violet: {\r\n 50: '#f4f2fe',\r\n 100: '#e1dbfd',\r\n 200: '#c9befc',\r\n 300: '#ad9bfb',\r\n 400: '#9978f9',\r\n 500: '#7c51e7',\r\n 600: '#5e36b8',\r\n 700: '#402979',\r\n 800: '#2a1e4e',\r\n 900: '#18122c',\r\n },\r\n purple: {\r\n 50: '#f9f1fe',\r\n 100: '#eed8fd',\r\n 200: '#e1b6fc',\r\n 300: '#d38bfb',\r\n 400: '#c85bf9',\r\n 500: '#ae27e0',\r\n 600: '#8514ac',\r\n 700: '#60077e',\r\n 800: '#44005a',\r\n 900: '#2a003a',\r\n },\r\n pink: {\r\n 50: '#fef1f4',\r\n 100: '#fdd6e1',\r\n 200: '#fcb2c7',\r\n 300: '#f984aa',\r\n 400: '#f25090',\r\n 500: '#cd2a74',\r\n 600: '#9d1658',\r\n 700: '#700c42',\r\n 800: '#4e052b',\r\n 900: '#32011a',\r\n },\r\n}\r\n","export const saveToPortfolioAsyncModule = {\r\n importFn: () => import(/* webpackChunkName: \"save-to-portfolio\" */ './module-entry'),\r\n cacheKey: 'save-to-portfolio',\r\n}\r\n","import { waitForPreviousPromise } from '../../main/services/wait-for-previous-promise'\r\n\r\nfunction getCurrentDateInMs() {\r\n return new Date().valueOf()\r\n}\r\n\r\nfunction getIsDocumentVisible() {\r\n return document.visibilityState === 'visible' || document.hidden === false\r\n}\r\n\r\n/**\r\n * Invoke a callback when page visibility changes. Turns the callback into a promise\r\n * and waits for the previous promise to finish before invoking it again\r\n */\r\nexport function notifyOnVisibilityChange(callback: (visible: boolean) => void | Promise) {\r\n const promisifiedCallback = waitForPreviousPromise(() => callback(getIsDocumentVisible()))\r\n\r\n document.addEventListener('visibilitychange', promisifiedCallback)\r\n\r\n return {\r\n callback: promisifiedCallback,\r\n unsubscribe: () => {\r\n document.removeEventListener('visibilitychange', promisifiedCallback)\r\n },\r\n }\r\n}\r\n\r\n/**\r\n * Calls callback based on interval and document visibility. Returns unsubscribe function.\r\n * How it works:\r\n * - document is hidden: interval cleared\r\n * - document visible: interval set-up with remaining time from last interval. Call immediately if interval elapsed\r\n */\r\nexport function intervalCallbackOnWindowVisible(\r\n interval: number | (() => number),\r\n callback: () => void | Promise\r\n) {\r\n const getInterval = typeof interval === 'function' ? interval : () => interval\r\n let refreshPromise: Promise | void | null = null\r\n let nextRefresh = getCurrentDateInMs() + getInterval()\r\n let refreshTimeout: number | null = null\r\n\r\n async function refresh() {\r\n nextRefresh = getCurrentDateInMs() + getInterval()\r\n // Call callback asynchronously\r\n refreshPromise = callback()\r\n await refreshPromise\r\n refreshPromise = null\r\n\r\n // Queue next refresh\r\n if (getIsDocumentVisible()) {\r\n refreshTimeout = window.setTimeout(refresh, Math.max(0, nextRefresh - getCurrentDateInMs()))\r\n }\r\n }\r\n\r\n /**\r\n * Handle the visibility change event, compute callback remaining time or call immediately\r\n */\r\n function handleVisibilityChange() {\r\n if (refreshTimeout) clearTimeout(refreshTimeout)\r\n\r\n if (getIsDocumentVisible() && refreshPromise === null) {\r\n const currentDateMs = getCurrentDateInMs()\r\n // Refresh if the document is stale, otherwise set a timeout to refresh later\r\n if (nextRefresh <= currentDateMs) {\r\n refresh()\r\n } else {\r\n refreshTimeout = window.setTimeout(refresh, nextRefresh - currentDateMs)\r\n }\r\n }\r\n }\r\n\r\n if (getIsDocumentVisible()) {\r\n refreshTimeout = window.setTimeout(refresh, getInterval())\r\n }\r\n\r\n document.addEventListener('visibilitychange', handleVisibilityChange)\r\n\r\n return () => {\r\n if (refreshTimeout) clearTimeout(refreshTimeout)\r\n document.removeEventListener('visibilitychange', handleVisibilityChange)\r\n }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button, ButtonRounding, ButtonRoundingType } from '../button'\r\n\r\nexport enum GroupTheme {\r\n light,\r\n dark,\r\n}\r\n\r\nexport interface ButtonGroupProps {\r\n children: React.ReactNode\r\n\r\n /**\r\n * Border radius of entire group wrapper\r\n *\r\n * @default \"regular\"\r\n */\r\n rounding?: ButtonRoundingType\r\n\r\n className?: string\r\n\r\n /**\r\n * If a pipe divider between buttons should be rendered\r\n *\r\n * @default true\r\n */\r\n hasDivider?: boolean\r\n\r\n /**\r\n * If group wrapper has a border\r\n *\r\n * @default true\r\n */\r\n hasBorder?: boolean\r\n\r\n /**\r\n * Group color theme\r\n *\r\n * @default \"light\"\r\n */\r\n theme?: keyof typeof GroupTheme\r\n\r\n /**\r\n * Custom button component which extends Button\r\n *\r\n * @default undefined\r\n */\r\n childComponent?: string | React.JSXElementConstructor\r\n}\r\n\r\nfunction getGroupTheme(theme: GroupTheme) {\r\n switch (theme) {\r\n case GroupTheme.dark:\r\n return {\r\n wrapper: 'bg-gray-800 border-gray-600',\r\n divider: 'bg-gray-600',\r\n }\r\n default:\r\n return {\r\n wrapper: 'bg-white dark:bg-gray-800 border-gray-100 dark:border-gray-600',\r\n divider: 'bg-gray-100 dark:bg-gray-600',\r\n }\r\n }\r\n}\r\n\r\nexport function ButtonGroup({\r\n className,\r\n children,\r\n theme = 'light',\r\n hasDivider = true,\r\n hasBorder = true,\r\n rounding = 'regular',\r\n childComponent,\r\n}: ButtonGroupProps) {\r\n const buttonRounding = ButtonRounding[rounding]\r\n const groupTheme = React.useMemo(() => getGroupTheme(GroupTheme[theme]), [theme])\r\n return (\r\n \r\n {React.Children.map(children, (child, index) => {\r\n if (!React.isValidElement(child) || ![Button, childComponent].filter(Boolean).includes(child.type)) {\r\n return child\r\n }\r\n\r\n return (\r\n \r\n {hasDivider && index > 0 &&
}\r\n {React.cloneElement(child as React.ReactElement>, {\r\n rounding: child.props.rounding ?? 'none',\r\n theme: child.props.theme ?? (GroupTheme[theme] === GroupTheme.dark ? 'menuItemDark' : 'menuItem'),\r\n })}\r\n \r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport { ForwardedRef, HTMLProps, PropsWithChildren, ReactNode, forwardRef } from 'react'\r\n\r\nimport { Icon } from './icon'\r\n\r\nexport enum ColorVariant {\r\n violet = 'violet',\r\n emerald = 'emerald',\r\n orange = 'orange',\r\n teal = 'teal',\r\n pink = 'pink',\r\n lime = 'lime',\r\n purple = 'purple',\r\n green = 'green',\r\n yellow = 'yellow',\r\n blue = 'blue',\r\n red = 'red',\r\n gray = 'gray',\r\n default = 'default',\r\n}\r\n\r\nexport enum CheckboxSize {\r\n none = '', // Do not set fixed size\r\n small = 'min-h-6 text-2xs', // 24px\r\n regular = 'min-h-7 text-sm', // 28px\r\n}\r\nexport type CheckboxSizeType = keyof typeof CheckboxSize\r\n\r\ninterface CheckboxProps extends Omit, 'label' | 'size'> {\r\n /**\r\n * Text that gets displayed on the right side of the checkbox\r\n */\r\n label?: ReactNode\r\n\r\n checked: boolean\r\n\r\n /**\r\n * Size of the checkbox\r\n *\r\n * @default \"regular\"\r\n */\r\n size?: CheckboxSizeType\r\n\r\n /**\r\n * Color of the checkbox\r\n *\r\n * @default \"default\"\r\n */\r\n color?: ColorVariant\r\n}\r\n\r\nfunction CheckboxComponent(\r\n {\r\n className,\r\n label,\r\n size = 'regular',\r\n color = ColorVariant.default,\r\n children,\r\n ...props\r\n }: PropsWithChildren,\r\n ref: ForwardedRef\r\n) {\r\n const checked = props.checked ?? props.defaultChecked\r\n\r\n return (\r\n \r\n
\r\n \r\n {checked && (\r\n \r\n )}\r\n
\r\n {label ?? children}\r\n \r\n )\r\n}\r\n\r\nexport const Checkbox = forwardRef(CheckboxComponent)\r\n","import classnames from 'classnames'\r\nimport { HTMLProps, PropsWithChildren, memo, useCallback, useLayoutEffect, useRef, useState } from 'react'\r\n\r\nexport interface Interaction {\r\n left: number\r\n top: number\r\n}\r\n\r\n/**\r\n * Clamp value between two bounds\r\n */\r\nfunction clamp(num: number, min = 0, max = 1) {\r\n return num > max ? max : num < min ? min : num\r\n}\r\n\r\n/**\r\n * Check if an event was triggered by touch\r\n */\r\nfunction isTouch(event: MouseEvent | TouchEvent): event is TouchEvent {\r\n return 'touches' in event\r\n}\r\n\r\n/**\r\n * Returns a relative position of the pointer inside the node's bounding box\r\n */\r\nfunction getRelativePosition(node: HTMLDivElement, event: MouseEvent | TouchEvent): Interaction {\r\n const rect = node.getBoundingClientRect()\r\n\r\n // Get user's pointer position from `touches` array if it's a `TouchEvent`\r\n const pointer = isTouch(event) ? event.touches[0] : (event as MouseEvent)\r\n\r\n return {\r\n left: clamp((pointer.pageX - (rect.left + window.pageXOffset)) / rect.width),\r\n top: clamp((pointer.pageY - (rect.top + window.pageYOffset)) / rect.height),\r\n }\r\n}\r\n\r\n/**\r\n * Browsers introduced an intervention, making touch events passive by default.\r\n * This workaround removes `preventDefault` call from the touch handlers.\r\n * @see https://github.com/facebook/react/issues/19651\r\n */\r\nfunction preventDefaultMove(event: MouseEvent | TouchEvent) {\r\n !isTouch(event) && event.preventDefault()\r\n}\r\n\r\ninterface Props {\r\n onMove: (interaction: Interaction) => void\r\n onKey: (offset: Interaction) => void\r\n}\r\n\r\nfunction DraggablePickerComponent({\r\n onMove,\r\n onKey,\r\n className,\r\n ...props\r\n}: PropsWithChildren & HTMLProps) {\r\n const container = useRef(null)\r\n const hasTouched = useRef(false)\r\n const [isDragging, setDragging] = useState(false)\r\n\r\n /**\r\n * Prevent mobile browsers from handling mouse events (conflicting with touch ones).\r\n * If we detected a touch interaction before, we prefer reacting to touch events only.\r\n */\r\n const isValid = useRef((event: MouseEvent | TouchEvent): boolean => {\r\n if (hasTouched.current && !isTouch(event)) return false\r\n if (!hasTouched.current) hasTouched.current = isTouch(event)\r\n return true\r\n })\r\n\r\n const handleMove = useCallback(\r\n (event: MouseEvent | TouchEvent) => {\r\n preventDefaultMove(event)\r\n\r\n // If user moves the pointer outside of the window or iframe bounds and release it there,\r\n // `mouseup`/`touchend` won't be fired. In order to stop the picker from following the cursor\r\n // after the user has moved the mouse/finger back to the document, we check `event.buttons`\r\n // and `event.touches`. It allows us to detect that the user is just moving his pointer\r\n // without pressing it down\r\n const isDown = isTouch(event) ? event.touches.length > 0 : event.buttons > 0\r\n\r\n if (isDown && container.current) {\r\n onMove(getRelativePosition(container.current, event))\r\n } else {\r\n setDragging(false)\r\n }\r\n },\r\n [onMove]\r\n )\r\n\r\n const handleMoveStart = useCallback(\r\n ({ nativeEvent }: React.MouseEvent | React.TouchEvent) => {\r\n preventDefaultMove(nativeEvent)\r\n\r\n if (!isValid.current(nativeEvent)) return\r\n\r\n // The node/ref must actually exist when user start an interaction.\r\n // We won't suppress the ESLint warning though, as it should probably be something to be aware of.\r\n onMove(getRelativePosition(container.current!, nativeEvent))\r\n setDragging(true)\r\n },\r\n [onMove]\r\n )\r\n\r\n const handleKeyDown = useCallback(\r\n (event: React.KeyboardEvent) => {\r\n const keyCode = event.which || event.keyCode\r\n\r\n // Ignore all keys except arrow ones\r\n if (keyCode < 37 || keyCode > 40) return\r\n // Do not scroll page by arrow keys when document is focused on the element\r\n event.preventDefault()\r\n // Send relative offset to the parent component.\r\n // We use codes (37←, 38↑, 39→, 40↓) instead of keys ('ArrowRight', 'ArrowDown', etc)\r\n // to reduce the size of the library\r\n onKey({\r\n left: keyCode === 39 ? 0.05 : keyCode === 37 ? -0.05 : 0,\r\n top: keyCode === 40 ? 0.05 : keyCode === 38 ? -0.05 : 0,\r\n })\r\n },\r\n [onKey]\r\n )\r\n\r\n const handleMoveEnd = useCallback(() => setDragging(false), [])\r\n\r\n const toggleDocumentEvents = useCallback(\r\n (state) => {\r\n // add or remove additional pointer event listeners\r\n const toggleEvent = state ? window.addEventListener : window.removeEventListener\r\n toggleEvent(hasTouched.current ? 'touchmove' : 'mousemove', handleMove)\r\n toggleEvent(hasTouched.current ? 'touchend' : 'mouseup', handleMoveEnd)\r\n },\r\n [handleMove, handleMoveEnd]\r\n )\r\n\r\n useLayoutEffect(() => {\r\n toggleDocumentEvents(isDragging)\r\n return () => {\r\n isDragging && toggleDocumentEvents(false)\r\n }\r\n }, [isDragging, toggleDocumentEvents])\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport const DraggablePicker = memo(DraggablePickerComponent)\r\n","interface PointerProps {\r\n className?: string\r\n top?: number\r\n left: number\r\n color: string\r\n}\r\n\r\nexport function Pointer({ color, left, top = 0.5 }: PointerProps) {\r\n return (\r\n \r\n
\r\n
\r\n )\r\n}\r\n","/**\r\n * Keep this file in sync with `app/utils/colors.ts` in charts repo\r\n * */\r\n\r\nexport interface RGBA {\r\n r: number\r\n g: number\r\n b: number\r\n a: number\r\n}\r\n\r\nexport interface HSVA {\r\n h: number\r\n s: number\r\n v: number\r\n a: number\r\n}\r\n\r\nexport interface HSLA {\r\n h: number\r\n s: number\r\n l: number\r\n a: number\r\n}\r\n\r\n/**\r\n * Convert Hex string to RGBA object.\r\n * @see https://css-tricks.com/converting-color-spaces-in-javascript/\r\n *\r\n * Input: color in hex3, hex4, hex6 or hex8 format (#fff)\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hexStringToRGBA(hexString: string): RGBA {\r\n const hexColor = removeHashSymbol(hexString)\r\n let r: string | number = 0\r\n let g: string | number = 0\r\n let b: string | number = 0\r\n let a: string | number = 255\r\n\r\n // 3 digits\r\n if (hexColor.length === 3 || hexColor.length === 4) {\r\n r = '0x' + hexColor[0] + hexColor[0]\r\n g = '0x' + hexColor[1] + hexColor[1]\r\n b = '0x' + hexColor[2] + hexColor[2]\r\n // Get channel if defined\r\n a = hexColor.length === 4 ? '0x' + hexColor[3] + hexColor[3] : a\r\n\r\n // 6 digits\r\n } else if (hexColor.length === 6 || hexColor.length === 8) {\r\n r = '0x' + hexColor[0] + hexColor[1]\r\n g = '0x' + hexColor[2] + hexColor[3]\r\n b = '0x' + hexColor[4] + hexColor[5]\r\n // Get channel if defined\r\n a = hexColor.length === 8 ? '0x' + hexColor[6] + hexColor[7] : a\r\n }\r\n\r\n return { r: Number(r), g: Number(g), b: Number(b), a: Math.min(Math.round((Number(a) / 255) * 100) / 100, 1) }\r\n}\r\n\r\n/**\r\n * Convert HEX string to HSVA color representation.\r\n *\r\n * Input: color in hex3, hex4, hex6 or hex8 format (#fff)\r\n *\r\n * Output: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n */\r\nexport function hexStringToHSVA(hexString: string) {\r\n return rgbaToHSVA(hexStringToRGBA(hexString))\r\n}\r\n\r\n/**\r\n * Convert HEX string to HSLA color representation.\r\n *\r\n * Input: color in hex3, hex4, hex6 or hex8 format (#fff)\r\n *\r\n * Output: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n */\r\nexport function hexStringToHSLA(hexString: string) {\r\n return rgbaToHSLA(hexStringToRGBA(hexString))\r\n}\r\n\r\n/**\r\n * Convert alpha value to hex value\r\n *\r\n * Input: [0,1]\r\n *\r\n * Output: alpha in HEX format\r\n */\r\nexport function alphaToHex(alpha: number) {\r\n return Math.max(Math.min(Math.round(alpha * 255), 255), 0)\r\n .toString(16)\r\n .padStart(2, '0')\r\n}\r\n\r\n/**\r\n * Convert RGBA color to HEX string.\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: color in hex6 or hex8 depending on whether or not alpha is enabled\r\n */\r\nexport function rgbaToHexString(color: RGBA, alpha = false) {\r\n const r = color.r.toString(16)\r\n const g = color.g.toString(16)\r\n const b = color.b.toString(16)\r\n const hexString = '#' + r.padStart(2, '0') + g.padStart(2, '0') + b.padStart(2, '0')\r\n\r\n if (!alpha || color.a === 1) {\r\n return hexString\r\n }\r\n\r\n return `${hexString}${alphaToHex(color.a)}`\r\n}\r\n\r\n/**\r\n * Convert HSVA object to HEX string\r\n *\r\n * @see https://css-tricks.com/converting-color-spaces-in-javascript/\r\n *\r\n * Input: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hsvaToHEXString(color: HSVA, alpha = false) {\r\n const rgbaColor = hsvaToRGBA(color)\r\n\r\n return rgbaToHexString(rgbaColor, alpha)\r\n}\r\n\r\n/**\r\n * Convert HSLA object to HEX string\r\n *\r\n * @see https://css-tricks.com/converting-color-spaces-in-javascript/\r\n *\r\n * Input: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hslaToHexString(color: HSLA, alpha = false) {\r\n const rgbaColor = hslaToRGBA(color)\r\n\r\n return rgbaToHexString(rgbaColor, alpha)\r\n}\r\n\r\n/**\r\n * Convert RGBA color to HSVA\r\n * @see https://stackoverflow.com/a/54070620/6662683\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n */\r\nexport function rgbaToHSVA(color: RGBA): HSVA {\r\n const r = color.r / 255\r\n const g = color.g / 255\r\n const b = color.b / 255\r\n\r\n const v = Math.max(r, g, b)\r\n const c = v - Math.min(r, g, b)\r\n const h = c && (v === r ? (g - b) / c : v === g ? 2 + (b - r) / c : 4 + (r - g) / c)\r\n\r\n return {\r\n h: 60 * (h < 0 ? h + 6 : h),\r\n s: v ? c / v : 0,\r\n v: v,\r\n a: color.a,\r\n }\r\n}\r\n\r\n/**\r\n * Convert RGBA to HSLA\r\n * @see https://stackoverflow.com/a/54071699/6662683\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n */\r\nexport function rgbaToHSLA(color: RGBA): HSLA {\r\n const r = color.r / 255\r\n const g = color.g / 255\r\n const b = color.b / 255\r\n\r\n const v = Math.max(r, g, b)\r\n const c = v - Math.min(r, g, b)\r\n const f = 1 - Math.abs(v + v - c - 1)\r\n const h = c && (v === r ? (g - b) / c : v === g ? 2 + (b - r) / c : 4 + (r - g) / c)\r\n\r\n return {\r\n h: 60 * (h < 0 ? h + 6 : h),\r\n s: f ? c / f : 0,\r\n l: (v + v - c) / 2,\r\n a: color.a,\r\n }\r\n}\r\n\r\n/**\r\n * Convert HSVA color to RGBA\r\n * @see https://stackoverflow.com/a/54024653/6662683\r\n *\r\n * Input: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hsvaToRGBA(color: HSVA): RGBA {\r\n const f = (n: number, k = (n + color.h / 60) % 6) => color.v - color.v * color.s * Math.max(Math.min(k, 4 - k, 1), 0)\r\n\r\n return {\r\n r: Math.round(f(5) * 255),\r\n g: Math.round(f(3) * 255),\r\n b: Math.round(f(1) * 255),\r\n a: Math.round(color.a * 100) / 100,\r\n }\r\n}\r\n\r\n/**\r\n * Convert HSLA color to RGBA\r\n * @see https://stackoverflow.com/a/54014428/6662683\r\n *\r\n * Input: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hslaToRGBA(color: HSLA): RGBA {\r\n const a = color.s * Math.min(color.l, 1 - color.l)\r\n const f = (n: number, k = (n + color.h / 30) % 12) => color.l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)\r\n\r\n return {\r\n r: Math.round(f(0) * 255),\r\n g: Math.round(f(8) * 255),\r\n b: Math.round(f(4) * 255),\r\n a: color.a,\r\n }\r\n}\r\n\r\n/**\r\n * Convert RGBA color to rgba() string\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: rgba(r, g, b, a)\r\n */\r\nexport function rgbaToRGBAString(color: RGBA) {\r\n return `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})`\r\n}\r\n\r\n/**\r\n * Convert rgba() string to RGBA color\r\n *\r\n * Input: rgba(r, g, b, a)\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function rgbaStringToObject(color: string) {\r\n const colorParts = /^rgba?\\(([0-9]{1,3})[ ,]+([0-9]{1,3})[ ,]+([0-9]{1,3})[ ,]*([01].?[0-9]*)?\\)$/.exec(color)\r\n const [red, green, blue, alpha = '1'] = colorParts?.slice(1) || [0, 0, 0, 1].map(String)\r\n return {\r\n r: Number.parseInt(red),\r\n g: Number.parseInt(green),\r\n b: Number.parseInt(blue),\r\n a: Number.parseFloat(alpha),\r\n }\r\n}\r\n\r\n/**\r\n * Convert HSLA color to hsla() string\r\n *\r\n * Input: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n *\r\n * Output: hsla(h, s, l, a)\r\n */\r\nexport function hslaToHSLAString(color: HSLA) {\r\n return `hsla(${Math.round(color.h)}, ${Math.round(color.s * 10000) / 100}%, ${Math.round(color.l * 10000) / 100}%, ${\r\n color.a\r\n })`\r\n}\r\n\r\nexport function removeHashSymbol(strColor: string) {\r\n return strColor.replace(/#/g, '')\r\n}\r\n\r\n/**\r\n * Check if the param is a valid color by setting it as style\r\n */\r\nexport function isValidColor(strColor: string) {\r\n const isRgb = strColor.startsWith('rgba')\r\n const s = new Option().style\r\n\r\n s.color = isRgb ? strColor : `#${removeHashSymbol(strColor)}`\r\n\r\n return s.color !== ''\r\n}\r\n\r\n/**\r\n * Normalize color to be a hex value\r\n */\r\nexport function convertColorToHEX(strColor: string) {\r\n const isRgb = getIsRgb(strColor)\r\n\r\n if (isRgb) {\r\n return rgbaToHexString(rgbaStringToObject(strColor), true)\r\n }\r\n\r\n return strColor\r\n}\r\n\r\n/**\r\n * Returns true if color is rgb or rgba\r\n */\r\nexport function getIsRgb(strColor: string, isAlphaAllowed = true) {\r\n const rgbKeys = ['rgb']\r\n if (isAlphaAllowed) {\r\n rgbKeys.push('rgba')\r\n }\r\n return rgbKeys.some((startsWith) => strColor.startsWith(startsWith))\r\n}\r\n\r\n/**\r\n * Convert any color format to HSVA (internal color picker representation)\r\n */\r\nexport function getHSVAFromColor(strColor: string) {\r\n if (getIsRgb(strColor)) {\r\n return rgbaToHSVA(rgbaStringToObject(strColor))\r\n }\r\n\r\n return hexStringToHSVA(strColor)\r\n}\r\n\r\n/**\r\n * Stringify HSVA color representation into a output format\r\n */\r\nexport function stringifyHSVAColor(color: HSVA, output: 'rgba' | 'hex', canSelectAlpha?: boolean) {\r\n switch (output) {\r\n case 'rgba':\r\n return rgbaToRGBAString(hsvaToRGBA(color))\r\n default:\r\n return hsvaToHEXString(color, canSelectAlpha)\r\n }\r\n}\r\n\r\n/**\r\n * Get luma value from RGBA color using the Rec. 709 coefficients\r\n * @see https://en.wikipedia.org/wiki/Luma_%28video%29\r\n *\r\n * If luma is >= 165 the foreground color should be dark\r\n */\r\nexport function getLumaFromRGBA(color: RGBA) {\r\n return 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b\r\n}\r\n\r\n/**\r\n * Checks if luma is >= 165 or alpha < 0.3\r\n */\r\nexport function getIsColorTooLightOrTransparent(color: RGBA) {\r\n return getLumaFromRGBA(color) >= 165 || color.a < 0.5\r\n}\r\n\r\n/**\r\n * Set specific alpha for a hex color\r\n */\r\nexport function getHEXWithSpecificAplha(color: string, alpha = 1) {\r\n const rgbaColor = hexStringToRGBA(color)\r\n return rgbaToHexString({ ...rgbaColor, a: alpha }, true)\r\n}\r\n\r\n/**\r\n * Get rgba from valid color string\r\n */\r\nexport function getRGBAValueFromValidColorString(value: string) {\r\n if (getIsRgb(value)) return rgbaToRGBAString(rgbaStringToObject(value))\r\n return rgbaToRGBAString(hexStringToRGBA(value))\r\n}\r\n","import { useCallback, useMemo } from 'react'\r\n\r\nimport { DraggablePicker, Interaction } from './draggable'\r\nimport { Pointer } from './pointer'\r\nimport { HSVA, hsvaToHEXString } from './util'\r\n\r\ninterface LightnessProps {\r\n color: HSVA\r\n onChange: (color: HSVA) => void\r\n}\r\n\r\nexport function Alpha({ color, onChange }: LightnessProps) {\r\n const changeLightness = useCallback((pos: Interaction) => onChange({ ...color, a: 1 - pos.left }), [onChange, color])\r\n\r\n const gradientPreview = useMemo(() => {\r\n const gradientFrom = hsvaToHEXString({ ...color, a: 1 })\r\n const gradientTo = hsvaToHEXString({ ...color, a: 0 }, true)\r\n\r\n return `linear-gradient(90deg, ${gradientFrom}, ${gradientTo})`\r\n // Don’t recalculate when alpha changes\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [color.h, color.s, color.v])\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n )\r\n}\r\n","import { Icon } from '../icon'\r\nimport { HSVA, hexStringToHSVA } from './util'\r\n\r\nconst DEFAULT_COLORS = [\r\n { title: 'Rose', value: '#f43f5e' },\r\n { title: 'Pink', value: '#db2777' },\r\n { title: 'Fuchsia', value: '#c026d3' },\r\n { title: 'Purple', value: '#9333ea' },\r\n { title: 'Violet', value: '#7c3aed' },\r\n { title: 'Indigo', value: '#4f46e5' },\r\n { title: 'Blue', value: '#2563eb' },\r\n { title: 'Light Blue', value: '#0284c7' },\r\n { title: 'Cyan', value: '#0891b2' },\r\n { title: 'Teal', value: '#0d9488' },\r\n { title: 'Emerald', value: '#059669' },\r\n { title: 'Green', value: '#16a34a' },\r\n { title: 'Lime', value: '#65a30d' },\r\n { title: 'Yellow', value: '#eab308' },\r\n { title: 'Amber', value: '#d97706' },\r\n { title: 'Red', value: '#dc2626' },\r\n]\r\n\r\ninterface ColorItem {\r\n /**\r\n * Name of the color\r\n */\r\n title: string\r\n\r\n /**\r\n * Hex value\r\n */\r\n value: string\r\n}\r\n\r\ninterface ColorPaletteProps {\r\n /**\r\n * Current selected color in HEX format (supports HEX8 for alpha)\r\n */\r\n color: string\r\n\r\n /**\r\n * List of colors to display in the palette\r\n *\r\n * @default DEFAULT_COLORS\r\n */\r\n colors?: ColorItem[]\r\n\r\n /**\r\n * Callback when user picks a color\r\n */\r\n onChange: (color: string, originalColor: HSVA) => void\r\n}\r\n\r\nexport function ColorPalette({ color, colors = DEFAULT_COLORS, onChange }: ColorPaletteProps) {\r\n const lowerCaseColor = color.toLowerCase()\r\n\r\n return (\r\n
\r\n {colors.map((colorObj) => {\r\n const isSelected = lowerCaseColor.startsWith(colorObj.value)\r\n return (\r\n onChange(colorObj.value, hexStringToHSVA(colorObj.value))}\r\n >\r\n {isSelected && }\r\n
\r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import { useCallback, useMemo } from 'react'\r\n\r\nimport { DraggablePicker, Interaction } from './draggable'\r\nimport { Pointer } from './pointer'\r\nimport { HSVA, hsvaToHEXString } from './util'\r\n\r\ninterface HueSaturationProps {\r\n color: HSVA\r\n onChange: (color: HSVA) => void\r\n}\r\n\r\nfunction getPositionFromHSLA(color: HSVA) {\r\n return {\r\n left: color.h / 360,\r\n top: 1 - color.s,\r\n }\r\n}\r\n\r\nexport function HueSaturation({ color, onChange }: HueSaturationProps) {\r\n const position = useMemo(() => getPositionFromHSLA(color), [color])\r\n\r\n const colorPreview = useMemo(() => hsvaToHEXString({ h: color.h, s: color.s, v: 1, a: 1 }), [color.h, color.s])\r\n\r\n const changeSaturation = useCallback(\r\n (pos: Interaction) =>\r\n onChange({\r\n h: Math.round(pos.left * 360),\r\n s: 1 - pos.top,\r\n v: 1,\r\n a: color.a,\r\n }),\r\n [color.a, onChange]\r\n )\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n )\r\n}\r\n","import { useCallback, useMemo } from 'react'\r\n\r\nimport { DraggablePicker, Interaction } from './draggable'\r\nimport { Pointer } from './pointer'\r\nimport { HSVA, hsvaToHEXString } from './util'\r\n\r\ninterface LightnessProps {\r\n color: HSVA\r\n onChange: (color: HSVA) => void\r\n}\r\n\r\nexport function Lightness({ color, onChange }: LightnessProps) {\r\n const changeLightness = useCallback((pos: Interaction) => onChange({ ...color, v: 1 - pos.left }), [onChange, color])\r\n\r\n const colorPreview = useMemo(\r\n () => hsvaToHEXString({ h: color.h, s: color.s, v: color.v, a: 1 }),\r\n [color.h, color.s, color.v]\r\n )\r\n\r\n const gradientPreview = useMemo(() => {\r\n const gradientFrom = hsvaToHEXString({ h: color.h, s: color.s, v: 1, a: 1 })\r\n const gradientTo = hsvaToHEXString({ h: color.h, s: color.s, v: 0, a: 1 })\r\n\r\n return `linear-gradient(90deg, ${gradientFrom}, ${gradientTo})`\r\n }, [color.h, color.s])\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { Icon, IconNameType, isValidIconName } from '../icon'\r\nimport { getIsColorTooLightOrTransparent, hexStringToRGBA } from './util'\r\n\r\ninterface ColorPreviewProps {\r\n /**\r\n * Name of an icon or JSX.Element\r\n */\r\n icon?: JSX.Element | IconNameType\r\n\r\n /**\r\n * One or more colors to show in the preview\r\n */\r\n color: string | string[]\r\n\r\n /**\r\n * Wrapper classname\r\n */\r\n className?: string\r\n}\r\n\r\nexport function ColorPreview({ icon, color, className }: ColorPreviewProps) {\r\n const colors = Array.isArray(color) ? color : [color]\r\n const isTooLight = getIsColorTooLightOrTransparent(hexStringToRGBA(colors[0]))\r\n return (\r\n \r\n {icon && (\r\n
\r\n {isValidIconName(icon) ? (\r\n \r\n ) : (\r\n icon\r\n )}\r\n
\r\n )}\r\n {colors.map((color, index) => (\r\n //   has to be there because of a bug on safari which ignores h-full when empty element\r\n
\r\n  \r\n
\r\n ))}\r\n
\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React, { ForwardedRef, useCallback, useEffect, useState } from 'react'\r\n\r\nimport { Input, InputComponentProps } from '../input'\r\nimport { ColorPreview } from './color-preview'\r\nimport { ColorPickerProps } from './picker'\r\nimport * as colorUtil from './util'\r\n\r\ninterface PickerInputProps extends Omit {\r\n color: ColorPickerProps['color']\r\n onChange: ColorPickerProps['onChange']\r\n\r\n /*\r\n * Is color preview square visible\r\n *\r\n * @default true\r\n * */\r\n hasColorPreview?: boolean\r\n}\r\nexport const PickerInput = React.forwardRef(\r\n (\r\n { color, inputClass, hasColorPreview = true, onChange, ...props }: PickerInputProps,\r\n ref: ForwardedRef\r\n ) => {\r\n const [colorInput, setColorInput] = useState(colorUtil.removeHashSymbol(color))\r\n const isRgba = colorUtil.getIsRgb(colorInput)\r\n\r\n useEffect(() => {\r\n setColorInput(colorUtil.removeHashSymbol(color))\r\n }, [color])\r\n\r\n const handleColorInputChange = useCallback(\r\n (event) => {\r\n const value = colorUtil.removeHashSymbol(event.currentTarget.value)\r\n const isRgba = value.startsWith('rgba')\r\n const colorValue = isRgba ? value : `#${value}`\r\n\r\n setColorInput(value)\r\n if ((value.length >= 6 || (isRgba && value.length >= 16)) && colorUtil.isValidColor(colorValue)) {\r\n onChange(colorValue, colorUtil.hexStringToHSVA(colorValue))\r\n }\r\n },\r\n [onChange]\r\n )\r\n return (\r\n \r\n {hasColorPreview && (\r\n
\r\n \r\n
\r\n )}\r\n {!isRgba && #}\r\n
\r\n }\r\n onChange={handleColorInputChange}\r\n />\r\n )\r\n }\r\n)\r\n","import classnames from 'classnames'\r\nimport React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { Button } from '../button'\r\nimport { Popover, PopoverTrigger, usePopoverState } from '../popover'\r\nimport { Alpha } from './alpha'\r\nimport { ColorPalette } from './color-palette'\r\nimport { HueSaturation } from './hue-saturation'\r\nimport { Lightness } from './lightness'\r\nimport { PickerInput } from './picker-input'\r\nimport * as colorUtil from './util'\r\n\r\nexport interface ColorPickerProps {\r\n /**\r\n * The selected color in HEX format (supports HEX8 for alpha)\r\n */\r\n color: string\r\n\r\n /**\r\n * Whether or not the user is able to select custom color\r\n *\r\n * @default true\r\n */\r\n canSelectCustom?: boolean\r\n\r\n /**\r\n * Whether or not the user is able to change alpha channel. Only applicable\r\n * when `canSelectCustom` is true\r\n *\r\n * @default true\r\n */\r\n canSelectAlpha?: boolean\r\n\r\n /**\r\n * Sets the output format for the color picker\r\n *\r\n * @default 'hex'\r\n */\r\n outputFormat?: 'hex' | 'rgba'\r\n\r\n /**\r\n * Callback when user changes color. Use the second parameter to do color space\r\n * conversions otherwise the color could differ due to rounding\r\n */\r\n onChange: (color: string, originalColor: colorUtil.HSVA) => void\r\n\r\n /**\r\n * Callback when user clicks on a palette item. Used to close popover\r\n */\r\n onPaletteItemClick?: () => void\r\n}\r\n\r\nexport function ColorPicker({\r\n color,\r\n canSelectCustom = true,\r\n canSelectAlpha = true,\r\n outputFormat = 'hex',\r\n onChange,\r\n onPaletteItemClick,\r\n}: ColorPickerProps) {\r\n const cachedColor = useRef(color)\r\n const [hsvaColor, setColor] = useState(colorUtil.getHSVAFromColor(color))\r\n\r\n /**\r\n * Update state if the color from outside changed\r\n */\r\n useEffect(() => {\r\n const currentColor = colorUtil.removeHashSymbol(cachedColor.current)\r\n const newColor = colorUtil.removeHashSymbol(color)\r\n\r\n if (currentColor === newColor || !colorUtil.isValidColor(newColor)) return\r\n\r\n cachedColor.current = color\r\n setColor(colorUtil.getHSVAFromColor(color))\r\n }, [color])\r\n\r\n /**\r\n * Handle color change\r\n * 1. update cache so we can correctly check when outside color updates\r\n * 2. Update internal color representation\r\n * 3. call onChange with string color\r\n */\r\n const onChangeCallback = useCallback(\r\n (color: colorUtil.HSVA) => {\r\n const stringColor = colorUtil.stringifyHSVAColor(color, outputFormat, canSelectAlpha)\r\n cachedColor.current = stringColor\r\n onChange(stringColor, color)\r\n setColor(color)\r\n },\r\n [onChange, canSelectAlpha, outputFormat]\r\n )\r\n\r\n const onSetCustomCodeClick = useCallback(() => {\r\n const value = prompt('Enter a color code')?.trim()\r\n\r\n if (!value) return\r\n\r\n const isValid = colorUtil.isValidColor(value)\r\n\r\n if (!isValid) {\r\n return alert('The code is not a valid color')\r\n }\r\n\r\n onChangeCallback(colorUtil.getHSVAFromColor(value))\r\n }, [onChangeCallback])\r\n\r\n return (\r\n
\r\n {canSelectCustom && (\r\n <>\r\n {isMobile() && (\r\n \r\n )}\r\n \r\n \r\n\r\n {canSelectAlpha && }\r\n \r\n )}\r\n\r\n \r\n {\r\n onPaletteItemClick?.()\r\n onChangeCallback({ ...orignalColor, a: hsvaColor.a })\r\n }}\r\n />\r\n
\r\n \r\n )\r\n}\r\n\r\ninterface InputColorPickerProps extends ColorPickerProps {\r\n /**\r\n * Label for the input\r\n */\r\n label?: ReactNode\r\n inputDataTestId?: string\r\n}\r\n\r\nexport function InputColorPicker({ label, inputDataTestId, onChange, ...props }: InputColorPickerProps) {\r\n const popoverState = usePopoverState()\r\n const canSelectCustom = props.canSelectCustom !== false\r\n const isMobileDevice = isMobile()\r\n\r\n return (\r\n <>\r\n popoverState.hide()}\r\n />\r\n \r\n \r\n {\r\n if (canSelectCustom) return\r\n popoverState.hide()\r\n }}\r\n />\r\n \r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { Button, ButtonComponentProps, ButtonRounding, ButtonSizeType } from '../button'\r\nimport { ButtonGroup } from '../button-group'\r\nimport { IconNameType } from '../icon'\r\nimport { Popover, PopoverProps, PopoverTrigger, usePopoverState } from '../popover'\r\nimport { ColorPreview } from './color-preview'\r\nimport { ColorPicker, ColorPickerProps } from './picker'\r\nimport { PickerInput } from './picker-input'\r\nimport * as colorUtil from './util'\r\n\r\ninterface MultiColorPickerProps extends ColorPickerProps {\r\n /**\r\n * Label for color text input\r\n *\r\n * @default undefined\r\n */\r\n colorInputLabel?: string\r\n}\r\n\r\nexport function MultiColorPicker({\r\n colorInputLabel,\r\n onChange,\r\n canSelectCustom = true,\r\n ...props\r\n}: MultiColorPickerProps) {\r\n const isMobileDevice = isMobile()\r\n\r\n return (\r\n <>\r\n {canSelectCustom && !isMobileDevice && (\r\n
\r\n \r\n
\r\n )}\r\n \r\n {}} />\r\n \r\n \r\n )\r\n}\r\n\r\ninterface ColorTabButtonProps extends ButtonComponentProps {\r\n /*\r\n * Preview color\r\n * */\r\n color: string\r\n}\r\n\r\nexport function ColorTabButton({ color, children, ...props }: ColorTabButtonProps) {\r\n return (\r\n }\r\n {...props}\r\n >\r\n {children}\r\n \r\n )\r\n}\r\n\r\ntype ButtonColorProperties = { color: string; label: string }\r\n\r\ninterface ButtonColorPickerProps\r\n extends Omit {\r\n /**\r\n * Temporary prop to enable/disable multi picker funcionality,\r\n * in the future we'll only use secondaryColor prop to decide if the picker is multi picker or not\r\n *\r\n * @default undefined\r\n */\r\n isMultiPicker?: boolean\r\n\r\n /**\r\n * Button classname\r\n */\r\n className?: string\r\n\r\n /**\r\n * Array of objects with color and value\r\n */\r\n colors: ColorType[]\r\n\r\n /**\r\n * Color onchange callback\r\n */\r\n onChange: (colors: ColorType[], originalColor: colorUtil.HSVA) => void\r\n\r\n /**\r\n * Button size\r\n *\r\n * @default undefined\r\n */\r\n size?: ButtonSizeType\r\n /**\r\n * Label for color text input\r\n *\r\n * @default undefined\r\n */\r\n colorInputLabel?: string\r\n\r\n /**\r\n * Name of an icon or JSX.Element\r\n */\r\n icon?: JSX.Element | IconNameType\r\n\r\n /**\r\n * Hides color picker when clicked outside of popover,\r\n * works with changing focus from the trigger component to another one\r\n *\r\n * @default true\r\n */\r\n hideOnClickOutside: PopoverProps['hideOnClickOutside']\r\n\r\n /**\r\n * Popover overlay click callback, if nothing's provided it calls hide when clicked outside of popover on its overlay\r\n * If false is provided, overlay click calls hide func on popover state object\r\n *\r\n * @default undefined\r\n */\r\n onOverlayClick?: (() => void) | false\r\n\r\n /**\r\n * Identifier for e2e testing\r\n *\r\n * @default undefined\r\n */\r\n buttonPickerDataTestId?: string\r\n}\r\n\r\nexport function ButtonColorPicker({\r\n size,\r\n icon,\r\n colors,\r\n className,\r\n onChange,\r\n buttonPickerDataTestId,\r\n hideOnClickOutside = true,\r\n onOverlayClick,\r\n ...props\r\n}: ButtonColorPickerProps) {\r\n const popoverState = usePopoverState()\r\n const isMultiPicker = !!props.isMultiPicker && colors.length > 1\r\n const [activeColorIndex, setActiveColorIndex] = React.useState(0)\r\n const handleColorChange = React.useCallback(\r\n (color: string, originalColor: colorUtil.HSVA) => {\r\n onChange(\r\n colors.map((colorObject, index) => (index === activeColorIndex ? { ...colorObject, color } : colorObject)),\r\n originalColor\r\n )\r\n },\r\n [activeColorIndex, colors, onChange]\r\n )\r\n return (\r\n <>\r\n \r\n color)}\r\n className={classnames('h-full w-full', ButtonRounding.small)}\r\n />\r\n \r\n \r\n {isMultiPicker && (\r\n
\r\n \r\n {colors.map(({ color, label }, index) => (\r\n setActiveColorIndex(index)}\r\n >\r\n {label}\r\n \r\n ))}\r\n \r\n
\r\n )}\r\n \r\n \r\n \r\n )\r\n}\r\n","import copy from 'copy-to-clipboard'\r\nimport React from 'react'\r\n\r\nimport { Button } from '../button'\r\nimport { InputProps, Textarea } from '../input'\r\n\r\ninterface Props extends Pick {\r\n className?: string\r\n text: string\r\n bottomLeftContent?: React.ReactNode\r\n}\r\n\r\nexport const CopyToClipboard: React.FC = ({ className, label, text, bottomLeftContent }) => {\r\n const [isCopied, setIsCopied] = React.useState(false)\r\n\r\n const handleCopyToClipboard = React.useCallback(() => {\r\n setIsCopied(true)\r\n copy(text)\r\n }, [text])\r\n\r\n React.useEffect(() => {\r\n let timeout: number\r\n const resetTimer = () => {\r\n if (!timeout) return\r\n clearTimeout(timeout)\r\n }\r\n if (isCopied) {\r\n resetTimer()\r\n timeout = window.setTimeout(() => {\r\n setIsCopied(false)\r\n }, 2000)\r\n }\r\n\r\n return () => {\r\n resetTimer()\r\n }\r\n }, [isCopied])\r\n\r\n return (\r\n
\r\n e.currentTarget.select()}\r\n inputClass=\"h-12\"\r\n data-testid=\"copy-to-clipboard-textarea\"\r\n value={text}\r\n />\r\n
\r\n {bottomLeftContent &&
{bottomLeftContent}
}\r\n \r\n {isCopied ? 'Copied' : 'Copy'}\r\n \r\n
\r\n
\r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { CalendarProps } from 'react-calendar'\r\n\r\nimport { Box } from '../box'\r\nimport { ZIndexContext, getExtendedDialogState } from '../dialog'\r\nimport { Popover, PopoverTrigger, usePopoverState } from '../popover'\r\nimport { Spinner } from '../spinner'\r\n\r\nconst DatePickerComponent = React.lazy(() => import('./picker'))\r\n\r\ntype RangePickerCallback = (value: [Date, Date], ev: React.ChangeEvent) => void\r\ntype PickerCallback = (value: Date, ev: React.ChangeEvent) => void\r\n\r\ninterface DatePickerProps extends Omit {\r\n /**\r\n * Trigger element for the picker\r\n */\r\n children: JSX.Element\r\n\r\n onChange: PickerCallback | RangePickerCallback\r\n\r\n zIndex?: string\r\n}\r\n\r\nexport function StatelessDatePicker({\r\n state,\r\n children,\r\n zIndex,\r\n ...props\r\n}: DatePickerProps & { state: ReturnType; zIndex?: string }) {\r\n const { isFullyClosed } = getExtendedDialogState(state)\r\n return (\r\n <>\r\n \r\n {(triggerProps: React.HTMLProps) =>\r\n React.Children.map(children, (child) => {\r\n if (React.isValidElement(child))\r\n return React.cloneElement(child, { ...triggerProps, ...(child.props as any) })\r\n })\r\n }\r\n \r\n {!isFullyClosed && (\r\n \r\n \r\n \r\n \r\n \r\n }\r\n >\r\n ) => {\r\n state.hide()\r\n props.onChange?.(value, ev)\r\n }}\r\n />\r\n \r\n \r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\nexport function DatePicker(props: DatePickerProps) {\r\n const popover = usePopoverState()\r\n\r\n return \r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport type DropdownStateReturn = ReturnType\r\n\r\nexport const DropdownContext = React.createContext<{\r\n parent: Reakit.MenuStateReturn\r\n root: Reakit.MenuStateReturn\r\n} | null>(null)\r\n\r\nexport function useDropdownState(settings?: Reakit.MenuInitialState) {\r\n const context = React.useContext(DropdownContext)\r\n\r\n return Reakit.useMenuState({\r\n ...settings,\r\n loop: true,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n unstable_virtual: true,\r\n unstable_offset: settings?.unstable_offset ?? (context?.root ? [-5, 4] : [0, 5]),\r\n modal: false,\r\n })\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { Box, BoxProps, BoxRounding } from '../box'\r\nimport { getExtendedDialogState, useZIndex } from '../dialog'\r\nimport { DropdownContext, useDropdownState } from './hooks'\r\n\r\ninterface DropdownBaseProps extends Omit {\r\n /**\r\n * Trigger button for the dropdown\r\n */\r\n label: JSX.Element\r\n\r\n /**\r\n * @private\r\n * Any additional props to the trigger button. Used by nested dropdown wrapper\r\n */\r\n triggerProps?: Reakit.MenuButtonHTMLProps\r\n\r\n /**\r\n * Rounding of all trigger button, dropdown wrapper and dropdown items\r\n */\r\n rounding?: keyof typeof BoxRounding\r\n}\r\n\r\ninterface RootDropdownProps {\r\n /**\r\n * The returned object from `useDropdownState`. For nested dropdowns use the `isNested` prop\r\n */\r\n state: Reakit.MenuStateReturn\r\n isNested?: never\r\n /**\r\n * When set to true the dropdown will not render in Portal and will not use position absolute + transform.\r\n */\r\n isStatic?: boolean\r\n}\r\n\r\ninterface NestedDropdownProps {\r\n state?: never\r\n /**\r\n * When set to true the dropdown will compute its own state. Only usable with\r\n * nested dropdowns\r\n */\r\n isNested: true\r\n\r\n isStatic?: never\r\n}\r\n\r\ntype DropdownProps = DropdownBaseProps & (RootDropdownProps | NestedDropdownProps)\r\n\r\nfunction DropdownComponent(\r\n {\r\n label,\r\n triggerProps,\r\n state,\r\n 'aria-label': ariaLabel,\r\n children,\r\n isNested,\r\n rounding,\r\n isStatic,\r\n ...props\r\n }: React.PropsWithChildren,\r\n ref: React.ForwardedRef\r\n) {\r\n const zIndex = useZIndex()\r\n const context = React.useContext(DropdownContext)\r\n // Required due to the way conditional props work\r\n const dropdownState = state!\r\n const { isFullyClosed } = getExtendedDialogState(state ?? { visible: false, animating: false })\r\n\r\n if (!isNested && !dropdownState) {\r\n throw new Error('Dropdowns require either `state` or `isNested` prop defined!')\r\n }\r\n\r\n const ContainerElement = React.useRef(isNested || isStatic ? React.Fragment : Portal).current\r\n\r\n return (\r\n <>\r\n \r\n {(buttonProps) =>\r\n React.cloneElement(label, {\r\n ...buttonProps,\r\n ...label.props,\r\n rounding,\r\n active: label.props.active ?? dropdownState.visible,\r\n })\r\n }\r\n \r\n {!isFullyClosed && (\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => (\r\n \r\n \r\n \r\n {React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child\r\n\r\n if (child.type === Dropdown) {\r\n return {child}\r\n }\r\n\r\n return React.cloneElement(child, {\r\n ...child.props,\r\n rounding,\r\n })\r\n })}\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\nexport const Dropdown = React.forwardRef(DropdownComponent)\r\n\r\ninterface NestedDropdownWrapperProps {\r\n /**\r\n * State of parrent dropdown to be passed to MenuItem for correct navigation\r\n * handling\r\n */\r\n parentState: Reakit.MenuStateReturn\r\n\r\n /**\r\n * Nested dropdown element\r\n */\r\n children: JSX.Element\r\n}\r\n\r\n/**\r\n * The `useDropdownState` requires parent context to be defined in order to work\r\n * with nested Dropdowns. So we need to create a wrapper to be able to get to the\r\n * parent context\r\n */\r\nfunction NestedDropdownWrapper({ parentState, children }: NestedDropdownWrapperProps) {\r\n const state = useDropdownState()\r\n\r\n return (\r\n \r\n {(itemProps) => React.cloneElement(children, { ...children.props, triggerProps: itemProps, state })}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\n\r\nimport { Button, ButtonProps } from '../button'\r\nimport { Icon, isValidIconName } from '../icon'\r\nimport { PropsWithAs } from '../types'\r\nimport { DropdownContext } from './hooks'\r\n\r\nconst DEFAULT_ELEMENT = 'button'\r\n\r\ninterface DropdownItemProps extends ButtonProps {\r\n subtitle?: React.ReactNode\r\n\r\n /**\r\n * Whether clicking the item should also close the dropdown. Only applies to\r\n * items without a submenu\r\n *\r\n * @default true\r\n */\r\n closeOnClick?: boolean\r\n}\r\n\r\nfunction DropdownItemComponent(\r\n {\r\n as: asComponent,\r\n state,\r\n subtitle,\r\n closeOnClick = true,\r\n children,\r\n rounding,\r\n size,\r\n ...props\r\n }: PropsWithAs & DropdownItemProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const context = React.useContext(DropdownContext)\r\n\r\n return (\r\n \r\n {(itemProps) => {\r\n const active = itemProps['aria-selected'] && !context?.parent.animating\r\n const hasSubmenu = Boolean(itemProps['aria-haspopup'])\r\n\r\n const iconTheme = {\r\n 'text-gray-300': !active,\r\n 'text-gray-white dark:text-white': active,\r\n }\r\n\r\n return (\r\n \r\n ) : (\r\n props.leftContent\r\n )\r\n }\r\n rightContent={\r\n isValidIconName(props.rightContent) ? (\r\n \r\n ) : (\r\n props.rightContent\r\n )\r\n }\r\n onClick={(ev: React.MouseEvent) => {\r\n // Close if we clicked on an item which doesn’t have a submenu\r\n if (closeOnClick && !hasSubmenu) {\r\n context?.root.hide()\r\n }\r\n\r\n itemProps.onClick?.(ev)\r\n }}\r\n >\r\n {children}\r\n {subtitle &&
{subtitle}
}\r\n \r\n )\r\n }}\r\n
\r\n )\r\n}\r\n\r\n/**\r\n * We need to forward ref to the function, but typescript looses the type of the\r\n * props param so we need to typecast to get suggestions to work\r\n */\r\nexport const DropdownItem = React.forwardRef(DropdownItemComponent) as <\r\n TagType extends React.ElementType = typeof DEFAULT_ELEMENT,\r\n>(\r\n props: PropsWithAs & DropdownItemProps & { ref?: React.ForwardedRef }\r\n) => ReturnType\r\n","import * as Reakit from 'reakit/Menu'\r\n\r\nimport { Paragraph } from '../typography'\r\n\r\nexport function DropdownSeparator(props: Partial) {\r\n return (\r\n \r\n
\r\n {props.children && (\r\n \r\n {props.children}\r\n \r\n )}\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { usePopper } from 'react-popper'\r\n\r\nimport { usePopoverMaxHeight } from '../../hooks/use-popover-maxHeight'\r\nimport { Button } from '../button'\r\nimport { getExtendedDialogState } from '../dialog'\r\nimport { Dropdown, DropdownItem, DropdownSeparator, useDropdownState } from '../dropdown'\r\nimport { ObjectHash } from '../types'\r\n\r\nconst DEFAULT_OFFSETS: [number, number] = [5, 5]\r\n\r\nfunction getVirtualRef(top: number, left: number) {\r\n return {\r\n getBoundingClientRect(): DOMRect {\r\n const rect = {\r\n top: top - window.scrollY,\r\n x: top - window.scrollY,\r\n left: left - window.scrollX,\r\n y: left - window.scrollX,\r\n bottom: top,\r\n right: left,\r\n width: 0,\r\n height: 0,\r\n }\r\n\r\n return {\r\n ...rect,\r\n toJSON: () => rect,\r\n }\r\n },\r\n }\r\n}\r\n\r\nexport interface IContextMenuOption {\r\n type?: never\r\n id: string\r\n label: React.ReactNode\r\n onClick?: () => void\r\n options?: ContextMenuItem[]\r\n gtag?: ObjectHash\r\n}\r\n\r\ninterface IContextMenuDivider {\r\n type: 'divider'\r\n label?: React.ReactNode\r\n}\r\n\r\nexport type ContextMenuItem = IContextMenuOption | IContextMenuDivider\r\n\r\ninterface ContextMenuProps {\r\n /**\r\n * Top coordinate of the click\r\n */\r\n top: number\r\n\r\n /**\r\n * Left coordinate of the click\r\n */\r\n left: number\r\n\r\n /**\r\n * Can limit the max height of the menu\r\n *\r\n * @default undefined\r\n */\r\n menuMaxHeight?: number\r\n\r\n /**\r\n * Items visible in the menu\r\n */\r\n items: ContextMenuItem[]\r\n\r\n /**\r\n * Callback to hide the menu\r\n */\r\n hide: () => void\r\n}\r\n\r\nexport function ContextMenu({ top, left, menuMaxHeight, hide, items }: ContextMenuProps) {\r\n const [popperElement, setPopperElement] = React.useState(null)\r\n const virtualRef = React.useMemo(() => getVirtualRef(top, left), [left, top])\r\n const dropdownState = useDropdownState({ placement: 'bottom-start' })\r\n const { isFullyClosed } = getExtendedDialogState(dropdownState)\r\n const hasBeenOpen = React.useRef(false)\r\n\r\n const { styles, attributes } = usePopper(virtualRef, popperElement, {\r\n placement: 'auto-end',\r\n modifiers: [\r\n {\r\n name: 'offset',\r\n options: {\r\n offset: DEFAULT_OFFSETS,\r\n },\r\n },\r\n ],\r\n })\r\n\r\n /**\r\n * This effect handles closing the context menu (parent element) itself\r\n */\r\n React.useEffect(() => {\r\n if (isFullyClosed && hasBeenOpen.current) hide()\r\n }, [isFullyClosed, hide])\r\n\r\n /**\r\n * This effect handles opening/closing the inner dropdown\r\n */\r\n React.useEffect(() => {\r\n dropdownState.show()\r\n hasBeenOpen.current = true // This acts as a way to differentiate the first render\r\n\r\n return () => dropdownState.hide()\r\n // This needs to run only on mount/unmount for obvious reasons\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [])\r\n\r\n return (\r\n \r\n }\r\n menuMaxHeight={menuMaxHeight}\r\n state={dropdownState}\r\n items={items}\r\n isStatic\r\n />\r\n
\r\n )\r\n}\r\n\r\ninterface ContextMenuInnerProps {\r\n label: JSX.Element\r\n items: ContextMenuItem[]\r\n state: ReturnType\r\n isStatic?: boolean\r\n menuMaxHeight?: number\r\n}\r\n\r\nfunction ContextMenuInner(\r\n { label, items, state, isStatic, menuMaxHeight = Number.MAX_SAFE_INTEGER }: ContextMenuInnerProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const innerState = useDropdownState({ placement: 'right-start' })\r\n const maxHeightStyle = usePopoverMaxHeight({\r\n maxHeightLimit: menuMaxHeight,\r\n hasViewportHeightLimit: true,\r\n offsets: DEFAULT_OFFSETS,\r\n state,\r\n })\r\n\r\n return (\r\n \r\n {items.map((item, index) => {\r\n if (item.type === 'divider') {\r\n return {item.label}\r\n }\r\n\r\n if (item?.options !== undefined) {\r\n return (\r\n \r\n {item.label}\r\n \r\n }\r\n items={item.options}\r\n />\r\n )\r\n }\r\n\r\n return (\r\n {\r\n item.onClick?.()\r\n window.gtag?.('event', 'context-menu', Object.assign({ menu_option: item.id }, item.gtag))\r\n }}\r\n data-testid={`dropdown-menu-${item.id}`}\r\n className=\"shrink-0\"\r\n >\r\n {item.label}\r\n \r\n )\r\n })}\r\n \r\n )\r\n}\r\n\r\nconst ContextMenuDropdown = React.forwardRef(ContextMenuInner)\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\ninterface GridLayoutProps extends React.HTMLProps {\r\n /**\r\n * Number of columns\r\n */\r\n columns?: number\r\n\r\n /**\r\n * Number of rows\r\n */\r\n rows?: number\r\n\r\n /**\r\n * Whether or not a border is rendered between and around items. eg. charts\r\n * on HP won’t have a border\r\n *\r\n * @default false\r\n */\r\n border?: boolean\r\n}\r\n\r\nexport const ChartGridCell = React.forwardRef(\r\n ({ children, gridArea, className, ...props }, ref) => (\r\n \r\n {children}\r\n \r\n )\r\n)\r\n\r\ninterface ChartGridCellProps extends React.HTMLProps {\r\n /**\r\n * Css grid-area value\r\n */\r\n gridArea?: string\r\n}\r\n\r\nexport function GridLayout({ columns = 1, rows = 1, border = false, children, className, ...props }: GridLayoutProps) {\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\ninterface ChartGridProps extends GridLayoutProps {\r\n isResizable?: boolean\r\n}\r\n\r\nexport const ChartGrid: React.FC = (props) => \r\n","import * as React from 'react'\r\n\r\nimport { PropsWithAs, RequireByKey } from '../types'\r\n\r\nconst defaultValueAccessor: ValueAccessor = (data) => data\r\n\r\nconst DEFAULT_VALUE_KEY = 'value'\r\nconst DEFAULT_CHANGE_KEY = 'onChange'\r\n\r\ntype ValueAccessor<\r\n TagType extends React.ElementType,\r\n ValueKey extends keyof React.ComponentProps = typeof DEFAULT_VALUE_KEY,\r\n ChangeKey extends keyof React.ComponentProps = typeof DEFAULT_CHANGE_KEY,\r\n> = (...args: Parameters[ChangeKey]>) => React.ComponentProps[ValueKey]\r\n\r\nexport type InnerStateProps<\r\n TagType extends React.ElementType,\r\n ValueKey extends keyof React.ComponentProps,\r\n ChangeKey extends keyof React.ComponentProps,\r\n> = RequireByKey, 'as'> & {\r\n valueKey?: ValueKey\r\n changeKey?: ChangeKey\r\n valueAccessor?: ValueAccessor\r\n}\r\n\r\nexport function InnerState<\r\n TagType extends React.ElementType,\r\n ValueKey extends keyof React.ComponentProps = typeof DEFAULT_VALUE_KEY,\r\n ChangeKey extends keyof React.ComponentProps = typeof DEFAULT_CHANGE_KEY,\r\n>({\r\n as: asComponent,\r\n valueKey = 'value' as ValueKey,\r\n changeKey = 'onChange' as ChangeKey,\r\n valueAccessor = defaultValueAccessor,\r\n ...props\r\n}: InnerStateProps) {\r\n const { [valueKey]: value, [changeKey]: onChange } = props\r\n const [state, setState] = React.useState[ValueKey]>(value)\r\n\r\n const handleChange = React.useCallback>(\r\n (...args) => {\r\n setState(valueAccessor(...args))\r\n onChange(...args)\r\n },\r\n [onChange, valueAccessor]\r\n )\r\n\r\n return React.createElement(asComponent, {\r\n ...props,\r\n [valueKey]: state,\r\n [changeKey]: handleChange,\r\n })\r\n}\r\n","import classnames from 'classnames'\r\nimport { HTMLProps, ReactNode, useEffect, useMemo, useRef, useState } from 'react'\r\n\r\nimport { Label } from './typography'\r\n\r\nexport enum RangeSize {\r\n small = 'sm:h-6', // 24px height\r\n regular = 'sm:h-7', // 28px height\r\n medium = 'sm:h-8', // 32px height\r\n large = 'sm:h-9', // 36px height\r\n}\r\n\r\ntype InputProps = HTMLProps\r\n\r\ninterface RangeSliderProps extends Omit {\r\n /**\r\n * Label which is rendered above the select\r\n */\r\n label?: ReactNode\r\n\r\n /**\r\n * Range size. All inputs have forced height on mobile to avoid zoom\r\n *\r\n * @default regular\r\n */\r\n size?: keyof typeof RangeSize\r\n\r\n /**\r\n * Element which will be rendered on the left side of the slider\r\n */\r\n leftContent?: ReactNode\r\n\r\n /**\r\n * Element which will be rendered on the right side of the slider\r\n */\r\n rightContent?: ReactNode\r\n\r\n /**\r\n * Class name for the wrapper element\r\n */\r\n className?: string\r\n\r\n /**\r\n * Class name for the input element\r\n */\r\n inputClassName?: string\r\n\r\n /**\r\n * Min value for the input\r\n *\r\n * @default 0\r\n */\r\n min?: number\r\n\r\n /**\r\n * Max value for the input\r\n *\r\n * @default 100\r\n */\r\n max?: number\r\n\r\n /**\r\n * Step value for the input\r\n *\r\n * @default 1\r\n */\r\n step?: number\r\n\r\n /**\r\n * Current value\r\n */\r\n value: number\r\n\r\n /**\r\n * Callback when value changes\r\n */\r\n onChange: InputProps['onChange']\r\n}\r\n\r\nexport function RangeSlider({\r\n label,\r\n size = 'regular',\r\n leftContent,\r\n rightContent,\r\n min = 0,\r\n max = 100,\r\n step = 1,\r\n className,\r\n inputClassName,\r\n ...props\r\n}: RangeSliderProps) {\r\n const [hasTrack, setHasTrack] = useState(false)\r\n const trackRef = useRef(null)\r\n const thumbRef = useRef(null)\r\n\r\n useEffect(() => {\r\n setHasTrack(Boolean(trackRef.current && thumbRef.current))\r\n }, [])\r\n\r\n const thumbLeft = useMemo(() => {\r\n const track = trackRef.current\r\n const thumb = thumbRef.current\r\n const valuePercent = (props.value - min) / (max - min)\r\n\r\n if (!hasTrack || !track || !thumb) return\r\n\r\n const trackBox = track.getBoundingClientRect()\r\n const thumbBox = thumb.getBoundingClientRect()\r\n\r\n return ((valuePercent * (trackBox.width - thumbBox.width)) / trackBox.width) * 100\r\n }, [min, max, props.value, hasTrack])\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import { ButtonRoundingType, ButtonThemeType } from '../button'\r\nimport { IconNameType } from '../icon'\r\n\r\nexport enum ToolbarTheme {\r\n chipTransparent, // (default)\r\n alternative,\r\n}\r\n\r\nexport enum ToolbarDirection {\r\n vertical,\r\n horizontal,\r\n}\r\n\r\nexport type ToolbarDirectionType = keyof typeof ToolbarDirection\r\n\r\nexport interface IButtonThemeSettings {\r\n className?: string\r\n theme: ButtonThemeType\r\n rounding: ButtonRoundingType\r\n}\r\n\r\nexport interface IToolbarItem {\r\n id: string\r\n icon: IconNameType\r\n iconActive?: IconNameType\r\n iconAction?: IconNameType\r\n title: string\r\n titleActive?: string\r\n titleAction?: string\r\n}\r\n\r\nexport type ToolbarThemeType = keyof typeof ToolbarTheme\r\n","import * as React from 'react'\r\n\r\nimport { ToolbarDirection, ToolbarTheme } from './interfaces'\r\n\r\nexport interface IToolbarContext {\r\n direction: ToolbarDirection\r\n theme: ToolbarTheme\r\n isWrapped: boolean\r\n isStretched: boolean\r\n isMobile: boolean\r\n}\r\n\r\nexport const ToolbarContext = React.createContext({\r\n direction: ToolbarDirection.vertical,\r\n theme: ToolbarTheme.chipTransparent,\r\n isWrapped: false,\r\n isStretched: false,\r\n isMobile: false,\r\n})\r\n\r\nexport function useToolbarContext() {\r\n return React.useContext(ToolbarContext)\r\n}\r\n","import classnames from 'classnames'\r\nimport throttle from 'lodash.throttle'\r\nimport React from 'react'\r\n\r\nimport { isSafariDesktop } from '../../../app/shared/isMobile'\r\nimport { IToolbarContext, ToolbarContext } from './hooks'\r\nimport { ToolbarDirection, ToolbarDirectionType, ToolbarTheme, ToolbarThemeType } from './interfaces'\r\n\r\nconst getToolbarSettings = ({\r\n direction,\r\n isWrapped,\r\n isMobile,\r\n theme,\r\n}: IToolbarContext): React.HTMLProps => {\r\n switch (isWrapped) {\r\n case true:\r\n return {\r\n className: classnames('shrink-0 items-center bg-white dark:bg-gray-800', {\r\n 'flex flex-wrap justify-between': direction === ToolbarDirection.vertical,\r\n 'grid border border-gray-100 dark:border-gray-600 p-1.5 gap-1 border-box rounded-md grid-cols-2':\r\n FinvizSettings.hasRedesignEnabled,\r\n }),\r\n }\r\n\r\n default:\r\n return {\r\n className: classnames('flex shrink-0 items-center p-1.5 bg-white dark:bg-gray-800', {\r\n 'space-x-1.5 px-1.5': direction === ToolbarDirection.horizontal && FinvizSettings.hasRedesignEnabled,\r\n 'flex-col overflow-hidden overflow-y-auto [--inset-l:0.5rem] landscape-primary:pl-inset-left':\r\n direction === ToolbarDirection.vertical,\r\n 'space-y-2': direction === ToolbarDirection.vertical && !isMobile,\r\n 'pb-inset-bottom [--inset-b:0.5rem]': theme !== ToolbarTheme.alternative && !isMobile,\r\n 'w-screen space-x-2 overflow-hidden overflow-x-auto':\r\n direction === ToolbarDirection.horizontal && theme !== ToolbarTheme.alternative,\r\n 'overflow-x-hidden': theme === ToolbarTheme.alternative,\r\n 'relative z-10 rounded-md border border-gray-100 dark:border-gray-600': isMobile,\r\n }),\r\n }\r\n }\r\n}\r\n\r\nexport interface ToolbarProps {\r\n /**\r\n * Toolbar direction\r\n *\r\n * @default vertical\r\n */\r\n direction?: ToolbarDirectionType\r\n\r\n /**\r\n * Toolbar buttons theme\r\n *\r\n * @default light\r\n */\r\n theme?: ToolbarThemeType\r\n\r\n /**\r\n * Charts mobile design\r\n *\r\n * @default false\r\n */\r\n isMobile?: boolean\r\n\r\n className?: string\r\n}\r\n\r\nexport function Toolbar({\r\n direction = 'vertical',\r\n theme = 'chipTransparent',\r\n isMobile = false,\r\n children,\r\n className,\r\n}: React.PropsWithChildren) {\r\n const toolbarRef = React.useRef(null)\r\n const contextProviderValue = React.useMemo(\r\n () => ({\r\n direction: ToolbarDirection[direction],\r\n theme: ToolbarTheme[theme],\r\n isWrapped:\r\n ToolbarDirection[direction] === ToolbarDirection.vertical && ToolbarTheme[theme] === ToolbarTheme.alternative,\r\n isStretched:\r\n ToolbarDirection[direction] === ToolbarDirection.horizontal && ToolbarTheme[theme] === ToolbarTheme.alternative,\r\n isMobile,\r\n }),\r\n [direction, theme, isMobile]\r\n )\r\n const toolbarSettings = getToolbarSettings(contextProviderValue)\r\n\r\n React.useLayoutEffect(() => {\r\n // Workaround for Safari scrollbar bug https://github.com/finvizhq/charts/issues/1038\r\n // Safari injects scrollbar after layout render and doesn't trigger reflow\r\n if (ToolbarTheme[theme] !== ToolbarTheme.alternative && isSafariDesktop()) {\r\n const forceReflow = throttle(() => {\r\n if (toolbarRef.current !== null) {\r\n const originalWidth = toolbarRef.current.style.width\r\n toolbarRef.current.style.width = '0'\r\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\r\n toolbarRef.current.offsetWidth\r\n toolbarRef.current.style.width = originalWidth\r\n }\r\n }, 200)\r\n\r\n forceReflow()\r\n window.addEventListener('resize', forceReflow)\r\n\r\n return () => {\r\n window.removeEventListener('resize', forceReflow)\r\n }\r\n }\r\n }, [theme])\r\n\r\n // reason for key is that popover is sealing initial state, description in\r\n // https://github.com/finvizhq/Finviz-Website/pull/402\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button, ButtonHTMLProps, ButtonProps } from '../button'\r\nimport { Delayed } from '../delayed'\r\nimport { Icon } from '../icon'\r\nimport { Spinner } from '../spinner'\r\nimport { PropsWithAs } from '../types'\r\nimport { useToolbarContext } from './hooks'\r\nimport { IToolbarItem, ToolbarTheme } from './interfaces'\r\n\r\nfunction getButtonThemeSettings({\r\n theme,\r\n isActive,\r\n isStretched,\r\n isInAction,\r\n}: {\r\n theme: ToolbarTheme\r\n isStretched: boolean\r\n isActive?: boolean\r\n isInAction?: boolean\r\n}): Omit & ButtonProps {\r\n const includeRedesign = FinvizSettings.hasRedesignEnabled\r\n switch (theme) {\r\n case ToolbarTheme.alternative:\r\n return {\r\n className: classnames(\r\n {\r\n grow: isStretched,\r\n 'h-10 w-10': !isStretched && !includeRedesign,\r\n 'animate-pulse': isInAction,\r\n },\r\n\r\n !includeRedesign && {\r\n 'active:bg-white disabled:bg-white disabled:text-gray-300 disabled:hover:text-gray-300': true,\r\n 'border border-white text-gray-500 hover:border-gray-100 hover:text-gray-900': !isActive,\r\n 'border border-gray-900 text-gray-900': isActive,\r\n }\r\n ),\r\n theme: includeRedesign ? 'chipTransparent' : 'transparent',\r\n rounding: includeRedesign ? undefined : 'none',\r\n size: isStretched || includeRedesign ? undefined : 'none',\r\n }\r\n default:\r\n return {\r\n className: classnames(\r\n 'border dark:disabled:bg-gray-800 dark:disabled:text-gray-600 disabled:text-gray-300 disabled:bg-white dark:disabled:hover:bg-gray-800 dark:disabled:hover:text-gray-600 disabled:hover:text-gray-300 disabled:hover:bg-white',\r\n {\r\n 'animate-pulse': isInAction,\r\n 'border-transparent text-gray-500 hover:bg-gray-200/30 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-500/30 dark:hover:text-gray-200':\r\n !isActive,\r\n 'border-blue-400 bg-blue-50 text-gray-900 dark:bg-gray-700 dark:text-white': isActive,\r\n }\r\n ),\r\n theme: 'transparent',\r\n rounding: 'small',\r\n }\r\n }\r\n}\r\n\r\nexport interface ToolbarButtonProps extends Omit {\r\n item: IToolbarItem\r\n disabledTooltip?: string\r\n isInAction?: boolean\r\n isLoading?: boolean\r\n}\r\n\r\nexport function ToolbarButton({\r\n item,\r\n disabledTooltip,\r\n isInAction: isInActionProp,\r\n isLoading,\r\n ...props\r\n}: PropsWithAs & ToolbarButtonProps) {\r\n const { theme, isStretched } = useToolbarContext()\r\n const isInAction = isInActionProp && item.iconAction !== undefined\r\n const buttonSettings = getButtonThemeSettings({\r\n theme,\r\n isStretched,\r\n isActive: props.active,\r\n isInAction: isInAction,\r\n })\r\n\r\n const getMainIcon = () => (\r\n \r\n )\r\n\r\n return (\r\n & ToolbarButtonProps)}\r\n appearance={props.appearance ?? 'square'}\r\n title={props.disabled && disabledTooltip ? disabledTooltip : (props.active && item.titleActive) || item.title}\r\n size={\r\n buttonSettings.size ??\r\n (theme === ToolbarTheme.chipTransparent || FinvizSettings.hasRedesignEnabled ? 'medium' : 'large')\r\n }\r\n >\r\n {isLoading ? (\r\n \r\n \r\n \r\n ) : (\r\n <>\r\n {props.children ??\r\n (isInAction ? (\r\n \r\n \r\n \r\n ) : (\r\n getMainIcon()\r\n ))}\r\n \r\n )}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { Icon } from '../icon'\r\nimport { List, ListItem, useListState } from '../list'\r\nimport { useList } from '../list/hooks'\r\nimport { Popover, PopoverTrigger, useHoverPopover } from '../popover'\r\nimport { NativeSelect } from '../select/NativeSelect'\r\nimport { useToolbarContext } from './hooks'\r\nimport { IToolbarItem, ToolbarTheme } from './interfaces'\r\nimport { ToolbarButton } from './toolbar-button'\r\n\r\nexport interface ToolbarGroupProps {\r\n /**\r\n * Main button item\r\n */\r\n defaultItem: IToolbarItem\r\n\r\n /**\r\n * Shows spinner instead of icon\r\n */\r\n isLoading?: boolean\r\n\r\n /**\r\n * Current selected item id\r\n */\r\n isActive: boolean\r\n\r\n /**\r\n * Should indicate some action in progress\r\n */\r\n isInAction?: boolean\r\n\r\n /**\r\n * Array of items\r\n */\r\n groupItems: IToolbarItem[]\r\n\r\n /**\r\n * Expand group button label\r\n */\r\n groupTitle?: string\r\n\r\n /**\r\n * On item select callback\r\n */\r\n onChange: (id: string, trigger: 'button' | 'select' | 'group') => void\r\n\r\n /**\r\n * Use native select for mobile devices\r\n *\r\n * @default true\r\n */\r\n useNativeSelect?: boolean\r\n\r\n /**\r\n * Is item disabled\r\n */\r\n disabled?: boolean\r\n\r\n /**\r\n * Tooltip message if item is disabled\r\n */\r\n disabledTooltip?: string\r\n}\r\n\r\nexport function ToolbarGroup({\r\n defaultItem,\r\n isActive,\r\n isLoading,\r\n groupItems,\r\n groupTitle,\r\n onChange,\r\n useNativeSelect = isMobile(),\r\n disabled,\r\n disabledTooltip,\r\n}: ToolbarGroupProps) {\r\n const listState = useListState({ currentId: null })\r\n const { theme, isStretched } = useToolbarContext()\r\n const [selectedItem, setSelectedItem] = React.useState(defaultItem)\r\n const groupId = groupTitle?.replace(/\\s/g, '-').toLocaleLowerCase()\r\n const isAlternativeTheme = theme === ToolbarTheme.alternative\r\n const popoverState = useHoverPopover({\r\n placement: isAlternativeTheme && isStretched ? 'bottom' : 'right-start',\r\n })\r\n const select = useList(\r\n popoverState,\r\n selectedItem.id,\r\n groupItems?.map((i) => ({ value: i.id, label: i.title })) ?? [],\r\n (option) => {\r\n setSelectedItem(groupItems![groupItems!.findIndex((item) => item.id === option.value)])\r\n onChange(option.value, 'select')\r\n }\r\n )\r\n\r\n return (\r\n \r\n ) => {\r\n ev.preventDefault()\r\n ev.stopPropagation()\r\n onChange(selectedItem.id, 'group')\r\n }}\r\n >\r\n \r\n \r\n \r\n\r\n {useNativeSelect ? (\r\n ({ value: item.id, label: item.title }))}\r\n onChange={(option) => {\r\n setSelectedItem(groupItems![groupItems!.findIndex((item) => item.id === option.value)])\r\n onChange(option.value, 'select')\r\n }}\r\n onClick={() => onChange(selectedItem.id, 'select')}\r\n />\r\n ) : (\r\n \r\n \r\n {groupItems.map((item) => (\r\n }\r\n data-testid={`toolbar-group-${groupId}-${item.id}`}\r\n >\r\n {item.title}\r\n \r\n ))}\r\n \r\n \r\n )}\r\n \r\n )\r\n}\r\n","import { PartialBy } from '../../types'\r\nimport { ToolbarButton } from './toolbar-button'\r\nimport { ToolbarGroup, ToolbarGroupProps } from './toolbar-group'\r\n\r\nexport function ToolbarItem({\r\n defaultItem,\r\n isLoading,\r\n isActive,\r\n isInAction,\r\n groupItems,\r\n groupTitle,\r\n onChange,\r\n useNativeSelect,\r\n disabled,\r\n disabledTooltip,\r\n}: PartialBy) {\r\n const isItemActive = isActive && !disabled\r\n\r\n if (!!groupItems?.length) {\r\n return (\r\n \r\n )\r\n }\r\n\r\n return (\r\n {\r\n onChange(defaultItem.id, 'button')\r\n }}\r\n />\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { useToolbarContext } from './hooks'\r\nimport { ToolbarDirection, ToolbarTheme } from './interfaces'\r\n\r\ntype ToolbarDividerProps = {\r\n className?: string\r\n}\r\n\r\nexport function ToolbarDivider({ className }: ToolbarDividerProps) {\r\n const { direction, theme } = useToolbarContext()\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import { Box } from '../box'\r\nimport { Heading, Paragraph } from '../typography'\r\nimport { TourStep } from './types'\r\n\r\nexport function StepContent({ step }: { step: TourStep }) {\r\n return (\r\n \r\n {step.title && (\r\n \r\n {step.title}\r\n \r\n )}\r\n {step.body && {step.body}}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as ReactDOM from 'react-dom/server'\r\nimport Shepherd from 'shepherd.js'\r\n\r\nimport {\r\n BUTTON_BASE_CLASS,\r\n BUTTON_FOCUS_STYLES,\r\n ButtonPadding,\r\n ButtonRounding,\r\n ButtonSize,\r\n ButtonTheme,\r\n getButtonTheme,\r\n} from '../button'\r\nimport { StepContent } from './step-content'\r\nimport { TourDefinition, TourStep } from './types'\r\n\r\ntype ExcludesFalse = (x: T | false) => x is T\r\n\r\n/**\r\n * Async load Shepherd module when we need it\r\n */\r\nlet shepherdLibrary: typeof Shepherd\r\nexport async function loadShepherdLibrary(setLoading: (state: boolean) => void) {\r\n if (shepherdLibrary) return shepherdLibrary\r\n\r\n try {\r\n setLoading(true)\r\n const shepherdPromise = await import('shepherd.js')\r\n shepherdLibrary = shepherdPromise.default\r\n setLoading(false)\r\n\r\n return shepherdLibrary\r\n } catch {}\r\n}\r\n\r\n/**\r\n * Get buttons based on index in the step array\r\n */\r\nconst buttonClasses = classnames(BUTTON_BASE_CLASS, BUTTON_FOCUS_STYLES, ButtonSize.regular, ButtonRounding.regular)\r\nfunction getStepButtons(tour: Shepherd.Tour, step: TourStep, index: number, arr: TourStep[]) {\r\n return [\r\n {\r\n action: tour.complete,\r\n classes: classnames(buttonClasses, 'mr-auto', getButtonTheme(ButtonTheme.light).button, ButtonPadding.regular),\r\n text: 'Exit',\r\n },\r\n index > 0 && {\r\n action: tour.back,\r\n classes: classnames(buttonClasses, getButtonTheme(ButtonTheme.light).button, ButtonPadding.regular),\r\n text: step.backButton ?? 'Back',\r\n },\r\n {\r\n classes: classnames(buttonClasses, getButtonTheme(ButtonTheme.blue).button, ButtonPadding.regular),\r\n action: tour.next,\r\n text: step.nextButton ?? (index === arr.length - 1 ? 'Finish' : 'Next'),\r\n },\r\n ].filter(Boolean as unknown as ExcludesFalse)\r\n}\r\n\r\n/**\r\n * Convert tour steps to Shepherd steps\r\n */\r\nexport function processSteps(tour: Shepherd.Tour, steps: TourStep[]): Shepherd.Step.StepOptions[] {\r\n return steps.map((step, index) => ({\r\n attachTo: { element: step.target, on: step.placement ?? 'auto' },\r\n classes: 'z-dialog',\r\n // Add offset\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: 'offset',\r\n options: {\r\n offset: step.offset ?? [0, 10],\r\n },\r\n },\r\n ],\r\n },\r\n // Render the body\r\n text: ReactDOM.renderToString(React.createElement(StepContent, { step })),\r\n // Add buttons\r\n buttons: getStepButtons(tour, step, index, steps),\r\n modalOverlayOpeningRadius: step.overlayRadius ?? 8,\r\n modalOverlayOpeningPadding: step.overlayPadding ?? 0,\r\n }))\r\n}\r\n\r\nexport function getTourKey() {\r\n return `tour${window.location.pathname.replace(/[/.]/g, '-')}`\r\n}\r\n\r\nexport function getStepsForUser(tours: TourDefinition[]) {\r\n const lastFinishedTour = localStorage?.getItem(getTourKey())\r\n const lastTourIndex = tours.findIndex((tour) => tour.id === lastFinishedTour)\r\n const allToursViewed = lastTourIndex === tours.length - 1 || tours.slice(lastTourIndex + 1).every((item) => item.skip)\r\n const toursToView = allToursViewed ? tours : tours.slice(lastTourIndex + 1)\r\n const userTour = toursToView.reduce(\r\n (acc, current) =>\r\n current.skip\r\n ? acc\r\n : {\r\n ...acc,\r\n id: current.id,\r\n steps: [...acc.steps, ...current.steps],\r\n },\r\n { id: 'tour', steps: [], initialTour: toursToView[0].id }\r\n )\r\n\r\n return { hasNewTours: !allToursViewed, tour: userTour }\r\n}\r\n\r\nexport function completeTour(key: string) {\r\n localStorage?.setItem(getTourKey(), key)\r\n}\r\n","import * as React from 'react'\r\nimport Shepherd from 'shepherd.js'\r\n\r\nimport { TourDefinition } from './types'\r\nimport * as tourUtils from './utils'\r\n\r\nexport const DEFAULT_OPTIONS = {\r\n exitOnEsc: true,\r\n useModalOverlay: true,\r\n}\r\n\r\n/**\r\n * Hook which controls shepherd.js. The library is lazy-loaded when the tour starts\r\n *\r\n * Returns:\r\n * - `isLoading`: state of the library loading\r\n * - `currentTour`: tour object, only defined after library has loaded\r\n * - `startTour`: load the library and start tour. Returns `currentTour`\r\n * - `getStepsForUser`: returns a list of tour steps based on tours the user finished\r\n * - `completeTour`: persists the last finished tour to local storage\r\n */\r\nexport function useTour(options?: Shepherd.Tour.TourOptions) {\r\n const [isLoading, setIsLoading] = React.useState(false)\r\n const [currentTour, setTour] = React.useState(null)\r\n\r\n /**\r\n * We’re loading shepherd asynchronously and want to have loading state so we use\r\n * AbortController to check if the component is still mounted.\r\n */\r\n const controller = React.useRef('AbortController' in window ? new AbortController() : undefined)\r\n const loadingSetter = React.useRef((state: boolean) => {\r\n if (controller.current?.signal.aborted) return\r\n\r\n setIsLoading(state)\r\n })\r\n // Cleanup effect to abort the controller\r\n React.useEffect(() => () => controller.current?.abort(), [])\r\n\r\n const startTour = React.useCallback(\r\n async (definition: TourDefinition, setComplete = true) => {\r\n const shepherdLibrary = await tourUtils.loadShepherdLibrary(loadingSetter.current)\r\n\r\n if (shepherdLibrary && !controller.current?.signal.aborted) {\r\n const tour = currentTour ?? new shepherdLibrary.Tour({ ...DEFAULT_OPTIONS, ...options })\r\n\r\n if (!currentTour) setTour(tour)\r\n\r\n // Reset the tour steps in case they were updated\r\n Array.from(tour.steps).forEach((step) => tour.removeStep(step.id))\r\n\r\n const processedSteps = tourUtils.processSteps(tour, definition.steps)\r\n tour.addSteps(processedSteps)\r\n\r\n if (setComplete) {\r\n tourUtils.completeTour(definition.id)\r\n }\r\n\r\n tour.start()\r\n window.gtag?.('event', 'tour-start', { event_label: definition.initialTour ?? definition.id })\r\n\r\n return tour\r\n }\r\n },\r\n [currentTour, options]\r\n )\r\n\r\n return {\r\n isLoading,\r\n currentTour,\r\n startTour,\r\n getStepsForUser: tourUtils.getStepsForUser,\r\n completeTour: tourUtils.completeTour,\r\n }\r\n}\r\n","import * as Ariakit from '@ariakit/react'\r\nimport classNames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { BUTTON_DEFAULT_ELEMENT, Button, ButtonComponentProps } from '../button'\r\nimport { Icon, IconNameType, isValidIconName } from '../icon'\r\n\r\n// Must have the same keys as ButtonSize\r\nexport enum TabSpacing {\r\n xxsmall = 'space-x-0.5', // 2px spacing\r\n xsmall = 'space-x-1', // 4px spacing\r\n none = 'space-x-1.5', // 6px spacing\r\n small = 'space-x-1.5', // 6px spacing\r\n regular = 'space-x-1.5', // 6px spacing\r\n medium = 'space-x-2', // 8px spacing\r\n large = 'space-x-2', // 8px spacing\r\n}\r\n\r\nfunction getRightContent(content: JSX.Element | IconNameType | undefined, isActive: boolean) {\r\n if (isValidIconName(content)) return \r\n else if (React.isValidElement(content))\r\n return React.cloneElement(content as React.ReactElement<{ active: boolean }>, {\r\n active: isActive,\r\n })\r\n else return content\r\n}\r\n\r\nconst InternalTab = React.forwardRef(function InternalTab<\r\n TagType extends React.ElementType = typeof BUTTON_DEFAULT_ELEMENT,\r\n>(\r\n {\r\n rounding = 'none',\r\n theme = 'tab',\r\n size = 'medium',\r\n 'aria-selected': ariaSelected,\r\n children,\r\n ...props\r\n }: Omit, 'theme'>,\r\n ref: React.ForwardedRef\r\n) {\r\n const spacing = TabSpacing[size]\r\n const active = Boolean(ariaSelected)\r\n const rightContent = getRightContent(props.rightContent, active)\r\n\r\n return (\r\n )}\r\n ref={ref}\r\n active={active}\r\n theme={theme}\r\n size={size}\r\n rounding={rounding}\r\n rightContent={undefined}\r\n className={classNames('group/badge', props.className)}\r\n contentClass={classNames(spacing, 'flex', props.contentClass)}\r\n >\r\n {children}\r\n {rightContent}\r\n \r\n )\r\n})\r\n\r\nexport function Tab(\r\n props: React.PropsWithChildren>\r\n) {\r\n return } />\r\n}\r\n","import * as Ariakit from '@ariakit/react'\r\nimport classNames from 'classnames'\r\n\r\nexport function TabList(props: Ariakit.TabListProps) {\r\n return (\r\n \r\n )\r\n}\r\n","import * as Ariakit from '@ariakit/react'\r\nimport React from 'react'\r\n\r\nexport function TabPanel(props: Ariakit.TabPanelProps) {\r\n return \r\n}\r\n","import * as Ariakit from '@ariakit/react'\r\nimport React from 'react'\r\n\r\nexport function Tabs({ children }: React.PropsWithChildren) {\r\n return (\r\n \r\n
{children}
\r\n
\r\n )\r\n}\r\n","import classNames from 'classnames'\r\nimport React from 'react'\r\n\r\nenum BadgeSize {\r\n small = 'h-4 min-w-4', // 16px height\r\n medium = 'h-5 min-w-5', // 20px height\r\n}\r\ntype BadgeSizeType = keyof typeof BadgeSize\r\n\r\nenum BadgePadding {\r\n small = 'px-[5px] py-0', // 16px height\r\n medium = 'px-1.5 py-0.5', // 20px height\r\n}\r\ntype BadgePaddingType = keyof typeof BadgePadding\r\n\r\ntype BadgeProps = {\r\n size?: BadgeSizeType\r\n padding?: BadgePaddingType\r\n active?: boolean\r\n}\r\n\r\nexport function Badge({ size = 'medium', padding = size, active, children }: React.PropsWithChildren) {\r\n const badgePadding = BadgePadding[padding]\r\n const badgeSize = BadgeSize[size]\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Popover'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { usePopoverMaxHeight } from '../../hooks/use-popover-maxHeight'\r\nimport { useWindowSize } from '../../hooks/use-window-size'\r\nimport { Box, BoxProps, BoxTheme } from '../box'\r\nimport { getExtendedDialogState, useZIndex } from '../dialog'\r\nimport { TooltipArrow } from '../tooltip/tooltip-arrow'\r\nimport { PopoverStateReturn } from './hooks'\r\n\r\nexport interface PopoverProps extends BoxProps, Pick {\r\n /**\r\n * The returned object from `usePopoverState`\r\n */\r\n state: PopoverStateReturn\r\n\r\n /**\r\n * Focus the popover when it opens\r\n *\r\n * @default true\r\n */\r\n focusOnShow?: Reakit.PopoverProps['unstable_autoFocusOnShow']\r\n\r\n /**\r\n * Focus the anchor element when it closes\r\n *\r\n * @default true\r\n */\r\n focusOnHide?: Reakit.PopoverProps['unstable_autoFocusOnHide']\r\n\r\n /**\r\n * Focus the anchor element when it closes\r\n *\r\n * @default undefined\r\n */\r\n finalFocusRef?: Reakit.PopoverProps['unstable_finalFocusRef']\r\n\r\n /**\r\n * Hides when clicked outside of popover, works with changing focus from the trigger component to another one\r\n *\r\n * @default true\r\n */\r\n hideOnClickOutside?: Reakit.PopoverProps['hideOnClickOutside']\r\n\r\n /**\r\n * Overlay click callback or if false is provided, overlay click calls hide func on popover state object\r\n *\r\n * @default undefined\r\n */\r\n onOverlayClick?: (() => void) | false\r\n\r\n /**\r\n * Popover wrapper css style object\r\n *\r\n * @default undefined\r\n */\r\n popoverWrapperStyle?: React.CSSProperties\r\n\r\n /**\r\n * Show popover arrow\r\n *\r\n * @default false\r\n */\r\n hasArrow?: boolean\r\n\r\n /**\r\n * Enable or disable backdrop click events\r\n *\r\n * @default true\r\n */\r\n hasBackdrop?: boolean\r\n\r\n /**\r\n * Set the popover to height to be limited by the viewport instead of having full height\r\n *\r\n * @default false\r\n */\r\n hasViewportHeightLimit?: boolean\r\n\r\n /**\r\n * Set the popover max-width to be limited by the trigger button\r\n */\r\n hasButtonWidthLimit?: boolean\r\n\r\n /**\r\n * Can be used together with `hasViewportHeightLimit` to limit the height of the popover\r\n *\r\n * @default undefined\r\n */\r\n popoverMaxHeight?: number\r\n}\r\n\r\nexport function Popover({\r\n state,\r\n children,\r\n focusOnShow = true,\r\n focusOnHide = true,\r\n finalFocusRef,\r\n 'aria-label': ariaLabel,\r\n hide,\r\n hideOnClickOutside = true,\r\n hasArrow = false,\r\n hasBackdrop = true,\r\n onOverlayClick,\r\n popoverWrapperStyle,\r\n popoverMaxHeight = Number.MAX_SAFE_INTEGER,\r\n theme = 'light',\r\n hasViewportHeightLimit = false,\r\n hasButtonWidthLimit = false,\r\n ...props\r\n}: PopoverProps) {\r\n const zIndex = useZIndex()\r\n const { isFullyClosed } = getExtendedDialogState(state)\r\n const { innerHeight } = useWindowSize({ isWatching: !isFullyClosed })\r\n\r\n const buttonElement = state.unstable_referenceRef.current\r\n const maxHeightStyle = usePopoverMaxHeight({\r\n maxHeightLimit: popoverMaxHeight,\r\n hasViewportHeightLimit,\r\n offsets: state.offsets,\r\n state,\r\n })\r\n\r\n React.useEffect(() => {\r\n if (!buttonElement || !state.visible || !(hasViewportHeightLimit || hasButtonWidthLimit)) return\r\n\r\n const buttonRect = buttonElement.getBoundingClientRect()\r\n const popoverId = buttonElement.getAttribute('aria-controls')\r\n const popoverWrapper = popoverId ? document.getElementById(popoverId) : null\r\n\r\n // Limit popover max-width to be width of the trigger button\r\n if (hasButtonWidthLimit) {\r\n popoverWrapper?.style.setProperty('max-width', `${buttonRect.width}px`)\r\n }\r\n }, [\r\n state.visible,\r\n state.offsets,\r\n buttonElement,\r\n hasViewportHeightLimit,\r\n hasButtonWidthLimit,\r\n innerHeight,\r\n state.placement,\r\n popoverMaxHeight,\r\n ])\r\n\r\n if (isFullyClosed) return null\r\n\r\n return (\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => (\r\n <>\r\n {\r\n // prevents from page scroll when clicked outside of popover\r\n event.preventDefault()\r\n }}\r\n />\r\n \r\n \r\n {hasArrow && (\r\n \r\n \r\n \r\n )}\r\n {children}\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Popover'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport type PopoverStateReturn = ReturnType\r\n\r\nconst DEFAULT_OFFSET: [number, number] = [0, 5]\r\nconst HOVER_TIMEOUT = 150\r\n\r\nconst preventDefault = (ev: React.MouseEvent) => {\r\n ev.preventDefault()\r\n}\r\n\r\n/**\r\n * Hook which provides state to dialogs\r\n */\r\nexport function usePopoverState(settings?: Reakit.PopoverInitialState) {\r\n const offsets = (settings?.unstable_offset ?? DEFAULT_OFFSET) as [number, number]\r\n const popover = Reakit.usePopoverState({\r\n ...settings,\r\n placement: settings?.placement ?? 'bottom-start',\r\n unstable_offset: offsets,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n modal: false,\r\n })\r\n\r\n return { ...popover, offsets }\r\n}\r\n\r\nexport function useHoverPopover(settings?: Reakit.PopoverInitialState) {\r\n const popover = usePopoverState(settings)\r\n const showTimeout = React.useRef(null)\r\n const hideTimeout = React.useRef(null)\r\n\r\n const clearTimeouts = React.useRef(() => {\r\n if (showTimeout.current !== null) {\r\n window.clearTimeout(showTimeout.current)\r\n }\r\n if (hideTimeout.current !== null) {\r\n window.clearTimeout(hideTimeout.current)\r\n }\r\n })\r\n\r\n const showPopover = React.useRef(() => {\r\n clearTimeouts.current()\r\n showTimeout.current = window.setTimeout(() => {\r\n popover.show()\r\n }, HOVER_TIMEOUT)\r\n })\r\n\r\n const hidePopover = React.useRef(() => {\r\n clearTimeouts.current()\r\n hideTimeout.current = window.setTimeout(() => {\r\n popover.hide()\r\n }, HOVER_TIMEOUT)\r\n })\r\n\r\n // Unmount cleanup\r\n React.useEffect(() => () => clearTimeouts.current(), [])\r\n\r\n return {\r\n ...popover,\r\n show: showPopover.current,\r\n hide: hidePopover.current,\r\n onMouseOver: showPopover.current,\r\n onMouseOut: hidePopover.current,\r\n onMouseDown: preventDefault,\r\n }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Popover'\r\n\r\nimport { useZIndex } from '../dialog'\r\n\r\ninterface PopoverButtonProps extends Reakit.PopoverDisclosureHTMLProps {\r\n state: Reakit.PopoverStateReturn\r\n as?: React.ElementType\r\n}\r\n/**\r\n * The trigger button component which handles ref & focus return, etc.\r\n */\r\nexport const PopoverTrigger = React.forwardRef(\r\n ({ state, ...props }: PopoverButtonProps, ref: React.ForwardedRef) => {\r\n const zIndex = useZIndex()\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n }\r\n)\r\n","import * as React from 'react'\r\nimport { useNavigate } from 'react-router-dom'\r\n\r\nimport { SelectItem, SelectItemGroup } from './types'\r\nimport { flattenItems, isSelectItemGroup } from './utils'\r\n\r\ninterface NativeSelectProps extends Omit, 'onChange'> {\r\n items: ItemType[]\r\n onChange?: (item: ItemType) => void\r\n}\r\n\r\nexport function NativeSelect | SelectItem>({\r\n items,\r\n onChange,\r\n placeholder = 'Select value',\r\n ...props\r\n}: NativeSelectProps) {\r\n const showPlaceholder = props.value === -1\r\n const handleNativeSelectChange = React.useCallback(\r\n (e: React.ChangeEvent) => {\r\n const itemIndex = e.target.selectedIndex + (showPlaceholder ? -1 : 0)\r\n const selectedItem = flattenItems(items)[itemIndex] as SelectItem\r\n\r\n if (!selectedItem) return\r\n\r\n onChange?.(selectedItem as any)\r\n\r\n if (!selectedItem.href || !selectedItem.reloadDocument) {\r\n return\r\n }\r\n\r\n if (typeof selectedItem.href === 'string') {\r\n window.location.href = selectedItem.href\r\n return\r\n }\r\n\r\n const newUrl = new URL(selectedItem.href.pathname!, window.location.href)\r\n newUrl.search = selectedItem.href.search ?? ''\r\n newUrl.hash = selectedItem.href.hash ?? ''\r\n\r\n window.location.href = newUrl.toString()\r\n },\r\n [items, onChange, showPlaceholder]\r\n )\r\n\r\n return (\r\n \r\n {showPlaceholder && }\r\n {items.map((item, itemIndex) => {\r\n if (isSelectItemGroup(item)) {\r\n return (\r\n \r\n {item.items.map((option, optionIndex) => (\r\n \r\n ))}\r\n \r\n )\r\n }\r\n\r\n return (\r\n \r\n )\r\n })}\r\n \r\n )\r\n}\r\n\r\nexport function NativeSelectInRouterContext | SelectItem>(\r\n props: NativeSelectProps\r\n) {\r\n const navigate = useNavigate()\r\n\r\n const onChangeWithNavigate = React.useCallback(\r\n (item: SelectItem) => {\r\n props.onChange?.(item as any)\r\n\r\n if (item.href) navigate(item.href)\r\n },\r\n // We don’t need the whole props here, just onChange and items\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [navigate, props.onChange, props.items]\r\n )\r\n\r\n return \r\n}\r\n","import * as Ariakit from '@ariakit/react'\r\nimport classNames from 'classnames'\r\nimport * as React from 'react'\r\n\r\ninterface ItemsGroupProps extends Omit, 'ref' | 'label'> {\r\n /**\r\n * Group label\r\n */\r\n label?: string\r\n}\r\n\r\nexport const ItemsGroup = React.forwardRef(function ItemsGroup(\r\n { label, children, ...props }: React.PropsWithChildren,\r\n ref: React.ForwardedRef\r\n) {\r\n return (\r\n \r\n {label && {label}}\r\n {children}\r\n \r\n )\r\n})\r\n","import * as Ariakit from '@ariakit/react'\r\nimport classNames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { BUTTON_DEFAULT_ELEMENT, Button, ButtonComponentProps, ButtonPadding, ButtonThemeType } from '../button'\r\n\r\ninterface InternalOptionProps {\r\n /**\r\n * Description for the option\r\n */\r\n subtitle?: React.ReactNode\r\n\r\n /**\r\n * Set the button theme when it is selected\r\n */\r\n activeTheme?: ButtonThemeType\r\n\r\n /**\r\n * Set the base button theme when not selected\r\n */\r\n theme?: ButtonThemeType | ((isHovered: boolean) => ButtonThemeType)\r\n}\r\n\r\nfunction getDefaultTheme(isHovered: boolean) {\r\n return isHovered ? 'menuItem' : 'menuItemTransparent'\r\n}\r\n\r\nconst InternalOption = React.forwardRef(function InternalOption<\r\n TagType extends React.ElementType = typeof BUTTON_DEFAULT_ELEMENT,\r\n>(\r\n {\r\n subtitle,\r\n children,\r\n 'aria-selected': ariaSelected,\r\n 'data-active-item': dataActiveItem,\r\n rounding = 'small',\r\n activeTheme = 'blue',\r\n theme = getDefaultTheme,\r\n ...props\r\n }: Omit, 'theme'> & InternalOptionProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const isSelected = ariaSelected === true\r\n const isHovered = dataActiveItem === true\r\n const defaultTheme = typeof theme === 'function' ? theme(isHovered) : theme\r\n\r\n return (\r\n )}\r\n ref={ref}\r\n align=\"left\"\r\n className={classNames(props.className, ButtonPadding.regular, 'select-none', {\r\n 'text-2xs': !!subtitle && !props.theme,\r\n })}\r\n contentClass={classNames(props.contentClass, 'font-normal')}\r\n rounding={rounding}\r\n active={props.active ?? (isHovered && !isSelected)}\r\n theme={isSelected ? activeTheme : defaultTheme}\r\n size={props.size ?? (subtitle ? 'none' : props.size)}\r\n aria-selected={ariaSelected}\r\n data-active-item={dataActiveItem}\r\n >\r\n {children}\r\n {subtitle && (\r\n \r\n {subtitle}\r\n \r\n )}\r\n \r\n )\r\n})\r\n\r\ninterface SelectOptionProps extends InternalOptionProps {\r\n value: ValueType\r\n}\r\n\r\nexport const SelectOption = React.forwardRef(function SelectOption<\r\n ValueType,\r\n TagType extends React.ElementType = typeof BUTTON_DEFAULT_ELEMENT,\r\n>(\r\n { as, ...props }: Omit, 'value' | 'theme'> & SelectOptionProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const context = Ariakit.useSelectContext()!\r\n const isComboBox = !!context.combobox\r\n\r\n return (\r\n } /> : }\r\n />\r\n )\r\n})\r\n","import { SelectRenderer, SelectRendererItemProps } from '@ariakit/react-core/select/select-renderer'\r\nimport classNames from 'classnames'\r\nimport * as React from 'react'\r\nimport { useInRouterContext } from 'react-router-dom'\r\n\r\nimport { ButtonRoundingType } from '../button'\r\nimport { ItemsGroup } from './ItemsGroup'\r\nimport { SelectOption } from './SelectOption'\r\nimport { SelectItem, SelectItemGroup } from './types'\r\nimport { filterSelectOptions, getSelectItemProps, isSelectItem } from './utils'\r\n\r\ninterface SelectItemsVirtualizedProps {\r\n hasGroups: boolean\r\n itemRenderer: (item: SelectItem, providedProps?: any) => React.ReactNode\r\n}\r\n\r\nfunction SelectItemsVirtualized(props: SelectItemsVirtualizedProps) {\r\n return (\r\n \r\n {({ value: groupOritem, index, label, ...restProps }: any) => {\r\n if (isSelectItem(groupOritem)) {\r\n return props.itemRenderer(groupOritem, { key: index, ...restProps })\r\n }\r\n\r\n return (\r\n (\r\n \r\n {rendererProps.children}\r\n \r\n )}\r\n >\r\n {({ value, index, ...restItem }: SelectRendererItemProps<{ value: SelectItem }>) =>\r\n props.itemRenderer(value, { key: index, ...restItem })\r\n }\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n\r\ninterface SelectItemsProps {\r\n searchValue: string\r\n items?: ItemType[]\r\n rounding?: ButtonRoundingType\r\n parentTestId?: string\r\n}\r\n\r\nexport function SelectItems | SelectItemGroup>({\r\n items,\r\n rounding,\r\n searchValue,\r\n parentTestId,\r\n virtualized,\r\n}: SelectItemsProps & { virtualized?: boolean }) {\r\n const isInRouterContext = useInRouterContext()\r\n const filteredItems = React.useMemo(() => filterSelectOptions(items, searchValue), [items, searchValue])\r\n\r\n const getItem = React.useCallback(\r\n (innerItem: SelectItem, providedProps?: any) => (\r\n \r\n {innerItem.label}\r\n \r\n ),\r\n [isInRouterContext, parentTestId, rounding, virtualized]\r\n )\r\n\r\n if (!filteredItems.length) {\r\n return
Nothing to select
\r\n }\r\n\r\n if (virtualized) {\r\n const hasGroups = isSelectItem(items?.[0]) === false\r\n return \r\n }\r\n\r\n return (\r\n <>\r\n {filteredItems.map((item, index) => {\r\n if (isSelectItem(item)) {\r\n return getItem(item, { key: index })\r\n }\r\n\r\n return (\r\n \r\n {item.items.map((item, itemIndex) => getItem(item, { key: itemIndex }))}\r\n \r\n )\r\n })}\r\n \r\n )\r\n}\r\n","import * as Ariakit from '@ariakit/react'\r\nimport classNames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Input } from '../input'\r\n\r\nenum ListRounding {\r\n none = '',\r\n regular = 'rounded-lg',\r\n}\r\n\r\nenum ListTheme {\r\n none = '',\r\n default = 'border border-primary bg-primary',\r\n}\r\n\r\nfunction focusWithoutScroll(element: HTMLElement | null) {\r\n element?.focus({ preventScroll: true })\r\n\r\n return !element\r\n}\r\n\r\nfunction onBackdropClick(ev: React.MouseEvent) {\r\n ev.preventDefault()\r\n}\r\n\r\nexport interface SelectListProps {\r\n /**\r\n * Internal prop which enables input at the top of the popover list\r\n */\r\n isComboBox?: boolean\r\n\r\n /**\r\n * Set rounding for the popover list\r\n *\r\n * @default regular\r\n */\r\n rounding?: keyof typeof ListRounding\r\n\r\n /**\r\n * Popover theme\r\n */\r\n theme?: keyof typeof ListTheme\r\n\r\n /**\r\n * The amount of space between button and its popover\r\n *\r\n * @default 4\r\n */\r\n gutter?: number\r\n\r\n /**\r\n * Change how the items are laid out\r\n *\r\n * @default vertical\r\n */\r\n orientation?: 'vertical' | 'horizontal'\r\n\r\n /**\r\n * Custom popover class\r\n */\r\n className?: string\r\n\r\n /**\r\n * Internal prop used to display no results when automatic `item` filtering doesn’t return any items\r\n */\r\n hasItemChildren?: boolean\r\n\r\n /**\r\n * Do not render the items when the popover is not visible\r\n *\r\n * @default false\r\n */\r\n unmountOnHide?: boolean\r\n}\r\n\r\nexport function SelectList({\r\n isComboBox,\r\n rounding = 'regular',\r\n theme = 'default',\r\n gutter = 4,\r\n orientation = 'vertical',\r\n className,\r\n unmountOnHide = false,\r\n hasItemChildren,\r\n children,\r\n}: React.PropsWithChildren) {\r\n const ListElement = React.useMemo(\r\n () => (isComboBox ? Ariakit.ComboboxList : (wrapperProps: any) =>
),\r\n [isComboBox]\r\n )\r\n const context = Ariakit.useSelectContext()!\r\n const placement = context.useState('currentPlacement')\r\n const hasChildren = hasItemChildren || React.Children.count(children) > 0\r\n\r\n return (\r\n }\r\n className={classNames(\r\n className,\r\n ListRounding[rounding],\r\n ListTheme[theme],\r\n 'custom-scrollbar absolute z-dialog flex flex-col overflow-hidden shadow-modal outline-none dark:shadow-modal-dark',\r\n // These are set by popper, we just need to make sure we don’t encroach on the safe insets\r\n 'min-w-[--popover-anchor-width] max-w-[--popover-available-width]',\r\n // Animations\r\n 'opacity-0 transition duration-[250ms] data-[enter]:translate-y-0 data-[enter]:opacity-100',\r\n {\r\n // When in combobox mode, the padding is smaller so we can render a gradient under the combobox input.\r\n // Change the custom scrollbar offset so the top of the first item fits the top of our scrollbar\r\n '[--scrollbar-offset-top:theme(spacing.1)]': isComboBox,\r\n '[--scrollbar-radius:0]': ListRounding[rounding] === ListRounding.none,\r\n // Direction based styles\r\n 'max-h-[calc(var(--popover-available-height)-env(safe-area-inset-bottom))] motion-safe:-translate-y-1':\r\n placement.startsWith('bottom'),\r\n 'max-h-[calc(var(--popover-available-height)-env(safe-area-inset-top))] motion-safe:translate-y-1':\r\n placement.startsWith('top'),\r\n }\r\n )}\r\n >\r\n {isComboBox && (\r\n
\r\n
\r\n \r\n }\r\n />\r\n
\r\n
\r\n
\r\n )}\r\n \r\n {hasChildren ? children :
Nothing to select
}\r\n \r\n \r\n )\r\n}\r\n","import * as Ariakit from '@ariakit/react'\r\nimport * as React from 'react'\r\n\r\nimport { notifyOnVisibilityChange } from '../../../app/shared/documentVisibility'\r\nimport { Tooltip, TooltipTrigger, useTooltipState } from '../tooltip'\r\n\r\nexport function SelectTooltip({ content, children }: { content: React.ReactNode; children: JSX.Element }) {\r\n const tooltipState = useTooltipState({ placement: 'bottom', showTimeout: 300 })\r\n const context = Ariakit.useSelectContext()\r\n const isSelectOpen = context?.useState('open')\r\n const hasShownTooltip = React.useRef(false)\r\n\r\n React.useEffect(() => {\r\n if (isSelectOpen) hasShownTooltip.current = true\r\n }, [isSelectOpen])\r\n\r\n /**\r\n * Ignore focus re-trigger (do not show tooltip) when page visibility/focus state changes\r\n * - some browsers re-trigger focus on `activeElement` when document becomes visible\r\n */\r\n React.useEffect(() => {\r\n const subscription = notifyOnVisibilityChange((visible) => {\r\n if (!visible) tooltipState?.hide()\r\n })\r\n return () => {\r\n subscription.unsubscribe()\r\n }\r\n // Changing this to `tooltip` dependency will run this effect on every render\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [])\r\n\r\n return (\r\n <>\r\n {\r\n // Do not open again unless user focuses the button again (or presses another ESC)\r\n if (hasShownTooltip.current) ev.preventDefault()\r\n hasShownTooltip.current = false\r\n }}\r\n />\r\n {content}\r\n \r\n )\r\n}\r\n\r\nexport function SelectTooltipWrapper({ content, children }: { content?: React.ReactNode; children: JSX.Element }) {\r\n if (!content) return null\r\n\r\n return {children}\r\n}\r\n","import * as Ariakit from '@ariakit/react'\r\nimport { Placement } from '@popperjs/core'\r\nimport * as React from 'react'\r\n\r\nimport { SelectButtonProps } from './SelectButton'\r\nimport { SelectItems } from './SelectItems'\r\nimport { SelectList, SelectListProps } from './SelectList'\r\nimport { SelectTooltipWrapper } from './SelectTooltipWrapper'\r\nimport { SelectItem, SelectItemGroup } from './types'\r\nimport { isSelectItem } from './utils'\r\n\r\nexport interface DesktopSelectProps\r\n extends Omit<\r\n SelectButtonProps,\r\n // Fix clash with `button` element html props\r\n 'value' | 'defaultValue' | 'onChange' | 'label' | 'name' | 'valueOverride'\r\n >,\r\n Pick {\r\n /**\r\n * Name of the select which coudl be used to distinguish onChange events.\r\n * Passed as 2nd argument to `onChange`\r\n */\r\n name?: Name\r\n\r\n /**\r\n * Set value for the select\r\n */\r\n value?: ValueType\r\n\r\n /**\r\n * Set default value for an uncontrolled select\r\n */\r\n defaultValue?: ValueType\r\n\r\n /**\r\n * Label to display above the select\r\n */\r\n label?: React.ReactNode\r\n\r\n /**\r\n * Callback when item changes. Called for both controlled and uncontrolled selects\r\n */\r\n onChange?: (\r\n item: ItemType extends SelectItemGroup\r\n ? ValueType extends SelectItem\r\n ? ValueType\r\n : SelectItem\r\n : ItemType,\r\n name: Name\r\n ) => void\r\n\r\n /**\r\n * Options to select from. When defined, the options are constructed automatically\r\n * so you don’t have to pass children to the select.\r\n *\r\n * When `nativeSelect` is set to \"mobile\", children take precedence on desktop\r\n */\r\n items?: ItemType[]\r\n\r\n /**\r\n * Enable virtualization of select items to improve performance of long lists\r\n *\r\n * @default items.length > 50\r\n */\r\n virtualized?: boolean\r\n\r\n /**\r\n * Custom button renderer for the select\r\n */\r\n trigger?: JSX.Element\r\n\r\n /**\r\n * Text for the button (usually the selected value). Falls back to placeholder if not set\r\n */\r\n triggerContent?: React.ReactNode\r\n\r\n /**\r\n * Show tooltip on the select\r\n */\r\n tooltip?: React.ReactNode\r\n\r\n /**\r\n * Popover placement\r\n *\r\n * @default \"bottom-start\"\r\n */\r\n placement?: Placement\r\n\r\n /**\r\n * Change the direction of the items placement in popover\r\n *\r\n * @default vertical\r\n */\r\n orientation?: 'vertical' | 'horizontal'\r\n\r\n /**\r\n * Set whether or not the Select is interactive to save resources. If not interactive,\r\n * the select only renders a placeholder button\r\n *\r\n * @default true\r\n */\r\n isInteractive?: boolean\r\n\r\n /**\r\n * Callback when the select opens or closes\r\n */\r\n onInteractionChange?: (open: boolean) => void\r\n\r\n /**\r\n * ### Only applicable for desktop selects without `children`, when passing `items`.\r\n * ### If you want to pass `children`, use the `onSearch` prop instead.\r\n *\r\n * Specifies whether or not to show a search input inside of the popover. Number\r\n * specifies the >= number of items after which search will be visible.\r\n * Search is made for both value and label props\r\n *\r\n * @default 10\r\n */\r\n comboBox?: boolean | number\r\n\r\n /**\r\n * ### Only applicable for desktop selects with `children`.\r\n * ### Use `comboBox` if you have `items` prop\r\n * When defined, the select is considered being a combobox and will display\r\n * input for filtering items. The filtering is up to the user.\r\n */\r\n onSearch?: (value: string) => void\r\n\r\n /**\r\n * When combined with `items` the children will automatically have testid assigned.\r\n * Otherwise just passed to the trigger button\r\n */\r\n 'data-testid'?: string\r\n\r\n listProps?: SelectListProps\r\n}\r\n\r\nfunction getCollectionItem(item: SelectItem, index: number) {\r\n return {\r\n id: `item-${index}-${String(item.value).replace(/\\W/g, '')}`,\r\n label: item.label,\r\n value: item,\r\n children: item.label,\r\n }\r\n}\r\n\r\nexport function DesktopSelect<\r\n ValueType,\r\n ItemType extends SelectItem | SelectItemGroup,\r\n Name = never,\r\n>({\r\n name,\r\n label,\r\n value,\r\n defaultValue,\r\n onChange,\r\n items,\r\n virtualized = (items?.length ?? 0) > 50,\r\n trigger,\r\n tooltip,\r\n onInteractionChange,\r\n comboBox,\r\n onSearch,\r\n children,\r\n gutter,\r\n placement = 'bottom-start',\r\n orientation,\r\n listProps,\r\n ...props\r\n}: React.PropsWithChildren>) {\r\n // Used when `items` are passed to construct a desktop select with comboBox\r\n const [internalSearch, setInternalSearch] = React.useState('')\r\n\r\n // Setup combobox if enabled\r\n const isComboBox =\r\n !!onSearch || comboBox === true || (typeof comboBox === 'number' && !!items && items.length > comboBox)\r\n const SelectWrapper = isComboBox ? Ariakit.ComboboxProvider : React.Fragment\r\n const wrapperProps = React.useMemo(\r\n () =>\r\n isComboBox ? { resetValueOnHide: true, includesBaseElement: false, setValue: onSearch ?? setInternalSearch } : {},\r\n [isComboBox, onSearch]\r\n )\r\n\r\n // Handle tooltip prop\r\n const ButtonWrapper = tooltip ? SelectTooltipWrapper : React.Fragment\r\n const buttonWrapperProps = React.useMemo(() => (tooltip ? { content: tooltip } : {}), [tooltip])\r\n\r\n if (isComboBox && !!children && !onSearch) {\r\n console.warn(\r\n 'ComboBoxes with children options require `onSearch` prop, otherwise searching will not work. \\n Either provide `onSearch` or disable this behavior by passing `comboBox={false}`'\r\n )\r\n }\r\n\r\n const listItems = React.useMemo(\r\n () =>\r\n items?.map((item, index) =>\r\n isSelectItem(item) ? getCollectionItem(item, index) : { ...item, items: item.items.map(getCollectionItem) }\r\n ) as ItemType[],\r\n [items]\r\n )\r\n\r\n return (\r\n \r\n {/* @ts-expect-error - The types are wrong here, the select allows any values, not just strings or ints */}\r\n \r\n // Loop to the first item after pressing arrow down on last item\r\n focusLoop\r\n virtualFocus\r\n value={value}\r\n defaultValue={defaultValue ?? ''}\r\n // Item will always be of ItemType\r\n setValue={(item) => setTimeout(() => onChange?.(item as any, name!), 50)}\r\n setOpen={onInteractionChange}\r\n placement={placement}\r\n orientation={orientation}\r\n defaultItems={listItems}\r\n >\r\n {label && {label}}\r\n\r\n \r\n \r\n \r\n\r\n \r\n {/* Either construct options from children or provided items prop */}\r\n {children ?? (\r\n \r\n )}\r\n \r\n \r\n \r\n )\r\n}\r\n","import * as Ariakit from '@ariakit/react'\r\nimport classNames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button, ButtonHTMLProps, ButtonProps, ButtonSize } from '../button'\r\nimport { Delayed } from '../delayed'\r\nimport { Icon, IconNameType, isValidIconName } from '../icon'\r\nimport { Spinner } from '../spinner'\r\nimport { SelectItem } from './types'\r\nimport { isSelectItem } from './utils'\r\n\r\ntype ValueType = SelectItem | string\r\n\r\nconst DEFAULT_RIGHT_ICON = 'caretDown'\r\n\r\nexport interface SelectButtonProps extends Omit, Omit {\r\n /**\r\n * Show a spinner in place of the button caret. The spinner is wrapped in Delayed\r\n * and uses the default timeout\r\n */\r\n isLoading?: boolean\r\n\r\n /**\r\n * Placeholder when no value is selected\r\n */\r\n placeholder?: string\r\n\r\n /**\r\n * Override for the select value from context. Used to provide value for native\r\n * select trigger\r\n */\r\n valueOverride?: ValueType\r\n\r\n rightContent?: boolean | IconNameType | JSX.Element\r\n}\r\n\r\nexport const SelectButton = React.forwardRef>(\r\n function SelectButton(\r\n {\r\n isLoading,\r\n placeholder = 'Select value',\r\n children,\r\n valueOverride,\r\n theme = 'outline',\r\n rightContent = DEFAULT_RIGHT_ICON,\r\n ...props\r\n },\r\n ref\r\n ) {\r\n const context = Ariakit.useSelectContext()\r\n const contextValue = context?.useState('value') as ValueType\r\n const isOpen = context?.useState('open')\r\n const selectedValue = valueOverride ?? contextValue\r\n\r\n let buttonText = placeholder\r\n if (isSelectItem(selectedValue)) buttonText = selectedValue.label ?? selectedValue.value\r\n else if (typeof selectedValue === 'string' && selectedValue.length) buttonText = selectedValue\r\n else if (selectedValue) buttonText = String(selectedValue)\r\n\r\n const rightIcon =\r\n isValidIconName(rightContent) || rightContent === true ? (\r\n \r\n ) : React.isValidElement(rightContent) ? (\r\n rightContent\r\n ) : undefined\r\n\r\n return (\r\n \r\n \r\n \r\n ) : (\r\n rightIcon\r\n )\r\n }\r\n >\r\n {children ?? buttonText}\r\n \r\n )\r\n }\r\n)\r\n","import * as React from 'react'\r\nimport { useInRouterContext } from 'react-router-dom'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { DesktopSelect, DesktopSelectProps } from './DesktopSelect'\r\nimport { NativeSelect, NativeSelectInRouterContext } from './NativeSelect'\r\nimport { SelectButton } from './SelectButton'\r\nimport { SelectItem } from './types'\r\nimport { findSelectedIndex, findSelectedValue } from './utils'\r\n\r\nconst isMobileDevice = isMobile()\r\n\r\nexport interface SelectProps extends DesktopSelectProps {\r\n /**\r\n * Whether or not to show a native select when clicking the button.\r\n * When rendering native select, you must provide `items`, `value` and `onChange`\r\n *\r\n * @default false\r\n */\r\n nativeSelect?: boolean | 'mobile'\r\n}\r\n\r\nexport function Select({\r\n name,\r\n label,\r\n value: providedValue,\r\n defaultValue: providedDefaultValue,\r\n onChange,\r\n items,\r\n trigger,\r\n gutter,\r\n orientation,\r\n triggerContent,\r\n isInteractive = true,\r\n onInteractionChange,\r\n nativeSelect = false,\r\n comboBox = 10,\r\n onSearch,\r\n 'data-testid': dataTestid,\r\n listProps,\r\n virtualized,\r\n ...props\r\n}: React.PropsWithChildren>) {\r\n // Used by native select to handle navigation for link items\r\n const isInRouterContext = useInRouterContext()\r\n // Let users either provide the selected item or its value. Items can also be grouped so we need to find the correct value\r\n const value = findSelectedValue(items, providedValue) ?? providedValue\r\n const defaultValue = findSelectedValue(items, providedDefaultValue) ?? providedDefaultValue\r\n\r\n // Extracted trigger to a variable because it is used in every branch\r\n const selectTrigger = trigger ?? (\r\n ) : undefined\r\n }\r\n data-testid={dataTestid}\r\n >\r\n {triggerContent}\r\n \r\n )\r\n\r\n // Save some resources by rendering the trigger only\r\n if (!isInteractive) {\r\n return selectTrigger\r\n }\r\n\r\n const renderNativeSelect = nativeSelect === true || (nativeSelect === 'mobile' && isMobileDevice)\r\n if (renderNativeSelect) {\r\n const NativeSelectComponent = isInRouterContext ? NativeSelectInRouterContext : NativeSelect\r\n const selectedIndex = findSelectedIndex(items, providedValue ?? providedDefaultValue)\r\n\r\n return (\r\n
\r\n {selectTrigger}\r\n
\r\n )\r\n }\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import { Link } from 'react-router-dom'\r\n\r\nimport { SelectItem, SelectItemGroup } from './types'\r\n\r\nexport function getSelectItemProps(item: SelectItem, inRouterContext?: boolean) {\r\n if (item.href) {\r\n if (inRouterContext) return { as: Link, to: item.href, reloadDocument: item.reloadDocument }\r\n else return { as: 'a', href: item.href }\r\n }\r\n\r\n return {}\r\n}\r\n\r\nexport function isSelectItem(item: unknown): item is SelectItem {\r\n return !!(item?.hasOwnProperty('label') && item?.hasOwnProperty('value')) && !item?.hasOwnProperty('items')\r\n}\r\n\r\nexport function isSelectItemGroup(item: unknown): item is SelectItemGroup {\r\n return !!item?.hasOwnProperty('items')\r\n}\r\n\r\nfunction matchesSearchTerm(item: SelectItem, searchTerm: string) {\r\n const lowerSearch = searchTerm.toLowerCase()\r\n\r\n return (\r\n (typeof item.value === 'string' && item.value.toLowerCase().includes(lowerSearch)) ||\r\n item.label.toLowerCase().includes(lowerSearch)\r\n )\r\n}\r\n\r\nfunction isSameItem(obj1: unknown, obj2?: unknown) {\r\n if (isSelectItem(obj1) && isSelectItem(obj2)) return obj1.value === obj2.value\r\n else if (isSelectItem(obj1)) return obj1.value === obj2\r\n return obj1 === obj2\r\n}\r\n\r\n/**\r\n * Used in combobox to find matching items\r\n */\r\nexport function filterSelectOptions | SelectItemGroup>(\r\n items: ItemType[] | undefined,\r\n searchTerm: string\r\n) {\r\n const finalResults: ItemType[] = []\r\n\r\n items?.forEach((item) => {\r\n if (isSelectItemGroup(item)) {\r\n const filtered = item.items.filter((option) => matchesSearchTerm(option, searchTerm))\r\n if (filtered.length) finalResults.push({ ...item, items: filtered })\r\n } else if (matchesSearchTerm(item, searchTerm)) {\r\n finalResults.push(item)\r\n }\r\n })\r\n\r\n return finalResults\r\n}\r\n\r\n/**\r\n * Used in select to allow users to pass any kind of valid value\r\n */\r\nexport function findSelectedValue(\r\n items: ItemType[] = [],\r\n value?: ValueType | SelectItem\r\n) {\r\n for (const item of items) {\r\n if (isSelectItemGroup(item)) {\r\n const foundItem = item.items.find((option) => isSameItem(option, value)) as SelectItem\r\n if (foundItem) return foundItem\r\n } else if (isSameItem(item, value)) {\r\n return item as SelectItem\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Used for native selects to match against user provided value\r\n */\r\nexport function findSelectedIndex(\r\n items: ItemType[] = [],\r\n value?: ValueType | SelectItem\r\n) {\r\n for (let index = 0; index < items.length; index++) {\r\n const item = items[index]\r\n\r\n if (isSelectItemGroup(item)) {\r\n const itemIndex = item.items.findIndex((option) => isSameItem(option, value))\r\n if (itemIndex > -1) return `${index}${itemIndex}`\r\n } else if (isSameItem(item, value)) {\r\n return index\r\n }\r\n }\r\n\r\n return -1\r\n}\r\n\r\nexport function flattenItems(items: ItemType[]) {\r\n return items.flatMap((itemOrGroup) =>\r\n isSelectItemGroup(itemOrGroup) ? (itemOrGroup.items as ItemType[]) : itemOrGroup\r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { Link, To } from 'react-router-dom'\r\n\r\nimport { TIMEFRAME } from '../../constants'\r\nimport { ButtonRoundingType, ButtonSizeType } from '../button'\r\nimport { DropdownSeparator } from '../dropdown'\r\nimport { Icon } from '../icon'\r\nimport { Select, SelectOption } from '../select'\r\nimport { SelectItem } from '../select/types'\r\n\r\nexport interface DateRangeBaseOption extends SelectItem {\r\n timeframe?: TIMEFRAME\r\n href?: To\r\n withReload?: boolean\r\n}\r\n\r\ninterface Props {\r\n chartIndex: number\r\n dateRangeGroups: Array<{ label?: string; dateRanges: DateRange[] }>\r\n selectedDateRange: string | null\r\n onDateRangeSelect: (value: DateRange) => void\r\n onCustomDateRangeClick?: () => void\r\n rounding?: ButtonRoundingType\r\n size?: ButtonSizeType\r\n}\r\n\r\nconst DATERANGE_TOOLTIP = 'Range'\r\n\r\nexport function DateRangeSelect({\r\n size,\r\n chartIndex,\r\n dateRangeGroups,\r\n selectedDateRange,\r\n onDateRangeSelect,\r\n onCustomDateRangeClick,\r\n rounding,\r\n}: Props) {\r\n const flatDateRanges = React.useMemo(() => dateRangeGroups.flatMap(({ dateRanges }) => dateRanges), [dateRangeGroups])\r\n\r\n return (\r\n {\r\n onDateRangeSelect(flatDateRanges.find((item) => item.value === value)!)\r\n }}\r\n rounding={rounding}\r\n appearance=\"square\"\r\n theme=\"chip\"\r\n size={size}\r\n triggerContent={}\r\n rightContent={false}\r\n active={selectedDateRange ? true : undefined}\r\n data-testid={`chart-${chartIndex}-date-range-select`}\r\n >\r\n {dateRangeGroups.flatMap(({ label, dateRanges }, index) => [\r\n {label},\r\n ...dateRanges.map(({ href, value, label, withReload, timeframe }) => {\r\n let linkProps = {}\r\n if (href) {\r\n linkProps = {\r\n as: Link,\r\n to: href,\r\n reloadDocument: withReload ?? !FinvizSettings.hasUserPremium,\r\n }\r\n }\r\n return (\r\n {\r\n if (!timeframe) onCustomDateRangeClick?.()\r\n }}\r\n >\r\n {label}\r\n \r\n )\r\n }),\r\n ])}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Delayed } from '../delayed'\r\nimport { Spinner } from '../spinner'\r\n\r\ninterface Props {\r\n label: React.ReactNode\r\n isLoading: boolean\r\n}\r\n\r\nexport function LabelWithDelayedSpinner({ label, isLoading }: Props) {\r\n return (\r\n <>\r\n {label}\r\n {isLoading && (\r\n
\r\n {label}}>\r\n \r\n \r\n
\r\n )}\r\n \r\n )\r\n}\r\n","import classNames from 'classnames'\r\nimport * as React from 'react'\r\nimport { Link, To } from 'react-router-dom'\r\n\r\nimport { Button, ButtonProps, ButtonRoundingType, ButtonSizeType } from '../button'\r\nimport { DropdownSeparator } from '../dropdown'\r\nimport { Icon } from '../icon'\r\nimport { SelectItem } from '../select'\r\nimport { Select, SelectOption } from '../select'\r\nimport { LabelWithDelayedSpinner } from './label-with-delayed-spinner'\r\n\r\nexport type TimeframeBaseOption = SelectItem & {\r\n labelShort?: string\r\n labelPageTitle?: string\r\n href?: To\r\n withReload?: boolean\r\n}\r\n\r\ninterface Props {\r\n chartIndex: number\r\n isCompactView: boolean\r\n isCompactOnly: boolean\r\n timeFrameGroups: Array<{ label: string; timeframes: TimeFrame[] }>\r\n selectedTimeframe: string\r\n onTimeframeSelect: (value: TimeFrame) => void\r\n favoriteTimeframes: string[]\r\n onFavoriteTimeframeToggle: (value: TimeFrame) => void\r\n rounding?: ButtonRoundingType\r\n size?: ButtonSizeType\r\n isLoading?: boolean\r\n isFavoritesEnabled: boolean\r\n theme?: ButtonProps['theme']\r\n}\r\n\r\nconst TIMEFRAME_TOOLTIP = 'Interval'\r\n\r\nexport function TimeframeSelect({\r\n size,\r\n chartIndex,\r\n timeFrameGroups,\r\n selectedTimeframe,\r\n favoriteTimeframes,\r\n isLoading = false,\r\n isCompactView,\r\n isCompactOnly,\r\n onTimeframeSelect,\r\n onFavoriteTimeframeToggle,\r\n rounding,\r\n isFavoritesEnabled,\r\n theme = 'chip',\r\n}: Props) {\r\n const flatTimeframes = React.useMemo(() => timeFrameGroups.flatMap(({ timeframes }) => timeframes), [timeFrameGroups])\r\n\r\n const getSelectedTimeframeLabel = React.useCallback(() => {\r\n if (isCompactView) {\r\n const selectedTimeframeItem = flatTimeframes.find(({ value }) => value === selectedTimeframe)\r\n return selectedTimeframeItem?.labelShort ?? selectedTimeframeItem?.label\r\n }\r\n return ''\r\n }, [flatTimeframes, isCompactView, selectedTimeframe])\r\n\r\n return (\r\n item.value === selectedTimeframe)}\r\n leftContent={\r\n
\r\n } isLoading={isLoading && isCompactView} />\r\n
\r\n }\r\n onChange={(item) => onTimeframeSelect(item as TimeFrame)}\r\n data-testid={`chart-${chartIndex}-timeframe-select`}\r\n >\r\n {timeFrameGroups.flatMap(({ timeframes }, groupIndex) => [\r\n ,\r\n ...timeframes.map((item) => {\r\n const isIconButtonActive = favoriteTimeframes.includes(item.value)\r\n let linkProps = {}\r\n if (item.href) {\r\n linkProps = {\r\n as: Link,\r\n to: item.href,\r\n reloadDocument: !!item.withReload,\r\n }\r\n }\r\n return (\r\n ) => {\r\n ev.stopPropagation()\r\n ev.preventDefault()\r\n onFavoriteTimeframeToggle(item)\r\n }}\r\n className={classNames('group -mr-2', {\r\n 'text-gray-300': !isIconButtonActive,\r\n 'text-yellow-200': isIconButtonActive,\r\n })}\r\n >\r\n \r\n \r\n \r\n ) : undefined\r\n }\r\n >\r\n {item.label}\r\n \r\n )\r\n }),\r\n ])}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport { Link } from 'react-router-dom'\r\n\r\nimport { useElementMeasure } from '../../hooks/use-element-measure'\r\nimport { Button, ButtonPadding, ButtonProps, ButtonRoundingType, ButtonSize, ButtonSizeType } from '../button'\r\nimport { DateRangeBaseOption, DateRangeSelect } from './daterange-select'\r\nimport { LabelWithDelayedSpinner } from './label-with-delayed-spinner'\r\nimport { TimeframeBaseOption, TimeframeSelect } from './timeframe-select'\r\n\r\ninterface Props {\r\n isPremium?: boolean\r\n chartIndex?: number\r\n compactViewMaxBreakpointPx?: number\r\n timeFrameGroups: Array<{ label: string; timeframes: TimeFrame[] }>\r\n dateRangeGroups: Array<{ label?: string; dateRanges: DateRange[] }>\r\n selectedTimeframe: string\r\n selectedDateRange: string | null\r\n onTimeframeSelect: (value: TimeFrame) => void\r\n onDateRangeSelect: (value: DateRange) => void\r\n onCustomDateRangeClick?: () => void\r\n favoriteTimeframes: string[]\r\n onFavoriteTimeframeToggle: (value: TimeFrame) => void\r\n size?: ButtonSizeType\r\n loadingTimeframe?: string\r\n rounding?: ButtonRoundingType\r\n isDateRangeAvailable?: boolean\r\n containerElement?: HTMLElement\r\n className?: string\r\n isFavoritesEnabled?: boolean\r\n isScrollIntoViewEnabled?: boolean\r\n isTimeframeSelectEnabled?: boolean\r\n isCompactOnly?: boolean\r\n theme?: ButtonProps['theme']\r\n}\r\n\r\nfunction getTimeframeChipElementId({ timeframe, chartIndex }: { timeframe: string; chartIndex: number }) {\r\n return `${chartIndex}-${timeframe}`\r\n}\r\n\r\nfunction getButtonPadding(size: ButtonSize): keyof typeof ButtonPadding {\r\n switch (size) {\r\n case ButtonSize.xxsmall:\r\n case ButtonSize.xsmall:\r\n case ButtonSize.small:\r\n case ButtonSize.regular:\r\n return 'small'\r\n case ButtonSize.medium:\r\n return 'regular'\r\n case ButtonSize.large:\r\n return 'medium'\r\n case ButtonSize.none:\r\n return 'none'\r\n }\r\n}\r\n\r\nexport function TimeframeBar({\r\n isPremium = FinvizSettings.hasUserPremium,\r\n chartIndex = 0,\r\n compactViewMaxBreakpointPx = 400,\r\n timeFrameGroups,\r\n dateRangeGroups,\r\n selectedTimeframe,\r\n selectedDateRange,\r\n favoriteTimeframes,\r\n loadingTimeframe,\r\n onTimeframeSelect,\r\n onDateRangeSelect,\r\n onCustomDateRangeClick,\r\n onFavoriteTimeframeToggle,\r\n size,\r\n rounding,\r\n isDateRangeAvailable = true,\r\n containerElement,\r\n className,\r\n isFavoritesEnabled = true,\r\n isScrollIntoViewEnabled = true,\r\n isTimeframeSelectEnabled,\r\n isCompactOnly = false,\r\n theme,\r\n}: Props) {\r\n const [scrollWrapperElement, setScrollWrapperElement] = React.useState(null)\r\n const [timeframeButtonsScrollLocation, setTimeframeButtonsScrollLocation] = React.useState({\r\n isOnLeftEdge: true,\r\n isOnRightEdge: true,\r\n })\r\n const { setElementRef, elementWidth } = useElementMeasure(containerElement)\r\n const flatTimeframes = React.useMemo(() => timeFrameGroups.flatMap(({ timeframes }) => timeframes), [timeFrameGroups])\r\n\r\n const timeframesInExpandedPanel = React.useMemo(\r\n () =>\r\n isFavoritesEnabled\r\n ? flatTimeframes.filter(({ value }) => value === selectedTimeframe || favoriteTimeframes.includes(value))\r\n : flatTimeframes,\r\n [flatTimeframes, selectedTimeframe, favoriteTimeframes, isFavoritesEnabled]\r\n )\r\n\r\n const isCompactView =\r\n isCompactOnly || elementWidth < compactViewMaxBreakpointPx || timeframesInExpandedPanel.length <= 1\r\n const checkTimeframeWrapperScrollPosition = React.useCallback(() => {\r\n if (scrollWrapperElement) {\r\n const isOnLeftEdge = scrollWrapperElement.scrollLeft === 0\r\n const isOnRightEdge =\r\n Math.ceil(scrollWrapperElement.offsetWidth + scrollWrapperElement.scrollLeft) >=\r\n scrollWrapperElement.scrollWidth\r\n\r\n if (\r\n timeframeButtonsScrollLocation.isOnLeftEdge !== isOnLeftEdge ||\r\n timeframeButtonsScrollLocation.isOnRightEdge !== isOnRightEdge\r\n ) {\r\n setTimeframeButtonsScrollLocation({ isOnLeftEdge, isOnRightEdge })\r\n }\r\n }\r\n }, [timeframeButtonsScrollLocation, scrollWrapperElement])\r\n\r\n React.useEffect(() => {\r\n checkTimeframeWrapperScrollPosition()\r\n }, [checkTimeframeWrapperScrollPosition, scrollWrapperElement, elementWidth])\r\n\r\n React.useEffect(() => {\r\n if (!isCompactView && isScrollIntoViewEnabled) {\r\n const timeframeElement = document.getElementById(\r\n getTimeframeChipElementId({ chartIndex, timeframe: selectedTimeframe })\r\n )\r\n\r\n if (timeframeElement && scrollWrapperElement) {\r\n const leftOffset =\r\n timeframeElement.offsetLeft + timeframeElement.clientWidth / 2 - scrollWrapperElement.clientWidth / 2\r\n\r\n scrollWrapperElement.scrollTo(Math.max(0, Math.min(leftOffset, scrollWrapperElement.scrollWidth)), 0)\r\n }\r\n }\r\n }, [isCompactView, chartIndex, selectedTimeframe, elementWidth, isScrollIntoViewEnabled, scrollWrapperElement])\r\n\r\n return (\r\n \r\n {(isTimeframeSelectEnabled ?? isFavoritesEnabled) && (\r\n
\r\n \r\n
\r\n )}\r\n {!isCompactView && (\r\n
\r\n \r\n {\r\n /*\r\n * Vertical scrolling doesn't scroll horizontally by default (it's possible when holding shift)\r\n * When using touchpad we may get values in both delatX and deltaY, so if someone's scrolling horizontally we don't want to do anything\r\n * but if they are scrolling vertically (deltaY > deltaX) we want to scroll horizontally the value they would nativally scroll in vertical direction\r\n * */\r\n const absDx = Math.abs(event.deltaX)\r\n const absDy = Math.abs(event.deltaY)\r\n if (absDy > absDx) {\r\n event.currentTarget.scrollLeft += event.deltaY\r\n }\r\n }}\r\n >\r\n {timeframesInExpandedPanel.map((timeframe) => {\r\n let linkProps = {}\r\n if (timeframe.href) {\r\n linkProps = {\r\n as: Link,\r\n to: timeframe.href,\r\n reloadDocument: timeframe.withReload ?? !isPremium,\r\n onClick: () => onTimeframeSelect(timeframe),\r\n }\r\n } else {\r\n linkProps = {\r\n onClick: (ev: React.MouseEvent) => {\r\n ev.preventDefault()\r\n onTimeframeSelect(timeframe)\r\n },\r\n }\r\n }\r\n return (\r\n \r\n \r\n \r\n )\r\n })}\r\n
\r\n \r\n
\r\n )}\r\n {isDateRangeAvailable && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n )\r\n}\r\n","import { type To } from 'react-router-dom'\r\n\r\nimport { decodeQueryString, encodeQueryString } from '../../../app/queryString'\r\nimport { SpecificChartFunctionality, TIMEFRAME } from '../../constants'\r\nimport { DateRangeType, Instrument } from '../../types'\r\nimport { CUSTOM_DATE_RANGE, CustomDateRangePrefixEnum, DATE_RANGE_PREFIX_DELMITER } from './custom-date-range-utils'\r\n\r\ninterface ITimeFrame {\r\n value: TIMEFRAME | 'intraday'\r\n label: string\r\n labelShort: string\r\n labelPageTitle?: string\r\n}\r\n\r\nexport interface ITimeframeGroup {\r\n label: string\r\n timeframes: ITimeFrame[]\r\n}\r\n\r\ninterface IDateRange {\r\n value: string\r\n label: string\r\n timeframe?: TIMEFRAME\r\n}\r\n\r\nexport interface IRangeGroup {\r\n label?: string\r\n dateRanges: IDateRange[]\r\n}\r\n\r\nexport const generateTimeframeGroups = (isPremium = true): ITimeframeGroup[] => {\r\n const premiumTimeframes: ITimeframeGroup[] = [\r\n {\r\n label: '',\r\n timeframes: [\r\n { value: TIMEFRAME.i1, label: '1 Minute', labelShort: '1M' },\r\n { value: TIMEFRAME.i2, label: '2 Minutes', labelShort: '2M' },\r\n { value: TIMEFRAME.i3, label: '3 Minutes', labelShort: '3M' },\r\n { value: TIMEFRAME.i5, label: '5 Minutes', labelShort: '5M' },\r\n { value: TIMEFRAME.i10, label: '10 Minutes', labelShort: '10M' },\r\n { value: TIMEFRAME.i15, label: '15 Minutes', labelShort: '15M' },\r\n { value: TIMEFRAME.i30, label: '30 Minutes', labelShort: '30M' },\r\n ],\r\n },\r\n {\r\n label: '',\r\n timeframes: [\r\n { value: TIMEFRAME.h, label: '1 Hour', labelShort: '1H', labelPageTitle: 'Hourly' },\r\n { value: TIMEFRAME.h2, label: '2 Hours', labelShort: '2H' },\r\n { value: TIMEFRAME.h4, label: '4 Hours', labelShort: '4H' },\r\n ],\r\n },\r\n {\r\n label: '',\r\n timeframes: [\r\n { value: TIMEFRAME.d, label: '1 Day', labelShort: 'D', labelPageTitle: 'Daily' },\r\n { value: TIMEFRAME.w, label: '1 Week', labelShort: 'W', labelPageTitle: 'Weekly' },\r\n { value: TIMEFRAME.m, label: '1 Month', labelShort: 'M', labelPageTitle: 'Monthly' },\r\n ],\r\n },\r\n ]\r\n\r\n const freeTimeframes = [\r\n {\r\n // intradayTimeframe is only for non premium users used as redirect to elite subscription\r\n label: '',\r\n timeframes: [{ value: 'intraday' as const, label: 'Intraday', labelShort: 'Intraday' }],\r\n },\r\n {\r\n label: '',\r\n timeframes: [\r\n { value: TIMEFRAME.d, label: '1 Day', labelShort: 'Daily' },\r\n { value: TIMEFRAME.w, label: '1 Week', labelShort: 'Weekly' },\r\n { value: TIMEFRAME.m, label: '1 Month', labelShort: 'Monthly' },\r\n ],\r\n },\r\n ]\r\n\r\n return isPremium ? premiumTimeframes : freeTimeframes\r\n}\r\n\r\nexport function getTimeframeGroups(isPremium: boolean) {\r\n return generateTimeframeGroups(isPremium)\r\n}\r\n\r\nexport const generateDateRangeGroups = ({\r\n isPremium,\r\n instrument,\r\n}: {\r\n isPremium: boolean\r\n instrument: Instrument\r\n}): IRangeGroup[] => {\r\n const isStock = instrument === Instrument.Stock\r\n const rangeGroups: Array<{ label?: string; dateRanges: IDateRange[] }> = [\r\n {\r\n label: 'Days',\r\n dateRanges: [\r\n { value: DateRangeType.d1, label: '1 Day', timeframe: isStock ? TIMEFRAME.i1 : TIMEFRAME.i5 },\r\n { value: DateRangeType.d5, label: '5 Days', timeframe: isStock ? TIMEFRAME.i5 : TIMEFRAME.i30 },\r\n ],\r\n },\r\n {\r\n label: 'Months',\r\n dateRanges: [\r\n { value: DateRangeType.m1, label: '1 Month', timeframe: TIMEFRAME.d },\r\n { value: DateRangeType.m3, label: '3 Months', timeframe: TIMEFRAME.d },\r\n { value: DateRangeType.m6, label: '6 Months', timeframe: TIMEFRAME.d },\r\n ],\r\n },\r\n {\r\n label: 'Years',\r\n dateRanges: [\r\n { value: DateRangeType.ytd, label: 'Year to Date', timeframe: TIMEFRAME.d },\r\n { value: DateRangeType.y1, label: '1 Year', timeframe: TIMEFRAME.d },\r\n { value: DateRangeType.y2, label: '2 Years', timeframe: TIMEFRAME.w },\r\n { value: DateRangeType.y5, label: '5 Years', timeframe: isPremium ? TIMEFRAME.w : TIMEFRAME.m },\r\n { value: DateRangeType.max, label: 'Max', timeframe: TIMEFRAME.m },\r\n ],\r\n },\r\n ]\r\n\r\n return rangeGroups\r\n}\r\n\r\nexport function getDateRangeGroups({\r\n isPremium,\r\n customRange,\r\n isCustomAvailable = true,\r\n instrument,\r\n}: {\r\n isPremium: boolean\r\n customRange?: string\r\n isCustomAvailable?: boolean\r\n instrument: Instrument\r\n}) {\r\n const rangeGroups = generateDateRangeGroups({ isPremium, instrument })\r\n\r\n if (isPremium && isCustomAvailable !== false) {\r\n const [dateRangePrefix] = customRange?.split(DATE_RANGE_PREFIX_DELMITER) ?? []\r\n rangeGroups.push({\r\n dateRanges: [\r\n {\r\n value:\r\n customRange && Object.values(CustomDateRangePrefixEnum).includes(dateRangePrefix)\r\n ? customRange\r\n : CUSTOM_DATE_RANGE,\r\n label: 'Custom',\r\n },\r\n ],\r\n })\r\n }\r\n\r\n return rangeGroups\r\n}\r\n\r\nexport function getDateRangeGroupsWithHref({\r\n isPremium,\r\n customRange,\r\n generatePath,\r\n withReload,\r\n isCustomAvailable,\r\n instrument,\r\n}: {\r\n isPremium: boolean\r\n isCustomAvailable?: boolean\r\n customRange?: string\r\n withReload?: boolean\r\n instrument: Instrument\r\n generatePath: (dateRange: IDateRange) => To\r\n}) {\r\n return getDateRangeGroups({\r\n isPremium,\r\n isCustomAvailable,\r\n customRange,\r\n instrument,\r\n }).map((dateRangeGroup: IRangeGroup) => ({\r\n label: dateRangeGroup.label,\r\n dateRanges: dateRangeGroup.dateRanges.map((dateRange) => ({\r\n ...dateRange,\r\n href:\r\n !isPremium || Object.values(DateRangeType).includes(dateRange.value as DateRangeType)\r\n ? generatePath(dateRange)\r\n : undefined,\r\n withReload: withReload ?? !isPremium,\r\n })),\r\n }))\r\n}\r\n\r\nconst FREE_PERIODS_STOCK = ['d', 'w', 'm']\r\n\r\nexport function generatePathForTimeframeDateRange({\r\n isPremium,\r\n pathname,\r\n timeframe,\r\n dateRange,\r\n utmCampaign,\r\n freeTimeframes = FREE_PERIODS_STOCK,\r\n dateRangeQueryKey = 'r',\r\n}: {\r\n isPremium: boolean\r\n pathname: string\r\n timeframe: TIMEFRAME | 'intraday'\r\n dateRange?: string | null\r\n utmCampaign?: string\r\n freeTimeframes?: string[]\r\n dateRangeQueryKey?: string\r\n}) {\r\n if (isPremium || freeTimeframes.includes(timeframe)) {\r\n return {\r\n pathname,\r\n search: `?${encodeQueryString({\r\n ...decodeQueryString(),\r\n i: undefined,\r\n p: timeframe,\r\n [dateRangeQueryKey]: dateRange ?? undefined,\r\n })}`,\r\n }\r\n }\r\n\r\n return {\r\n pathname: '/elite.ashx',\r\n search: `?${encodeQueryString({\r\n utm_source: 'finviz',\r\n utm_medium: 'banner',\r\n utm_campaign: utmCampaign || window.location.pathname,\r\n })}`,\r\n }\r\n}\r\n\r\nexport const timeframeUtm: Partial> = {\r\n [SpecificChartFunctionality.quotePage]: 'quote-timeframe',\r\n [SpecificChartFunctionality.futuresPage]: 'futures-timeframe',\r\n [SpecificChartFunctionality.forexPage]: 'forex-timeframe',\r\n [SpecificChartFunctionality.cryptoPage]: 'crypto-timeframe',\r\n}\r\n\r\nexport const daterangeUtm: Partial> = {\r\n [SpecificChartFunctionality.futuresPage]: 'futures-timeframe-daterange',\r\n [SpecificChartFunctionality.forexPage]: 'forex-timeframe-daterange',\r\n [SpecificChartFunctionality.cryptoPage]: 'crypto-timeframe-daterange',\r\n}\r\n","import * as dateFns from 'date-fns'\r\n\r\nimport { formatDateToStringUS } from '../../../app/shared/utils'\r\nimport { TIMEFRAME } from '../../constants'\r\nimport { Instrument } from '../../types'\r\nimport { generateDateRangeGroups } from './utils'\r\n\r\n// **************START**************\r\n// Functions from here until END have to be in sync with\r\n// charts: app/utils/chart-date-range-utils.ts\r\n// *********************************\r\n\r\nexport enum CustomDateRangePrefixEnum {\r\n Range = 'range',\r\n Prev = 'prev',\r\n}\r\n\r\nexport const CUSTOM_DATE_RANGE = 'custom'\r\nexport const DATE_RANGE_PREFIX_DELMITER = '_'\r\nconst CUSTOM_DATE_RANGE_DELIMITER = 'x'\r\nconst CUSTOM_PREV_RANGE_DELIMITER = '-'\r\n\r\nexport function getParsedDateRange(dateRange?: string) {\r\n return dateRange?.split(DATE_RANGE_PREFIX_DELMITER) ?? []\r\n}\r\n\r\nexport function parseCustomDateRangeUrlParam({ dateRange, anchorDate }: { dateRange: string; anchorDate: Date }) {\r\n const [dateRangePrefix, dateRangeValue] = getParsedDateRange(dateRange)\r\n\r\n if (dateRangePrefix === CustomDateRangePrefixEnum.Range) {\r\n const [dateFromString, dateToString] = dateRangeValue.replace(/-/g, '/').split(CUSTOM_DATE_RANGE_DELIMITER)\r\n const dateFrom = dateFromString ? new Date(dateFromString) : null\r\n const dateTo = dateToString ? new Date(dateToString) : null\r\n return {\r\n start: dateFrom && !Number.isNaN(dateFrom.getTime()) ? dateFrom : null,\r\n end: dateTo && !Number.isNaN(dateTo.getTime()) ? dateFns.endOfDay(dateTo) : null,\r\n }\r\n }\r\n\r\n if (dateRangePrefix === CustomDateRangePrefixEnum.Prev) {\r\n const [years, months, days] = dateRangeValue.split(CUSTOM_PREV_RANGE_DELIMITER).map(Number)\r\n\r\n if ([years, months, days].some(Number.isNaN)) {\r\n return { start: null, end: null }\r\n }\r\n\r\n return {\r\n start: dateFns.startOfDay(dateFns.sub(anchorDate, { years, months, days: days - 1 })),\r\n end: anchorDate,\r\n }\r\n }\r\n\r\n return { start: null, end: anchorDate }\r\n}\r\n\r\n// **************END**************\r\n// Functions below don't need to be\r\n// in sync with Website repository\r\n// *******************************\r\n\r\nconst DAYS_IN_YEAR = 365\r\n\r\nexport function getCustomStartEndDateRangeUrlParam({ start, end }: { start: Date | null; end: Date | null }) {\r\n const startString = start ? formatDateToStringUS(start) : ''\r\n const endString = end ? formatDateToStringUS(end) : ''\r\n\r\n const stringParts = [\r\n CustomDateRangePrefixEnum.Range,\r\n DATE_RANGE_PREFIX_DELMITER,\r\n startString,\r\n CUSTOM_DATE_RANGE_DELIMITER,\r\n endString,\r\n ]\r\n\r\n return stringParts.join('').replace(/\\//g, '-')\r\n}\r\n\r\nexport function getPrevPeriodDateRangeUrlParam({\r\n years,\r\n months,\r\n days,\r\n}: {\r\n years: number\r\n months: number\r\n days: number\r\n}) {\r\n const stringParts = [\r\n CustomDateRangePrefixEnum.Prev,\r\n DATE_RANGE_PREFIX_DELMITER,\r\n years,\r\n CUSTOM_PREV_RANGE_DELIMITER,\r\n months,\r\n CUSTOM_PREV_RANGE_DELIMITER,\r\n days,\r\n ]\r\n\r\n return stringParts.join('')\r\n}\r\n\r\nexport function getTimeframeForDateRangeType({\r\n dateRange,\r\n isPremium = true,\r\n instrument,\r\n}: {\r\n dateRange: string\r\n isPremium?: boolean\r\n instrument: Instrument\r\n}) {\r\n const dateRanges = generateDateRangeGroups({ isPremium, instrument }).flatMap(({ dateRanges }) => dateRanges)\r\n return dateRanges.find(({ value }) => value === dateRange)?.timeframe ?? null\r\n}\r\n\r\nexport function getTimeframeFromDateRange({\r\n dateRange,\r\n anchorDate,\r\n instrument,\r\n isPremium,\r\n}: {\r\n dateRange: string\r\n anchorDate: Date\r\n instrument: Instrument\r\n isPremium: boolean\r\n}) {\r\n const dateRangeTimeframe = getTimeframeForDateRangeType({ dateRange, instrument })\r\n if (dateRangeTimeframe) {\r\n return dateRangeTimeframe\r\n }\r\n const { start, end } = parseCustomDateRangeUrlParam({ dateRange, anchorDate })\r\n const startNyTime = start ?? new Date(0)\r\n const startToReferenceDateNumOfDays = dateFns.differenceInCalendarDays(anchorDate, startNyTime) + 1\r\n const rangeNumOfDays = dateFns.differenceInCalendarDays(end ?? anchorDate, startNyTime) + 1\r\n /**\r\n * DB_BARS_LIMIT - code below is dependent on amount of data we store for specific timeframes\r\n * Search DB_BARS_LIMIT in the project to find other places with such code.\r\n */\r\n if (rangeNumOfDays > 6 * DAYS_IN_YEAR) {\r\n return TIMEFRAME.m\r\n }\r\n\r\n if (rangeNumOfDays > 4 * DAYS_IN_YEAR) {\r\n return isPremium ? TIMEFRAME.w : TIMEFRAME.m\r\n }\r\n\r\n if (rangeNumOfDays > 1.5 * DAYS_IN_YEAR) {\r\n return TIMEFRAME.w\r\n }\r\n\r\n // Keep these values in sync with values in FetchQuoteIntraday in quote.cs\r\n if (instrument === Instrument.Stock) {\r\n if (rangeNumOfDays <= 1 && startToReferenceDateNumOfDays <= 11) {\r\n return TIMEFRAME.i1\r\n }\r\n\r\n if (rangeNumOfDays <= 5 && startToReferenceDateNumOfDays <= 16) {\r\n return TIMEFRAME.i5\r\n }\r\n\r\n if (rangeNumOfDays <= 7 && startToReferenceDateNumOfDays <= 200) {\r\n return TIMEFRAME.i30\r\n }\r\n } else {\r\n if (startToReferenceDateNumOfDays <= 2) {\r\n return TIMEFRAME.i5\r\n }\r\n if (startToReferenceDateNumOfDays <= 7) {\r\n return TIMEFRAME.i30\r\n }\r\n }\r\n\r\n return TIMEFRAME.d\r\n}\r\n","import * as dateFns from 'date-fns'\r\nimport * as React from 'react'\r\n\r\nimport { formatDateToStringUS } from '../../../app/shared/utils'\r\nimport { Button } from '../button'\r\nimport { ButtonGroup } from '../button-group'\r\nimport { DatePicker } from '../date-picker'\r\nimport { Delayed } from '../delayed'\r\nimport { Dialog, DialogBody, DialogDismiss, DialogFooter, DialogHeader } from '../dialog'\r\nimport { Input } from '../input'\r\nimport { Spinner } from '../spinner'\r\nimport {\r\n CustomDateRangePrefixEnum,\r\n getCustomStartEndDateRangeUrlParam,\r\n getParsedDateRange,\r\n getPrevPeriodDateRangeUrlParam,\r\n parseCustomDateRangeUrlParam,\r\n} from './custom-date-range-utils'\r\n\r\nconst DATA_YEAR_START = 1980\r\nconst DATE_PICKER_MIN_DATE = new Date(`01/01/${DATA_YEAR_START}`)\r\nconst YEARS_MAX_VALUE = new Date().getFullYear() - DATA_YEAR_START\r\n\r\nconst TAB_BUTTON_COMMON_PROPS = { type: 'button', className: 'flex-1', contentClass: 'text-center' } as const\r\n\r\nexport enum CustomRangeType {\r\n StartEnd,\r\n Manual,\r\n}\r\n\r\ninterface StartEndRange {\r\n kind: CustomRangeType.StartEnd\r\n start: Date | null\r\n end: Date | null\r\n}\r\n\r\ninterface ManualRange {\r\n kind: CustomRangeType.Manual\r\n days?: number\r\n months?: number\r\n years?: number\r\n}\r\n\r\nexport type CustomDateRangeType = StartEndRange | ManualRange\r\n\r\ninterface DialogContentProps {\r\n /**\r\n * Dialog state\r\n */\r\n dialogState: any\r\n dateRange?: string\r\n anchorDate: Date\r\n onDialogSubmit: (args: { dateRange: string | null }) => void\r\n isFetching?: boolean\r\n}\r\n\r\nconst DEFAULT_MANUAL_RANGE: ManualRange = {\r\n kind: CustomRangeType.Manual,\r\n days: 0,\r\n months: 0,\r\n years: 0,\r\n}\r\n\r\nconst DEFAULT_START_END_RANGE: StartEndRange = {\r\n kind: CustomRangeType.StartEnd,\r\n start: null,\r\n end: null,\r\n}\r\n\r\nfunction isValidManualRangeState({ years = 0, months = 0, days = 0 }: ManualRange) {\r\n return years + months + days > 0\r\n}\r\n\r\nfunction isValidStartEndRangeState({ start, end }: StartEndRange) {\r\n return !!(start || end)\r\n}\r\n\r\nfunction getDefaultSelectedTab(dateRange?: string) {\r\n if (dateRange) {\r\n const [dateRangePrefix] = getParsedDateRange(dateRange)\r\n if (dateRangePrefix === CustomDateRangePrefixEnum.Range) {\r\n return CustomRangeType.StartEnd\r\n }\r\n if (dateRangePrefix === CustomDateRangePrefixEnum.Prev) {\r\n return CustomRangeType.Manual\r\n }\r\n }\r\n return CustomRangeType.StartEnd\r\n}\r\n\r\nfunction getDefaultSelectedDate({\r\n dateRange,\r\n anchorDate,\r\n}: {\r\n dateRange?: string\r\n anchorDate: Date\r\n}): CustomDateRangeType {\r\n if (dateRange) {\r\n const [dateRangePrefix] = getParsedDateRange(dateRange)\r\n const { start, end } = parseCustomDateRangeUrlParam({ dateRange, anchorDate })\r\n if (dateRangePrefix === CustomDateRangePrefixEnum.Range) {\r\n return { kind: CustomRangeType.StartEnd, start, end }\r\n }\r\n if (dateRangePrefix === CustomDateRangePrefixEnum.Prev && start && end) {\r\n const { years, months, days } = dateFns.intervalToDuration({\r\n start: dateFns.sub(start, { days: 1 }),\r\n end,\r\n })\r\n return { kind: CustomRangeType.Manual, years, months, days }\r\n }\r\n }\r\n\r\n return DEFAULT_START_END_RANGE\r\n}\r\n\r\nexport function CustomDateRange({\r\n dialogState,\r\n dateRange,\r\n anchorDate,\r\n onDialogSubmit,\r\n isFetching,\r\n}: DialogContentProps) {\r\n const [selectedTab, setSelectedTab] = React.useState(getDefaultSelectedTab(dateRange))\r\n\r\n const [state, setState] = React.useState(getDefaultSelectedDate({ dateRange, anchorDate }))\r\n\r\n const { current: onChange } = React.useRef((kind: CustomRangeType, newValue: Partial) => {\r\n setState((prevState) => {\r\n if (kind === CustomRangeType.Manual) {\r\n const defaults = prevState?.kind === CustomRangeType.Manual ? prevState : DEFAULT_MANUAL_RANGE\r\n return { ...defaults, ...newValue } as ManualRange\r\n }\r\n if (kind === CustomRangeType.StartEnd) {\r\n const defaults = prevState?.kind === CustomRangeType.StartEnd ? prevState : DEFAULT_START_END_RANGE\r\n\r\n const newState = { ...defaults, ...newValue }\r\n if (newState.start && newState.end && newState.start.getTime() > newState.end.getTime()) {\r\n const newEnd = new Date(newState.start.getTime())\r\n newState.start = newState.end\r\n newState.end = newEnd\r\n }\r\n return newState\r\n }\r\n return prevState\r\n })\r\n })\r\n\r\n const handleSubmit = (ev: React.FormEvent) => {\r\n ev.preventDefault()\r\n\r\n let dateRange = null\r\n\r\n if (state?.kind === CustomRangeType.StartEnd && isValidStartEndRangeState(state)) {\r\n dateRange = getCustomStartEndDateRangeUrlParam({ start: state.start, end: state.end })\r\n } else if (state?.kind === CustomRangeType.Manual && isValidManualRangeState(state)) {\r\n dateRange = getPrevPeriodDateRangeUrlParam({\r\n days: state.days ?? 0,\r\n months: state.months ?? 0,\r\n years: state.years ?? 0,\r\n })\r\n }\r\n\r\n onDialogSubmit({ dateRange })\r\n }\r\n\r\n const isAbsolute = state?.kind === CustomRangeType.StartEnd\r\n const fromDate = isAbsolute ? state.start : DEFAULT_START_END_RANGE.start\r\n const toDate = isAbsolute ? state.end : DEFAULT_START_END_RANGE.end\r\n\r\n const manualRange = {\r\n ...DEFAULT_MANUAL_RANGE,\r\n ...(state?.kind === CustomRangeType.Manual ? state : {}),\r\n }\r\n\r\n return (\r\n \r\n Custom Date Range\r\n
\r\n \r\n \r\n setSelectedTab(CustomRangeType.StartEnd)}\r\n >\r\n Start / End\r\n \r\n setSelectedTab(CustomRangeType.Manual)}\r\n >\r\n Range\r\n \r\n \r\n\r\n {selectedTab === CustomRangeType.StartEnd ? (\r\n
\r\n onChange(CustomRangeType.StartEnd, { start })}\r\n >\r\n \r\n \r\n onChange(CustomRangeType.StartEnd, { end })}\r\n >\r\n \r\n \r\n
\r\n ) : (\r\n
\r\n ) =>\r\n onChange(CustomRangeType.Manual, { years: Number.parseInt(ev.currentTarget.value) })\r\n }\r\n />\r\n ) =>\r\n onChange(CustomRangeType.Manual, { months: Number.parseInt(ev.currentTarget.value) })\r\n }\r\n />\r\n ) =>\r\n onChange(CustomRangeType.Manual, { days: Number.parseInt(ev.currentTarget.value) })\r\n }\r\n />\r\n
\r\n )}\r\n
\r\n \r\n
\r\n \r\n setState(state.kind === CustomRangeType.Manual ? DEFAULT_MANUAL_RANGE : DEFAULT_START_END_RANGE)\r\n }\r\n >\r\n Reset\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n )\r\n}\r\n","import React from 'react'\r\nimport { To, useNavigate } from 'react-router-dom'\r\n\r\nimport { TIMEFRAME } from '../../constants'\r\nimport { Instrument } from '../../types'\r\nimport { useDialogState } from '../dialog'\r\nimport { getTimeframeFromDateRange } from './custom-date-range-utils'\r\n\r\ninterface IPathForTimeframeDateRangeProps {\r\n timeframe: TIMEFRAME | 'intraday'\r\n dateRange?: string | null\r\n ticker?: string\r\n}\r\n\r\ninterface IUseCustomDateRangeDialogSubmitProps {\r\n anchorDate?: Date\r\n instrument?: Instrument\r\n shouldReloadOnNavigate?: boolean\r\n pathGenerator?: ({ ticker, timeframe, dateRange }: IPathForTimeframeDateRangeProps) => {\r\n pathname: string\r\n search: string\r\n }\r\n}\r\n\r\nexport function useCustomDateRangeDialog({\r\n anchorDate,\r\n instrument,\r\n pathGenerator,\r\n shouldReloadOnNavigate = false,\r\n}: IUseCustomDateRangeDialogSubmitProps) {\r\n const navigate = useNavigate()\r\n const customDateRangeDialogState = useDialogState()\r\n\r\n const isPremium = FinvizSettings.hasUserPremium\r\n\r\n const handleDateRangeSelect = React.useCallback(\r\n (\r\n { value, timeframe, href }: { value: string; timeframe?: TIMEFRAME; href?: To },\r\n callback?: ({ value, timeframe, href }: { value: string; timeframe: TIMEFRAME; href?: To }) => void\r\n ) => {\r\n if (!timeframe) return\r\n\r\n if (!href && pathGenerator) {\r\n const path = pathGenerator({ timeframe, dateRange: value })\r\n if (shouldReloadOnNavigate) {\r\n window.location.href = `${path.pathname}?${path.search}`\r\n } else {\r\n navigate(path)\r\n }\r\n }\r\n\r\n callback?.({ value, timeframe, href })\r\n },\r\n [navigate, pathGenerator, shouldReloadOnNavigate]\r\n )\r\n\r\n const getDateRangeTimeframe = React.useCallback(\r\n (dateRange: string | null) => {\r\n if (!anchorDate || !instrument || !dateRange) return null\r\n\r\n return {\r\n value: dateRange,\r\n timeframe: getTimeframeFromDateRange({\r\n dateRange: dateRange!,\r\n anchorDate,\r\n isPremium,\r\n instrument,\r\n }),\r\n }\r\n },\r\n [anchorDate, instrument, isPremium]\r\n )\r\n\r\n const onDialogSubmit = React.useCallback(\r\n ({ value: dateRange, timeframe: newTimeframe }: { value: string; timeframe: TIMEFRAME }) => {\r\n handleDateRangeSelect({\r\n value: dateRange,\r\n timeframe: newTimeframe,\r\n })\r\n customDateRangeDialogState.hide()\r\n },\r\n // We only want `customDateRangeDialogState.hide`, not the whole dialog\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [customDateRangeDialogState.hide, handleDateRangeSelect]\r\n )\r\n\r\n return { onDialogSubmit, customDateRangeDialogState, handleDateRangeSelect, getDateRangeTimeframe }\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { TIMEFRAME } from '../../constants'\r\nimport { useSyncLocalStorage } from '../../hooks/use-sync-local-storage'\r\n\r\ntype FavoriteTimeframesMap = { [K in TIMEFRAME | 'intraday']?: boolean }\r\n\r\nexport const TIMEFRAME_FAVORITE_DEFAULTS = {\r\n [TIMEFRAME.i1]: true,\r\n [TIMEFRAME.i2]: false,\r\n [TIMEFRAME.i3]: true,\r\n [TIMEFRAME.i5]: true,\r\n [TIMEFRAME.i10]: false,\r\n [TIMEFRAME.i15]: true,\r\n [TIMEFRAME.i30]: true,\r\n [TIMEFRAME.h]: true,\r\n [TIMEFRAME.h2]: false,\r\n [TIMEFRAME.h4]: false,\r\n [TIMEFRAME.d]: true,\r\n [TIMEFRAME.w]: true,\r\n [TIMEFRAME.m]: true,\r\n}\r\n\r\nexport const TIMEFRAME_FAVORITE_DEFAULTS_FREE = {\r\n ...TIMEFRAME_FAVORITE_DEFAULTS,\r\n intraday: true,\r\n}\r\n\r\nconst LOCAL_STORAGE_KEY = 'favoriteTimeframesMap'\r\n\r\nexport function useFavoriteTimeframes(isPremium = true) {\r\n const { state, setState } = useSyncLocalStorage(\r\n LOCAL_STORAGE_KEY,\r\n isPremium ? TIMEFRAME_FAVORITE_DEFAULTS : TIMEFRAME_FAVORITE_DEFAULTS_FREE\r\n )\r\n\r\n const toggleFavoriteTimeframe = React.useCallback(\r\n (timeframe: TIMEFRAME | 'intraday') => {\r\n setState((prevState) => ({\r\n ...prevState,\r\n [timeframe]: !prevState[timeframe],\r\n }))\r\n },\r\n [setState]\r\n )\r\n\r\n const favoriteTimeframes = React.useMemo(\r\n () => Object.keys(state).filter((key) => state[key as keyof FavoriteTimeframesMap]),\r\n [state]\r\n )\r\n\r\n return {\r\n favoriteTimeframes: isPremium ? favoriteTimeframes : Object.keys(TIMEFRAME_FAVORITE_DEFAULTS_FREE),\r\n toggleFavoriteTimeframe,\r\n }\r\n}\r\n","import * as React from 'react'\r\n\r\nimport * as storage from '../services/local-storage'\r\n\r\n/**\r\n * Hook to synchronize localStorage.setItem across all components on the page on all open tabs\r\n */\r\nexport function useSyncLocalStorage(storageKey: string, defaultValue: ValueType) {\r\n const [state, setState] = React.useState(storage.getValue(storageKey, defaultValue))\r\n\r\n React.useEffect(() => {\r\n const subscription = storage.subscribeToChanges(storageKey, defaultValue, setState)\r\n\r\n return () => {\r\n subscription.unsubscribe()\r\n }\r\n }, [storageKey, defaultValue])\r\n\r\n const setValue = React.useCallback(\r\n (valueGetter: React.SetStateAction) => storage.setValue(storageKey, valueGetter, defaultValue),\r\n [defaultValue, storageKey]\r\n )\r\n\r\n return {\r\n state,\r\n setState: setValue,\r\n }\r\n}\r\n","import * as AriaKit from '@ariakit/react'\r\nimport * as React from 'react'\r\n\r\nimport { Input, InputHTMLProps, InputProps } from './input'\r\nimport { Tooltip, TooltipColor, TooltipProps, TooltipTrigger, useTooltipState } from './tooltip'\r\n\r\ntype TooltipInputProps = InputProps & InputHTMLProps & { isInteractive?: boolean }\r\n\r\ninterface TooltipSettingsProps extends Pick, Pick {\r\n content?: React.ReactNode\r\n color?: keyof typeof TooltipColor\r\n}\r\n\r\nexport interface TooltipInputWrapperProps extends Pick {\r\n children: React.ReactElement\r\n /**\r\n * Settings for Tooltip component and useTooltipStore\r\n */\r\n tooltipSettings?: TooltipSettingsProps\r\n}\r\n\r\nfunction TooltipInputWrapper({ children, tooltipSettings = {}, name }: TooltipInputWrapperProps) {\r\n const { content, color, gutter, placement = 'bottom' } = tooltipSettings\r\n const tooltip = useTooltipState({ placement })\r\n\r\n return (\r\n <>\r\n \r\n {React.cloneElement(children, {\r\n onFocus: (event: React.FocusEvent) => {\r\n children.props.onFocus?.(event)\r\n tooltip.show()\r\n },\r\n onBlur: (event: React.FocusEvent) => {\r\n children.props.onBlur?.(event)\r\n tooltip.hide()\r\n },\r\n })}\r\n \r\n {content && (\r\n \r\n {content}\r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\nfunction TooltipInputComponent(\r\n { tooltipSettings, isInteractive = true, ...props }: TooltipInputProps & Omit,\r\n ref: React.ForwardedRef\r\n) {\r\n const input = \r\n\r\n if (!isInteractive) {\r\n return input\r\n }\r\n\r\n return (\r\n \r\n {input}\r\n \r\n )\r\n}\r\n\r\nexport const TooltipInput = React.forwardRef(TooltipInputComponent)\r\n","import React from 'react'\r\n\r\nimport { DropdownStateReturn } from '../components/dropdown'\r\nimport { PopoverStateReturn } from '../components/popover'\r\nimport { useWindowSize } from './use-window-size'\r\n\r\ntype Props = {\r\n maxHeightLimit: number\r\n hasViewportHeightLimit: boolean\r\n offsets: [number, number]\r\n state: PopoverStateReturn | DropdownStateReturn\r\n}\r\n\r\nconst MAX_HEIGHT_PROPERTY = '--popover-max-height'\r\nconst POPOVER_HEIGHT_LIMIT_STYLE = {\r\n maxHeight: `calc(var(${MAX_HEIGHT_PROPERTY}) - env(safe-area-inset-bottom))`,\r\n}\r\n\r\n/**\r\n * Limit popover height to be always in viewport is `hasViewportHeightLimit` is true\r\n */\r\nexport function usePopoverMaxHeight({ maxHeightLimit, hasViewportHeightLimit, offsets, state }: Props) {\r\n const { innerHeight } = useWindowSize({ isWatching: state.visible || state.animating })\r\n const buttonElement = state.unstable_referenceRef.current\r\n\r\n React.useEffect(() => {\r\n if (!buttonElement || !state.visible || !hasViewportHeightLimit) return\r\n\r\n // calculate height\r\n const buttonRect = buttonElement.getBoundingClientRect()\r\n const [, offsetY] = offsets\r\n let elementMaxHeight = 'auto'\r\n if (state.placement.startsWith('bottom')) {\r\n let height = innerHeight - buttonRect.bottom - offsetY * 2\r\n // when used on pages where is scrollable content, buttonRect.bottom is sometimes negative\r\n // in that case we need to subtract window.scrollY\r\n if (buttonRect.bottom < 0) height -= window.scrollY\r\n elementMaxHeight = `${Math.min(height, maxHeightLimit)}px`\r\n } else {\r\n const height = buttonRect.top - offsetY * 2\r\n elementMaxHeight = `${Math.min(height, maxHeightLimit)}px`\r\n }\r\n\r\n // set height\r\n const popoverId = buttonElement.getAttribute('aria-controls')\r\n const popoverWrapper = popoverId ? document.getElementById(popoverId) : null\r\n popoverWrapper?.style.setProperty(MAX_HEIGHT_PROPERTY, elementMaxHeight)\r\n }, [buttonElement, innerHeight, maxHeightLimit, hasViewportHeightLimit, offsets, state.placement, state.visible])\r\n\r\n return hasViewportHeightLimit ? POPOVER_HEIGHT_LIMIT_STYLE : undefined\r\n}\r\n","import throttle from 'lodash.throttle'\r\nimport * as React from 'react'\r\n\r\ninterface Props {\r\n throttleWaitInMs?: number\r\n isWatching?: boolean\r\n}\r\n\r\nexport function useWindowSize({ throttleWaitInMs = 300, isWatching = true }: Props = {}) {\r\n const [size, setSize] = React.useState({\r\n innerWidth: window.innerWidth,\r\n innerHeight: window.innerHeight,\r\n })\r\n\r\n React.useEffect(() => {\r\n if (!isWatching) return\r\n\r\n const handleResize = throttle(() => {\r\n setSize({\r\n innerWidth: window.innerWidth,\r\n innerHeight: window.innerHeight,\r\n })\r\n }, throttleWaitInMs)\r\n\r\n window.addEventListener('resize', handleResize)\r\n\r\n return () => {\r\n handleResize.cancel()\r\n window.removeEventListener('resize', handleResize)\r\n }\r\n }, [throttleWaitInMs, isWatching])\r\n\r\n return size\r\n}\r\n","import { TableAlign } from '../../components/Table'\r\nimport { SortByShape } from '../../hooks/use-sort-data'\r\nimport { NullableNumbers } from '../../types'\r\n\r\nexport enum PortfolioQuery {\r\n View = 'v',\r\n TableView = 'tv',\r\n PortfolioId = 'pid',\r\n Order = 'o',\r\n Tickers = 't',\r\n Map = 'map',\r\n Size = 'mapSize',\r\n Subtype = 'subtype',\r\n Group = 'group',\r\n}\r\n\r\nexport enum PortfolioMapSizeKey {\r\n MarketValue = 'market',\r\n Gain = 'gain',\r\n}\r\n\r\nexport enum PortfolioView {\r\n View = '1',\r\n Edit = '2',\r\n}\r\n\r\nexport enum PortfolioTableView {\r\n Ticker = '1',\r\n Trade = '2',\r\n}\r\n\r\nexport const PortfolioTableViewLabels = {\r\n [PortfolioTableView.Ticker]: 'Tickers',\r\n [PortfolioTableView.Trade]: 'Trades',\r\n}\r\n\r\nexport enum PortfolioSymbolType {\r\n Stock = 'stock',\r\n Cash = 'cash',\r\n}\r\n\r\nexport enum PortfolioTransaction {\r\n Watch = 0,\r\n\r\n // Stock transactions\r\n Buy = 1,\r\n Short = 2,\r\n\r\n // Cash transactions\r\n CashDeposit = 200,\r\n CashWithdraw = 201,\r\n CashIncome = 202,\r\n CashFee = 203,\r\n}\r\n\r\nexport enum NumberOfShares {\r\n None = 0,\r\n /**\r\n * The usage of this is technically incorrect. The value for `PositiveNumber` is 1.\r\n * But we don’t care in this context, because we only want to differentiate betwen zero/non-zero values,\r\n * which helps us get correct types.\r\n *\r\n * # Don’t compare `entry.shares === NumberOfShares.PositiveNumber`\r\n */\r\n PositiveNumber = 1,\r\n}\r\n\r\nexport interface PortfolioEntryBase {\r\n id: number\r\n ticker: string\r\n date: string\r\n transaction: PortfolioTransaction\r\n shares: number\r\n price: number\r\n type: PortfolioSymbolType\r\n}\r\n\r\n/**\r\n * Base type which lists all common properties\r\n */\r\nexport interface PortfolioEntryComputed {\r\n valuePaid: number\r\n valueMarket: number\r\n valueMarketPrev: number\r\n gainMarket: number\r\n gainMarketPct: number\r\n gainMarketUsd: number\r\n gainTodayUsd: number\r\n lastChangePct: number\r\n}\r\n\r\n/**\r\n * Transaction with > 0 shares\r\n */\r\nexport interface PortfolioTransactionStake extends PortfolioEntryBase, PortfolioEntryComputed {\r\n shares: NumberOfShares.PositiveNumber\r\n}\r\n\r\n/**\r\n * Transaction with 0 shares\r\n */\r\nexport interface PortfolioTransactionWatch\r\n extends Omit,\r\n NullableNumbers {\r\n shares: NumberOfShares.None\r\n transaction: PortfolioTransaction\r\n}\r\n\r\nexport type PortfolioEntryTransaction = PortfolioTransactionStake | PortfolioTransactionWatch\r\n\r\nexport type PortfolioActionType = PortfolioEntryTransaction & { isNotification?: boolean; message?: string }\r\n\r\n/**\r\n * Top level portfolio entry\r\n */\r\nexport interface PortfolioGroup extends PortfolioEntryComputed {\r\n ticker: string\r\n shares: number\r\n industry: string\r\n country: string\r\n company: string\r\n marketCap: number\r\n prevClose: number\r\n lastClose: number\r\n lastVolume: number\r\n perfWeek: number\r\n costAvg: number\r\n transactions: PortfolioEntryTransaction[]\r\n order: number\r\n id: number\r\n date: string\r\n type: PortfolioSymbolType\r\n isDelisted?: true\r\n}\r\n\r\nexport type PortfolioTrade = Omit & PortfolioEntryTransaction\r\n\r\nexport type PortfolioMapEntry = Omit & PortfolioTransactionStake\r\n\r\n/**\r\n * Summary row for the whole portfolio\r\n */\r\nexport interface PortfolioSummary {\r\n tickers: number\r\n transactions: number\r\n shares: number\r\n lastChangePct: number\r\n valuePaid: number\r\n valueMarket: number\r\n valueMarketStocks: number\r\n valueMarketStocksPrev: number\r\n gainMarketUsd: number\r\n gainMarketPct: number\r\n gainTodayUsd: number\r\n}\r\n\r\nexport interface PortfolioDefinition {\r\n id: number\r\n name: string\r\n order: number\r\n}\r\n\r\nexport interface PortfolioInitData {\r\n limit: number\r\n limitTransactions: number\r\n selectedPortfolio: number\r\n portfolios: PortfolioDefinition[]\r\n portfolio: PortfolioGroup[]\r\n news: string[]\r\n version?: number\r\n}\r\n\r\nexport interface PortfolioFormEntry\r\n extends Pick,\r\n Partial> {\r\n uuid: string\r\n}\r\n\r\nexport interface PortfolioFormGroup extends Pick {\r\n id: string\r\n transactions: PortfolioFormEntry[]\r\n}\r\n\r\nexport enum ColumnId {\r\n Spacer = 'spacer',\r\n Ticker = 'ticker',\r\n Company = 'company',\r\n LastClose = 'lastClose',\r\n CostAvg = 'costAvg',\r\n LastChange = 'lastChange',\r\n LastChangePct = 'lastChangePct',\r\n LastVolume = 'lastVolume',\r\n Transaction = 'transaction',\r\n Date = 'date',\r\n Shares = 'shares',\r\n Price = 'price',\r\n ValuePaid = 'valuePaid',\r\n Amount = 'amount',\r\n ValueMarket = 'valueMarket',\r\n GainMarketUsd = 'gainMarketUsd',\r\n GainMarketPct = 'gainMarketPct',\r\n GainMarketCombined = 'gainMarketCombined',\r\n GainTodayUsd = 'gainTodayUsd',\r\n GainTodayCombined = 'gainTodayCombined',\r\n Order = 'order',\r\n}\r\n\r\nexport enum RowKind {\r\n Group, // A group of transactions\r\n Transaction, // A transaction made inside ticker\r\n Summary, // Portfolio summary\r\n Watchlist, // Charts portfolio watchlist table\r\n Trade,\r\n}\r\n\r\ninterface GroupProps {\r\n kind: RowKind.Group\r\n row: PortfolioGroup\r\n}\r\ninterface TradeProps {\r\n kind: RowKind.Trade\r\n row: PortfolioTrade\r\n}\r\n\r\ninterface TransactionProps {\r\n kind: RowKind.Transaction\r\n row: PortfolioEntryTransaction\r\n}\r\n\r\ninterface SummaryProps {\r\n kind: RowKind.Summary\r\n row: PortfolioSummary\r\n}\r\n\r\ninterface WatchlistProps {\r\n index: number\r\n kind: RowKind.Watchlist\r\n row: PortfolioGroup\r\n}\r\n\r\nexport interface TableColumnDefinition<\r\n PropsType = GroupProps | TradeProps | TransactionProps | SummaryProps | WatchlistProps,\r\n> extends SortByShape {\r\n urlSort: string\r\n name: string\r\n align?: TableAlign\r\n\r\n /**\r\n * Get the value of the column and render it\r\n */\r\n renderColumn: (props: PropsType) => React.ReactNode\r\n}\r\n\r\nexport enum ActionKind {\r\n AddTickers,\r\n RemoveTicker,\r\n AddTransaction,\r\n EditTransaction,\r\n RemoveTransaction,\r\n ReorderTickers,\r\n PortfoliosReorder,\r\n}\r\n\r\nexport interface Action {\r\n kind: ActionKind\r\n payload: PayloadType\r\n}\r\n\r\nexport type AddTickersError = {\r\n tickers?: string\r\n}\r\n\r\nexport interface CreatePortfolioErrors extends AddTickersError {\r\n portfolioName?: string\r\n}\r\n\r\nexport interface CreatePortfolioData {\r\n tickers: string\r\n portfolioName: string\r\n}\r\n\r\nexport type FormErrors = Partial>\r\n\r\nexport interface PortfolioBulkEditErrors {\r\n portfolioName: boolean\r\n rows: Record\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { Notification, useNotification } from '../components/notification'\r\nimport { Paragraph } from '../components/typography'\r\nimport { useIsMounted } from '../hooks/use-is-mounted'\r\nimport { importWithRetry } from './import-with-retry'\r\n\r\nconst cache: any = {}\r\nconst errorsCache: any = {}\r\n\r\nenum ErrorSeverity {\r\n medium,\r\n high,\r\n}\r\n\r\nfunction defaultCaptureException(exception: Error, captureContext?: { extra: Record }) {\r\n if (process.env.NODE_ENV === 'development') {\r\n console.error(exception)\r\n } else {\r\n window.Sentry.captureException(exception, captureContext)\r\n }\r\n}\r\n\r\nexport interface ControlledModuleConfig {\r\n /**\r\n * Suspense mode shouldn’t be used together with controlled loading as it could lead to bugs.\r\n * If you know what you’re doing, add an ignore comment explaining the decision\r\n */\r\n isSuspenseMode?: never\r\n shouldLoadModule?: boolean\r\n}\r\nexport interface SuspenseModuleConfig {\r\n /**\r\n * Controlled loading shouldn’t be used together with suspense mode as it could lead to bugs.\r\n * If you know what you’re doing, add an ignore comment explaining the decision\r\n */\r\n shouldLoadModule?: never\r\n isSuspenseMode?: SuspenseMode\r\n}\r\n\r\n/**\r\n * Hook used to asynchronously load a module\r\n *\r\n * Usage: [wiki](https://github.com/finvizhq/Finviz-Website/wiki/Loading-modules-asynchronously#useasyncmodule)\r\n */\r\nexport function useAsyncModule({\r\n importFn,\r\n onError,\r\n errorSeverity,\r\n cacheKey,\r\n captureException = defaultCaptureException,\r\n shouldLoadModule = false,\r\n isSuspenseMode = false as SuspenseMode,\r\n}: {\r\n importFn: () => Promise\r\n onError?: () => void\r\n cacheKey: string\r\n errorSeverity?: keyof typeof ErrorSeverity\r\n captureException?: typeof defaultCaptureException\r\n} & (ControlledModuleConfig | SuspenseModuleConfig)) {\r\n const notificationContext = useNotification()\r\n const [isLoading, setIsLoading] = React.useState(false)\r\n const [isError, setIsError] = React.useState(false)\r\n const getIsMounted = useIsMounted()\r\n\r\n const handleError = () => {\r\n onError?.()\r\n setIsError(true)\r\n\r\n if (errorSeverity === undefined) {\r\n return\r\n }\r\n\r\n if (ErrorSeverity[errorSeverity] === ErrorSeverity.high) {\r\n window.handleScriptNotLoaded()\r\n window.renderScriptNotLoaded()\r\n }\r\n\r\n if (ErrorSeverity[errorSeverity] === ErrorSeverity.medium) {\r\n notificationContext.show(\r\n \r\n \r\n One or more of the required application components couldn’t be loaded.
Please try to repeat the\r\n action or{' '}\r\n window.location.reload()}>\r\n refresh the page\r\n {' '}\r\n if the problem persists.\r\n
\r\n
\r\n )\r\n }\r\n }\r\n\r\n const loadModule = async () => {\r\n if (cache[cacheKey]) {\r\n return cache[cacheKey]\r\n }\r\n\r\n setIsLoading(true)\r\n\r\n try {\r\n cache[cacheKey] = await importWithRetry(importFn)\r\n } catch (error) {\r\n captureException(error as Error)\r\n handleError()\r\n } finally {\r\n if (getIsMounted()) {\r\n setIsLoading(false)\r\n }\r\n }\r\n\r\n return cache[cacheKey]\r\n }\r\n\r\n React.useEffect(() => {\r\n if (shouldLoadModule) {\r\n loadModule()\r\n }\r\n // We want to run it only on shouldLoadModule change\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [shouldLoadModule])\r\n\r\n const cachedModule = cache[cacheKey]\r\n if (isSuspenseMode) {\r\n if (errorsCache[cacheKey]) throw errorsCache[cacheKey]\r\n if (!cachedModule) {\r\n throw importFn()\r\n .then((mod) => (cache[cacheKey] = mod))\r\n .catch((err) => {\r\n handleError()\r\n errorsCache[cacheKey] = err\r\n })\r\n }\r\n }\r\n\r\n return [cachedModule ?? null, { isLoading, loadModule, isError }] as [\r\n SuspenseMode extends true ? T : T | null,\r\n { isLoading: boolean; loadModule: () => Promise; isError: boolean },\r\n ]\r\n}\r\n\r\n/**\r\n * HOC which wraps component in React.Suspense\r\n *\r\n * Usage: [wiki](https://github.com/finvizhq/Finviz-Website/wiki/Loading-modules-asynchronously#withsuspense)\r\n */\r\nexport function withSuspense

>(\r\n Component: React.ComponentType

,\r\n fallback: React.ReactNode = null\r\n) {\r\n return function WrappedComponent(props: P) {\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n}\r\n","const NUM_OF_RETRIES = 3\r\n\r\nexport function importWithRetry(importFn: () => Promise, retries = 0) {\r\n const result = importFn().catch(async (err) => {\r\n if (retries > NUM_OF_RETRIES) {\r\n throw err\r\n }\r\n\r\n await new Promise((r) => setTimeout(r, 1000 * retries))\r\n\r\n return importWithRetry(importFn, retries + 1)\r\n }) as Promise\r\n\r\n return result\r\n}\r\n","import { EventEmitter } from 'events'\r\nimport * as React from 'react'\r\n\r\nlet emitter: EventEmitter | undefined\r\n\r\n/**\r\n * Get the emitter which is used to sync components across the page, subscibe to\r\n * changes and attach event which handles changes across windows\r\n */\r\nexport function subscribeToChanges(\r\n key: string,\r\n defaultValue: ValueType,\r\n changeCallback?: (value: React.SetStateAction) => void\r\n) {\r\n if (!emitter) emitter = new EventEmitter()\r\n\r\n const onChange = (value: React.SetStateAction) => {\r\n const newValue = value ?? getValue(key, defaultValue)\r\n setValue(key, newValue, defaultValue, false)\r\n changeCallback?.(newValue)\r\n }\r\n\r\n const onStorageChange = (ev: StorageEvent) => {\r\n if (ev.key === key) {\r\n try {\r\n const value = ev.newValue ? JSON.parse(ev.newValue) : null\r\n onChange(value ?? defaultValue)\r\n } catch {\r\n onChange(defaultValue)\r\n }\r\n }\r\n }\r\n\r\n emitter.addListener(key, onChange)\r\n window.addEventListener('storage', onStorageChange)\r\n\r\n return {\r\n emitter,\r\n unsubscribe: () => {\r\n emitter?.removeListener(key, onChange)\r\n window.removeEventListener('storage', onStorageChange)\r\n },\r\n }\r\n}\r\n\r\n/**\r\n * Get value from local storage or fall back to `defaultValue`\r\n */\r\nexport function getValue(key: string, defaultValue: ValueType): ValueType {\r\n try {\r\n const value = localStorage.getItem(key)\r\n const parsedValue = value ? JSON.parse(value) : null\r\n return parsedValue ?? defaultValue\r\n } catch {\r\n return defaultValue\r\n }\r\n}\r\n\r\n/**\r\n * Set value to local storage. Optionally emits the change to all other components\r\n * which are subscribed with the same `key`\r\n */\r\nexport function setValue(\r\n key: string,\r\n valueGetter: React.SetStateAction,\r\n defaultValue: ValueType,\r\n emit = true\r\n) {\r\n try {\r\n const state = getValue(key, defaultValue)\r\n const valueToStore = valueGetter instanceof Function ? valueGetter(state) : valueGetter\r\n\r\n localStorage.setItem(key, JSON.stringify(valueToStore))\r\n if (emit) emitter?.emit(key, valueToStore)\r\n } catch {}\r\n}\r\n\r\n/**\r\n * Removes value from local storage. Optionally emits the change to all other components\r\n * which are subscribed with the same `key`\r\n */\r\nexport function removeValue(key: string, emit = true) {\r\n try {\r\n localStorage.removeItem(key)\r\n if (emit) emitter?.emit(key, undefined)\r\n } catch {}\r\n}\r\n\r\n/**\r\n * Helper function to migrate old value type to new one (eg. boolean to object)\r\n */\r\nexport function migrateValue(\r\n key: string,\r\n /**\r\n * The migrate function might get called multiple times on the page, so `oldValue` in the callback\r\n * can actually be the already migrated value. Make sure to add a condition to only migrate once.\r\n */\r\n transformValue: NewValue | ((oldValue: PrevValue | NewValue) => NewValue),\r\n defaultValue: NewValue\r\n) {\r\n try {\r\n const oldValue = getValue(key, undefined)\r\n if (typeof oldValue === 'undefined') return\r\n const migratedValue = transformValue instanceof Function ? transformValue(oldValue) : transformValue\r\n setValue(key, migratedValue, defaultValue, false) // don’t emit to other components\r\n } catch {}\r\n}\r\n","/**\r\n * Ignore any subsequent callback calls until the previous callback has finished\r\n */\r\n\r\nexport function waitForPreviousPromise(callback: () => void | Promise) {\r\n let callbackPromise: Promise | void | null = null\r\n\r\n return async function () {\r\n if (callbackPromise !== null) return\r\n\r\n callbackPromise = callback()\r\n await callbackPromise\r\n callbackPromise = null\r\n }\r\n}\r\n"],"names":["module","exports","white","black","inherit","transparent","current","finviz","blue","gray","red","orange","amber","yellow","brightYellow","lime","green","emerald","teal","violet","purple","pink","saveToPortfolioAsyncModule","importFn","cacheKey","getCurrentDateInMs","Date","valueOf","getIsDocumentVisible","document","visibilityState","hidden","notifyOnVisibilityChange","callback","promisifiedCallback","waitForPreviousPromise","addEventListener","unsubscribe","removeEventListener","intervalCallbackOnWindowVisible","interval","getInterval","refreshPromise","nextRefresh","refreshTimeout","async","refresh","window","setTimeout","Math","max","handleVisibilityChange","clearTimeout","currentDateMs","GroupTheme","ButtonGroup","_ref","className","children","theme","hasDivider","hasBorder","rounding","childComponent","buttonRounding","ButtonRounding","groupTheme","React","dark","wrapper","divider","getGroupTheme","_jsx","role","classnames","border","map","child","index","_child$props$rounding","_child$props$theme","Button","filter","Boolean","includes","type","_jsxs","props","ColorVariant","CheckboxSize","CheckboxComponent","ref","_props$checked","label","size","color","default","checked","defaultChecked","disabled","Icon","name","width","Checkbox","forwardRef","clamp","num","min","arguments","length","undefined","isTouch","event","getRelativePosition","node","rect","getBoundingClientRect","pointer","touches","left","pageX","pageXOffset","top","pageY","pageYOffset","height","preventDefaultMove","preventDefault","DraggablePickerComponent","onMove","onKey","container","useRef","hasTouched","isDragging","setDragging","useState","isValid","handleMove","useCallback","buttons","handleMoveStart","_ref2","nativeEvent","handleKeyDown","keyCode","which","handleMoveEnd","toggleDocumentEvents","state","toggleEvent","useLayoutEffect","onTouchStart","onMouseDown","onKeyDown","tabIndex","DraggablePicker","memo","Pointer","style","concat","backgroundColor","hexStringToRGBA","hexString","hexColor","removeHashSymbol","r","g","b","a","Number","round","hexStringToHSVA","rgbaToHSVA","alphaToHex","alpha","toString","padStart","rgbaToHexString","hsvaToHEXString","hsvaToRGBA","v","c","h","s","f","n","k","rgbaToRGBAString","rgbaStringToObject","colorParts","exec","slice","String","parseInt","parseFloat","strColor","replace","isValidColor","isRgb","startsWith","Option","convertColorToHEX","getIsRgb","rgbKeys","push","some","getHSVAFromColor","Alpha","onChange","changeLightness","pos","gradientPreview","useMemo","gradientFrom","gradientTo","backgroundImage","DEFAULT_COLORS","title","value","ColorPalette","colors","lowerCaseColor","toLowerCase","colorObj","isSelected","onClick","HueSaturation","position","getPositionFromHSLA","colorPreview","changeSaturation","Lightness","ColorPreview","icon","Array","isArray","isTooLight","getLumaFromRGBA","getIsColorTooLightOrTransparent","isValidIconName","PickerInput","inputClass","hasColorPreview","colorInput","setColorInput","colorUtil","isRgba","useEffect","handleColorInputChange","currentTarget","colorValue","Input","leftContent","ColorPicker","canSelectCustom","canSelectAlpha","outputFormat","onPaletteItemClick","cachedColor","hsvaColor","setColor","currentColor","newColor","onChangeCallback","stringColor","output","onSetCustomCodeClick","_prompt","prompt","trim","alert","_Fragment","isMobile","contentClass","_hex","orignalColor","InputColorPicker","inputDataTestId","popoverState","usePopoverState","isMobileDevice","PopoverTrigger","as","onBlur","hide","Popover","focusOnShow","MultiColorPicker","colorInputLabel","ColorTabButton","small","ButtonColorPicker","_ref3","buttonPickerDataTestId","hideOnClickOutside","onOverlayClick","isMultiPicker","activeColorIndex","setActiveColorIndex","handleColorChange","originalColor","colorObject","appearance","active","visible","_ref4","_ref5","CopyToClipboard","text","bottomLeftContent","isCopied","setIsCopied","handleCopyToClipboard","copy","timeout","resetTimer","Textarea","readOnly","e","select","DatePickerComponent","StatelessDatePicker","zIndex","isFullyClosed","getExtendedDialogState","triggerProps","ZIndexContext","Provider","fallback","Box","Spinner","locale","minDetail","ev","_props$onChange","call","DatePicker","popover","DropdownContext","useDropdownState","settings","_settings$unstable_of","context","Reakit","loop","animated","COMPONENT_ANIMATION_DURATION","unstable_virtual","unstable_offset","root","modal","DropdownComponent","ariaLabel","isNested","isStatic","useZIndex","dropdownState","animating","Error","ContainerElement","Portal","buttonProps","_label$props$active","_context$root","onTransitionEnd","onAnimationEnd","innerProps","parent","placement","orientation","Dropdown","NestedDropdownWrapper","parentState","itemProps","DropdownItemComponent","asComponent","subtitle","closeOnClick","hasSubmenu","iconTheme","align","rightContent","_itemProps$onClick","DropdownItem","DropdownSeparator","Paragraph","DEFAULT_OFFSETS","ContextMenu","menuMaxHeight","items","popperElement","setPopperElement","virtualRef","scrollY","x","scrollX","y","bottom","right","toJSON","getVirtualRef","hasBeenOpen","styles","attributes","usePopper","modifiers","options","offset","show","popper","ContextMenuDropdown","ContextMenuInner","MAX_SAFE_INTEGER","innerState","maxHeightStyle","usePopoverMaxHeight","maxHeightLimit","hasViewportHeightLimit","offsets","item","id","_item$onClick","_window$gtag","_window","gtag","Object","assign","menu_option","ChartGridCell","gridArea","GridLayout","columns","rows","gridTemplateColumns","gridTemplateRows","ChartGrid","defaultValueAccessor","data","InnerState","valueKey","changeKey","valueAccessor","setState","handleChange","RangeSize","RangeSlider","step","inputClassName","hasTrack","setHasTrack","trackRef","thumbRef","thumbLeft","track","thumb","valuePercent","trackBox","thumbBox","Label","ToolbarTheme","ToolbarDirection","ToolbarContext","direction","vertical","chipTransparent","isWrapped","isStretched","useToolbarContext","getToolbarSettings","FinvizSettings","hasRedesignEnabled","horizontal","alternative","Toolbar","toolbarRef","contextProviderValue","toolbarSettings","isSafariDesktop","forceReflow","throttle","originalWidth","offsetWidth","ToolbarButton","_props$appearance","_buttonSettings$size","_props$children","disabledTooltip","isInAction","isInActionProp","isLoading","iconAction","buttonSettings","isActive","includeRedesign","grow","getButtonThemeSettings","getMainIcon","iconActive","titleActive","Delayed","delay","delayComponent","ToolbarGroup","_groupItems$map","defaultItem","groupItems","groupTitle","useNativeSelect","listState","useListState","currentId","selectedItem","setSelectedItem","groupId","toLocaleLowerCase","isAlternativeTheme","useHoverPopover","useList","i","option","findIndex","stopPropagation","NativeSelect","finalFocusRef","body","hasBackdrop","List","onItemChange","ListItem","ToolbarItem","isItemActive","ToolbarDivider","StepContent","Heading","level","shepherdLibrary","loadShepherdLibrary","setLoading","shepherdPromise","buttonClasses","BUTTON_BASE_CLASS","BUTTON_FOCUS_STYLES","ButtonSize","regular","getStepButtons","tour","arr","_step$backButton","_step$nextButton","action","complete","classes","getButtonTheme","ButtonTheme","light","button","ButtonPadding","back","backButton","next","nextButton","getTourKey","location","pathname","getStepsForUser","tours","_localStorage","lastFinishedTour","localStorage","getItem","lastTourIndex","allToursViewed","every","skip","toursToView","hasNewTours","reduce","acc","steps","initialTour","completeTour","key","_localStorage2","setItem","DEFAULT_OPTIONS","exitOnEsc","useModalOverlay","useTour","setIsLoading","currentTour","setTour","controller","AbortController","loadingSetter","_controller$current","signal","aborted","_controller$current2","abort","startTour","definition","_controller$current3","setComplete","tourUtils","_definition$initialTo","Tour","from","forEach","removeStep","processedSteps","_step$placement","_step$offset","_step$overlayRadius","_step$overlayPadding","attachTo","element","target","on","popperOptions","ReactDOM","modalOverlayOpeningRadius","overlayRadius","modalOverlayOpeningPadding","overlayPadding","addSteps","start","event_label","TabSpacing","InternalTab","ariaSelected","spacing","content","classNames","Tab","Ariakit","render","TabList","TabPanel","Tabs","BadgeSize","BadgePadding","Badge","padding","badgePadding","badgeSize","focusOnHide","hasArrow","popoverWrapperStyle","popoverMaxHeight","hasButtonWidthLimit","innerHeight","useWindowSize","isWatching","buttonElement","unstable_referenceRef","buttonRect","popoverId","getAttribute","popoverWrapper","getElementById","setProperty","unstable_autoFocusOnShow","unstable_autoFocusOnHide","unstable_finalFocusRef","TooltipArrow","BoxTheme","DEFAULT_OFFSET","HOVER_TIMEOUT","_settings$placement","showTimeout","hideTimeout","clearTimeouts","showPopover","hidePopover","onMouseOver","onMouseOut","_props$as","placeholder","showPlaceholder","handleNativeSelectChange","_selectedItem$href$se","_selectedItem$href$ha","itemIndex","selectedIndex","flattenItems","href","reloadDocument","newUrl","URL","search","hash","isSelectItemGroup","optionIndex","NativeSelectInRouterContext","navigate","useNavigate","onChangeWithNavigate","ItemsGroup","getDefaultTheme","isHovered","InternalOption","_props$active","_props$size","dataActiveItem","activeTheme","defaultTheme","SelectOption","isComboBox","combobox","SelectItemsVirtualized","SelectRenderer","itemSize","hasGroups","overscan","groupOritem","restProps","isSelectItem","itemRenderer","paddingStart","paddingEnd","rendererProps","restItem","SelectItems","searchValue","parentTestId","virtualized","isInRouterContext","useInRouterContext","filteredItems","filterSelectOptions","innerItem","providedProps","getSelectItemProps","truncate","ListRounding","ListTheme","focusWithoutScroll","focus","preventScroll","onBackdropClick","SelectList","gutter","unmountOnHide","hasItemChildren","ListElement","wrapperProps","hasChildren","count","preventBodyScroll","autoFocusOnHide","backdrop","none","autoSelect","SelectTooltip","tooltipState","useTooltipState","isSelectOpen","hasShownTooltip","subscription","TooltipTrigger","focusable","onFocusVisible","Tooltip","SelectTooltipWrapper","getCollectionItem","DesktopSelect","_items$length","_listProps$unmountOnH","defaultValue","trigger","tooltip","onInteractionChange","comboBox","onSearch","listProps","internalSearch","setInternalSearch","SelectWrapper","resetValueOnHide","includesBaseElement","setValue","ButtonWrapper","buttonWrapperProps","console","warn","listItems","focusLoop","virtualFocus","setOpen","defaultItems","DEFAULT_RIGHT_ICON","SelectButton","_selectedValue$label","valueOverride","contextValue","isOpen","selectedValue","buttonText","rightIcon","xxsmall","Select","_findSelectedValue","_findSelectedValue2","providedValue","providedDefaultValue","triggerContent","isInteractive","nativeSelect","dataTestid","findSelectedValue","selectTrigger","NativeSelectComponent","findSelectedIndex","inRouterContext","Link","to","hasOwnProperty","matchesSearchTerm","searchTerm","lowerSearch","isSameItem","obj1","obj2","finalResults","filtered","foundItem","find","flatMap","itemOrGroup","DATERANGE_TOOLTIP","DateRangeSelect","chartIndex","dateRangeGroups","selectedDateRange","onDateRangeSelect","onCustomDateRangeClick","flatDateRanges","dateRanges","withReload","timeframe","linkProps","hasUserPremium","_createElement","LabelWithDelayedSpinner","invisible","TIMEFRAME_TOOLTIP","TimeframeSelect","timeFrameGroups","selectedTimeframe","favoriteTimeframes","isCompactView","isCompactOnly","onTimeframeSelect","onFavoriteTimeframeToggle","isFavoritesEnabled","flatTimeframes","timeframes","getSelectedTimeframeLabel","_selectedTimeframeIte","selectedTimeframeItem","labelShort","groupIndex","isIconButtonActive","getTimeframeChipElementId","getButtonPadding","xsmall","medium","large","TimeframeBar","isPremium","compactViewMaxBreakpointPx","loadingTimeframe","isDateRangeAvailable","containerElement","isScrollIntoViewEnabled","isTimeframeSelectEnabled","scrollWrapperElement","setScrollWrapperElement","timeframeButtonsScrollLocation","setTimeframeButtonsScrollLocation","isOnLeftEdge","isOnRightEdge","setElementRef","elementWidth","useElementMeasure","timeframesInExpandedPanel","checkTimeframeWrapperScrollPosition","scrollLeft","ceil","scrollWidth","timeframeElement","leftOffset","offsetLeft","clientWidth","scrollTo","onScroll","onWheel","absDx","abs","deltaX","deltaY","_timeframe$withReload","generateTimeframeGroups","premiumTimeframes","TIMEFRAME","i1","i2","i3","i5","i10","i15","i30","labelPageTitle","h2","h4","d","w","m","freeTimeframes","getTimeframeGroups","generateDateRangeGroups","instrument","isStock","Instrument","Stock","DateRangeType","d1","d5","m1","m3","m6","ytd","y1","y2","y5","getDateRangeGroups","customRange","isCustomAvailable","rangeGroups","_customRange$split","dateRangePrefix","split","DATE_RANGE_PREFIX_DELMITER","values","CustomDateRangePrefixEnum","CUSTOM_DATE_RANGE","getDateRangeGroupsWithHref","generatePath","dateRangeGroup","dateRange","FREE_PERIODS_STOCK","generatePathForTimeframeDateRange","utmCampaign","dateRangeQueryKey","encodeQueryString","decodeQueryString","p","utm_source","utm_medium","utm_campaign","timeframeUtm","SpecificChartFunctionality","quotePage","futuresPage","forexPage","cryptoPage","daterangeUtm","CUSTOM_DATE_RANGE_DELIMITER","CUSTOM_PREV_RANGE_DELIMITER","getParsedDateRange","_dateRange$split","parseCustomDateRangeUrlParam","anchorDate","dateRangeValue","Range","dateFromString","dateToString","dateFrom","dateTo","isNaN","getTime","end","dateFns","Prev","years","months","days","DAYS_IN_YEAR","getTimeframeFromDateRange","_ref7","dateRangeTimeframe","_dateRanges$find$time","_dateRanges$find","_ref6","getTimeframeForDateRangeType","startNyTime","startToReferenceDateNumOfDays","rangeNumOfDays","DATE_PICKER_MIN_DATE","YEARS_MAX_VALUE","getFullYear","TAB_BUTTON_COMMON_PROPS","CustomRangeType","DEFAULT_MANUAL_RANGE","kind","Manual","DEFAULT_START_END_RANGE","StartEnd","CustomDateRange","dialogState","onDialogSubmit","isFetching","selectedTab","setSelectedTab","getDefaultSelectedTab","getDefaultSelectedDate","newValue","prevState","newState","newEnd","isAbsolute","fromDate","toDate","manualRange","Dialog","DialogHeader","onSubmit","isValidStartEndRangeState","startString","formatDateToStringUS","endString","join","getCustomStartEndDateRangeUrlParam","isValidManualRangeState","_state$days","_state$months","_state$years","getPrevPeriodDateRangeUrlParam","DialogBody","minDate","DialogFooter","DialogDismiss","useCustomDateRangeDialog","pathGenerator","shouldReloadOnNavigate","customDateRangeDialogState","useDialogState","handleDateRangeSelect","path","getDateRangeTimeframe","newTimeframe","TIMEFRAME_FAVORITE_DEFAULTS","TIMEFRAME_FAVORITE_DEFAULTS_FREE","intraday","LOCAL_STORAGE_KEY","useFavoriteTimeframes","storageKey","storage","valueGetter","useSyncLocalStorage","toggleFavoriteTimeframe","keys","TooltipInputWrapper","tooltipSettings","isHideOnClickOutside","onFocus","_children$props$onFoc","_children$props","_children$props$onBlu","_children$props2","hideOnHoverOutside","TooltipInputComponent","input","TooltipInput","MAX_HEIGHT_PROPERTY","POPOVER_HEIGHT_LIMIT_STYLE","maxHeight","offsetY","elementMaxHeight","throttleWaitInMs","setSize","innerWidth","handleResize","cancel","PortfolioQuery","PortfolioMapSizeKey","PortfolioView","PortfolioTableView","PortfolioTableViewLabels","Ticker","Trade","PortfolioSymbolType","PortfolioTransaction","ColumnId","RowKind","ActionKind","cache","errorsCache","ErrorSeverity","defaultCaptureException","exception","captureContext","Sentry","captureException","useAsyncModule","onError","errorSeverity","shouldLoadModule","isSuspenseMode","notificationContext","useNotification","isError","setIsError","getIsMounted","useIsMounted","handleError","high","handleScriptNotLoaded","renderScriptNotLoaded","Notification","timeoutInMs","reload","loadModule","importWithRetry","error","cachedModule","then","mod","catch","err","withSuspense","Component","NUM_OF_RETRIES","retries","Promise","emitter","subscribeToChanges","changeCallback","EventEmitter","getValue","onStorageChange","JSON","parse","addListener","_emitter","removeListener","parsedValue","emit","_emitter2","valueToStore","Function","stringify","removeValue","_emitter3","removeItem","migrateValue","transformValue","oldValue","callbackPromise"],"sourceRoot":""}