@next-bricks/ai-portal 0.58.13 → 0.58.15

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.
Files changed (42) hide show
  1. package/dist/bricks.json +27 -27
  2. package/dist/chunks/151.a1330dd5.js +2 -0
  3. package/dist/chunks/151.a1330dd5.js.map +1 -0
  4. package/dist/chunks/2084.778e8126.js.map +1 -1
  5. package/dist/chunks/{2232.57f7b38c.js → 2232.db8e7b47.js} +2 -2
  6. package/dist/chunks/2232.db8e7b47.js.map +1 -0
  7. package/dist/chunks/5712.82a31234.js +2 -0
  8. package/dist/chunks/5712.82a31234.js.map +1 -0
  9. package/dist/chunks/9496.471f9fb9.js +2 -0
  10. package/dist/chunks/9496.471f9fb9.js.map +1 -0
  11. package/dist/chunks/{chat-box.82360f9a.js → chat-box.2f9b10eb.js} +2 -2
  12. package/dist/chunks/chat-box.2f9b10eb.js.map +1 -0
  13. package/dist/chunks/elevo-sidebar.0d1f76dd.js +3 -0
  14. package/dist/chunks/elevo-sidebar.0d1f76dd.js.map +1 -0
  15. package/dist/chunks/{goal-card-list.44c21cf2.js → goal-card-list.ca03d258.js} +3 -3
  16. package/dist/chunks/goal-card-list.ca03d258.js.map +1 -0
  17. package/dist/chunks/{main.5fc54860.js → main.8208534c.js} +2 -2
  18. package/dist/chunks/{main.5fc54860.js.map → main.8208534c.js.map} +1 -1
  19. package/dist/examples.json +19 -19
  20. package/dist/{index.a9ae68ac.js → index.cdd388a0.js} +2 -2
  21. package/dist/{index.a9ae68ac.js.map → index.cdd388a0.js.map} +1 -1
  22. package/dist/manifest.json +228 -228
  23. package/dist/types.json +941 -941
  24. package/dist-types/chat-box/index.d.ts +1 -0
  25. package/dist-types/elevo-sidebar/bricks.d.ts +3 -1
  26. package/dist-types/shared/TaskContext.d.ts +1 -0
  27. package/dist-types/shared/useHandleEscape.d.ts +2 -0
  28. package/dist-types/shared/useHandleEscape.spec.d.ts +1 -0
  29. package/package.json +2 -2
  30. package/dist/chunks/151.0550e056.js +0 -2
  31. package/dist/chunks/151.0550e056.js.map +0 -1
  32. package/dist/chunks/2232.57f7b38c.js.map +0 -1
  33. package/dist/chunks/6811.a67f5755.js +0 -2
  34. package/dist/chunks/6811.a67f5755.js.map +0 -1
  35. package/dist/chunks/9496.065a4fc5.js +0 -2
  36. package/dist/chunks/9496.065a4fc5.js.map +0 -1
  37. package/dist/chunks/chat-box.82360f9a.js.map +0 -1
  38. package/dist/chunks/elevo-sidebar.dcdcd0e4.js +0 -3
  39. package/dist/chunks/elevo-sidebar.dcdcd0e4.js.map +0 -1
  40. package/dist/chunks/goal-card-list.44c21cf2.js.map +0 -1
  41. /package/dist/chunks/{elevo-sidebar.dcdcd0e4.js.LICENSE.txt → elevo-sidebar.0d1f76dd.js.LICENSE.txt} +0 -0
  42. /package/dist/chunks/{goal-card-list.44c21cf2.js.LICENSE.txt → goal-card-list.ca03d258.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/2084.778e8126.js","mappings":";qMAEO,IAAKA,EAAC,SAADA,GAAC,OAADA,EAAC,oBAADA,EAAC,gBAADA,EAAC,cAADA,EAAC,sBAADA,EAAC,kCAADA,EAAC,oCAADA,EAAC,kCAADA,EAAC,QAADA,EAAC,oBAADA,EAAC,kBAADA,EAAC,gCAADA,EAAC,kCAADA,EAAC,oBAADA,EAAC,kBAADA,CAAC,MAiBb,MAAMC,EAAa,CACjB,CAACD,EAAEE,UAAW,WACd,CAACF,EAAEG,QAAS,SACZ,CAACH,EAAEI,OAAQ,QACX,CAACJ,EAAEK,WAAY,YACf,CAACL,EAAEM,iBAAkB,kBACrB,CAACN,EAAEO,kBAAmB,mBACtB,CAACP,EAAEQ,iBAAkB,KACrB,CAACR,EAAES,IAAK,KACR,CAACT,EAAEU,UAAW,WACd,CAACV,EAAEW,SAAU,QACb,CAACX,EAAEY,gBAAiB,iBACpB,CAACZ,EAAEa,iBAAkB,kBACrB,CAACb,EAAEc,UA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E,IAAMH,EAAKG,IAAMH,EAAKI,OAC/CX,EAAgBS,EAAO,EAAE,GACxB,KAEH,OADAR,EAAOW,iBAAiB,SAAUP,GAC3B,KACLJ,EAAOY,oBAAoB,SAAUR,EAAS,CAC/C,GACA,CAACtC,EAAWvG,IAGboG,IAAAA,cAAA,OACEC,UAAWC,IAAW,gBAAiB,CAAEgD,OAAQf,IACjDjJ,IAAKA,GAEL8G,IAAAA,cAAA,OAAKC,UAAU,gBAAgBiB,QAASZ,GACrCD,EACDL,IAAAA,cAACrI,EAAAA,GAAW,CAACiB,IAAI,KAAKC,KAAK,gBAE5BqJ,EAGP,8DCxiBO,SAASzB,EAAOxH,GAAgD,IAA/C,IAAEyH,EAAG,eAAEC,EAAc,OAAEC,GAAsB3H,EACnE,MAAO6H,EAAQqC,IAAanJ,EAAAA,EAAAA,WAAS,GAsBrC,OApBAiC,EAAAA,EAAAA,YAAU,KACR,SAASmH,EAAgBC,GACvB,GAAK3C,EAAL,CAIA,IAAK,MAAM4C,IAAQ,CAAC5C,KAASC,QAAAA,EAAkB,IAE7C,IADgB4C,EAAAA,EAAAA,WAAUF,EAAIG,SAAU,CAAEF,OAAMG,OAAO,IAGrD,YADAN,GAAU,GAIdA,GAAU,EARV,MAFEA,GAAU,EAWd,CACA,MAAMO,GAAUC,EAAAA,EAAAA,cAEhB,OADAP,EAAgBM,EAAQE,UACjBF,EAAQG,OAAOT,EAAgB,GACrC,CAAC1C,EAAKC,IAEFC,EAAO,CAAEE,UAClB","sources":["webpack:///./src/elevo-sidebar/i18n.ts","webpack:///./src/elevo-sidebar/styles.shadow.css","webpack:///./src/elevo-sidebar/bricks.ts","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/getElevoProjects.js","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/listElevoConversations.js","webpack:///./src/elevo-sidebar/ChatHistory.tsx","webpack:///./src/elevo-sidebar/NavLink.tsx"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\n\nexport enum K {\n NEW_CHAT = \"NEW_CHAT\",\n LOGOUT = \"LOGOUT\",\n TODAY = \"TODAY\",\n YESTERDAY = \"YESTERDAY\",\n PREVIOUS_7_DAYS = \"PREVIOUS_7_DAYS\",\n PREVIOUS_30_DAYS = \"PREVIOUS_30_DAYS\",\n SWITCH_LANGUAGE = \"SWITCH_LANGUAGE\",\n MY = \"MY\",\n PROJECTS = \"PROJECTS\",\n HISTORY = \"HISTORY\",\n CREATE_PROJECT = \"CREATE_PROJECT\",\n MOVE_TO_PROJECT = \"MOVE_TO_PROJECT\",\n UNTITLED = \"UNTITLED\",\n UNNAMED = \"UNNAMED\",\n}\n\nconst en: Locale = {\n [K.NEW_CHAT]: \"New chat\",\n [K.LOGOUT]: \"Logout\",\n [K.TODAY]: \"Today\",\n [K.YESTERDAY]: \"Yesterday\",\n [K.PREVIOUS_7_DAYS]: \"Previous 7 days\",\n [K.PREVIOUS_30_DAYS]: \"Previous 30 days\",\n [K.SWITCH_LANGUAGE]: \"中文\",\n [K.MY]: \"My\",\n [K.PROJECTS]: \"Projects\",\n [K.HISTORY]: \"Chats\",\n [K.CREATE_PROJECT]: \"Create project\",\n [K.MOVE_TO_PROJECT]: \"Move to project\",\n [K.UNTITLED]: \"Untitled\",\n [K.UNNAMED]: \"Unnamed\",\n};\n\nconst zh: Locale = {\n [K.NEW_CHAT]: \"新对话\",\n [K.LOGOUT]: \"登出\",\n [K.TODAY]: \"今天\",\n [K.YESTERDAY]: \"昨天\",\n [K.PREVIOUS_7_DAYS]: \"过去7天\",\n [K.PREVIOUS_30_DAYS]: \"过去30天\",\n [K.SWITCH_LANGUAGE]: \"English\",\n [K.MY]: \"我的\",\n [K.PROJECTS]: \"项目\",\n [K.HISTORY]: \"对话\",\n [K.CREATE_PROJECT]: \"创建项目\",\n [K.MOVE_TO_PROJECT]: \"移动到项目\",\n [K.UNTITLED]: \"无标题\",\n [K.UNNAMED]: \"未命名\",\n};\n\nexport const NS = \"bricks/ai-portal/elevo-sidebar\";\n\nexport const locales = { en, zh };\n\nexport const t = i18n.getFixedT(null, NS);\n\ntype Locale = { [k in K]: string } & {\n [k in K as `${k}_plural`]?: string;\n};\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:12px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior=\"drawer\"]){z-index:2;width:0}:host(:not([behavior=\"drawer\"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.links{border-bottom:1px solid rgba(0,0,0,0.06);padding-bottom:16px;margin-bottom:16px}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:\"\";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","import { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\nimport type {\n EoDropdownActions,\n DropdownActionsProps,\n DropdownActionsEvents,\n DropdownActionsEventsMapping,\n} from \"@next-bricks/basic/dropdown-actions\";\nimport type {\n EoEasyopsAvatar,\n EoEasyopsAvatarProps,\n} from \"@next-bricks/basic/easyops-avatar\";\nimport type {\n EoMiniActions,\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping,\n EoMiniActionsProps,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { IconButton, IconButtonProps } from \"../icon-button\";\n\nexport const WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nexport const WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\nexport const WrappedDropdownActions = wrapBrick<\n EoDropdownActions,\n DropdownActionsProps,\n DropdownActionsEvents,\n DropdownActionsEventsMapping\n>(\"eo-dropdown-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedEasyopsAvatar = wrapBrick<\n EoEasyopsAvatar,\n EoEasyopsAvatarProps\n>(\"eo-easyops-avatar\");\nexport const WrappedMiniActions = wrapBrick<\n EoMiniActions,\n EoMiniActionsProps & { themeVariant?: \"default\" | \"elevo\" },\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping\n>(\"eo-mini-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedIconButton = wrapBrick<IconButton, IconButtonProps>(\n \"ai-portal.icon-button\"\n);\n","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo项目列表\n * @endpoint list /api/v1/elevo/projects\n */\nexport const ElevoApi_getElevoProjects = async (params, options) => /**! @contract easyops.api.llm.elevo.GetElevoProjects@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/projects\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=getElevoProjects.js.map","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo会话列表\n * @endpoint GET /api/v1/elevo/conversations\n */\nexport const ElevoApi_listElevoConversations = async (params, options) => /**! @contract easyops.api.llm.elevo.ListElevoConversations@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=listElevoConversations.js.map","import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type MutableRefObject,\n type PropsWithChildren,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ElevoApi_listElevoConversations,\n ElevoApi_getElevoProjects,\n type ElevoApi_ListElevoConversationsRequestParams,\n} from \"@next-api-sdk/llm-sdk\";\nimport type {\n ActionType,\n SimpleActionType,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { GeneralIconProps } from \"@next-bricks/icons/general-icon\";\nimport { isEqual, throttle } from \"lodash\";\nimport { K, t } from \"./i18n.js\";\nimport {\n WrappedIcon,\n WrappedLink,\n WrappedMiniActions,\n WrappedIconButton,\n} from \"./bricks.js\";\nimport { DONE_STATES } from \"../shared/constants.js\";\nimport { parseTemplate } from \"../shared/parseTemplate.js\";\nimport type { ConversationState } from \"../shared/interfaces.js\";\nimport type { SidebarLink } from \"./index.js\";\nimport { NavLink } from \"./NavLink.js\";\n\nconst ADD_ICON: GeneralIconProps = {\n lib: \"fa\",\n icon: \"plus\",\n};\n\nexport interface HistoryItem {\n conversationId: string;\n title: string;\n startTime: number;\n state?: ConversationState;\n}\n\nexport interface GroupedHistory {\n title: string;\n items: HistoryItem[];\n}\n\nexport interface ActionClickDetail {\n action: SimpleActionType;\n item: HistoryItem;\n project?: Project;\n}\n\nexport interface ProjectActionClickDetail {\n action: SimpleActionType;\n project: Project;\n}\n\nexport interface Project {\n /** 实例ID */\n instanceId: string;\n /** 项目名称 */\n name: string;\n /** 项目描述 */\n description: string;\n /** 状态 */\n state: \"active\" | \"inactive\";\n /** 默认数字人ID */\n defaultAiEmployeeId: string;\n /** 创建者 */\n creator: string;\n /** 创建时间 */\n ctime: string;\n /** 修改时间 */\n mtime: string;\n /** 修改者 */\n modifier: string;\n}\n\nexport interface ChatHistoryProps {\n historyUrlTemplate?: string;\n historyActions?: ActionType[];\n projectUrlTemplate?: string;\n projectActions?: ActionType[];\n canAddProject?: boolean;\n myLinks?: SidebarLink[];\n onActionClick: (detail: ActionClickDetail) => void;\n onHistoryClick: () => void;\n onProjectActionClick: (detail: ProjectActionClickDetail) => void;\n onAddProject: () => void;\n}\n\nexport interface ChatHistoryRef {\n pull: () => void;\n removeProject?: (projectId: string) => void;\n addProject?: (project: Project) => void;\n moveConversation?: (conversationId: string) => void;\n}\n\nexport const ChatHistory = forwardRef(LowLevelChatHistory);\n\nexport function LowLevelChatHistory(\n {\n historyActions,\n historyUrlTemplate,\n projectUrlTemplate,\n projectActions,\n canAddProject,\n myLinks,\n onActionClick,\n onHistoryClick,\n onProjectActionClick,\n onAddProject,\n }: ChatHistoryProps,\n ref: React.Ref<ChatHistoryRef>\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [myCollapsed, setMyCollapsed] = useState(false);\n const [projects, setProjects] = useState<Project[] | null>(null);\n const [projectsCollapsed, setProjectsCollapsed] = useState(false);\n const [projectsError, setProjectsError] = useState(false);\n const [historyList, setHistoryList] = useState<HistoryItem[] | null>(null);\n const [historyCollapsed, setHistoryCollapsed] = useState(false);\n const [nextToken, setNextToken] = useState<string | undefined>();\n const [loadNextToken, setLoadNextToken] = useState<string | undefined>();\n const [historyError, setHistoryError] = useState(false);\n const initialRef = useRef(true);\n const [movedConversations, setMovedConversations] = useState<string[]>([]);\n\n const mergedHistoryActions = useMemo(\n () =>\n [\n ...(historyActions ?? []),\n {\n isDropdown: true,\n text: t(K.MOVE_TO_PROJECT),\n disabled: !projects?.length,\n items: projects?.map((project) => ({\n event: \"move\",\n key: project.instanceId,\n text: project.name,\n project,\n })),\n },\n ] as ActionType[],\n [historyActions, projects]\n );\n\n useEffect(() => {\n (async () => {\n try {\n const projects = await ElevoApi_getElevoProjects({\n page: 1,\n page_size: 3000,\n });\n setProjects(projects.list as Project[]);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error loading projects:\", error);\n setProjectsError(true);\n setProjects([]);\n }\n })();\n }, []);\n\n useEffect(() => {\n Promise.all([\n ElevoApi_listElevoConversations(\n {\n token: loadNextToken,\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n ),\n ...(initialRef.current\n ? []\n : [\n new Promise((resolve) => setTimeout(resolve, 500)), // Force a minimum delay\n ]),\n ])\n .then(([data]) => {\n initialRef.current = false;\n setHistoryList((prev) => [\n ...(prev ?? []),\n ...(data.conversations as HistoryItem[]),\n ]);\n setNextToken(data.nextToken);\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.error(\"Error loading chat history:\", error);\n setHistoryList([]);\n setHistoryError(true);\n });\n }, [loadNextToken]);\n\n const [actionsVisible, setActionsVisible] = useState<string | null>(null);\n\n const nextRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n const next = nextRef.current;\n const root = rootRef.current;\n if (!next || !nextToken || !root || historyCollapsed) {\n return;\n }\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n setLoadNextToken(nextToken);\n }\n }\n },\n { root }\n );\n observer.observe(next);\n return () => {\n observer.disconnect();\n };\n }, [nextToken, historyCollapsed]);\n\n const pullIdRef = useRef(0);\n\n const pull = useCallback(async () => {\n try {\n const pullId = ++pullIdRef.current;\n const tempList = await ElevoApi_listElevoConversations(\n {\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n );\n if (pullId !== pullIdRef.current) {\n // Ignore this pull if a newer one has been triggered\n return;\n }\n setHistoryList((prev) => {\n const prevList = prev ?? [];\n const newList = tempList.conversations as HistoryItem[];\n const newIds = new Set(newList.map((item) => item.conversationId));\n const newItemsMap = new Map(\n newList.map((item) => [item.conversationId, item])\n );\n\n let foundIntersection = false;\n let foundChanged = false;\n let isFirst = true;\n for (const item of prevList) {\n const newItem = newItemsMap.get(item.conversationId);\n if (newItem) {\n foundIntersection = true;\n foundChanged =\n (isFirst && newItem !== newList[0]) || !isEqual(newItem, item);\n if (foundChanged) {\n break;\n }\n } else {\n break;\n }\n isFirst = false;\n }\n\n if (!foundIntersection) {\n setNextToken(tempList.nextToken);\n return newList;\n }\n\n if (foundChanged) {\n return [\n ...newList,\n ...prevList.filter((item) => !newIds.has(item.conversationId)),\n ];\n }\n\n return prev;\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error pulling chat history:\", error);\n }\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n pull,\n removeProject: (projectId: string) => {\n setProjects((prev) =>\n prev ? prev.filter((p) => p.instanceId !== projectId) : prev\n );\n },\n addProject: (project: Project) => {\n setProjects((prev) => (prev ? [...prev, project] : [project]));\n },\n moveConversation: (conversationId: string) => {\n setMovedConversations((prev) => [...prev, conversationId]);\n },\n }),\n [pull]\n );\n\n const filteredHistoryList = useMemo(() => {\n if (!historyList || !historyList.length) {\n return historyList;\n }\n return historyList.filter(\n (item) => !movedConversations.includes(item.conversationId)\n );\n }, [historyList, movedConversations]);\n\n return (\n <div className=\"history\" ref={rootRef}>\n {myLinks?.length ? (\n <div className={classNames(\"section\", { collapsed: myCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.MY)}\n collapsed={myCollapsed}\n onToggle={() => setMyCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {myLinks.map((link, index) => (\n <li key={index}>\n <NavLink\n url={link.url}\n activeIncludes={link.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={link.url}\n >\n <div className=\"item-title\">{link.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n <div className={classNames(\"section\", { collapsed: projectsCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.PROJECTS)}\n collapsed={projectsCollapsed}\n onToggle={() => setProjectsCollapsed((prev) => !prev)}\n >\n {canAddProject && (\n <WrappedIconButton\n icon={ADD_ICON}\n variant=\"mini-light\"\n tooltip={t(K.CREATE_PROJECT)}\n tooltipHoist={true}\n className=\"button\"\n onClick={onAddProject}\n />\n )}\n </SectionTitle>\n <ul className=\"items\">\n {projectsError ? (\n <li className=\"error\">Failed to load project</li>\n ) : projects ? (\n projects.map((project) => {\n const url = projectUrlTemplate\n ? parseTemplate(projectUrlTemplate, project)\n : undefined;\n return (\n <li key={project.instanceId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n project.instanceId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(url ? { url } : null)}\n >\n <div className=\"item-title\" title={project.name}>\n {project.name || t(K.UNNAMED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={projectActions}\n themeVariant=\"elevo\"\n onActionClick={(e) => {\n onProjectActionClick({ action: e.detail, project });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? project.instanceId : null\n );\n }}\n />\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n </ul>\n </div>\n <div className={classNames(\"section\", { collapsed: historyCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.HISTORY)}\n collapsed={historyCollapsed}\n onToggle={() => setHistoryCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {filteredHistoryList ? (\n filteredHistoryList.map((item) => {\n const url = historyUrlTemplate\n ? parseTemplate(historyUrlTemplate, item)\n : undefined;\n return (\n <li key={item.conversationId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n item.conversationId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(historyUrlTemplate\n ? { url: parseTemplate(historyUrlTemplate, item) }\n : null)}\n >\n <div className=\"item-title\" title={item.title}>\n {item.title || t(K.UNTITLED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={mergedHistoryActions}\n onActionClick={(e) => {\n onActionClick({ action: e.detail, item });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? item.conversationId : null\n );\n }}\n />\n {!DONE_STATES.includes(item.state!) && (\n <div className=\"working\"></div>\n )}\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n {historyError ? (\n <li className=\"error\">Failed to load chat history</li>\n ) : null}\n </ul>\n {!historyCollapsed && nextToken && (\n <div className=\"load-more\" ref={nextRef}>\n <WrappedIcon lib=\"antd\" icon=\"loading-3-quarters\" spinning />\n </div>\n )}\n </div>\n </div>\n );\n}\n\ninterface SectionTitleProps {\n rootRef: MutableRefObject<HTMLDivElement | null>;\n title: string;\n collapsed: boolean;\n onToggle: () => void;\n}\n\nfunction SectionTitle({\n rootRef,\n title,\n collapsed,\n children,\n onToggle,\n}: PropsWithChildren<SectionTitleProps>) {\n const ref = useRef<HTMLDivElement | null>(null);\n const [stickyActive, setStickyActive] = useState(false);\n\n useEffect(() => {\n if (collapsed) {\n setStickyActive(false);\n return;\n }\n const parent = rootRef.current;\n const element = ref.current;\n const sibling = element?.nextElementSibling as HTMLElement | null;\n if (!parent || !element || !sibling) {\n return;\n }\n const onScroll = throttle(() => {\n const rect = element.getBoundingClientRect();\n const siblingRect = sibling.getBoundingClientRect();\n const diff = siblingRect.top - rect.top - rect.height;\n setStickyActive(diff < 1);\n }, 100);\n parent.addEventListener(\"scroll\", onScroll);\n return () => {\n parent.removeEventListener(\"scroll\", onScroll);\n };\n }, [collapsed, rootRef]);\n\n return (\n <div\n className={classNames(\"section-title\", { sticky: stickyActive })}\n ref={ref}\n >\n <div className=\"section-label\" onClick={onToggle}>\n {title}\n <WrappedIcon lib=\"fa\" icon=\"angle-down\" />\n </div>\n {children}\n </div>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { getHistory, matchPath } from \"@next-core/runtime\";\nimport type { Location } from \"history\";\n\nexport interface NavLinkProps {\n url?: string;\n activeIncludes?: string[];\n render: (props: { active: boolean }) => React.ReactElement;\n}\n\nexport function NavLink({ url, activeIncludes, render }: NavLinkProps) {\n const [active, setActive] = useState(false);\n\n useEffect(() => {\n function checkLinkActive(loc: Location) {\n if (!url) {\n setActive(false);\n return;\n }\n for (const path of [url, ...(activeIncludes ?? [])]) {\n const matched = matchPath(loc.pathname, { path, exact: false });\n if (matched) {\n setActive(true);\n return;\n }\n }\n setActive(false);\n }\n const history = getHistory();\n checkLinkActive(history.location);\n return history.listen(checkLinkActive);\n }, [url, activeIncludes]);\n\n return render({ active });\n}\n"],"names":["K","en","NEW_CHAT","LOGOUT","TODAY","YESTERDAY","PREVIOUS_7_DAYS","PREVIOUS_30_DAYS","SWITCH_LANGUAGE","MY","PROJECTS","HISTORY","CREATE_PROJECT","MOVE_TO_PROJECT","UNTITLED","UNNAMED","zh","NS","locales","t","i18n","getFixedT","___CSS_LOADER_EXPORT___","push","module","id","toString","WrappedIcon","wrapBrick","WrappedLink","WrappedDropdownActions","onActionClick","onVisibleChange","WrappedEasyopsAvatar","WrappedMiniActions","WrappedIconButton","ElevoApi_listElevoConversations","async","params","options","http","get","data","ADD_ICON","lib","icon","ChatHistory","forwardRef","LowLevelChatHistory","_ref","ref","historyActions","historyUrlTemplate","projectUrlTemplate","projectActions","canAddProject","myLinks","onHistoryClick","onProjectActionClick","onAddProject","rootRef","useRef","myCollapsed","setMyCollapsed","useState","projects","setProjects","projectsCollapsed","setProjectsCollapsed","projectsError","setProjectsError","historyList","setHistoryList","historyCollapsed","setHistoryCollapsed","nextToken","setNextToken","loadNextToken","setLoadNextToken","historyError","setHistoryError","initialRef","movedConversations","setMovedConversations","mergedHistoryActions","useMemo","isDropdown","text","disabled","length","items","map","project","event","key","instanceId","name","useEffect","page","page_size","ElevoApi_getElevoProjects","list","error","console","Promise","all","token","limit","onlyOwner","onlyUnrelatedProject","interceptorParams","ignoreLoadingBar","current","resolve","setTimeout","then","_ref2","prev","conversations","catch","actionsVisible","setActionsVisible","nextRef","next","root","observer","IntersectionObserver","entries","entry","isIntersecting","observe","disconnect","pullIdRef","pull","useCallback","pullId","tempList","prevList","newList","newIds","Set","item","conversationId","newItemsMap","Map","foundIntersection","foundChanged","isFirst","newItem","isEqual","filter","has","useImperativeHandle","removeProject","projectId","p","addProject","moveConversation","filteredHistoryList","includes","React","className","classNames","collapsed","SectionTitle","title","onToggle","link","index","NavLink","url","activeIncludes","render","_ref3","active","variant","tooltip","tooltipHoist","onClick","parseTemplate","undefined","_ref4","_extends","actions","themeVariant","e","action","detail","theme","spinning","_ref5","DONE_STATES","state","_ref6","children","stickyActive","setStickyActive","parent","element","sibling","nextElementSibling","onScroll","throttle","rect","getBoundingClientRect","diff","top","height","addEventListener","removeEventListener","sticky","setActive","checkLinkActive","loc","path","matchPath","pathname","exact","history","getHistory","location","listen"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/2084.778e8126.js","mappings":";qMAEO,IAAKA,EAAC,SAADA,GAAC,OAADA,EAAC,oBAADA,EAAC,gBAADA,EAAC,cAADA,EAAC,sBAADA,EAAC,kCAADA,EAAC,oCAADA,EAAC,kCAADA,EAAC,QAADA,EAAC,oBAADA,EAAC,kBAADA,EAAC,gCAADA,EAAC,kCAADA,EAAC,oBAADA,EAAC,kBAADA,CAAC,MAiBb,MAAMC,EAAa,CACjB,CAACD,EAAEE,UAAW,WACd,CAACF,EAAEG,QAAS,SACZ,CAACH,EAAEI,OAAQ,QACX,CAACJ,EAAEK,WAAY,YACf,CAACL,EAAEM,iBAAkB,kBACrB,CAACN,EAAEO,kBAAmB,mBACtB,CAACP,EAAEQ,iBAAkB,KACrB,CAACR,EAAES,IAAK,KACR,CAACT,EAAEU,UAAW,WACd,CAACV,EAAEW,SAAU,QACb,CAACX,EAAEY,gBAAiB,iBACpB,CAACZ,EAAEa,iBAAkB,kBACrB,CAACb,EAAEc,UAAW,WACd,CAACd,EAAEe,SAAU,WAGTC,EAAa,CACjB,CAAChB,EAAEE,UAAW,MACd,CAACF,EAAEG,QAAS,KACZ,CAACH,EAAEI,OAAQ,KACX,CAACJ,EAAEK,WAAY,KACf,CAACL,EAAEM,iBAAkB,OACrB,CAACN,EAAEO,kBAAmB,QACtB,CAACP,EAAEQ,iBAAkB,UACrB,CAACR,EAAES,IAAK,KACR,CAACT,EAAEU,UAAW,KACd,CAACV,EAAEW,SAAU,KACb,CAACX,EAAEY,gBAAiB,OACpB,CAACZ,EAAEa,iBAA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iB,IAAI,KAAKC,KAAK,gBAE5BqJ,EAGP,8DCxiBO,SAASzB,EAAOxH,GAAgD,IAA/C,IAAEyH,EAAG,eAAEC,EAAc,OAAEC,GAAsB3H,EACnE,MAAO6H,EAAQqC,IAAanJ,EAAAA,EAAAA,WAAS,GAsBrC,OApBAiC,EAAAA,EAAAA,YAAU,KACR,SAASmH,EAAgBC,GACvB,GAAK3C,EAAL,CAIA,IAAK,MAAM4C,IAAQ,CAAC5C,KAASC,QAAAA,EAAkB,IAE7C,IADgB4C,EAAAA,EAAAA,WAAUF,EAAIG,SAAU,CAAEF,OAAMG,OAAO,IAGrD,YADAN,GAAU,GAIdA,GAAU,EARV,MAFEA,GAAU,EAWd,CACA,MAAMO,GAAUC,EAAAA,EAAAA,cAEhB,OADAP,EAAgBM,EAAQE,UACjBF,EAAQG,OAAOT,EAAgB,GACrC,CAAC1C,EAAKC,IAEFC,EAAO,CAAEE,UAClB","sources":["webpack:///./src/elevo-sidebar/i18n.ts","webpack:///./src/elevo-sidebar/styles.shadow.css","webpack:///./src/elevo-sidebar/bricks.ts","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/getElevoProjects.js","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/listElevoConversations.js","webpack:///./src/elevo-sidebar/ChatHistory.tsx","webpack:///./src/elevo-sidebar/NavLink.tsx"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\n\nexport enum K {\n NEW_CHAT = \"NEW_CHAT\",\n LOGOUT = \"LOGOUT\",\n TODAY = \"TODAY\",\n YESTERDAY = \"YESTERDAY\",\n PREVIOUS_7_DAYS = \"PREVIOUS_7_DAYS\",\n PREVIOUS_30_DAYS = \"PREVIOUS_30_DAYS\",\n SWITCH_LANGUAGE = \"SWITCH_LANGUAGE\",\n MY = \"MY\",\n PROJECTS = \"PROJECTS\",\n HISTORY = \"HISTORY\",\n CREATE_PROJECT = \"CREATE_PROJECT\",\n MOVE_TO_PROJECT = \"MOVE_TO_PROJECT\",\n UNTITLED = \"UNTITLED\",\n UNNAMED = \"UNNAMED\",\n}\n\nconst en: Locale = {\n [K.NEW_CHAT]: \"New chat\",\n [K.LOGOUT]: \"Logout\",\n [K.TODAY]: \"Today\",\n [K.YESTERDAY]: \"Yesterday\",\n [K.PREVIOUS_7_DAYS]: \"Previous 7 days\",\n [K.PREVIOUS_30_DAYS]: \"Previous 30 days\",\n [K.SWITCH_LANGUAGE]: \"中文\",\n [K.MY]: \"My\",\n [K.PROJECTS]: \"Projects\",\n [K.HISTORY]: \"Chats\",\n [K.CREATE_PROJECT]: \"Create project\",\n [K.MOVE_TO_PROJECT]: \"Move to project\",\n [K.UNTITLED]: \"Untitled\",\n [K.UNNAMED]: \"Unnamed\",\n};\n\nconst zh: Locale = {\n [K.NEW_CHAT]: \"新对话\",\n [K.LOGOUT]: \"登出\",\n [K.TODAY]: \"今天\",\n [K.YESTERDAY]: \"昨天\",\n [K.PREVIOUS_7_DAYS]: \"过去7天\",\n [K.PREVIOUS_30_DAYS]: \"过去30天\",\n [K.SWITCH_LANGUAGE]: \"English\",\n [K.MY]: \"我的\",\n [K.PROJECTS]: \"项目\",\n [K.HISTORY]: \"对话\",\n [K.CREATE_PROJECT]: \"创建项目\",\n [K.MOVE_TO_PROJECT]: \"移动到项目\",\n [K.UNTITLED]: \"无标题\",\n [K.UNNAMED]: \"未命名\",\n};\n\nexport const NS = \"bricks/ai-portal/elevo-sidebar\";\n\nexport const locales = { en, zh };\n\nexport const t = i18n.getFixedT(null, NS);\n\ntype Locale = { [k in K]: string } & {\n [k in K as `${k}_plural`]?: string;\n};\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:12px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior=\"drawer\"]){z-index:2;width:0}:host(:not([behavior=\"drawer\"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.links{border-bottom:1px solid rgba(0,0,0,0.06);padding-bottom:16px;margin-bottom:16px}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:\"\";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","import { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\nimport type {\n EoDropdownActions,\n DropdownActionsProps,\n DropdownActionsEvents,\n DropdownActionsEventsMapping,\n} from \"@next-bricks/basic/dropdown-actions\";\nimport type {\n EoEasyopsAvatar,\n EoEasyopsAvatarProps,\n} from \"@next-bricks/basic/easyops-avatar\";\nimport type {\n EoMiniActions,\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping,\n EoMiniActionsProps,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { IconButton, IconButtonProps } from \"../icon-button\";\n\nexport const WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nexport const WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\nexport const WrappedDropdownActions = wrapBrick<\n EoDropdownActions,\n DropdownActionsProps & { themeVariant?: \"default\" | \"elevo\" },\n DropdownActionsEvents,\n DropdownActionsEventsMapping\n>(\"eo-dropdown-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedEasyopsAvatar = wrapBrick<\n EoEasyopsAvatar,\n EoEasyopsAvatarProps\n>(\"eo-easyops-avatar\");\nexport const WrappedMiniActions = wrapBrick<\n EoMiniActions,\n EoMiniActionsProps & { themeVariant?: \"default\" | \"elevo\" },\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping\n>(\"eo-mini-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedIconButton = wrapBrick<IconButton, IconButtonProps>(\n \"ai-portal.icon-button\"\n);\n","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo项目列表\n * @endpoint list /api/v1/elevo/projects\n */\nexport const ElevoApi_getElevoProjects = async (params, options) => /**! @contract easyops.api.llm.elevo.GetElevoProjects@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/projects\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=getElevoProjects.js.map","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo会话列表\n * @endpoint GET /api/v1/elevo/conversations\n */\nexport const ElevoApi_listElevoConversations = async (params, options) => /**! @contract easyops.api.llm.elevo.ListElevoConversations@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=listElevoConversations.js.map","import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type MutableRefObject,\n type PropsWithChildren,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ElevoApi_listElevoConversations,\n ElevoApi_getElevoProjects,\n type ElevoApi_ListElevoConversationsRequestParams,\n} from \"@next-api-sdk/llm-sdk\";\nimport type {\n ActionType,\n SimpleActionType,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { GeneralIconProps } from \"@next-bricks/icons/general-icon\";\nimport { isEqual, throttle } from \"lodash\";\nimport { K, t } from \"./i18n.js\";\nimport {\n WrappedIcon,\n WrappedLink,\n WrappedMiniActions,\n WrappedIconButton,\n} from \"./bricks.js\";\nimport { DONE_STATES } from \"../shared/constants.js\";\nimport { parseTemplate } from \"../shared/parseTemplate.js\";\nimport type { ConversationState } from \"../shared/interfaces.js\";\nimport type { SidebarLink } from \"./index.js\";\nimport { NavLink } from \"./NavLink.js\";\n\nconst ADD_ICON: GeneralIconProps = {\n lib: \"fa\",\n icon: \"plus\",\n};\n\nexport interface HistoryItem {\n conversationId: string;\n title: string;\n startTime: number;\n state?: ConversationState;\n}\n\nexport interface GroupedHistory {\n title: string;\n items: HistoryItem[];\n}\n\nexport interface ActionClickDetail {\n action: SimpleActionType;\n item: HistoryItem;\n project?: Project;\n}\n\nexport interface ProjectActionClickDetail {\n action: SimpleActionType;\n project: Project;\n}\n\nexport interface Project {\n /** 实例ID */\n instanceId: string;\n /** 项目名称 */\n name: string;\n /** 项目描述 */\n description: string;\n /** 状态 */\n state: \"active\" | \"inactive\";\n /** 默认数字人ID */\n defaultAiEmployeeId: string;\n /** 创建者 */\n creator: string;\n /** 创建时间 */\n ctime: string;\n /** 修改时间 */\n mtime: string;\n /** 修改者 */\n modifier: string;\n}\n\nexport interface ChatHistoryProps {\n historyUrlTemplate?: string;\n historyActions?: ActionType[];\n projectUrlTemplate?: string;\n projectActions?: ActionType[];\n canAddProject?: boolean;\n myLinks?: SidebarLink[];\n onActionClick: (detail: ActionClickDetail) => void;\n onHistoryClick: () => void;\n onProjectActionClick: (detail: ProjectActionClickDetail) => void;\n onAddProject: () => void;\n}\n\nexport interface ChatHistoryRef {\n pull: () => void;\n removeProject?: (projectId: string) => void;\n addProject?: (project: Project) => void;\n moveConversation?: (conversationId: string) => void;\n}\n\nexport const ChatHistory = forwardRef(LowLevelChatHistory);\n\nexport function LowLevelChatHistory(\n {\n historyActions,\n historyUrlTemplate,\n projectUrlTemplate,\n projectActions,\n canAddProject,\n myLinks,\n onActionClick,\n onHistoryClick,\n onProjectActionClick,\n onAddProject,\n }: ChatHistoryProps,\n ref: React.Ref<ChatHistoryRef>\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [myCollapsed, setMyCollapsed] = useState(false);\n const [projects, setProjects] = useState<Project[] | null>(null);\n const [projectsCollapsed, setProjectsCollapsed] = useState(false);\n const [projectsError, setProjectsError] = useState(false);\n const [historyList, setHistoryList] = useState<HistoryItem[] | null>(null);\n const [historyCollapsed, setHistoryCollapsed] = useState(false);\n const [nextToken, setNextToken] = useState<string | undefined>();\n const [loadNextToken, setLoadNextToken] = useState<string | undefined>();\n const [historyError, setHistoryError] = useState(false);\n const initialRef = useRef(true);\n const [movedConversations, setMovedConversations] = useState<string[]>([]);\n\n const mergedHistoryActions = useMemo(\n () =>\n [\n ...(historyActions ?? []),\n {\n isDropdown: true,\n text: t(K.MOVE_TO_PROJECT),\n disabled: !projects?.length,\n items: projects?.map((project) => ({\n event: \"move\",\n key: project.instanceId,\n text: project.name,\n project,\n })),\n },\n ] as ActionType[],\n [historyActions, projects]\n );\n\n useEffect(() => {\n (async () => {\n try {\n const projects = await ElevoApi_getElevoProjects({\n page: 1,\n page_size: 3000,\n });\n setProjects(projects.list as Project[]);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error loading projects:\", error);\n setProjectsError(true);\n setProjects([]);\n }\n })();\n }, []);\n\n useEffect(() => {\n Promise.all([\n ElevoApi_listElevoConversations(\n {\n token: loadNextToken,\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n ),\n ...(initialRef.current\n ? []\n : [\n new Promise((resolve) => setTimeout(resolve, 500)), // Force a minimum delay\n ]),\n ])\n .then(([data]) => {\n initialRef.current = false;\n setHistoryList((prev) => [\n ...(prev ?? []),\n ...(data.conversations as HistoryItem[]),\n ]);\n setNextToken(data.nextToken);\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.error(\"Error loading chat history:\", error);\n setHistoryList([]);\n setHistoryError(true);\n });\n }, [loadNextToken]);\n\n const [actionsVisible, setActionsVisible] = useState<string | null>(null);\n\n const nextRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n const next = nextRef.current;\n const root = rootRef.current;\n if (!next || !nextToken || !root || historyCollapsed) {\n return;\n }\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n setLoadNextToken(nextToken);\n }\n }\n },\n { root }\n );\n observer.observe(next);\n return () => {\n observer.disconnect();\n };\n }, [nextToken, historyCollapsed]);\n\n const pullIdRef = useRef(0);\n\n const pull = useCallback(async () => {\n try {\n const pullId = ++pullIdRef.current;\n const tempList = await ElevoApi_listElevoConversations(\n {\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n );\n if (pullId !== pullIdRef.current) {\n // Ignore this pull if a newer one has been triggered\n return;\n }\n setHistoryList((prev) => {\n const prevList = prev ?? [];\n const newList = tempList.conversations as HistoryItem[];\n const newIds = new Set(newList.map((item) => item.conversationId));\n const newItemsMap = new Map(\n newList.map((item) => [item.conversationId, item])\n );\n\n let foundIntersection = false;\n let foundChanged = false;\n let isFirst = true;\n for (const item of prevList) {\n const newItem = newItemsMap.get(item.conversationId);\n if (newItem) {\n foundIntersection = true;\n foundChanged =\n (isFirst && newItem !== newList[0]) || !isEqual(newItem, item);\n if (foundChanged) {\n break;\n }\n } else {\n break;\n }\n isFirst = false;\n }\n\n if (!foundIntersection) {\n setNextToken(tempList.nextToken);\n return newList;\n }\n\n if (foundChanged) {\n return [\n ...newList,\n ...prevList.filter((item) => !newIds.has(item.conversationId)),\n ];\n }\n\n return prev;\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error pulling chat history:\", error);\n }\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n pull,\n removeProject: (projectId: string) => {\n setProjects((prev) =>\n prev ? prev.filter((p) => p.instanceId !== projectId) : prev\n );\n },\n addProject: (project: Project) => {\n setProjects((prev) => (prev ? [...prev, project] : [project]));\n },\n moveConversation: (conversationId: string) => {\n setMovedConversations((prev) => [...prev, conversationId]);\n },\n }),\n [pull]\n );\n\n const filteredHistoryList = useMemo(() => {\n if (!historyList || !historyList.length) {\n return historyList;\n }\n return historyList.filter(\n (item) => !movedConversations.includes(item.conversationId)\n );\n }, [historyList, movedConversations]);\n\n return (\n <div className=\"history\" ref={rootRef}>\n {myLinks?.length ? (\n <div className={classNames(\"section\", { collapsed: myCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.MY)}\n collapsed={myCollapsed}\n onToggle={() => setMyCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {myLinks.map((link, index) => (\n <li key={index}>\n <NavLink\n url={link.url}\n activeIncludes={link.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={link.url}\n >\n <div className=\"item-title\">{link.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n <div className={classNames(\"section\", { collapsed: projectsCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.PROJECTS)}\n collapsed={projectsCollapsed}\n onToggle={() => setProjectsCollapsed((prev) => !prev)}\n >\n {canAddProject && (\n <WrappedIconButton\n icon={ADD_ICON}\n variant=\"mini-light\"\n tooltip={t(K.CREATE_PROJECT)}\n tooltipHoist={true}\n className=\"button\"\n onClick={onAddProject}\n />\n )}\n </SectionTitle>\n <ul className=\"items\">\n {projectsError ? (\n <li className=\"error\">Failed to load project</li>\n ) : projects ? (\n projects.map((project) => {\n const url = projectUrlTemplate\n ? parseTemplate(projectUrlTemplate, project)\n : undefined;\n return (\n <li key={project.instanceId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n project.instanceId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(url ? { url } : null)}\n >\n <div className=\"item-title\" title={project.name}>\n {project.name || t(K.UNNAMED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={projectActions}\n themeVariant=\"elevo\"\n onActionClick={(e) => {\n onProjectActionClick({ action: e.detail, project });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? project.instanceId : null\n );\n }}\n />\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n </ul>\n </div>\n <div className={classNames(\"section\", { collapsed: historyCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.HISTORY)}\n collapsed={historyCollapsed}\n onToggle={() => setHistoryCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {filteredHistoryList ? (\n filteredHistoryList.map((item) => {\n const url = historyUrlTemplate\n ? parseTemplate(historyUrlTemplate, item)\n : undefined;\n return (\n <li key={item.conversationId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n item.conversationId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(historyUrlTemplate\n ? { url: parseTemplate(historyUrlTemplate, item) }\n : null)}\n >\n <div className=\"item-title\" title={item.title}>\n {item.title || t(K.UNTITLED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={mergedHistoryActions}\n onActionClick={(e) => {\n onActionClick({ action: e.detail, item });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? item.conversationId : null\n );\n }}\n />\n {!DONE_STATES.includes(item.state!) && (\n <div className=\"working\"></div>\n )}\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n {historyError ? (\n <li className=\"error\">Failed to load chat history</li>\n ) : null}\n </ul>\n {!historyCollapsed && nextToken && (\n <div className=\"load-more\" ref={nextRef}>\n <WrappedIcon lib=\"antd\" icon=\"loading-3-quarters\" spinning />\n </div>\n )}\n </div>\n </div>\n );\n}\n\ninterface SectionTitleProps {\n rootRef: MutableRefObject<HTMLDivElement | null>;\n title: string;\n collapsed: boolean;\n onToggle: () => void;\n}\n\nfunction SectionTitle({\n rootRef,\n title,\n collapsed,\n children,\n onToggle,\n}: PropsWithChildren<SectionTitleProps>) {\n const ref = useRef<HTMLDivElement | null>(null);\n const [stickyActive, setStickyActive] = useState(false);\n\n useEffect(() => {\n if (collapsed) {\n setStickyActive(false);\n return;\n }\n const parent = rootRef.current;\n const element = ref.current;\n const sibling = element?.nextElementSibling as HTMLElement | null;\n if (!parent || !element || !sibling) {\n return;\n }\n const onScroll = throttle(() => {\n const rect = element.getBoundingClientRect();\n const siblingRect = sibling.getBoundingClientRect();\n const diff = siblingRect.top - rect.top - rect.height;\n setStickyActive(diff < 1);\n }, 100);\n parent.addEventListener(\"scroll\", onScroll);\n return () => {\n parent.removeEventListener(\"scroll\", onScroll);\n };\n }, [collapsed, rootRef]);\n\n return (\n <div\n className={classNames(\"section-title\", { sticky: stickyActive })}\n ref={ref}\n >\n <div className=\"section-label\" onClick={onToggle}>\n {title}\n <WrappedIcon lib=\"fa\" icon=\"angle-down\" />\n </div>\n {children}\n </div>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { getHistory, matchPath } from \"@next-core/runtime\";\nimport type { Location } from \"history\";\n\nexport interface NavLinkProps {\n url?: string;\n activeIncludes?: string[];\n render: (props: { active: boolean }) => React.ReactElement;\n}\n\nexport function NavLink({ url, activeIncludes, render }: NavLinkProps) {\n const [active, setActive] = useState(false);\n\n useEffect(() => {\n function checkLinkActive(loc: Location) {\n if (!url) {\n setActive(false);\n return;\n }\n for (const path of [url, ...(activeIncludes ?? [])]) {\n const matched = matchPath(loc.pathname, { path, exact: false });\n if (matched) {\n setActive(true);\n return;\n }\n }\n setActive(false);\n }\n const history = getHistory();\n checkLinkActive(history.location);\n return history.listen(checkLinkActive);\n }, [url, activeIncludes]);\n\n return render({ active });\n}\n"],"names":["K","en","NEW_CHAT","LOGOUT","TODAY","YESTERDAY","PREVIOUS_7_DAYS","PREVIOUS_30_DAYS","SWITCH_LANGUAGE","MY","PROJECTS","HISTORY","CREATE_PROJECT","MOVE_TO_PROJECT","UNTITLED","UNNAMED","zh","NS","locales","t","i18n","getFixedT","___CSS_LOADER_EXPORT___","push","module","id","toString","WrappedIcon","wrapBrick","WrappedLink","WrappedDropdownActions","onActionClick","onVisibleChange","WrappedEasyopsAvatar","WrappedMiniActions","WrappedIconButton","ElevoApi_listElevoConversations","async","params","options","http","get","data","ADD_ICON","lib","icon","ChatHistory","forwardRef","LowLevelChatHistory","_ref","ref","historyActions","historyUrlTemplate","projectUrlTemplate","projectActions","canAddProject","myLinks","onHistoryClick","onProjectActionClick","onAddProject","rootRef","useRef","myCollapsed","setMyCollapsed","useState","projects","setProjects","projectsCollapsed","setProjectsCollapsed","projectsError","setProjectsError","historyList","setHistoryList","historyCollapsed","setHistoryCollapsed","nextToken","setNextToken","loadNextToken","setLoadNextToken","historyError","setHistoryError","initialRef","movedConversations","setMovedConversations","mergedHistoryActions","useMemo","isDropdown","text","disabled","length","items","map","project","event","key","instanceId","name","useEffect","page","page_size","ElevoApi_getElevoProjects","list","error","console","Promise","all","token","limit","onlyOwner","onlyUnrelatedProject","interceptorParams","ignoreLoadingBar","current","resolve","setTimeout","then","_ref2","prev","conversations","catch","actionsVisible","setActionsVisible","nextRef","next","root","observer","IntersectionObserver","entries","entry","isIntersecting","observe","disconnect","pullIdRef","pull","useCallback","pullId","tempList","prevList","newList","newIds","Set","item","conversationId","newItemsMap","Map","foundIntersection","foundChanged","isFirst","newItem","isEqual","filter","has","useImperativeHandle","removeProject","projectId","p","addProject","moveConversation","filteredHistoryList","includes","React","className","classNames","collapsed","SectionTitle","title","onToggle","link","index","NavLink","url","activeIncludes","render","_ref3","active","variant","tooltip","tooltipHoist","onClick","parseTemplate","undefined","_ref4","_extends","actions","themeVariant","e","action","detail","theme","spinning","_ref5","DONE_STATES","state","_ref6","children","stickyActive","setStickyActive","parent","element","sibling","nextElementSibling","onScroll","throttle","rect","getBoundingClientRect","diff","top","height","addEventListener","removeEventListener","sticky","setActive","checkLinkActive","loc","path","matchPath","pathname","exact","history","getHistory","location","listen"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[2232],{625:(e,t,a)=>{function n(e){switch(e){case"input-required":return{lib:"antd",theme:"filled",icon:"pause-circle"};case"completed":return{lib:"antd",theme:"filled",icon:"check-circle"};case"failed":return{lib:"antd",theme:"filled",icon:"close-circle"};case"terminated":return{lib:"antd",theme:"filled",icon:"stop"};case"working":return{lib:"antd",icon:"loading-3-quarters",spinning:!0};default:return{lib:"antd",theme:"filled",icon:"clock-circle"}}}a.d(t,{W:()=>n})},17994:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".hil--e3zZFYQc{background:rgba(255,255,255,0.5);border-radius:8px;border:1px solid #ffffff;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:13px 16px;margin-top:12px}.content--tmVj790o,\n.actions--wbNFKF3J{display:flex;align-items:center}.content--tmVj790o{gap:10px;flex-wrap:wrap}.actions--wbNFKF3J{justify-content:flex-end;margin-top:-3px}",""]),s.locals={hil:"hil--e3zZFYQc",content:"content--tmVj790o",actions:"actions--wbNFKF3J"};const o=s},18768:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".progress--lx8TY1CA{margin-bottom:10px;position:relative}.bar--ApxcfDGj,\n.details--YLrChHBK{background:rgba(255,255,255,0.6);border:1px solid rgba(255,255,255,0.6);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.bar--ApxcfDGj{cursor:pointer;display:flex;align-items:center;height:32px;box-shadow:0px 2px 6px 0px rgba(0,0,0,0.04);border-radius:16px;font-size:12px;padding:0 14px}.icon--tQcIUG1N{margin-right:6px;width:16px;height:16px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:linear-gradient(222deg,#abaab7 25%,#fff 75%);color:#4e4d56;font-size:10px;text-shadow:0px 1px 1px #fff}.progress--lx8TY1CA.completed--CRSVMXSS .icon--tQcIUG1N{background:linear-gradient(222deg,#16c661 25%,#fff 75%);color:#055527}.progress--lx8TY1CA.failed--uYq638ML .icon--tQcIUG1N{background:linear-gradient(222deg,#f24c25 25%,#fff 75%);color:#5b1504}.progress--lx8TY1CA.working--vSiJEm6I .icon--tQcIUG1N{background:linear-gradient(222deg,#3e56ff 25%,#fff 75%);color:#0c165d}.progress--lx8TY1CA.input-required--fub8PAf3 .icon--tQcIUG1N{background:linear-gradient(222deg,#12aacc 25%,#fff 75%);color:#0c353e}.progress--lx8TY1CA.canceled--Ew8Xed4m .icon--tQcIUG1N{background:linear-gradient(222deg,#fcaa07 25%,#fff 75%);color:#302206}.text--xtCVQl6G,\n.name--GCO4oNl4{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0;flex:1}.stat--vXcz2KIB{margin-left:6px}.expand--euAPifdF{margin-left:6px}.stat--vXcz2KIB,\n.expand--euAPifdF{color:rgba(0,0,0,0.45)}.details--YLrChHBK{position:absolute;left:0;right:0;bottom:40px;box-shadow:0px 3px 6px -4px rgba(0,0,0,0.12);border-radius:12px;list-style:none;margin:0;padding:20px;cursor:auto}.step--WdWDE_I7{--state-color:initial;display:flex;align-items:center;color:var(--state-color,var(--text-color-secondary))}.name--GCO4oNl4{color:var(--state-color,#262626)}.step--WdWDE_I7:not(:last-child){margin-bottom:16px}.step--WdWDE_I7.completed--CRSVMXSS{--state-color:var(--color-success)}.step--WdWDE_I7.failed--uYq638ML{--state-color:var(--color-error)}.step--WdWDE_I7.working--vSiJEm6I{--state-color:var(--color-info)}.step--WdWDE_I7.input-required--fub8PAf3{--state-color:var(--palette-cyan-7)}.step--WdWDE_I7.canceled--Ew8Xed4m{--state-color:#fcaa07}.state--Flb6ddfB{margin-right:10px}.mask--nL2DoW2Q{position:fixed;top:0;right:0;bottom:0;left:0}",""]),s.locals={progress:"progress--lx8TY1CA",bar:"bar--ApxcfDGj",details:"details--YLrChHBK",icon:"icon--tQcIUG1N",completed:"completed--CRSVMXSS",failed:"failed--uYq638ML",working:"working--vSiJEm6I","input-required":"input-required--fub8PAf3",canceled:"canceled--Ew8Xed4m",text:"text--xtCVQl6G",name:"name--GCO4oNl4",stat:"stat--vXcz2KIB",expand:"expand--euAPifdF",step:"step--WdWDE_I7",state:"state--Flb6ddfB",mask:"mask--nL2DoW2Q"};const o=s},26598:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".user--HjXM9OHW{background:rgba(255,255,255,0.6);border-radius:24px;padding:8px 16px;width:-moz-fit-content;width:fit-content;max-width:500px;margin-left:auto;overflow-wrap:break-word;white-space:pre-wrap;font-size:16px;line-height:26px}",""]),s.locals={user:"user--HjXM9OHW"};const o=s},32360:(e,t,a)=>{e.exports=a.p+"images/72c24398.png"},35754:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,'.assistant--CrlgPgYL{display:flex}.body--sAIo2dhL{flex:1;min-width:0;padding:3px 0 3px 16px}.texting--Rpmsbpca{position:relative}.texting--Rpmsbpca::after{content:" ";animation:texting--Rpmsbpca 2s infinite;white-space:pre}.avatar--jaJhEiSV{font-size:32px}@keyframes texting--Rpmsbpca{0%{content:"\\00a0\\00a0\\00a0"}25%{content:".\\00a0\\00a0"}50%{content:"..\\00a0"}75%{content:"..."}100%{content:"\\00a0\\00a0\\00a0"}}',""]),s.locals={assistant:"assistant--CrlgPgYL",body:"body--sAIo2dhL",texting:"texting--Rpmsbpca",avatar:"avatar--jaJhEiSV"};const o=s},48952:(e,t,a)=>{a.d(t,{I:()=>s,K:()=>i,NS:()=>l,t:()=>o});var n=a(52616);let i=function(e){return e.SWITCH_TO_CANVAS="SWITCH_TO_CANVAS",e.INITIATING_SERVICE_FLOW="INITIATING_SERVICE_FLOW",e.STARTING_SERVICE_FLOW_ACTIVITY="STARTING_SERVICE_FLOW_ACTIVITY",e.HIL_TIPS="HIL_TIPS",e}({});const l="bricks/ai-portal/chat-stream",s={en:{SWITCH_TO_CANVAS:"Switch to canvas",INITIATING_SERVICE_FLOW:"Initiating service flow: {{ name }}",STARTING_SERVICE_FLOW_ACTIVITY:"Starting service flow activity: {{ name }}",HIL_TIPS:"Triggered HIL rule, waiting for {{ name }} to process."},zh:{SWITCH_TO_CANVAS:"切换为画布",INITIATING_SERVICE_FLOW:"发起业务流:{{ name }}",STARTING_SERVICE_FLOW_ACTIVITY:"开始业务流活动:{{ name }}",HIL_TIPS:"触发 HIL 规则,等待 {{ name }} 处理。"}},o=n.i18n.getFixedT(null,l)},50094:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,'.heading--lj5kJ2fg{display:flex;align-items:center;padding:5px 8px;margin:0 -8px 12px;cursor:pointer}.main--P8894aNV{font-size:16px;line-height:26px}.caret--XqX6mjyf{opacity:0;transition:transform 0.2s ease-in-out}.heading--lj5kJ2fg:hover{background:rgba(184,187,205,0.15);border-radius:8px}.heading--lj5kJ2fg:hover .caret--XqX6mjyf{opacity:1}.icon--l8SzaFlV{display:flex;align-items:center;margin-right:12px}.title--FZPCnJbE{color:#262626;font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool--ugqSpeIM{background:#e2e5ef;border:1px solid #d4d4de;border-radius:13px;line-height:24px;padding:0 12px;width:-moz-fit-content;width:fit-content;font-size:12px;color:rgba(0,0,0,0.65);cursor:pointer;display:flex;align-items:center;gap:7px;margin-bottom:12px}.tool--ugqSpeIM eo-icon{font-size:14px;color:#8c8c8c}.body--p3Zt_jA4{margin-bottom:20px}.heading--lj5kJ2fg + .body--p3Zt_jA4{padding-left:26px}.collapsed--cGSG2zk_ .body--p3Zt_jA4{display:none}.collapsed--cGSG2zk_ .caret--XqX6mjyf{transform:rotate(180deg);opacity:1}.content--pBkkWQ5e{margin-top:14px}.content--pBkkWQ5e .markdown--Ky2J85cs [class*="code-wrapper--"]::part(mermaid){background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:20px;min-width:var(--cruise-canvas-node-width-medium);width:auto;max-width:100%}.content--pBkkWQ5e:empty{display:none}.message--okEUzWzg:first-child > .message-part--kxjYnHz0:first-child > :first-child{margin-top:0}.icon--l8SzaFlV{color:#abaab7}.completed--JWq7E1Jw .icon--l8SzaFlV{color:#0fbe59}.failed--uk7jDD7K .icon--l8SzaFlV{color:#f24c25}.working--dZiN0y04 .icon--l8SzaFlV{color:var(--elevo-color-brand)}.input-required--JSuPr8br .icon--l8SzaFlV{color:#12aacc}.canceled--LyMjPJQd .icon--l8SzaFlV{color:#fcaa07}ai-portal\\.chat-stream[hide-mermaid] .content--pBkkWQ5e .markdown--Ky2J85cs .mermaid{display:none}.error--n_Of3DwP{color:var(--color-error);white-space:pre-wrap;word-break:break-word}',""]),s.locals={heading:"heading--lj5kJ2fg",main:"main--P8894aNV",caret:"caret--XqX6mjyf",icon:"icon--l8SzaFlV",title:"title--FZPCnJbE",tool:"tool--ugqSpeIM",body:"body--p3Zt_jA4",collapsed:"collapsed--cGSG2zk_",content:"content--pBkkWQ5e",markdown:"markdown--Ky2J85cs",message:"message--okEUzWzg","message-part":"message-part--kxjYnHz0",completed:"completed--JWq7E1Jw",failed:"failed--uk7jDD7K",working:"working--dZiN0y04","input-required":"input-required--JSuPr8br",canceled:"canceled--LyMjPJQd",error:"error--n_Of3DwP"};const o=s},62232:(e,t,a)=>{a.d(t,{C:()=>$e});var n=a(18769),i=a.n(n),l=a(30348),s=a(53373),o=a.n(s),r=a(52208),c=a(67101),d=a(50045),m=a(40177);function p(e,t,a,i,l,s,o){const r=null==o?void 0:o.showHumanActions,c=null==o?void 0:o.skipActivitySubTasks;return(0,n.useMemo)((()=>{if(!e)return{messages:[],lastDetail:null};const{chunks:n,jobMap:o}=(0,d.a)(a,i,l,s,c),p=[];let u={role:"assistant",chunks:[]},f=null;for(const e of n)if("job"===e.type){var g;const t=e.job;var b;t.toolCall&&(f={type:"job",id:t.id}),"completed"===t.state&&null!==(g=t.messages)&&void 0!==g&&g.length&&t.messages.every((e=>"user"===e.role))?(u.chunks.length>0&&p.push(u),p.push({role:"user",content:t.messages.flatMap((e=>e.parts.map((e=>"text"===e.type?e.text:"")))).join(""),cmd:t.cmd,mentionedAiEmployeeId:t.mentionedAiEmployeeId,fromSkippedSubTask:e.fromSkippedSubTask,files:null===(b=t.messages)||void 0===b?void 0:b.filter((e=>"user"===e.role)).flatMap((e=>e.parts)).filter((e=>"file"===e.type)).map((e=>e.file))}),u={role:"assistant",chunks:[]}):u.chunks.push(e),t.humanAction&&(u.chunks.length>0&&p.push(u),r&&p.push({role:"user",content:t.humanAction}),u={role:"assistant",chunks:[]})}else u.chunks.push(e),"error"!==e.type&&(f={type:e.type,id:e.task.id});let h=p.length>0&&!m.QB.includes(t);if(h&&"assistant"===u.role&&0===u.chunks.length){const e=p[p.length-1];"user"===e.role&&e.fromSkippedSubTask&&(h=!1)}return(u.chunks.length>0||h)&&p.push(u),{messages:p,jobMap:o,lastDetail:f}}),[e,t,a,l,s,i,r,c])}var u=a(30672),f=a(72591),g=a.n(f),b=a(1740),h=a.n(b),x=a(88128),v=a.n(x),E=a(30855),k=a.n(E),w=a(93051),A=a.n(w),y=a(73656),I=a.n(y),N=a(26598),T={};T.styleTagTransform=I(),T.setAttributes=k(),T.insert=v().bind(null,"head"),T.domAPI=h(),T.insertStyleElement=A(),g()(N.A,T);const S=N.A&&N.A.locals?N.A.locals:void 0;var C=a(77388),j=a(47760);function _(e){let{content:t,cmd:a,mentionedAiEmployeeId:n,files:l}=e;return i().createElement(i().Fragment,null,i().createElement("div",{className:S.user},(a||n)&&i().createElement(C._,{cmd:a,mentionedAiEmployeeId:n}),t),null!=l&&l.length?i().createElement(j.$,{files:l,ui:"chat"}):null)}var D=a(35754),F={};F.styleTagTransform=I(),F.setAttributes=k(),F.insert=v().bind(null,"head"),F.domAPI=h(),F.insertStyleElement=A(),g()(D.A,F);const P=D.A&&D.A.locals?D.A.locals:void 0;var V=a(35430),L=a(89575),z=a(41030),G=a(50094),R={};R.styleTagTransform=I(),R.setAttributes=k(),R.insert=v().bind(null,"head"),R.domAPI=h(),R.insertStyleElement=A(),g()(G.A,R);const W=G.A&&G.A.locals?G.A.locals:void 0;var q=a(36903),O=a(29386),M=a(42854),U=a(86976),B=a(65438),J={};J.styleTagTransform=I(),J.setAttributes=k(),J.insert=v().bind(null,"head"),J.domAPI=h(),J.insertStyleElement=A(),g()(B.A,J);const X=B.A&&B.A.locals?B.A.locals:void 0;function H(e){let{job:t}=e;const[a,l]=(0,n.useState)("medium"),s=(0,n.useCallback)((e=>{l(e)}),[]);return i().createElement("div",{className:o()(X.view,{[X.large]:"large"===a})},i().createElement(U.y,{job:t,onSizeChange:s}))}var Y=a(76720);const Q=(0,n.createContext)({lastDetail:null,setUserClosedAside:()=>{}});function K(e,t){switch(e){case"completed":return{className:W.completed,icon:{lib:"antd",theme:"filled",icon:"check-circle"}};case"submitted":case"working":return"terminated"===t?{icon:{lib:"fa",prefix:"far",icon:"circle-stop"}}:{className:W.working,icon:{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}};case"input-required":return{className:W["input-required"],icon:{lib:"fa",prefix:"far",icon:"circle-user"}};case"failed":return{className:W.failed,icon:{lib:"fa",prefix:"fas",icon:"xmark"}};case"canceled":case"terminated":return{className:W.canceled,icon:{lib:"fa",prefix:"far",icon:"circle-stop"}};case"skipped":return{icon:{lib:"fa",prefix:"fas",icon:"ban"}};default:return{icon:{lib:"fa",prefix:"far",icon:"clock"}}}}function Z(e){var t,a;let{job:l,isSubTask:s}=e;const r=l.toolCall,c=(null==r||null===(t=r.annotations)||void 0===t?void 0:t.title)||(null==r?void 0:r.name),d=null==r?void 0:r.name,p=!!r,{conversationState:f,setActiveDetail:g,setSubActiveDetail:b}=(0,n.useContext)(Y.j),{lastDetail:h,setUserClosedAside:x}=(0,n.useContext)(Q),{className:v,icon:E}=(0,n.useMemo)((()=>K(l.state,f)),[l.state,f]),[k,w,A]=(0,n.useMemo)((()=>{var e;const t=[],a=[],n=[];let i="llm_answer"===d;return null===(e=l.messages)||void 0===e||e.forEach((e=>{if("tool"===e.role)for(const o of e.parts){var l;if("data"===o.type)switch(null===(l=o.data)||void 0===l?void 0:l.type){case"markdown":t.push(o.data.content);break;case"cmdb_instance_detail":var s;a.push(o.data),i||(i=Object.keys("object"===(null===(s=o.data)||void 0===s||null===(s=s.outputSchema)||void 0===s?void 0:s.type)?o.data.outputSchema.properties:o.data.detail).length>6)}else"file"===o.type&&n.push(o.file)}})),[t.join(""),a,n]}),[l.messages,d]),[y,I]=(0,n.useState)(!1),N=p||!!l.instruction;return i().createElement("div",{className:o()({[W.collapsed]:y})},N&&i().createElement("div",{className:o()(W.heading,v),onClick:()=>I((e=>!e))},i().createElement("div",{className:W.icon},i().createElement(u.Bj,E)),i().createElement("div",{className:W.title},l.instruction||c),i().createElement(u.Bj,(0,L.A)({className:W.caret},m.ae))),i().createElement("div",{className:W.body},p&&i().createElement("div",{className:W.tool,onClick:()=>{const e={type:"job",id:l.id};(s?b:g)((t=>(0,z.isEqual)(t,e)?t:e)),(0,z.isEqual)(e,h)&&x(!1)}},i().createElement(u.Bj,{lib:"lucide",icon:"square-chevron-right"}),c),i().createElement("div",{className:W.main},null===(a=l.messages)||void 0===a?void 0:a.map(((e,t)=>{var a;return"tool"===e.role?null:i().createElement("div",{key:t,className:o()(W.message,q.A.markdown)},null===(a=e.parts)||void 0===a?void 0:a.map(((e,t)=>i().createElement(i().Fragment,{key:t},"text"===e.type&&i().createElement(O.w,{className:o()(W["message-part"],q.A["markdown-wrapper"]),content:e.text})))))}))),i().createElement("div",{className:W.content},k&&i().createElement("div",{className:o()(W.markdown,q.A.markdown)},i().createElement(O.w,{className:q.A["markdown-wrapper"],content:k})),w.map(((e,t)=>i().createElement("div",{key:t,className:W.box},i().createElement(M.H,e)))),l.generatedView?i().createElement(H,{job:l}):null,A.length>0&&i().createElement(j.$,{files:A}))))}var $=a(48952);function ee(e){let{chunk:t,isSubTask:a}=e;return"job"===t.type?i().createElement(Z,{job:t.job,isSubTask:a}):"error"===t.type?i().createElement("div",{className:W.error},t.error):i().createElement(te,{chunk:t,isSubTask:a})}function te(e){let{chunk:t,isSubTask:a}=e;const{conversationState:l,setActiveDetail:s,setSubActiveDetail:r}=(0,n.useContext)(Y.j),{setUserClosedAside:c,lastDetail:d}=(0,n.useContext)(Q),[p,f]=(0,n.useState)(!1),{type:g,task:b}=t,{className:h,icon:x}=(0,n.useMemo)((()=>K("flow"===t.type?"completed":b.state,l)),[t.type,l,b.state]);return i().createElement("div",{className:o()({[W.collapsed]:p})},i().createElement("div",{className:o()(W.heading,h),onClick:()=>f((e=>!e))},i().createElement("div",{className:W.icon},i().createElement(u.Bj,x)),i().createElement("div",{className:W.title},"flow"===g?(0,$.t)($.K.INITIATING_SERVICE_FLOW,{name:t.flow.name}):(0,$.t)($.K.STARTING_SERVICE_FLOW_ACTIVITY,{name:t.activity.name})),i().createElement(u.Bj,(0,L.A)({className:W.caret},m.ae))),i().createElement("div",{className:W.body},i().createElement("div",{className:W.tool,onClick:()=>{const e={type:t.type,id:t.task.id};(a?r:s)((t=>(0,z.isEqual)(t,e)?t:e)),(0,z.isEqual)(e,d)&&c(!1)}},i().createElement(u.Bj,{lib:"lucide",icon:"route"}),"flow"===g?(0,$.t)($.K.INITIATING_SERVICE_FLOW,{name:t.flow.name}):(0,$.t)($.K.STARTING_SERVICE_FLOW_ACTIVITY,{name:t.activity.name}))))}var ae=a(17994),ne={};ne.styleTagTransform=I(),ne.setAttributes=k(),ne.insert=v().bind(null,"head"),ne.domAPI=h(),ne.insertStyleElement=A(),g()(ae.A,ne);const ie=ae.A&&ae.A.locals?ae.A.locals:void 0;function le(e){let{job:t}=e;return i().createElement("div",{className:ie.hil},i().createElement("div",{className:ie.content},i().createElement(u.Bj,{lib:"antd",icon:"exclamation-circle"}),(0,$.t)($.K.HIL_TIPS,{name:t.hil.username})),t.requestHumanAction&&i().createElement("div",{className:ie.actions},i().createElement(V.n,{action:t.requestHumanAction,ui:"chat"})))}function se(e){let{chunks:t,scopeState:a,isLatest:l,isSubTask:s}=e;const[o,r]=(0,n.useMemo)((()=>{const e=t[t.length-1];let n;if(e)switch(e.type){case"flow":case"activity":n=e.task.jobs[e.task.jobs.length-1];break;case"job":n=e.job;break;default:return[!1,void 0]}if(!l||m.Z5.includes(a))return[!1,n];for(const e of t)switch(e.type){case"flow":case"activity":if(e.task.jobs.some((e=>"input-required"===e.state)))return[!1,n];break;case"job":if("input-required"===e.job.state)return[!1,n]}return n&&"working"===n.state&&n.toolCall?[!1,n]:[!0,n]}),[l,t,a]);return i().createElement("div",{className:P.assistant},i().createElement(u.Bj,{lib:"easyops",category:"image",icon:"elevo-avatar-png",className:P.avatar}),i().createElement("div",{className:P.body},t.map(((e,t)=>i().createElement(ee,{key:t,chunk:e,isSubTask:s}))),o&&i().createElement("div",{className:P.texting}),l&&r&&!m.X4.includes(a)&&("working"===r.state||"input-required"===r.state)&&!r.humanAction&&(r.hil?i().createElement(le,{job:r}):r.requestHumanAction&&i().createElement(V.n,{action:r.requestHumanAction,ui:"chat"}))))}var oe=a(70046),re=a(62309),ce=a(83090),de={};de.styleTagTransform=I(),de.setAttributes=k(),de.insert=v().bind(null,"head"),de.domAPI=h(),de.insertStyleElement=A(),g()(ce.A,de);const me=ce.A&&ce.A.locals?ce.A.locals:void 0;var pe=a(39649),ue=a(52616),fe=a(83685),ge={};ge.styleTagTransform=I(),ge.setAttributes=k(),ge.insert=v().bind(null,"head"),ge.domAPI=h(),ge.insertStyleElement=A(),g()(fe.A,ge);const be=fe.A&&fe.A.locals?fe.A.locals:void 0;var he=a(625);let xe=function(e){return e.WAITING="WAITING",e.EXECUTING="EXECUTING",e.PAUSED="PAUSED",e.SUCCEEDED="SUCCEEDED",e.FAILED="FAILED",e.TERMINATED="TERMINATED",e}({});const ve="bricks/ai-portal/FlowApp",Ee=ue.i18n.getFixedT(null,ve);var ke=a(99126);function we(e,t,a){const i=(0,n.useRef)(!1),l=(0,n.useRef)(!1),[s,o]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{const e=t.current,n=a.current;if(l.current||!e||!n)return;const s=()=>{o(e.scrollTop+e.clientHeight+24<e.scrollHeight),i.current&&(l.current=e.scrollTop+e.clientHeight+6<e.scrollHeight)};let r;e.addEventListener("scroll",s);const c=new ke.A((()=>{l.current||(i.current=!1,e.scrollTo({top:n.scrollHeight,behavior:"instant"}),clearTimeout(r),r=setTimeout((()=>{i.current=!0}),100))}));return c.observe(n),()=>{c.disconnect(),e.removeEventListener("scroll",s)}}),[e]),{scrollable:s,scrollToBottom:(0,n.useCallback)((()=>{const e=t.current;null==e||e.scrollTo({top:null==e?void 0:e.scrollHeight,behavior:"instant"})}),[t])}}var Ae=a(86e3),ye={};ye.styleTagTransform=I(),ye.setAttributes=k(),ye.insert=v().bind(null,"head"),ye.domAPI=h(),ye.insertStyleElement=A(),g()(Ae.A,ye);const Ie=Ae.A&&Ae.A.locals?Ae.A.locals:void 0;var Ne=a(69493);function Te(e){var t;let{flow:a,activity:l}=e;const{tasks:s,setActiveDetail:r}=(0,n.useContext)(Y.j),c=(0,n.useMemo)((()=>s.find((e=>e.id===a.taskId))),[s,a.taskId]),d=(0,n.useMemo)((()=>a.spec.map((e=>{var t;return{...e,serviceFlowActivities:null===(t=e.serviceFlowActivities)||void 0===t?void 0:t.map((e=>{const t=s.find((t=>t.id===e.taskId));return{name:e.name,taskId:e.taskId,state:null==t?void 0:t.state,startTime:null==t?void 0:t.startTime,endTime:null==t?void 0:t.endTime}}))}}))),[a.spec,s]),m=(0,n.useMemo)((()=>Ce(c.state)),[c.state]);return i().createElement("div",{className:be.app},i().createElement("div",{className:be.heading},i().createElement("div",{className:be.header},i().createElement("div",{className:o()(be.status,m.className)},i().createElement(u.Bj,m.icon),m.text),i().createElement("div",{className:be.title},`${null!==(t=a.space)&&void 0!==t&&t.name?`${a.space.name} / `:""}${a.name}`)),i().createElement("div",{className:be.chart},i().createElement(u.n$,{spec:d,activeActivityId:null==l?void 0:l.taskId,onActiveChange:e=>{e.detail&&r({type:"activity",id:e.detail})}}))),i().createElement("div",{className:be.body},l?i().createElement(Se,{activity:l}):i().createElement(u.F_,{className:be.blank,description:"您还未选择活动",illustration:"serviceflows"})))}function Se(e){let{activity:t}=e;const{tasks:a,errors:l}=(0,n.useContext)(Y.j),s=(0,n.useMemo)((()=>a.find((e=>e.id===t.taskId))),[a,t.taskId]),o=s.state,{icon:r,className:c}=(0,n.useMemo)((()=>Ce(o)),[o]),d=(0,n.useMemo)((()=>[{...s,parent:void 0}]),[s]),{messages:m}=p(!0,s.state,d,l),f=(0,n.useRef)(null),g=(0,n.useRef)(null),{scrollable:b,scrollToBottom:h}=we(!0,f,g);return i().createElement(i().Fragment,null,i().createElement("div",{className:be["activity-title"]},i().createElement(u.Bj,(0,L.A)({},r,{className:c})),t.name),i().createElement("div",{className:be.chat,ref:f},i().createElement("div",{className:be.messages,ref:g},m.map(((e,t,a)=>i().createElement("div",{className:be.message,key:t},"user"===e.role?i().createElement(_,{content:e.content,cmd:e.cmd,files:e.files}):i().createElement(se,{chunks:e.chunks,scopeState:s.state,isLatest:t===a.length-1,isSubTask:!0})))))),i().createElement("button",{className:`${Ie["scroll-down"]} ${Ne.A["floating-button"]}`,style:{bottom:"30px"},hidden:!b,onClick:h},i().createElement(u.Bj,{lib:"antd",icon:"down"})))}function Ce(e){const t=(0,he.W)(e);let a,n;switch(e){case"working":a=Ee(xe.EXECUTING),n=be.working;break;case"completed":a=Ee(xe.SUCCEEDED),n=be.completed;break;case"failed":a=Ee(xe.FAILED),n=be.failed;break;case"input-required":a=Ee(xe.PAUSED),n=be.paused;break;case"terminated":a=Ee(xe.TERMINATED);break;default:a=Ee(e?xe.EXECUTING:xe.WAITING)}return{icon:t,text:a,className:n}}(0,ue.initializeI18n)(ve,{en:{WAITING:"Waiting",EXECUTING:"Executing",PAUSED:"Paused",SUCCEEDED:"Succeeded",FAILED:"Failed",TERMINATED:"Terminated"},zh:{WAITING:"等待中",EXECUTING:"执行中",PAUSED:"暂停",SUCCEEDED:"成功",FAILED:"失败",TERMINATED:"已终止"}});const je={lib:"easyops",icon:"shrink"};function _e(e){let{detail:t,isSubTask:a,faded:l}=e;const{setActiveDetail:s,setSubActiveDetail:r}=(0,n.useContext)(Y.j),{setUserClosedAside:c}=(0,n.useContext)(Q),[d,m]=(0,n.useMemo)((()=>{const e=[],a=[],n=[];var i;return"job"===t.type&&(null===(i=t.job.messages)||void 0===i||i.forEach((t=>{if("tool"===t.role)for(const l of t.parts){var i;if("data"===l.type)switch(null===(i=l.data)||void 0===i?void 0:i.type){case"markdown":e.push(l.data.content);break;case"cmdb_instance_detail":a.push(l.data)}else"file"===l.type&&n.push(l.file)}}))),[e.join(""),a,n]}),[t]);return i().createElement("div",{className:o()(me.aside,{[me.sub]:a,[me.faded]:l})},i().createElement("div",{className:me.box},i().createElement("div",{className:me.header},i().createElement("div",{className:me.title},"Elevo's Computer"),i().createElement(u.Py,{icon:je,variant:"mini",onClick:()=>{a?r(null):(s(null),c(!0))}})),i().createElement("div",{className:me.body},"job"===t.type?i().createElement(i().Fragment,null,i().createElement(pe.t,{job:t.job,variant:"read-only"}),t.job.generatedView?i().createElement(De,{name:"View",source:t.job.generatedView.code,language:"jsx"}):d?i().createElement(De,{name:"Content",source:d,language:"md"}):m.length>0?i().createElement(De,{name:"CMDB",source:JSON.stringify(m,null,2),language:"json"}):null):i().createElement(Te,{flow:t.flow,activity:t.activity}))))}function De(e){let{name:t,source:a,language:n}=e;return i().createElement("div",{className:o()(me.app,me.editor)},i().createElement("div",{className:me.heading},`${t}.${n}`),i().createElement("div",{className:o()(me.content,q.A.markdown)},i().createElement("div",{className:me.scroller},i().createElement(u.yQ,{className:me["code-block"],source:a,language:n,themeVariant:"elevo"}))))}var Fe=a(94625),Pe=a(76239),Ve={};Ve.styleTagTransform=I(),Ve.setAttributes=k(),Ve.insert=v().bind(null,"head"),Ve.domAPI=h(),Ve.insertStyleElement=A(),g()(Pe.A,Ve);const Le=Pe.A&&Pe.A.locals?Pe.A.locals:void 0;var ze=a(86767),Ge=a(98153),Re=a(88253),We=a(2367),qe=a(18768),Oe={};Oe.styleTagTransform=I(),Oe.setAttributes=k(),Oe.insert=v().bind(null,"head"),Oe.domAPI=h(),Oe.insertStyleElement=A(),g()(qe.A,Oe);const Me=qe.A&&qe.A.locals?qe.A.locals:void 0;let Ue=function(e){return e.PLAN_COMPLETED="PLAN_COMPLETED",e}({});const Be="bricks/ai-portal/PlanProgress",Je=ue.i18n.getFixedT(null,Be);function Xe(e){let{plan:t,conversationState:a,style:l}=e;const[s,r]=(0,n.useState)(!1),{doneCount:c,state:d,name:m}=(0,n.useMemo)((()=>t.reduce(((e,t)=>"completed"===t.state?{...e,state:t.state,name:t.name,doneCount:e.doneCount+1}:!e.name||t.state?{...e,state:t.state,name:t.name}:e),{doneCount:0,name:"",state:void 0})),[t]),{className:p,icon:f}=(0,n.useMemo)((()=>Ye(d,a)),[d,a]),g=(0,n.useCallback)((()=>{r((e=>!e))}),[]);if(null==t||!t.length)return null;const b=c===t.length&&"completed"===a;return i().createElement(i().Fragment,null,s&&i().createElement("div",{className:Me.mask,onClick:g}),i().createElement("div",{className:o()(Me.progress,p),style:l},i().createElement("div",{className:Me.bar,onClick:g},i().createElement("div",{className:Me.icon},i().createElement(u.Bj,f)),i().createElement("span",{className:Me.text,title:b?"":m},b?Je(Ue.PLAN_COMPLETED):m),i().createElement("span",{className:Me.stat},c,"/",t.length),i().createElement(u.Bj,{className:Me.expand,lib:"antd",theme:"outlined",icon:s?"down":"up"})),s&&i().createElement("ul",{className:Me.details},t.map(((e,t)=>i().createElement(He,{key:t,state:e.state,conversationState:a,name:e.name}))))))}function He(e){let{state:t,conversationState:a,name:l}=e;const{className:s,icon:r}=(0,n.useMemo)((()=>Ye(t,a)),[t,a]);return i().createElement("li",{className:o()(Me.step,s)},i().createElement(u.Bj,(0,L.A)({},r,{className:Me.state})),i().createElement("span",{className:Me.name,title:l},l))}function Ye(e,t){switch(e){case"completed":return{className:Me.completed,icon:{lib:"fa",prefix:"fas",icon:"check"}};case"submitted":case"working":return"terminated"===t?{className:void 0,icon:{lib:"fa",prefix:"far",icon:"circle-stop"}}:{className:Me.working,icon:{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}};case"input-required":return{className:Me["input-required"],icon:{lib:"fa",prefix:"far",icon:"circle-user"}};case"failed":return{className:Me.failed,icon:{lib:"fa",prefix:"fas",icon:"xmark"}};case"canceled":return{className:Me.canceled,icon:{lib:"fa",prefix:"far",icon:"circle-stop"}};default:return{icon:{lib:"fa",prefix:"far",icon:"clock"}}}}(0,ue.initializeI18n)(Be,{en:{PLAN_COMPLETED:"All tasks are completed"},zh:{PLAN_COMPLETED:"所有任务已全部完成"}});var Qe=a(38717),Ke=a(6671);const Ze={lib:"easyops",icon:"share"};function $e(e,t){var a;let{conversationId:s,initialRequest:d,replay:f,replayDelay:g,supports:b,showHumanActions:h,showFeedback:x,showFeedbackAfterFailed:v,showFeedbackOnView:E,showUiSwitch:k,previewUrlTemplate:w,noticeUrlTemplate:A,showCases:y,showNoticeIcon:I,exampleProjects:N,notices:T,tryItOutUrl:S,uploadOptions:C,onShare:j,onTerminate:D,onSubmitFeedback:F,onSwitchToCanvas:P,onFeedbackOnView:V,onDetailChange:L,onMarkNoticesRead:z,onNoticeClick:G}=e;const{conversation:R,tasks:W,serviceFlows:q,errors:O,humanInputRef:M,skipToResults:U,watchAgain:B}=(0,c.u)(s,d,f,g),J=null!==(a=null==R?void 0:R.title)&&void 0!==a?a:"",X=null==R?void 0:R.state,H=m.QB.includes(X)||"input-required"===X,K=function(e,t){return(0,n.useMemo)((()=>{const a=[];for(const n of e)for(const e of n.spec)for(const n of e.serviceFlowActivities)if(n.taskId){const e=t.find((e=>e.id===n.taskId));a.push({name:n.name,taskId:n.taskId,state:null==e?void 0:e.state})}else a.push({name:n.name});return a}),[e,t])}(q,W),{flowMap:Z,activityMap:ee}=(0,Re.o)(q),{messages:te,jobMap:ae,lastDetail:ne}=p(!!R,null==R?void 0:R.state,W,O,Z,ee,{showHumanActions:h,skipActivitySubTasks:!0});(0,n.useEffect)((()=>{L({projectId:null==R?void 0:R.projectId})}),[L,null==R?void 0:R.projectId]);const ie=(0,n.useMemo)((()=>ae?[...ae.values()].flatMap((e=>e.generatedView?{id:e.id,view:e.generatedView}:[])):[]),[ae]),[le,ce]=(0,n.useState)(!1),[de,me]=(0,n.useState)(!1),[pe,ue]=(0,n.useState)(!!x);(0,n.useEffect)((()=>{ue(!!x)}),[x]);const[fe,ge]=(0,n.useState)(),be=(0,n.useCallback)((e=>{ce(!0),F(e)}),[F]);(0,n.useImperativeHandle)(t,(()=>({feedbackSubmitDone:()=>{me(!0),setTimeout((()=>{ue(!1)}),3e3)},feedbackSubmitFailed:()=>{ce(!1)},feedbackOnViewDone:e=>{ge((t=>{const a=new Set(t);return a.add(e),a}))}})),[]);const[he,xe]=(0,n.useState)(null),[ve,Ee]=(0,n.useState)(null),[ke,Ae]=(0,n.useState)(null),[ye,Te]=(0,n.useState)(!1),Se=(0,n.useRef)(!1),Ce=!!R;(0,n.useEffect)((()=>{if(Ce){const e=setTimeout((()=>{Se.current=!0}),1e3);return()=>{clearTimeout(e)}}}),[Ce]),(0,n.useEffect)((()=>{Se.current&&ne&&!ye&&Ee(ne)}),[ne,ye]),(0,n.useEffect)((()=>{(0,l.getRuntime)().applyPageTitle(J)}),[J]);const je=(0,n.useCallback)(((e,t,a)=>{var n;null===(n=M.current)||void 0===n||n.call(M,e,t,a)}),[M]),De=te[0],Pe=(0,n.useMemo)((()=>{if("user"===(null==De?void 0:De.role))return De.content}),[De]),[Ve,qe]=(0,n.useState)(null),Oe=s,[Me,Ue]=(0,n.useState)(null),Be=(0,n.useMemo)((()=>({conversationId:s,conversationState:X,tasks:W,errors:O,workspace:Oe,previewUrlTemplate:w,replay:f,showCases:y,exampleProjects:N,uploadOptions:C,humanInput:je,onShare:j,onTerminate:D,supports:b,activeExpandedViewJobId:he,setActiveExpandedViewJobId:xe,activeDetail:ve,setActiveDetail:Ee,subActiveDetail:ke,setSubActiveDetail:Ae,submittingFeedback:le,submittedFeedback:de,onSubmitFeedback:be,setShowFeedback:ue,showFeedbackOnView:E,onFeedbackOnView:V,feedbackDoneViews:fe,skipToResults:U,watchAgain:B,tryItOut(){const e=window.open(`${(0,l.getBasePath)().slice(0,-1)}${null!=S?S:"/elevo"}`,"_blank");e&&(e.__elevo_try_it_out={content:Pe})},setActiveFile:Ue,activeImages:Ve,setActiveImages:qe})),[s,X,W,O,Oe,w,f,y,N,C,je,j,D,b,he,ve,ke,le,de,be,E,V,fe,U,B,Pe,S,Ve]),Je=(0,n.useMemo)((()=>({lastDetail:ne,setUserClosedAside:Te})),[ne]),He=(0,n.useRef)(null),Ye=(0,n.useRef)(null),{scrollable:$e,scrollToBottom:et}=we(Ce,He,Ye),tt=(0,We.U)(ve,ae,Z,ee),at=(0,We.U)(ke,ae,Z,ee),[nt,it]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{let e=!1;return Promise.race([(0,r.L)("light-plus"),new Promise((e=>setTimeout(e,5e3)))]).finally((()=>{e||it(!0)})),()=>{e=!0}}),[]),i().createElement(Y.j.Provider,{value:Be},i().createElement(Q.Provider,{value:Je},i().createElement("div",{className:Le.container},i().createElement("div",{className:Le.header},i().createElement("div",{className:Le.left}),i().createElement("h1",null,J),i().createElement("div",{className:Le.right},k&&i().createElement(u.Py,{className:Le["navbar-switch-ui"],icon:m.Rq,variant:"mini",title:(0,$.t)($.K.SWITCH_TO_CANVAS),onClick:P}),I&&i().createElement(u.jw,{dataSource:T,dropdownContentStyle:{minWidth:300},hideNotifyCenterButton:!0,urlTarget:"_blank",urlTemplate:A,onNoticeClick:e=>G(e.detail),onMarkAllRead:z}),i().createElement(u.Py,{icon:Ze,variant:"mini",onClick:j}))),Ce&&nt?i().createElement(i().Fragment,null,i().createElement("div",{className:Le.main,ref:He},i().createElement("div",{className:Le.narrow,ref:Ye},te.map(((e,t,a)=>i().createElement("div",{className:Le.message,key:t},"user"===e.role?i().createElement(_,{content:e.content,cmd:e.cmd,mentionedAiEmployeeId:e.mentionedAiEmployeeId,files:e.files}):i().createElement(se,{chunks:e.chunks,scopeState:X,isLatest:t===a.length-1})))),f?(null==R?void 0:R.finished)&&i().createElement(i().Fragment,null,i().createElement(Xe,{plan:K,conversationState:X,style:{marginTop:14}}),i().createElement(Ge.A,{finished:!0,ui:"chat"})):pe&&("completed"===X||"failed"===X&&v)&&W.length>0&&i().createElement(Fe.k,{className:Le.feedback}))),i().createElement("button",{className:`${Ie["scroll-down"]} ${Ne.A["floating-button"]}`,hidden:!$e,onClick:et},i().createElement(u.Bj,{lib:"antd",icon:"down"})),(f?null==R||!R.finished:null==b?void 0:b.chat)?i().createElement("div",{className:Le.footer},i().createElement("div",{className:Le.narrow},i().createElement(Xe,{plan:K,conversationState:X}),f?i().createElement(Ge.A,null):i().createElement(oe.s,{state:X,canChat:H}))):null):i().createElement("div",{className:Le["loading-icon"]},i().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}))),i().createElement("div",{className:o()(Le.aside,{[Le.expanded]:!!tt})},tt&&i().createElement(_e,{detail:tt,faded:!!at}),at&&i().createElement(_e,{detail:at,isSubTask:!0})),he&&i().createElement(re.f,{views:ie}),k&&i().createElement("div",{className:o()(ze.A.toolbar,Le.toolbar)},i().createElement(u.Py,{icon:m.Rq,variant:"mini",title:(0,$.t)($.K.SWITCH_TO_CANVAS),onClick:P})),Me&&i().createElement(Qe.d,{file:Me}),Ve&&i().createElement(Ke.f,{images:Ve})))}},65438:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".view--O8CNDdS_{background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:12px 20px;width:var(--cruise-canvas-node-width-medium);max-width:100%;margin-top:14px}.large--jT3IWlRf{width:var(--cruise-canvas-node-width-large)}",""]),s.locals={view:"view--O8CNDdS_",large:"large--jT3IWlRf"};const o=s},76239:(e,t,a)=>{a.d(t,{A:()=>p});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l),o=a(20062),r=a.n(o),c=new URL(a(32360),a.b),d=s()(i()),m=r()(c);d.push([e.id,`ai-portal\\.chat-stream{display:flex;position:relative;width:100%;height:100%;overflow:hidden;background-color:#f3f3f4;background-image:url(${m});background-size:cover;background-repeat:no-repeat;background-position:center;background-attachment:fixed;color:rgba(0,0,0,0.88);--cruise-canvas-node-width-small:330px;--cruise-canvas-node-width-medium:453px;--cruise-canvas-node-width-large:800px;--cruise-canvas-primary-color:var(--elevo-color-brand);--cruise-canvas-input-background:rgba(255,255,255,0.8);--cruise-canvas-input-box-shadow:0px 1px 0px 0px #ffffff,inset 0px 2px 4px 0px #b3bcf9}.container--IOwk4fR1{display:flex;flex-direction:column;position:relative;flex:1;min-width:0}.header--O9c4lNA3{height:54px;padding:0 24px;display:flex;align-items:center;justify-content:space-between}.header--O9c4lNA3 h1{font-weight:500;font-size:14px;margin:0;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.header--O9c4lNA3 .left--ed9ka1jF,.header--O9c4lNA3 .right--fs8TyVN3{width:56px}.header--O9c4lNA3 .right--fs8TyVN3{display:flex;align-items:center;justify-content:end;gap:8px}.main--KDIjetJs{overflow-y:auto;flex:1;padding:20px 24px}.narrow--xWih9UIb{width:100%;max-width:800px;margin:0 auto}.message--YIXGDQNi + .message--YIXGDQNi{margin-top:40px}.loading-icon--lagcmORP{flex:1;display:flex;align-items:center;justify-content:center;font-size:48px;color:#fff}.footer--aLZ8UWjM{padding:0 20px 24px}.aside--Xjd6To2A{width:0%;height:100%;transition:width 0.2s ease-in-out;position:relative}.expanded--xZgk3uBF{width:50%}.feedback--YbYylTcK{margin:24px auto 0}.toolbar--uiLshJmw{left:20px;bottom:20px}.navbar-switch-ui--hREVJ6zG{display:none}@media (max-width: 1123px){div.toolbar--uiLshJmw{display:none}.navbar-switch-ui--hREVJ6zG{display:block}}`,""]),d.locals={container:"container--IOwk4fR1",header:"header--O9c4lNA3",left:"left--ed9ka1jF",right:"right--fs8TyVN3",main:"main--KDIjetJs",narrow:"narrow--xWih9UIb",message:"message--YIXGDQNi","loading-icon":"loading-icon--lagcmORP",footer:"footer--aLZ8UWjM",aside:"aside--Xjd6To2A",expanded:"expanded--xZgk3uBF",feedback:"feedback--YbYylTcK",toolbar:"toolbar--uiLshJmw","navbar-switch-ui":"navbar-switch-ui--hREVJ6zG"};const p=d},83090:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".aside--DDIdDtkt{padding:12px 12px 12px 0;height:100%}.faded--AsNxuT2v{opacity:0.4}.sub--d8EpebQt{position:absolute;top:16px;right:16px;left:-16px;height:calc(100% - 16px)}.box--niuFBiiQ{background:#ffffff;box-shadow:1px 1px 10px 0px rgba(0,10,26,0.1);border-radius:12px;height:100%;display:flex;flex-direction:column}.header--DPl_hrTp{height:52px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,0.15);padding:0 20px}.title--HlE9yRcJ{font-weight:500;font-size:16px;color:#262626}.body--OLKz1zeC{flex:1;min-height:0;padding:20px;display:flex;flex-direction:column}.app--UanK0TGf{flex:1;min-height:0;background:#ffffff;border-radius:9px;border:1px solid #ccd1de;margin-top:16px;overflow:hidden;display:flex;flex-direction:column}.heading--ngRi_rQ4{background:#e6e9f3;color:#5e6472;padding:5px 14px}.content--I2i0y65v{font-size:12px;flex:1;min-height:0;position:relative}.scroller--mLfznC_I{height:100%;overflow-x:hidden;overflow-y:auto;overflow:hidden auto;padding:10px}.scroller--mLfznC_I.loading--U1GWHEp9{display:flex;align-items:center;justify-content:center}.editor--p_Sqs1os .content--I2i0y65v .code-block--XiUVX7st::part(wrapper){position:static;margin:0}.editor--p_Sqs1os .content--I2i0y65v .code-block--XiUVX7st::part(pre){background:none!important;padding:0;border-radius:0;border:0}",""]),s.locals={aside:"aside--DDIdDtkt",faded:"faded--AsNxuT2v",sub:"sub--d8EpebQt",box:"box--niuFBiiQ",header:"header--DPl_hrTp",title:"title--HlE9yRcJ",body:"body--OLKz1zeC",app:"app--UanK0TGf",heading:"heading--ngRi_rQ4",content:"content--I2i0y65v",scroller:"scroller--mLfznC_I",loading:"loading--U1GWHEp9",editor:"editor--p_Sqs1os","code-block":"code-block--XiUVX7st"};const o=s},83685:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".app--qxnx6yuG{border-radius:9px;border:1px solid #ccd1de;flex:1;min-height:0;display:flex;flex-direction:column}.heading--SbCRupnn{border-bottom:1px solid #ccd1de;border-radius:9px 9px 0 0;background-image:radial-gradient(circle at 1px 1px,#ddd 1px,transparent 0px);background-size:25px 25px;background-position:12px;max-height:50%;display:flex;flex-direction:column}.header--LGXNxV5J{display:flex;align-items:center;padding:16px 30px}.status--aqbJGBcl{background:#aeb3bc;border-radius:100px;height:40px;padding:9px 16px;display:flex;align-items:center;gap:8px;font-size:18px;color:#ffffff}.status--aqbJGBcl eo-icon{font-size:22px}.status--aqbJGBcl.paused--U1cc3Ksn{background:#f0a22e}.status--aqbJGBcl.working--f2PYqFo7{background:#4f69ff}.status--aqbJGBcl.completed--Ihiekkve{background:#08bf33}.status--aqbJGBcl.failed--kB8wxIZ0{background:var(--color-error)}.title--IRvB2t7z{font-weight:500;font-size:16px;margin-left:40px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart--mypbn8pI{padding:8px 22px 18px;overflow:auto;min-height:0}.body--jnk1EIz0{padding:16px 12px 12px;display:flex;flex:1;min-height:0;flex-direction:column;position:relative}.activity-title--hF6stwmT{font-weight:500;font-size:16px;display:flex;align-items:center;gap:6px;margin-bottom:16px}.activity-title--hF6stwmT eo-icon{font-size:20px;color:#8c8c8c}.activity-title--hF6stwmT .paused--U1cc3Ksn{color:#f0a22e}.activity-title--hF6stwmT .working--f2PYqFo7{color:#4f69ff}.activity-title--hF6stwmT .completed--Ihiekkve{color:#08bf33}.activity-title--hF6stwmT .failed--kB8wxIZ0{color:var(--color-error)}.chat--nEzTEXbV{background:rgba(227,228,229,0.4);border:1px solid rgba(0,0,0,0.1);border-radius:8px;padding:16px 20px;flex:1;min-height:0;overflow-y:auto}.messages--vLiwUYSP{width:100%;margin:0 auto}.message--Okzj6NDx + .message--Okzj6NDx{margin-top:40px}",""]),s.locals={app:"app--qxnx6yuG",heading:"heading--SbCRupnn",header:"header--LGXNxV5J",status:"status--aqbJGBcl",paused:"paused--U1cc3Ksn",working:"working--f2PYqFo7",completed:"completed--Ihiekkve",failed:"failed--kB8wxIZ0",title:"title--IRvB2t7z",chart:"chart--mypbn8pI",body:"body--jnk1EIz0","activity-title":"activity-title--hF6stwmT",chat:"chat--nEzTEXbV",messages:"messages--vLiwUYSP",message:"message--Okzj6NDx"};const o=s},86e3:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".scroll-down--st4A5sQ4{position:absolute;left:50%;bottom:136px;transform:translateX(-50%);width:32px;height:32px;font-size:12px}",""]),s.locals={"scroll-down":"scroll-down--st4A5sQ4"};const o=s}}]);
2
- //# sourceMappingURL=2232.57f7b38c.js.map
1
+ "use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[2232],{625:(e,t,a)=>{function n(e){switch(e){case"input-required":return{lib:"antd",theme:"filled",icon:"pause-circle"};case"completed":return{lib:"antd",theme:"filled",icon:"check-circle"};case"failed":return{lib:"antd",theme:"filled",icon:"close-circle"};case"terminated":return{lib:"antd",theme:"filled",icon:"stop"};case"working":return{lib:"antd",icon:"loading-3-quarters",spinning:!0};default:return{lib:"antd",theme:"filled",icon:"clock-circle"}}}a.d(t,{W:()=>n})},17994:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".hil--e3zZFYQc{background:rgba(255,255,255,0.5);border-radius:8px;border:1px solid #ffffff;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:13px 16px;margin-top:12px}.content--tmVj790o,\n.actions--wbNFKF3J{display:flex;align-items:center}.content--tmVj790o{gap:10px;flex-wrap:wrap}.actions--wbNFKF3J{justify-content:flex-end;margin-top:-3px}",""]),s.locals={hil:"hil--e3zZFYQc",content:"content--tmVj790o",actions:"actions--wbNFKF3J"};const o=s},18768:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".progress--lx8TY1CA{margin-bottom:10px;position:relative}.bar--ApxcfDGj,\n.details--YLrChHBK{background:rgba(255,255,255,0.6);border:1px solid rgba(255,255,255,0.6);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.bar--ApxcfDGj{cursor:pointer;display:flex;align-items:center;height:32px;box-shadow:0px 2px 6px 0px rgba(0,0,0,0.04);border-radius:16px;font-size:12px;padding:0 14px}.icon--tQcIUG1N{margin-right:6px;width:16px;height:16px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:linear-gradient(222deg,#abaab7 25%,#fff 75%);color:#4e4d56;font-size:10px;text-shadow:0px 1px 1px #fff}.progress--lx8TY1CA.completed--CRSVMXSS .icon--tQcIUG1N{background:linear-gradient(222deg,#16c661 25%,#fff 75%);color:#055527}.progress--lx8TY1CA.failed--uYq638ML .icon--tQcIUG1N{background:linear-gradient(222deg,#f24c25 25%,#fff 75%);color:#5b1504}.progress--lx8TY1CA.working--vSiJEm6I .icon--tQcIUG1N{background:linear-gradient(222deg,#3e56ff 25%,#fff 75%);color:#0c165d}.progress--lx8TY1CA.input-required--fub8PAf3 .icon--tQcIUG1N{background:linear-gradient(222deg,#12aacc 25%,#fff 75%);color:#0c353e}.progress--lx8TY1CA.canceled--Ew8Xed4m .icon--tQcIUG1N{background:linear-gradient(222deg,#fcaa07 25%,#fff 75%);color:#302206}.text--xtCVQl6G,\n.name--GCO4oNl4{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0;flex:1}.stat--vXcz2KIB{margin-left:6px}.expand--euAPifdF{margin-left:6px}.stat--vXcz2KIB,\n.expand--euAPifdF{color:rgba(0,0,0,0.45)}.details--YLrChHBK{position:absolute;left:0;right:0;bottom:40px;box-shadow:0px 3px 6px -4px rgba(0,0,0,0.12);border-radius:12px;list-style:none;margin:0;padding:20px;cursor:auto}.step--WdWDE_I7{--state-color:initial;display:flex;align-items:center;color:var(--state-color,var(--text-color-secondary))}.name--GCO4oNl4{color:var(--state-color,#262626)}.step--WdWDE_I7:not(:last-child){margin-bottom:16px}.step--WdWDE_I7.completed--CRSVMXSS{--state-color:var(--color-success)}.step--WdWDE_I7.failed--uYq638ML{--state-color:var(--color-error)}.step--WdWDE_I7.working--vSiJEm6I{--state-color:var(--color-info)}.step--WdWDE_I7.input-required--fub8PAf3{--state-color:var(--palette-cyan-7)}.step--WdWDE_I7.canceled--Ew8Xed4m{--state-color:#fcaa07}.state--Flb6ddfB{margin-right:10px}.mask--nL2DoW2Q{position:fixed;top:0;right:0;bottom:0;left:0}",""]),s.locals={progress:"progress--lx8TY1CA",bar:"bar--ApxcfDGj",details:"details--YLrChHBK",icon:"icon--tQcIUG1N",completed:"completed--CRSVMXSS",failed:"failed--uYq638ML",working:"working--vSiJEm6I","input-required":"input-required--fub8PAf3",canceled:"canceled--Ew8Xed4m",text:"text--xtCVQl6G",name:"name--GCO4oNl4",stat:"stat--vXcz2KIB",expand:"expand--euAPifdF",step:"step--WdWDE_I7",state:"state--Flb6ddfB",mask:"mask--nL2DoW2Q"};const o=s},26598:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".user--HjXM9OHW{background:rgba(255,255,255,0.6);border-radius:24px;padding:8px 16px;width:-moz-fit-content;width:fit-content;max-width:500px;margin-left:auto;overflow-wrap:break-word;white-space:pre-wrap;font-size:16px;line-height:26px}",""]),s.locals={user:"user--HjXM9OHW"};const o=s},32360:(e,t,a)=>{e.exports=a.p+"images/72c24398.png"},35754:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,'.assistant--CrlgPgYL{display:flex}.body--sAIo2dhL{flex:1;min-width:0;padding:3px 0 3px 16px}.texting--Rpmsbpca{position:relative}.texting--Rpmsbpca::after{content:" ";animation:texting--Rpmsbpca 2s infinite;white-space:pre}.avatar--jaJhEiSV{font-size:32px}@keyframes texting--Rpmsbpca{0%{content:"\\00a0\\00a0\\00a0"}25%{content:".\\00a0\\00a0"}50%{content:"..\\00a0"}75%{content:"..."}100%{content:"\\00a0\\00a0\\00a0"}}',""]),s.locals={assistant:"assistant--CrlgPgYL",body:"body--sAIo2dhL",texting:"texting--Rpmsbpca",avatar:"avatar--jaJhEiSV"};const o=s},48952:(e,t,a)=>{a.d(t,{I:()=>s,K:()=>i,NS:()=>l,t:()=>o});var n=a(52616);let i=function(e){return e.SWITCH_TO_CANVAS="SWITCH_TO_CANVAS",e.INITIATING_SERVICE_FLOW="INITIATING_SERVICE_FLOW",e.STARTING_SERVICE_FLOW_ACTIVITY="STARTING_SERVICE_FLOW_ACTIVITY",e.HIL_TIPS="HIL_TIPS",e}({});const l="bricks/ai-portal/chat-stream",s={en:{SWITCH_TO_CANVAS:"Switch to canvas",INITIATING_SERVICE_FLOW:"Initiating service flow: {{ name }}",STARTING_SERVICE_FLOW_ACTIVITY:"Starting service flow activity: {{ name }}",HIL_TIPS:"Triggered HIL rule, waiting for {{ name }} to process."},zh:{SWITCH_TO_CANVAS:"切换为画布",INITIATING_SERVICE_FLOW:"发起业务流:{{ name }}",STARTING_SERVICE_FLOW_ACTIVITY:"开始业务流活动:{{ name }}",HIL_TIPS:"触发 HIL 规则,等待 {{ name }} 处理。"}},o=n.i18n.getFixedT(null,l)},50094:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,'.heading--lj5kJ2fg{display:flex;align-items:center;padding:5px 8px;margin:0 -8px 12px;cursor:pointer}.main--P8894aNV{font-size:16px;line-height:26px}.caret--XqX6mjyf{opacity:0;transition:transform 0.2s ease-in-out}.heading--lj5kJ2fg:hover{background:rgba(184,187,205,0.15);border-radius:8px}.heading--lj5kJ2fg:hover .caret--XqX6mjyf{opacity:1}.icon--l8SzaFlV{display:flex;align-items:center;margin-right:12px}.title--FZPCnJbE{color:#262626;font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool--ugqSpeIM{background:#e2e5ef;border:1px solid #d4d4de;border-radius:13px;line-height:24px;padding:0 12px;width:-moz-fit-content;width:fit-content;font-size:12px;color:rgba(0,0,0,0.65);cursor:pointer;display:flex;align-items:center;gap:7px;margin-bottom:12px}.tool--ugqSpeIM eo-icon{font-size:14px;color:#8c8c8c}.body--p3Zt_jA4{margin-bottom:20px}.heading--lj5kJ2fg + .body--p3Zt_jA4{padding-left:26px}.collapsed--cGSG2zk_ .body--p3Zt_jA4{display:none}.collapsed--cGSG2zk_ .caret--XqX6mjyf{transform:rotate(180deg);opacity:1}.content--pBkkWQ5e{margin-top:14px}.content--pBkkWQ5e .markdown--Ky2J85cs [class*="code-wrapper--"]::part(mermaid){background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:20px;min-width:var(--cruise-canvas-node-width-medium);width:auto;max-width:100%}.content--pBkkWQ5e:empty{display:none}.message--okEUzWzg:first-child > .message-part--kxjYnHz0:first-child > :first-child{margin-top:0}.icon--l8SzaFlV{color:#abaab7}.completed--JWq7E1Jw .icon--l8SzaFlV{color:#0fbe59}.failed--uk7jDD7K .icon--l8SzaFlV{color:#f24c25}.working--dZiN0y04 .icon--l8SzaFlV{color:var(--elevo-color-brand)}.input-required--JSuPr8br .icon--l8SzaFlV{color:#12aacc}.canceled--LyMjPJQd .icon--l8SzaFlV{color:#fcaa07}ai-portal\\.chat-stream[hide-mermaid] .content--pBkkWQ5e .markdown--Ky2J85cs .mermaid{display:none}.error--n_Of3DwP{color:var(--color-error);white-space:pre-wrap;word-break:break-word}',""]),s.locals={heading:"heading--lj5kJ2fg",main:"main--P8894aNV",caret:"caret--XqX6mjyf",icon:"icon--l8SzaFlV",title:"title--FZPCnJbE",tool:"tool--ugqSpeIM",body:"body--p3Zt_jA4",collapsed:"collapsed--cGSG2zk_",content:"content--pBkkWQ5e",markdown:"markdown--Ky2J85cs",message:"message--okEUzWzg","message-part":"message-part--kxjYnHz0",completed:"completed--JWq7E1Jw",failed:"failed--uk7jDD7K",working:"working--dZiN0y04","input-required":"input-required--JSuPr8br",canceled:"canceled--LyMjPJQd",error:"error--n_Of3DwP"};const o=s},62232:(e,t,a)=>{a.d(t,{C:()=>et});var n=a(18769),i=a.n(n),l=a(30348),s=a(53373),o=a.n(s),r=a(52208),c=a(67101),d=a(50045),m=a(40177);function p(e,t,a,i,l,s,o){const r=null==o?void 0:o.showHumanActions,c=null==o?void 0:o.skipActivitySubTasks;return(0,n.useMemo)((()=>{if(!e)return{messages:[],lastDetail:null};const{chunks:n,jobMap:o}=(0,d.a)(a,i,l,s,c),p=[];let u={role:"assistant",chunks:[]},f=null;for(const e of n)if("job"===e.type){var g;const t=e.job;var b;t.toolCall&&(f={type:"job",id:t.id}),"completed"===t.state&&null!==(g=t.messages)&&void 0!==g&&g.length&&t.messages.every((e=>"user"===e.role))?(u.chunks.length>0&&p.push(u),p.push({role:"user",content:t.messages.flatMap((e=>e.parts.map((e=>"text"===e.type?e.text:"")))).join(""),cmd:t.cmd,mentionedAiEmployeeId:t.mentionedAiEmployeeId,fromSkippedSubTask:e.fromSkippedSubTask,files:null===(b=t.messages)||void 0===b?void 0:b.filter((e=>"user"===e.role)).flatMap((e=>e.parts)).filter((e=>"file"===e.type)).map((e=>e.file))}),u={role:"assistant",chunks:[]}):u.chunks.push(e),t.humanAction&&(u.chunks.length>0&&p.push(u),r&&p.push({role:"user",content:t.humanAction}),u={role:"assistant",chunks:[]})}else u.chunks.push(e),"error"!==e.type&&(f={type:e.type,id:e.task.id});let h=p.length>0&&!m.QB.includes(t);if(h&&"assistant"===u.role&&0===u.chunks.length){const e=p[p.length-1];"user"===e.role&&e.fromSkippedSubTask&&(h=!1)}return(u.chunks.length>0||h)&&p.push(u),{messages:p,jobMap:o,lastDetail:f}}),[e,t,a,l,s,i,r,c])}var u=a(30672),f=a(72591),g=a.n(f),b=a(1740),h=a.n(b),x=a(88128),v=a.n(x),E=a(30855),k=a.n(E),w=a(93051),A=a.n(w),y=a(73656),I=a.n(y),N=a(26598),T={};T.styleTagTransform=I(),T.setAttributes=k(),T.insert=v().bind(null,"head"),T.domAPI=h(),T.insertStyleElement=A(),g()(N.A,T);const S=N.A&&N.A.locals?N.A.locals:void 0;var C=a(77388),j=a(47760);function _(e){let{content:t,cmd:a,mentionedAiEmployeeId:n,files:l}=e;return i().createElement(i().Fragment,null,i().createElement("div",{className:S.user},(a||n)&&i().createElement(C._,{cmd:a,mentionedAiEmployeeId:n}),t),null!=l&&l.length?i().createElement(j.$,{files:l,ui:"chat"}):null)}var D=a(35754),F={};F.styleTagTransform=I(),F.setAttributes=k(),F.insert=v().bind(null,"head"),F.domAPI=h(),F.insertStyleElement=A(),g()(D.A,F);const P=D.A&&D.A.locals?D.A.locals:void 0;var V=a(35430),L=a(89575),z=a(41030),G=a(50094),R={};R.styleTagTransform=I(),R.setAttributes=k(),R.insert=v().bind(null,"head"),R.domAPI=h(),R.insertStyleElement=A(),g()(G.A,R);const W=G.A&&G.A.locals?G.A.locals:void 0;var q=a(36903),O=a(29386),M=a(42854),U=a(86976),B=a(65438),J={};J.styleTagTransform=I(),J.setAttributes=k(),J.insert=v().bind(null,"head"),J.domAPI=h(),J.insertStyleElement=A(),g()(B.A,J);const X=B.A&&B.A.locals?B.A.locals:void 0;function H(e){let{job:t}=e;const[a,l]=(0,n.useState)("medium"),s=(0,n.useCallback)((e=>{l(e)}),[]);return i().createElement("div",{className:o()(X.view,{[X.large]:"large"===a})},i().createElement(U.y,{job:t,onSizeChange:s}))}var Y=a(76720);const Q=(0,n.createContext)({lastDetail:null,setUserClosedAside:()=>{}});function K(e,t){switch(e){case"completed":return{className:W.completed,icon:{lib:"antd",theme:"filled",icon:"check-circle"}};case"submitted":case"working":return"terminated"===t?{icon:{lib:"fa",prefix:"far",icon:"circle-stop"}}:{className:W.working,icon:{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}};case"input-required":return{className:W["input-required"],icon:{lib:"fa",prefix:"far",icon:"circle-user"}};case"failed":return{className:W.failed,icon:{lib:"fa",prefix:"fas",icon:"xmark"}};case"canceled":case"terminated":return{className:W.canceled,icon:{lib:"fa",prefix:"far",icon:"circle-stop"}};case"skipped":return{icon:{lib:"fa",prefix:"fas",icon:"ban"}};default:return{icon:{lib:"fa",prefix:"far",icon:"clock"}}}}function Z(e){var t,a;let{job:l,isSubTask:s}=e;const r=l.toolCall,c=(null==r||null===(t=r.annotations)||void 0===t?void 0:t.title)||(null==r?void 0:r.name),d=null==r?void 0:r.name,p=!!r,{conversationState:f,setActiveDetail:g,setSubActiveDetail:b}=(0,n.useContext)(Y.j),{lastDetail:h,setUserClosedAside:x}=(0,n.useContext)(Q),{className:v,icon:E}=(0,n.useMemo)((()=>K(l.state,f)),[l.state,f]),[k,w,A]=(0,n.useMemo)((()=>{var e;const t=[],a=[],n=[];let i="llm_answer"===d;return null===(e=l.messages)||void 0===e||e.forEach((e=>{if("tool"===e.role)for(const o of e.parts){var l;if("data"===o.type)switch(null===(l=o.data)||void 0===l?void 0:l.type){case"markdown":t.push(o.data.content);break;case"cmdb_instance_detail":var s;a.push(o.data),i||(i=Object.keys("object"===(null===(s=o.data)||void 0===s||null===(s=s.outputSchema)||void 0===s?void 0:s.type)?o.data.outputSchema.properties:o.data.detail).length>6)}else"file"===o.type&&n.push(o.file)}})),[t.join(""),a,n]}),[l.messages,d]),[y,I]=(0,n.useState)(!1),N=p||!!l.instruction;return i().createElement("div",{className:o()({[W.collapsed]:y})},N&&i().createElement("div",{className:o()(W.heading,v),onClick:()=>I((e=>!e))},i().createElement("div",{className:W.icon},i().createElement(u.Bj,E)),i().createElement("div",{className:W.title},l.instruction||c),i().createElement(u.Bj,(0,L.A)({className:W.caret},m.ae))),i().createElement("div",{className:W.body},p&&i().createElement("div",{className:W.tool,onClick:()=>{const e={type:"job",id:l.id};(s?b:g)((t=>(0,z.isEqual)(t,e)?t:e)),(0,z.isEqual)(e,h)&&x(!1)}},i().createElement(u.Bj,{lib:"lucide",icon:"square-chevron-right"}),c),i().createElement("div",{className:W.main},null===(a=l.messages)||void 0===a?void 0:a.map(((e,t)=>{var a;return"tool"===e.role?null:i().createElement("div",{key:t,className:o()(W.message,q.A.markdown)},null===(a=e.parts)||void 0===a?void 0:a.map(((e,t)=>i().createElement(i().Fragment,{key:t},"text"===e.type&&i().createElement(O.w,{className:o()(W["message-part"],q.A["markdown-wrapper"]),content:e.text})))))}))),i().createElement("div",{className:W.content},k&&i().createElement("div",{className:o()(W.markdown,q.A.markdown)},i().createElement(O.w,{className:q.A["markdown-wrapper"],content:k})),w.map(((e,t)=>i().createElement("div",{key:t,className:W.box},i().createElement(M.H,e)))),l.generatedView?i().createElement(H,{job:l}):null,A.length>0&&i().createElement(j.$,{files:A}))))}var $=a(48952);function ee(e){let{chunk:t,isSubTask:a}=e;return"job"===t.type?i().createElement(Z,{job:t.job,isSubTask:a}):"error"===t.type?i().createElement("div",{className:W.error},t.error):i().createElement(te,{chunk:t,isSubTask:a})}function te(e){let{chunk:t,isSubTask:a}=e;const{conversationState:l,setActiveDetail:s,setSubActiveDetail:r}=(0,n.useContext)(Y.j),{setUserClosedAside:c,lastDetail:d}=(0,n.useContext)(Q),[p,f]=(0,n.useState)(!1),{type:g,task:b}=t,{className:h,icon:x}=(0,n.useMemo)((()=>K("flow"===t.type?"completed":b.state,l)),[t.type,l,b.state]);return i().createElement("div",{className:o()({[W.collapsed]:p})},i().createElement("div",{className:o()(W.heading,h),onClick:()=>f((e=>!e))},i().createElement("div",{className:W.icon},i().createElement(u.Bj,x)),i().createElement("div",{className:W.title},"flow"===g?(0,$.t)($.K.INITIATING_SERVICE_FLOW,{name:t.flow.name}):(0,$.t)($.K.STARTING_SERVICE_FLOW_ACTIVITY,{name:t.activity.name})),i().createElement(u.Bj,(0,L.A)({className:W.caret},m.ae))),i().createElement("div",{className:W.body},i().createElement("div",{className:W.tool,onClick:()=>{const e={type:t.type,id:t.task.id};(a?r:s)((t=>(0,z.isEqual)(t,e)?t:e)),(0,z.isEqual)(e,d)&&c(!1)}},i().createElement(u.Bj,{lib:"lucide",icon:"route"}),"flow"===g?(0,$.t)($.K.INITIATING_SERVICE_FLOW,{name:t.flow.name}):(0,$.t)($.K.STARTING_SERVICE_FLOW_ACTIVITY,{name:t.activity.name}))))}var ae=a(17994),ne={};ne.styleTagTransform=I(),ne.setAttributes=k(),ne.insert=v().bind(null,"head"),ne.domAPI=h(),ne.insertStyleElement=A(),g()(ae.A,ne);const ie=ae.A&&ae.A.locals?ae.A.locals:void 0;function le(e){let{job:t}=e;return i().createElement("div",{className:ie.hil},i().createElement("div",{className:ie.content},i().createElement(u.Bj,{lib:"antd",icon:"exclamation-circle"}),(0,$.t)($.K.HIL_TIPS,{name:t.hil.username})),t.requestHumanAction&&i().createElement("div",{className:ie.actions},i().createElement(V.n,{action:t.requestHumanAction,ui:"chat"})))}function se(e){let{chunks:t,scopeState:a,isLatest:l,isSubTask:s}=e;const[o,r]=(0,n.useMemo)((()=>{const e=t[t.length-1];let n;if(e)switch(e.type){case"flow":case"activity":n=e.task.jobs[e.task.jobs.length-1];break;case"job":n=e.job;break;default:return[!1,void 0]}if(!l||m.Z5.includes(a))return[!1,n];for(const e of t)switch(e.type){case"flow":case"activity":if(e.task.jobs.some((e=>"input-required"===e.state)))return[!1,n];break;case"job":if("input-required"===e.job.state)return[!1,n]}return n&&"working"===n.state&&n.toolCall?[!1,n]:[!0,n]}),[l,t,a]);return i().createElement("div",{className:P.assistant},i().createElement(u.Bj,{lib:"easyops",category:"image",icon:"elevo-avatar-png",className:P.avatar}),i().createElement("div",{className:P.body},t.map(((e,t)=>i().createElement(ee,{key:t,chunk:e,isSubTask:s}))),o&&i().createElement("div",{className:P.texting}),l&&r&&!m.X4.includes(a)&&("working"===r.state||"input-required"===r.state)&&!r.humanAction&&(r.hil?i().createElement(le,{job:r}):r.requestHumanAction&&i().createElement(V.n,{action:r.requestHumanAction,ui:"chat"}))))}var oe=a(70046),re=a(62309),ce=a(83090),de={};de.styleTagTransform=I(),de.setAttributes=k(),de.insert=v().bind(null,"head"),de.domAPI=h(),de.insertStyleElement=A(),g()(ce.A,de);const me=ce.A&&ce.A.locals?ce.A.locals:void 0;var pe=a(39649),ue=a(52616),fe=a(83685),ge={};ge.styleTagTransform=I(),ge.setAttributes=k(),ge.insert=v().bind(null,"head"),ge.domAPI=h(),ge.insertStyleElement=A(),g()(fe.A,ge);const be=fe.A&&fe.A.locals?fe.A.locals:void 0;var he=a(625);let xe=function(e){return e.WAITING="WAITING",e.EXECUTING="EXECUTING",e.PAUSED="PAUSED",e.SUCCEEDED="SUCCEEDED",e.FAILED="FAILED",e.TERMINATED="TERMINATED",e}({});const ve="bricks/ai-portal/FlowApp",Ee=ue.i18n.getFixedT(null,ve);var ke=a(99126);function we(e,t,a){const i=(0,n.useRef)(!1),l=(0,n.useRef)(!1),[s,o]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{const e=t.current,n=a.current;if(l.current||!e||!n)return;const s=()=>{o(e.scrollTop+e.clientHeight+24<e.scrollHeight),i.current&&(l.current=e.scrollTop+e.clientHeight+6<e.scrollHeight)};let r;e.addEventListener("scroll",s);const c=new ke.A((()=>{l.current||(i.current=!1,e.scrollTo({top:n.scrollHeight,behavior:"instant"}),clearTimeout(r),r=setTimeout((()=>{i.current=!0}),100))}));return c.observe(n),()=>{c.disconnect(),e.removeEventListener("scroll",s)}}),[e]),{scrollable:s,scrollToBottom:(0,n.useCallback)((()=>{const e=t.current;null==e||e.scrollTo({top:null==e?void 0:e.scrollHeight,behavior:"instant"})}),[t])}}var Ae=a(86e3),ye={};ye.styleTagTransform=I(),ye.setAttributes=k(),ye.insert=v().bind(null,"head"),ye.domAPI=h(),ye.insertStyleElement=A(),g()(Ae.A,ye);const Ie=Ae.A&&Ae.A.locals?Ae.A.locals:void 0;var Ne=a(69493);function Te(e){var t;let{flow:a,activity:l}=e;const{tasks:s,setActiveDetail:r}=(0,n.useContext)(Y.j),c=(0,n.useMemo)((()=>s.find((e=>e.id===a.taskId))),[s,a.taskId]),d=(0,n.useMemo)((()=>a.spec.map((e=>{var t;return{...e,serviceFlowActivities:null===(t=e.serviceFlowActivities)||void 0===t?void 0:t.map((e=>{const t=s.find((t=>t.id===e.taskId));return{name:e.name,taskId:e.taskId,state:null==t?void 0:t.state,startTime:null==t?void 0:t.startTime,endTime:null==t?void 0:t.endTime}}))}}))),[a.spec,s]),m=(0,n.useMemo)((()=>Ce(c.state)),[c.state]);return i().createElement("div",{className:be.app},i().createElement("div",{className:be.heading},i().createElement("div",{className:be.header},i().createElement("div",{className:o()(be.status,m.className)},i().createElement(u.Bj,m.icon),m.text),i().createElement("div",{className:be.title},`${null!==(t=a.space)&&void 0!==t&&t.name?`${a.space.name} / `:""}${a.name}`)),i().createElement("div",{className:be.chart},i().createElement(u.n$,{spec:d,activeActivityId:null==l?void 0:l.taskId,onActiveChange:e=>{e.detail&&r({type:"activity",id:e.detail})}}))),i().createElement("div",{className:be.body},l?i().createElement(Se,{activity:l}):i().createElement(u.F_,{className:be.blank,description:"您还未选择活动",illustration:"serviceflows"})))}function Se(e){let{activity:t}=e;const{tasks:a,errors:l}=(0,n.useContext)(Y.j),s=(0,n.useMemo)((()=>a.find((e=>e.id===t.taskId))),[a,t.taskId]),o=s.state,{icon:r,className:c}=(0,n.useMemo)((()=>Ce(o)),[o]),d=(0,n.useMemo)((()=>[{...s,parent:void 0}]),[s]),{messages:m}=p(!0,s.state,d,l),f=(0,n.useRef)(null),g=(0,n.useRef)(null),{scrollable:b,scrollToBottom:h}=we(!0,f,g);return i().createElement(i().Fragment,null,i().createElement("div",{className:be["activity-title"]},i().createElement(u.Bj,(0,L.A)({},r,{className:c})),t.name),i().createElement("div",{className:be.chat,ref:f},i().createElement("div",{className:be.messages,ref:g},m.map(((e,t,a)=>i().createElement("div",{className:be.message,key:t},"user"===e.role?i().createElement(_,{content:e.content,cmd:e.cmd,files:e.files}):i().createElement(se,{chunks:e.chunks,scopeState:s.state,isLatest:t===a.length-1,isSubTask:!0})))))),i().createElement("button",{className:`${Ie["scroll-down"]} ${Ne.A["floating-button"]}`,style:{bottom:"30px"},hidden:!b,onClick:h},i().createElement(u.Bj,{lib:"antd",icon:"down"})))}function Ce(e){const t=(0,he.W)(e);let a,n;switch(e){case"working":a=Ee(xe.EXECUTING),n=be.working;break;case"completed":a=Ee(xe.SUCCEEDED),n=be.completed;break;case"failed":a=Ee(xe.FAILED),n=be.failed;break;case"input-required":a=Ee(xe.PAUSED),n=be.paused;break;case"terminated":a=Ee(xe.TERMINATED);break;default:a=Ee(e?xe.EXECUTING:xe.WAITING)}return{icon:t,text:a,className:n}}(0,ue.initializeI18n)(ve,{en:{WAITING:"Waiting",EXECUTING:"Executing",PAUSED:"Paused",SUCCEEDED:"Succeeded",FAILED:"Failed",TERMINATED:"Terminated"},zh:{WAITING:"等待中",EXECUTING:"执行中",PAUSED:"暂停",SUCCEEDED:"成功",FAILED:"失败",TERMINATED:"已终止"}});const je={lib:"easyops",icon:"shrink"};function _e(e){let{detail:t,isSubTask:a,faded:l}=e;const{setActiveDetail:s,setSubActiveDetail:r}=(0,n.useContext)(Y.j),{setUserClosedAside:c}=(0,n.useContext)(Q),[d,m]=(0,n.useMemo)((()=>{const e=[],a=[],n=[];var i;return"job"===t.type&&(null===(i=t.job.messages)||void 0===i||i.forEach((t=>{if("tool"===t.role)for(const l of t.parts){var i;if("data"===l.type)switch(null===(i=l.data)||void 0===i?void 0:i.type){case"markdown":e.push(l.data.content);break;case"cmdb_instance_detail":a.push(l.data)}else"file"===l.type&&n.push(l.file)}}))),[e.join(""),a,n]}),[t]);return i().createElement("div",{className:o()(me.aside,{[me.sub]:a,[me.faded]:l})},i().createElement("div",{className:me.box},i().createElement("div",{className:me.header},i().createElement("div",{className:me.title},"Elevo's Computer"),i().createElement(u.Py,{icon:je,variant:"mini",onClick:()=>{a?r(null):(s(null),c(!0))}})),i().createElement("div",{className:me.body},"job"===t.type?i().createElement(i().Fragment,null,i().createElement(pe.t,{job:t.job,variant:"read-only"}),t.job.generatedView?i().createElement(De,{name:"View",source:t.job.generatedView.code,language:"jsx"}):d?i().createElement(De,{name:"Content",source:d,language:"md"}):m.length>0?i().createElement(De,{name:"CMDB",source:JSON.stringify(m,null,2),language:"json"}):null):i().createElement(Te,{flow:t.flow,activity:t.activity}))))}function De(e){let{name:t,source:a,language:n}=e;return i().createElement("div",{className:o()(me.app,me.editor)},i().createElement("div",{className:me.heading},`${t}.${n}`),i().createElement("div",{className:o()(me.content,q.A.markdown)},i().createElement("div",{className:me.scroller},i().createElement(u.yQ,{className:me["code-block"],source:a,language:n,themeVariant:"elevo"}))))}var Fe=a(94625),Pe=a(76239),Ve={};Ve.styleTagTransform=I(),Ve.setAttributes=k(),Ve.insert=v().bind(null,"head"),Ve.domAPI=h(),Ve.insertStyleElement=A(),g()(Pe.A,Ve);const Le=Pe.A&&Pe.A.locals?Pe.A.locals:void 0;var ze=a(86767),Ge=a(98153),Re=a(88253),We=a(2367),qe=a(18768),Oe={};Oe.styleTagTransform=I(),Oe.setAttributes=k(),Oe.insert=v().bind(null,"head"),Oe.domAPI=h(),Oe.insertStyleElement=A(),g()(qe.A,Oe);const Me=qe.A&&qe.A.locals?qe.A.locals:void 0;let Ue=function(e){return e.PLAN_COMPLETED="PLAN_COMPLETED",e}({});const Be="bricks/ai-portal/PlanProgress",Je=ue.i18n.getFixedT(null,Be);function Xe(e){let{plan:t,conversationState:a,style:l}=e;const[s,r]=(0,n.useState)(!1),{doneCount:c,state:d,name:m}=(0,n.useMemo)((()=>t.reduce(((e,t)=>"completed"===t.state?{...e,state:t.state,name:t.name,doneCount:e.doneCount+1}:!e.name||t.state?{...e,state:t.state,name:t.name}:e),{doneCount:0,name:"",state:void 0})),[t]),{className:p,icon:f}=(0,n.useMemo)((()=>Ye(d,a)),[d,a]),g=(0,n.useCallback)((()=>{r((e=>!e))}),[]);if(null==t||!t.length)return null;const b=c===t.length&&"completed"===a;return i().createElement(i().Fragment,null,s&&i().createElement("div",{className:Me.mask,onClick:g}),i().createElement("div",{className:o()(Me.progress,p),style:l},i().createElement("div",{className:Me.bar,onClick:g},i().createElement("div",{className:Me.icon},i().createElement(u.Bj,f)),i().createElement("span",{className:Me.text,title:b?"":m},b?Je(Ue.PLAN_COMPLETED):m),i().createElement("span",{className:Me.stat},c,"/",t.length),i().createElement(u.Bj,{className:Me.expand,lib:"antd",theme:"outlined",icon:s?"down":"up"})),s&&i().createElement("ul",{className:Me.details},t.map(((e,t)=>i().createElement(He,{key:t,state:e.state,conversationState:a,name:e.name}))))))}function He(e){let{state:t,conversationState:a,name:l}=e;const{className:s,icon:r}=(0,n.useMemo)((()=>Ye(t,a)),[t,a]);return i().createElement("li",{className:o()(Me.step,s)},i().createElement(u.Bj,(0,L.A)({},r,{className:Me.state})),i().createElement("span",{className:Me.name,title:l},l))}function Ye(e,t){switch(e){case"completed":return{className:Me.completed,icon:{lib:"fa",prefix:"fas",icon:"check"}};case"submitted":case"working":return"terminated"===t?{className:void 0,icon:{lib:"fa",prefix:"far",icon:"circle-stop"}}:{className:Me.working,icon:{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}};case"input-required":return{className:Me["input-required"],icon:{lib:"fa",prefix:"far",icon:"circle-user"}};case"failed":return{className:Me.failed,icon:{lib:"fa",prefix:"fas",icon:"xmark"}};case"canceled":return{className:Me.canceled,icon:{lib:"fa",prefix:"far",icon:"circle-stop"}};default:return{icon:{lib:"fa",prefix:"far",icon:"clock"}}}}(0,ue.initializeI18n)(Be,{en:{PLAN_COMPLETED:"All tasks are completed"},zh:{PLAN_COMPLETED:"所有任务已全部完成"}});var Qe=a(38717),Ke=a(6671),Ze=a(32146);const $e={lib:"easyops",icon:"share"};function et(e,t){var a;let{conversationId:s,initialRequest:d,replay:f,replayDelay:g,supports:b,showHumanActions:h,showFeedback:x,showFeedbackAfterFailed:v,showFeedbackOnView:E,showUiSwitch:k,previewUrlTemplate:w,noticeUrlTemplate:A,showCases:y,showNoticeIcon:I,exampleProjects:N,notices:T,tryItOutUrl:S,uploadOptions:C,onShare:j,onTerminate:D,onSubmitFeedback:F,onSwitchToCanvas:P,onFeedbackOnView:V,onDetailChange:L,onMarkNoticesRead:z,onNoticeClick:G}=e;const{conversation:R,tasks:W,serviceFlows:q,errors:O,humanInputRef:M,skipToResults:U,watchAgain:B}=(0,c.u)(s,d,f,g),J=null!==(a=null==R?void 0:R.title)&&void 0!==a?a:"",X=null==R?void 0:R.state,H=m.QB.includes(X)||"input-required"===X,K=function(e,t){return(0,n.useMemo)((()=>{const a=[];for(const n of e)for(const e of n.spec)for(const n of e.serviceFlowActivities)if(n.taskId){const e=t.find((e=>e.id===n.taskId));a.push({name:n.name,taskId:n.taskId,state:null==e?void 0:e.state})}else a.push({name:n.name});return a}),[e,t])}(q,W),{flowMap:Z,activityMap:ee}=(0,Re.o)(q),{messages:te,jobMap:ae,lastDetail:ne}=p(!!R,null==R?void 0:R.state,W,O,Z,ee,{showHumanActions:h,skipActivitySubTasks:!0});(0,n.useEffect)((()=>{L({projectId:null==R?void 0:R.projectId})}),[L,null==R?void 0:R.projectId]);const ie=(0,n.useMemo)((()=>ae?[...ae.values()].flatMap((e=>e.generatedView?{id:e.id,view:e.generatedView}:[])):[]),[ae]),[le,ce]=(0,n.useState)(!1),[de,me]=(0,n.useState)(!1),[pe,ue]=(0,n.useState)(!!x);(0,n.useEffect)((()=>{ue(!!x)}),[x]);const[fe,ge]=(0,n.useState)(),be=(0,n.useCallback)((e=>{ce(!0),F(e)}),[F]);(0,n.useImperativeHandle)(t,(()=>({feedbackSubmitDone:()=>{me(!0),setTimeout((()=>{ue(!1)}),3e3)},feedbackSubmitFailed:()=>{ce(!1)},feedbackOnViewDone:e=>{ge((t=>{const a=new Set(t);return a.add(e),a}))}})),[]);const[he,xe]=(0,n.useState)(null),[ve,Ee]=(0,n.useState)(null),[ke,Ae]=(0,n.useState)(null),[ye,Te]=(0,n.useState)(!1),Se=!!R,Ce=(0,n.useRef)(!1);(0,n.useEffect)((()=>{if(Se){const e=setTimeout((()=>{Ce.current=!0}),1e3);return()=>{clearTimeout(e)}}}),[Se]);const je=!!d;(0,n.useEffect)((()=>{(Ce.current||je)&&ne&&!ye&&Ee(ne)}),[ne,ye,je]),(0,n.useEffect)((()=>{(0,l.getRuntime)().applyPageTitle(J)}),[J]);const De=(0,n.useCallback)(((e,t,a)=>{var n;null===(n=M.current)||void 0===n||n.call(M,e,t,a)}),[M]),Pe=te[0],Ve=(0,n.useMemo)((()=>{if("user"===(null==Pe?void 0:Pe.role))return Pe.content}),[Pe]),[qe,Oe]=(0,n.useState)(null),Me=s,[Ue,Be]=(0,n.useState)(null),Je=(0,n.useMemo)((()=>({conversationId:s,conversationState:X,tasks:W,errors:O,workspace:Me,previewUrlTemplate:w,replay:f,showCases:y,exampleProjects:N,uploadOptions:C,humanInput:De,onShare:j,onTerminate:D,supports:b,activeExpandedViewJobId:he,setActiveExpandedViewJobId:xe,activeDetail:ve,setActiveDetail:Ee,subActiveDetail:ke,setSubActiveDetail:Ae,submittingFeedback:le,submittedFeedback:de,onSubmitFeedback:be,setShowFeedback:ue,showFeedbackOnView:E,onFeedbackOnView:V,feedbackDoneViews:fe,skipToResults:U,watchAgain:B,tryItOut(){const e=window.open(`${(0,l.getBasePath)().slice(0,-1)}${null!=S?S:"/elevo"}`,"_blank");e&&(e.__elevo_try_it_out={content:Ve})},activeFile:Ue,setActiveFile:Be,activeImages:qe,setActiveImages:Oe})),[s,X,W,O,Me,w,f,y,N,C,De,j,D,b,he,ve,ke,le,de,be,E,V,fe,U,B,Ve,S,Ue,qe]),He=(0,n.useMemo)((()=>({lastDetail:ne,setUserClosedAside:Te})),[ne]),Ye=(0,n.useRef)(null),et=(0,n.useRef)(null),{scrollable:tt,scrollToBottom:at}=we(Se,Ye,et),nt=(0,We.U)(ve,ae,Z,ee),it=(0,We.U)(ke,ae,Z,ee),[lt,st]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{let e=!1;return Promise.race([(0,r.L)("light-plus"),new Promise((e=>setTimeout(e,5e3)))]).finally((()=>{e||st(!0)})),()=>{e=!0}}),[]),(0,Ze.d)(Je),i().createElement(Y.j.Provider,{value:Je},i().createElement(Q.Provider,{value:He},i().createElement("div",{className:Le.container},i().createElement("div",{className:Le.header},i().createElement("div",{className:Le.left}),i().createElement("h1",null,J),i().createElement("div",{className:Le.right},k&&i().createElement(u.Py,{className:Le["navbar-switch-ui"],icon:m.Rq,variant:"mini",title:(0,$.t)($.K.SWITCH_TO_CANVAS),onClick:P}),I&&i().createElement(u.jw,{dataSource:T,dropdownContentStyle:{minWidth:300},hideNotifyCenterButton:!0,urlTarget:"_blank",urlTemplate:A,onNoticeClick:e=>G(e.detail),onMarkAllRead:z}),i().createElement(u.Py,{icon:$e,variant:"mini",onClick:j}))),Se&&lt?i().createElement(i().Fragment,null,i().createElement("div",{className:Le.main,ref:Ye},i().createElement("div",{className:Le.narrow,ref:et},te.map(((e,t,a)=>i().createElement("div",{className:Le.message,key:t},"user"===e.role?i().createElement(_,{content:e.content,cmd:e.cmd,mentionedAiEmployeeId:e.mentionedAiEmployeeId,files:e.files}):i().createElement(se,{chunks:e.chunks,scopeState:X,isLatest:t===a.length-1})))),f?(null==R?void 0:R.finished)&&i().createElement(i().Fragment,null,i().createElement(Xe,{plan:K,conversationState:X,style:{marginTop:14}}),i().createElement(Ge.A,{finished:!0,ui:"chat"})):pe&&("completed"===X||"failed"===X&&v)&&W.length>0&&i().createElement(Fe.k,{className:Le.feedback}))),i().createElement("button",{className:`${Ie["scroll-down"]} ${Ne.A["floating-button"]}`,hidden:!tt,onClick:at},i().createElement(u.Bj,{lib:"antd",icon:"down"})),(f?null==R||!R.finished:null==b?void 0:b.chat)?i().createElement("div",{className:Le.footer},i().createElement("div",{className:Le.narrow},i().createElement(Xe,{plan:K,conversationState:X}),f?i().createElement(Ge.A,null):i().createElement(oe.s,{state:X,canChat:H}))):null):i().createElement("div",{className:Le["loading-icon"]},i().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}))),i().createElement("div",{className:o()(Le.aside,{[Le.expanded]:!!nt})},nt&&i().createElement(_e,{detail:nt,faded:!!it}),it&&i().createElement(_e,{detail:it,isSubTask:!0})),he&&i().createElement(re.f,{views:ie}),k&&i().createElement("div",{className:o()(ze.A.toolbar,Le.toolbar)},i().createElement(u.Py,{icon:m.Rq,variant:"mini",title:(0,$.t)($.K.SWITCH_TO_CANVAS),onClick:P})),Ue&&i().createElement(Qe.d,{file:Ue}),qe&&i().createElement(Ke.f,{images:qe})))}},65438:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".view--O8CNDdS_{background:rgba(255,255,255,0.6);border-radius:8px;border:1px solid rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:12px 20px;width:var(--cruise-canvas-node-width-medium);max-width:100%;margin-top:14px}.large--jT3IWlRf{width:var(--cruise-canvas-node-width-large)}",""]),s.locals={view:"view--O8CNDdS_",large:"large--jT3IWlRf"};const o=s},76239:(e,t,a)=>{a.d(t,{A:()=>p});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l),o=a(20062),r=a.n(o),c=new URL(a(32360),a.b),d=s()(i()),m=r()(c);d.push([e.id,`ai-portal\\.chat-stream{display:flex;position:relative;width:100%;height:100%;overflow:hidden;background-color:#f3f3f4;background-image:url(${m});background-size:cover;background-repeat:no-repeat;background-position:center;background-attachment:fixed;color:rgba(0,0,0,0.88);--cruise-canvas-node-width-small:330px;--cruise-canvas-node-width-medium:453px;--cruise-canvas-node-width-large:800px;--cruise-canvas-primary-color:var(--elevo-color-brand);--cruise-canvas-input-background:rgba(255,255,255,0.8);--cruise-canvas-input-box-shadow:0px 1px 0px 0px #ffffff,inset 0px 2px 4px 0px #b3bcf9}.container--IOwk4fR1{display:flex;flex-direction:column;position:relative;flex:1;min-width:0}.header--O9c4lNA3{height:54px;padding:0 24px;display:flex;align-items:center;justify-content:space-between}.header--O9c4lNA3 h1{font-weight:500;font-size:14px;margin:0;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.header--O9c4lNA3 .left--ed9ka1jF,.header--O9c4lNA3 .right--fs8TyVN3{width:56px}.header--O9c4lNA3 .right--fs8TyVN3{display:flex;align-items:center;justify-content:end;gap:8px}.main--KDIjetJs{overflow-y:auto;flex:1;padding:20px 24px}.narrow--xWih9UIb{width:100%;max-width:800px;margin:0 auto}.message--YIXGDQNi + .message--YIXGDQNi{margin-top:40px}.loading-icon--lagcmORP{flex:1;display:flex;align-items:center;justify-content:center;font-size:48px;color:#fff}.footer--aLZ8UWjM{padding:0 20px 24px}.aside--Xjd6To2A{width:0%;height:100%;transition:width 0.2s ease-in-out;position:relative}.expanded--xZgk3uBF{width:50%}.feedback--YbYylTcK{margin:24px auto 0}.toolbar--uiLshJmw{left:20px;bottom:20px}.navbar-switch-ui--hREVJ6zG{display:none}@media (max-width: 1123px){div.toolbar--uiLshJmw{display:none}.navbar-switch-ui--hREVJ6zG{display:block}}`,""]),d.locals={container:"container--IOwk4fR1",header:"header--O9c4lNA3",left:"left--ed9ka1jF",right:"right--fs8TyVN3",main:"main--KDIjetJs",narrow:"narrow--xWih9UIb",message:"message--YIXGDQNi","loading-icon":"loading-icon--lagcmORP",footer:"footer--aLZ8UWjM",aside:"aside--Xjd6To2A",expanded:"expanded--xZgk3uBF",feedback:"feedback--YbYylTcK",toolbar:"toolbar--uiLshJmw","navbar-switch-ui":"navbar-switch-ui--hREVJ6zG"};const p=d},83090:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".aside--DDIdDtkt{padding:12px 12px 12px 0;height:100%}.faded--AsNxuT2v{opacity:0.4}.sub--d8EpebQt{position:absolute;top:16px;right:16px;left:-16px;height:calc(100% - 16px)}.box--niuFBiiQ{background:#ffffff;box-shadow:1px 1px 10px 0px rgba(0,10,26,0.1);border-radius:12px;height:100%;display:flex;flex-direction:column}.header--DPl_hrTp{height:52px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,0.15);padding:0 20px}.title--HlE9yRcJ{font-weight:500;font-size:16px;color:#262626}.body--OLKz1zeC{flex:1;min-height:0;padding:20px;display:flex;flex-direction:column}.app--UanK0TGf{flex:1;min-height:0;background:#ffffff;border-radius:9px;border:1px solid #ccd1de;margin-top:16px;overflow:hidden;display:flex;flex-direction:column}.heading--ngRi_rQ4{background:#e6e9f3;color:#5e6472;padding:5px 14px}.content--I2i0y65v{font-size:12px;flex:1;min-height:0;position:relative}.scroller--mLfznC_I{height:100%;overflow-x:hidden;overflow-y:auto;overflow:hidden auto;padding:10px}.scroller--mLfznC_I.loading--U1GWHEp9{display:flex;align-items:center;justify-content:center}.editor--p_Sqs1os .content--I2i0y65v .code-block--XiUVX7st::part(wrapper){position:static;margin:0}.editor--p_Sqs1os .content--I2i0y65v .code-block--XiUVX7st::part(pre){background:none!important;padding:0;border-radius:0;border:0}",""]),s.locals={aside:"aside--DDIdDtkt",faded:"faded--AsNxuT2v",sub:"sub--d8EpebQt",box:"box--niuFBiiQ",header:"header--DPl_hrTp",title:"title--HlE9yRcJ",body:"body--OLKz1zeC",app:"app--UanK0TGf",heading:"heading--ngRi_rQ4",content:"content--I2i0y65v",scroller:"scroller--mLfznC_I",loading:"loading--U1GWHEp9",editor:"editor--p_Sqs1os","code-block":"code-block--XiUVX7st"};const o=s},83685:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".app--qxnx6yuG{border-radius:9px;border:1px solid #ccd1de;flex:1;min-height:0;display:flex;flex-direction:column}.heading--SbCRupnn{border-bottom:1px solid #ccd1de;border-radius:9px 9px 0 0;background-image:radial-gradient(circle at 1px 1px,#ddd 1px,transparent 0px);background-size:25px 25px;background-position:12px;max-height:30%;display:flex;flex-direction:column}.header--LGXNxV5J{display:flex;align-items:center;padding:16px 30px}.status--aqbJGBcl{background:#aeb3bc;border-radius:100px;height:40px;padding:9px 16px;display:flex;align-items:center;gap:8px;font-size:18px;color:#ffffff}.status--aqbJGBcl eo-icon{font-size:22px}.status--aqbJGBcl.paused--U1cc3Ksn{background:#f0a22e}.status--aqbJGBcl.working--f2PYqFo7{background:#4f69ff}.status--aqbJGBcl.completed--Ihiekkve{background:#08bf33}.status--aqbJGBcl.failed--kB8wxIZ0{background:var(--color-error)}.title--IRvB2t7z{font-weight:500;font-size:16px;margin-left:40px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart--mypbn8pI{padding:8px 22px 18px;overflow:auto;min-height:0}.body--jnk1EIz0{padding:16px 12px 12px;display:flex;flex:1;min-height:0;flex-direction:column;position:relative}.activity-title--hF6stwmT{font-weight:500;font-size:16px;display:flex;align-items:center;gap:6px;margin-bottom:16px}.activity-title--hF6stwmT eo-icon{font-size:20px;color:#8c8c8c}.activity-title--hF6stwmT .paused--U1cc3Ksn{color:#f0a22e}.activity-title--hF6stwmT .working--f2PYqFo7{color:#4f69ff}.activity-title--hF6stwmT .completed--Ihiekkve{color:#08bf33}.activity-title--hF6stwmT .failed--kB8wxIZ0{color:var(--color-error)}.chat--nEzTEXbV{background:rgba(227,228,229,0.4);border:1px solid rgba(0,0,0,0.1);border-radius:8px;padding:16px 20px;flex:1;min-height:0;overflow-y:auto}.messages--vLiwUYSP{width:100%;margin:0 auto}.message--Okzj6NDx + .message--Okzj6NDx{margin-top:40px}",""]),s.locals={app:"app--qxnx6yuG",heading:"heading--SbCRupnn",header:"header--LGXNxV5J",status:"status--aqbJGBcl",paused:"paused--U1cc3Ksn",working:"working--f2PYqFo7",completed:"completed--Ihiekkve",failed:"failed--kB8wxIZ0",title:"title--IRvB2t7z",chart:"chart--mypbn8pI",body:"body--jnk1EIz0","activity-title":"activity-title--hF6stwmT",chat:"chat--nEzTEXbV",messages:"messages--vLiwUYSP",message:"message--Okzj6NDx"};const o=s},86e3:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(36758),i=a.n(n),l=a(40935),s=a.n(l)()(i());s.push([e.id,".scroll-down--st4A5sQ4{position:absolute;left:50%;bottom:136px;transform:translateX(-50%);width:32px;height:32px;font-size:12px}",""]),s.locals={"scroll-down":"scroll-down--st4A5sQ4"};const o=s}}]);
2
+ //# sourceMappingURL=2232.db8e7b47.js.map