UNPKG

@helpwave/hightide

Version:

helpwave's component and theming library

1,352 lines (1,327 loc) 730 kB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts var index_exports = {}; __export(index_exports, { APP_PAGE_CONTENT_SELECTOR: () => APP_PAGE_CONTENT_SELECTOR, ASTNodeInterpreter: () => ASTNodeInterpreter, ActionCard: () => ActionCard, AnchoredFloatingContainer: () => AnchoredFloatingContainer, AppPage: () => AppPage, AppPageSidebarWithNavigation: () => AppPageSidebarWithNavigation, AppSidebar: () => AppSidebar, AppZumDocBadge: () => AppZumDocBadge, AppZumDocLogo: () => AppZumDocLogo, ArrayUtil: () => ArrayUtil, AutoColumnOrderFeature: () => AutoColumnOrderFeature, Avatar: () => Avatar, AvatarGroup: () => AvatarGroup, AvatarWithLabel: () => AvatarWithLabel, AvatarWithStatus: () => AvatarWithStatus, BagFunctionUtil: () => BagFunctionUtil, BooleanFilterPopUp: () => BooleanFilterPopUp, BreadCrumbGroup: () => BreadCrumbGroup, BreadCrumbLink: () => BreadCrumbLink, BreadCrumbs: () => BreadCrumbs, Button: () => Button, ButtonUtil: () => ButtonUtil, Card: () => Card, Carousel: () => Carousel, CarouselSlide: () => CarouselSlide, ChangingNumber: () => ChangingNumber, ChatAttachmentCard: () => ChatAttachmentCard, ChatConversationList: () => ChatConversationList, ChatConversationRow: () => ChatConversationRow, ChatDateDivider: () => ChatDateDivider, ChatMessageBubble: () => ChatMessageBubble, ChatMessageCard: () => ChatMessageCard, ChatMessageComposer: () => ChatMessageComposer, ChatMessageList: () => ChatMessageList, ChatQuickReplyChip: () => ChatQuickReplyChip, ChatSystemLine: () => ChatSystemLine, ChatThreadHeader: () => ChatThreadHeader, Checkbox: () => Checkbox, CheckboxProperty: () => CheckboxProperty, Chip: () => Chip, ChipList: () => ChipList, ChipUtil: () => ChipUtil, ColumnSizeUtil: () => ColumnSizeUtil, ColumnSizingWithTargetFeature: () => ColumnSizingWithTargetFeature, Combobox: () => Combobox, ComboboxContext: () => ComboboxContext, ComboboxInput: () => ComboboxInput, ComboboxList: () => ComboboxList, ComboboxOption: () => ComboboxOption, ComboboxRoot: () => ComboboxRoot, ConfirmDialog: () => ConfirmDialog, CopyToClipboardWrapper: () => CopyToClipboardWrapper, CurveBuilderUtil: () => CurveBuilderUtil, DOMUtils: () => DOMUtils, DataTypeUtils: () => DataTypeUtils, DateFilterPopUp: () => DateFilterPopUp, DatePicker: () => DatePicker, DateProperty: () => DateProperty, DateTimeField: () => DateTimeField, DateTimeInput: () => DateTimeInput, DateTimePicker: () => DateTimePicker, DateTimePickerDialog: () => DateTimePickerDialog, DateUtils: () => DateUtils, DatetimeFilterPopUp: () => DatetimeFilterPopUp, DayPicker: () => DayPicker, Dialog: () => Dialog, DialogContext: () => DialogContext, DialogOpenerWrapper: () => DialogOpenerWrapper, DialogRoot: () => DialogRoot, DiscardChangesDialog: () => DiscardChangesDialog, DividerInserter: () => DividerInserter, Drawer: () => Drawer, DrawerCloseButton: () => DrawerCloseButton, DrawerContainer: () => DrawerContainer, DrawerContext: () => DrawerContext, DrawerRoot: () => DrawerRoot, Duration: () => Duration, ErrorComponent: () => ErrorComponent, Expandable: () => Expandable, ExpandableContent: () => ExpandableContent, ExpandableHeader: () => ExpandableHeader, ExpandableRoot: () => ExpandableRoot, ExpansionIcon: () => ExpansionIcon, FAQSection: () => FAQSection, FillerCell: () => FillerCell, FilterBasePopUp: () => FilterBasePopUp, FilterFunctions: () => FilterFunctions, FilterList: () => FilterList, FilterOperatorLabel: () => FilterOperatorLabel, FilterOperatorUtils: () => FilterOperatorUtils, FilterPopUp: () => FilterPopUp, FilterValueUtils: () => FilterValueUtils, FlexibleDateTimeInput: () => FlexibleDateTimeInput, FocusTrap: () => FocusTrap, FocusTrapWrapper: () => FocusTrapWrapper, FormContext: () => FormContext, FormField: () => FormField, FormFieldLayout: () => FormFieldLayout, FormObserver: () => FormObserver, FormObserverKey: () => FormObserverKey, FormProvider: () => FormProvider, FormStore: () => FormStore, GenericFilterPopUp: () => GenericFilterPopUp, HelpwaveBadge: () => HelpwaveBadge, HelpwaveLogo: () => HelpwaveLogo, HightideConfigContext: () => HightideConfigContext, HightideConfigProvider: () => HightideConfigProvider, HightideProvider: () => HightideProvider, IconButton: () => IconButton, IconButtonBase: () => IconButtonBase, InfiniteScroll: () => InfiniteScroll, Input: () => Input, InputDialog: () => InputDialog, InsideLabelInput: () => InsideLabelInput, LabelledCheckbox: () => LabelledCheckbox, LanguageDialog: () => LanguageDialog, LanguageSelect: () => LanguageSelect, LoadingAndErrorComponent: () => LoadingAndErrorComponent, LoadingAnimation: () => LoadingAnimation, LoadingContainer: () => LoadingContainer, LocaleContext: () => LocaleContext, LocaleProvider: () => LocaleProvider, LocalizationUtil: () => LocalizationUtil, LoopingArrayCalculator: () => LoopingArrayCalculator, MarkdownInterpreter: () => MarkdownInterpreter, MathUtil: () => MathUtil, Menu: () => Menu, MenuItem: () => MenuItem, MultiSearchWithMapping: () => MultiSearchWithMapping, MultiSelect: () => MultiSelect, MultiSelectButton: () => MultiSelectButton, MultiSelectChipDisplay: () => MultiSelectChipDisplay, MultiSelectChipDisplayButton: () => MultiSelectChipDisplayButton, MultiSelectContent: () => MultiSelectContent, MultiSelectContext: () => MultiSelectContext, MultiSelectOption: () => MultiSelectOption, MultiSelectOptionDisplayContext: () => MultiSelectOptionDisplayContext, MultiSelectProperty: () => MultiSelectProperty, MultiSelectRoot: () => MultiSelectRoot, MultiSubjectSearchWithMapping: () => MultiSubjectSearchWithMapping, NO_COLUMN_ID: () => NO_COLUMN_ID, Navigation: () => Navigation, NavigationCard: () => NavigationCard, NavigationItemList: () => NavigationItemList, NavigationProvider: () => NavigationProvider, NumberFilterPopUp: () => NumberFilterPopUp, NumberInput: () => NumberInput, NumberProperty: () => NumberProperty, NumberStepperInput: () => NumberStepperInput, OverlayRegistry: () => OverlayRegistry, Pagination: () => Pagination, PopUp: () => PopUp, PopUpContext: () => PopUpContext, PopUpOpener: () => PopUpOpener, PopUpRoot: () => PopUpRoot, Portal: () => Portal, ProcessModelActivityNode: () => ProcessModelActivityNode, ProcessModelCanvas: () => ProcessModelCanvas, ProcessModelLayoutUtilities: () => ProcessModelLayoutUtilities, ProcessModelTerminalNode: () => ProcessModelTerminalNode, ProcessModelTraceReplay: () => ProcessModelTraceReplay, ProgressIndicator: () => ProgressIndicator, PromiseUtils: () => PromiseUtils, PropertyBase: () => PropertyBase, PropsUtil: () => PropsUtil, ReactRefsUtil: () => ReactRefsUtil, ScrollPicker: () => ScrollPicker, ScrollableList: () => ScrollableList, SearchBar: () => SearchBar, Select: () => Select, SelectButton: () => SelectButton, SelectContent: () => SelectContent, SelectContext: () => SelectContext, SelectOption: () => SelectOption, SelectOptionDisplayContext: () => SelectOptionDisplayContext, SelectRoot: () => SelectRoot, SimpleSearch: () => SimpleSearch, SimpleSearchWithMapping: () => SimpleSearchWithMapping, SingleSelectProperty: () => SingleSelectProperty, SortingList: () => SortingList, StepperBar: () => StepperBar, StorageListener: () => StorageListener, Switch: () => Switch, TabList: () => TabList, TabPanel: () => TabPanel, TabSwitcher: () => TabSwitcher, TabView: () => TabView, Table: () => Table, TableBody: () => TableBody, TableCell: () => TableCell, TableColumn: () => TableColumn, TableColumnDefinitionContext: () => TableColumnDefinitionContext, TableColumnSwitcher: () => TableColumnSwitcher, TableColumnSwitcherPopUp: () => TableColumnSwitcherPopUp, TableContainerContext: () => TableContainerContext, TableDisplay: () => TableDisplay, TableFilter: () => TableFilter, TableFilterButton: () => TableFilterButton, TableHeader: () => TableHeader, TablePageSizeSelect: () => TablePageSizeSelect, TablePagination: () => TablePagination, TablePaginationMenu: () => TablePaginationMenu, TableProvider: () => TableProvider, TableSortButton: () => TableSortButton, TableStateContext: () => TableStateContext, TableStateWithoutSizingContext: () => TableStateWithoutSizingContext, TableWithSelection: () => TableWithSelection, TableWithSelectionProvider: () => TableWithSelectionProvider, TagsFilterPopUp: () => TagsFilterPopUp, TagsSingleFilterPopUp: () => TagsSingleFilterPopUp, TextFilterPopUp: () => TextFilterPopUp, TextImage: () => TextImage, TextProperty: () => TextProperty, Textarea: () => Textarea, TextareaWithHeadline: () => TextareaWithHeadline, ThemeContext: () => ThemeContext, ThemeDialog: () => ThemeDialog, ThemeIcon: () => ThemeIcon, ThemeProvider: () => ThemeProvider, ThemeSelect: () => ThemeSelect, ThemeUtil: () => ThemeUtil, TimeDisplay: () => TimeDisplay, TimeInput: () => TimeInput, TimePicker: () => TimePicker, ToggleableInput: () => ToggleableInput, Tooltip: () => Tooltip, TooltipContext: () => TooltipContext, TooltipDisplay: () => TooltipDisplay, TooltipRoot: () => TooltipRoot, TooltipTrigger: () => TooltipTrigger, Transition: () => Transition, TreeUtilities: () => TreeUtilities, UseValidators: () => UseValidators, VerticalDivider: () => VerticalDivider, VerticalNavigationItem: () => VerticalNavigationMenuItem, VerticalNavigationMenu: () => VerticalNavigationMenu, VerticalNavigationMenuItem: () => VerticalNavigationMenuItem, VerticalNavigationProvider: () => NavigationProvider, VirtualizedCardGrid: () => VirtualizedCardGrid, VirtualizedTableBody: () => VirtualizedTableBody, Visibility: () => Visibility, YearMonthPicker: () => YearMonthPicker, buildSegmentLayout: () => buildSegmentLayout, builder: () => builder, chunkIntoRows: () => chunkIntoRows, clearSegment: () => clearSegment, closestMatch: () => closestMatch, columnsForWidth: () => columnsForWidth, composeDate: () => composeDate, createLoopingList: () => createLoopingList, createLoopingListWithIndex: () => createLoopingListWithIndex, createNoColumnPlaceholderColumn: () => createNoColumnPlaceholderColumn, decomposeDate: () => decomposeDate, editableSegmentTypes: () => editableSegmentTypes, editableTypesOf: () => editableTypesOf, equalSizeGroups: () => equalSizeGroups, findPageScrollContainer: () => findPageScrollContainer, findScrollableAncestor: () => findScrollableAncestor, formatSegment: () => formatSegment, getNeighbours: () => getNeighbours, getProcessModelLibraryEntry: () => getProcessModelLibraryEntry, getScrollMetrics: () => getScrollMetrics, hasNonExcludedColumns: () => hasNonExcludedColumns, hightideTranslation: () => hightideTranslation, hightideTranslationLocales: () => hightideTranslationLocales, isComplete: () => isComplete, isEmpty: () => isEmpty, isNearBottom: () => isNearBottom, match: () => match, mergeProps: () => mergeProps, noop: () => noop, overscanRowsForBuffer: () => overscanRowsForBuffer, processModelLibrary: () => processModelLibrary, range: () => range, resolveSetState: () => resolveSetState, resolveTreeNodePath: () => resolveTreeNodePath, segmentBounds: () => segmentBounds, segmentPlaceholder: () => segmentPlaceholder, setDayPeriod: () => setDayPeriod, stepSegment: () => stepSegment, timeUnitTranslationKey: () => timeUnitTranslationKey, toSizeVars: () => toSizeVars, toTreeNodes: () => toTreeNodes, typeDigit: () => typeDigit, useAnchoredPosition: () => useAnchoredPosition, useChangingNumber: () => useChangingNumber, useCombobox: () => useCombobox, useComboboxContext: () => useComboboxContext, useControlledState: () => useControlledState, useCreateForm: () => useCreateForm, useDateTimeFormat: () => useDateTimeFormat, useDebouncer: () => useDebouncer, useDelay: () => useDelay, useDialogContext: () => useDialogContext, useDrawerContext: () => useDrawerContext, useEventCallbackStabilizer: () => useEventCallbackStabilizer, useFilterValueTranslation: () => useFilterValueTranslation, useFocusGuards: () => useFocusGuards, useFocusManagement: () => useFocusManagement, useFocusOnceVisible: () => useFocusOnceVisible, useFocusTrap: () => useFocusTrap, useForm: () => useForm, useFormField: () => useFormField, useFormObserver: () => useFormObserver, useFormObserverKey: () => useFormObserverKey, useHandleRefs: () => useHandleRefs, useHightideConfig: () => useHightideConfig, useHightideTranslation: () => useHightideTranslation, useICUTranslation: () => useICUTranslation, useIsMounted: () => useIsMounted, useLanguage: () => useLanguage, useListNavigation: () => useListNavigation, useLocale: () => useLocale, useLogOnce: () => useLogOnce, useLogUnstableDependencies: () => useLogUnstableDependencies, useMultiSelect: () => useMultiSelect, useMultiSelectContext: () => useMultiSelectContext, useMultiSelectOptionDisplayLocation: () => useMultiSelectOptionDisplayLocation, useMultiSelection: () => useMultiSelection, useNaturalColumnWidthLock: () => useNaturalColumnWidthLock, useNavigationContext: () => useNavigationContext, useNavigationItem: () => useNavigationItem, useOutsideClick: () => useOutsideClick, useOverlayRegistry: () => useOverlayRegistry, useOverwritableState: () => useOverwritableState, usePopUpContext: () => usePopUpContext, usePresenceRef: () => usePresenceRef, useRerender: () => useRerender, useResizeObserver: () => useResizeObserver, useScrollObserver: () => useScrollObserver, useScrollbarState: () => useScrollbarState, useSearch: () => useSearch, useSelect: () => useSelect, useSelectContext: () => useSelectContext, useSelectOptionDisplayLocation: () => useSelectOptionDisplayLocation, useSingleSelection: () => useSingleSelection, useStepperHold: () => useStepperHold, useStorage: () => useStorage, useSwipeGesture: () => useSwipeGesture, useTabContext: () => useTabContext, useTableColumnDefinitionContext: () => useTableColumnDefinitionContext, useTableContainerContext: () => useTableContainerContext, useTableStateContext: () => useTableStateContext, useTableStateWithoutSizingContext: () => useTableStateWithoutSizingContext, useTheme: () => useTheme, useThrottle: () => useThrottle, useTimeZone: () => useTimeZone, useTooltip: () => useTooltip, useTransitionState: () => useTransitionState, useTranslatedValidators: () => useTranslatedValidators, useTreeExpansion: () => useTreeExpansion, useTreeFocusNavigation: () => useTreeFocusNavigation, useTreeNavigation: () => useTreeNavigation, useTypeAheadSearch: () => useTypeAheadSearch, useUpdatingDateString: () => useUpdatingDateString, useVerticalNavigationContext: () => useNavigationContext, useVerticalNavigationItem: () => useNavigationItem, useVirtualizedRows: () => useVirtualizedRows, useWindowResizeObserver: () => useWindowResizeObserver, validateEmail: () => validateEmail, writeToClipboard: () => writeToClipboard }); module.exports = __toCommonJS(index_exports); // src/components/branding/AppZumDocBadge.tsx var import_clsx2 = __toESM(require("clsx")); // src/components/branding/AppZumDocLogo.tsx var import_react = require("react"); var import_clsx = require("clsx"); var import_jsx_runtime = require("react/jsx-runtime"); var backFillPath = "M33.1817 37.511L29.7804 37.511C21.7695 37.511 15.2754 44.0051 15.2754 52.016C15.2754 60.0268 21.7695 66.5209 29.7804 66.5209H35.4017C35.4208 66.5209 35.4274 66.5239 35.4301 66.5251C35.436 66.5275 35.4456 66.5331 35.4559 66.5434C35.4662 66.5536 35.4717 66.5633 35.4742 66.5691C35.4754 66.5719 35.4783 66.5785 35.4783 66.5975L35.4783 72.852C35.4783 80.8628 41.9724 87.3569 49.9833 87.3569C57.9942 87.3569 64.4883 80.8628 64.4883 72.852L64.4883 54.7684C64.4883 45.2374 56.7619 37.511 47.2309 37.511L43.6515 37.511V42.1072L47.2309 42.1072C54.2235 42.1072 59.8921 47.7758 59.8921 54.7684V72.852C59.8921 78.3244 55.4558 82.7608 49.9833 82.7608C44.5108 82.7608 40.0745 78.3244 40.0745 72.852L40.0745 66.5975C40.0745 64.0168 37.9824 61.9248 35.4017 61.9248L29.7804 61.9248C24.3079 61.9248 19.8716 57.4884 19.8716 52.016C19.8716 46.5435 24.3079 42.1072 29.7804 42.1072L33.1817 42.1072V37.511Z"; var frontFillPath = "M65.0734 29.3412C65.0734 21.3303 58.5793 14.8362 50.5685 14.8362C42.5576 14.8362 36.0635 21.3303 36.0635 29.3412V47.4247C36.0635 56.9557 43.7899 64.6821 53.3209 64.6821H57.4673V60.086H53.3209C46.3283 60.086 40.6597 54.4173 40.6597 47.4247V29.3412C40.6597 23.8687 45.096 19.4324 50.5685 19.4324C56.0409 19.4324 60.4773 23.8687 60.4773 29.3412V35.5956C60.4773 38.1763 62.5693 40.2684 65.15 40.2684H70.7714C76.2439 40.2684 80.6802 44.7047 80.6802 50.1772C80.6802 55.6496 76.2439 60.086 70.7714 60.086H66.7949V64.6821H70.7714C78.7823 64.6821 85.2764 58.188 85.2764 50.1772C85.2764 42.1663 78.7823 35.6722 70.7714 35.6722H65.15C65.131 35.6722 65.1244 35.6692 65.1216 35.668C65.1158 35.6656 65.1061 35.66 65.0959 35.6497C65.0856 35.6395 65.08 35.6298 65.0776 35.624L65.0775 35.6238C65.0763 35.6209 65.0734 35.6142 65.0734 35.5956V29.3412Z"; var backStrokePath = "M43.65 39.81 L47.23 39.81 A14.96 14.96 0 0 1 62.19 54.77 L62.19 72.85 A12.21 12.21 0 0 1 37.78 72.85 L37.78 66.6 Q37.78 64.22 35.4 64.22 L29.78 64.22 A12.21 12.21 0 0 1 29.78 39.81 L33.18 39.81"; var frontStrokePath = "M57.47 62.38 L53.32 62.38 A14.96 14.96 0 0 1 38.36 47.42 L38.36 29.34 A12.21 12.21 0 0 1 62.78 29.34 L62.78 35.6 Q62.78 37.97 65.15 37.97 L70.77 37.97 A12.21 12.21 0 0 1 70.77 62.38 L66.79 62.38"; var AppZumDocLogo = ({ frontColor = "#095763", backColor = "#4E97A2", animate = "none", size, animationDuration = 1.7, ...props }) => { const id = (0, import_react.useId)(); const isLoadingAnimation = animate === "loading"; let svgAnimationKey = ""; if (animate === "pulse") { svgAnimationKey = "animate-pulse"; } else if (animate === "bounce") { svgAnimationKey = "animate-bounce"; } const style = animationDuration !== void 0 && isLoadingAnimation ? { ...props.style, "--helpwave-loading-duration": `${animationDuration}s` } : props.style; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "svg", { ...props, style, viewBox: "14 14 72 74", fill: "none", className: (0, import_clsx.clsx)({ "max-w-16 max-h-16 min-w-16 min-h-16": size === "lg", "max-w-12 max-h-12 min-w-12 min-h-12": size === "md", "max-w-8 max-h-8 min-w-8 min-h-8": size === "sm" }, props.className), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { className: (0, import_clsx.clsx)(svgAnimationKey), children: isLoadingAnimation ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("clipPath", { id: `${id}-back`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: backFillPath }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("clipPath", { id: `${id}-front`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: frontFillPath }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { clipPath: `url(#${id}-back)`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "path", { className: "animate-azd-fill-back", d: backStrokePath, stroke: backColor, strokeWidth: 7, strokeLinecap: "round", pathLength: 1e3, strokeDasharray: "1000 2000" } ) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { clipPath: `url(#${id}-front)`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "path", { className: "animate-azd-fill-front", d: frontStrokePath, stroke: frontColor, strokeWidth: 7, strokeLinecap: "round", pathLength: 1e3, strokeDasharray: "1000 2000" } ) }) ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: backFillPath, fill: backColor }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: frontFillPath, fill: frontColor }) ] }) }) } ); }; // src/components/branding/AppZumDocBadge.tsx var import_jsx_runtime2 = require("react/jsx-runtime"); var AppZumDocBadge = ({ size = "sm", ...props }) => { return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)( "span", { ...props, className: (0, import_clsx2.default)( "flex flex-row items-center font-bold font-space rounded-md text-[#057986]", { "gap-x-1": size === "sm", "gap-x-2 text-lg": size === "md", "gap-x-2 text-xl": size === "lg" }, props.className ), children: [ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppZumDocLogo, { size }), "App zum Doc" ] } ); }; // src/components/branding/HelpwaveLogo.tsx var import_clsx3 = require("clsx"); var import_jsx_runtime3 = require("react/jsx-runtime"); var HelpwaveLogo = ({ color = "currentColor", size, animate = "none", animationDuration = 1.7, ...props }) => { const isLoadingAnimation = animate === "loading"; let svgAnimationKey = ""; if (animate === "pulse") { svgAnimationKey = "animate-pulse"; } else if (animate === "bounce") { svgAnimationKey = "animate-bounce"; } const style = animationDuration !== void 0 && isLoadingAnimation ? { ...props.style, "--helpwave-loading-duration": `${animationDuration}s` } : props.style; return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( "svg", { ...props, style, viewBox: "0 0 1024 1024", fill: "none", strokeLinecap: "round", strokeWidth: 65, className: (0, import_clsx3.clsx)({ "max-w-16 max-h-16 min-w-16 min-h-16": size === "lg", "max-w-12 max-h-12 min-w-12 min-h-12": size === "md", "max-w-8 max-h-8 min-w-8 min-h-8": size === "sm" }, props.className), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("g", { className: (0, import_clsx3.clsx)(svgAnimationKey), children: [ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( "path", { className: (0, import_clsx3.clsx)({ "animate-wave-big-left-up": isLoadingAnimation }), d: "M146 644.214C146 498.088 253.381 379.629 385.843 379.629", stroke: color, strokeDasharray: "1000 1000" } ), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( "path", { className: (0, import_clsx3.clsx)({ "animate-wave-big-right-down": isLoadingAnimation }), d: "M625.686 645.272C493.224 645.272 385.843 526.813 385.843 380.687", stroke: color, strokeDasharray: "1000 1000" } ), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( "path", { className: (0, import_clsx3.clsx)({ "animate-wave-small-left-up": isLoadingAnimation }), d: "M533.585 613.522C533.585 508.895 610.47 424.079 705.312 424.079", stroke: color, strokeDasharray: "1000 1000" } ), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( "path", { className: (0, import_clsx3.clsx)({ "animate-wave-small-right-down": isLoadingAnimation }), d: "M878 615.639C782.628 615.639 705.313 530.822 705.313 426.196", stroke: color, strokeDasharray: "1000 1000" } ) ] }) } ); }; // src/components/branding/HelpwaveBadge.tsx var import_clsx4 = __toESM(require("clsx")); var import_jsx_runtime4 = require("react/jsx-runtime"); var HelpwaveBadge = ({ size = "sm", ...props }) => { return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)( "span", { ...props, className: (0, import_clsx4.default)( "flex flex-row items-center font-bold font-space rounded-md", { "gap-x-1": size === "sm", "gap-x-2 text-lg": size === "md", "gap-x-2 text-xl": size === "lg" }, props.className ), children: [ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HelpwaveLogo, { size }), "helpwave" ] } ); }; // src/components/chat/ChatAttachmentCard.tsx var import_clsx6 = __toESM(require("clsx")); var import_lucide_react = require("lucide-react"); // src/components/user-interaction/IconButton.tsx var import_react15 = require("react"); // src/components/user-interaction/Tooltip.tsx var import_react10 = require("react"); var import_react11 = require("react"); var import_react12 = require("react"); // src/hooks/useOverlayRegistry.ts var import_react2 = require("react"); var OverlayRegistry = class _OverlayRegistry { constructor() { // The frontmost overlay is at the end of the array this.overlayIds = []; this.overlayItems = {}; this.listeners = /* @__PURE__ */ new Set(); } static { this.instance = null; } static getInstance() { if (!_OverlayRegistry.instance) { _OverlayRegistry.instance = new _OverlayRegistry(); } return _OverlayRegistry.instance; } register(item) { this.overlayIds = this.overlayIds.filter((id) => id !== item.id); this.overlayIds.push(item.id); this.overlayItems[item.id] = item; this.notify(); return () => { this.overlayIds = this.overlayIds.filter((id) => id !== item.id); delete this.overlayItems[item.id]; this.notify(); }; } update(item) { this.overlayItems[item.id] = item; this.notify(); } addListener(callback) { this.listeners.add(callback); return () => { this.listeners.delete(callback); }; } notify() { const itemInformation = {}; const ids = [...this.overlayIds]; const startZIndex = 100; const tagCount = {}; for (let index = ids.length - 1; index >= 0; index--) { const id = ids[index]; const item = this.overlayItems[id]; itemInformation[id] = { ...item, position: index, tagPositions: {}, zIndex: startZIndex + index }; for (const tag of item.tags ?? []) { const count = tagCount[tag] ?? 0; const nextPosition = count; tagCount[tag] = count + 1; itemInformation[id].tagPositions[tag] = nextPosition; } } for (const callback of this.listeners) { callback({ activeId: ids[ids.length - 1] ?? null, itemInformation, tagItemCounts: tagCount }); } } }; var useOverlayRegistry = (props = {}) => { const generatedId = (0, import_react2.useId)(); const item = (0, import_react2.useMemo)(() => ({ id: props.id ?? generatedId, tags: props.tags }), [props.id, generatedId, props.tags]); const [value, setValue] = (0, import_react2.useState)({ activeId: null, itemInformation: {}, tagItemCounts: {} }); const registry = (0, import_react2.useMemo)(() => OverlayRegistry.getInstance(), []); (0, import_react2.useEffect)(() => { if (!props.isActive) { return; } function callback(value2) { setValue(value2); } const removeListener = registry.addListener(callback); const unregister = registry.register(item); return () => { removeListener(); unregister(); setValue({ activeId: null, itemInformation: {}, tagItemCounts: {} }); }; }, [props.isActive, item, registry]); const itemInformation = value.itemInformation[item.id]; return { isInFront: value.activeId === item.id, zIndex: itemInformation?.zIndex, position: itemInformation?.position, tagPositions: itemInformation?.tagPositions, tagItemCounts: value.tagItemCounts }; }; // src/hooks/useTransitionState.ts var import_react3 = require("react"); var reducer = (state, action) => { switch (action) { case "open": return "opening"; case "close": return "closing"; case "finished": { if (state === "opening") { return "opened"; } if (state === "closing") { return "closed"; } return state; } default: return state; } }; var useTransitionState = ({ isOpen, initialState = "closed", ref, timeout: initialTimeout = 1e3 }) => { const [state, dispatch] = (0, import_react3.useReducer)(reducer, initialState); const timer = (0, import_react3.useRef)(void 0); const hasAnimation = (0, import_react3.useRef)(false); const [timeout] = (0, import_react3.useState)(initialTimeout); (0, import_react3.useEffect)(() => { if (isOpen && (state !== "opened" && state !== "opening")) { dispatch("open"); } else if (!isOpen && (state !== "closed" && state !== "closing")) { dispatch("close"); } }, [isOpen, state]); (0, import_react3.useEffect)(() => { if (state === "opening" || state === "closing") { if (timer.current) { clearTimeout(timer.current); } if (timeout > 0) { timer.current = setTimeout(() => { dispatch("finished"); }, timeout); } } else { if (timer.current) { clearTimeout(timer.current); } } }, [state, timeout]); (0, import_react3.useLayoutEffect)(() => { if (state === "opening" || state === "closing") { let element = ref.current; if (!element) { console.warn("useTransitionState: ref is not set to an element using window instead"); element = window.document.body; } const animations = element.getAnimations({ subtree: true }).filter((animation) => animation.effect?.getTiming().duration !== "0s"); if (animations.length > 0) { hasAnimation.current = true; Promise.all(animations.map((animation) => animation.finished)).then(() => { dispatch("finished"); }).catch(() => { dispatch("finished"); }); } else { dispatch("finished"); hasAnimation.current = false; clearTimeout(timer.current); } } }, [ref, state]); const onStart = (0, import_react3.useCallback)(() => { hasAnimation.current = true; }, []); const onEnd = (0, import_react3.useCallback)(() => { dispatch("finished"); hasAnimation.current = false; }, []); (0, import_react3.useEffect)(() => { if (ref?.current && (state === "opening" || state === "closing")) { const element = ref.current; element.addEventListener("animationstart", onStart); element.addEventListener("animationend", onEnd); element.addEventListener("transitionstart", onStart); element.addEventListener("transitionend", onEnd); element.addEventListener("transitioncancel", onEnd); return () => { element.removeEventListener("animationstart", onStart); element.removeEventListener("animationend", onEnd); element.removeEventListener("transitionstart", onStart); element.removeEventListener("transitionend", onEnd); element.removeEventListener("transitioncancel", onEnd); }; } }, [state, ref, onStart, onEnd]); return { transitionState: state, isVisible: state !== "closed" }; }; // src/global-contexts/HightideConfigContext.tsx var import_react4 = require("react"); var import_jsx_runtime5 = require("react/jsx-runtime"); var defaultConfig = { tooltip: { appearDelay: 0, isAnimated: false, screenPadding: 1 }, theme: { initialTheme: "light" }, locale: { defaultLocale: "de-DE" } }; function mergeConfig(config, overwrite) { return { locale: { ...config.locale, ...overwrite?.locale }, theme: { ...config.theme, ...overwrite.theme }, tooltip: { ...config.tooltip, ...overwrite.tooltip } }; } var HightideConfigContext = (0, import_react4.createContext)(null); var HightideConfigProvider = ({ children, ...initialOverwrite }) => { const [config, setConfig] = (0, import_react4.useState)(mergeConfig(defaultConfig, initialOverwrite)); return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( HightideConfigContext.Provider, { value: { config, setConfig: (value) => setConfig((prevState) => mergeConfig(prevState, value)) }, children } ); }; var useHightideConfig = () => { const context = (0, import_react4.useContext)(HightideConfigContext); if (!context) { return { config: defaultConfig, setConfig: () => { console.error("useHightideConfig.setConfig is not available without a HightideConfigProvider. Try wrapping your app a HightideConfigProvider."); } }; } return context; }; // src/components/utils/Portal.tsx var import_react_dom = require("react-dom"); var Portal = ({ children, container }) => { return (0, import_react_dom.createPortal)(children, container ?? document.body); }; // src/components/layout/AnchoredFloatingContainer.tsx var import_react9 = require("react"); // src/hooks/useAnchoredPosition.ts var import_react8 = require("react"); // src/utils/math.ts function clamp(value, min, max) { if (min !== void 0) value = Math.max(value, min); if (max !== void 0) value = Math.min(value, max); return value; } function clamp01(value) { return clamp(value, 0, 1); } function closestStep(value, stepSize) { return Math.round(value / stepSize) * stepSize; } function toStepRange(value, stepSize, min, max) { const minStep = min !== void 0 ? Math.ceil(min / stepSize) * stepSize : void 0; const maxStep = max !== void 0 ? Math.floor(max / stepSize) * stepSize : void 0; value = closestStep(value, stepSize); if (minStep !== void 0) value = Math.max(value, minStep); if (maxStep !== void 0) value = Math.min(value, maxStep); return value; } function resolveLoopingRangeValue(value, minimum, maximum) { const range2 = maximum - minimum; if (value > maximum) { return { value: (value - maximum) % range2 + minimum, loopedOver: "maximum" }; } if (value < minimum) { return { value: (value - minimum) % range2 + minimum, loopedOver: "minimum" }; } return { value, loopedOver: null }; } var MathUtil = { clamp, clamp01, toStepRange, closestStep, resolveLoopingRangeValue }; // src/hooks/useWindowResizeObserver.ts var import_react5 = require("react"); var useWindowResizeObserver = (onResize) => { (0, import_react5.useEffect)(() => { window.addEventListener("resize", onResize); return () => { window.removeEventListener("resize", onResize); }; }, [onResize]); }; // src/hooks/useResizeObserver.ts var import_react6 = require("react"); function useResizeObserver({ observedElementRef, onResize, isActive = true }) { (0, import_react6.useLayoutEffect)(() => { const el = observedElementRef?.current; if (!el || !isActive) return; const observer = new ResizeObserver(() => { onResize(); }); observer.observe(el); return () => { observer.disconnect(); }; }, [observedElementRef, onResize, isActive]); } // src/hooks/useScrollObserver.ts var import_react7 = require("react"); function getScrollParents(el) { const parents = []; let parent = el.parentElement; while (parent) { const { overflow, overflowX, overflowY } = getComputedStyle(parent); if (/(auto|scroll|overlay)/.test(overflow + overflowX + overflowY)) { parents.push(parent); } parent = parent.parentElement; } parents.push(window); return parents; } function useScrollObserver({ observedElementRef, onScroll, isActive = true }) { (0, import_react7.useLayoutEffect)(() => { if (!observedElementRef?.current || !isActive) return; const parents = getScrollParents(observedElementRef.current); parents.forEach((p) => p.addEventListener("scroll", onScroll, { passive: true })); return () => { parents.forEach((p) => p.removeEventListener("scroll", onScroll)); }; }, [observedElementRef, onScroll, isActive]); } // src/hooks/useAnchoredPosition.ts function calculatePosition({ windowRect, containerRect, anchorRect, options }) { const { verticalAlignment, horizontalAlignment, gap, screenPadding, avoidOverlap } = options; const calculateBasicPosition = (hAlign, vAlign) => { const windowWidth = windowRect.width; const windowHeight = windowRect.height; const maxWidth = windowWidth - 2 * screenPadding; const maxHeight = windowHeight - 2 * screenPadding; const width = Math.min(containerRect.width, maxWidth); const height = Math.min(containerRect.height, maxHeight); const anchorCenterX = anchorRect.left + anchorRect.width / 2; const anchorCenterY = anchorRect.top + anchorRect.height / 2; let left; let top; let translateXPercent; let translateYPercent; switch (hAlign) { case "beforeStart": left = anchorRect.left; translateXPercent = -100; break; case "afterStart": left = anchorRect.left; translateXPercent = 0; break; case "center": left = anchorCenterX; translateXPercent = -50; break; case "beforeEnd": left = anchorRect.right; translateXPercent = -100; break; case "afterEnd": left = anchorRect.right; translateXPercent = 0; break; } switch (vAlign) { case "beforeStart": top = anchorRect.top; translateYPercent = -100; break; case "afterStart": top = anchorRect.top; translateYPercent = 0; break; case "center": top = anchorCenterY; translateYPercent = -50; break; case "beforeEnd": top = anchorRect.bottom; translateYPercent = -100; break; case "afterEnd": top = anchorRect.bottom; translateYPercent = 0; break; } if (gap !== 0) { if (hAlign === "afterEnd") { left += gap; } else if (hAlign === "beforeStart") { left -= gap; } if (vAlign === "afterEnd") { top += gap; } else if (vAlign === "beforeStart") { top -= gap; } } const targetLeft = left + width * translateXPercent / 100; const targetTop = top + height * translateYPercent / 100; const clampedLeft = MathUtil.clamp(targetLeft, screenPadding, windowWidth - screenPadding - width); const clampedTop = MathUtil.clamp(targetTop, screenPadding, windowHeight - screenPadding - height); return { left, top, clampedLeft, clampedTop, width, height, maxWidth, maxHeight }; }; const calculateOverlap = (left, top, width, height) => { const floatingRect = { left, top, right: left + width, bottom: top + height }; const overlapLeft = Math.max(floatingRect.left, anchorRect.left); const overlapTop = Math.max(floatingRect.top, anchorRect.top); const overlapRight = Math.min(floatingRect.right, anchorRect.right); const overlapBottom = Math.min(floatingRect.bottom, anchorRect.bottom); const overlapWidth = Math.max(0, overlapRight - overlapLeft); const overlapHeight = Math.max(0, overlapBottom - overlapTop); return overlapWidth * overlapHeight; }; const originalPos = calculateBasicPosition(horizontalAlignment, verticalAlignment); let bestPosition = originalPos; if (avoidOverlap && (horizontalAlignment === "beforeStart" || horizontalAlignment === "afterEnd" || verticalAlignment === "beforeStart" || verticalAlignment === "afterEnd")) { let bestOverlap = calculateOverlap(originalPos.clampedLeft, originalPos.clampedTop, originalPos.width, originalPos.height); let altHorizontalAlignment = horizontalAlignment; let altVerticalAlignment = verticalAlignment; if (horizontalAlignment === "beforeStart") { altHorizontalAlignment = "afterEnd"; } else if (horizontalAlignment === "afterEnd") { altHorizontalAlignment = "beforeStart"; } if (verticalAlignment === "beforeStart") { altVerticalAlignment = "afterEnd"; } else if (verticalAlignment === "afterEnd") { altVerticalAlignment = "beforeStart"; } const altPos = calculateBasicPosition(altHorizontalAlignment, altVerticalAlignment); const altOverlap = calculateOverlap(altPos.clampedLeft, altPos.clampedTop, altPos.width, altPos.height); if (altOverlap < bestOverlap) { bestPosition = altPos; bestOverlap = altOverlap; } } return { left: bestPosition.clampedLeft, top: bestPosition.clampedTop, maxWidth: bestPosition.maxWidth, maxHeight: bestPosition.maxHeight, transformOrigin: "top left" }; } var measureSizes = ({ containerRef, anchorRef, windowRef }) => { const visualViewport = window.visualViewport; const fallback = visualViewport ? { top: 0, bottom: visualViewport.height - visualViewport.offsetTop, left: 0, right: visualViewport.width - visualViewport.offsetLeft, width: visualViewport.width - visualViewport.offsetLeft, height: visualViewport.height - visualViewport.offsetTop } : { top: 0, bottom: window.innerHeight, left: 0, right: window.innerWidth, width: window.innerWidth, height: window.innerHeight }; return { container: containerRef?.current?.getBoundingClientRect(), anchor: anchorRef?.current?.getBoundingClientRect(), window: windowRef?.current?.getBoundingClientRect() ?? fallback }; }; var isSameMeasurment = (a, b) => !!a && !!b && a.container?.width === b.container?.width && a.container?.height === b.container?.height && a.anchor?.top === b.anchor?.top && a.anchor?.left === b.anchor?.left && a.anchor?.right === b.anchor?.right && a.anchor?.bottom === b.anchor?.bottom && a.anchor?.width === b.anchor?.width && a.anchor?.height === b.anchor?.height && a.window?.top === b.window?.top && a.window?.left === b.window?.left && a.window?.right === b.window?.right && a.window?.bottom === b.window?.bottom && a.window?.width === b.window?.width && a.window?.height === b.window?.height; var isSameOptions = (a, b) => !!a && !!b && a.horizontalAlignment === b.horizontalAlignment && a.verticalAlignment === b.verticalAlignment && a.screenPadding === b.screenPadding && a.gap === b.gap && a.avoidOverlap === b.avoidOverlap; function useAnchoredPosition({ active = true, window: windowRef, anchor: anchorRef, container: containerRef, isPolling = false, isReactingToResize = true, isReactingToScroll = false, pollingInterval = 100, verticalAlignment = "afterEnd", horizontalAlignment = "afterStart", avoidOverlap = false, screenPadding = 16, gap = 4 }) { const [style, setStyle] = (0, import_react8.useState)(); const lastSizes = (0, import_react8.useRef)(null); const lastOptions = (0, import_react8.useRef)(null); const options = (0, import_react8.useMemo)(() => ({ horizontalAlignment, verticalAlignment, screenPadding, gap, avoidOverlap }), [horizontalAlignment, verticalAlignment, screenPadding, gap, avoidOverlap]); const calculate2 = (0, import_react8.useCallback)(() => { const newMeasurement = measureSizes({ containerRef, anchorRef, windowRef }); if (!newMeasurement) return; if (isSameMeasurment(lastSizes.current, newMeasurement) && isSameOptions(options, lastOptions.current)) return; lastSizes.current = newMeasurement; lastOptions.current = options; if (!newMeasurement.container) { return; } const containerRect = newMeasurement.container; const windowRect = newMeasurement.window; const anchorRect = newMeasurement.anchor ?? newMeasurement.window; if (containerRect.width === 0 || containerRect.height === 0) { return; } const calculateProps = { windowRect, anchorRect, containerRect, options }; setStyle(calculatePosition(calculateProps)); }, [anchorRef, containerRef, options, windowRef]); (0, import_react8.useLayoutEffect)(() => { if (!active) { setStyle(void 0); lastSizes.current = null; return; } else { calculate2(); } }, [active, options, calculate2]); useWindowResizeObserver(calculate2); useResizeObserver({ observedElementRef: containerRef, onResize: calculate2, isActive: isReactingToResize && active }); useResizeObserver({ observedElementRef: anchorRef, onResize: calculate2, isActive: isReactingToResize && active }); useResizeObserver({ observedElementRef: windowRef, onResize: calculate2, isActive: isReactingToResize && active }); useScrollObserver({ observedElementRef: anchorRef, onScroll: calculate2, isActive: isReactingToScroll && active }); (0, import_react8.useEffect)(() => { if (!containerRef.current || !active) { return; } let timeout; if (isPolling) { timeout = setInterval(calculate2, pollingInterval); } return () => { if (timeout) { clearInterval(timeout); } }; }, [active, calculate2, containerRef, isPolling, pollingInterval]); return style; } // src/utils/reactRefs.ts function assignForwardRef(element, ref) { if (!ref) return; if (typeof ref === "function") { ref(element); } else { ref.current = element; } } function assingRefsBuilder(refs) { return (element) => { refs.forEach((ref) => { assignForwardRef(element, ref); }); }; } var ReactRefsUtil = { assignForwardRef, assingRefsBuilder }; // src/components/layout/AnchoredFloatingContainer.tsx var import_jsx_runtime6 = require("react/jsx-runtime"); var AnchoredFloatingContainer = (0, import_react9.forwardRef)(function FloatingContainer({ children, anchor, options = {}, active = true, ...props }, forwardRef38) { const innerRef = (0, import_react9.useRef)(null); const position = useAnchoredPosition({ ...options, container: innerRef, anchor, active }); return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( "div", { ...props, ref: ReactRefsUtil.assingRefsBuilder([innerRef, forwardRef38]), "data-positioned": position ? "" : void 0, style: { overflow: "hidden", ...position, ...props.style }, children } ); }); // src/components/user-interaction/Tooltip.tsx var import_react13 = require("react"); // src/utils/bagFunctions.ts var resolve = (bagFunctionOrValue, bag) => { if (typeof bagFunctionOrValue === "function") { return bagFunctionOrValue(bag); } return bagFunctionOrValue; }; var BagFunctionUtil = { resolve }; // src/components/user-interaction/Tooltip.tsx var import_jsx_runtime7 = require("react/jsx-runtime"); var TooltipContext = (0, import_react13.createContext)(null); var useTooltip = () => { const context = (0, import_react10.useContext)(TooltipContext); if (!context) { throw new Error("useTooltip must be used within a TooltipContext.Provider or TooltipRoot"); } return context; }; var TooltipRoot = ({ children, isInitiallyShown = false, onIsShownChange, appearDelay: appearOverwrite, disabled = false }) => { const generatedId = "tooltip-" + (0, import_react11.useId)(); const [tooltipId, setTooltipId] = (0, import_react12.useState)(generatedId); const [isShown, setIsShown] = (0, import_react12.useState)(isInitiallyShown); const timeoutRef = (0, import_react12.useRef)(void 0); const { config } = useHightideConfig(); const appearDelay = (0, import_react12.useMemo)( () => appearOverwrite ?? config.tooltip.appearDelay, [appearOverwrite, config.tooltip.appearDelay] ); const triggerRef = (0, import_react12.useRef)(null); (0, import_react10.useEffect)(() => { onIsShownChange?.(isShown); }, [isShown, onIsShownChange]); const openWithDelay = (0, import_react12.useCallback)(() => { if (timeoutRef.current || isShown) return; if (appearDelay < 0) { setIsShown(true); return; } timeoutRef.current = setTimeout(() => { timeoutRef.current = void 0; setIsShown(true); }, appearDelay); }, [appearDelay, isShown]); const close2 = (0, import_react12.useCallb