@inkeep/agents-ui 0.1.0 → 0.14.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +64 -0
- package/README.md +1 -67
- package/dist/_virtual/index.cjs +1 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/use-sync-external-store-shim.development.cjs +1 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.cjs +1 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/color-mode/index.cjs +1 -0
- package/dist/color-mode/index.js +170 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +5093 -0
- package/dist/index.d.ts +5093 -0
- package/dist/index.js +213 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +9 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +9 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.cjs +1 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.js +8 -0
- package/dist/primitives/atoms/avatars/ai.cjs +1 -0
- package/dist/primitives/atoms/avatars/ai.js +99 -0
- package/dist/primitives/atoms/avatars/user.cjs +1 -0
- package/dist/primitives/atoms/avatars/user.js +27 -0
- package/dist/primitives/atoms/cmdk/command-score.cjs +1 -0
- package/dist/primitives/atoms/cmdk/command-score.js +46 -0
- package/dist/primitives/atoms/cmdk/index.cjs +1 -0
- package/dist/primitives/atoms/cmdk/index.js +521 -0
- package/dist/primitives/atoms/codeblock/index.cjs +1 -0
- package/dist/primitives/atoms/codeblock/index.js +40 -0
- package/dist/primitives/atoms/custom-styles.cjs +1 -0
- package/dist/primitives/atoms/custom-styles.js +57 -0
- package/dist/primitives/atoms/dialog.cjs +1 -0
- package/dist/primitives/atoms/dialog.js +226 -0
- package/dist/primitives/atoms/error-boundary.cjs +1 -0
- package/dist/primitives/atoms/error-boundary.js +9 -0
- package/dist/primitives/atoms/icons/built-in-icon-renderer.cjs +1 -0
- package/dist/primitives/atoms/icons/built-in-icon-renderer.js +51 -0
- package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -0
- package/dist/primitives/atoms/icons/built-in-icons.js +86 -0
- package/dist/primitives/atoms/icons/checkbox-icon.cjs +1 -0
- package/dist/primitives/atoms/icons/checkbox-icon.js +24 -0
- package/dist/primitives/atoms/icons/collections/bi.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/bi.js +49 -0
- package/dist/primitives/atoms/icons/collections/fi.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/fi.js +29 -0
- package/dist/primitives/atoms/icons/collections/gr.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/gr.js +21 -0
- package/dist/primitives/atoms/icons/collections/io5.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/io5.js +806 -0
- package/dist/primitives/atoms/icons/collections/pi.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/pi.js +49 -0
- package/dist/primitives/atoms/icons/custom-icon.cjs +1 -0
- package/dist/primitives/atoms/icons/custom-icon.js +19 -0
- package/dist/primitives/atoms/icons/generate-icon.cjs +1 -0
- package/dist/primitives/atoms/icons/generate-icon.js +56 -0
- package/dist/primitives/atoms/icons/index.cjs +1 -0
- package/dist/primitives/atoms/icons/index.js +6 -0
- package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -0
- package/dist/primitives/atoms/icons/inkeep-default-icons.js +24 -0
- package/dist/primitives/atoms/link.cjs +1 -0
- package/dist/primitives/atoms/link.js +35 -0
- package/dist/primitives/atoms/markdown/components.cjs +1 -0
- package/dist/primitives/atoms/markdown/components.js +73 -0
- package/dist/primitives/atoms/markdown/index.cjs +1 -0
- package/dist/primitives/atoms/markdown/index.js +115 -0
- package/dist/primitives/atoms/markdown/rehype-inline-code-property.cjs +1 -0
- package/dist/primitives/atoms/markdown/rehype-inline-code-property.js +12 -0
- package/dist/primitives/atoms/portal-with-theme.cjs +1 -0
- package/dist/primitives/atoms/portal-with-theme.js +12 -0
- package/dist/primitives/atoms/portal.cjs +1 -0
- package/dist/primitives/atoms/portal.js +19 -0
- package/dist/primitives/atoms/select.cjs +1 -0
- package/dist/primitives/atoms/select.js +785 -0
- package/dist/primitives/atoms/shadow/context.cjs +1 -0
- package/dist/primitives/atoms/shadow/context.js +54 -0
- package/dist/primitives/atoms/shadow/create.cjs +1 -0
- package/dist/primitives/atoms/shadow/create.js +56 -0
- package/dist/primitives/atoms/shadow/root.cjs +1 -0
- package/dist/primitives/atoms/shadow/root.js +22 -0
- package/dist/primitives/atoms/shadow/use-ensured-forwarded-ref.cjs +1 -0
- package/dist/primitives/atoms/shadow/use-ensured-forwarded-ref.js +11 -0
- package/dist/primitives/atoms/shadow/utils.cjs +1 -0
- package/dist/primitives/atoms/shadow/utils.js +16 -0
- package/dist/primitives/components/chat-button.cjs +1 -0
- package/dist/primitives/components/chat-button.js +46 -0
- package/dist/primitives/components/embedded-chat/chat-provider.cjs +1 -0
- package/dist/primitives/components/embedded-chat/chat-provider.js +20 -0
- package/dist/primitives/components/embedded-chat/use-chat-action.cjs +1 -0
- package/dist/primitives/components/embedded-chat/use-chat-action.js +38 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +3 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +160 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +82 -0
- package/dist/primitives/components/embedded-chat.cjs +11 -0
- package/dist/primitives/components/embedded-chat.js +1898 -0
- package/dist/primitives/components/embedded-search/search-provider.cjs +1 -0
- package/dist/primitives/components/embedded-search/search-provider.js +26 -0
- package/dist/primitives/components/embedded-search/transform-results.cjs +1 -0
- package/dist/primitives/components/embedded-search/transform-results.js +47 -0
- package/dist/primitives/components/embedded-search/url-query.cjs +1 -0
- package/dist/primitives/components/embedded-search/url-query.js +12 -0
- package/dist/primitives/components/embedded-search/use-inkeep-search.cjs +1 -0
- package/dist/primitives/components/embedded-search/use-inkeep-search.js +35 -0
- package/dist/primitives/components/embedded-search/use-search-filter.cjs +1 -0
- package/dist/primitives/components/embedded-search/use-search-filter.js +77 -0
- package/dist/primitives/components/embedded-search.cjs +1 -0
- package/dist/primitives/components/embedded-search.js +628 -0
- package/dist/primitives/components/factory.cjs +1 -0
- package/dist/primitives/components/factory.js +39 -0
- package/dist/primitives/components/index.cjs +1 -0
- package/dist/primitives/components/index.js +27 -0
- package/dist/primitives/components/modal/modal-provider.cjs +1 -0
- package/dist/primitives/components/modal/modal-provider.js +8 -0
- package/dist/primitives/components/modal/use-inkeep-modal.cjs +1 -0
- package/dist/primitives/components/modal/use-inkeep-modal.js +45 -0
- package/dist/primitives/components/modal/widget-auto-focus.cjs +1 -0
- package/dist/primitives/components/modal/widget-auto-focus.js +16 -0
- package/dist/primitives/components/modal.cjs +1 -0
- package/dist/primitives/components/modal.js +40 -0
- package/dist/primitives/components/presence.cjs +1 -0
- package/dist/primitives/components/presence.js +26 -0
- package/dist/primitives/components/searchbar.cjs +1 -0
- package/dist/primitives/components/searchbar.js +54 -0
- package/dist/primitives/components/sidebar-chat/index.cjs +1 -0
- package/dist/primitives/components/sidebar-chat/index.js +86 -0
- package/dist/primitives/components/sidebar-chat/use-sidebar-chat-resizer.cjs +1 -0
- package/dist/primitives/components/sidebar-chat/use-sidebar-chat-resizer.js +34 -0
- package/dist/primitives/components/tagline-logo-icon.cjs +1 -0
- package/dist/primitives/components/tagline-logo-icon.js +26 -0
- package/dist/primitives/components/use-component-trigger.cjs +1 -0
- package/dist/primitives/components/use-component-trigger.js +16 -0
- package/dist/primitives/constants/search.cjs +1 -0
- package/dist/primitives/constants/search.js +5 -0
- package/dist/primitives/hooks/index.cjs +1 -0
- package/dist/primitives/hooks/index.js +24 -0
- package/dist/primitives/hooks/use-boolean.cjs +1 -0
- package/dist/primitives/hooks/use-boolean.js +17 -0
- package/dist/primitives/hooks/use-component-classnames.cjs +1 -0
- package/dist/primitives/hooks/use-component-classnames.js +14 -0
- package/dist/primitives/hooks/use-container-size.cjs +1 -0
- package/dist/primitives/hooks/use-container-size.js +18 -0
- package/dist/primitives/hooks/use-copy-to-clipboard.cjs +1 -0
- package/dist/primitives/hooks/use-copy-to-clipboard.js +24 -0
- package/dist/primitives/hooks/use-debounce.cjs +1 -0
- package/dist/primitives/hooks/use-debounce.js +16 -0
- package/dist/primitives/hooks/use-instant-update.cjs +1 -0
- package/dist/primitives/hooks/use-instant-update.js +16 -0
- package/dist/primitives/hooks/use-is-mounted.cjs +1 -0
- package/dist/primitives/hooks/use-is-mounted.js +11 -0
- package/dist/primitives/hooks/use-media-query.cjs +1 -0
- package/dist/primitives/hooks/use-media-query.js +14 -0
- package/dist/primitives/hooks/use-resize-observer.cjs +1 -0
- package/dist/primitives/hooks/use-resize-observer.js +32 -0
- package/dist/primitives/hooks/use-scroll-to-bottom.cjs +1 -0
- package/dist/primitives/hooks/use-scroll-to-bottom.js +52 -0
- package/dist/primitives/hooks/use-scrolling-fades.cjs +1 -0
- package/dist/primitives/hooks/use-scrolling-fades.js +18 -0
- package/dist/primitives/hooks/use-settle-action.cjs +1 -0
- package/dist/primitives/hooks/use-settle-action.js +11 -0
- package/dist/primitives/index.cjs +1 -0
- package/dist/primitives/index.js +155 -0
- package/dist/primitives/providers/attachment-item-provider.cjs +1 -0
- package/dist/primitives/providers/attachment-item-provider.js +13 -0
- package/dist/primitives/providers/attachments-bar-provider.cjs +1 -0
- package/dist/primitives/providers/attachments-bar-provider.js +57 -0
- package/dist/primitives/providers/base-events-provider.cjs +1 -0
- package/dist/primitives/providers/base-events-provider.js +37 -0
- package/dist/primitives/providers/chat-form-provider.cjs +1 -0
- package/dist/primitives/providers/chat-form-provider.js +109 -0
- package/dist/primitives/providers/config-provider.cjs +1 -0
- package/dist/primitives/providers/config-provider.js +38 -0
- package/dist/primitives/providers/feedback-item-provider.cjs +1 -0
- package/dist/primitives/providers/feedback-item-provider.js +16 -0
- package/dist/primitives/providers/feedback-provider.cjs +1 -0
- package/dist/primitives/providers/feedback-provider.js +83 -0
- package/dist/primitives/providers/form-field-provider.cjs +1 -0
- package/dist/primitives/providers/form-field-provider.js +17 -0
- package/dist/primitives/providers/help-menu-provider.cjs +1 -0
- package/dist/primitives/providers/help-menu-provider.js +19 -0
- package/dist/primitives/providers/hover-popover-provider.cjs +1 -0
- package/dist/primitives/providers/hover-popover-provider.js +13 -0
- package/dist/primitives/providers/index.cjs +1 -0
- package/dist/primitives/providers/index.js +57 -0
- package/dist/primitives/providers/markdown-provider.cjs +1 -0
- package/dist/primitives/providers/markdown-provider.js +8 -0
- package/dist/primitives/providers/message-attachments-provider.cjs +1 -0
- package/dist/primitives/providers/message-attachments-provider.js +27 -0
- package/dist/primitives/providers/message-provider.cjs +1 -0
- package/dist/primitives/providers/message-provider.js +14 -0
- package/dist/primitives/providers/root-provider.cjs +1 -0
- package/dist/primitives/providers/root-provider.js +21 -0
- package/dist/primitives/providers/search-events-provider.cjs +1 -0
- package/dist/primitives/providers/search-events-provider.js +17 -0
- package/dist/primitives/providers/sidebar-chat-provider.cjs +1 -0
- package/dist/primitives/providers/sidebar-chat-provider.js +41 -0
- package/dist/primitives/providers/source-item-provider.cjs +1 -0
- package/dist/primitives/providers/source-item-provider.js +13 -0
- package/dist/primitives/providers/theme-provider.cjs +3 -0
- package/dist/primitives/providers/theme-provider.js +79 -0
- package/dist/primitives/providers/widget-provider.cjs +1 -0
- package/dist/primitives/providers/widget-provider.js +8 -0
- package/dist/primitives/utils/component-ids.cjs +1 -0
- package/dist/primitives/utils/component-ids.js +309 -0
- package/dist/primitives/utils/compose-event-handlers.cjs +1 -0
- package/dist/primitives/utils/compose-event-handlers.js +10 -0
- package/dist/primitives/utils/compose-refs.cjs +1 -0
- package/dist/primitives/utils/compose-refs.js +30 -0
- package/dist/primitives/utils/default-settings.cjs +1 -0
- package/dist/primitives/utils/default-settings.js +50 -0
- package/dist/primitives/utils/form.cjs +1 -0
- package/dist/primitives/utils/form.js +17 -0
- package/dist/primitives/utils/generate-uid.cjs +1 -0
- package/dist/primitives/utils/generate-uid.js +14 -0
- package/dist/primitives/utils/get-source-icon.cjs +1 -0
- package/dist/primitives/utils/get-source-icon.js +11 -0
- package/dist/primitives/utils/highlight-emphasis.cjs +1 -0
- package/dist/primitives/utils/highlight-emphasis.js +15 -0
- package/dist/primitives/utils/merge-props.cjs +1 -0
- package/dist/primitives/utils/merge-props.js +41 -0
- package/dist/primitives/utils/misc.cjs +1 -0
- package/dist/primitives/utils/misc.js +31 -0
- package/dist/primitives/utils/split-props.cjs +1 -0
- package/dist/primitives/utils/split-props.js +10 -0
- package/dist/react/chat-button.cjs +1 -0
- package/dist/react/chat-button.js +60 -0
- package/dist/react/embedded-chat.cjs +1 -0
- package/dist/react/embedded-chat.js +380 -0
- package/dist/react/embedded-search-and-chat.cjs +1 -0
- package/dist/react/embedded-search-and-chat.impl.cjs +1 -0
- package/dist/react/embedded-search-and-chat.impl.js +43 -0
- package/dist/react/embedded-search-and-chat.js +66 -0
- package/dist/react/embedded-search.cjs +1 -0
- package/dist/react/embedded-search.js +181 -0
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.js +213 -0
- package/dist/react/modal.chat.cjs +1 -0
- package/dist/react/modal.chat.js +21 -0
- package/dist/react/modal.cjs +1 -0
- package/dist/react/modal.js +27 -0
- package/dist/react/modal.search-and-chat.cjs +1 -0
- package/dist/react/modal.search-and-chat.js +27 -0
- package/dist/react/modal.search.cjs +1 -0
- package/dist/react/modal.search.js +21 -0
- package/dist/react/searchbar.cjs +1 -0
- package/dist/react/searchbar.js +68 -0
- package/dist/react/sidebar-chat.cjs +1 -0
- package/dist/react/sidebar-chat.js +49 -0
- package/dist/react/utils.cjs +1 -0
- package/dist/react/utils.js +20 -0
- package/dist/react/widget-toggle.cjs +1 -0
- package/dist/react/widget-toggle.js +65 -0
- package/dist/styled/components/chat-button.cjs +1 -0
- package/dist/styled/components/chat-button.js +56 -0
- package/dist/styled/components/data-summary-group.cjs +1 -0
- package/dist/styled/components/data-summary-group.js +76 -0
- package/dist/styled/components/embedded-chat.cjs +1 -0
- package/dist/styled/components/embedded-chat.js +1816 -0
- package/dist/styled/components/embedded-search/results-loading.cjs +1 -0
- package/dist/styled/components/embedded-search/results-loading.js +39 -0
- package/dist/styled/components/embedded-search.cjs +1 -0
- package/dist/styled/components/embedded-search.js +680 -0
- package/dist/styled/components/index.cjs +1 -0
- package/dist/styled/components/index.js +24 -0
- package/dist/styled/components/loading-indicator.cjs +1 -0
- package/dist/styled/components/loading-indicator.js +36 -0
- package/dist/styled/components/message.cjs +1 -0
- package/dist/styled/components/message.js +140 -0
- package/dist/styled/components/modal.cjs +1 -0
- package/dist/styled/components/modal.js +46 -0
- package/dist/styled/components/searchbar.cjs +1 -0
- package/dist/styled/components/searchbar.js +81 -0
- package/dist/styled/components/shadow.cjs +1 -0
- package/dist/styled/components/shadow.js +8 -0
- package/dist/styled/components/sidebar-chat.cjs +1 -0
- package/dist/styled/components/sidebar-chat.js +90 -0
- package/dist/styled/components/ui/markdown-styles.cjs +1 -0
- package/dist/styled/components/ui/markdown-styles.js +38 -0
- package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.cjs +1 -0
- package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.js +32 -0
- package/dist/styled/components/ui/recipes/attachment.cjs +1 -0
- package/dist/styled/components/ui/recipes/attachment.js +28 -0
- package/dist/styled/components/ui/recipes/button.cjs +1 -0
- package/dist/styled/components/ui/recipes/button.js +81 -0
- package/dist/styled/components/ui/recipes/checkbox.cjs +1 -0
- package/dist/styled/components/ui/recipes/checkbox.js +23 -0
- package/dist/styled/components/ui/recipes/citation.cjs +1 -0
- package/dist/styled/components/ui/recipes/citation.js +75 -0
- package/dist/styled/components/ui/recipes/icon.cjs +1 -0
- package/dist/styled/components/ui/recipes/icon.js +6 -0
- package/dist/styled/components/ui/recipes/index.cjs +1 -0
- package/dist/styled/components/ui/recipes/index.js +37 -0
- package/dist/styled/components/ui/recipes/input.cjs +1 -0
- package/dist/styled/components/ui/recipes/input.js +34 -0
- package/dist/styled/components/ui/recipes/link.cjs +1 -0
- package/dist/styled/components/ui/recipes/link.js +13 -0
- package/dist/styled/components/ui/recipes/markdown.cjs +1 -0
- package/dist/styled/components/ui/recipes/markdown.js +103 -0
- package/dist/styled/components/ui/recipes/modal.cjs +1 -0
- package/dist/styled/components/ui/recipes/modal.js +59 -0
- package/dist/styled/components/ui/recipes/popover.cjs +1 -0
- package/dist/styled/components/ui/recipes/popover.js +20 -0
- package/dist/styled/components/ui/recipes/scrollable.cjs +1 -0
- package/dist/styled/components/ui/recipes/scrollable.js +15 -0
- package/dist/styled/components/ui/recipes/select.cjs +1 -0
- package/dist/styled/components/ui/recipes/select.js +38 -0
- package/dist/styled/components/ui/recipes/skeleton.cjs +1 -0
- package/dist/styled/components/ui/recipes/skeleton.js +16 -0
- package/dist/styled/components/ui/recipes/widget-toggle.cjs +1 -0
- package/dist/styled/components/ui/recipes/widget-toggle.js +35 -0
- package/dist/styled/index.cjs +1 -0
- package/dist/styled/index.js +177 -0
- package/dist/styled/inkeep.css.cjs +4049 -0
- package/dist/styled/inkeep.css.js +4053 -0
- package/dist/styled/utils.cjs +1 -0
- package/dist/styled/utils.js +11 -0
- package/dist/theme/color-utils.cjs +1 -0
- package/dist/theme/color-utils.js +21 -0
- package/dist/theme/colors.cjs +1 -0
- package/dist/theme/colors.js +143 -0
- package/dist/theme/index.cjs +1 -0
- package/dist/theme/index.js +58 -0
- package/dist/theme/utils/create-css-variables.cjs +1 -0
- package/dist/theme/utils/create-css-variables.js +24 -0
- package/dist/theme/utils/generate-theme-variables.cjs +1 -0
- package/dist/theme/utils/generate-theme-variables.js +34 -0
- package/dist/types/message.cjs +1 -0
- package/dist/types/message.js +5 -0
- package/dist/types/types.d.cts +1754 -0
- package/dist/types/types.d.ts +1754 -0
- package/package.json +132 -39
- package/LICENSE.md +0 -51
- package/dist/assets/index-3anqgmEs.js +0 -49
- package/dist/assets/index-CF_BRP1w.css +0 -1
- package/dist/index.html +0 -14
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as h, Fragment as k, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Container as B, ChatButton as A, ChatButtonText as S, ChatButtonAvatarContent as w, ChatButtonAvatarImage as b } from "../styled/components/chat-button.js";
|
|
4
|
+
import { Shadow as v } from "../styled/components/shadow.js";
|
|
5
|
+
import { WebWidgetInteractionType as c } from "../primitives/providers/config-provider.js";
|
|
6
|
+
import { RootProvider as y } from "../primitives/providers/root-provider.js";
|
|
7
|
+
import { ErrorBoundary as O } from "../primitives/atoms/error-boundary.js";
|
|
8
|
+
import { InkeepModal as T } from "./modal.js";
|
|
9
|
+
import { InkeepEmbeddedSearchAndChatImpl as x } from "./embedded-search-and-chat.js";
|
|
10
|
+
import { useWidgetImpl as E } from "./embedded-search-and-chat.impl.js";
|
|
11
|
+
import { InkeepEmbeddedChatImpl as V } from "./embedded-chat.js";
|
|
12
|
+
import { composeEventHandlers as P } from "./utils.js";
|
|
13
|
+
import { useControllableState as W } from "@radix-ui/react-use-controllable-state";
|
|
14
|
+
function N(n) {
|
|
15
|
+
const {
|
|
16
|
+
modalSettings: e,
|
|
17
|
+
label: r,
|
|
18
|
+
defaultView: a = "chat",
|
|
19
|
+
canToggleView: o = !0,
|
|
20
|
+
avatar: i,
|
|
21
|
+
...m
|
|
22
|
+
} = n, u = {
|
|
23
|
+
...m,
|
|
24
|
+
shouldShowAskAICard: o ? n.shouldShowAskAICard : !1
|
|
25
|
+
}, { config: d, ...s } = E({ ...u, defaultView: a }), f = (p) => {
|
|
26
|
+
e?.isOpen === void 0 && (n.forceDefaultView && !p && s.setView(a ?? "search"), l(!!p));
|
|
27
|
+
}, [C = !1, l] = W({
|
|
28
|
+
prop: e?.isOpen,
|
|
29
|
+
defaultProp: !1,
|
|
30
|
+
onChange: P(e?.onOpenChange, f)
|
|
31
|
+
}), g = {
|
|
32
|
+
...e,
|
|
33
|
+
isOpen: C,
|
|
34
|
+
onOpenChange: l
|
|
35
|
+
}, I = () => o ? /* @__PURE__ */ t(x, { ...s }) : /* @__PURE__ */ t(V, { ...m });
|
|
36
|
+
return /* @__PURE__ */ h(k, { children: [
|
|
37
|
+
/* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(v, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ t(y, { config: d, componentType: c.ChatButton, children: /* @__PURE__ */ t(j, { label: r, avatar: i, onOpenChange: l }) }) }) }),
|
|
38
|
+
/* @__PURE__ */ t(
|
|
39
|
+
T,
|
|
40
|
+
{
|
|
41
|
+
...d,
|
|
42
|
+
componentType: c.ChatButton,
|
|
43
|
+
modalSettings: g,
|
|
44
|
+
children: I()
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
function j({ label: n = "Ask AI", avatar: e, onOpenChange: r }) {
|
|
50
|
+
return /* @__PURE__ */ t(B, { children: /* @__PURE__ */ h(A, { onClick: (o) => {
|
|
51
|
+
o.button !== 2 && r?.((i) => !i);
|
|
52
|
+
}, children: [
|
|
53
|
+
/* @__PURE__ */ t(S, { children: n }),
|
|
54
|
+
/* @__PURE__ */ t(w, { children: /* @__PURE__ */ t(b, { avatar: e }) })
|
|
55
|
+
] }) });
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
j as ChatButtonImpl,
|
|
59
|
+
N as InkeepChatButton
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),s=require("../styled/components/embedded-chat.cjs"),h=require("../styled/components/modal.cjs"),M=require("../styled/components/shadow.cjs"),g=require("../styled/components/message.cjs"),p=require("../primitives/providers/config-provider.cjs"),C=require("../primitives/providers/root-provider.cjs"),k=require("../primitives/providers/widget-provider.cjs"),T=require("../primitives/components/modal/modal-provider.cjs"),F=require("../primitives/utils/misc.cjs"),j=require("../primitives/atoms/portal-with-theme.cjs"),B=require("../primitives/atoms/error-boundary.cjs"),S=require("./modal.cjs"),v=require("./widget-toggle.cjs");function w(n){const{baseSettings:t,aiChatSettings:r}=n;return e.jsx(B.ErrorBoundary,{children:e.jsx(M.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(C.RootProvider,{config:{baseSettings:t,aiChatSettings:r},componentType:p.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(b,{...n})})})})}function A(n){const{children:t,onToggleView:r,isHidden:a,shouldAutoFocusInput:o=!r}=n;return e.jsx(s.Provider,{isHidden:a,shouldAutoFocusInput:o,children:t})}function b(n){return e.jsx(A,{...n,children:e.jsx(I,{...n})})}function I(n){const{onToggleView:t,variant:r,header:a=y}=n,o=T.useModal(),i=k.useWidget(),c=o&&!i?S.ModalContent:x.Fragment;return e.jsx(c,{children:e.jsxs(s.Wrapper,{variant:r??(t?"no-shadow":"container-with-shadow"),"data-composite":F.dataAttr(!!n.onToggleView||o?.isOpen),children:[e.jsxs(s.Root,{children:[a&&e.jsx(a,{...n}),e.jsx(f,{}),e.jsx(W,{})]}),e.jsx(V,{}),e.jsx(O,{})]})})}const y=n=>{const{onToggleView:t,askAILabel:r,searchLabel:a}=n,o=!!t;return e.jsx(s.Header,{"data-show-toolbar":F.dataAttr(o),children:o?e.jsxs(s.HeaderToolbar,{children:[e.jsxs(s.HeaderToolbarWrapper,{children:[e.jsx(s.ToolbarHeader,{}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{side:"bottom",align:"start",children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]})]}),e.jsx(v.WidgetToggle,{onToggleView:t,askAILabel:r,searchLabel:a,view:"chat"}),e.jsx(h.Close,{})]}):e.jsx(h.Close,{})})};function f(){return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:e.jsx(E,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function E(){const{aiChatSettings:{components:n}}=p.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:r})=>{const a=t.at(-1),o=(c,m)=>{const d=n?.[c];if(!d)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof d=="function"&&d.length<=1)return x.createElement(d,m);const l=d(m,document.createElement("div"),null);return x.isValidElement(l)||typeof l=="string"?l:null}catch(l){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,l),null}},i=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx(H,{}),t.map(c=>e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(u,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:n?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:o,renderMarkdown:i},componentDef:n.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(g.EmbeddedChatMessagePart,{isLast:a?.id===c.id}),e.jsx(L,{})]})}),e.jsx(D,{}),e.jsx(P,{})]})]},c.id)),r&&a?.parts.length&&e.jsx(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:e.jsx(u,{})})]})}})}function H(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsxs(s.MessageAvatarContent,{children:[e.jsx(s.MessageAvatarFallback,{}),e.jsx(s.MessageAvatarImage,{})]})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(g.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:n=>n.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},t))})]})]})]})}function u(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsxs(s.MessageAvatarContent,{children:[e.jsx(s.MessageAvatarFallback,{}),e.jsx(s.MessageAvatarImage,{})]})}),e.jsx(s.MessageName,{})]})}function D(){return e.jsxs(s.MessageAttachments,{children:[e.jsx(s.MessageAttachmentsList,{children:n=>n.map(t=>e.jsxs(s.MessageAttachmentsItem,{attachment:t,children:[e.jsx(s.MessageAttachmentsItemIcon,{}),e.jsx(s.MessageAttachmentsItemTitle,{})]},t.id))}),e.jsx(s.MessageAttachmentsPreview,{children:e.jsx(j.PortalWithTheme,{children:e.jsx(s.MessageAttachmentsPreviewOverlay,{children:e.jsxs(s.MessageAttachmentsPreviewContent,{children:[e.jsx(s.MessageAttachmentsPreviewHeader,{}),e.jsx(s.MessageAttachmentsPreviewClose,{}),e.jsx(s.MessageAttachmentsPreviewBody,{})]})})})})]})}function P(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageAnnotationActions,{children:n=>n.map((t,r)=>e.jsx(s.MessageAnnotationAction,{action:t},`action-${r}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function L(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:n=>n.map((t,r)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(a=>e.jsxs(x.Fragment,{children:[a,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},a))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:a=>a.map((o,i)=>e.jsx(s.MessageSourceItemDescriptionPart,{part:o},`part-${i}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},r))})]})}function W(){return e.jsxs(s.Footer,{children:[e.jsx(q,{}),e.jsx(_,{})]})}function q(){return e.jsxs(s.InputFieldset,{children:[e.jsxs(s.InputGroup,{children:[e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]}),e.jsxs(s.AttachmentsBar,{children:[e.jsx(s.AttachmentsBarList,{children:n=>n.map(t=>e.jsxs(s.AttachmentsBarAttachment,{attachment:t,children:[e.jsx(s.AttachmentsBarAttachmentIcon,{}),e.jsx(s.AttachmentsBarAttachmentTitle,{}),e.jsx(s.AttachmentsBarAttachmentDelete,{})]},t.id))}),e.jsxs(s.AttachmentsBarActions,{children:[e.jsxs(s.AttachmentsBarInfoTip,{children:[e.jsx(s.AttachmentsBarInfoTipIcon,{}),e.jsx(s.AttachmentsBarInfoTipText,{})]}),e.jsx(s.AttachmentsBarInputs,{children:n=>n.map(t=>e.jsx(s.AttachmentsBarInput,{input:t,children:t.displayName},t.id))})]}),e.jsx(j.PortalWithTheme,{children:e.jsx(s.AttachmentsBarModal,{children:e.jsx(s.AttachmentsBarModalOverlay,{children:e.jsxs(s.AttachmentsBarModalContent,{children:[e.jsxs(s.AttachmentsBarModalHeader,{children:[e.jsx(s.AttachmentsBarModalHeading,{}),e.jsx(s.AttachmentsBarModalDescription,{}),e.jsx(s.AttachmentsBarModalHelp,{})]}),e.jsx(s.AttachmentsBarModalClose,{}),e.jsx(s.AttachmentsBarModalBody,{children:e.jsxs(s.AttachmentsBarForm,{children:[e.jsxs(s.AttachmentsBarFormTitle,{children:[e.jsx(s.AttachmentsBarFormTitleLabel,{}),e.jsx(s.AttachmentsBarFormTitleInput,{}),e.jsx(s.AttachmentsBarFormTitleError,{})]}),e.jsxs(s.AttachmentsBarFormContent,{children:[e.jsx(s.AttachmentsBarFormContentLabel,{}),e.jsx(s.AttachmentsBarFormContentInput,{}),e.jsx(s.AttachmentsBarFormContentError,{})]}),e.jsx(s.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function _(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{}),e.jsx(s.TaglineBrandName,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:n,unpinned:t})=>e.jsxs(e.Fragment,{children:[n.map(r=>e.jsx(s.HelpAction,{action:r},r.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(r=>e.jsxs(s.HelpActionsMenuItem,{action:r,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:r}),r.name]},r.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function V(){return e.jsx(j.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackItem,{name:"unrelated_response",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsxs(s.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(s.FeedbackItemCheckbox,{children:e.jsx(s.FeedbackItemCheckboxIndicator,{})}),e.jsx(s.FeedbackItemLabel,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function O(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:n=>e.jsxs(e.Fragment,{children:[n.map((t,r)=>e.jsxs(s.FormField,{field:t,autoFocus:r===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(a=>e.jsxs(s.FormFieldSelectItem,{value:a.value,children:[e.jsx(s.FormFieldSelectItemText,{children:a.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},a.value))})})]}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=w;exports.InkeepEmbeddedChatImpl=b;exports.InkeepEmbeddedChatImplContent=I;exports.InkeepEmbeddedChatProvider=A;
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as t, Fragment as E } from "react/jsx-runtime";
|
|
3
|
+
import M, { Fragment as T } from "react";
|
|
4
|
+
import { Provider as N, Wrapper as $, Root as R, Header as j, HeaderToolbar as G, HeaderToolbarWrapper as z, ToolbarHeader as J, Disclaimer as k, DisclaimerTrigger as H, DisclaimerContent as f, DisclaimerText as v, DisclaimerArrow as w, Content as K, ContentScrollArea as U, ContentScrollAreaViewport as X, ContentScrollAreaScrollbar as Y, ContentScrollAreaThumb as Z, ContentScrollAreaCorner as q, Footer as ee, FeedbackModal as te, FeedbackModalOverlay as ae, FeedbackModalContent as de, FeedbackModalHeader as re, FeedbackModalClose as ne, FeedbackModalBody as se, FeedbackForm as oe, FeedbackItem as h, FeedbackItemCheckbox as l, FeedbackItemCheckboxIndicator as b, FeedbackItemLabel as C, FeedbackItemDescription as F, FeedbackSubmitButton as me, FormWrapper as ce, FormClose as ie, Form as he, FormHeader as le, FormHeading as be, FormDescription as Ce, FormContent as Ee, FormField as Fe, FormFieldLabel as pe, FormFieldText as ue, FormFieldEmail as Ae, FormFieldFile as ge, FormFieldTextArea as Me, FormFieldCheckbox as Ie, FormFieldCheckboxIndicator as Be, FormFieldSelect as Se, FormFieldSelectTrigger as Te, FormFieldSelectValue as ke, FormFieldSelectIcon as He, FormFieldSelectContent as fe, FormFieldSelectViewport as ve, FormFieldSelectItem as we, FormFieldSelectItemText as xe, FormFieldSelectItemIndicator as ye, FormFieldError as De, FormError as Le, FormFooter as Pe, FormCancel as We, FormSubmit as _e, FormSuccess as Ve, FormSuccessHeading as Qe, FormSuccessMessage as Oe, FormSuccessButton as Ne, Messages as $e, MessageWrapper as I, MessageContentWrapper as x, MessageContent as y, DynamicComponent as Re, InputFieldset as je, InputGroup as Ge, Input as ze, SendButton as Je, SendButtonIcon as Ke, AttachmentsBar as Ue, AttachmentsBarList as Xe, AttachmentsBarAttachment as Ye, AttachmentsBarAttachmentIcon as Ze, AttachmentsBarAttachmentTitle as qe, AttachmentsBarAttachmentDelete as et, AttachmentsBarActions as tt, AttachmentsBarInfoTip as at, AttachmentsBarInfoTipIcon as dt, AttachmentsBarInfoTipText as rt, AttachmentsBarInputs as nt, AttachmentsBarInput as st, AttachmentsBarModal as ot, AttachmentsBarModalOverlay as mt, AttachmentsBarModalContent as ct, AttachmentsBarModalHeader as it, AttachmentsBarModalHeading as ht, AttachmentsBarModalDescription as lt, AttachmentsBarModalHelp as bt, AttachmentsBarModalClose as Ct, AttachmentsBarModalBody as Et, AttachmentsBarForm as Ft, AttachmentsBarFormTitle as pt, AttachmentsBarFormTitleLabel as ut, AttachmentsBarFormTitleInput as At, AttachmentsBarFormTitleError as gt, AttachmentsBarFormContent as Mt, AttachmentsBarFormContentLabel as It, AttachmentsBarFormContentInput as Bt, AttachmentsBarFormContentError as St, AttachmentsBarFormSubmitButton as Tt, ActionBar as kt, TaglineContainer as Ht, TaglineText as ft, TaglineLogo as vt, TaglineBrandName as wt, Actions as xt, HelpActions as yt, HelpAction as Dt, HelpActionsTrigger as Lt, HelpActionsMenu as Pt, HelpActionsMenuArrow as Wt, HelpActionsMenuItem as _t, HelpActionsMenuItemIcon as Vt, ChatAction as p, ChatActionLabel as Qt, ChatActionFeedback as Ot, IntroMessageWrapper as Nt, MessageHeader as D, MessageAvatar as L, MessageAvatarContent as P, MessageAvatarFallback as W, MessageAvatarImage as _, MessageName as V, DisclaimerLabel as $t, ExampleQuestions as Rt, ExampleQuestionsLabel as jt, ExampleQuestionsList as Gt, ExampleQuestion as zt, ExampleQuestionButton as Jt, Markdown as Kt, MessageSources as Ut, MessageSourcesHeader as Xt, MessageSourcesList as Yt, MessageSourceItem as Zt, MessageSourceItemBreadcrumbs as qt, MessageSourceItemBreadcrumbIcon as ea, MessageSourceItemIcon as ta, MessageSourceItemTitle as aa, MessageSourceItemTag as da, MessageSourceItemDescription as ra, MessageSourceItemDescriptionPart as na, MessageSourceItemIndicator as sa, MessageAttachments as oa, MessageAttachmentsList as ma, MessageAttachmentsItem as ca, MessageAttachmentsItemIcon as ia, MessageAttachmentsItemTitle as ha, MessageAttachmentsPreview as la, MessageAttachmentsPreviewOverlay as ba, MessageAttachmentsPreviewContent as Ca, MessageAttachmentsPreviewHeader as Ea, MessageAttachmentsPreviewClose as Fa, MessageAttachmentsPreviewBody as pa, MessageToolbar as ua, MessageAnnotationActions as Aa, MessageAnnotationAction as ga, MessageAction as u } from "../styled/components/embedded-chat.js";
|
|
5
|
+
import { Close as B } from "../styled/components/modal.js";
|
|
6
|
+
import { Shadow as Ma } from "../styled/components/shadow.js";
|
|
7
|
+
import { EmbeddedChatMessagePart as Q } from "../styled/components/message.js";
|
|
8
|
+
import { WebWidgetInteractionType as Ia, useInkeepConfig as Ba } from "../primitives/providers/config-provider.js";
|
|
9
|
+
import { RootProvider as Sa } from "../primitives/providers/root-provider.js";
|
|
10
|
+
import { useWidget as Ta } from "../primitives/providers/widget-provider.js";
|
|
11
|
+
import { useModal as ka } from "../primitives/components/modal/modal-provider.js";
|
|
12
|
+
import { dataAttr as O } from "../primitives/utils/misc.js";
|
|
13
|
+
import { PortalWithTheme as A } from "../primitives/atoms/portal-with-theme.js";
|
|
14
|
+
import { ErrorBoundary as Ha } from "../primitives/atoms/error-boundary.js";
|
|
15
|
+
import { ModalContent as fa } from "./modal.js";
|
|
16
|
+
import { WidgetToggle as va } from "./widget-toggle.js";
|
|
17
|
+
function sd(d) {
|
|
18
|
+
const { baseSettings: a, aiChatSettings: r } = d;
|
|
19
|
+
return /* @__PURE__ */ e(Ha, { children: /* @__PURE__ */ e(
|
|
20
|
+
Ma,
|
|
21
|
+
{
|
|
22
|
+
wrapperStyles: {
|
|
23
|
+
height: "inherit",
|
|
24
|
+
width: "inherit"
|
|
25
|
+
},
|
|
26
|
+
children: /* @__PURE__ */ e(
|
|
27
|
+
Sa,
|
|
28
|
+
{
|
|
29
|
+
config: {
|
|
30
|
+
baseSettings: a,
|
|
31
|
+
aiChatSettings: r
|
|
32
|
+
},
|
|
33
|
+
componentType: Ia.EmbeddedChat,
|
|
34
|
+
children: /* @__PURE__ */ e(xa, { ...d })
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
) });
|
|
39
|
+
}
|
|
40
|
+
function wa(d) {
|
|
41
|
+
const { children: a, onToggleView: r, isHidden: n, shouldAutoFocusInput: s = !r } = d;
|
|
42
|
+
return /* @__PURE__ */ e(N, { isHidden: n, shouldAutoFocusInput: s, children: a });
|
|
43
|
+
}
|
|
44
|
+
function xa(d) {
|
|
45
|
+
return /* @__PURE__ */ e(wa, { ...d, children: /* @__PURE__ */ e(ya, { ...d }) });
|
|
46
|
+
}
|
|
47
|
+
function ya(d) {
|
|
48
|
+
const { onToggleView: a, variant: r, header: n = Da } = d, s = ka(), m = Ta();
|
|
49
|
+
return /* @__PURE__ */ e(s && !m ? fa : T, { children: /* @__PURE__ */ t(
|
|
50
|
+
$,
|
|
51
|
+
{
|
|
52
|
+
variant: r ?? (a ? "no-shadow" : "container-with-shadow"),
|
|
53
|
+
"data-composite": O(!!d.onToggleView || s?.isOpen),
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ t(R, { children: [
|
|
56
|
+
n && /* @__PURE__ */ e(n, { ...d }),
|
|
57
|
+
/* @__PURE__ */ e(La, {}),
|
|
58
|
+
/* @__PURE__ */ e(Oa, {})
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ e(Ra, {}),
|
|
61
|
+
/* @__PURE__ */ e(ja, {})
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
) });
|
|
65
|
+
}
|
|
66
|
+
const Da = (d) => {
|
|
67
|
+
const { onToggleView: a, askAILabel: r, searchLabel: n } = d, s = !!a;
|
|
68
|
+
return /* @__PURE__ */ e(j, { "data-show-toolbar": O(s), children: s ? /* @__PURE__ */ t(G, { children: [
|
|
69
|
+
/* @__PURE__ */ t(z, { children: [
|
|
70
|
+
/* @__PURE__ */ e(J, {}),
|
|
71
|
+
/* @__PURE__ */ t(k, { children: [
|
|
72
|
+
/* @__PURE__ */ e(H, {}),
|
|
73
|
+
/* @__PURE__ */ t(f, { side: "bottom", align: "start", children: [
|
|
74
|
+
/* @__PURE__ */ e(v, {}),
|
|
75
|
+
/* @__PURE__ */ e(w, {})
|
|
76
|
+
] })
|
|
77
|
+
] })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ e(
|
|
80
|
+
va,
|
|
81
|
+
{
|
|
82
|
+
onToggleView: a,
|
|
83
|
+
askAILabel: r,
|
|
84
|
+
searchLabel: n,
|
|
85
|
+
view: "chat"
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ e(B, {})
|
|
89
|
+
] }) : /* @__PURE__ */ e(B, {}) });
|
|
90
|
+
};
|
|
91
|
+
function La() {
|
|
92
|
+
return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ t(U, { children: [
|
|
93
|
+
/* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(Pa, {}) }),
|
|
94
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(Z, {}) }),
|
|
95
|
+
/* @__PURE__ */ e(q, {})
|
|
96
|
+
] }) });
|
|
97
|
+
}
|
|
98
|
+
function Pa() {
|
|
99
|
+
const {
|
|
100
|
+
aiChatSettings: { components: d }
|
|
101
|
+
} = Ba();
|
|
102
|
+
return /* @__PURE__ */ e($e, { children: ({ messages: a, isLoading: r }) => {
|
|
103
|
+
const n = a.at(-1), s = (o, g) => {
|
|
104
|
+
const c = d?.[o];
|
|
105
|
+
if (!c)
|
|
106
|
+
return console.warn(`Component "${o}" not found in components config`), null;
|
|
107
|
+
try {
|
|
108
|
+
if (typeof c == "function" && c.length <= 1)
|
|
109
|
+
return M.createElement(c, g);
|
|
110
|
+
const i = c(g, document.createElement("div"), null);
|
|
111
|
+
return M.isValidElement(i) || typeof i == "string" ? i : null;
|
|
112
|
+
} catch (i) {
|
|
113
|
+
return console.error(`🔍 [renderComponent] Error rendering component "${o}":`, i), null;
|
|
114
|
+
}
|
|
115
|
+
}, m = (o) => /* @__PURE__ */ e(Kt, { text: o });
|
|
116
|
+
return /* @__PURE__ */ t(E, { children: [
|
|
117
|
+
/* @__PURE__ */ e(Wa, {}),
|
|
118
|
+
a.map((o) => /* @__PURE__ */ t(I, { message: o, children: [
|
|
119
|
+
/* @__PURE__ */ e(S, {}),
|
|
120
|
+
/* @__PURE__ */ t(x, { children: [
|
|
121
|
+
/* @__PURE__ */ e(y, { children: d?.IkpMessage ? /* @__PURE__ */ e(
|
|
122
|
+
Re,
|
|
123
|
+
{
|
|
124
|
+
name: "IkpMessage",
|
|
125
|
+
props: { message: o, renderComponent: s, renderMarkdown: m },
|
|
126
|
+
componentDef: d.IkpMessage
|
|
127
|
+
}
|
|
128
|
+
) : /* @__PURE__ */ t(E, { children: [
|
|
129
|
+
/* @__PURE__ */ e(Q, { isLast: n?.id === o.id }),
|
|
130
|
+
/* @__PURE__ */ e(Qa, {})
|
|
131
|
+
] }) }),
|
|
132
|
+
/* @__PURE__ */ e(_a, {}),
|
|
133
|
+
/* @__PURE__ */ e(Va, {})
|
|
134
|
+
] })
|
|
135
|
+
] }, o.id)),
|
|
136
|
+
r && n?.parts.length && /* @__PURE__ */ e(
|
|
137
|
+
I,
|
|
138
|
+
{
|
|
139
|
+
message: {
|
|
140
|
+
id: "___loader___",
|
|
141
|
+
role: "assistant",
|
|
142
|
+
parts: [{ type: "text", text: "Thinking..." }]
|
|
143
|
+
},
|
|
144
|
+
children: /* @__PURE__ */ e(S, {})
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
] });
|
|
148
|
+
} });
|
|
149
|
+
}
|
|
150
|
+
function Wa() {
|
|
151
|
+
return /* @__PURE__ */ t(Nt, { children: [
|
|
152
|
+
/* @__PURE__ */ t(D, { children: [
|
|
153
|
+
/* @__PURE__ */ e(L, { children: /* @__PURE__ */ t(P, { children: [
|
|
154
|
+
/* @__PURE__ */ e(W, {}),
|
|
155
|
+
/* @__PURE__ */ e(_, {})
|
|
156
|
+
] }) }),
|
|
157
|
+
/* @__PURE__ */ e(V, {})
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ t(x, { children: [
|
|
160
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(Q, { isLast: !1 }) }),
|
|
161
|
+
/* @__PURE__ */ t(k, { children: [
|
|
162
|
+
/* @__PURE__ */ e($t, {}),
|
|
163
|
+
/* @__PURE__ */ e(H, {}),
|
|
164
|
+
/* @__PURE__ */ t(f, { children: [
|
|
165
|
+
/* @__PURE__ */ e(v, {}),
|
|
166
|
+
/* @__PURE__ */ e(w, {})
|
|
167
|
+
] })
|
|
168
|
+
] }),
|
|
169
|
+
/* @__PURE__ */ t(Rt, { children: [
|
|
170
|
+
/* @__PURE__ */ e(jt, {}),
|
|
171
|
+
/* @__PURE__ */ e(Gt, { children: (d) => d.map((a) => /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e(Jt, { question: a }) }, a)) })
|
|
172
|
+
] })
|
|
173
|
+
] })
|
|
174
|
+
] });
|
|
175
|
+
}
|
|
176
|
+
function S() {
|
|
177
|
+
return /* @__PURE__ */ t(D, { children: [
|
|
178
|
+
/* @__PURE__ */ e(L, { children: /* @__PURE__ */ t(P, { children: [
|
|
179
|
+
/* @__PURE__ */ e(W, {}),
|
|
180
|
+
/* @__PURE__ */ e(_, {})
|
|
181
|
+
] }) }),
|
|
182
|
+
/* @__PURE__ */ e(V, {})
|
|
183
|
+
] });
|
|
184
|
+
}
|
|
185
|
+
function _a() {
|
|
186
|
+
return /* @__PURE__ */ t(oa, { children: [
|
|
187
|
+
/* @__PURE__ */ e(ma, { children: (d) => d.map((a) => /* @__PURE__ */ t(ca, { attachment: a, children: [
|
|
188
|
+
/* @__PURE__ */ e(ia, {}),
|
|
189
|
+
/* @__PURE__ */ e(ha, {})
|
|
190
|
+
] }, a.id)) }),
|
|
191
|
+
/* @__PURE__ */ e(la, { children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(ba, { children: /* @__PURE__ */ t(Ca, { children: [
|
|
192
|
+
/* @__PURE__ */ e(Ea, {}),
|
|
193
|
+
/* @__PURE__ */ e(Fa, {}),
|
|
194
|
+
/* @__PURE__ */ e(pa, {})
|
|
195
|
+
] }) }) }) })
|
|
196
|
+
] });
|
|
197
|
+
}
|
|
198
|
+
function Va() {
|
|
199
|
+
return /* @__PURE__ */ t(ua, { children: [
|
|
200
|
+
/* @__PURE__ */ e(Aa, { children: (d) => d.map((a, r) => /* @__PURE__ */ e(ga, { action: a }, `action-${r}`)) }),
|
|
201
|
+
/* @__PURE__ */ e(u, { action: "copy" }),
|
|
202
|
+
/* @__PURE__ */ e(u, { action: "upvote" }),
|
|
203
|
+
/* @__PURE__ */ e(u, { action: "downvote" })
|
|
204
|
+
] });
|
|
205
|
+
}
|
|
206
|
+
function Qa() {
|
|
207
|
+
return /* @__PURE__ */ t(Ut, { children: [
|
|
208
|
+
/* @__PURE__ */ e(Xt, {}),
|
|
209
|
+
/* @__PURE__ */ e(Yt, { children: (d) => d.map((a, r) => /* @__PURE__ */ t(Zt, { href: a.url, source: a, children: [
|
|
210
|
+
/* @__PURE__ */ e(qt, { children: a.breadcrumbs?.map((n) => /* @__PURE__ */ t(T, { children: [
|
|
211
|
+
n,
|
|
212
|
+
/* @__PURE__ */ e(ea, {})
|
|
213
|
+
] }, n)) }),
|
|
214
|
+
/* @__PURE__ */ e(ta, {}),
|
|
215
|
+
/* @__PURE__ */ e(aa, {}),
|
|
216
|
+
/* @__PURE__ */ e(da, {}),
|
|
217
|
+
/* @__PURE__ */ e(ra, { children: (n) => n.map((s, m) => /* @__PURE__ */ e(
|
|
218
|
+
na,
|
|
219
|
+
{
|
|
220
|
+
part: s
|
|
221
|
+
},
|
|
222
|
+
`part-${m}`
|
|
223
|
+
)) }),
|
|
224
|
+
/* @__PURE__ */ e(sa, {})
|
|
225
|
+
] }, r)) })
|
|
226
|
+
] });
|
|
227
|
+
}
|
|
228
|
+
function Oa() {
|
|
229
|
+
return /* @__PURE__ */ t(ee, { children: [
|
|
230
|
+
/* @__PURE__ */ e(Na, {}),
|
|
231
|
+
/* @__PURE__ */ e($a, {})
|
|
232
|
+
] });
|
|
233
|
+
}
|
|
234
|
+
function Na() {
|
|
235
|
+
return /* @__PURE__ */ t(je, { children: [
|
|
236
|
+
/* @__PURE__ */ t(Ge, { children: [
|
|
237
|
+
/* @__PURE__ */ e(ze, {}),
|
|
238
|
+
/* @__PURE__ */ e(Je, { children: /* @__PURE__ */ e(Ke, {}) })
|
|
239
|
+
] }),
|
|
240
|
+
/* @__PURE__ */ t(Ue, { children: [
|
|
241
|
+
/* @__PURE__ */ e(Xe, { children: (d) => d.map((a) => /* @__PURE__ */ t(Ye, { attachment: a, children: [
|
|
242
|
+
/* @__PURE__ */ e(Ze, {}),
|
|
243
|
+
/* @__PURE__ */ e(qe, {}),
|
|
244
|
+
/* @__PURE__ */ e(et, {})
|
|
245
|
+
] }, a.id)) }),
|
|
246
|
+
/* @__PURE__ */ t(tt, { children: [
|
|
247
|
+
/* @__PURE__ */ t(at, { children: [
|
|
248
|
+
/* @__PURE__ */ e(dt, {}),
|
|
249
|
+
/* @__PURE__ */ e(rt, {})
|
|
250
|
+
] }),
|
|
251
|
+
/* @__PURE__ */ e(nt, { children: (d) => d.map((a) => /* @__PURE__ */ e(st, { input: a, children: a.displayName }, a.id)) })
|
|
252
|
+
] }),
|
|
253
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(ot, { children: /* @__PURE__ */ e(mt, { children: /* @__PURE__ */ t(ct, { children: [
|
|
254
|
+
/* @__PURE__ */ t(it, { children: [
|
|
255
|
+
/* @__PURE__ */ e(ht, {}),
|
|
256
|
+
/* @__PURE__ */ e(lt, {}),
|
|
257
|
+
/* @__PURE__ */ e(bt, {})
|
|
258
|
+
] }),
|
|
259
|
+
/* @__PURE__ */ e(Ct, {}),
|
|
260
|
+
/* @__PURE__ */ e(Et, { children: /* @__PURE__ */ t(Ft, { children: [
|
|
261
|
+
/* @__PURE__ */ t(pt, { children: [
|
|
262
|
+
/* @__PURE__ */ e(ut, {}),
|
|
263
|
+
/* @__PURE__ */ e(At, {}),
|
|
264
|
+
/* @__PURE__ */ e(gt, {})
|
|
265
|
+
] }),
|
|
266
|
+
/* @__PURE__ */ t(Mt, { children: [
|
|
267
|
+
/* @__PURE__ */ e(It, {}),
|
|
268
|
+
/* @__PURE__ */ e(Bt, {}),
|
|
269
|
+
/* @__PURE__ */ e(St, {})
|
|
270
|
+
] }),
|
|
271
|
+
/* @__PURE__ */ e(Tt, {})
|
|
272
|
+
] }) })
|
|
273
|
+
] }) }) }) })
|
|
274
|
+
] })
|
|
275
|
+
] });
|
|
276
|
+
}
|
|
277
|
+
function $a() {
|
|
278
|
+
return /* @__PURE__ */ t(kt, { children: [
|
|
279
|
+
/* @__PURE__ */ t(Ht, { children: [
|
|
280
|
+
/* @__PURE__ */ e(ft, {}),
|
|
281
|
+
/* @__PURE__ */ e(vt, {}),
|
|
282
|
+
/* @__PURE__ */ e(wt, {})
|
|
283
|
+
] }),
|
|
284
|
+
/* @__PURE__ */ t(xt, { children: [
|
|
285
|
+
/* @__PURE__ */ e(yt, { children: ({ pinned: d, unpinned: a }) => /* @__PURE__ */ t(E, { children: [
|
|
286
|
+
d.map((r) => /* @__PURE__ */ e(Dt, { action: r }, r.name)),
|
|
287
|
+
a.length > 0 && /* @__PURE__ */ e(Lt, {}),
|
|
288
|
+
/* @__PURE__ */ t(Pt, { children: [
|
|
289
|
+
/* @__PURE__ */ e(Wt, {}),
|
|
290
|
+
a.map((r) => /* @__PURE__ */ t(_t, { action: r, children: [
|
|
291
|
+
/* @__PURE__ */ e(Vt, { action: r }),
|
|
292
|
+
r.name
|
|
293
|
+
] }, r.name))
|
|
294
|
+
] })
|
|
295
|
+
] }) }),
|
|
296
|
+
/* @__PURE__ */ t(p, { action: "copy", children: [
|
|
297
|
+
/* @__PURE__ */ e(Qt, { action: "copy" }),
|
|
298
|
+
/* @__PURE__ */ e(Ot, { action: "copy" })
|
|
299
|
+
] }),
|
|
300
|
+
/* @__PURE__ */ e(p, { action: "clear" }),
|
|
301
|
+
/* @__PURE__ */ e(p, { action: "stop" })
|
|
302
|
+
] })
|
|
303
|
+
] });
|
|
304
|
+
}
|
|
305
|
+
function Ra() {
|
|
306
|
+
return /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ t(de, { children: [
|
|
307
|
+
/* @__PURE__ */ e(re, {}),
|
|
308
|
+
/* @__PURE__ */ e(ne, {}),
|
|
309
|
+
/* @__PURE__ */ e(se, { children: /* @__PURE__ */ t(oe, { children: [
|
|
310
|
+
/* @__PURE__ */ t(h, { name: "unrelated_response", children: [
|
|
311
|
+
/* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(b, {}) }),
|
|
312
|
+
/* @__PURE__ */ e(C, {}),
|
|
313
|
+
/* @__PURE__ */ e(F, {})
|
|
314
|
+
] }),
|
|
315
|
+
/* @__PURE__ */ t(h, { name: "inaccurate_statement", children: [
|
|
316
|
+
/* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(b, {}) }),
|
|
317
|
+
/* @__PURE__ */ e(C, {}),
|
|
318
|
+
/* @__PURE__ */ e(F, {})
|
|
319
|
+
] }),
|
|
320
|
+
/* @__PURE__ */ t(h, { name: "inaccurate_code_snippet", children: [
|
|
321
|
+
/* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(b, {}) }),
|
|
322
|
+
/* @__PURE__ */ e(C, {}),
|
|
323
|
+
/* @__PURE__ */ e(F, {})
|
|
324
|
+
] }),
|
|
325
|
+
/* @__PURE__ */ t(h, { name: "irrelevant_citations", children: [
|
|
326
|
+
/* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(b, {}) }),
|
|
327
|
+
/* @__PURE__ */ e(C, {})
|
|
328
|
+
] }),
|
|
329
|
+
/* @__PURE__ */ e(me, {})
|
|
330
|
+
] }) })
|
|
331
|
+
] }) }) }) });
|
|
332
|
+
}
|
|
333
|
+
function ja() {
|
|
334
|
+
return /* @__PURE__ */ t(ce, { children: [
|
|
335
|
+
/* @__PURE__ */ e(ie, {}),
|
|
336
|
+
/* @__PURE__ */ t(he, { children: [
|
|
337
|
+
/* @__PURE__ */ t(le, { children: [
|
|
338
|
+
/* @__PURE__ */ e(be, {}),
|
|
339
|
+
/* @__PURE__ */ e(Ce, {})
|
|
340
|
+
] }),
|
|
341
|
+
/* @__PURE__ */ e(Ee, { children: (d) => /* @__PURE__ */ t(E, { children: [
|
|
342
|
+
d.map((a, r) => /* @__PURE__ */ t(Fe, { field: a, autoFocus: r === 0, children: [
|
|
343
|
+
/* @__PURE__ */ e(pe, {}),
|
|
344
|
+
a.inputType === "text" && /* @__PURE__ */ e(ue, {}),
|
|
345
|
+
a.inputType === "email" && /* @__PURE__ */ e(Ae, {}),
|
|
346
|
+
a.inputType === "file" && /* @__PURE__ */ e(ge, {}),
|
|
347
|
+
a.inputType === "textarea" && /* @__PURE__ */ e(Me, {}),
|
|
348
|
+
a.inputType === "checkbox" && /* @__PURE__ */ e(Ie, { children: /* @__PURE__ */ e(Be, {}) }),
|
|
349
|
+
a.inputType === "select" && /* @__PURE__ */ t(Se, { children: [
|
|
350
|
+
/* @__PURE__ */ t(Te, { children: [
|
|
351
|
+
/* @__PURE__ */ e(ke, {}),
|
|
352
|
+
/* @__PURE__ */ e(He, {})
|
|
353
|
+
] }),
|
|
354
|
+
/* @__PURE__ */ e(fe, { children: /* @__PURE__ */ e(ve, { children: a.items.map((n) => /* @__PURE__ */ t(we, { value: n.value, children: [
|
|
355
|
+
/* @__PURE__ */ e(xe, { children: n.label }),
|
|
356
|
+
/* @__PURE__ */ e(ye, {})
|
|
357
|
+
] }, n.value)) }) })
|
|
358
|
+
] }),
|
|
359
|
+
/* @__PURE__ */ e(De, {})
|
|
360
|
+
] }, a.name)),
|
|
361
|
+
/* @__PURE__ */ e(Le, {})
|
|
362
|
+
] }) }),
|
|
363
|
+
/* @__PURE__ */ t(Pe, { children: [
|
|
364
|
+
/* @__PURE__ */ e(We, {}),
|
|
365
|
+
/* @__PURE__ */ e(_e, {})
|
|
366
|
+
] })
|
|
367
|
+
] }),
|
|
368
|
+
/* @__PURE__ */ t(Ve, { children: [
|
|
369
|
+
/* @__PURE__ */ e(Qe, {}),
|
|
370
|
+
/* @__PURE__ */ e(Oe, {}),
|
|
371
|
+
/* @__PURE__ */ e(Ne, {})
|
|
372
|
+
] })
|
|
373
|
+
] });
|
|
374
|
+
}
|
|
375
|
+
export {
|
|
376
|
+
sd as InkeepEmbeddedChat,
|
|
377
|
+
xa as InkeepEmbeddedChatImpl,
|
|
378
|
+
ya as InkeepEmbeddedChatImplContent,
|
|
379
|
+
wa as InkeepEmbeddedChatProvider
|
|
380
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./embedded-chat.cjs"),C=require("../styled/components/shadow.cjs"),S=require("../primitives/providers/config-provider.cjs"),g=require("../primitives/providers/root-provider.cjs"),j=require("../primitives/providers/widget-provider.cjs"),q=require("../primitives/components/modal/modal-provider.cjs"),P=require("../primitives/atoms/error-boundary.cjs"),c=require("./embedded-search.cjs"),k=require("./embedded-search-and-chat.impl.cjs"),x=require("react"),A=require("./modal.cjs");function v(d){const{config:r,...n}=k.useWidgetImpl(d);return e.jsx(P.ErrorBoundary,{children:e.jsx(C.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(g.RootProvider,{config:r,componentType:S.WebWidgetInteractionType.EmbeddedSearchAndChat,children:e.jsx(a,{...n})})})})}function a(d){const{view:r,setView:n,shouldShowAskAICard:h,onToggleView:l,shouldAutoFocusInput:u,searchLabel:m,askAILabel:p,askAICardLabel:b}=d,I=q.useModal()?A.ModalContent:x.Fragment,t={onToggleView:l,shouldShowAskAICard:h,shouldAutoFocusInput:u,searchLabel:m,askAILabel:p,askAICardLabel:b},o={isHidden:r==="chat",...t},i={isHidden:r==="search",...t};return e.jsx(j.WidgetProvider,{widget:{setView:n,view:r},children:e.jsx(c.InkeepEmbeddedSearchProvider,{...o,children:e.jsx(s.InkeepEmbeddedChatProvider,{...i,children:e.jsxs(I,{children:[e.jsx(c.InkeepEmbeddedSearchImplContent,{...o}),e.jsx(s.InkeepEmbeddedChatImplContent,{...i})]})})})})}exports.InkeepEmbeddedSearchAndChat=v;exports.InkeepEmbeddedSearchAndChatImpl=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),a=require("./utils.cjs");function p(f){const{defaultView:u="search",aiChatSettings:i,baseSettings:g,searchSettings:o,shouldAutoFocusInput:l=!0,onToggleView:h,ref:R,...S}=f,s=t.useRef(null),m=a.composeRefs(s,i?.chatFunctionsRef),r=t.useRef(null),d=a.composeRefs(r,o?.searchFunctionsRef),w={...i,chatFunctionsRef:m},I={...o,searchFunctionsRef:d},[n,c]=t.useState(u),b=e=>{e.autoSubmit&&e.query&&s.current?.submitMessage(e.query),h?.(e),c(e.view)};return t.useImperativeHandle(R,()=>({setView:c})),t.useEffect(()=>{n==="chat"?s.current?.focusInput():r.current?.focusInput()},[n]),{config:{baseSettings:g,aiChatSettings:w,searchSettings:I},defaultView:u,view:n,setView:c,onToggleView:b,shouldAutoFocusInput:l,...S}}exports.useWidgetImpl=p;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as r, useState as V, useImperativeHandle as d, useEffect as b } from "react";
|
|
3
|
+
import { composeRefs as a } from "./utils.js";
|
|
4
|
+
function _(f) {
|
|
5
|
+
const {
|
|
6
|
+
defaultView: c = "search",
|
|
7
|
+
aiChatSettings: i,
|
|
8
|
+
baseSettings: g,
|
|
9
|
+
searchSettings: o,
|
|
10
|
+
shouldAutoFocusInput: h = !0,
|
|
11
|
+
onToggleView: l,
|
|
12
|
+
ref: m,
|
|
13
|
+
...S
|
|
14
|
+
} = f, t = r(null), R = a(t, i?.chatFunctionsRef), u = r(null), w = a(u, o?.searchFunctionsRef), p = {
|
|
15
|
+
...i,
|
|
16
|
+
chatFunctionsRef: R
|
|
17
|
+
}, F = {
|
|
18
|
+
...o,
|
|
19
|
+
searchFunctionsRef: w
|
|
20
|
+
}, [n, s] = V(c), I = (e) => {
|
|
21
|
+
e.autoSubmit && e.query && t.current?.submitMessage(e.query), l?.(e), s(e.view);
|
|
22
|
+
};
|
|
23
|
+
return d(m, () => ({
|
|
24
|
+
setView: s
|
|
25
|
+
})), b(() => {
|
|
26
|
+
n === "chat" ? t.current?.focusInput() : u.current?.focusInput();
|
|
27
|
+
}, [n]), {
|
|
28
|
+
config: {
|
|
29
|
+
baseSettings: g,
|
|
30
|
+
aiChatSettings: p,
|
|
31
|
+
searchSettings: F
|
|
32
|
+
},
|
|
33
|
+
defaultView: c,
|
|
34
|
+
view: n,
|
|
35
|
+
setView: s,
|
|
36
|
+
onToggleView: I,
|
|
37
|
+
shouldAutoFocusInput: h,
|
|
38
|
+
...S
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
_ as useWidgetImpl
|
|
43
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
3
|
+
import { InkeepEmbeddedChatProvider as I, InkeepEmbeddedChatImplContent as u } from "./embedded-chat.js";
|
|
4
|
+
import { Shadow as b } from "../styled/components/shadow.js";
|
|
5
|
+
import { WebWidgetInteractionType as C } from "../primitives/providers/config-provider.js";
|
|
6
|
+
import { RootProvider as g } from "../primitives/providers/root-provider.js";
|
|
7
|
+
import { WidgetProvider as k } from "../primitives/providers/widget-provider.js";
|
|
8
|
+
import { useModal as w } from "../primitives/components/modal/modal-provider.js";
|
|
9
|
+
import { ErrorBoundary as A } from "../primitives/atoms/error-boundary.js";
|
|
10
|
+
import { InkeepEmbeddedSearchProvider as E, InkeepEmbeddedSearchImplContent as S } from "./embedded-search.js";
|
|
11
|
+
import { useWidgetImpl as P } from "./embedded-search-and-chat.impl.js";
|
|
12
|
+
import { Fragment as v } from "react";
|
|
13
|
+
import { ModalContent as W } from "./modal.js";
|
|
14
|
+
function G(o) {
|
|
15
|
+
const { config: r, ...t } = P(o);
|
|
16
|
+
return /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
|
|
17
|
+
b,
|
|
18
|
+
{
|
|
19
|
+
wrapperStyles: {
|
|
20
|
+
height: "inherit",
|
|
21
|
+
width: "inherit"
|
|
22
|
+
},
|
|
23
|
+
children: /* @__PURE__ */ e(
|
|
24
|
+
g,
|
|
25
|
+
{
|
|
26
|
+
config: r,
|
|
27
|
+
componentType: C.EmbeddedSearchAndChat,
|
|
28
|
+
children: /* @__PURE__ */ e(y, { ...t })
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
) });
|
|
33
|
+
}
|
|
34
|
+
function y(o) {
|
|
35
|
+
const {
|
|
36
|
+
view: r,
|
|
37
|
+
setView: t,
|
|
38
|
+
shouldShowAskAICard: m,
|
|
39
|
+
onToggleView: p,
|
|
40
|
+
shouldAutoFocusInput: a,
|
|
41
|
+
searchLabel: h,
|
|
42
|
+
askAILabel: c,
|
|
43
|
+
askAICardLabel: s
|
|
44
|
+
} = o, l = w() ? W : v, d = {
|
|
45
|
+
onToggleView: p,
|
|
46
|
+
shouldShowAskAICard: m,
|
|
47
|
+
shouldAutoFocusInput: a,
|
|
48
|
+
searchLabel: h,
|
|
49
|
+
askAILabel: c,
|
|
50
|
+
askAICardLabel: s
|
|
51
|
+
}, n = {
|
|
52
|
+
isHidden: r === "chat",
|
|
53
|
+
...d
|
|
54
|
+
}, i = {
|
|
55
|
+
isHidden: r === "search",
|
|
56
|
+
...d
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ e(k, { widget: { setView: t, view: r }, children: /* @__PURE__ */ e(E, { ...n, children: /* @__PURE__ */ e(I, { ...i, children: /* @__PURE__ */ f(l, { children: [
|
|
59
|
+
/* @__PURE__ */ e(S, { ...n }),
|
|
60
|
+
/* @__PURE__ */ e(u, { ...i })
|
|
61
|
+
] }) }) }) });
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
G as InkeepEmbeddedSearchAndChat,
|
|
65
|
+
y as InkeepEmbeddedSearchAndChatImpl
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("../styled/components/embedded-search.cjs"),R=require("../styled/components/modal.cjs"),A=require("../styled/components/shadow.cjs"),u=require("../primitives/providers/config-provider.cjs"),T=require("../primitives/providers/root-provider.cjs"),w=require("../primitives/providers/widget-provider.cjs"),S=require("../primitives/components/embedded-search/search-provider.cjs"),p=require("../primitives/components/modal/modal-provider.cjs"),d=require("../primitives/utils/misc.cjs"),x=require("../primitives/atoms/cmdk/index.cjs"),v=require("../primitives/atoms/error-boundary.cjs"),a=require("react"),j=require("./widget-toggle.cjs"),k=require("./modal.cjs");function b(r){const{baseSettings:t,searchSettings:n}=r;return e.jsx(v.ErrorBoundary,{children:e.jsx(A.Shadow,{children:e.jsx(T.RootProvider,{config:{baseSettings:t,searchSettings:n},componentType:u.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(h,{...r})})})})}function I(r){const{children:t,onToggleView:n,isHidden:i,shouldAutoFocusInput:l=!n}=r;return e.jsx(s.Provider,{isHidden:i,shouldAutoFocusInput:l,children:t})}function h(r){return e.jsx(I,{...r,children:e.jsx(m,{...r})})}function m(r){const{searchSettings:{view:t}}=u.useInkeepConfig(),{onToggleView:n,shouldShowAskAICard:i=!!n&&t!=="dual-pane"}=r,l=p.useModal(),o=w.useWidget(),c=l&&!o?k.ModalContent:a.Fragment;return e.jsx(c,{children:e.jsx(s.Wrapper,{"data-show-ask-ai-card":d.dataAttr(i),"data-composite":d.dataAttr(!!n||l?.isOpen),children:e.jsxs(s.Root,{children:[e.jsx(P,{...r}),e.jsxs(s.Content,{children:[e.jsx(C,{askAICardLabel:r.askAICardLabel,askAILabel:r.askAILabel,onToggleView:r.onToggleView,shouldShowAskAICard:i}),e.jsx(L,{})]}),e.jsx(y,{})]})})})}function P(r){const{onToggleView:t,askAILabel:n,searchLabel:i}=r,l=x.useCommandState(c=>c.search),{loading:o}=S.useSearch();return e.jsxs(s.InputGroup,{children:[!o&&e.jsx(s.InputIcon,{}),e.jsx(s.Loading,{}),e.jsx(s.Input,{}),t&&e.jsx(j.WidgetToggle,{onToggleView:t,query:l,askAILabel:n,searchLabel:i,view:"search"}),e.jsx(R.Close,{})]})}function C(r){const{askAILabel:t,onToggleView:n,shouldShowAskAICard:i,askAICardLabel:l}=r,o=x.useCommandState(g=>g.search),{handleToggle:c}=j.useToggleView({onToggleView:n,query:o});return i?e.jsxs(s.AskAITrigger,{onSelect:()=>c("chat",!0),children:[e.jsx(s.AskAITriggerIcon,{}),e.jsxs(s.AskAITriggerLabel,{children:[l||t||"Ask AI",o&&e.jsx(s.AskAITriggerQuery,{children:`${o}`})]}),e.jsx(s.AskAITriggerIndicatorText,{children:"Start conversation"}),e.jsx(s.AskAITriggerIndicator,{})]}):null}function L(){return e.jsxs(s.Results,{children:[e.jsx(s.ResultsLoading,{}),e.jsx(s.ResultsTabList,{children:r=>r.map(t=>e.jsx(s.ResultsTab,{tab:t},t))}),e.jsx(s.ResultsEmpty,{}),e.jsxs(s.ResultsContent,{children:[e.jsx(q,{}),e.jsx(f,{})]})]})}function q(){return e.jsxs(s.ResultsScrollArea,{children:[e.jsx(s.ResultsScrollAreaViewport,{children:e.jsx(s.ResultsList,{children:r=>r.map(t=>e.jsxs(s.ResultsItem,{item:t,children:[e.jsx(s.ResultsItemBreadcrumbs,{children:n=>n.map((i,l)=>e.jsxs(a.Fragment,{children:[i,e.jsx(s.ResultsItemBreadcrumbIcon,{})]},`${i}-${l}`))}),e.jsx(s.ResultsItemIcon,{}),e.jsx(s.ResultsItemTitle,{}),e.jsx(s.ResultsItemTag,{}),e.jsx(s.ResultsItemDescription,{children:n=>n.map((i,l)=>e.jsx(s.ResultsItemDescriptionPart,{part:i},`part-${l}`))}),e.jsx(s.ResultsItemIndicator,{})]},t.id))})}),e.jsx(s.ResultsScrollAreaScrollbar,{children:e.jsx(s.ResultsScrollAreaThumb,{})}),e.jsx(s.ResultsScrollAreaCorner,{})]})}function f(){return e.jsxs(s.ResultsScrollArea,{children:[e.jsx(s.ResultsScrollAreaViewport,{children:e.jsxs(s.ResultsItemPreview,{children:[e.jsxs(s.ResultsItemPreviewHeader,{children:[e.jsxs(s.ResultsItemPreviewHeading,{children:[e.jsx(s.ResultsItemPreviewTitle,{}),e.jsx(s.ResultsItemPreviewTitleLinkIcon,{})]}),e.jsx(s.ResultsItemPreviewBreadcrumbs,{children:r=>r.map((t,n)=>e.jsxs(a.Fragment,{children:[t,e.jsx(s.ResultsItemPreviewBreadcrumbIcon,{})]},`${t}-${n}`))})]}),e.jsx(s.ResultsItemPreviewBody,{}),e.jsxs(s.ResultsItemPreviewOutline,{children:[e.jsx(s.ResultsItemPreviewOutlineTitle,{}),e.jsx(s.ResultsItemPreviewOutlineList,{children:r=>r.map((t,n)=>e.jsxs(s.ResultsItemPreviewOutlineItem,{href:t.url??void 0,"data-is-match":d.dataAttr(t.isMatch),children:[e.jsx(s.ResultsItemPreviewOutlineItemIcon,{}),e.jsx(s.ResultsItemPreviewOutlineItemText,{children:t.content}),t.url&&e.jsx(s.ResultsItemPreviewOutlineItemLinkIcon,{})]},`${t.anchor}-${n}`))})]})]})}),e.jsx(s.ResultsScrollAreaScrollbar,{children:e.jsx(s.ResultsScrollAreaThumb,{})}),e.jsx(s.ResultsScrollAreaCorner,{})]})}function y(){return e.jsx(s.Footer,{children:e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{}),e.jsx(s.TaglineBrandName,{})]})})}exports.InkeepEmbeddedSearch=b;exports.InkeepEmbeddedSearchImpl=h;exports.InkeepEmbeddedSearchImplContent=m;exports.InkeepEmbeddedSearchProvider=I;
|