@yuriai/web 0.3.1 → 0.3.2-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentAvatar-BwB9S5gR.js → AgentAvatar-x96Bnfsu.js} +1 -1
- package/dist/assets/AssistantConversationSurface-Fb-zSPo9.js +3 -0
- package/dist/assets/AssistantSessionCard-CoCLydJP.js +2 -0
- package/dist/assets/{AssistantUnreadBadge-DJQUBf7P.js → AssistantUnreadBadge-rZCi09a_.js} +1 -1
- package/dist/assets/{AssistantView-BNYeCdPt.js → AssistantView-swsUejpX.js} +1 -1
- package/dist/assets/{DiagramView-4xy78PeY.js → DiagramView-CLS0pLZO.js} +1 -1
- package/dist/assets/{FadeInOnReveal-BSm_Y5N-.js → FadeInOnReveal-CI-IPVEK.js} +1 -1
- package/dist/assets/{GuiPluginPage-Zn-NJGcV.js → GuiPluginPage-CAJB88Hr.js} +1 -1
- package/dist/assets/{GuiPluginSurface-BzbqxS7y.js → GuiPluginSurface-BS2r8oXR.js} +1 -1
- package/dist/assets/{GuiPluginWindow-DACvDqJe.js → GuiPluginWindow-FOzqLIZ3.js} +1 -1
- package/dist/assets/{Icon-CbRhi6Fu.js → Icon-DmIDd0Q3.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-DoSf5jCj.js → ImageLoadingPlaceholder-trn5U_et.js} +1 -1
- package/dist/assets/{LoadingImage-2mWVVnaP.js → LoadingImage-C4d5T4hV.js} +1 -1
- package/dist/assets/MarkdownRenderer-BVwZ1pA4.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-Bs4elVH3.js → MarkdownRendererImpl-DS0zWiLN.js} +2 -2
- package/dist/assets/{MarkstreamRendererImpl-rHAAvqOj.js → MarkstreamRendererImpl-jAsInIUo.js} +2 -2
- package/dist/assets/{MobileDetailNavigation-l_n1taf1.js → MobileDetailNavigation-C5cGr0_z.js} +1 -1
- package/dist/assets/{MobileResizableSheet-eCQDQAYS.js → MobileResizableSheet-C1mMUPUi.js} +1 -1
- package/dist/assets/{MobileShareBridge-DGb2HExd.js → MobileShareBridge-WMVB0JDL.js} +1 -1
- package/dist/assets/MobileSurface-DvKk_z56.js +2 -0
- package/dist/assets/{MultiRunWindow-BzkslOOz.js → MultiRunWindow-sY6Pm1xj.js} +1 -1
- package/dist/assets/{OnboardingScreen-YNlP1MQe.js → OnboardingScreen-BklzeM5-.js} +1 -1
- package/dist/assets/{OverlayScrollbar-CTdoPf6E.js → OverlayScrollbar-CCiU1O4G.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-B1Pavyxf.js → RemoteAssistantSessionCard-B51iN77P.js} +1 -1
- package/dist/assets/{SettingsView-Bl2kgume.js → SettingsView-DIjOyLKA.js} +13 -13
- package/dist/assets/{SettingsWindow-IUQlRvAB.js → SettingsWindow-CImW4cF3.js} +1 -1
- package/dist/assets/{SetupTourDialog-CPBnXSzq.js → SetupTourDialog-BKQ3z7Y2.js} +1 -1
- package/dist/assets/{TerminalView-9qSzxiHi.js → TerminalView-B2vccUH6.js} +1 -1
- package/dist/assets/ToolOutputDialog-Ce0eoysA.js +16 -0
- package/dist/assets/{VoiceSettings-CfYrDKgr.js → VoiceSettings-GiwhoPor.js} +2 -2
- package/dist/assets/{YuriLogo-VXtP1vhh.js → YuriLogo-DNvrroBa.js} +1 -1
- package/dist/assets/{YuriWordmark-B7lmpLRB.js → YuriWordmark-bJX68f2Y.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-D-LmCflm.js → assistant-attachment-cache-zu9sz4ex.js} +1 -1
- package/dist/assets/{capgoAdapter-BEKE5h5I.js → capgoAdapter-CDggXiqU.js} +1 -1
- package/dist/assets/{checkbox-gVpQUiVY.js → checkbox-1rYH2bTD.js} +1 -1
- package/dist/assets/{client-1Fk5IbQR.js → client-CgAFd1ew.js} +1 -1
- package/dist/assets/{collapsible-DCBnoRLL.js → collapsible-c8Ibgdp0.js} +1 -1
- package/dist/assets/context-menu-BImF2R_w.js +1 -0
- package/dist/assets/{device-QL8KNSLM.js → device-C8ZHblkr.js} +1 -1
- package/dist/assets/{diagram-DGTlsED0.js → diagram-DgoUJTH7.js} +1 -1
- package/dist/assets/dialog-BC7o8gDY.js +1 -0
- package/dist/assets/dialog-DYOEW9DC.css +1 -0
- package/dist/assets/{fileMentionTouchSelection-YTaXrwGt.js → fileMentionTouchSelection-C4Bcy0x9.js} +1 -1
- package/dist/assets/{fileReferenceActions-cYqdsXFz.js → fileReferenceActions-DX-Stroq.js} +1 -1
- package/dist/assets/{gitApi-Bxuv7iZR.js → gitApi-v_nr2noV.js} +1 -1
- package/dist/assets/{gitApiHttp-B0FJaIhU.js → gitApiHttp-BEMPJCIG.js} +1 -1
- package/dist/assets/{historyImportQueries-D_9RlrLp.js → historyImportQueries-eR7Bj6VN.js} +1 -1
- package/dist/assets/host-iM7aLAip.js +1 -0
- package/dist/assets/{i18n-qHllte6P.js → i18n-OsFhnlRH.js} +1 -1
- package/dist/assets/{image-loading-DBqnxgDH.js → image-loading-ZB1bYt51.js} +1 -1
- package/dist/assets/{input-Bv6SbhDB.js → input-Be95umzN.js} +1 -1
- package/dist/assets/{input-store-CsY-uaSj.js → input-store-DRTu4uZc.js} +1 -1
- package/dist/assets/{insertionBoundaries-CIvMb0MT.js → insertionBoundaries-B6Qmm9AF.js} +1 -1
- package/dist/assets/{main-wQ79inDK.js → main-B_c29S7v.js} +2 -2
- package/dist/assets/main-DehtDyHn.js +169 -0
- package/dist/assets/{markdownHeightCache-D2mAXH8W.js → markdownHeightCache-DRCM6uIv.js} +1 -1
- package/dist/assets/{markdownTheme-DFDWa8Gh.js → markdownTheme-C2LJ3cJo.js} +1 -1
- package/dist/assets/{mcpQueries-CUIUymwN.js → mcpQueries-ar057Rgj.js} +1 -1
- package/dist/assets/miniChat-Ba-eW2E2.js +2 -0
- package/dist/assets/mobile-CteFNdYr.js +2 -0
- package/dist/assets/{mobileBackNavigation-DwKmPsU6.js → mobileBackNavigation-D5OGRKSr.js} +1 -1
- package/dist/assets/mobileConnections-ha4M0S0e.js +2 -0
- package/dist/assets/{multirun-Di_vmRR_.js → multirun-_MbBN5TJ.js} +1 -1
- package/dist/assets/{native-config-B3D9Nv0p.js → native-config-nNPVev0-.js} +1 -1
- package/dist/assets/{navigation-lAkZZJTN.js → navigation-DcR3_z8w.js} +2 -2
- package/dist/assets/openRemoteProjectSession-b-2cofYh.js +1 -0
- package/dist/assets/{project-preview-2H-TmJkd.js → project-preview-BhNspxqe.js} +1 -1
- package/dist/assets/projectMeta-D53IRKNO.js +1 -0
- package/dist/assets/{prompt-attachment-upload-9fjmgafL.js → prompt-attachment-upload-8bssUUT3.js} +1 -1
- package/dist/assets/pwa-BVfdVkx_.js +2 -0
- package/dist/assets/qoder-zGvP_RLr.svg +5 -0
- package/dist/assets/{queue-abort-optimistic-DYFaJQrY.js → queue-abort-optimistic-DNMz6oUq.js} +1 -1
- package/dist/assets/{react-DVXKhubI.js → react-GVgpPWOu.js} +1 -1
- package/dist/assets/{readiness-Di6b1RDu.js → readiness-BLhjWepK.js} +2 -2
- package/dist/assets/{reference-history-DO4BO4M5.js → reference-history-DhW8i1Bj.js} +1 -1
- package/dist/assets/{remote-input-store-84i8uDyM.js → remote-input-store-DFBMyVS-.js} +1 -1
- package/dist/assets/{remoteProjectQueries-Dfms-cCx.js → remoteProjectQueries-8giIAvzL.js} +1 -1
- package/dist/assets/{remoteSessionReference-CabFQNo2.js → remoteSessionReference-2EzJ0HAI.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-BkHYTNcZ.js → renderElectronMiniChatApp-BSeoyBNY.js} +2 -2
- package/dist/assets/renderMobileApp-B8zNPX8J.js +29 -0
- package/dist/assets/{runtime-file-download-D11Nnedg.js → runtime-file-download-Dc459c9e.js} +1 -1
- package/dist/assets/{runtime-file-resource-CuLP3xp7.js → runtime-file-resource-DnhWnndu.js} +1 -1
- package/dist/assets/{runtimeConfig-Ez0YVcLS.js → runtimeConfig-B5mZw-WN.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-BUGfn7y0.css → runtimeEndpointReset-BIrMtGn5.css} +1 -1
- package/dist/assets/runtimeEndpointReset-xsh9V5vl.js +151 -0
- package/dist/assets/{scheduledTaskNavigation-y5g8D2ee.js → scheduledTaskNavigation-Bi7sRiFW.js} +1 -1
- package/dist/assets/{select-CrwouN4e.js → select-BRjmw6pb.js} +1 -1
- package/dist/assets/{sessionLookup-BpilZd_w.js → sessionLookup-BBqXTJRj.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-Ijc1-z3K.js → sortable-tabs-strip-DL4TMS9r.js} +1 -1
- package/dist/assets/{speechSettingsQueries-cV1mK7RB.js → speechSettingsQueries-DKopd_iw.js} +1 -1
- package/dist/assets/src-DRyZ4dLj.css +2 -0
- package/dist/assets/{store-BOD3jjMl.js → store-Dj5cSf8B.js} +1 -1
- package/dist/assets/{terminalApi-Cq0vjFe1.js → terminalApi-eR_918UZ.js} +1 -1
- package/dist/assets/{textarea-BPhvk5Vd.js → textarea-BJ8C3aZh.js} +1 -1
- package/dist/assets/{tooltip-BQ1xVNC6.js → tooltip-C88IVUw5.js} +1 -1
- package/dist/assets/types-jqOiAN4j.js +2 -0
- package/dist/assets/{useAppFontEffects-PZ3Y-JIL.js → useAppFontEffects-C28vxpqk.js} +62 -61
- package/dist/assets/{useAssistantUIStore-jOKVcBK8.js → useAssistantUIStore-CphyXHEY.js} +1 -1
- package/dist/assets/{useDesktopWindowControlsLayout-Z6PBzcuL.js → useDesktopWindowControlsLayout-Dm8OZBQF.js} +1 -1
- package/dist/assets/{useDictation-De8WB_Z7.js → useDictation-Do12BpsS.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DWiz5-Xa.js → useEffectiveDirectory-6o2SvpVe.js} +1 -1
- package/dist/assets/{useFontPreferences-CO-L-Gd7.js → useFontPreferences-DFF-uEAD.js} +1 -1
- package/dist/assets/{useMobileHtmlPreviewStore-EOAzZiAy.js → useMobileHtmlPreviewStore-DUquFMmd.js} +1 -1
- package/dist/assets/useMobileNavigationStore-zEWQLkBM.js +13 -0
- package/dist/assets/{usePluginsStore-pd_Lgl6m.js → usePluginsStore-CJNc92gY.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-Me0Uy2tM.js → useProjectRuntimeAPIs-D6zSDR6i.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-eJaQ-Vpw.js → useStreamingTextThrottle-DBPv5MtB.js} +1 -1
- package/dist/assets/{useThemeSystem-C57Z9mV2.js → useThemeSystem-D2YBbLma.js} +1 -1
- package/dist/assets/{useUIStore-Cfmg-aDQ.js → useUIStore-CYex4rbF.js} +1 -1
- package/dist/assets/{vendor-base-ui-z2M4boRm.js → vendor-base-ui-fom6orB6.js} +1 -1
- package/dist/assets/{vendor-cmdk-BgHvMv5l.js → vendor-cmdk-BKc6RGpL.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-accessibility-gVi9ga0x.js → vendor-dnd-kit-accessibility-Cf9EEJvm.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-core-Dd5yS2-T.js → vendor-dnd-kit-core-DRyd7I0I.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-sortable-CV-SGi8y.js → vendor-dnd-kit-sortable-C8S8cyRO.js} +1 -1
- package/dist/assets/{vendor-framer-motion-CF9BQLta.js → vendor-framer-motion-DiGWHm7K.js} +1 -1
- package/dist/assets/{vendor-markstream-react-TwEpkgfP.js → vendor-markstream-react-Cwc-VXWM.js} +3 -3
- package/dist/assets/vendor-motion-DtmZZeEm.js +1 -0
- package/dist/assets/{vendor-pierre-diffs-tqo4Z3TC.js → vendor-pierre-diffs-HJfPTtu2.js} +1 -1
- package/dist/assets/{vendor-react-P8wFrkcT.js → vendor-react-D5BntRmA.js} +1 -1
- package/dist/assets/{vendor-react-drawio-CQW1YP2l.js → vendor-react-drawio-DXADKcSU.js} +1 -1
- package/dist/assets/{vendor-reactuses-core-Dyjw5sZR.js → vendor-reactuses-core-B8s-Rcd-.js} +1 -1
- package/dist/assets/{vendor-sonner-B5HgJenP.js → vendor-sonner-Y-KPX915.js} +1 -1
- package/dist/assets/{vendor-stream-diffs-DCMtZcS3.js → vendor-stream-diffs-BMT21f-n.js} +2 -2
- package/dist/assets/{vendor-tanstack-react-query-B-KblYBV.js → vendor-tanstack-react-query-ChSd65dm.js} +1 -1
- package/dist/assets/{vendor-tanstack-react-virtual-BkuqzrEV.js → vendor-tanstack-react-virtual-WY42p6U6.js} +1 -1
- package/dist/assets/{vendor-zustand-Cwko4FG1.js → vendor-zustand-CNn3HHhT.js} +1 -1
- package/dist/index.html +19 -19
- package/dist/mini-chat.html +19 -19
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/server/lib/gui-customization/skill/references/work-status.md +4 -2
- package/server/lib/notifications/DOCUMENTATION.md +11 -1
- package/server/lib/notifications/session-unread-store.js +20 -6
- package/server/lib/notifications/session-unread.test.js +80 -0
- package/server/lib/relay/tunnel-host.js +12 -3
- package/server/lib/relay/tunnel-host.test.js +24 -0
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +14 -5
- package/server/lib/scheduled-tasks/runtime.js +29 -25
- package/server/lib/scheduled-tasks/runtime.test.js +88 -1
- package/dist/assets/AssistantConversationSurface-BQJZ0RY8.js +0 -3
- package/dist/assets/AssistantSessionCard-CSpwjbEO.js +0 -2
- package/dist/assets/MarkdownRenderer-BHK_Ba71.js +0 -2
- package/dist/assets/MobileSurface-lAYRO5L7.js +0 -2
- package/dist/assets/ToolOutputDialog-CmhQV6kW.js +0 -16
- package/dist/assets/context-menu-w28HFXdm.js +0 -1
- package/dist/assets/dialog-CTYD3Sbr.css +0 -1
- package/dist/assets/dialog-wyG1j1ZY.js +0 -1
- package/dist/assets/host-D9EDWNmx.js +0 -1
- package/dist/assets/main-DrYyJLms.js +0 -169
- package/dist/assets/miniChat-BTPvGmaS.js +0 -2
- package/dist/assets/mobile-DtTmIm4s.js +0 -2
- package/dist/assets/mobileConnections-BaVOE5PX.js +0 -2
- package/dist/assets/openRemoteProjectSession-APe4n1gm.js +0 -1
- package/dist/assets/projectMeta--OgVpG4Z.js +0 -1
- package/dist/assets/pwa-B6o6xxPS.js +0 -2
- package/dist/assets/renderMobileApp-tKRbh1UN.js +0 -29
- package/dist/assets/runtimeEndpointReset-C105_37x.js +0 -151
- package/dist/assets/src-INJJ62RE.css +0 -2
- package/dist/assets/types-CO7YCNVq.js +0 -2
- package/dist/assets/useMobileNavigationStore-D2FLOd1l.js +0 -13
- package/dist/assets/vendor-motion-Dv27UnOI.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ToolOutputDialog-Ce0eoysA.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-auth-mjIpsk3N.js","assets/runtime-switch-BMjl5Y5W.js","assets/runtime-fetch-DKZOpfzo.js","assets/reasoning-projection-client-BEhVknv9.js","assets/platform-wF65ZFgV.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-base-ui-fom6orB6.js","assets/vendor-react-D5BntRmA.js","assets/vendor-tanstack-react-query-ChSd65dm.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/runtime-file-resource-DnhWnndu.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-B8s-Rcd-.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/useUIStore-CYex4rbF.js","assets/vendor-zustand-CNn3HHhT.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/safeStorage-DTOhKN0V.js","assets/useMobileHtmlPreviewStore-DUquFMmd.js","assets/runtime-file-download-Dc459c9e.js","assets/vendor-pierre-diffs-HJfPTtu2.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/i18n-OsFhnlRH.js","assets/runtime-ead7P81A.js","assets/bootstrap-eLlfzqAI.js","assets/store-Dj5cSf8B.js","assets/tour-CMXP3Kif.js","assets/useMobileNavigationStore-zEWQLkBM.js","assets/gitApiHttp-BEMPJCIG.js","assets/client-CgAFd1ew.js","assets/vendor-opencode-client-BM2r1f0o.js","assets/vendor-effect-X1Hqc7ba.js","assets/prompt-attachment-upload-8bssUUT3.js","assets/uuid-D-SDZijH.js","assets/vendor-sonner-Y-KPX915.js","assets/useAssistantUIStore-CphyXHEY.js","assets/input-store-DRTu4uZc.js","assets/remoteProjectQueries-8giIAvzL.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/toolHelpers-iEHVHQ9p.js","assets/useThemeSystem-D2YBbLma.js","assets/vendor-framer-motion-DiGWHm7K.js","assets/Icon-DmIDd0Q3.js","assets/dialog-BC7o8gDY.js","assets/dialog-DYOEW9DC.css","assets/tap-LkQum5bB.js","assets/themes-BgDJcxRc.js","assets/MarkdownRenderer-BVwZ1pA4.js","assets/useEffectiveDirectory-6o2SvpVe.js","assets/markdownHeightCache-DRCM6uIv.js","assets/dualLimitLru-D8Sphgua.js","assets/MobileWindowStack-DGLdgoGr.js","assets/mobileBackNavigation-D5OGRKSr.js","assets/agentColors-DWSbQXy2.js","assets/rasterizePng-056Poix7.js","assets/image-loading-ZB1bYt51.js","assets/image-loading-DA9JEHD8.css","assets/ImageLoadingPlaceholder-trn5U_et.js","assets/vendor-tanstack-react-virtual-WY42p6U6.js","assets/markdownTheme-C2LJ3cJo.js","assets/markdown-worker-oBGEB9Eg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-BMjl5Y5W.js";import{n as r,r as i}from"./platform-wF65ZFgV.js";import{a}from"./vendor-zustand-CNn3HHhT.js";import{B as o,F as s,I as c,L as l,P as u,R as d,ot as f,st as p,z as m}from"./vendor-base-ui-fom6orB6.js";import{En as h,On as g,Tn as _,_n as v,vn as y,wn as b,xn as x}from"./gitApiHttp-BEMPJCIG.js";import{f as S}from"./prompt-attachment-upload-8bssUUT3.js";import{n as C}from"./vendor-react-D5BntRmA.js";import{s as w}from"./vendor-tanstack-react-query-ChSd65dm.js";import{L as T}from"./runtime-file-resource-DnhWnndu.js";import{a as E,i as D,m as O,o as k,p as A,r as j}from"./vendor-reactuses-core-B8s-Rcd-.js";import{o as M}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as N}from"./useUIStore-CYex4rbF.js";import{t as ee}from"./uuid-D-SDZijH.js";import{t as P}from"./i18n-OsFhnlRH.js";import{N as te,_ as ne,f as re,g as ie,h as ae,j as oe,r as se,u as ce,v as le,w as ue}from"./MobileDetailNavigation-C5cGr0_z.js";import{In as F,Rn as I,bi as L,s as de}from"./useMobileNavigationStore-zEWQLkBM.js";import{n as R}from"./useAssistantUIStore-CphyXHEY.js";import{a as z,r as fe}from"./MobileShareBridge-WMVB0JDL.js";import{a as B}from"./fileMentionAutocompleteState-BZJqfgae.js";import{o as pe,p as me,t as V}from"./AgentAvatar-x96Bnfsu.js";import{d as H,o as U,t as he}from"./vendor-framer-motion-DiGWHm7K.js";import{n as W}from"./Icon-DmIDd0Q3.js";import{t as G}from"./scheduledTaskNavigation-Bi7sRiFW.js";import{a as ge,i as _e,t as ve}from"./MarkdownRenderer-BVwZ1pA4.js";import{a as ye,b as K,c as be,h as xe,i as Se,l as q,n as Ce,o as we,r as Te,t as Ee,u as De,v as Oe,y as ke}from"./reference-history-DhW8i1Bj.js";import{a as Ae,n as J,r as je,t as Me}from"./fileMentionTouchSelection-C4Bcy0x9.js";import{c as Ne,s as Pe}from"./image-loading-ZB1bYt51.js";import{t as Fe}from"./ImageLoadingPlaceholder-trn5U_et.js";import{t as Ie}from"./LoadingImage-C4d5T4hV.js";import{n as Le}from"./textarea-BJ8C3aZh.js";import{c as Re}from"./sessionLookup-BBqXTJRj.js";import{t as ze}from"./vendor-motion-DtmZZeEm.js";import{i as Be,n as Ve,r as He}from"./assistant-attachment-cache-zu9sz4ex.js";import{a as Y,c as Ue,i as X,l as We,o as Ge,r as Ke,s as qe,t as Je}from"./AssistantSessionCard-CoCLydJP.js";var Z=C(),Q=e(p(),1),$=f();function Ye(e){let i=(0,Z.c)(12),{assistantID:a,position:o}=e,s=Q.useRef(null),c=Q.useRef(!1),l;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={busy:!1,done:!1,retryAt:0},i[0]=l):l=i[0];let u=Q.useRef(l),[d]=Q.useState(tt),f;i[1]!==a||i[2]!==o||i[3]!==d?(f=()=>{let e=s.current;if(!e||!c.current||u.current.busy||u.current.done||Date.now()<u.current.retryAt||d.transport!==t()||d.generation!==n()||document.visibilityState!==`visible`||(r()?!document.documentElement.classList.contains(`yuri-native-app-active`):!document.hasFocus())||e.parentElement?.closest(`[inert], [aria-hidden="true"]`))return;let i=e.closest(`[data-assistant-contact-transcript]`);if(!i||i.scrollHeight-i.scrollTop-i.clientHeight>2)return;let l=e.getBoundingClientRect(),f=i.getBoundingClientRect(),p=window.visualViewport,m=p?.offsetTop??0,h=m+(p?.height??window.innerHeight);l.height<=0||l.width<=0||l.bottom>Math.min(f.bottom,h)||l.top<Math.max(f.top,m)||l.right<=Math.max(f.left,0)||l.left>=Math.min(f.right,window.innerWidth)||(u.current.busy=!0,ce(a,o).then(()=>{u.current.done=!0}).catch(()=>{u.current.retryAt=Date.now()+15e3}).finally(()=>{u.current.busy=!1}))},i[1]=a,i[2]=o,i[3]=d,i[4]=f):f=i[4];let p=j(f),m;i[5]===p?m=i[6]:(m=e=>{c.current=e.some(et),p()},i[5]=p,i[6]=m);let h;i[7]===Symbol.for(`react.memo_cache_sentinel`)?(h={threshold:1},i[7]=h):h=i[7],E(s,j(m),h),D(`visibilitychange`,p,$e),D(`focus`,p,Qe),D(`resize`,p,Ze);let g,_;i[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>s.current?.closest(`[data-assistant-contact-transcript]`),_={passive:!0},i[8]=g,i[9]=_):(g=i[8],_=i[9]),D(`scroll`,p,g,_);let v;i[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={attributes:!0,attributeFilter:[`class`]},i[10]=v):v=i[10],A(p,Xe,v),k(p,15e3);let y;return i[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`span`,{ref:s,"aria-hidden":`true`,className:`absolute bottom-0 left-0 block h-px w-px`,"data-assistant-read-marker":``}),i[11]=y):y=i[11],y}function Xe(){return document.documentElement}function Ze(){return window.visualViewport}function Qe(){return window}function $e(){return document}function et(e){return e.isIntersecting&&e.intersectionRatio===1}function tt(){return{transport:t(),generation:n()}}var nt=()=>{},rt=Q.memo(K),it=e=>e?.directories.flatMap(({directory:e,sessions:t})=>e?t.filter(e=>!e.time.archived).map(t=>({...t,directory:e||t.location?.directory||t.directory||``})).filter(e=>e.directory.length>0):[])??null,at=Q.forwardRef(({query:e,isMobile:t,listId:n,onHighlightChange:r,onSelect:i,onClose:a},o)=>{let{t:s}=P(),c=Ne(),l=w({...L(c),select:it}),u=l.isPending,d=l.isError,f=Q.useMemo(()=>B({sessions:l.data??[],currentSessionId:null,searchQuery:e,limit:e.trim()?10:3}),[l.data,e]),[p,m]=Q.useState({query:e,index:0}),h=Math.min(p.query===e?p.index:0,Math.max(0,f.length-1)),g=Q.useRef(null),_=Q.useRef([]),v=Q.useMemo(Me,[]);D(`pointerdown`,e=>{e.target instanceof Node&&!g.current?.contains(e.target)&&a()},void 0,{capture:!0}),Q.useLayoutEffect(()=>{_.current[h]?.scrollIntoView?.({block:`nearest`})},[h]),Q.useLayoutEffect(()=>{r(f.length?`${n}-${h}`:void 0)},[h,n,f.length,r]);let y=j(t=>{if(t===`Escape`){a();return}f.length&&(t===`ArrowDown`&&m({query:e,index:(h+1)%f.length}),t===`ArrowUp`&&m({query:e,index:(h-1+f.length)%f.length}),(t===`Enter`||t===`Tab`)&&i(f[h]))});return Q.useImperativeHandle(o,()=>({keyDown:y}),[y]),(0,$.jsxs)(J,{ref:g,isMobile:t,className:`max-w-[640px] max-h-64`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-1`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 text-[length:calc(var(--text-meta)*0.875)] leading-4 text-muted-foreground`,children:s(`assistants.contact.sessionMention.scope`)}),(0,$.jsx)(F,{type:`button`,size:`xs`,variant:`ghost`,"aria-label":s(`dialog.common.actions.close`),onClick:a,children:(0,$.jsx)(W,{name:`close`,className:`size-4`})})]}),u?(0,$.jsx)(`p`,{role:`status`,className:`px-3 py-2 typography-meta text-muted-foreground`,children:s(`common.loading`)}):null,d?(0,$.jsxs)(`div`,{role:`alert`,className:`px-3 py-2 typography-meta text-[var(--status-error)]`,children:[s(`assistants.contact.sessionMention.loadFailed`),(0,$.jsx)(F,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{l.refetch()},children:s(`chat.history.retry`)})]}):null,l.isSuccess&&!u&&!d&&!f.length?(0,$.jsx)(`p`,{role:`status`,className:`px-3 py-2 typography-meta text-muted-foreground`,children:s(l.data===null?`common.unavailable`:`sessions.sidebar.empty.noMatches.title`)}):null,(0,$.jsx)(Le,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0`,children:(0,$.jsx)(`div`,{id:n,role:`listbox`,"aria-label":s(`chat.fileMentionAutocomplete.groups.sessions`),className:`p-1.5`,children:f.map((r,a)=>(0,$.jsxs)(`div`,{id:`${n}-${a}`,role:`option`,"aria-selected":a===h,ref:e=>{_.current[a]=e},className:I(`flex min-h-10 cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 typography-ui-label`,je(t,a===h)),onMouseDown:e=>e.preventDefault(),onMouseMove:()=>m({query:e,index:a}),onPointerDown:e=>{e.pointerType===`touch`&&v.pointerDown(e.clientX,e.clientY)},onPointerMove:e=>{e.pointerType===`touch`&&v.pointerMove(e.clientX,e.clientY)},onPointerUp:e=>{e.pointerType===`touch`&&v.pointerUp(()=>i(r))&&(e.preventDefault(),e.stopPropagation())},onPointerCancel:()=>v.pointerCancel(),onClick:()=>v.click(()=>i(r)),children:[(0,$.jsx)(W,{name:`chat-thread`,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium leading-5`,title:r.title,children:r.title||s(`chat.fileMentionAutocomplete.untitledSession`)}),(0,$.jsx)(`div`,{className:`truncate text-[length:calc(var(--text-meta)*0.875)] leading-4 text-muted-foreground`,title:r.directory,children:r.directory})]})]},JSON.stringify([r.directory,r.id])))})}),t?null:(0,$.jsx)(`div`,{className:`mx-1.5 shrink-0 border-t px-1.5 py-1 text-[length:calc(var(--text-meta)*0.875)] leading-4 text-muted-foreground`,children:s(`chat.autocomplete.keyboardHint`)})]})}),ot=e=>{let t=(0,Z.c)(122),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({active:n,onChange:r,onVoiceSend:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{t:o}=P(),s=Q.useRef(null),c=n&&!!a.isMobile&&!!i,l;t[5]===c?l=t[6]:(l={available:c},t[5]=c,t[6]=l);let{enabled:u,hint:d,onHintChange:f}=ke(l),p;t[7]!==d||t[8]!==a.placeholder||t[9]!==o?(p=d===null?a.placeholder:o(d===`recording`?`chat.dictation.releaseSend`:d===`cancelling`?`chat.dictation.releaseCancel`:d===`editing`?`chat.dictation.releaseEdit`:`chat.dictation.processing`),t[7]=d,t[8]=a.placeholder,t[9]=o,t[10]=p):p=t[10];let m=p,g;t[11]===a.value?g=t[12]:(g=()=>({canonical:a.value,document:x(a.value,new Map)}),t[11]=a.value,t[12]=g);let[C,w]=Q.useState(g),T;t[13]!==C.canonical||t[14]!==C.document||t[15]!==a.value?(T=C.canonical===a.value?C.document:x(a.value,new Map),t[13]=C.canonical,t[14]=C.document,t[15]=a.value,t[16]=T):T=t[16];let E=T,[D,O]=Q.useState(0),[k,A]=Q.useState(!0),[M,N]=Q.useState(!1),[ee,te]=Q.useState(),ne=Q.useRef(null),re=Q.useRef(null),ie=Q.useRef(null),ae=Q.useRef(null),oe;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(oe=Ce(),t[17]=oe):oe=t[17];let se=Q.useRef(oe),ce=Q.useId(),le;t[18]!==n||t[19]!==M||t[20]!==D||t[21]!==k||t[22]!==E.text||t[23]!==a.disabled||t[24]!==a.pending?(le=n&&!a.pending&&!a.disabled&&!k&&!M?Ae({text:E.text,cursor:D}):null,t[18]=n,t[19]=M,t[20]=D,t[21]=k,t[22]=E.text,t[23]=a.disabled,t[24]=a.pending,t[25]=le):le=t[25];let ue=le,F=ue?.kind===`mention`?ue:null,L;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{ae.current!==null&&(ne.current?.focus({preventScroll:!0}),ne.current?.setSelectionRange(ae.current,ae.current),ae.current=null)},t[26]=L):L=t[26];let de;t[27]===E?de=t[28]:(de=[E],t[27]=E,t[28]=de),Q.useLayoutEffect(L,de);let R;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>A(!0),t[29]=R):R=t[29];let z=j(R),fe;t[30]!==M||t[31]!==D||t[32]!==E||t[33]!==r?(fe=(e,t,n)=>{let i=n===void 0||n,a=h(e);a.ok&&(i&&(se.current=Te(se.current,{before:Ee(E,[],{start:ne.current?.selectionStart??D,end:ne.current?.selectionEnd??D}),after:Ee(e,[],{start:t,end:t})})),M||(ae.current=t),O(t),w({canonical:a.text,document:e}),r(a.text))},t[30]=M,t[31]=D,t[32]=E,t[33]=r,t[34]=fe):fe=t[34];let B=j(fe),pe;t[35]!==B||t[36]!==E||t[37]!==F||t[38]!==o?(pe=e=>{if(!F)return;let t=e.title||o(`chat.fileMentionAutocomplete.untitledSession`),n=y(E,F.tokenStart,F.tokenEnd,{id:`session:${e.id}:${crypto.randomUUID()}`,kind:`session`,sessionId:e.id,directory:e.directory,display:S({trigger:`@`,icon:`chat-thread`,label:t})},{inlineBoundaries:!0,padDocumentEdges:!0}),r=n.caret+ +(n.document.text[n.caret]===` `);A(!0),B(n.document,r)},t[35]=B,t[36]=E,t[37]=F,t[38]=o,t[39]=pe):pe=t[39];let me=j(pe),V;t[40]!==n||t[41]!==B||t[42]!==E||t[43]!==a.disabled||t[44]!==a.pending?(V=e=>{if(!n||a.pending||a.disabled||!e.trim())return;let t=E.text?`${E.text} ${e}`:e,r=b(E,t,t.length,t.length);B(r.document,r.caret),A(!0)},t[40]=n,t[41]=B,t[42]=E,t[43]=a.disabled,t[44]=a.pending,t[45]=V):V=t[45];let H=j(V),U;t[46]!==n||t[47]!==E.text||t[48]!==H||t[49]!==r||t[50]!==i||t[51]!==a.disabled||t[52]!==a.pending?(U=e=>{if(!(!n||a.pending||a.disabled||!e.trim())){if(E.text){H(e);return}r(e),i?.(e)}},t[46]=n,t[47]=E.text,t[48]=H,t[49]=r,t[50]=i,t[51]=a.disabled,t[52]=a.pending,t[53]=U):U=t[53];let he=j(U),W;t[54]!==B||t[55]!==E?(W=(e,t)=>{let n=e.currentTarget;if(n.selectionStart===n.selectionEnd||!e.clipboardData||!E.references.some(e=>e.start<n.selectionEnd&&e.end>n.selectionStart))return;let r=v(n.selectionStart,n.selectionEnd,E.references)??{start:n.selectionStart,end:n.selectionEnd},i=h({text:E.text.slice(r.start,r.end),references:E.references.filter(e=>e.start>=r.start&&e.end<=r.end).map(e=>({...e,start:e.start-r.start,end:e.end-r.start}))});if(i.ok&&(e.preventDefault(),e.clipboardData.setData(`text/plain`,i.text),t)){let e=b(E,E.text.slice(0,r.start)+E.text.slice(r.end),r.start,r.start);B(e.document,e.caret)}},t[54]=B,t[55]=E,t[56]=W):W=t[56];let G=j(W),ge;t[57]!==E.references||t[58]!==E.text?(ge=De(E.text,E.references.map(st))?.map(ct),t[57]=E.references,t[58]=E.text,t[59]=ge):ge=t[59];let _e=ge,ve=u&&E.text.length===0?`true`:void 0,K;t[60]!==u||t[61]!==H||t[62]!==a.disabled||t[63]!==a.pending||t[64]!==he||t[65]!==f?(K=u&&(0,$.jsx)(rt,{containerRef:s,disabled:!!(a.pending||a.disabled),onInsert:H,onSend:he,onRelease:nt,onHintChange:f}),t[60]=u,t[61]=H,t[62]=a.disabled,t[63]=a.pending,t[64]=he,t[65]=f,t[66]=K):K=t[66];let be=E.text,q=a.pending,we=n&&a.layout===`inline`,J;t[67]===a?J=t[68]:(J=()=>{a.pending||a.onSubmit()},t[67]=a,t[68]=J);let je=a.layout===`inline`?`py-3 leading-6`:`pt-4 pb-2`,Me=a.layout===`inline`&&a.isMobile&&`pl-2`,Ne;t[69]!==a.textLayoutClassName||t[70]!==je||t[71]!==Me?(Ne=I(`whitespace-pre-wrap break-words overflow-hidden px-3 typography-markdown md:typography-ui-label`,je,Me,a.textLayoutClassName),t[69]=a.textLayoutClassName,t[70]=je,t[71]=Me,t[72]=Ne):Ne=t[72];let Pe;t[73]!==B||t[74]!==E?(Pe=(e,t)=>{let n=b(E,e,t?.target.selectionStart??e.length,t?.target.selectionEnd??e.length);B(n.document,n.caret),A(t?.nativeEvent?.inputType===`insertFromPaste`)},t[73]=B,t[74]=E,t[75]=Pe):Pe=t[75];let Fe=F?ce:void 0,Ie=F?ee:void 0,Le;t[76]===a.textareaProps?Le=t[77]:(Le=e=>{a.textareaProps?.onScroll?.(e),re.current&&(re.current.scrollTop=e.currentTarget.scrollTop,re.current.scrollLeft=e.currentTarget.scrollLeft)},t[76]=a.textareaProps,t[77]=Le);let Re,ze;t[78]!==G||t[79]!==a.textareaProps?(Re=e=>{a.textareaProps?.onCopy?.(e),e.defaultPrevented||G(e,!1)},ze=e=>{a.textareaProps?.onCut?.(e),e.defaultPrevented||G(e,!0)},t[78]=G,t[79]=a.textareaProps,t[80]=Re,t[81]=ze):(Re=t[80],ze=t[81]);let Be;t[82]===a.textareaProps?Be=t[83]:(Be=e=>{O(e.currentTarget.selectionStart),a.textareaProps?.onSelect?.(e)},t[82]=a.textareaProps,t[83]=Be);let Ve,He;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=()=>{N(!0)},He=e=>{N(!1),O(e.currentTarget.selectionStart)},t[84]=Ve,t[85]=He):(Ve=t[84],He=t[85]);let Y;t[86]!==B||t[87]!==M||t[88]!==E||t[89]!==F||t[90]!==a.textareaProps?(Y=e=>{if(a.textareaProps?.onKeyDown?.(e),!(e.defaultPrevented||Oe(e))){if(M){e.key===`Enter`&&e.preventDefault();return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`z`){let t=e.shiftKey?Se(se.current,E):ye(se.current,E);t&&(e.preventDefault(),se.current=t.history,B(t.snapshot.document,t.snapshot.selection.end,!1),A(!0));return}if(e.key===`Backspace`||e.key===`Delete`){let t=_(E,{key:e.key,selectionStart:e.currentTarget.selectionStart,selectionEnd:e.currentTarget.selectionEnd,altKey:e.altKey});if(t){e.preventDefault(),B(t.document,t.caret),A(!0);return}}F&&[`ArrowDown`,`ArrowUp`,`Enter`,`Tab`,`Escape`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),ie.current?.keyDown(e.key))}},t[86]=B,t[87]=M,t[88]=E,t[89]=F,t[90]=a.textareaProps,t[91]=Y):Y=t[91];let Ue;t[92]!==a.textareaProps||t[93]!==Fe||t[94]!==Ie||t[95]!==Le||t[96]!==Re||t[97]!==ze||t[98]!==Be||t[99]!==Y?(Ue={...a.textareaProps,"aria-controls":Fe,"aria-activedescendant":Ie,"aria-autocomplete":`list`,onScroll:Le,onCopy:Re,onCut:ze,onSelect:Be,onCompositionStart:Ve,onCompositionEnd:He,onKeyDown:Y},t[92]=a.textareaProps,t[93]=Fe,t[94]=Ie,t[95]=Le,t[96]=Re,t[97]=ze,t[98]=Be,t[99]=Y,t[100]=Ue):Ue=t[100];let X;t[101]!==z||t[102]!==ce||t[103]!==F||t[104]!==a.isMobile||t[105]!==me?(X=F?(0,$.jsx)(at,{ref:ie,query:F.query,isMobile:a.isMobile??!1,listId:ce,onHighlightChange:te,onSelect:me,onClose:z}):null,t[101]=z,t[102]=ce,t[103]=F,t[104]=a.isMobile,t[105]=me,t[106]=X):X=t[106];let We;t[107]!==E.text||t[108]!==_e||t[109]!==m||t[110]!==a||t[111]!==we||t[112]!==J||t[113]!==Ne||t[114]!==Pe||t[115]!==Ue||t[116]!==X?(We=(0,$.jsx)(xe,{...a,value:be,pending:q,animateResize:we,placeholder:m,disableInputWhilePending:!1,inputRef:ne,onSubmit:J,highlightedContent:_e,highlightRef:re,textLayoutClassName:Ne,onChange:Pe,textareaProps:Ue,children:X}),t[107]=E.text,t[108]=_e,t[109]=m,t[110]=a,t[111]=we,t[112]=J,t[113]=Ne,t[114]=Pe,t[115]=Ue,t[116]=X,t[117]=We):We=t[117];let Ge;return t[118]!==ve||t[119]!==K||t[120]!==We?(Ge=(0,$.jsxs)(`div`,{ref:s,className:`yuri-hold-to-talk-container`,"data-hold-to-talk-empty":ve,children:[K,We]}),t[118]=ve,t[119]=K,t[120]=We,t[121]=Ge):Ge=t[121],Ge};function st(e){return{start:e.start,end:e.end,priority:103,...g(e)}}function ct(e,t){return(0,$.jsx)(`span`,{className:e.className,children:e.visual?(0,$.jsx)(q,{visual:e.visual,text:e.text}):e.text},`${t}-${e.text.length}`)}var lt=`rounded-[var(--contact-bubble-radius,1.125rem)] border border-border/40 cursor-zoom-in`;function ut({assistantID:e,descriptor:t,onShowPopup:n}){let{t:r}=P(),i=Ne(),{attachmentID:a,sha256:o,size:s,mime:c,filename:l}=t,u=Q.useMemo(()=>({type:`file`,attachmentID:a,sha256:o,size:s,mime:c,filename:l}),[a,o,s,c,l]),d=c.startsWith(`image/`),f=_e(l??``,c),[p,m]=Q.useState(0),[h,g]=Q.useState(``),[_,v]=Q.useState(!1),[y,b]=Q.useState(!1),x=Q.useRef(null),S=Q.useRef([]);Q.useEffect(()=>{g(``),v(!1);let t=new AbortController,n;return d&&He(e,u,{signal:t.signal}).then(e=>{if(t.signal.aborted){e.release();return}n=e.release,g(e.url)}).catch(()=>{t.signal.aborted||v(!0)}),()=>{t.abort(),n?.()}},[e,u,i,d,p]),Q.useEffect(()=>()=>{x.current?.abort(),S.current.forEach(e=>URL.revokeObjectURL(e)),S.current=[]},[e,u,i]);let C=j(async(t=!1)=>{if(x.current)return;let i=new AbortController;x.current=i,b(!0),v(!1);try{let a=await Ve(e,u,{signal:i.signal});if(i.signal.aborted)return;S.current.forEach(e=>URL.revokeObjectURL(e));let o=URL.createObjectURL(a);if(S.current=[o],t&&n){n({open:!0,title:l||r(`assistants.contact.attachment.file`),content:``,video:{url:o,mimeType:c,filename:l}});return}let s=document.createElement(`a`);s.href=o,s.download=l||r(`assistants.contact.attachment.file`),document.body.appendChild(s),s.click(),s.remove()}catch{i.signal.aborted||v(!0)}finally{x.current===i&&(x.current=null),i.signal.aborted||b(!1)}}),w=l||r(d?`assistants.contact.attachment.image`:`assistants.contact.attachment.file`),T=j(e=>{!n||!h||n({open:!0,title:w,content:``,metadata:{tool:`image-preview`,filename:w,mime:c},previewSource:e.currentTarget,image:{url:h,mimeType:c,filename:w,size:s,gallery:[{url:h,mimeType:c,filename:w,size:s}],index:0}})});return d&&h&&!_?(0,$.jsx)(Ie,{src:h,alt:w,contentFrame:!0,className:lt,onError:()=>v(!0),onClick:T,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(e))},role:`button`,tabIndex:0,"data-assistant-contact-image":``}):d&&!_?(0,$.jsx)(Fe,{className:`h-[var(--yuri-content-image-height)] w-[min(20rem,100%)] rounded-[var(--contact-bubble-radius,1.125rem)]`}):(0,$.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1 rounded-[1.25rem] bg-[var(--surface-muted)] px-3.5 py-2.5 ring-1 ring-inset ring-[var(--surface-subtle)]`,"data-assistant-contact-file":``,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,$.jsx)(W,{name:`file-text`,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate typography-ui`,children:w})]}),_?(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:r(`assistants.contact.attachment.loadFailed`)}):null,d&&!_||y?(0,$.jsx)(`span`,{role:`status`,className:`typography-micro text-muted-foreground`,children:r(`common.loading`)}):(0,$.jsx)(F,{type:`button`,size:`sm`,variant:`ghost`,onClick:d?()=>m(e=>e+1):()=>void C(f&&!!n),children:r(_?`chat.history.retry`:f&&n?`contextPanel.mode.preview`:`assistants.contact.attachment.download`)})]})}function dt(e){let t=(0,Z.c)(39),{part:n,onShowPopup:r}=e,{t:i}=P(),a=/^(?:https?:|data:|blob:)/i.test(n.url)?n.url:``,o=Pe(a,``),[s,c]=Q.useState(!1),l;t[0]!==n.filename||t[1]!==i?(l=n.filename||i(`assistants.contact.attachment.image`),t[0]=n.filename,t[1]=i,t[2]=l):l=t[2];let u=l,d;t[3]!==u||t[4]!==r||t[5]!==o?(d=e=>{!r||!o||r({open:!0,title:u,content:``,metadata:{tool:`image-preview`,filename:u},previewSource:e.currentTarget,image:{url:o,filename:u,gallery:[{url:o,filename:u}],index:0}})},t[3]=u,t[4]=r,t[5]=o,t[6]=d):d=t[6];let f=j(d);if(_e(a,n.mime)&&a&&r){let e;t[7]!==r||t[8]!==n.filename||t[9]!==n.mime||t[10]!==a||t[11]!==i?(e=()=>r({open:!0,title:n.filename||i(`assistants.contact.attachment.file`),content:``,video:{url:a,filename:n.filename,mimeType:n.mime}}),t[7]=r,t[8]=n.filename,t[9]=n.mime,t[10]=a,t[11]=i,t[12]=e):e=t[12];let o;t[13]!==n.filename||t[14]!==i?(o=n.filename||i(`contextPanel.mode.preview`),t[13]=n.filename,t[14]=i,t[15]=o):o=t[15];let s;return t[16]!==e||t[17]!==o?(s=(0,$.jsx)(F,{variant:`secondary`,size:`sm`,onClick:e,children:o}),t[16]=e,t[17]=o,t[18]=s):s=t[18],s}if(n.mime.startsWith(`image/`)&&o&&!s){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>c(!0),t[19]=e):e=t[19];let n;t[20]===f?n=t[21]:(n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(e))},t[20]=f,t[21]=n);let r;return t[22]!==u||t[23]!==f||t[24]!==o||t[25]!==n?(r=(0,$.jsx)(Ie,{src:o,alt:u,contentFrame:!0,className:lt,onError:e,onClick:f,onKeyDown:n,role:`button`,tabIndex:0,"data-assistant-contact-image":``}),t[22]=u,t[23]=f,t[24]=o,t[25]=n,t[26]=r):r=t[26],r}let p;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(W,{name:`file-text`,className:`size-4 shrink-0 text-muted-foreground`}),t[27]=p):p=t[27];let m;t[28]!==n.filename||t[29]!==i?(m=n.filename||i(`assistants.contact.attachment.file`),t[28]=n.filename,t[29]=i,t[30]=m):m=t[30];let h;t[31]===m?h=t[32]:(h=(0,$.jsx)(`span`,{className:`truncate typography-ui`,children:m}),t[31]=m,t[32]=h);let g;t[33]!==s||t[34]!==i?(g=s?(0,$.jsx)(F,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>c(!1),children:i(`chat.history.retry`)}):null,t[33]=s,t[34]=i,t[35]=g):g=t[35];let _;return t[36]!==h||t[37]!==g?(_=(0,$.jsxs)(`div`,{className:`flex max-w-full items-center gap-2.5 rounded-[1.25rem] bg-[var(--surface-muted)] px-3.5 py-2.5`,"data-assistant-contact-file":``,children:[p,h,g]}),t[36]=h,t[37]=g,t[38]=_):_=t[38],_}function ft(e){let t=(0,Z.c)(5),{assistantID:n,part:r,onShowPopup:i}=e,a=Ne(),o;return t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==a?(o=`attachmentID`in r?(0,$.jsx)(ut,{assistantID:n,descriptor:r,onShowPopup:i},`${a}:${n}:${r.attachmentID}:${r.sha256}`):(0,$.jsx)(dt,{part:r,onShowPopup:i},`${a}:${r.url}`),t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=o):o=t[4],o}var pt=Q.memo(e=>{let t=(0,Z.c)(32),{turn:n,retryDisabled:r,onRetry:i}=e,{t:a}=P(),f;t[0]===a?f=t[1]:(f=a(`assistants.contact.sendError.viewDetails`),t[0]=a,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(W,{name:`exclamation-fill`,className:`size-[18px] text-[var(--status-error)]`,"data-assistant-contact-error-dot":``}),t[2]=p):p=t[2];let h;t[3]===f?h=t[4]:(h=(0,$.jsx)(m,{type:`button`,"aria-label":f,"data-assistant-contact-send-error":``,className:`absolute right-full top-1/2 mr-1.5 flex size-9 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0 shadow-none outline-none focus-visible:opacity-70`,children:p}),t[3]=f,t[4]=h);let g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g={side:`flip`,align:`shift`,fallbackAxisSide:`end`},t[5]=g):g=t[5];let _;t[6]===a?_=t[7]:(_=a(`assistants.contact.sendError.title`),t[6]=a,t[7]=_);let v;t[8]===_?v=t[9]:(v=(0,$.jsx)(s,{className:`typography-ui-label font-medium`,children:_}),t[8]=_,t[9]=v);let y;t[10]!==a||t[11]!==n.error?(y=n.error||a(`assistants.contact.sendFailed`),t[10]=a,t[11]=n.error,t[12]=y):y=t[12];let b;t[13]===y?b=t[14]:(b=(0,$.jsx)(u,{role:`alert`,className:`mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap typography-meta leading-relaxed [overflow-wrap:anywhere]`,children:y}),t[13]=y,t[14]=b);let x;t[15]!==i||t[16]!==n.messageID?(x=()=>i(n.messageID),t[15]=i,t[16]=n.messageID,t[17]=x):x=t[17];let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(W,{name:`refresh`,className:`size-3`}),t[18]=S):S=t[18];let C;t[19]===a?C=t[20]:(C=a(`chat.history.retry`),t[19]=a,t[20]=C);let w;t[21]!==r||t[22]!==C||t[23]!==x?(w=(0,$.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,$.jsxs)(F,{type:`button`,size:`xs`,disabled:r,onClick:x,children:[S,C]})}),t[21]=r,t[22]=C,t[23]=x,t[24]=w):w=t[24];let T;t[25]!==w||t[26]!==v||t[27]!==b?(T=(0,$.jsx)(d,{children:(0,$.jsx)(l,{side:`left`,align:`center`,sideOffset:6,collisionPadding:12,collisionAvoidance:g,className:`z-50`,children:(0,$.jsxs)(c,{className:`yuri-mobile-overlay-surface w-72 max-w-[calc(100vw-2rem)] rounded-xl p-4 text-foreground outline-none`,"data-assistant-contact-send-error-popup":``,children:[v,b,w]})})}),t[25]=w,t[26]=v,t[27]=b,t[28]=T):T=t[28];let E;return t[29]!==T||t[30]!==h?(E=(0,$.jsxs)(o,{children:[h,T]}),t[29]=T,t[30]=h,t[31]=E):E=t[31],E});function mt(e){let t=(0,Z.c)(7),{children:n,failedTurn:r,retryDisabled:i,onRetry:a}=e,o;t[0]!==r||t[1]!==a||t[2]!==i?(o=r?.status===`failed`?(0,$.jsx)(pt,{turn:r,retryDisabled:i,onRetry:a}):null,t[0]=r,t[1]=a,t[2]=i,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==o?(s=(0,$.jsxs)(`div`,{className:`relative min-w-0 max-w-full`,"data-assistant-contact-user-part":``,children:[n,o]}),t[4]=n,t[5]=o,t[6]=s):s=t[6],s}function ht(e){let t=(0,Z.c)(38),{children:n,outgoing:r,joinedBefore:i,joinedAfter:a,createdAt:o,time:s,media:c,mobile:l,hidden:u,colors:d,label:f}=e,p=Q.useRef(null),m=Q.useRef(null),h=Q.useRef(null),g;t[0]!==a||t[1]!==c||t[2]!==r?(g=()=>{let e=p.current,t=m.current,n=h.current;if(!e||!t||!n||c)return;let{width:i,height:o}=e.getBoundingClientRect();if(!i||!o)return;let s=window.getComputedStyle(e),l=e=>Math.min(Number.parseFloat(e)||0,i/2,o/2),u=l(s.borderTopLeftRadius),d=l(s.borderTopRightRadius),f=l(s.borderBottomLeftRadius),g=l(s.borderBottomRightRadius),_=8+i,v=r&&!a?`V ${o-10} C ${_} ${o-5} ${_+3} ${o-1} ${_+8} ${o}`:`V ${o-g} A ${g} ${g} 0 0 1 ${_-g} ${o}`,y=!r&&!a?`H 0 C 5 ${o-1} 8 ${o-5} 8 ${o-10}`:`H ${8+f} A ${f} ${f} 0 0 1 8 ${o-f}`;t.setAttribute(`viewBox`,`0 0 ${i+16} ${o}`),n.setAttribute(`d`,`M ${8+u} 0 H ${_-d} A ${d} ${d} 0 0 1 ${_} ${d} ${v} ${y} V ${u} A ${u} ${u} 0 0 1 ${8+u} 0 Z`)},t[0]=a,t[1]=c,t[2]=r,t[3]=g):g=t[3];let _=j(g),v;t[4]===_?v=t[5]:(v=()=>{_()},t[4]=_,t[5]=v);let y;t[6]!==_||t[7]!==a||t[8]!==i||t[9]!==c||t[10]!==l||t[11]!==r?(y=[r,i,a,l,c,_],t[6]=_,t[7]=a,t[8]=i,t[9]=c,t[10]=l,t[11]=r,t[12]=y):y=t[12],Q.useLayoutEffect(v,y),O(typeof ResizeObserver<`u`&&!c?p:null,_);let b=c||void 0,x=r?`outgoing`:`incoming`,S=i||void 0,C=a||void 0,w=l&&!c&&`touch-manipulation [-webkit-user-select:all] [user-select:all]`,T;t[13]===w?T=t[14]:(T=I(`yuri-contact-bubble min-w-0 max-w-full [overflow-wrap:anywhere]`,w),t[13]=w,t[14]=T);let E=d?.background,D=d?.foreground,k=u?`hidden`:void 0,A;t[15]!==E||t[16]!==D||t[17]!==k?(A={"--contact-bubble-fill":E,color:D,visibility:k},t[15]=E,t[16]=D,t[17]=k,t[18]=A):A=t[18];let M=A,N;t[19]===c?N=t[20]:(N=c?null:(0,$.jsx)(`svg`,{ref:m,className:`yuri-contact-bubble-outline`,"aria-hidden":`true`,preserveAspectRatio:`none`,children:(0,$.jsx)(`path`,{ref:h})}),t[19]=c,t[20]=N);let ee;t[21]===n?ee=t[22]:(ee=(0,$.jsx)(`div`,{className:`yuri-contact-bubble-body`,"data-assistant-contact-body":``,children:n}),t[21]=n,t[22]=ee);let P;t[23]!==o||t[24]!==c||t[25]!==s?(P=c?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`yuri-contact-bubble-time-space`,children:s}),(0,$.jsx)(`time`,{className:`yuri-contact-bubble-time`,dateTime:new Date(o).toISOString(),children:s})]}),t[23]=o,t[24]=c,t[25]=s,t[26]=P):P=t[26];let te;return t[27]!==f||t[28]!==M||t[29]!==N||t[30]!==ee||t[31]!==P||t[32]!==b||t[33]!==x||t[34]!==S||t[35]!==C||t[36]!==T?(te=(0,$.jsxs)(`div`,{ref:p,"aria-label":f,"data-assistant-contact-text":``,"data-assistant-contact-media":b,"data-contact-bubble-direction":x,"data-contact-bubble-joined-before":S,"data-contact-bubble-joined-after":C,className:T,style:M,children:[N,ee,P]}),t[27]=f,t[28]=M,t[29]=N,t[30]=ee,t[31]=P,t[32]=b,t[33]=x,t[34]=S,t[35]=C,t[36]=T,t[37]=te):te=t[37],te}var gt=[],_t=e=>e.flatMap(e=>e.type===`text`&&e.text.trim()?[e.text]:[]).join(`
|
|
3
|
+
`),vt=(e,t,n,r=Date.now())=>({assistantID:e,messageID:t,parts:n,status:`sending`,createdAt:r}),yt=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},bt=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},xt=(e,t,n,r)=>({messageID:t?`${e.turnID}:preview:${t.bubbleIndex}`:`${e.turnID}:preview:${r}`,assistantID:e.assistantID,role:`assistant`,turnID:e.turnID,bubbleIndex:t?.bubbleIndex??0,createdAt:t?.occurredAt??e.occurredAt,ordinal:n,status:r,fromAssistantID:null,fromAssistantName:null,parts:t?[{type:`text`,text:t.text}]:[],text:t?.text??``,cards:[]}),St=(e,t,n)=>{let r=e.bubbles.filter(e=>!t.has(e.bubbleIndex)).map((t,r)=>xt(e,t,n+r,t.done?`complete`:`streaming`));return e.status===`failed`?[...r,xt(e,null,n+r.length,`failed`)]:e.status===`admitted`||e.status===`streaming`?[...r,xt(e,null,n+r.length,`admitted`)]:r},Ct=(e,t,n,r=[])=>{let i=new Set(e.map(e=>e.messageID)),a=t.flatMap((t,r)=>t.assistantID!==n||i.has(t.messageID)?[]:[{messageID:t.messageID,assistantID:n,role:`user`,turnID:t.messageID,bubbleIndex:0,createdAt:t.createdAt,ordinal:e.length+r,status:t.status,fromAssistantID:null,fromAssistantName:null,parts:[...t.parts],text:_t(t.parts),cards:[]}]),o=a.length===0?e:[...e,...a],s=r.filter(e=>e.assistantID===n);if(s.length===0)return o;let c=new Map,l=new Map;o.forEach((e,t)=>{if(c.set(e.turnID,t),e.role!==`assistant`||e.messageID.includes(`:preview:`))return;let n=l.get(e.turnID)??new Set;n.add(e.bubbleIndex),l.set(e.turnID,n)});let u=new Map,d=[];for(let e of s){let t=St(e,l.get(e.turnID)??new Set,o.length+d.length);if(t.length===0)continue;let n=c.get(e.turnID);if(n===void 0){if(e.status===`failed`&&o.some(t=>t.turnID!==e.turnID))continue;d.push(...t);continue}let r=u.get(n)??[];r.push(...t),u.set(n,r)}return u.size===0&&d.length===0?o:o.flatMap((e,t)=>[e,...u.get(t)??[]]).concat(d)},wt=(e,t)=>{let n=new Set(t.map(e=>e.messageID)),r=e.filter(e=>!n.has(e.messageID));return r.length===e.length?e:r},Tt=(e,t)=>e.map(e=>e.messageID===t?{...e,status:`admitted`}:e),Et=(e,t,n,r=Date.now())=>{let i=e.filter(e=>e.assistantID!==t||e.status!==`failed`||e.turnID===n);return i.some(e=>e.assistantID===t&&e.turnID===n)?i.length===e.length?e:i:[...i,{assistantID:t,turnID:n,status:`admitted`,bubbles:[],occurredAt:r}]},Dt=(e,t,n)=>!t?.turnID||!t.assistantID||n?.has(t.turnID)?e:Et(e,t.assistantID,t.turnID,t.admittedAt),Ot=(e,t)=>{let n=t.assistantID,r=t.pendingSendTurnIDs??new Set,i=t.settledTurnIDs??new Set,a=typeof t.snapshotRevision==`number`&&Number.isFinite(t.snapshotRevision)?t.snapshotRevision:null,o=t.admissionRevisionByTurnID instanceof Map?t.admissionRevisionByTurnID:new Map(Object.entries(t.admissionRevisionByTurnID??{}).map(([e,t])=>[e,Number(t)])),s=t.occurredAt??Date.now(),c=t.activeContactTurn&&t.activeContactTurn.turnID?t.activeContactTurn:null,l=!!(t.serverWorking||c),u=Dt(e,c?{assistantID:n,turnID:c.turnID,admittedAt:c.admittedAt}:null,i),d=Array.isArray(t.messages)?t.messages:[];for(let e of d)e.role===`assistant`&&e.status===`error`&&(r.has(e.turnID)||i.has(e.turnID)||(u=At(u,{assistantID:n,turnID:e.turnID,status:`error`,error:e.text||`upstream_error`,occurredAt:s})));if(u=jt(u,d),l){let t=u.filter(e=>{if(e.assistantID!==n||e.status!==`admitted`&&e.status!==`streaming`||r.has(e.turnID)||c&&e.turnID===c.turnID)return!0;let t=o.get(e.turnID);return typeof t==`number`&&a!=null&&a<t?!0:typeof t==`number`&&a!=null&&a>=t&&e.turnID!==c?.turnID?!1:!c||e.turnID===c.turnID});return t.length===e.length&&t.every((t,n)=>t===e[n])?e:t}if(a==null)return u.length===e.length&&u.every((t,n)=>t===e[n])?e:u;let f=u.filter(e=>{if(e.assistantID!==n||e.status!==`admitted`&&e.status!==`streaming`||r.has(e.turnID))return!0;if(i.has(e.turnID))return!1;let t=o.get(e.turnID);return typeof t==`number`&&a<t});return f.length===e.length&&f.every((t,n)=>t===e[n])?e:f.length===u.length?u:f},kt=(e,t)=>Et(e,t.assistantID,t.turnID,t.occurredAt).map(e=>{if(e.assistantID!==t.assistantID||e.turnID!==t.turnID||e.status===`failed`||e.status===`complete`)return e;let n=e.bubbles.find(e=>e.bubbleIndex===t.bubbleIndex);if(n?.done)return e;let r=n?{...n,text:`${n.text}${t.delta}`,done:t.done,occurredAt:t.occurredAt}:{bubbleIndex:t.bubbleIndex,text:t.delta,done:t.done,occurredAt:t.occurredAt},i=n?e.bubbles.map(e=>e.bubbleIndex===t.bubbleIndex?r:e):[...e.bubbles,r].sort((e,t)=>e.bubbleIndex-t.bubbleIndex);return{...e,status:`streaming`,bubbles:i}}),At=(e,t,n={})=>n.requireExisting&&!e.some(e=>e.assistantID===t.assistantID&&e.turnID===t.turnID)?e:Et(e,t.assistantID,t.turnID,t.occurredAt).map(e=>e.assistantID!==t.assistantID||e.turnID!==t.turnID||e.status===`complete`||e.status===`failed`?e:{...e,status:t.status===`error`?`failed`:`complete`,...t.error?{error:t.error}:{}}),jt=(e,t)=>{let n=new Set(t.map(e=>e.turnID).filter(Boolean)),r=t.length>0?t[t.length-1]?.turnID??null:null,i=[...e].reverse().find(e=>e.status===`admitted`||e.status===`streaming`)?.turnID??r,a=new Set(t.flatMap(e=>e.role===`assistant`?[e.turnID]:[])),o=e.filter(e=>e.status===`admitted`||e.status===`streaming`||!(e.status===`complete`&&a.has(e.turnID)||!n.has(e.turnID)||e.status===`failed`&&(i&&i!==e.turnID||r&&r!==e.turnID)));return o.length===e.length?e:o},Mt=(e,t,n)=>e.map(e=>e.messageID===t?{...e,status:`failed`,error:n}:e),Nt=(e,t)=>e instanceof oe?e.code===`no_provider`?t.noProvider:e.code===`admission_timeout`||e.code===`generate_timeout`?t.timedOut:e.message&&e.message!==e.code?e.message:`${t.sendFailed}\n\n${e.code} (HTTP ${e.status})`:te(e)?t.timedOut:e instanceof Error&&e.message.trim()?e.message:t.sendFailed,Pt=()=>{let e=!1;return{tryAcquire:()=>!e&&(e=!0,!0),release:()=>{e=!1}}},Ft=e=>{let t=e.text.trim();if(e.sending||!t&&e.attachments.length===0||!e.gate.tryAcquire())return{ok:!1};let n=[...t?[{type:`text`,text:t}]:[],...e.attachments.map(e=>({type:`file`,mime:e.mime,url:e.url,filename:e.name}))],r=e.createMessageID();return{ok:!0,messageID:r,parts:n,turn:vt(e.assistantID,r,n,e.createdAt)}},It=e=>e.some(e=>e.status===`sending`),Lt=e=>e.some(e=>e.status===`admitted`||e.status===`streaming`),Rt=a(e=>({workingByID:{},setWorking:(t,n)=>e(e=>({workingByID:{...e.workingByID,[t]:n}}))})),zt=({sending:e=!1,processing:t=!1,serverWorking:n=!1})=>e||t||n,Bt=(e,t)=>{let n=(0,Z.c)(5),r=t!==void 0&&t,i;n[0]===e?i=n[1]:(i=t=>!!t.workingByID[e],n[0]=e,n[1]=i);let a=Rt(i),o;return n[2]!==a||n[3]!==r?(o=zt({processing:a,serverWorking:r}),n[2]=a,n[3]=r,n[4]=o):o=n[4],o},Vt=e=>{let t=(0,Z.c)(25),{name:n,avatarSeed:r,size:i,label:a,working:o,showWorkingDot:s,className:c,hoverTarget:l,followPointer:u,blinkOnMount:d}=e,f=i===void 0?24:i,p=s===void 0||s,m=d===void 0||d,{t:h}=P(),g;t[0]!==n||t[1]!==o?(g=e=>o!==void 0&&!!e.workingByID[n],t[0]=n,t[1]=o,t[2]=g):g=t[2];let _=Rt(g),v=!!(o||_),y=`calc(${f}px * var(--dpt-n, 1))`,b;t[3]===c?b=t[4]:(b=I(`relative inline-block shrink-0 align-middle leading-none`,c),t[3]=c,t[4]=b);let x;t[5]===y?x=t[6]:(x={width:y,minWidth:y,maxWidth:y,height:y,minHeight:y,maxHeight:y},t[5]=y,t[6]=x);let S=o===void 0?void 0:v?`working`:`idle`,C=r??n,w;t[7]!==m||t[8]!==u||t[9]!==l||t[10]!==a||t[11]!==n||t[12]!==f||t[13]!==S||t[14]!==C?(w=(0,$.jsx)(V,{kind:`assistant`,motion:S,name:C,size:f,label:a,hoverTarget:l,followPointer:u,animationKey:n,blinkOnMount:m}),t[7]=m,t[8]=u,t[9]=l,t[10]=a,t[11]=n,t[12]=f,t[13]=S,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==p||t[17]!==h||t[18]!==o?(T=o&&p?(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-0 bottom-0 size-2.5 translate-x-0.5 translate-y-0.5 rounded-full bg-[var(--status-success)] ring-2 ring-background`,"data-assistant-working-dot":``,"aria-label":h(`assistants.contact.working`)}):null,t[16]=p,t[17]=h,t[18]=o,t[19]=T):T=t[19];let E;return t[20]!==T||t[21]!==b||t[22]!==x||t[23]!==w?(E=(0,$.jsxs)(`span`,{className:b,style:x,"data-assistant-working-avatar":``,children:[w,T]}),t[20]=T,t[21]=b,t[22]=x,t[23]=w,t[24]=E):E=t[24],E},Ht=e=>{let t=(0,Z.c)(36),{card:n,assistant:r,active:a}=e,o=a===void 0||a,{t:s}=P(),c=Re(),l;t[0]===c?l=t[1]:(l=c&&!i(),t[0]=c,t[1]=l);let u=!!l,d=n.name,f=`${n.providerID}/${n.modelID}`,p=Q.useContext(Ue),m;t[2]!==n.assistantID||t[3]!==u||t[4]!==p?(m=()=>{if(p)return p({assistantID:n.assistantID});if(u){de.getState().openAssistant(n.assistantID);return}R(n.assistantID)},t[2]=n.assistantID,t[3]=u,t[4]=p,t[5]=m):m=t[5];let h=j(m),g;t[6]===h?g=t[7]:(g=e=>{qe(e,h)},t[6]=h,t[7]=g);let _=j(g),v;t[8]!==s||t[9]!==d?(v=s(`assistants.contact.card.assistant.aria`,{name:d}),t[8]=s,t[9]=d,t[10]=v):v=t[10];let y=r?.avatarSeed,b=o?!!(r?.working||r?.activeContactTurn):void 0,x;t[11]!==n.assistantID||t[12]!==y||t[13]!==b?(x=(0,$.jsx)(`span`,{className:`relative inline-block shrink-0 leading-none`,"aria-hidden":!0,children:(0,$.jsx)(Vt,{name:n.assistantID,avatarSeed:y,size:32,working:b,showWorkingDot:!1,followPointer:!1})}),t[11]=n.assistantID,t[12]=y,t[13]=b,t[14]=x):x=t[14];let S;t[15]===s?S=t[16]:(S=s(`assistants.contact.card.assistant.label`),t[15]=s,t[16]=S);let C;t[17]===S?C=t[18]:(C=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-[0.8em] leading-4 text-muted-foreground`,children:S}),t[17]=S,t[18]=C);let w;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(W,{name:`arrow-right-s`,weight:`medium`,className:`ml-auto size-4 shrink-0 text-muted-foreground`}),t[19]=w):w=t[19];let T;t[20]!==C||t[21]!==x?(T=(0,$.jsxs)(`div`,{className:Y,children:[x,C,w]}),t[20]=C,t[21]=x,t[22]=T):T=t[22];let E;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(E=I(Ge,`row-span-2 self-center`),t[23]=E):E=t[23];let D;t[24]===d?D=t[25]:(D=(0,$.jsx)(`h3`,{className:E,title:d,children:d}),t[24]=d,t[25]=D);let O;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(O=I(X,`justify-end pb-1`),t[26]=O):O=t[26];let k;t[27]===f?k=t[28]:(k=(0,$.jsx)(`div`,{className:O,children:(0,$.jsx)(`div`,{className:`flex h-4 min-w-0 items-center`,children:(0,$.jsx)(We,{value:f})})}),t[27]=f,t[28]=k);let A;return t[29]!==_||t[30]!==h||t[31]!==T||t[32]!==D||t[33]!==k||t[34]!==v?(A=(0,$.jsxs)(`article`,{className:Ke,role:`button`,tabIndex:0,"aria-label":v,"data-assistant-contact-card":`assistant`,onClick:h,onKeyDown:_,children:[T,D,k]}),t[29]=_,t[30]=h,t[31]=T,t[32]=D,t[33]=k,t[34]=v,t[35]=A):A=t[35],A},Ut=e=>!!(e&&typeof e==`object`&&!Array.isArray(e)),Wt=e=>typeof e==`string`&&/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Gt=e=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=6,Kt=e=>e.kind===`cron`?e.cron===void 0:e.kind===`once`?e.date===void 0:e.kind===`weekly`?e.times===void 0||e.weekdays===void 0:e.kind===`daily`&&e.times===void 0,qt=e=>{if(!Ut(e)||e.timezone!==void 0&&typeof e.timezone!=`string`)return!1;if(e.kind===`cron`)return typeof e.cron==`string`&&!!e.cron.trim();if(e.kind===`once`)return typeof e.date==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(e.date)&&Wt(e.time);let t=Array.isArray(e.times)&&e.times.length>0&&e.times.every(Wt);return e.kind===`daily`?t||Wt(e.time):e.kind===`weekly`&&(t||Wt(e.time))&&Array.isArray(e.weekdays)&&e.weekdays.length>0&&e.weekdays.every(Gt)},Jt=(e,t)=>{if(!Kt(e)||!qt(t?.schedule))return e;let n=t.schedule;return{...e,kind:n.kind,time:n.time??n.times?.[0]??null,timezone:n.timezone??e.timezone,cron:n.cron??null,date:n.date??null,times:n.times??null,weekdays:n.weekdays??null}},Yt=(e,t)=>{let n=e.kind===`daily`||e.kind===`weekly`||e.kind===`once`||e.kind===`cron`?t(`sessions.scheduledTasks.editor.scheduleType.${e.kind}`):e.kind||``,r=[...new Set((e.times?.length?e.times:e.time?[e.time]:[]).filter(Wt))].sort(),i=r.join(`, `),a=n,o=r.length===1;if(e.kind===`cron`)i=e.cron?.trim()||n,a=e.cron?.trim()?n:``,o=!1;else if(e.kind===`once`)i=[e.date?.trim(),i].filter(Boolean).join(` `),o=!1;else if(e.kind===`weekly`&&e.weekdays?.length){let n=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`];a=[...new Set(e.weekdays.filter(Gt))].sort((e,t)=>e-t).map(e=>t(`sessions.scheduledTasks.dialog.schedule.weekdayShort.${n[e]}`)).join(`, `)}return{value:i||t(`assistants.contact.card.schedule.timeUnavailable`),cadence:a,clock:o,timezone:e.timezone}},Xt=e=>{let t=(0,Z.c)(44),{card:n,task:r}=e,{t:i}=P(),a=n.name,o;t[0]!==n||t[1]!==i||t[2]!==r?(o=Yt(Jt(n,r),i),t[0]=n,t[1]=i,t[2]=r,t[3]=o):o=t[3];let s=o,c;t[4]===n.prompt?c=t[5]:(c=n.prompt?.trim(),t[4]=n.prompt,t[5]=c);let l=c,u=Q.useContext(Ue),d;t[6]!==n.projectID||t[7]!==n.taskID||t[8]!==u?(d=()=>{if(u)return u({projectID:n.projectID,taskID:n.taskID});G(n.projectID,n.taskID)},t[6]=n.projectID,t[7]=n.taskID,t[8]=u,t[9]=d):d=t[9];let f=j(d),p;t[10]===f?p=t[11]:(p=e=>{qe(e,f)},t[10]=f,t[11]=p);let m=j(p),h;t[12]!==i||t[13]!==a?(h=i(`assistants.contact.card.schedule.aria`,{name:a}),t[12]=i,t[13]=a,t[14]=h):h=t[14];let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(W,{name:`calendar`,weight:`medium`,className:`size-4 shrink-0`}),t[15]=g):g=t[15];let _;t[16]===i?_=t[17]:(_=i(`assistants.contact.card.schedule.label`),t[16]=i,t[17]=_);let v;t[18]===_?v=t[19]:(v=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-[0.8em] leading-4 text-muted-foreground`,children:[g,(0,$.jsx)(`span`,{className:`truncate`,children:_})]}),t[18]=_,t[19]=v);let y;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(W,{name:`arrow-right-s`,weight:`medium`,className:`ml-auto size-4 shrink-0 text-muted-foreground`}),t[20]=y):y=t[20];let b;t[21]===v?b=t[22]:(b=(0,$.jsxs)(`div`,{className:Y,children:[v,y]}),t[21]=v,t[22]=b);let x;t[23]===a?x=t[24]:(x=(0,$.jsx)(`h3`,{className:Ge,title:a,children:a}),t[23]=a,t[24]=x);let S;t[25]===l?S=t[26]:(S=l?(0,$.jsx)(`p`,{className:`row-start-3 mt-1 min-w-0 truncate text-[0.8em] leading-4 text-muted-foreground`,title:l,children:l}):null,t[25]=l,t[26]=S);let C;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=I(X,`justify-end`),t[27]=C):C=t[27];let w;t[28]===s.cadence?w=t[29]:(w=s.cadence?(0,$.jsx)(`span`,{"data-contact-schedule-cadence":``,className:`min-w-0 max-w-[36%] flex-[0_1_auto] truncate text-[0.75em] leading-4 text-muted-foreground`,title:s.cadence,children:s.cadence}):null,t[28]=s.cadence,t[29]=w);let T=`min-w-0 flex-[0_1_auto] truncate leading-[22px] text-foreground tabular-nums ${s.clock?`text-[1.25em] font-normal tracking-[-0.3px]`:`text-[0.85em]`}`,E;t[30]!==s.value||t[31]!==T?(E=(0,$.jsx)(`p`,{className:T,title:s.value,children:s.value}),t[30]=s.value,t[31]=T,t[32]=E):E=t[32];let D;t[33]!==w||t[34]!==E?(D=(0,$.jsx)(`div`,{className:C,children:(0,$.jsxs)(`div`,{"data-contact-schedule-time":``,className:`flex min-w-0 flex-none items-baseline gap-1.5`,children:[w,E]})}),t[33]=w,t[34]=E,t[35]=D):D=t[35];let O;return t[36]!==m||t[37]!==f||t[38]!==b||t[39]!==x||t[40]!==S||t[41]!==D||t[42]!==h?(O=(0,$.jsxs)(`article`,{className:Ke,role:`button`,tabIndex:0,"aria-label":h,"data-assistant-contact-card":`schedule`,onClick:f,onKeyDown:m,children:[b,x,S,D]}),t[36]=m,t[37]=f,t[38]=b,t[39]=x,t[40]=S,t[41]=D,t[42]=h,t[43]=O):O=t[43],O},Zt=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate();function Qt(e){let t=new Map,n=null;for(let r of e){if(!(r.status===`error`||r.status===`failed`||r.parts.some(e=>e.type!==`text`||e.text.trim()&&!e.text.trim().startsWith(`yuri.settle.`)&&!e.text.trim().startsWith(`oc.settle.`))))continue;let e=new Date(r.createdAt);Number.isFinite(e.getTime())&&((!n||!Zt(n,e))&&t.set(r.messageID,r.createdAt),n=e)}return t}function $t(e,t,n,r){let i=new Date(r);i.setDate(i.getDate()-1);let a=new Intl.DateTimeFormat(e,{month:`long`,day:`numeric`}),o=new Intl.DateTimeFormat(e,{year:`numeric`,month:`long`,day:`numeric`});return e=>{let s=new Date(e);return Zt(s,r)?t:Zt(s,i)?n:(s.getFullYear()===r.getFullYear()?a:o).format(s)}}function en(e,t,n){let r=new Intl.DateTimeFormat(e,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),i=new Intl.DateTimeFormat(e,{month:`long`,day:`numeric`}),a=new Intl.DateTimeFormat(e,{year:`numeric`,month:`long`,day:`numeric`});return e=>{let o=new Date(e);return`${Zt(o,n)?t:(o.getFullYear()===n.getFullYear()?i:a).format(o)} ${r.format(o)}`}}var tn=2,nn=1500,rn=e=>({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}),an=e=>e.scrollHeight-e.scrollTop-e.clientHeight,on=e=>an(e)<=tn,sn=(e,t)=>{let n=t instanceof Element?t:t instanceof Node?t.parentElement:null;for(;n&&n!==e;){if(n instanceof HTMLElement&&n.scrollHeight>n.clientHeight+1&&n.scrollTop+n.clientHeight<n.scrollHeight-1)return!0;n=n.parentElement}return!1},cn=e=>e.altKey||e.ctrlKey||e.metaKey?!1:e.key===`ArrowDown`||e.key===`PageDown`||e.key===`End`,ln=({active:e,assistantID:t,contentRevision:n,onLoadEarlier:r,overlayComposerRef:i})=>{let a=Q.useRef(null),[o,s]=Q.useState(null),[c,l]=Q.useState(null),u=Q.useRef(!0),d=Q.useRef(null),f=Q.useRef(null),p=Q.useRef(null),m=Q.useRef(0),h=Q.useRef(null),g=Q.useRef(null),_=Q.useRef(e);_.current=e;let v=he(),y=Q.useRef(!1),b=Q.useRef(null),x=Q.useRef(null),S=Q.useRef(0),C=Q.useRef(null),w=j(e=>{let t=C.current;C.current=null,t?.(e)}),T=j(()=>{S.current+=1,b.current?.stop(),b.current=null,x.current=null}),E=Q.useMemo(()=>e=>{a.current=e,s(t=>t===e?t:e)},[]),k=Q.useMemo(()=>e=>{l(t=>t===e?t:e)},[]),A=j(()=>{let e=a.current,t=e?.parentElement;if(!e||!t||!_.current)return;let n=`${Math.max(0,e.offsetWidth-e.clientWidth)}px`;t.style.getPropertyValue(`--contact-scrollbar-width`)!==n&&t.style.setProperty(`--contact-scrollbar-width`,n)});Q.useLayoutEffect(()=>{A()},[e,o,A]);let M=j(()=>{let e=a.current;if(!e||!_.current||u.current)return;let t=e.getBoundingClientRect().top,n=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.getBoundingClientRect().bottom>t);d.current=n?{id:n.dataset.messageId,offset:n.getBoundingClientRect().top-t,scrollTop:e.scrollTop}:null}),N=j(()=>{let e=a.current,t=d.current;if(!e||!_.current||u.current)return;if(!t){M();return}let n=e.scrollTop-t.scrollTop;if(Math.abs(n)>.5&&h.current){m.current=e.scrollTop,M();return}let r=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.dataset.messageId===t.id);if(!r){M();return}let i=r.getBoundingClientRect().top-e.getBoundingClientRect().top-(t.offset-n);Math.abs(i)>.5&&(e.scrollTop+=i),m.current=e.scrollTop,d.current={id:t.id,offset:r.getBoundingClientRect().top-e.getBoundingClientRect().top,scrollTop:e.scrollTop}}),ee=j(()=>{T(),w(!1),u.current=!1,m.current=a.current?.scrollTop??0,M()}),P=Q.useRef(null),te=j((e,t)=>{let n=a.current;if(!_.current||!n){t?.(!1);return}T(),w(!1);let r=!on(rn(n));C.current=r?t??null:null,P.current=r&&t?null:e??null,u.current=!0,d.current=null,g.current=null,m.current=n.scrollTop,r||t?.(!0)}),ne=j(()=>{if(!_.current||!u.current)return!1;let e=a.current;if(!e)return!1;let t=rn(e),n=Math.min(m.current,Math.max(0,t.scrollHeight-t.clientHeight));if(t.scrollTop<n-.5)return T(),u.current=!1,m.current=t.scrollTop,M(),w(!1),!1;let r=!y.current;if(r&&e.querySelector(`[data-message-id]`)&&(y.current=!0),on(t))return T(),m.current=t.scrollTop,w(!0),!1;let i=Math.max(0,t.scrollHeight-t.clientHeight);if(!r&&!v){if(x.current===i)return!1;T(),x.current=i;let t=S.current,n=P.current;return P.current=null,b.current=U(e.scrollTop,i,{duration:n?.duration??.22,ease:n?[...n.ease]:`easeOut`,onUpdate:n=>{if(S.current!==t||!_.current||!u.current||a.current!==e)return;let r=Math.max(0,e.scrollHeight-e.clientHeight);if(e.scrollTop<Math.min(m.current,r)-.5){u.current=!1,T(),m.current=e.scrollTop,M(),w(!1);return}e.scrollTop=Math.min(Math.max(e.scrollTop,n),r),m.current=e.scrollTop},onComplete:()=>{S.current===t&&(b.current=null,x.current=null,ne())}}),!0}return T(),e.scrollTop=i,m.current=e.scrollTop,w(!0),!0}),re=j(e=>{g.current={direction:e,expiresAt:performance.now()+nn}}),ie=j(()=>{let e=g.current;return e?performance.now()>e.expiresAt?(g.current=null,null):e.direction:null}),ae=j(()=>{T(),w(!1),P.current=null,u.current=!1,M()}),oe=j(()=>{if(!_.current)return;let e=a.current;if(!e)return;let t=rn(e),n=t.scrollTop>m.current,i=Math.min(m.current,Math.max(0,t.scrollHeight-t.clientHeight));if(m.current=t.scrollTop,u.current){t.scrollTop<i-.5&&ae();return}let o=ie();N(),t.scrollTop<=80&&o===`up`&&r?.(),n&&on(t)&&(o===`down`||o===`scrollbar`)&&(u.current=!0)}),se=j(e=>{let t=a.current;if(!(!t||e.deltaY===0)){if(e.deltaY<0){if(be(t,e.target))return;re(`up`),ae(),t.scrollTop<=80&&r?.();return}sn(t,e.target)||re(`down`)}}),ce=j(e=>{g.current=null;let t=e.touches.item(0);h.current=t?{x:t.clientX,y:t.clientY,deltaX:0,deltaY:0}:null}),le=j(e=>{let t=a.current,n=e.touches.item(0);if(!t||!n){h.current=null;return}let i=h.current;if(!i)return;let o=n.clientY-i.y,s=o*i.deltaY<0,c=(s?0:i.deltaX)+n.clientX-i.x,l=(s?0:i.deltaY)+o;if(h.current={x:n.clientX,y:n.clientY,deltaX:c,deltaY:l},!(Math.abs(c)>=Math.abs(l))){if(l>0&&be(t,e.target)||l<0&&sn(t,e.target)){h.current.deltaX=0,h.current.deltaY=0;return}re(l>0?`up`:`down`),l>2&&(ae(),t.scrollTop<=80&&r?.())}}),ue=j(()=>{h.current=null}),F=j(e=>{if(we(e)){re(`up`),ae(),(a.current?.scrollTop??1/0)<=80&&r?.();return}cn(e)&&re(`down`)}),I=j(e=>{let t=a.current;e.pointerType===`mouse`&&e.target===t&&re(`scrollbar`)}),L=j(()=>{let e=a.current?.parentElement;if(!e||!_.current)return!1;let t=`${i?.current?.offsetHeight??0}px`;return e.style.getPropertyValue(`--contact-composer-height`)!==t&&(e.style.setProperty(`--contact-composer-height`,t),!0)});Q.useLayoutEffect(()=>{L()},[e,o,i,L]),Q.useLayoutEffect(()=>{let n=e?t:null,r=a.current;(f.current!==n||p.current!==r)&&(T(),w(!1),P.current=null,y.current=!1,f.current=n,p.current=r,u.current=!0,d.current=null,g.current=null,h.current=null,m.current=r?.scrollTop??0),e&&(ne(),N())},[e,t,n,o,v,i]),Q.useLayoutEffect(()=>()=>{T(),w(!1)},[e,t,o,T,w]);let de=Q.useMemo(()=>()=>void 0,[]),R=e&&o?o:de,z=Q.useMemo(()=>({passive:!0}),[]);D(`scroll`,oe,R,z),D(`wheel`,se,R,z),D(`touchstart`,ce,R,z),D(`touchmove`,le,R,z),D(`touchend`,ue,R,z),D(`touchcancel`,ue,R,z),D(`keydown`,F,R),D(`pointerdown`,I,R,z);let fe=Q.useRef(null),B=j(()=>{let e=a.current;fe.current=e&&_.current?{element:e,top:e.scrollTop,height:e.clientHeight}:null}),pe=j(()=>{A();let e=a.current,t=fe.current;!e||t?.element!==e||t.height===e.clientHeight||(fe.current=null,T(),e.scrollTop=Math.max(0,t.top+t.height-e.clientHeight),m.current=e.scrollTop,u.current?ne():M())});D(`yuri:keyboard-native-layout`,B,e&&typeof window<`u`?window:de);let me=j(()=>{ne(),N()}),V=j(()=>{L()&&me()}),H=typeof ResizeObserver<`u`;return O(H&&e?c:null,me),O(H&&e?o:null,pe),O(H&&e&&i?i:null,V,{box:`border-box`}),{scrollRef:E,contentRef:k,preparePrepend:ee,followLatest:te}},un=.3,dn=[.19919472913616398,.010644531250000006,.27920937042459737,.91025390625],fn=[.23,1,.32,1],pn=H(...dn),mn=H(...fn),hn=.15,gn=.1,_n=.08,vn=e=>({left:e.left,top:e.top,width:e.width,height:e.height}),yn=e=>Number.parseFloat(e)||0,bn=(e,t,n)=>e+(t-e)*n,xn=e=>[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius],Sn=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=t.left+yn(n.borderLeftWidth)+yn(n.paddingLeft),i=t.top+yn(n.borderTopWidth)+yn(n.paddingTop);return{left:r,top:i,width:t.right-yn(n.borderRightWidth)-yn(n.paddingRight)-r,height:t.bottom-yn(n.borderBottomWidth)-yn(n.paddingBottom)-i}},Cn=e=>({color:e.color,fontFamily:e.fontFamily,fontSize:e.fontSize,fontWeight:e.fontWeight,fontFeatureSettings:e.fontFeatureSettings,letterSpacing:e.letterSpacing,lineHeight:e.lineHeight,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`}),wn=(e,t,n=!1)=>{if(!t.value.trim())return null;let r=e.querySelector(`[data-composer-material]`)??e,i=window.getComputedStyle(r),a=Sn(t),o=t.parentElement?.querySelector(`[data-composer-highlight]`),s=Cn(window.getComputedStyle(t));return o&&(s.color=window.getComputedStyle(o).color),{compact:n,background:vn(r.getBoundingClientRect()),backgroundColor:i.backgroundColor,radii:xn(i),text:t.value,textBox:{...a,top:a.top-t.scrollTop},textStyle:s}},Tn=e=>{let t=document.createElement(`div`);return Object.assign(t.style,{position:`absolute`,pointerEvents:`none`,margin:`0px`,...e}),t},En=(e,t,n,r)=>(e.style.opacity=String(t),U(e,{opacity:[t,n]},{duration:r,ease:`linear`})),Dn=(e,t,n=t,r)=>{let i=window.getComputedStyle(t),a=t.querySelector(`.yuri-contact-bubble-outline path`),o=a?window.getComputedStyle(a).fill:i.backgroundColor,s=xn(i),c=vn(t.getBoundingClientRect()),l=Sn(t),u=e.compact?{...e.background,left:e.textBox.left-yn(i.paddingLeft),width:Math.min(e.background.width,Math.max(120,c.width+32))}:e.background,d={left:u.left,top:u.top+u.height-c.height},f={x:e.textBox.left-d.left-(l.left-c.left),y:e.textBox.top-d.top-(l.top-c.top)},p=Tn({position:`fixed`,left:`0px`,top:`0px`,overflow:`hidden`,zIndex:`60`,willChange:`transform, width, height`});p.setAttribute(`aria-hidden`,`true`),p.setAttribute(`data-assistant-contact-send-flight`,``),p.style.backgroundColor=e.backgroundColor;let m=Tn({...e.textStyle,left:`0px`,top:`0px`,width:`${e.textBox.width}px`});m.textContent=e.text;let h=Tn({...Cn(i),left:`0px`,top:`0px`,width:`${l.width}px`});h.textContent=(t.querySelector(`[data-assistant-contact-body]`)??t).textContent??``,p.append(m,h);let g=n=>{let r=pn(n),i=mn(n),a=vn(t.getBoundingClientRect()),o=u,g=bn(o.left,a.left,i),_=bn(o.left+o.width,a.left+a.width,i),v=bn(o.top+o.height,a.top+a.height,r),y=bn(o.height,a.height,r),b=v-y;p.style.transform=`translate3d(${g}px, ${b}px, 0)`,p.style.width=`${_-g}px`,p.style.height=`${y}px`,p.style.borderRadius=s.map((t,n)=>`${bn(yn(e.radii[n]),yn(t),r)}px`).join(` `);let x=a.left+(d.left-c.left)*(1-i),S=a.top+(d.top-c.top)*(1-r),C=`translate3d(${x+(l.left-c.left)+f.x*(1-r)-g}px, ${S+(l.top-c.top)+f.y*(1-r)-b}px, 0)`;m.style.transform=C,h.style.transform=C},_=!1,v=[],y=()=>{_||(_=!0,v.forEach(e=>e.stop()),p.remove(),n.style.visibility=``,r?.())};return n.style.visibility=`hidden`,g(0),document.body.appendChild(p),v.push(U(p,{backgroundColor:[e.backgroundColor,o]},{duration:hn,ease:`linear`}),En(m,1,0,gn),En(h,0,1,_n),U(0,1,{duration:un,ease:`linear`,onUpdate:g,onComplete:y})),y},On=64,kn=e=>{if(!e)return[];let t=Array.from(e.files||[]);return t.length>0?t:Array.from(e.items||[]).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e instanceof File)},An=e=>Array.from(e?.files||[]),jn=async(e,t=ee)=>{let n=[],r=0;for(let i of Array.from(e||[])){if(!i||i.size<=0)continue;if(i.size>26214400){r+=1;continue}let e=URL.createObjectURL(i);n.push({id:t(),url:e,name:i.name.trim()||`attachment`,mime:i.type.trim()||`application/octet-stream`,file:i})}return{attachments:n,skippedTooLarge:r}},Mn=(e,t)=>{let n=[...e,...t];for(let e of n.slice(On))e.url.startsWith(`blob:`)&&URL.revokeObjectURL(e.url);return n.slice(0,On)},Nn=ge(()=>M(()=>import(`./ToolOutputDialog-Ce0eoysA.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78]))),Pn=e=>e.trim().startsWith(`yuri.settle.`)||e.trim().startsWith(`oc.settle.`),Fn=e=>e.status===`error`||e.status===`failed`&&e.messageID.endsWith(`:preview:failed`),In=e=>e.role===`assistant`&&e.status!==`error`&&e.parts.some(e=>e.type===`text`)?`${e.turnID}:assistant:${e.bubbleIndex}`:e.messageID,Ln=({assistant:e,warning:t,active:n,overlayHeader:r=!1,overlayComposer:i=!1})=>{let{t:a,locale:o}=P(),s=Ne(),c=N(e=>e.isMobile),l=ae(),u=le(),d=ie(e.id,n),f=N(e=>e.isSettingsDialogOpen),p=n&&!f&&!d.hasMessageGap?ue(e,d.data):null,m=z(e.name).displayName||e.name,h=pe(me(e.avatarSeed??e.id).color),g=(e,t)=>{let n=e?u.data?.assistants.find(t=>t.id===e):void 0;return n?z(n.name).displayName||n.name:t||a(`assistants.contact.peer.unknown`)},[_,v]=Q.useState(``),[y,b]=Q.useState([]),x=Q.useRef(new Map),S=Q.useRef(new Map),C=Q.useRef(new AbortController);Q.useEffect(()=>{let e=new AbortController;return C.current=e,()=>e.abort()},[e.id,s]);let w=Q.useRef(new Set),[E,D]=Q.useState([]);Q.useEffect(()=>{let e=new Set(y.map(e=>e.url));for(let t of x.current.values())for(let n of t.attachments)e.add(n.url);for(let t of w.current)e.has(t)||URL.revokeObjectURL(t);w.current=e},[y,E]),Q.useEffect(()=>()=>{for(let e of w.current)URL.revokeObjectURL(e)},[]);let[O,k]=Q.useState([]),[A,M]=Q.useState(null),[te,ce]=Q.useState({open:!1,title:``,content:``}),L=N(e=>e.setImagePreviewOpen),de=j(e=>{(e.image||e.mermaid||e.video)&&(ce(e),L(!0))}),R=j(e=>{ce(t=>({...t,open:e})),L(e)});Q.useEffect(()=>()=>{L(!1)},[L]),Q.useEffect(()=>{S.current.clear(),x.current.clear(),D([]),k([]),M(null)},[s]);let B=Q.useMemo(()=>Pt(),[]),V=Q.useRef(new Set),H=Q.useRef(new Map),U=Rt(e=>e.setWorking),G=d.data?.messages??gt,ge=Q.useMemo(()=>G.some(e=>e.parts.some(e=>e.type===`card`&&e.cardType===`schedule`&&Kt(e))),[G]),_e=ne(e.id,n&&ge),ye=Q.useMemo(()=>{let e=new Map;for(let t of _e.data?.tasks??[]){if(!t.task)continue;let n=e.get(t.projectID);n||(n=new Map,e.set(t.projectID,n)),n.set(t.taskID,t.task)}return e},[_e.data]),K=yt(E,e.id),be=bt(O,e.id),xe=Ct(G,K,e.id,be).filter(e=>{if(e.status===`admitted`&&e.messageID.endsWith(`:preview:admitted`))return!1;let t=Array.isArray(e.parts)?e.parts:[];return t.length===0||t.some(e=>!(e.type===`text`&&Pn(e.text)))}),Se=xe.length-1;for(;Se>=0&&Fn(xe[Se]);)--Se;let q=xe.filter((e,t)=>!Fn(e)||t>Se),Ce=Qt(q),we=`${s}:${e.id}`,Te=Q.useRef(null),Ee=Te.current?.scope===we?Te.current.keys:null,De=[],Oe=new Set,ke=new Map;for(let[e,t]of q.entries()){let n=De.at(-1),r=n?.rows.at(-1)?.message,i=In(t);if(n&&r&&t.role!==`user`&&t.role===r.role&&t.turnID===r.turnID&&t.fromAssistantID===r.fromAssistantID&&!Fn(t)&&!Fn(r))n.rows.push({message:t,index:e});else{let n=Ee?.get(i),r=n&&!Oe.has(n)?n:i;De.push({key:r,rows:[{message:t,index:e}]}),Oe.add(r)}ke.set(i,De.at(-1).key)}for(let e of De){if(e.rows.some(({message:t})=>Ee?.get(In(t))===e.key))continue;let t=e.rows.map(({message:e})=>Ee?.get(In(e))).find(e=>e&&!Oe.has(e));if(t){Oe.delete(e.key),e.key=t,Oe.add(t);for(let{message:n}of e.rows)ke.set(In(n),t)}}Q.useLayoutEffect(()=>{Te.current={scope:we,keys:ke}});let Ae=he(),J=`${s}:${e.id}`,je=Q.useRef(null),Me=je.current,Pe=Me?.lastID?q.findIndex(e=>In(e)===Me.lastID):-1,Fe=n&&!Ae&&Me?.scope===J&&Me.ready&&(Me.lastID===null||Pe>=0);Q.useLayoutEffect(()=>{let e=q.at(-1);je.current={scope:J,ready:n&&d.isSuccess,lastID:e?In(e):null}});let Ie=new Date().toDateString(),Le=a(`common.date.today`),Re=a(`common.date.yesterday`),Ve=Q.useMemo(()=>$t(o,Le,Re,new Date(Ie)),[o,Le,Re,Ie]),He=Q.useMemo(()=>new Intl.DateTimeFormat(o,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),[o]),Y=It(K),Ue=Lt(be),X=!!(e.working||e.activeContactTurn),We=u.data?.revision??null,Ge=be.reduce((e,t)=>e+t.bubbles.reduce((e,t)=>e+t.text.length,0),0),Ke=new Map(be.map(e=>[e.turnID,e])),qe=Q.useRef(!1),Z=j(async(e=!1)=>{if(!(!n||qe.current||d.isFetchingPreviousPage||d.isFillingMessageGap)&&!(e&&d.previousPageError)&&!(!d.hasPreviousPage&&!d.hasMessageGap)){qe.current=!0,$e();try{d.hasMessageGap?await d.retryMessageGap():await d.fetchPreviousPage()}catch{}finally{qe.current=!1}}}),Xe=Q.useRef(null),{scrollRef:Ze,contentRef:Qe,preparePrepend:$e,followLatest:et}=ln({active:n,assistantID:e.id,contentRevision:`${q[0]?.messageID}:${q.length}:${Ge}:${d.isFetchingPreviousPage}:${d.hasPreviousPage}:${d.isFillingMessageGap}`,onLoadEarlier:()=>{Z(!0)},overlayComposerRef:i?Xe:void 0}),tt=Q.useRef(null),nt=Q.useRef(null),rt=Q.useRef(null),it=Q.useRef(null),[at,st]=Q.useState(null),ct=()=>{let e=Xe.current?.querySelector(`[data-assistant-contact-composer-surface]`),t=e?.querySelector(`textarea`);return e&&t?wn(e,t,!c):null};Q.useLayoutEffect(()=>{let e=nt.current;if(!e?.ready||!n)return;nt.current=null;let t=Array.from(tt.current?.querySelectorAll(`[data-message-id]`)??[]).find(t=>t.dataset.messageId===e.messageID)?.querySelector(`[data-assistant-contact-text]`),r=()=>st(t=>t?.messageID===e.messageID?null:t);if(!t){r();return}it.current?.(),it.current=Dn(e.source,t,t,r)}),Q.useEffect(()=>()=>{nt.current=null,it.current?.(),it.current=null},[n,e.id,s]),Q.useEffect(()=>{M(null),x.current.clear(),S.current.clear(),V.current.clear(),H.current=new Map,D(t=>yt(t,e.id)),k(t=>bt(t,e.id)),ce({open:!1,title:``,content:``}),L(!1)},[e.id,L]),Q.useEffect(()=>{for(let e of G){let t=x.current.get(e.messageID);if(t){for(let e of t.attachments)S.current.delete(`${t.assistantID}:${e.id}`);x.current.delete(e.messageID)}}D(e=>wt(e,G))},[G]),Q.useEffect(()=>{let t=new Set(K.filter(e=>e.status===`sending`).map(e=>e.messageID));k(n=>Ot(n,{assistantID:e.id,activeContactTurn:e.activeContactTurn?{turnID:e.activeContactTurn.turnID,admittedAt:e.activeContactTurn.admittedAt}:null,serverWorking:X,snapshotRevision:We,admissionRevisionByTurnID:H.current,pendingSendTurnIDs:t,messages:G,settledTurnIDs:V.current}))},[e.activeContactTurn,e.id,G,K,X,We]),Q.useEffect(()=>{U(e.id,Y||Ue||X)},[e.id,Ue,Y,X,U]),Q.useEffect(()=>{let t=e.id;return()=>{U(t,!1)}},[e.id,U]);let lt=j(t=>{if(!(!(`assistantID`in t)||t.assistantID!==e.id)){if(t.type===`contact-turn-start`){V.current.delete(t.turnID),k(e=>Et(e,t.assistantID,t.turnID,t.occurredAt));return}if(t.type===`contact-bubble-delta`){if(V.current.has(t.turnID))return;k(e=>kt(e,t));return}t.type===`contact-turn-end`&&(V.current.add(t.turnID),k(e=>jt(At(e,t,{requireExisting:!0}),G)))}});Q.useEffect(()=>{if(n)return T(lt)},[n,e.id]);let ut=j(async e=>{if(Y)return;let t=C.current,n=await jn(e);if(t.signal.aborted){n.attachments.forEach(e=>URL.revokeObjectURL(e.url));return}n.skippedTooLarge>0&&M(a(`assistants.contact.attachment.tooLarge`)),n.attachments.length!==0&&b(e=>Mn(e,n.attachments))}),dt=j(e=>{let t=kn(e.clipboardData);t.length!==0&&(e.preventDefault(),ut(t))}),pt=j(e=>{Array.from(e.dataTransfer?.types??[]).includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}),_t=j(e=>{let t=An(e.dataTransfer);t.length!==0&&(e.preventDefault(),ut(t))}),vt=j(async(t,r)=>{let i=C.current,o=e.id,s=r?x.current.get(r):void 0;if(r&&(!s||s.assistantID!==o))return;let c=s?.text??t??_,u=s?.attachments??y,d=Ft({gate:B,sending:It(K),text:c,attachments:u,assistantID:o,createMessageID:()=>r||`yuri_contact_${ee()}`});if(!d.ok)return;U(o,!0),x.current.set(d.messageID,{assistantID:o,text:c,attachments:u});let f=u.length===0&&t===void 0&&!r&&n&&!Ae?ct():null;it.current?.(),it.current=null;let p=f?{messageID:d.messageID,source:f,ready:!1}:null;nt.current=p,st(f?{scope:J,messageID:d.messageID,phase:`scrolling`}:null),rt.current=f?d.messageID:rt.current,r||(et(f?{duration:un,ease:dn}:void 0,p?e=>{nt.current===p&&(e?p.ready=!0:nt.current=null,st(t=>t?.messageID===d.messageID?e?{...t,phase:`flying`}:null:t))}:void 0),v(e=>e===c?``:e),b(e=>e.filter(e=>!u.includes(e)))),D(e=>e.some(e=>e.messageID===d.messageID)?e.map(e=>e.messageID===d.messageID?{...d.turn,createdAt:e.createdAt}:e):[...e,d.turn]),M(null);let h=()=>{u.forEach(e=>S.current.delete(`${o}:${e.id}`)),x.current.delete(d.messageID)};try{let t=[];for(let e of u){let n=`${o}:${e.id}`,r=S.current.get(n);if(!r){if(r=await Be(o,e.file,e.id,i.signal),i.signal.aborted)return;S.current.set(n,r)}t.push(r)}if(i.signal.aborted)return;let n=[...d.parts.filter(e=>e.type===`text`),...t];D(e=>e.map(e=>e.messageID===d.messageID?{...e,parts:n}:e));let r=await re(o,d.messageID,{parts:n});if(i.signal.aborted)return;h(),typeof r.revision==`number`&&H.current.set(d.messageID,r.revision),D(e=>Tt(e,d.messageID)),V.current.has(d.messageID)||k(e=>Et(e,o,d.messageID)),l.data?.serverInstanceID&&fe({serverInstanceID:l.data.serverInstanceID,assistantID:o,name:m,avatarSeed:e.avatarSeed??o}).catch(()=>void 0)}catch(e){if(i.signal.aborted)return;if(e instanceof oe&&e.code===`admission_timeout`)try{let e=await se(o,d.messageID);if(i.signal.aborted)return;if(e){h(),typeof e.revision==`number`&&H.current.set(d.messageID,e.revision),D(e=>Tt(e,d.messageID)),V.current.has(d.messageID)||k(e=>Et(e,o,d.messageID));return}}catch{}let t=Nt(e,{noProvider:a(`assistants.contact.noProvider`),sendFailed:a(`assistants.contact.sendFailed`),timedOut:a(`assistants.contact.timedOut`)});D(e=>Mt(e,d.messageID,t))}finally{B.release()}}),xt=j(e=>{vt(void 0,e)}),St=d.isError&&q.length===0,Dt=d.isSuccess&&q.length===0,zt=new Map(K.map(e=>[e.messageID,e]));return(0,$.jsxs)(`div`,{ref:tt,className:`yuri-contact-conversation flex min-h-0 flex-1 flex-col bg-transparent`,"data-contact-layout":c?`mobile`:`desktop`,"data-composer-overlay":i||void 0,children:[(0,$.jsxs)(`div`,{ref:Ze,className:I(`min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-4 sm:px-8`,c&&`pb-11`,r?`pt-[calc(max(0.625rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height)+1.25rem)]`:`pt-5 sm:pt-7`),style:{overflowAnchor:`none`,overscrollBehavior:`contain`,overscrollBehaviorY:`contain`},"data-assistant-contact-transcript":``,children:[t?(0,$.jsx)(`p`,{className:`mb-3 typography-micro text-[var(--status-warning)]`,children:t}):null,St?(0,$.jsxs)(`div`,{ref:Qe,className:`mx-auto flex h-full min-h-56 max-w-xs flex-col items-center justify-center pb-16 text-center`,"data-assistant-contact-error":``,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(Vt,{name:e.id,avatarSeed:e.avatarSeed,size:44,label:m,working:n?X:void 0,showWorkingDot:!1,followPointer:!1}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`absolute -right-1 -bottom-1 flex size-5 items-center justify-center rounded-full bg-[var(--surface-elevated)] text-[var(--status-error)] ring-2 ring-background`,children:(0,$.jsx)(W,{name:`error-warning`,className:`size-3`})})]}),(0,$.jsx)(`p`,{className:`mt-4 typography-ui-label font-medium text-foreground`,children:m}),(0,$.jsx)(`p`,{className:`mt-1.5 typography-ui leading-6 text-muted-foreground`,children:a(`assistants.contact.loadFailed`)}),(0,$.jsx)(F,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>void d.refetch(),children:a(`chat.history.retry`)})]}):Dt?(0,$.jsxs)(`div`,{ref:Qe,className:`mx-auto flex h-full min-h-56 max-w-sm flex-col items-center justify-center pb-16 text-center`,"data-assistant-contact-empty":``,children:[(0,$.jsx)(Vt,{name:e.id,avatarSeed:e.avatarSeed,size:48,label:m,className:`opacity-90`,working:n?X:void 0,showWorkingDot:!1,followPointer:!1}),(0,$.jsx)(`p`,{className:`mt-5 typography-ui-header font-medium tracking-[-0.01em] text-foreground`,children:a(`assistants.conversation.emptyTitle`,{name:m})}),(0,$.jsx)(`p`,{className:`mt-2 max-w-xs typography-ui leading-6 text-muted-foreground/80`,children:a(`assistants.contact.empty`)})]}):(0,$.jsxs)(`div`,{ref:Qe,className:`relative mx-auto flex w-full flex-col pb-12`,"data-assistant-contact-content":``,children:[d.isPending?(0,$.jsx)(`p`,{role:`status`,className:`py-3 text-center typography-micro text-muted-foreground`,children:a(`common.loading`)}):null,d.hasPreviousPage||d.hasMessageGap?(0,$.jsxs)(`div`,{className:`mb-3 flex flex-col items-center gap-1`,"data-assistant-contact-pagination":``,"aria-busy":d.isFetchingPreviousPage||d.isFillingMessageGap,children:[d.previousPageError?(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:a(`chat.history.loadOlderFailed`)}):null,d.hasMessageGap?(0,$.jsx)(`p`,{role:`status`,className:`typography-micro text-muted-foreground`,children:a(`assistants.contact.history.gap`)}):null,(0,$.jsx)(F,{type:`button`,size:`sm`,variant:`ghost`,disabled:d.isFetchingPreviousPage||d.isFillingMessageGap,onClick:()=>void Z(),children:a(d.isFetchingPreviousPage||d.isFillingMessageGap?`chat.history.loadingMore`:d.previousPageError||d.hasMessageGap?`chat.history.retry`:`chat.history.loadOlder`)})]}):null,De.map(t=>{let r=t.rows[0].message,i=r.role!==`user`&&!Fn(r),o=r.role===`peer`&&r.fromAssistantID?u.data?.assistants.find(e=>e.id===r.fromAssistantID):e,l=r.role===`peer`?g(r.fromAssistantID,r.fromAssistantName):m;return(0,$.jsxs)(`div`,{className:I(`relative flex w-full`,!Ce.has(r.messageID)&&(i?`mt-4 first:mt-0`:`mt-6 first:mt-0`)),"data-assistant-contact-group":``,children:[i?(0,$.jsx)(`div`,{className:I(`sticky bottom-2 flex shrink-0 self-end justify-center pb-0.5`,c?`mr-2.5 w-9`:`mr-2 w-6`),"data-assistant-contact-avatar-rail":``,children:(0,$.jsx)(Vt,{name:o?.id||r.fromAssistantID||e.id,avatarSeed:o?.avatarSeed??(r.fromAssistantID?void 0:e.avatarSeed),size:c?32:24,label:l,working:n?!!(o?.working||o?.activeContactTurn):void 0,showWorkingDot:!1,followPointer:!1})}):null,(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:t.rows.map(({message:t,index:r})=>{let i=`${J}:${In(t)}`,o=r>0?q[r-1]:null,l=q[r+1],d=Ce.get(t.messageID),f=d!==void 0,_=f?(0,$.jsx)(`div`,{className:`flex w-full justify-center px-4 py-4`,"data-assistant-contact-time":``,children:(0,$.jsx)(`time`,{dateTime:new Date(d).toISOString(),className:`text-[11px] font-normal leading-4 tabular-nums text-muted-foreground/70`,children:Ve(d)})}):null,v=t.role===`user`,y=t.role===`peer`,b=e=>e&&!Fn(e)&&e.role===t.role&&e.turnID===t.turnID&&e.fromAssistantID===t.fromAssistantID,x=!!(!f&&b(o)),S=!!(l&&!Ce.has(l.messageID)&&b(l)),C=t.role===`assistant`&&!f&&o?.role===`assistant`&&o.turnID===t.turnID,w=y?g(t.fromAssistantID,t.fromAssistantName):m,T=zt.get(t.messageID),E=Ke.get(t.turnID),D=t.status===`failed`&&t.messageID.endsWith(`:preview:failed`),O=(e,t)=>v?(0,$.jsx)(mt,{failedTurn:n?T:void 0,retryDisabled:Y,onRetry:xt,children:e},t):e;return t.status===`error`||D?(0,$.jsxs)(Q.Fragment,{children:[_,(0,$.jsxs)(`div`,{"data-message-id":t.messageID,"data-assistant-contact-error":``,className:I(`relative px-1`,!f&&`mt-3`),children:[(0,$.jsx)(`p`,{role:`alert`,className:`whitespace-pre-wrap text-center text-[11px] font-normal leading-4 text-muted-foreground [overflow-wrap:anywhere]`,children:t.text||E?.error||a(`assistants.contact.sendFailed`)}),p?.messageID===t.messageID?(0,$.jsx)(Ye,{assistantID:e.id,position:p},`${s}:${e.id}:${p.generation}:${p.ordinal}`):null]})]},i):(0,$.jsxs)(Q.Fragment,{children:[_,(0,$.jsx)(ze.div,{"data-message-id":t.messageID,initial:Fe&&r>Pe&&t.messageID!==rt.current?{opacity:0,y:4}:!1,animate:{opacity:1,y:0},transition:{duration:Ae?0:.18,ease:`easeOut`},className:I(`flex w-full`,v?`justify-end`:`justify-start`,f?`mt-0`:x?`mt-2`:`mt-4 first:mt-0`),"data-assistant-contact-role":t.role,"data-assistant-contact-turn-status":T?.status??t.status,"data-assistant-contact-run-start":t.role===`assistant`&&!C?``:void 0,children:(0,$.jsxs)(`div`,{className:I(`relative flex min-w-0 flex-col gap-2`,v?`max-w-[min(82%,30rem)] items-end`:`max-w-[min(84%,34rem)] items-start`),children:[y?(0,$.jsx)(`span`,{className:`mb-0.5 px-1 typography-micro text-muted-foreground/75`,children:a(`assistants.contact.peer.from`,{name:w})}):null,t.parts.map((r,o)=>{if(r.type===`card`&&r.cardType===`session`)return(0,$.jsx)(Je,{card:r},`${i}:card:${o}:${JSON.stringify([r.target??null,r.directory,r.sessionID])}`);if(r.type===`card`&&r.cardType===`assistant`)return(0,$.jsx)(Ht,{card:r,assistant:u.data?.assistants.find(e=>e.id===r.assistantID),active:n},`${i}:card:${o}`);if(r.type===`card`&&r.cardType===`schedule`)return(0,$.jsx)(Xt,{card:r,task:ye.get(r.projectID)?.get(r.taskID)},`${i}:card:${o}`);if(r.type===`file`)return O((0,$.jsx)(ft,{assistantID:e.id,part:r,onShowPopup:de},`${i}:file:${o}`),`${i}:file:${o}`);if(r.type===`text`&&Pn(r.text))return null;if(r.type===`text`&&(r.text.trim()||t.status===`streaming`)){let e=!v,s=e&&/^!\[(?:\\.|[^\]\\\n])*\]\(\s*(?:<[^>\n]+>|[^\s()]+)(?:\s+"[^"\n]*")?\s*\)$/.test(r.text.trim());return O((0,$.jsx)(ht,{label:y?a(`assistants.contact.peer.aria`,{name:w}):void 0,outgoing:v,joinedBefore:x,joinedAfter:S,createdAt:t.createdAt,time:He.format(t.createdAt),mobile:c,media:s,colors:v?h:void 0,hidden:n&&at?.scope===J&&at.messageID===t.messageID,children:e?(0,$.jsx)(ve,{content:r.text,messageId:i,isAnimated:!1,isStreaming:t.status===`streaming`,variant:`assistant`,enableFileReferences:!1,onShowPopup:de,className:`w-full min-w-0 [overflow-wrap:anywhere]`}):r.text},`${i}:text:${o}`),`${i}:text:${o}`)}return null}),p?.messageID===t.messageID?(0,$.jsx)(Ye,{assistantID:e.id,position:p},`${s}:${e.id}:${p.generation}:${p.ordinal}`):null]})})]},i)})})]},`${J}:${t.key}`)}),(0,$.jsx)(`div`,{className:`pointer-events-none absolute bottom-1 left-[var(--contact-avatar-gutter)] flex h-10 items-center`,"data-assistant-contact-status-slot":``,children:!Y&&at?.scope!==J&&(Ue||X)?(0,$.jsxs)(ze.div,{role:`status`,"aria-label":a(`assistants.contact.processing`),initial:!Ae&&{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:Ae?0:.18,ease:`easeOut`},className:`relative inline-flex h-9 origin-bottom-left items-center gap-1 rounded-[1.35rem] bg-[var(--surface-muted)] px-4 text-muted-foreground/70`,"data-assistant-contact-processing":``,children:[(0,$.jsx)(`div`,{className:I(`absolute -left-[var(--contact-avatar-gutter)] top-0.5 flex justify-center`,c?`w-9`:`w-6`),"data-assistant-contact-processing-avatar":``,children:(0,$.jsx)(Vt,{name:e.id,avatarSeed:e.avatarSeed,size:c?32:24,label:m,working:n?X:void 0,showWorkingDot:!1,followPointer:!1})}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-delay:-0.45s] [animation-duration:1.4s] motion-reduce:animate-none`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-delay:-0.22s] [animation-duration:1.4s] motion-reduce:animate-none`}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse rounded-full bg-current [animation-duration:1.4s] motion-reduce:animate-none`})]}):null})]})]}),(0,$.jsxs)(`footer`,{ref:Xe,className:`relative z-10 shrink-0 bg-transparent pt-1`,"data-assistant-contact-composer":``,children:[A?(0,$.jsx)(`div`,{className:`chat-input-column mb-2`,children:(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:A})}):null,(0,$.jsx)(`form`,{className:I(`relative w-full pt-1.5 pb-4`,c&&`bottom-safe-area yuri-mobile-composer`),onSubmit:e=>{e.preventDefault(),vt()},onDragOver:pt,onDrop:_t,children:(0,$.jsx)(`div`,{className:`relative overflow-visible`,"data-contact-composer-column":``,children:(0,$.jsx)(ot,{active:n,layout:`inline`,value:_,attachments:y,pending:Y,isMobile:c,placeholder:a(`assistants.contact.placeholder`,{name:m}),sendLabel:a(`assistants.contact.send`),addFilesLabel:a(`assistants.contact.addFiles`),removeAttachmentLabel:a(`assistants.contact.removeAttachment`),fileAccept:`*/*`,onChange:e=>v(e),onVoiceSend:e=>{vt(e)},onSubmit:()=>{vt()},onAddFiles:e=>{ut(e)},onRemoveAttachment:t=>{Y||(S.current.delete(`${e.id}:${t}`),b(e=>e.filter(e=>e.id!==t)))},onPaste:dt,onDragOver:pt,onDrop:_t,className:I(`relative z-10`,c&&`yuri-mobile-composer-surface`),style:{borderRadius:`1.5rem`},"data-assistant-contact-composer-surface":``,textareaProps:{"aria-label":a(`assistants.contact.placeholder`,{name:m})}},`${s}:${e.id}`)})})]}),te.open?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Nn,{popup:te,onOpenChange:R,isMobile:c})}):null]})};export{Bt as i,en as n,Vt as r,Ln as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RemoteAssistantSessionCard-B51iN77P.js","assets/vendor-base-ui-fom6orB6.js","assets/rolldown-runtime-hePW80VL.js","assets/vendor-react-D5BntRmA.js","assets/vendor-tanstack-react-query-ChSd65dm.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/useMobileNavigationStore-zEWQLkBM.js","assets/runtime-auth-mjIpsk3N.js","assets/reasoning-projection-client-BEhVknv9.js","assets/runtime-switch-BMjl5Y5W.js","assets/runtime-fetch-DKZOpfzo.js","assets/platform-wF65ZFgV.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-zustand-CNn3HHhT.js","assets/gitApiHttp-BEMPJCIG.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/safeStorage-DTOhKN0V.js","assets/client-CgAFd1ew.js","assets/vendor-opencode-client-BM2r1f0o.js","assets/vendor-effect-X1Hqc7ba.js","assets/prompt-attachment-upload-8bssUUT3.js","assets/runtime-file-resource-DnhWnndu.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-B8s-Rcd-.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/useUIStore-CYex4rbF.js","assets/useMobileHtmlPreviewStore-DUquFMmd.js","assets/uuid-D-SDZijH.js","assets/vendor-sonner-Y-KPX915.js","assets/i18n-OsFhnlRH.js","assets/runtime-ead7P81A.js","assets/bootstrap-eLlfzqAI.js","assets/store-Dj5cSf8B.js","assets/tour-CMXP3Kif.js","assets/useAssistantUIStore-CphyXHEY.js","assets/input-store-DRTu4uZc.js","assets/remoteProjectQueries-8giIAvzL.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/toolHelpers-iEHVHQ9p.js","assets/remoteSessionReference-2EzJ0HAI.js","assets/openRemoteProjectSession-b-2cofYh.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./platform-wF65ZFgV.js";import{ot as n,st as r}from"./vendor-base-ui-fom6orB6.js";import{n as i}from"./vendor-react-D5BntRmA.js";import{r as a}from"./vendor-reactuses-core-B8s-Rcd-.js";import{o}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as s}from"./useUIStore-CYex4rbF.js";import{r as c}from"./vendor-sonner-Y-KPX915.js";import{t as l}from"./i18n-OsFhnlRH.js";import{Ct as u,K as d,Rn as f,Zn as p,yi as m}from"./useMobileNavigationStore-zEWQLkBM.js";import{n as h}from"./Icon-DmIDd0Q3.js";import{a as g,c as _,o as v,t as y}from"./sessionLookup-BBqXTJRj.js";var b=e(r(),1),x=i(),S=n();function C(e){let t=(0,x.c)(6),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,S.jsx)(h,{name:`brain`,weight:`medium`,className:`size-3.5 shrink-0`}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=(0,S.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[1]=n,t[2]=i);let a;return t[3]!==i||t[4]!==n?(a=(0,S.jsxs)(`p`,{"data-contact-card-model":``,className:`flex min-w-0 flex-1 items-center gap-1.5 text-[0.75em] leading-4 text-muted-foreground`,title:n,children:[r,i]}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}var w=b.createContext(null),T=[`grid h-[calc(148px*var(--padding-scale,1))] w-[19rem] min-w-0 max-w-full shrink-0 grid-rows-[calc(40px*var(--padding-scale,1))_calc(20px*var(--padding-scale,1))_calc(20px*var(--padding-scale,1))_calc(48px*var(--padding-scale,1))] content-start cursor-pointer rounded-[var(--contact-bubble-radius,1.125rem)] bg-[var(--assistant-panel-background,var(--surface-muted))]`,`px-4 py-2.5 text-left typography-ui-label transition-colors duration-150 motion-reduce:transition-none`,`hover:bg-[color-mix(in_srgb,var(--assistant-panel-background,var(--surface-muted))_94%,black)]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]`].join(` `),E=T,D=T,O=`row-start-1 mb-2 flex h-8 min-w-0 items-center gap-2`,k=`row-start-2 min-w-0 self-start truncate font-medium leading-5 text-foreground`,A=`row-start-4 flex h-12 min-w-0 flex-col justify-center`;function j(e,t){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())}var M=b.lazy(()=>o(()=>import(`./RemoteAssistantSessionCard-B51iN77P.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46]))),N=(e,t)=>t===`cancelled`?t:e===`busy`||e===`retry`?e:t===`error`||t===`question`||t===`complete`||t===`busy`||t===`retry`?t:e===`idle`?`complete`:t===`idle`?t:t||`busy`,P=e=>e===`unknown`?`remoteProjects.unknown`:e===`cancelled`?`assistants.contact.card.session.status.cancelled`:e===`busy`?`assistants.contact.card.session.status.busy`:e===`retry`?`assistants.contact.card.session.status.retry`:e===`idle`?`assistants.contact.card.session.status.idle`:e===`complete`?`assistants.contact.card.session.status.complete`:e===`error`?`assistants.contact.card.session.status.error`:e===`question`?`assistants.contact.card.session.status.question`:null,F=e=>e===`busy`?`text-[var(--status-info)]`:e===`retry`||e===`question`?`text-[var(--status-warning)]`:e===`error`?`text-[var(--status-error)]`:e===`idle`||e===`complete`?`text-[var(--status-success)]`:`text-muted-foreground`,I=e=>e.split(/[/\\]/u).filter(Boolean).at(-1)||e,L=e=>{let t=(0,x.c)(12),{card:n}=e,r;t[0]===n.sessionID?r=t[1]:(r=e=>e.activeSessions.find(e=>e.id===n.sessionID)??e.archivedSessions.find(e=>e.id===n.sessionID)??null,t[0]=n.sessionID,t[1]=r);let i=m(r),a=d(n.sessionID),o;t[2]!==n.directory||t[3]!==i?.directory?(o=i?.directory?.trim()||n.directory,t[2]=n.directory,t[3]=i?.directory,t[4]=o):o=t[4];let s=p(o),c=i??void 0,l=a?.type,u;t[5]===s.data?.current?u=t[6]:(u=s.data?.current?.trim()||null,t[5]=s.data?.current,t[6]=u);let f;return t[7]!==n||t[8]!==c||t[9]!==l||t[10]!==u?(f=(0,S.jsx)(z,{card:n,liveSession:c,liveType:l,branch:u}),t[7]=n,t[8]=c,t[9]=l,t[10]=u,t[11]=f):f=t[11],f},R=e=>{let t=(0,x.c)(2),{card:n}=e,r;return t[0]===n?r=t[1]:(r=n.target?(0,S.jsx)(b.Suspense,{fallback:(0,S.jsx)(z,{card:n,branch:null}),children:(0,S.jsx)(M,{card:n})}):(0,S.jsx)(L,{card:n}),t[0]=n,t[1]=r),r};function z({card:e,liveSession:n,liveType:r,branch:i}){let{t:d}=l(),p=!!(_()&&!t()),m=(typeof n?.title==`string`&&n.title.trim()?n.title.trim():null)||e.title||d(`assistants.contact.card.session.untitled`),x=e.target?r===`idle`?`complete`:r===`busy`||r===`retry`?r:[`complete`,`error`,`cancelled`].includes(e.status??``)?e.status:`unknown`:N(r,e.status),T=P(x),E=typeof n?.directory==`string`&&n.directory.trim()?n.directory.trim():e.directory,A=I(E),M=v(n),L=x===`complete`||x===`idle`?g(n):null,R=b.useContext(w),z=a(()=>{if(e.target){if(R)return R({sessionId:e.sessionID,directory:e.directory,target:e.target});o(async()=>{let{openAssistantRemoteSession:e}=await import(`./remoteSessionReference-2EzJ0HAI.js`);return{openAssistantRemoteSession:e}},__vite__mapDeps([47,23,2,7,9,10,8,11,12,13,1,3,5,4,24,25,26,27,28,29,17,6,14,15,16,18,19,20,21,22,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,48])).then(({openAssistantRemoteSession:t})=>t(e,p)).catch(()=>c.error(d(`remoteProjects.host-unavailable`)));return}let t=y(e.sessionID)?.directory||e.directory;if(R)return R({sessionId:e.sessionID,directory:t});u(e.sessionID,t,{phoneShell:p,switchToChat:!0}),p||s.getState().setActiveMainTab(`chat`)}),B=a(e=>{j(e,z)});return(0,S.jsxs)(`article`,{className:D,role:`button`,tabIndex:0,"aria-label":d(`assistants.contact.card.session.aria`,{title:m}),"data-assistant-contact-card":`session`,onClick:z,onKeyDown:B,children:[(0,S.jsxs)(`div`,{className:O,children:[(0,S.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-[0.8em] leading-4 text-muted-foreground`,children:[(0,S.jsx)(h,{name:`chat-thread`,weight:`medium`,className:`size-4 shrink-0`}),(0,S.jsx)(`span`,{className:`truncate`,children:d(`assistants.contact.card.session.label`)})]}),T?(0,S.jsxs)(`span`,{"data-assistant-session-status":``,className:f(`ml-auto inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-[0.75em] leading-4`,F(x)),children:[(0,S.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-current`,"aria-hidden":!0}),d(T)]}):null]}),(0,S.jsx)(`h3`,{className:k,title:m,children:m}),(0,S.jsxs)(`div`,{"data-contact-session-details":``,className:`row-start-3 row-end-5 flex min-w-0 flex-col gap-1.5 py-1`,children:[(0,S.jsxs)(`div`,{"data-contact-session-project":``,className:`flex h-4 min-w-0 flex-none items-center gap-2 text-[0.8em] leading-4`,children:[(0,S.jsxs)(`p`,{className:f(`flex min-w-0 items-center gap-1.5 text-foreground`,i&&`max-w-[45%] shrink-0`),title:E,children:[(0,S.jsx)(h,{name:`folder`,weight:`medium`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,S.jsx)(`span`,{className:`min-w-0 truncate`,children:A})]}),i?(0,S.jsxs)(`p`,{"data-contact-session-branch":``,className:`flex min-w-0 items-center gap-1 text-muted-foreground`,title:i,children:[(0,S.jsx)(h,{name:`git-branch`,weight:`medium`,className:`size-3 shrink-0`}),(0,S.jsx)(`span`,{className:`min-w-0 truncate`,children:i})]}):null]}),L?(0,S.jsxs)(`p`,{"data-contact-session-changes":``,className:`flex h-4 min-w-0 flex-none items-center gap-1.5 overflow-hidden whitespace-nowrap text-[0.8em] leading-4 text-muted-foreground tabular-nums`,children:[(0,S.jsx)(h,{name:`code`,weight:`medium`,className:`size-3.5 shrink-0`}),L.additions===void 0?null:(0,S.jsxs)(`span`,{className:`text-[var(--status-success)]`,children:[`+`,L.additions]}),L.deletions===void 0?null:(0,S.jsxs)(`span`,{className:`text-[var(--status-error)]`,children:[`−`,L.deletions]}),L.files===void 0?null:(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:L.files===1?d(`assistants.contact.card.session.changes.filesSingle`,{count:L.files}):d(`assistants.contact.card.session.changes.filesPlural`,{count:L.files})})]}):null,(0,S.jsxs)(`div`,{"data-contact-session-bottom":``,className:`mt-auto flex h-4 min-w-0 flex-none items-center gap-2`,children:[M?(0,S.jsx)(C,{value:M}):null,(0,S.jsx)(h,{name:`arrow-right-s`,weight:`medium`,className:`ml-auto size-4 shrink-0 text-muted-foreground`})]})]})]})}export{O as a,w as c,A as i,C as l,z as n,k as o,E as r,j as s,R as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ot as e}from"./vendor-base-ui-
|
|
1
|
+
import{ot as e}from"./vendor-base-ui-fom6orB6.js";import{n as t}from"./vendor-react-D5BntRmA.js";import{t as n}from"./i18n-OsFhnlRH.js";import{y as r}from"./MobileDetailNavigation-C5cGr0_z.js";import{Rn as i}from"./useMobileNavigationStore-zEWQLkBM.js";function a(e){return[...e].sort((e,t)=>{let n=e.latestMessagePreview?.createdAt??-1/0,r=t.latestMessagePreview?.createdAt??-1/0;return n===r?0:r-n})}function o(e){let t;for(let n of e)n.pinnedAt!=null&&(!t||n.pinnedAt>t.pinnedAt)&&(t=n);return{pinned:t?[t]:[],unpinned:a(e.filter(e=>e!==t))}}var s=t(),c=e();function l(e){let t=(0,s.c)(10),{count:r,className:a}=e,{t:o}=n();if(!(r>0))return null;let l;t[0]===a?l=t[1]:(l=i(`inline-flex h-[18px] min-w-[18px] shrink-0 items-center justify-center rounded-full bg-[var(--assistant-unread-fill)] px-1.5 typography-micro font-semibold leading-none text-[var(--assistant-unread-foreground)] tabular-nums`,a),t[0]=a,t[1]=l);let u;t[2]!==r||t[3]!==o?(u=o(`assistants.unread.label`,{count:r}),t[2]=r,t[3]=o,t[4]=u):u=t[4];let d=r>99?`99+`:r,f;return t[5]!==r||t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,c.jsx)(`span`,{className:l,"aria-label":u,"data-assistant-unread-count":r,children:d}),t[5]=r,t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9],f}function u(e){let t=(0,s.c)(3),{className:n}=e,i=r(),a;return t[0]!==n||t[1]!==i?(a=(0,c.jsx)(l,{count:i,className:n}),t[0]=n,t[1]=i,t[2]=a):a=t[2],a}export{a as i,l as n,o as r,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{c as n,w as r}from"./runtime-auth-mjIpsk3N.js";import{c as i,i as a,t as o}from"./runtime-switch-BMjl5Y5W.js";import{j as s,m as c}from"./platform-wF65ZFgV.js";import{ot as l,st as u}from"./vendor-base-ui-z2M4boRm.js";import{n as d}from"./vendor-react-P8wFrkcT.js";import{n as f}from"./vendor-tanstack-react-query-B-KblYBV.js";import{r as p}from"./vendor-reactuses-core-Dyjw5sZR.js";import{r as m}from"./useUIStore-Cfmg-aDQ.js";import{r as h}from"./vendor-sonner-B5HgJenP.js";import{t as g}from"./i18n-qHllte6P.js";import{a as _,h as v,l as y,m as b,s as x,t as S,v as C}from"./MobileDetailNavigation-l_n1taf1.js";import{In as w,Rn as T}from"./useMobileNavigationStore-D2FLOd1l.js";import{i as E,r as D}from"./useAssistantUIStore-jOKVcBK8.js";import{a as O}from"./MobileShareBridge-DGb2HExd.js";import{n as k}from"./Icon-CbRhi6Fu.js";import{a as A,i as j,n as M,o as N,r as P,t as F}from"./dialog-wyG1j1ZY.js";import{r as ee}from"./device-QL8KNSLM.js";import{c as te}from"./sessionLookup-BpilZd_w.js";import{i as I,r as L,t as ne}from"./AssistantConversationSurface-BQJZ0RY8.js";import{n as re,r as ie}from"./AssistantUnreadBadge-DJQUBf7P.js";import{a as ae,i as oe,n as se,r as R,t as z}from"./context-menu-w28HFXdm.js";var B=t(u(),1),V=d(),H=()=>c()&&!r(),ce=async e=>{if(!H())throw Error(`Assistant Mini Chat requires a direct desktop connection`);await s(`desktop_open_assistant_mini_chat_window`,{assistantID:e,apiBaseUrl:o(),clientToken:n()})},U=l();function W(e){let t=(0,V.c)(49),{assistant:n,trigger:r,onEdit:i,onDelete:o,doubleClickMiniChat:s}=e,c=s!==void 0&&s,{t:l}=g(),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=a(),t[0]=u):u=t[0];let d;t[1]===n.id?d=t[2]:(d=[u,`assistants`,n.id,`pin`],t[1]=n.id,t[2]=d);let p;t[3]===n?p=t[4]:(p=()=>b(n,{pinned:n.pinnedAt==null}),t[3]=n,t[4]=p);let m;t[5]===l?m=t[6]:(m=()=>h.error(l(`assistants.menu.pinError`)),t[5]=l,t[6]=m);let _;t[7]!==d||t[8]!==p||t[9]!==m?(_={mutationKey:d,mutationFn:p,onError:m},t[7]=d,t[8]=p,t[9]=m,t[10]=_):_=t[10];let v=f(_),y;t[11]!==n.id||t[12]!==l?(y=()=>{ce(n.id).catch(()=>h.error(l(`miniChat.actions.failed`)))},t[11]=n.id,t[12]=l,t[13]=y):y=t[13];let x=y,S=r,C;t[14]!==S||t[15]!==c||t[16]!==x||t[17]!==r?(C=c?B.cloneElement(S,{onDoubleClick:e=>{S.props.onDoubleClick?.(e),!e.defaultPrevented&&H()&&x()}}):r,t[14]=S,t[15]=c,t[16]=x,t[17]=r,t[18]=C):C=t[18];let w;t[19]===C?w=t[20]:(w=(0,U.jsx)(ae,{render:C}),t[19]=C,t[20]=w);let T;t[21]!==n.pinnedAt||t[22]!==v||t[23]!==l?(T=n.pinnedAt===void 0?null:(0,U.jsxs)(R,{disabled:v.isPending,onClick:()=>v.mutate(),children:[(0,U.jsx)(k,{name:n.pinnedAt==null?`pushpin-2`:`unpin`,className:`size-4`}),l(n.pinnedAt==null?`assistants.menu.pin`:`assistants.menu.unpin`)]}),t[21]=n.pinnedAt,t[22]=v,t[23]=l,t[24]=T):T=t[24];let E;t[25]!==x||t[26]!==l?(E=H()?(0,U.jsxs)(R,{onClick:x,children:[(0,U.jsx)(k,{name:`external-link`,className:`size-4`}),l(`sessions.sidebar.session.menu.openMiniChatWindow`)]}):null,t[25]=x,t[26]=l,t[27]=E):E=t[27];let D;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,U.jsx)(k,{name:`edit`,className:`size-4`}),t[28]=D):D=t[28];let O;t[29]===l?O=t[30]:(O=l(`assistants.menu.edit`),t[29]=l,t[30]=O);let A;t[31]!==i||t[32]!==O?(A=(0,U.jsxs)(R,{onClick:i,children:[D,O]}),t[31]=i,t[32]=O,t[33]=A):A=t[33];let j;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,U.jsx)(oe,{}),t[34]=j):j=t[34];let M;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,U.jsx)(k,{name:`delete-bin`,className:`size-4 text-inherit`}),t[35]=M):M=t[35];let N;t[36]===l?N=t[37]:(N=l(`assistants.settings.delete`),t[36]=l,t[37]=N);let P;t[38]!==o||t[39]!==N?(P=(0,U.jsxs)(R,{onClick:o,className:`text-[var(--status-error)] focus:text-[var(--status-error)] data-[highlighted]:text-[var(--status-error)]`,children:[M,N]}),t[38]=o,t[39]=N,t[40]=P):P=t[40];let F;t[41]!==T||t[42]!==E||t[43]!==A||t[44]!==P?(F=(0,U.jsxs)(se,{className:`min-w-[10rem]`,children:[T,E,A,j,P]}),t[41]=T,t[42]=E,t[43]=A,t[44]=P,t[45]=F):F=t[45];let ee;return t[46]!==F||t[47]!==w?(ee=(0,U.jsxs)(z,{children:[w,F]}),t[46]=F,t[47]=w,t[48]=ee):ee=t[48],ee}function le(e){let t=(0,V.c)(38),{assistant:n,selected:r,onSelect:i,onEdit:a,onDelete:o}=e,s=B.useRef(null),c=I(n.id,n.working),l;t[0]===n.name?l=t[1]:(l=O(n.name).displayName||n.name,t[0]=n.name,t[1]=l);let u=l,d;t[2]!==n.id||t[3]!==a?(d=()=>a(n.id),t[2]=n.id,t[3]=a,t[4]=d):d=t[4];let f;t[5]!==n||t[6]!==o?(f=()=>o(n),t[5]=n,t[6]=o,t[7]=f):f=t[7];let p=n.id,m;t[8]!==n.id||t[9]!==i?(m=()=>i(n.id),t[8]=n.id,t[9]=i,t[10]=m):m=t[10];let h=r?`bg-[var(--surface-muted)]`:`hover:bg-interactive-hover`,g;t[11]===h?g=t[12]:(g=T(`flex w-full min-w-0 max-w-28 flex-col items-center gap-2 rounded-2xl px-2 py-3 text-center outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] active:bg-interactive-active motion-reduce:transition-none`,h),t[11]=h,t[12]=g);let _;t[13]!==n.avatarSeed||t[14]!==n.id||t[15]!==u||t[16]!==c?(_=(0,U.jsx)(L,{name:n.id,avatarSeed:n.avatarSeed,size:64,label:u,working:c,hoverTarget:s}),t[13]=n.avatarSeed,t[14]=n.id,t[15]=u,t[16]=c,t[17]=_):_=t[17];let v=n.unreadCount??0,y;t[18]===v?y=t[19]:(y=(0,U.jsx)(re,{count:v,className:`absolute -right-1 -top-1`}),t[18]=v,t[19]=y);let b;t[20]!==y||t[21]!==_?(b=(0,U.jsxs)(`span`,{className:`relative`,children:[_,y]}),t[20]=y,t[21]=_,t[22]=b):b=t[22];let x;t[23]===u?x=t[24]:(x=(0,U.jsx)(`span`,{className:`w-full truncate typography-ui-label font-medium leading-5`,children:u}),t[23]=u,t[24]=x);let S;t[25]!==n.id||t[26]!==u||t[27]!==r||t[28]!==b||t[29]!==x||t[30]!==m||t[31]!==g?(S=(0,U.jsxs)(`button`,{ref:s,type:`button`,role:`option`,"aria-selected":r,title:u,"data-assistant-pinned":p,"data-mobile-press-feedback":`soft`,onClick:m,className:g,children:[b,x]}),t[25]=n.id,t[26]=u,t[27]=r,t[28]=b,t[29]=x,t[30]=m,t[31]=g,t[32]=S):S=t[32];let C;return t[33]!==n||t[34]!==S||t[35]!==d||t[36]!==f?(C=(0,U.jsx)(W,{assistant:n,doubleClickMiniChat:!0,onEdit:d,onDelete:f,trigger:S}),t[33]=n,t[34]=S,t[35]=d,t[36]=f,t[37]=C):C=t[37],C}function ue(e){let t=(0,V.c)(16),{contacts:n,selectedAssistantID:r,onSelect:i,onEdit:a,onDelete:o}=e,{t:s}=g();if(n.length===0)return null;let c;t[0]===s?c=t[1]:(c=s(`assistants.list.pinned`),t[0]=s,t[1]=c);let l;if(t[2]!==n||t[3]!==o||t[4]!==a||t[5]!==i||t[6]!==r){let e;t[8]!==o||t[9]!==a||t[10]!==i||t[11]!==r?(e=e=>(0,U.jsx)(le,{assistant:e,selected:e.id===r,onSelect:i,onEdit:a,onDelete:o},e.id),t[8]=o,t[9]=a,t[10]=i,t[11]=r,t[12]=e):e=t[12],l=n.map(e),t[2]=n,t[3]=o,t[4]=a,t[5]=i,t[6]=r,t[7]=l}else l=t[7];let u;return t[13]!==c||t[14]!==l?(u=(0,U.jsx)(`div`,{role:`group`,"aria-label":c,className:`yuri-assistant-pinned-contacts grid grid-cols-1 justify-items-center gap-2 pb-3 pt-2`,children:l}),t[13]=c,t[14]=l,t[15]=u):u=t[15],u}function de({snapshot:e,rowClassName:t,compact:n=!1,mobile:r=!1}){let{t:i}=g(),[a,o]=B.useState(!1),s=B.useRef(!1),c=p(async()=>{if(!s.current){s.current=!0,o(!0);try{(await y(e)).failed&&h.error(i(`assistants.unread.markAllFailed`))}catch{h.error(i(`assistants.unread.markAllFailed`))}finally{s.current=!1,o(!1)}}}),l=e.assistants.some(e=>(e.unreadCount??0)>0);return!n&&!l?null:(0,U.jsx)(`div`,{className:t,style:n&&!l?{visibility:`hidden`}:void 0,children:(0,U.jsx)(w,{type:`button`,variant:r?`mobileGlass`:`ghost`,size:r?`mobileIcon`:`icon`,onClick:c,"aria-label":i(`assistants.unread.markAll`),title:i(`assistants.unread.markAll`),disabled:a||!e.assistants.some(e=>(e.unreadCount??0)>0&&e.readTip),"aria-busy":a,children:(0,U.jsx)(k,{name:`check-double`,className:r?`size-5`:`size-4`})})})}async function fe(e){await _(e);let t=E.getState().defaultShareAssistant;if(t?.assistantID!==e.id)return;let n=await x();n.serverInstanceID&&t.serverInstanceID===n.serverInstanceID&&E.getState().setDefaultShareAssistant(null)}function pe({assistant:e,open:t,onOpenChange:n,onDeleted:r}){let{t:i}=g(),[a,o]=B.useState(!1),s=e?O(e.name).displayName||e.name:``,c=p(e=>{a&&!e||n(e)}),l=p(()=>{a||n(!1)}),u=p(async()=>{if(!(!e||a)){o(!0);try{await fe(e),r?.(e.id),n(!1),h.success(i(`assistants.settings.toast.deleted`))}catch{h.error(i(`assistants.settings.toast.deleteFailed`))}finally{o(!1)}}});return(0,U.jsx)(F,{open:t&&e!==null,onOpenChange:c,children:(0,U.jsxs)(M,{className:`max-w-md`,children:[(0,U.jsxs)(A,{children:[(0,U.jsx)(N,{children:i(`assistants.settings.delete`)}),(0,U.jsx)(P,{children:i(`assistants.settings.deleteConfirm`,{name:s})})]}),(0,U.jsxs)(j,{children:[(0,U.jsx)(w,{size:`sm`,variant:`ghost`,onClick:l,disabled:a,children:i(`settings.common.actions.cancel`)}),(0,U.jsx)(w,{size:`sm`,variant:`destructive`,onClick:u,disabled:a,children:i(`settings.common.actions.delete`)})]})]})})}var G=`block min-w-0 max-w-full truncate typography-micro text-muted-foreground`,me={image:`assistants.contact.attachment.image`,file:`assistants.contact.attachment.file`,session:`assistants.contact.card.session.untitled`,assistant:`assistants.title`,schedule:`assistants.settings.scheduledTasks.title`};function he(e,t){let n=e?.text??``;return(e?.fallbackKind?n:n.replace(/^\s{0,3}(?:`{3,}|~{3,})[\w+-]*(?:\s+|$)/gmu,``).replace(/`{3,}|~{3,}/gu,``).replace(/^\s{0,3}(?:#{1,6}\s+|(?:>\s*)+|[-+*]\s+(?:\[[ xX]\]\s*)?|\d+[.)]\s+)/gmu,``).replace(/!?\[([^\]\n]*)\]\([^\n)]*(?:\)|$)/gu,`$1`).replace(/!\[([^\]\n]*)(?:\]|$)/gu,`$1`).replace(/(`+)([^`\n]+)\1/gu,`$2`).replace(/(\*{1,3}|~~)(?=\S)(.+?)\1/gu,`$2`).replace(/(?<![\p{L}\p{N}_])(_{1,3})(?=\S)(.+?)\1(?![\p{L}\p{N}_])/gu,`$2`)).replace(/\s+/gu,` `).trim()||t(e?.fallbackKind?me[e.fallbackKind]:`assistants.contact.empty`)}var ge=e=>e.capabilityPending?`loading`:e.capabilityError||e.supported!==!0||e.capabilityEnabled!==!0?`unavailable`:e.snapshotPending?`loading`:e.snapshotEnabled===!0?e.assistantCount===0?`onboarding`:e.hasAssistant?`ready`:e.snapshotSettled?`unavailable`:`loading`:`unavailable`,_e=e({AssistantView:()=>K});function ve(e){let t=(0,V.c)(17),{assistant:n,onClick:r}=e,{t:i}=g(),a;t[0]===n.name?a=t[1]:(a=O(n.name).displayName||n.name,t[0]=n.name,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=i(`assistants.conversation.openSettings`),t[2]=i,t[3]=s);let c=n.id,l=n.avatarSeed,u=!!(n.working||n.activeContactTurn),d;t[4]!==n.avatarSeed||t[5]!==n.id||t[6]!==o||t[7]!==u?(d=(0,U.jsx)(L,{name:c,avatarSeed:l,size:56,label:o,working:u,showWorkingDot:!1}),t[4]=n.avatarSeed,t[5]=n.id,t[6]=o,t[7]=u,t[8]=d):d=t[8];let f;t[9]===o?f=t[10]:(f=(0,U.jsx)(`span`,{className:`yuri-assistant-header-name truncate typography-ui-label font-medium`,children:o}),t[9]=o,t[10]=f);let p;return t[11]!==o||t[12]!==r||t[13]!==s||t[14]!==d||t[15]!==f?(p=(0,U.jsxs)(w,{type:`button`,variant:`ghost`,className:`yuri-assistant-header-identity`,onClick:r,"aria-label":s,title:o,children:[d,f]}),t[11]=o,t[12]=r,t[13]=s,t[14]=d,t[15]=f,t[16]=p):p=t[16],p}var ye=e=>{let t=(0,V.c)(14),{assistant:n,onBack:r,onOpenSettings:i}=e,{t:a}=g(),o=te(),s;t[0]!==n||t[1]!==o||t[2]!==i?(s=()=>{if(n){if(i){i(n.id);return}D(n.id,o?{openMobileSettings:o.openSettings}:void 0)}},t[0]=n,t[1]=o,t[2]=i,t[3]=s):s=t[3];let c=p(s),l;t[4]!==n||t[5]!==c||t[6]!==a?(l=n?(0,U.jsx)(ve,{assistant:n,onClick:c}):a(`assistants.title`),t[4]=n,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=a(`assistants.actions.backToChat`),t[8]=a,t[9]=u);let d;return t[10]!==r||t[11]!==l||t[12]!==u?(d=(0,U.jsx)(S,{className:`yuri-assistant-mobile-header`,title:l,backAriaLabel:u,onBack:r,overlay:!0}),t[10]=r,t[11]=l,t[12]=u,t[13]=d):d=t[13],d},be=e=>{let t=(0,V.c)(34),{assistant:n,avatarSeed:r,unreadCount:i,summary:a,assistantID:o,displayName:s,selected:c,onSelect:l,onEdit:u,onDelete:d,serverWorking:f}=e,m=I(o,f!==void 0&&f),h=B.useRef(null),g;t[0]===l?g=t[1]:(g=()=>l(),t[0]=l,t[1]=g);let _=p(g),v=c?`bg-interactive-selection text-interactive-selection-foreground`:`hover:bg-interactive-hover`,y;t[2]===v?y=t[3]:(y=T(`yuri-assistant-contact-row flex w-full min-h-11 items-center gap-3 rounded-xl border border-transparent px-3 py-3 text-left outline-none transition-[background-color,opacity] duration-150 ease-out active:bg-interactive-active focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] motion-reduce:transition-none`,v),t[2]=v,t[3]=y);let b;t[4]!==o||t[5]!==r||t[6]!==s||t[7]!==m?(b=(0,U.jsx)(L,{name:o,avatarSeed:r,size:44,label:s,working:m,hoverTarget:h}),t[4]=o,t[5]=r,t[6]=s,t[7]=m,t[8]=b):b=t[8];let x=c?`font-semibold`:`font-medium`,S;t[9]===x?S=t[10]:(S=T(`block truncate typography-ui-label leading-5`,x),t[9]=x,t[10]=S);let C;t[11]!==s||t[12]!==S?(C=(0,U.jsx)(`span`,{className:S,children:s}),t[11]=s,t[12]=S,t[13]=C):C=t[13];let w;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(w=T(G,`mt-1 text-[length:calc(var(--text-micro)*0.9)] leading-5`),t[14]=w):w=t[14];let E;t[15]===a?E=t[16]:(E=(0,U.jsx)(`span`,{className:w,children:a}),t[15]=a,t[16]=E);let D;t[17]!==E||t[18]!==C?(D=(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[C,E]}),t[17]=E,t[18]=C,t[19]=D):D=t[19];let O;t[20]===i?O=t[21]:(O=(0,U.jsx)(re,{count:i,className:`h-3.5 min-w-3.5 px-1 text-[10px]`}),t[20]=i,t[21]=O);let k;t[22]!==_||t[23]!==c||t[24]!==D||t[25]!==O||t[26]!==y||t[27]!==b?(k=(0,U.jsxs)(`button`,{ref:h,type:`button`,role:`option`,"aria-selected":c,onClick:_,className:y,children:[b,D,O]}),t[22]=_,t[23]=c,t[24]=D,t[25]=O,t[26]=y,t[27]=b,t[28]=k):k=t[28];let A;return t[29]!==n||t[30]!==d||t[31]!==u||t[32]!==k?(A=(0,U.jsx)(W,{assistant:n,doubleClickMiniChat:!0,onEdit:u,onDelete:d,trigger:k}),t[29]=n,t[30]=d,t[31]=u,t[32]=k,t[33]=A):A=t[33],A},K=e=>{let t=(0,V.c)(112),{activeOverride:n,onMobileBack:r,onMobileOpenSettings:o}=e,{t:s}=g(),{isMobile:c}=ee(),l=te(),u=B.useSyncExternalStore(i,a,a),d=m(xe),f=n??d,h=m(Se),_=c||h,y=v(),b=C(),x=b.data;x?.assistants;let S;t[0]===x?.assistants?S=t[1]:(S=x?.assistants??[],t[0]=x?.assistants,t[1]=S);let T;t[2]===S?T=t[3]:(T=ie(S),t[2]=S,t[3]=T);let A=T,j;t[4]===u?j=t[5]:(j=e=>e.assistantByTransport[u]??null,t[4]=u,t[5]=j);let M=E(j),N=E(Ce),P=E(we),F;t[6]!==M||t[7]!==x?.assistants?(F=x?.assistants.find(e=>e.id===M)??null,t[6]=M,t[7]=x?.assistants,t[8]=F):F=t[8];let I=F,L;t[9]!==N||t[10]!==M||t[11]!==x?(L=()=>{!M&&x?.assistants[0]&&N(x.assistants[0].id)},t[9]=N,t[10]=M,t[11]=x,t[12]=L):L=t[12];let re=x?.assistants,ae;t[13]!==N||t[14]!==M||t[15]!==re?(ae=[N,M,re],t[13]=N,t[14]=M,t[15]=re,t[16]=ae):ae=t[16],B.useEffect(L,ae);let oe;t[17]!==I||t[18]!==N||t[19]!==M||t[20]!==x?.assistants||t[21]!==b.isSuccess?(oe=()=>{b.isSuccess&&M&&!I&&N(x?.assistants[0]?.id??null)},t[17]=I,t[18]=N,t[19]=M,t[20]=x?.assistants,t[21]=b.isSuccess,t[22]=oe):oe=t[22];let se=x?.assistants,R;t[23]!==I||t[24]!==N||t[25]!==M||t[26]!==b.isSuccess||t[27]!==se?(R=[I,N,M,se,b.isSuccess],t[23]=I,t[24]=N,t[25]=M,t[26]=b.isSuccess,t[27]=se,t[28]=R):R=t[28],B.useEffect(oe,R);let z;t[29]!==l||t[30]!==P?(z=()=>{if(P(),l){l.openSettings();return}let e=m.getState();e.setSettingsPage(`assistants`),e.setSettingsDialogOpen(!0)},t[29]=l,t[30]=P,t[31]=z):z=t[31];let H=p(z),ce;t[32]===l?ce=t[33]:(ce=e=>{D(e,l?{openMobileSettings:l.openSettings}:void 0)},t[32]=l,t[33]=ce);let W=p(ce),le;t[34]!==I||t[35]!==l?(le=()=>{I&&D(I.id,l?{openMobileSettings:l.openSettings}:void 0)},t[34]=I,t[35]=l,t[36]=le):le=t[36];let fe=p(le),[G,me]=B.useState(null),_e;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(_e=e=>{me(e)},t[37]=_e):_e=t[37];let K=p(_e),Ee;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=e=>{e||me(null)},t[38]=Ee):Ee=t[38];let De=p(Ee),Oe=p(Te),ke;t[39]!==r||t[40]!==Oe?(ke=()=>{if(r){r();return}Oe()},t[39]=r,t[40]=Oe,t[41]=ke):ke=t[41];let q=p(ke),Ae=ge({capabilityPending:y.isPending,snapshotPending:b.isPending,capabilityError:y.isError,supported:y.data?.supported,capabilityEnabled:y.data?.enabled,snapshotEnabled:x?.enabled,snapshotSettled:b.isSuccess,assistantCount:x?.assistants.length??0,hasAssistant:!!I}),je;t[42]!==I||t[43]!==q||t[44]!==_||t[45]!==o?(je=(e,t,n,r)=>(0,U.jsxs)(`div`,{className:`yuri-assistant-wallpaper yuri-assistant-workspace relative flex h-full min-h-0 flex-col overflow-clip`,"data-assistant-layout":_?`mobile`:`desktop`,children:[_?(0,U.jsx)(ye,{assistant:I,onBack:q,onOpenSettings:o}):null,(0,U.jsxs)(`div`,{className:`yuri-assistant-state flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem))] text-center`,children:[(0,U.jsx)(k,{name:e,className:`size-6 text-muted-foreground`}),(0,U.jsx)(`h1`,{className:`mt-4 typography-ui-header font-semibold`,children:t}),n?(0,U.jsx)(`p`,{className:`mt-2 max-w-md typography-ui text-muted-foreground`,children:n}):null,r?(0,U.jsx)(`div`,{className:`mt-5`,children:r}):null]})]}),t[42]=I,t[43]=q,t[44]=_,t[45]=o,t[46]=je):je=t[46];let J=je;if(Ae===`loading`){let e=_?`mobile`:`desktop`,n;t[47]!==I||t[48]!==q||t[49]!==_||t[50]!==o?(n=_?(0,U.jsx)(ye,{assistant:I,onBack:q,onOpenSettings:o}):null,t[47]=I,t[48]=q,t[49]=_,t[50]=o,t[51]=n):n=t[51];let r;t[52]===s?r=t[53]:(r=s(`common.loading`),t[52]=s,t[53]=r);let i;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsx)(k,{name:`loader-4`,className:`size-6 animate-spin text-muted-foreground`}),t[54]=i):i=t[54];let a;t[55]===r?a=t[56]:(a=(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem))] text-center`,"aria-busy":`true`,"aria-label":r,"data-assistant-workspace-loading":``,children:i}),t[55]=r,t[56]=a);let c;return t[57]!==e||t[58]!==n||t[59]!==a?(c=(0,U.jsxs)(`div`,{className:`yuri-assistant-wallpaper yuri-assistant-workspace relative flex h-full min-h-0 flex-col overflow-clip`,"data-assistant-layout":e,children:[n,a]}),t[57]=e,t[58]=n,t[59]=a,t[60]=c):c=t[60],c}if(Ae===`unavailable`){let e;return t[61]!==J||t[62]!==s?(e=J(`cloud-off`,s(`assistants.state.unavailable`)),t[61]=J,t[62]=s,t[63]=e):e=t[63],e}if(Ae===`onboarding`){let e;if(t[64]!==H||t[65]!==J||t[66]!==s){let n=s(`assistants.onboarding.title`),r=s(`assistants.onboarding.description`),i;t[68]===s?i=t[69]:(i=s(`assistants.onboarding.action`),t[68]=s,t[69]=i);let a;t[70]!==H||t[71]!==i?(a=(0,U.jsx)(w,{onClick:H,children:i}),t[70]=H,t[71]=i,t[72]=a):a=t[72],e=J(`ai-agent`,n,r,a),t[64]=H,t[65]=J,t[66]=s,t[67]=e}else e=t[67];return e}if(!x||!I){let e;return t[73]!==J||t[74]!==s?(e=J(`cloud-off`,s(`assistants.state.unavailable`)),t[73]=J,t[74]=s,t[75]=e):e=t[75],e}let Me;t[76]!==b.isError||t[77]!==s?(Me=b.isError?s(`assistants.state.staleSnapshot`):null,t[76]=b.isError,t[77]=s,t[78]=Me):Me=t[78];let Ne=Me,Pe=_?`mobile`:`desktop`,Y;t[79]!==A||t[80]!==_||t[81]!==H||t[82]!==W||t[83]!==K||t[84]!==N||t[85]!==M||t[86]!==x||t[87]!==s?(Y=_?null:(0,U.jsxs)(`section`,{className:`flex h-full min-h-0 w-[clamp(15rem,20vw,17.5rem)] shrink-0 flex-col overflow-clip yuri-assistant-catalog-panel`,children:[(0,U.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 px-4 py-4 sm:px-5`,children:[(0,U.jsx)(`h1`,{className:`min-w-0 truncate typography-ui-label font-semibold text-foreground`,children:s(`assistants.title`)}),(0,U.jsx)(de,{snapshot:x,compact:!0,rowClassName:`flex min-w-0 flex-1 justify-end`}),(0,U.jsx)(w,{type:`button`,variant:`mobileGlass`,size:`mobileIcon`,className:`size-8 min-h-0 min-w-0`,"aria-label":s(`assistants.settings.create`),onClick:H,children:(0,U.jsx)(k,{name:`add`,className:`size-4`})})]}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 pb-3`,role:`listbox`,"aria-label":s(`assistants.listAria`),children:[(0,U.jsx)(ue,{contacts:A.pinned,selectedAssistantID:M,onSelect:N,onEdit:W,onDelete:K}),(0,U.jsx)(`div`,{className:`flex flex-col gap-1 pt-1`,children:A.unpinned.map(e=>{let t=e.id===M,n=O(e.name);return(0,U.jsx)(be,{assistant:e,assistantID:e.id,avatarSeed:e.avatarSeed,unreadCount:e.unreadCount??0,summary:he(e.latestMessagePreview,s),displayName:n.displayName,selected:t,assignedSessionIDs:e.assignedSessionIDs,serverWorking:e.working,onSelect:()=>N(e.id),onEdit:()=>W(e.id),onDelete:()=>K(e)},e.id)})})]})]}),t[79]=A,t[80]=_,t[81]=H,t[82]=W,t[83]=K,t[84]=N,t[85]=M,t[86]=x,t[87]=s,t[88]=Y):Y=t[88];let Fe=G!==null,X;t[89]!==G||t[90]!==De||t[91]!==Fe?(X=(0,U.jsx)(pe,{assistant:G,open:Fe,onOpenChange:De}),t[89]=G,t[90]=De,t[91]=Fe,t[92]=X):X=t[92];let Z;t[93]!==I||t[94]!==q||t[95]!==_||t[96]!==o||t[97]!==fe?(Z=_?(0,U.jsx)(ye,{assistant:I,onBack:q,onOpenSettings:o}):(0,U.jsx)(`header`,{className:`yuri-assistant-conversation-header`,children:(0,U.jsx)(ve,{assistant:I,onClick:fe})}),t[93]=I,t[94]=q,t[95]=_,t[96]=o,t[97]=fe,t[98]=Z):Z=t[98];let Q;t[99]!==f||t[100]!==I||t[101]!==_||t[102]!==Ne?(Q=(0,U.jsx)(ne,{assistant:I,warning:Ne,active:f,overlayHeader:_,overlayComposer:!0}),t[99]=f,t[100]=I,t[101]=_,t[102]=Ne,t[103]=Q):Q=t[103];let $;t[104]!==Z||t[105]!==Q?($=(0,U.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col overflow-clip yuri-assistant-pane`,children:[Z,Q]}),t[104]=Z,t[105]=Q,t[106]=$):$=t[106];let Ie;return t[107]!==Pe||t[108]!==Y||t[109]!==X||t[110]!==$?(Ie=(0,U.jsxs)(`div`,{className:`relative flex h-full min-h-0 overflow-clip yuri-assistant-wallpaper yuri-assistant-workspace`,"data-presentation":`workspace`,"data-assistant-layout":Pe,children:[Y,X,$]}),t[107]=Pe,t[108]=Y,t[109]=X,t[110]=$,t[111]=Ie):Ie=t[111],Ie};function xe(e){return e.activeMainTab===`assistant`}function Se(e){return e.isMobile}function Ce(e){return e.selectAssistant}function we(e){return e.requestCreate}function Te(){m.getState().setActiveMainTab(`chat`)}export{pe as a,W as c,he as i,_e as n,de as o,G as r,ue as s,K as t};
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{c as n,w as r}from"./runtime-auth-mjIpsk3N.js";import{c as i,i as a,t as o}from"./runtime-switch-BMjl5Y5W.js";import{j as s,m as c}from"./platform-wF65ZFgV.js";import{ot as l,st as u}from"./vendor-base-ui-fom6orB6.js";import{n as d}from"./vendor-react-D5BntRmA.js";import{n as f}from"./vendor-tanstack-react-query-ChSd65dm.js";import{r as p}from"./vendor-reactuses-core-B8s-Rcd-.js";import{r as m}from"./useUIStore-CYex4rbF.js";import{r as h}from"./vendor-sonner-Y-KPX915.js";import{t as g}from"./i18n-OsFhnlRH.js";import{a as _,h as v,l as y,m as b,s as x,t as S,v as C}from"./MobileDetailNavigation-C5cGr0_z.js";import{In as w,Rn as T}from"./useMobileNavigationStore-zEWQLkBM.js";import{i as E,r as D}from"./useAssistantUIStore-CphyXHEY.js";import{a as O}from"./MobileShareBridge-WMVB0JDL.js";import{n as k}from"./Icon-DmIDd0Q3.js";import{a as A,i as j,n as M,o as N,r as P,t as F}from"./dialog-BC7o8gDY.js";import{r as ee}from"./device-C8ZHblkr.js";import{c as te}from"./sessionLookup-BBqXTJRj.js";import{i as I,r as L,t as ne}from"./AssistantConversationSurface-Fb-zSPo9.js";import{n as re,r as ie}from"./AssistantUnreadBadge-rZCi09a_.js";import{a as ae,i as oe,n as se,r as R,t as z}from"./context-menu-BImF2R_w.js";var B=t(u(),1),V=d(),H=()=>c()&&!r(),ce=async e=>{if(!H())throw Error(`Assistant Mini Chat requires a direct desktop connection`);await s(`desktop_open_assistant_mini_chat_window`,{assistantID:e,apiBaseUrl:o(),clientToken:n()})},U=l();function W(e){let t=(0,V.c)(49),{assistant:n,trigger:r,onEdit:i,onDelete:o,doubleClickMiniChat:s}=e,c=s!==void 0&&s,{t:l}=g(),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=a(),t[0]=u):u=t[0];let d;t[1]===n.id?d=t[2]:(d=[u,`assistants`,n.id,`pin`],t[1]=n.id,t[2]=d);let p;t[3]===n?p=t[4]:(p=()=>b(n,{pinned:n.pinnedAt==null}),t[3]=n,t[4]=p);let m;t[5]===l?m=t[6]:(m=()=>h.error(l(`assistants.menu.pinError`)),t[5]=l,t[6]=m);let _;t[7]!==d||t[8]!==p||t[9]!==m?(_={mutationKey:d,mutationFn:p,onError:m},t[7]=d,t[8]=p,t[9]=m,t[10]=_):_=t[10];let v=f(_),y;t[11]!==n.id||t[12]!==l?(y=()=>{ce(n.id).catch(()=>h.error(l(`miniChat.actions.failed`)))},t[11]=n.id,t[12]=l,t[13]=y):y=t[13];let x=y,S=r,C;t[14]!==S||t[15]!==c||t[16]!==x||t[17]!==r?(C=c?B.cloneElement(S,{onDoubleClick:e=>{S.props.onDoubleClick?.(e),!e.defaultPrevented&&H()&&x()}}):r,t[14]=S,t[15]=c,t[16]=x,t[17]=r,t[18]=C):C=t[18];let w;t[19]===C?w=t[20]:(w=(0,U.jsx)(ae,{render:C}),t[19]=C,t[20]=w);let T;t[21]!==n.pinnedAt||t[22]!==v||t[23]!==l?(T=n.pinnedAt===void 0?null:(0,U.jsxs)(R,{disabled:v.isPending,onClick:()=>v.mutate(),children:[(0,U.jsx)(k,{name:n.pinnedAt==null?`pushpin-2`:`unpin`,className:`size-4`}),l(n.pinnedAt==null?`assistants.menu.pin`:`assistants.menu.unpin`)]}),t[21]=n.pinnedAt,t[22]=v,t[23]=l,t[24]=T):T=t[24];let E;t[25]!==x||t[26]!==l?(E=H()?(0,U.jsxs)(R,{onClick:x,children:[(0,U.jsx)(k,{name:`external-link`,className:`size-4`}),l(`sessions.sidebar.session.menu.openMiniChatWindow`)]}):null,t[25]=x,t[26]=l,t[27]=E):E=t[27];let D;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,U.jsx)(k,{name:`edit`,className:`size-4`}),t[28]=D):D=t[28];let O;t[29]===l?O=t[30]:(O=l(`assistants.menu.edit`),t[29]=l,t[30]=O);let A;t[31]!==i||t[32]!==O?(A=(0,U.jsxs)(R,{onClick:i,children:[D,O]}),t[31]=i,t[32]=O,t[33]=A):A=t[33];let j;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,U.jsx)(oe,{}),t[34]=j):j=t[34];let M;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,U.jsx)(k,{name:`delete-bin`,className:`size-4 text-inherit`}),t[35]=M):M=t[35];let N;t[36]===l?N=t[37]:(N=l(`assistants.settings.delete`),t[36]=l,t[37]=N);let P;t[38]!==o||t[39]!==N?(P=(0,U.jsxs)(R,{onClick:o,className:`text-[var(--status-error)] focus:text-[var(--status-error)] data-[highlighted]:text-[var(--status-error)]`,children:[M,N]}),t[38]=o,t[39]=N,t[40]=P):P=t[40];let F;t[41]!==T||t[42]!==E||t[43]!==A||t[44]!==P?(F=(0,U.jsxs)(se,{className:`min-w-[10rem]`,children:[T,E,A,j,P]}),t[41]=T,t[42]=E,t[43]=A,t[44]=P,t[45]=F):F=t[45];let ee;return t[46]!==F||t[47]!==w?(ee=(0,U.jsxs)(z,{children:[w,F]}),t[46]=F,t[47]=w,t[48]=ee):ee=t[48],ee}function le(e){let t=(0,V.c)(38),{assistant:n,selected:r,onSelect:i,onEdit:a,onDelete:o}=e,s=B.useRef(null),c=I(n.id,n.working),l;t[0]===n.name?l=t[1]:(l=O(n.name).displayName||n.name,t[0]=n.name,t[1]=l);let u=l,d;t[2]!==n.id||t[3]!==a?(d=()=>a(n.id),t[2]=n.id,t[3]=a,t[4]=d):d=t[4];let f;t[5]!==n||t[6]!==o?(f=()=>o(n),t[5]=n,t[6]=o,t[7]=f):f=t[7];let p=n.id,m;t[8]!==n.id||t[9]!==i?(m=()=>i(n.id),t[8]=n.id,t[9]=i,t[10]=m):m=t[10];let h=r?`bg-[var(--surface-muted)]`:`hover:bg-interactive-hover`,g;t[11]===h?g=t[12]:(g=T(`flex w-full min-w-0 max-w-28 flex-col items-center gap-2 rounded-2xl px-2 py-3 text-center outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] active:bg-interactive-active motion-reduce:transition-none`,h),t[11]=h,t[12]=g);let _;t[13]!==n.avatarSeed||t[14]!==n.id||t[15]!==u||t[16]!==c?(_=(0,U.jsx)(L,{name:n.id,avatarSeed:n.avatarSeed,size:64,label:u,working:c,hoverTarget:s}),t[13]=n.avatarSeed,t[14]=n.id,t[15]=u,t[16]=c,t[17]=_):_=t[17];let v=n.unreadCount??0,y;t[18]===v?y=t[19]:(y=(0,U.jsx)(re,{count:v,className:`absolute -right-1 -top-1`}),t[18]=v,t[19]=y);let b;t[20]!==y||t[21]!==_?(b=(0,U.jsxs)(`span`,{className:`relative`,children:[_,y]}),t[20]=y,t[21]=_,t[22]=b):b=t[22];let x;t[23]===u?x=t[24]:(x=(0,U.jsx)(`span`,{className:`w-full truncate typography-ui-label font-medium leading-5`,children:u}),t[23]=u,t[24]=x);let S;t[25]!==n.id||t[26]!==u||t[27]!==r||t[28]!==b||t[29]!==x||t[30]!==m||t[31]!==g?(S=(0,U.jsxs)(`button`,{ref:s,type:`button`,role:`option`,"aria-selected":r,title:u,"data-assistant-pinned":p,"data-mobile-press-feedback":`soft`,onClick:m,className:g,children:[b,x]}),t[25]=n.id,t[26]=u,t[27]=r,t[28]=b,t[29]=x,t[30]=m,t[31]=g,t[32]=S):S=t[32];let C;return t[33]!==n||t[34]!==S||t[35]!==d||t[36]!==f?(C=(0,U.jsx)(W,{assistant:n,doubleClickMiniChat:!0,onEdit:d,onDelete:f,trigger:S}),t[33]=n,t[34]=S,t[35]=d,t[36]=f,t[37]=C):C=t[37],C}function ue(e){let t=(0,V.c)(16),{contacts:n,selectedAssistantID:r,onSelect:i,onEdit:a,onDelete:o}=e,{t:s}=g();if(n.length===0)return null;let c;t[0]===s?c=t[1]:(c=s(`assistants.list.pinned`),t[0]=s,t[1]=c);let l;if(t[2]!==n||t[3]!==o||t[4]!==a||t[5]!==i||t[6]!==r){let e;t[8]!==o||t[9]!==a||t[10]!==i||t[11]!==r?(e=e=>(0,U.jsx)(le,{assistant:e,selected:e.id===r,onSelect:i,onEdit:a,onDelete:o},e.id),t[8]=o,t[9]=a,t[10]=i,t[11]=r,t[12]=e):e=t[12],l=n.map(e),t[2]=n,t[3]=o,t[4]=a,t[5]=i,t[6]=r,t[7]=l}else l=t[7];let u;return t[13]!==c||t[14]!==l?(u=(0,U.jsx)(`div`,{role:`group`,"aria-label":c,className:`yuri-assistant-pinned-contacts grid grid-cols-1 justify-items-center gap-2 pb-3 pt-2`,children:l}),t[13]=c,t[14]=l,t[15]=u):u=t[15],u}function de({snapshot:e,rowClassName:t,compact:n=!1,mobile:r=!1}){let{t:i}=g(),[a,o]=B.useState(!1),s=B.useRef(!1),c=p(async()=>{if(!s.current){s.current=!0,o(!0);try{(await y(e)).failed&&h.error(i(`assistants.unread.markAllFailed`))}catch{h.error(i(`assistants.unread.markAllFailed`))}finally{s.current=!1,o(!1)}}}),l=e.assistants.some(e=>(e.unreadCount??0)>0);return!n&&!l?null:(0,U.jsx)(`div`,{className:t,style:n&&!l?{visibility:`hidden`}:void 0,children:(0,U.jsx)(w,{type:`button`,variant:r?`mobileGlass`:`ghost`,size:r?`mobileIcon`:`icon`,onClick:c,"aria-label":i(`assistants.unread.markAll`),title:i(`assistants.unread.markAll`),disabled:a||!e.assistants.some(e=>(e.unreadCount??0)>0&&e.readTip),"aria-busy":a,children:(0,U.jsx)(k,{name:`check-double`,className:r?`size-5`:`size-4`})})})}async function fe(e){await _(e);let t=E.getState().defaultShareAssistant;if(t?.assistantID!==e.id)return;let n=await x();n.serverInstanceID&&t.serverInstanceID===n.serverInstanceID&&E.getState().setDefaultShareAssistant(null)}function pe({assistant:e,open:t,onOpenChange:n,onDeleted:r}){let{t:i}=g(),[a,o]=B.useState(!1),s=e?O(e.name).displayName||e.name:``,c=p(e=>{a&&!e||n(e)}),l=p(()=>{a||n(!1)}),u=p(async()=>{if(!(!e||a)){o(!0);try{await fe(e),r?.(e.id),n(!1),h.success(i(`assistants.settings.toast.deleted`))}catch{h.error(i(`assistants.settings.toast.deleteFailed`))}finally{o(!1)}}});return(0,U.jsx)(F,{open:t&&e!==null,onOpenChange:c,children:(0,U.jsxs)(M,{className:`max-w-md`,children:[(0,U.jsxs)(A,{children:[(0,U.jsx)(N,{children:i(`assistants.settings.delete`)}),(0,U.jsx)(P,{children:i(`assistants.settings.deleteConfirm`,{name:s})})]}),(0,U.jsxs)(j,{children:[(0,U.jsx)(w,{size:`sm`,variant:`ghost`,onClick:l,disabled:a,children:i(`settings.common.actions.cancel`)}),(0,U.jsx)(w,{size:`sm`,variant:`destructive`,onClick:u,disabled:a,children:i(`settings.common.actions.delete`)})]})]})})}var G=`block min-w-0 max-w-full truncate typography-micro text-muted-foreground`,me={image:`assistants.contact.attachment.image`,file:`assistants.contact.attachment.file`,session:`assistants.contact.card.session.untitled`,assistant:`assistants.title`,schedule:`assistants.settings.scheduledTasks.title`};function he(e,t){let n=e?.text??``;return(e?.fallbackKind?n:n.replace(/^\s{0,3}(?:`{3,}|~{3,})[\w+-]*(?:\s+|$)/gmu,``).replace(/`{3,}|~{3,}/gu,``).replace(/^\s{0,3}(?:#{1,6}\s+|(?:>\s*)+|[-+*]\s+(?:\[[ xX]\]\s*)?|\d+[.)]\s+)/gmu,``).replace(/!?\[([^\]\n]*)\]\([^\n)]*(?:\)|$)/gu,`$1`).replace(/!\[([^\]\n]*)(?:\]|$)/gu,`$1`).replace(/(`+)([^`\n]+)\1/gu,`$2`).replace(/(\*{1,3}|~~)(?=\S)(.+?)\1/gu,`$2`).replace(/(?<![\p{L}\p{N}_])(_{1,3})(?=\S)(.+?)\1(?![\p{L}\p{N}_])/gu,`$2`)).replace(/\s+/gu,` `).trim()||t(e?.fallbackKind?me[e.fallbackKind]:`assistants.contact.empty`)}var ge=e=>e.capabilityPending?`loading`:e.capabilityError||e.supported!==!0||e.capabilityEnabled!==!0?`unavailable`:e.snapshotPending?`loading`:e.snapshotEnabled===!0?e.assistantCount===0?`onboarding`:e.hasAssistant?`ready`:e.snapshotSettled?`unavailable`:`loading`:`unavailable`,_e=e({AssistantView:()=>K});function ve(e){let t=(0,V.c)(17),{assistant:n,onClick:r}=e,{t:i}=g(),a;t[0]===n.name?a=t[1]:(a=O(n.name).displayName||n.name,t[0]=n.name,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=i(`assistants.conversation.openSettings`),t[2]=i,t[3]=s);let c=n.id,l=n.avatarSeed,u=!!(n.working||n.activeContactTurn),d;t[4]!==n.avatarSeed||t[5]!==n.id||t[6]!==o||t[7]!==u?(d=(0,U.jsx)(L,{name:c,avatarSeed:l,size:56,label:o,working:u,showWorkingDot:!1}),t[4]=n.avatarSeed,t[5]=n.id,t[6]=o,t[7]=u,t[8]=d):d=t[8];let f;t[9]===o?f=t[10]:(f=(0,U.jsx)(`span`,{className:`yuri-assistant-header-name truncate typography-ui-label font-medium`,children:o}),t[9]=o,t[10]=f);let p;return t[11]!==o||t[12]!==r||t[13]!==s||t[14]!==d||t[15]!==f?(p=(0,U.jsxs)(w,{type:`button`,variant:`ghost`,className:`yuri-assistant-header-identity`,onClick:r,"aria-label":s,title:o,children:[d,f]}),t[11]=o,t[12]=r,t[13]=s,t[14]=d,t[15]=f,t[16]=p):p=t[16],p}var ye=e=>{let t=(0,V.c)(14),{assistant:n,onBack:r,onOpenSettings:i}=e,{t:a}=g(),o=te(),s;t[0]!==n||t[1]!==o||t[2]!==i?(s=()=>{if(n){if(i){i(n.id);return}D(n.id,o?{openMobileSettings:o.openSettings}:void 0)}},t[0]=n,t[1]=o,t[2]=i,t[3]=s):s=t[3];let c=p(s),l;t[4]!==n||t[5]!==c||t[6]!==a?(l=n?(0,U.jsx)(ve,{assistant:n,onClick:c}):a(`assistants.title`),t[4]=n,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=a(`assistants.actions.backToChat`),t[8]=a,t[9]=u);let d;return t[10]!==r||t[11]!==l||t[12]!==u?(d=(0,U.jsx)(S,{className:`yuri-assistant-mobile-header`,title:l,backAriaLabel:u,onBack:r,overlay:!0}),t[10]=r,t[11]=l,t[12]=u,t[13]=d):d=t[13],d},be=e=>{let t=(0,V.c)(34),{assistant:n,avatarSeed:r,unreadCount:i,summary:a,assistantID:o,displayName:s,selected:c,onSelect:l,onEdit:u,onDelete:d,serverWorking:f}=e,m=I(o,f!==void 0&&f),h=B.useRef(null),g;t[0]===l?g=t[1]:(g=()=>l(),t[0]=l,t[1]=g);let _=p(g),v=c?`bg-interactive-selection text-interactive-selection-foreground`:`hover:bg-interactive-hover`,y;t[2]===v?y=t[3]:(y=T(`yuri-assistant-contact-row flex w-full min-h-11 items-center gap-3 rounded-xl border border-transparent px-3 py-3 text-left outline-none transition-[background-color,opacity] duration-150 ease-out active:bg-interactive-active focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] motion-reduce:transition-none`,v),t[2]=v,t[3]=y);let b;t[4]!==o||t[5]!==r||t[6]!==s||t[7]!==m?(b=(0,U.jsx)(L,{name:o,avatarSeed:r,size:44,label:s,working:m,hoverTarget:h}),t[4]=o,t[5]=r,t[6]=s,t[7]=m,t[8]=b):b=t[8];let x=c?`font-semibold`:`font-medium`,S;t[9]===x?S=t[10]:(S=T(`block truncate typography-ui-label leading-5`,x),t[9]=x,t[10]=S);let C;t[11]!==s||t[12]!==S?(C=(0,U.jsx)(`span`,{className:S,children:s}),t[11]=s,t[12]=S,t[13]=C):C=t[13];let w;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(w=T(G,`mt-1 text-[length:calc(var(--text-micro)*0.9)] leading-5`),t[14]=w):w=t[14];let E;t[15]===a?E=t[16]:(E=(0,U.jsx)(`span`,{className:w,children:a}),t[15]=a,t[16]=E);let D;t[17]!==E||t[18]!==C?(D=(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[C,E]}),t[17]=E,t[18]=C,t[19]=D):D=t[19];let O;t[20]===i?O=t[21]:(O=(0,U.jsx)(re,{count:i,className:`h-3.5 min-w-3.5 px-1 text-[10px]`}),t[20]=i,t[21]=O);let k;t[22]!==_||t[23]!==c||t[24]!==D||t[25]!==O||t[26]!==y||t[27]!==b?(k=(0,U.jsxs)(`button`,{ref:h,type:`button`,role:`option`,"aria-selected":c,onClick:_,className:y,children:[b,D,O]}),t[22]=_,t[23]=c,t[24]=D,t[25]=O,t[26]=y,t[27]=b,t[28]=k):k=t[28];let A;return t[29]!==n||t[30]!==d||t[31]!==u||t[32]!==k?(A=(0,U.jsx)(W,{assistant:n,doubleClickMiniChat:!0,onEdit:u,onDelete:d,trigger:k}),t[29]=n,t[30]=d,t[31]=u,t[32]=k,t[33]=A):A=t[33],A},K=e=>{let t=(0,V.c)(112),{activeOverride:n,onMobileBack:r,onMobileOpenSettings:o}=e,{t:s}=g(),{isMobile:c}=ee(),l=te(),u=B.useSyncExternalStore(i,a,a),d=m(xe),f=n??d,h=m(Se),_=c||h,y=v(),b=C(),x=b.data;x?.assistants;let S;t[0]===x?.assistants?S=t[1]:(S=x?.assistants??[],t[0]=x?.assistants,t[1]=S);let T;t[2]===S?T=t[3]:(T=ie(S),t[2]=S,t[3]=T);let A=T,j;t[4]===u?j=t[5]:(j=e=>e.assistantByTransport[u]??null,t[4]=u,t[5]=j);let M=E(j),N=E(Ce),P=E(we),F;t[6]!==M||t[7]!==x?.assistants?(F=x?.assistants.find(e=>e.id===M)??null,t[6]=M,t[7]=x?.assistants,t[8]=F):F=t[8];let I=F,L;t[9]!==N||t[10]!==M||t[11]!==x?(L=()=>{!M&&x?.assistants[0]&&N(x.assistants[0].id)},t[9]=N,t[10]=M,t[11]=x,t[12]=L):L=t[12];let re=x?.assistants,ae;t[13]!==N||t[14]!==M||t[15]!==re?(ae=[N,M,re],t[13]=N,t[14]=M,t[15]=re,t[16]=ae):ae=t[16],B.useEffect(L,ae);let oe;t[17]!==I||t[18]!==N||t[19]!==M||t[20]!==x?.assistants||t[21]!==b.isSuccess?(oe=()=>{b.isSuccess&&M&&!I&&N(x?.assistants[0]?.id??null)},t[17]=I,t[18]=N,t[19]=M,t[20]=x?.assistants,t[21]=b.isSuccess,t[22]=oe):oe=t[22];let se=x?.assistants,R;t[23]!==I||t[24]!==N||t[25]!==M||t[26]!==b.isSuccess||t[27]!==se?(R=[I,N,M,se,b.isSuccess],t[23]=I,t[24]=N,t[25]=M,t[26]=b.isSuccess,t[27]=se,t[28]=R):R=t[28],B.useEffect(oe,R);let z;t[29]!==l||t[30]!==P?(z=()=>{if(P(),l){l.openSettings();return}let e=m.getState();e.setSettingsPage(`assistants`),e.setSettingsDialogOpen(!0)},t[29]=l,t[30]=P,t[31]=z):z=t[31];let H=p(z),ce;t[32]===l?ce=t[33]:(ce=e=>{D(e,l?{openMobileSettings:l.openSettings}:void 0)},t[32]=l,t[33]=ce);let W=p(ce),le;t[34]!==I||t[35]!==l?(le=()=>{I&&D(I.id,l?{openMobileSettings:l.openSettings}:void 0)},t[34]=I,t[35]=l,t[36]=le):le=t[36];let fe=p(le),[G,me]=B.useState(null),_e;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(_e=e=>{me(e)},t[37]=_e):_e=t[37];let K=p(_e),Ee;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=e=>{e||me(null)},t[38]=Ee):Ee=t[38];let De=p(Ee),Oe=p(Te),ke;t[39]!==r||t[40]!==Oe?(ke=()=>{if(r){r();return}Oe()},t[39]=r,t[40]=Oe,t[41]=ke):ke=t[41];let q=p(ke),Ae=ge({capabilityPending:y.isPending,snapshotPending:b.isPending,capabilityError:y.isError,supported:y.data?.supported,capabilityEnabled:y.data?.enabled,snapshotEnabled:x?.enabled,snapshotSettled:b.isSuccess,assistantCount:x?.assistants.length??0,hasAssistant:!!I}),je;t[42]!==I||t[43]!==q||t[44]!==_||t[45]!==o?(je=(e,t,n,r)=>(0,U.jsxs)(`div`,{className:`yuri-assistant-wallpaper yuri-assistant-workspace relative flex h-full min-h-0 flex-col overflow-clip`,"data-assistant-layout":_?`mobile`:`desktop`,children:[_?(0,U.jsx)(ye,{assistant:I,onBack:q,onOpenSettings:o}):null,(0,U.jsxs)(`div`,{className:`yuri-assistant-state flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem))] text-center`,children:[(0,U.jsx)(k,{name:e,className:`size-6 text-muted-foreground`}),(0,U.jsx)(`h1`,{className:`mt-4 typography-ui-header font-semibold`,children:t}),n?(0,U.jsx)(`p`,{className:`mt-2 max-w-md typography-ui text-muted-foreground`,children:n}):null,r?(0,U.jsx)(`div`,{className:`mt-5`,children:r}):null]})]}),t[42]=I,t[43]=q,t[44]=_,t[45]=o,t[46]=je):je=t[46];let J=je;if(Ae===`loading`){let e=_?`mobile`:`desktop`,n;t[47]!==I||t[48]!==q||t[49]!==_||t[50]!==o?(n=_?(0,U.jsx)(ye,{assistant:I,onBack:q,onOpenSettings:o}):null,t[47]=I,t[48]=q,t[49]=_,t[50]=o,t[51]=n):n=t[51];let r;t[52]===s?r=t[53]:(r=s(`common.loading`),t[52]=s,t[53]=r);let i;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,U.jsx)(k,{name:`loader-4`,className:`size-6 animate-spin text-muted-foreground`}),t[54]=i):i=t[54];let a;t[55]===r?a=t[56]:(a=(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center px-6 pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem))] text-center`,"aria-busy":`true`,"aria-label":r,"data-assistant-workspace-loading":``,children:i}),t[55]=r,t[56]=a);let c;return t[57]!==e||t[58]!==n||t[59]!==a?(c=(0,U.jsxs)(`div`,{className:`yuri-assistant-wallpaper yuri-assistant-workspace relative flex h-full min-h-0 flex-col overflow-clip`,"data-assistant-layout":e,children:[n,a]}),t[57]=e,t[58]=n,t[59]=a,t[60]=c):c=t[60],c}if(Ae===`unavailable`){let e;return t[61]!==J||t[62]!==s?(e=J(`cloud-off`,s(`assistants.state.unavailable`)),t[61]=J,t[62]=s,t[63]=e):e=t[63],e}if(Ae===`onboarding`){let e;if(t[64]!==H||t[65]!==J||t[66]!==s){let n=s(`assistants.onboarding.title`),r=s(`assistants.onboarding.description`),i;t[68]===s?i=t[69]:(i=s(`assistants.onboarding.action`),t[68]=s,t[69]=i);let a;t[70]!==H||t[71]!==i?(a=(0,U.jsx)(w,{onClick:H,children:i}),t[70]=H,t[71]=i,t[72]=a):a=t[72],e=J(`ai-agent`,n,r,a),t[64]=H,t[65]=J,t[66]=s,t[67]=e}else e=t[67];return e}if(!x||!I){let e;return t[73]!==J||t[74]!==s?(e=J(`cloud-off`,s(`assistants.state.unavailable`)),t[73]=J,t[74]=s,t[75]=e):e=t[75],e}let Me;t[76]!==b.isError||t[77]!==s?(Me=b.isError?s(`assistants.state.staleSnapshot`):null,t[76]=b.isError,t[77]=s,t[78]=Me):Me=t[78];let Ne=Me,Pe=_?`mobile`:`desktop`,Y;t[79]!==A||t[80]!==_||t[81]!==H||t[82]!==W||t[83]!==K||t[84]!==N||t[85]!==M||t[86]!==x||t[87]!==s?(Y=_?null:(0,U.jsxs)(`section`,{className:`flex h-full min-h-0 w-[clamp(15rem,20vw,17.5rem)] shrink-0 flex-col overflow-clip yuri-assistant-catalog-panel`,children:[(0,U.jsxs)(`header`,{className:`flex shrink-0 items-center gap-3 px-4 py-4 sm:px-5`,children:[(0,U.jsx)(`h1`,{className:`min-w-0 truncate typography-ui-label font-semibold text-foreground`,children:s(`assistants.title`)}),(0,U.jsx)(de,{snapshot:x,compact:!0,rowClassName:`flex min-w-0 flex-1 justify-end`}),(0,U.jsx)(w,{type:`button`,variant:`mobileGlass`,size:`mobileIcon`,className:`size-8 min-h-0 min-w-0`,"aria-label":s(`assistants.settings.create`),onClick:H,children:(0,U.jsx)(k,{name:`add`,className:`size-4`})})]}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 pb-3`,role:`listbox`,"aria-label":s(`assistants.listAria`),children:[(0,U.jsx)(ue,{contacts:A.pinned,selectedAssistantID:M,onSelect:N,onEdit:W,onDelete:K}),(0,U.jsx)(`div`,{className:`flex flex-col gap-1 pt-1`,children:A.unpinned.map(e=>{let t=e.id===M,n=O(e.name);return(0,U.jsx)(be,{assistant:e,assistantID:e.id,avatarSeed:e.avatarSeed,unreadCount:e.unreadCount??0,summary:he(e.latestMessagePreview,s),displayName:n.displayName,selected:t,assignedSessionIDs:e.assignedSessionIDs,serverWorking:e.working,onSelect:()=>N(e.id),onEdit:()=>W(e.id),onDelete:()=>K(e)},e.id)})})]})]}),t[79]=A,t[80]=_,t[81]=H,t[82]=W,t[83]=K,t[84]=N,t[85]=M,t[86]=x,t[87]=s,t[88]=Y):Y=t[88];let Fe=G!==null,X;t[89]!==G||t[90]!==De||t[91]!==Fe?(X=(0,U.jsx)(pe,{assistant:G,open:Fe,onOpenChange:De}),t[89]=G,t[90]=De,t[91]=Fe,t[92]=X):X=t[92];let Z;t[93]!==I||t[94]!==q||t[95]!==_||t[96]!==o||t[97]!==fe?(Z=_?(0,U.jsx)(ye,{assistant:I,onBack:q,onOpenSettings:o}):(0,U.jsx)(`header`,{className:`yuri-assistant-conversation-header`,children:(0,U.jsx)(ve,{assistant:I,onClick:fe})}),t[93]=I,t[94]=q,t[95]=_,t[96]=o,t[97]=fe,t[98]=Z):Z=t[98];let Q;t[99]!==f||t[100]!==I||t[101]!==_||t[102]!==Ne?(Q=(0,U.jsx)(ne,{assistant:I,warning:Ne,active:f,overlayHeader:_,overlayComposer:!0}),t[99]=f,t[100]=I,t[101]=_,t[102]=Ne,t[103]=Q):Q=t[103];let $;t[104]!==Z||t[105]!==Q?($=(0,U.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col overflow-clip yuri-assistant-pane`,children:[Z,Q]}),t[104]=Z,t[105]=Q,t[106]=$):$=t[106];let Ie;return t[107]!==Pe||t[108]!==Y||t[109]!==X||t[110]!==$?(Ie=(0,U.jsxs)(`div`,{className:`relative flex h-full min-h-0 overflow-clip yuri-assistant-wallpaper yuri-assistant-workspace`,"data-presentation":`workspace`,"data-assistant-layout":Pe,children:[Y,X,$]}),t[107]=Pe,t[108]=Y,t[109]=X,t[110]=$,t[111]=Ie):Ie=t[111],Ie};function xe(e){return e.activeMainTab===`assistant`}function Se(e){return e.isMobile}function Ce(e){return e.selectAssistant}function we(e){return e.requestCreate}function Te(){m.getState().setActiveMainTab(`chat`)}export{pe as a,W as c,he as i,_e as n,de as o,G as r,ue as s,K as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./runtime-switch-BMjl5Y5W.js";import{ot as n,st as r}from"./vendor-base-ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./runtime-switch-BMjl5Y5W.js";import{ot as n,st as r}from"./vendor-base-ui-fom6orB6.js";import{u as i}from"./vendor-tanstack-react-query-ChSd65dm.js";import{S as a,_ as o,x as s}from"./runtime-file-resource-DnhWnndu.js";import{r as c}from"./useUIStore-CYex4rbF.js";import{r as l}from"./vendor-sonner-Y-KPX915.js";import{t as u}from"./i18n-OsFhnlRH.js";import{n as d}from"./Icon-DmIDd0Q3.js";import{n as f}from"./useEffectiveDirectory-6o2SvpVe.js";import{n as p}from"./useProjectRuntimeAPIs-D6zSDR6i.js";import{t as m}from"./diagram-DgoUJTH7.js";var h=e(r(),1),g=n();function _(){let{t:e}=u(),{files:n}=p(),r=i(),_=f()??null,v=t(),[y,b]=h.useState(null),[x,S]=h.useState(``),C=h.useRef(null),w=h.useRef(!1),T=h.useRef(null),E=h.useRef(0),D=h.useRef(Promise.resolve()),O=c(e=>e.pendingDiagramFile),k=a({scopeDirectory:_,path:y},{enabled:!!y});if(y&&(T.current?.path!==y||T.current.transport!==v||T.current.scopeDirectory!==_)){let e=E.current+1;E.current=e,T.current={path:y,generation:e,transport:v,scopeDirectory:_}}h.useEffect(()=>(w.current=!0,()=>{w.current=!1,E.current+=1}),[]),h.useEffect(()=>{if(!O)return;let e=c.getState().consumePendingDiagramFile();if(e){let t=E.current+1;E.current=t,T.current={path:e,generation:t,transport:v,scopeDirectory:_},b(e)}},[_,O,v]),h.useEffect(()=>{let e=T.current;if(!(!e||e.path!==y||e.transport!==v||e.scopeDirectory!==_)){if(k.data!==void 0){S(k.data);return}k.isError&&S(``)}},[_,y,k.data,k.isError,v]);let A=h.useCallback(async()=>{let t=C.current?.getXml(),i=T.current,a=n?.writeFile;if(!y||!a||!t||t===x||i?.path!==y)return;let{path:c,generation:u,scopeDirectory:d,transport:f}=i,p=D.current.then(async()=>{try{if(!(await a(c,t))?.success)throw Error(e(`filesView.toast.writeFileFailed`));let n={scopeDirectory:d,path:c};await r.cancelQueries({queryKey:o(n,f),exact:!0}),s(r,n,f,t);let i=T.current;w.current&&i?.path===c&&i.generation===u&&i.transport===f&&i.scopeDirectory===d&&S(t)}catch(t){l.error(t instanceof Error?t.message:e(`filesView.toast.saveFailed`))}});D.current=p.catch(()=>void 0),await p},[y,n,r,e,x]),j=y?y.split(`/`).pop()||y:``;return y?k.isPending?(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center p-3`,children:(0,g.jsx)(d,{name:`loader-4`,className:`size-4 animate-spin`})}):(0,g.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/30 px-3 py-1.5`,children:[(0,g.jsx)(d,{name:`file`,className:`size-4 shrink-0 text-muted-foreground`}),(0,g.jsx)(`span`,{className:`typography-ui text-muted-foreground truncate flex-1`,children:j}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>void A(),className:`size-6 flex items-center justify-center rounded-md text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,title:e(`filesView.diagram.saveDiagram`),children:(0,g.jsx)(d,{name:`save-3`,className:`size-4`})}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>c.getState().setActiveMainTab(`chat`),className:`size-6 flex items-center justify-center rounded-md text-muted-foreground hover:bg-interactive-hover/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,title:e(`filesView.diagram.closeDiagramView`),children:(0,g.jsx)(d,{name:`close`,className:`size-4`})})]}),(0,g.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,g.jsx)(m,{ref:C,xml:x,className:`h-full`})})]}):(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center p-3`,children:(0,g.jsx)(`div`,{className:`typography-ui text-muted-foreground`,children:e(`filesView.editor.pickFileFromTree`)})})}export{_ as DiagramView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-fom6orB6.js";import{n as r}from"./vendor-react-D5BntRmA.js";import{Rn as i}from"./useMobileNavigationStore-zEWQLkBM.js";var a=`#yuri-skill:`,o=`#yuri-agent:`,s=e=>`https://opencode.ai/docs/agents/#${encodeURIComponent(e)}`,c=e=>`${a}${encodeURIComponent(e)}`,l=e=>`${o}${encodeURIComponent(e)}`,u=e=>{let t=[a,`#openchamber-skill:`].find(t=>e?.startsWith(t));if(!t||!e)return null;try{return decodeURIComponent(e.slice(t.length))}catch{return null}},d=e=>{let t=[o,`#openchamber-agent:`].find(t=>e?.startsWith(t));if(!t||!e)return null;try{return decodeURIComponent(e.slice(t.length))}catch{return null}},f=[`user-blocking`,`visible`,`background`],p=e=>{let t={"user-blocking":{head:null,tail:null},visible:{head:null,tail:null},background:{head:null,tail:null}},n=Math.max(1,Math.floor(e.maxTasksPerFrame)),r=Math.max(1,e.frameBudgetMs),i=null,a=!1,o=0,s=e=>{let n=t[e.priority];e.previous=n.tail,n.tail?n.tail.next=e:n.head=e,n.tail=e},c=e=>{let n=t[e.priority];e.previous?e.previous.next=e.next:n.head=e.next,e.next?e.next.previous=e.previous:n.tail=e.previous,e.next=null,e.previous=null},l=()=>{for(let e of f){let n=t[e].head;if(n)return c(n),n.consumed=!0,--o,n}return null},u=()=>{i===null&&o!==0&&(i=e.requestFrame(d))},d=()=>{i=null;let t=e.now(),a=0;for(;o>0&&a<n;){let n=l();if(!n||(n.run(),a+=1,e.now()-t>=r))break}u()},p=()=>{i!==null||a||o===0||(a=!0,i=e.requestFrame(()=>{i=null,a=!1,u()}))};return{enqueue(t,n){let r={cancelled:!1,consumed:!1,next:null,previous:null,priority:n?.priority??`background`,run:t};return s(r),o+=1,!a&&i===null&&p(),()=>{r.cancelled||r.consumed||(r.cancelled=!0,c(r),--o,o===0&&(i!==null&&(e.cancelFrame(i),i=null),a=!1))}},clear(){for(let e of f){let n=t[e],r=n.head;for(;r;){let e=r.next;r.cancelled=!0,r.next=null,r.previous=null,r=e}n.head=null,n.tail=null}o=0,i!==null&&(e.cancelFrame(i),i=null),a=!1}}},m=null,h=()=>typeof window>`u`?null:m||(m=p({requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),now:()=>performance.now(),maxTasksPerFrame:2,frameBudgetMs:6}),m),g=(e,t)=>{let n=h();return n?n.enqueue(e,t):(e(),()=>{})},_={textThrottleMs:20,markdownPaceMs:64},v={textThrottleMs:100,markdownPaceMs:128},y=e=>e===`android`?v:_,b=r(),x=e(n(),1),S=t(),C=x.createContext(!1),w=e=>{let t=(0,b.c)(3),{disabled:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,S.jsx)(C.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i},T=e=>{let t=(0,b.c)(8),{children:n,className:r}=e,[a,o]=x.useState(!1),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=null,t=()=>o(!0);return typeof window<`u`&&typeof window.requestAnimationFrame==`function`?e=window.requestAnimationFrame(t):t(),()=>{e!==null&&typeof window<`u`&&typeof window.cancelAnimationFrame==`function`&&window.cancelAnimationFrame(e)}},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),x.useEffect(s,c);let l=a?`opacity-100 translate-y-0`:`opacity-0 translate-y-2`,u;t[2]!==r||t[3]!==l?(u=i(`w-full transition-all duration-300 ease-out`,l,r),t[2]=r,t[3]=l,t[4]=u):u=t[4];let d;return t[5]!==n||t[6]!==u?(d=(0,S.jsx)(`div`,{className:u,children:n}),t[5]=n,t[6]=u,t[7]=d):d=t[7],d},E=e=>{let t=(0,b.c)(5),{children:n,className:r,skipAnimation:i,forceAnimation:a,ignoreContextDisabled:o,respectReducedMotion:s}=e,c=a!==void 0&&a,l=o!==void 0&&o,u=s!==void 0&&s,d=x.useContext(C),f=u&&typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!c||i||!l&&d||f){let e;return t[0]===n?e=t[1]:(e=(0,S.jsx)(S.Fragment,{children:n}),t[0]=n,t[1]=e),e}let p;return t[2]!==n||t[3]!==r?(p=(0,S.jsx)(T,{className:r,children:n}),t[2]=n,t[3]=r,t[4]=p):p=t[4],p};export{l as a,d as c,g as i,u as l,E as n,s as o,y as r,c as s,w as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t}from"./platform-wF65ZFgV.js";import{ot as n,st as r}from"./vendor-base-ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t}from"./platform-wF65ZFgV.js";import{ot as n,st as r}from"./vendor-base-ui-fom6orB6.js";import{n as i}from"./vendor-react-D5BntRmA.js";import{r as a}from"./useUIStore-CYex4rbF.js";import{t as o}from"./i18n-OsFhnlRH.js";import{In as s,Rn as c}from"./useMobileNavigationStore-zEWQLkBM.js";import{n as l}from"./Icon-DmIDd0Q3.js";import{a as u,o as d}from"./react-GVgpPWOu.js";import{a as f,n as p}from"./readiness-BLhjWepK.js";import{i as m}from"./pages-CYkE04ml.js";var h=e(r(),1),g=i(),_=n();function v(e){let t=(0,g.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=c(`relative isolate flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl bg-background shadow-sm [--background:oklch(from_var(--surface-background)_min(1,calc(l_+_0.015))_c_h)] dark:[--background:color-mix(in_srgb,var(--surface-foreground)_4%,var(--surface-background))]`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,_.jsx)(`span`,{"aria-hidden":`true`,"data-workspace-surface-ring":!0,className:`pointer-events-none absolute inset-0 z-50 rounded-[inherit] ring-1 ring-inset ring-[var(--interactive-border)]`}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,_.jsxs)(`section`,{...i,"data-workspace-surface":!0,className:a,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function y(){let e=(0,g.c)(33),{host:n,snapshot:r,inventory:i,error:c,loading:y,requested:S,requestLoad:C,refresh:w}=u(),{t:T}=o(),E=a(x),D=a(b),O,k;e[0]!==C||e[1]!==S?(O=()=>{S||C()},k=[S,C],e[0]=C,e[1]=S,e[2]=O,e[3]=k):(O=e[2],k=e[3]),h.useEffect(O,k);let A=r.pages,j,M,N,P,F,I;if(e[4]!==c||e[5]!==n||e[6]!==i||e[7]!==D||e[8]!==E||e[9]!==y||e[10]!==w||e[11]!==S||e[12]!==r.pages||e[13]!==r.plugins||e[14]!==T){I=Symbol.for(`react.early_return_sentinel`);bb0:{let a;e[21]===E?a=e[22]:(a=e=>e.key===E,e[21]=E,e[22]=a);let o=A.find(a),u=r.plugins.find(e=>e.id===o?.pluginId)?.revision,h=m(E),g=r.plugins.some(e=>e.id===h&&e.status===`failed`)||i.some(e=>e.id===h&&e.error)||!o&&!!c;if(D){let r=!t()||c===`unsupported`?(0,_.jsx)(f,{message:T(`guiPlugins.mobile.unsupported`)}):n&&o?(0,_.jsx)(d,{fallback:(0,_.jsx)(f,{message:T(`guiPlugins.error`)}),children:(0,_.jsx)(p,{host:n,kind:`page`,contributionKey:o.key,revision:u})},JSON.stringify([o.key,u])):g?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(f,{message:T(c===`relay_required`?`guiPlugins.mobile.relayRequired`:c===`relay_unavailable`?`guiPlugins.mobile.networkFailed`:`guiPlugins.error`)}),c?(0,_.jsx)(s,{className:`m-4 self-center`,onClick:w,children:T(`guiPlugins.mobile.retry`)}):null]}):y||!S?(0,_.jsxs)(`div`,{role:`status`,className:`flex min-h-0 flex-1 items-center justify-center gap-2 text-muted-foreground`,children:[(0,_.jsx)(l,{name:`loader-4`,className:`size-4 animate-spin motion-reduce:animate-none`}),T(`guiPlugins.loading`)]}):null,i;e[23]===r?i=e[24]:(i=(0,_.jsx)(`div`,{"data-gui-plugin-page":!0,className:`flex min-h-0 min-w-0 flex-1 flex-col`,"data-mobile-edge-to-edge-preview":`true`,children:r}),e[23]=r,e[24]=i),I=i;break bb0}P=!0,F=`flex h-full min-h-0 min-w-0 flex-col py-1.5 pl-1 pr-1.5 text-foreground`,j=v,M=!0,N=n&&o?(0,_.jsx)(d,{fallback:(0,_.jsx)(f,{message:T(`guiPlugins.error`)}),children:(0,_.jsx)(p,{host:n,kind:`page`,contributionKey:o.key,revision:u})},JSON.stringify([o.key,u])):g?(0,_.jsx)(f,{message:T(`guiPlugins.error`)}):null}e[4]=c,e[5]=n,e[6]=i,e[7]=D,e[8]=E,e[9]=y,e[10]=w,e[11]=S,e[12]=r.pages,e[13]=r.plugins,e[14]=T,e[15]=j,e[16]=M,e[17]=N,e[18]=P,e[19]=F,e[20]=I}else j=e[15],M=e[16],N=e[17],P=e[18],F=e[19],I=e[20];if(I!==Symbol.for(`react.early_return_sentinel`))return I;let L;e[25]!==j||e[26]!==M||e[27]!==N?(L=(0,_.jsx)(j,{"data-gui-plugin-page-surface":M,children:N}),e[25]=j,e[26]=M,e[27]=N,e[28]=L):L=e[28];let R;return e[29]!==P||e[30]!==F||e[31]!==L?(R=(0,_.jsx)(`div`,{"data-gui-plugin-page":P,className:F,children:L}),e[29]=P,e[30]=F,e[31]=L,e[32]=R):R=e[32],R}function b(e){return e.isMobile}function x(e){return e.activeGuiPage}export{v as n,y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-fom6orB6.js";import{n as r}from"./vendor-react-D5BntRmA.js";import{r as i}from"./useUIStore-CYex4rbF.js";import{t as a}from"./i18n-OsFhnlRH.js";import{In as o}from"./useMobileNavigationStore-zEWQLkBM.js";import{a as s}from"./react-GVgpPWOu.js";import{r as c}from"./device-C8ZHblkr.js";import{n as l,r as u,t as d}from"./readiness-BLhjWepK.js";import{t as f}from"./GuiPluginWindow-FOzqLIZ3.js";import{t as p}from"./GuiPluginPage-CAJB88Hr.js";import{i as m}from"./pages-CYkE04ml.js";var h=r(),g=e(n(),1),_=t();function v(){let e=(0,h.c)(57),{host:t,snapshot:n,inventory:r,error:v,loading:S,requested:C}=s(),{t:w}=a(),{isMobile:T}=c(),E=i(x),D;if(e[0]!==E||e[1]!==n.pages){let t;e[3]===E?t=e[4]:(t=e=>e.key===E,e[3]=E,e[4]=t),D=n.pages.find(t),e[0]=E,e[1]=n.pages,e[2]=D}else D=e[2];let O=D,k;e[5]===E?k=e[6]:(k=m(E),e[5]=E,e[6]=k);let A=k,j;e[7]!==v||e[8]!==r||e[9]!==A||e[10]!==n.plugins?(j=!!v||n.plugins.some(e=>e.id===A&&e.status===`failed`)||r.some(e=>e.id===A&&e.error),e[7]=v,e[8]=r,e[9]=A,e[10]=n.plugins,e[11]=j):j=e[11];let M=j,N,P;e[12]!==M||e[13]!==T||e[14]!==S||e[15]!==O||e[16]!==E||e[17]!==C?(N=()=>{T&&E&&C&&!S&&!O&&!M&&i.getState().closeGuiPage()},P=[T,E,C,S,O,M],e[12]=M,e[13]=T,e[14]=S,e[15]=O,e[16]=E,e[17]=C,e[18]=N,e[19]=P):(N=e[18],P=e[19]),g.useEffect(N,P);let[F]=g.useState(b),I,L,R,z,B,V,H,U;if(e[20]!==F||e[21]!==t||e[22]!==T||e[23]!==O?.title||e[24]!==E||e[25]!==n.activePanel||e[26]!==n.panels||e[27]!==n.plugins||e[28]!==w){let r;e[37]===n.activePanel?r=e[38]:(r=e=>e.key===n.activePanel&&!e.inline,e[37]=n.activePanel,e[38]=r);let i=n.panels.find(r);e[39]!==T||e[40]!==O?.title||e[41]!==E||e[42]!==w?(R=T&&E?(0,_.jsx)(f,{id:`gui-plugin-page`,open:!0,title:O?.title??w(`guiPlugins.title`),onClose:y,children:(0,_.jsx)(p,{})}):null,e[39]=T,e[40]=O?.title,e[41]=E,e[42]=w,e[43]=R):R=e[43],I=f,z=`gui-plugin-panel`,B=!!(t&&i),V=i?.title??w(`guiPlugins.title`),e[44]===t?H=e[45]:(H=()=>t?.hidePanel(),e[44]=t,e[45]=H),U=T&&i?(0,_.jsx)(u,{target:F}):null,L=t&&i?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`div`,{className:`flex shrink-0 flex-wrap gap-1`,"aria-label":w(`guiPlugins.panels`),children:n.panels.map(e=>(0,_.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,_.jsx)(o,{variant:`chip`,size:`sm`,"aria-pressed":e.key===i.key,onClick:()=>t.selectPanel(e.key),className:`max-w-64 truncate`,children:e.title}),(0,_.jsx)(o,{variant:`ghost`,size:`xs`,"aria-label":w(`guiPlugins.closePanel`,{title:e.title}),onClick:()=>t.closePanel(e.key),children:w(`guiPlugins.close`)})]},e.key))}),(0,_.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,"data-mobile-edge-to-edge-preview":`true`,children:(0,_.jsx)(l,{host:t,contributionKey:i.key,kind:`panel`,actions:T?F:void 0,revision:d(n.plugins,i.pluginId)})})]}):null,e[20]=F,e[21]=t,e[22]=T,e[23]=O?.title,e[24]=E,e[25]=n.activePanel,e[26]=n.panels,e[27]=n.plugins,e[28]=w,e[29]=I,e[30]=L,e[31]=R,e[32]=z,e[33]=B,e[34]=V,e[35]=H,e[36]=U}else I=e[29],L=e[30],R=e[31],z=e[32],B=e[33],V=e[34],H=e[35],U=e[36];let W;e[46]!==I||e[47]!==L||e[48]!==z||e[49]!==B||e[50]!==V||e[51]!==H||e[52]!==U?(W=(0,_.jsx)(I,{id:z,open:B,title:V,onClose:H,actions:U,children:L}),e[46]=I,e[47]=L,e[48]=z,e[49]=B,e[50]=V,e[51]=H,e[52]=U,e[53]=W):W=e[53];let G;return e[54]!==R||e[55]!==W?(G=(0,_.jsxs)(_.Fragment,{children:[R,W]}),e[54]=R,e[55]=W,e[56]=G):G=e[56],G}function y(){return i.getState().closeGuiPage()}function b(){return document.createElement(`div`)}function x(e){return e.activeMainTab===`plugin`?e.activeGuiPage:null}export{v as GuiPluginSurface};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ot as e}from"./vendor-base-ui-
|
|
1
|
+
import{ot as e}from"./vendor-base-ui-fom6orB6.js";import{n as t}from"./vendor-react-D5BntRmA.js";import{t as n}from"./i18n-OsFhnlRH.js";import{a as r,n as i,o as a,t as o}from"./dialog-BC7o8gDY.js";import{r as s}from"./device-C8ZHblkr.js";import{t as c}from"./MobileResizableSheet-C1mMUPUi.js";var l=t(),u=e();function d(e){let t=(0,l.c)(24),{id:d,open:f,title:p,onClose:m,children:h,actions:g}=e,{isMobile:_}=s(),{t:v}=n(),y;t[0]===m?y=t[1]:(y=e=>{e||m()},t[0]=m,t[1]=y);let b=y;if(_){let e;t[2]===v?e=t[3]:(e=v(`guiPlugins.close`),t[2]=v,t[3]=e);let n;t[4]===v?n=t[5]:(n=v(`guiPlugins.resize`),t[4]=v,t[5]=n);let r;return t[6]!==g||t[7]!==h||t[8]!==d||t[9]!==b||t[10]!==f||t[11]!==e||t[12]!==n||t[13]!==p?(r=(0,u.jsx)(c,{id:d,open:f,onOpenChange:b,title:p,ariaLabel:p,closeAriaLabel:e,resizeAriaLabel:n,trailing:g,initiallyExpanded:!0,compactHeader:!0,showCloseButton:!1,children:h}),t[6]=g,t[7]=h,t[8]=d,t[9]=b,t[10]=f,t[11]=e,t[12]=n,t[13]=p,t[14]=r):r=t[14],r}let x;t[15]===p?x=t[16]:(x=(0,u.jsx)(r,{children:(0,u.jsx)(a,{children:p})}),t[15]=p,t[16]=x);let S;t[17]!==h||t[18]!==x?(S=(0,u.jsxs)(i,{className:`flex h-[80dvh] max-w-5xl flex-col overflow-hidden`,"aria-describedby":void 0,children:[x,h]}),t[17]=h,t[18]=x,t[19]=S):S=t[19];let C;return t[20]!==b||t[21]!==f||t[22]!==S?(C=(0,u.jsx)(o,{open:f,onOpenChange:b,children:S}),t[20]=b,t[21]=f,t[22]=S,t[23]=C):C=t[23],C}export{d as t};
|