@yuriai/web 0.2.31-beta.2 → 0.2.31-beta.4
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-DHFLlQ7M.js → AgentAvatar-C3ydMP90.js} +1 -1
- package/dist/assets/AssistantContactStatus-CsDyIckA.js +3 -0
- package/dist/assets/{AssistantUnreadBadge-C2GtQigK.js → AssistantUnreadBadge-BMqANfEi.js} +1 -1
- package/dist/assets/{AssistantView-BFrMDed1.js → AssistantView-Bgz6Qg_n.js} +1 -1
- package/dist/assets/{DiagramView-BjCG9Ile.js → DiagramView-BYrjA5kG.js} +1 -1
- package/dist/assets/{FadeInOnReveal-CuOJu25b.js → FadeInOnReveal-GH4O857L.js} +1 -1
- package/dist/assets/{GuiPluginSurface-Bn4T7i79.js → GuiPluginSurface-BPAdeYGQ.js} +1 -1
- package/dist/assets/{GuiPluginWindow-DImyeW1D.js → GuiPluginWindow-D3JsxPrT.js} +1 -1
- package/dist/assets/{Icon-BQczEnxm.js → Icon-0kSL3zYJ.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-KksxJaKp.js → ImageLoadingPlaceholder-Cwd4MCPX.js} +1 -1
- package/dist/assets/{LoadingImage-Ch5MyA20.js → LoadingImage-qXDbd77i.js} +1 -1
- package/dist/assets/MarkdownRenderer-DIQeWdJJ.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-DhJ9_BLd.js → MarkdownRendererImpl-BEO0mmTl.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-BFjWHQDE.js → MarkstreamRendererImpl-BTwy_9_a.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-BZeOHfd5.js → MobileDetailNavigation-Cw7Xc_3T.js} +1 -1
- package/dist/assets/{MobileResizableSheet-Bk3z4g6T.js → MobileResizableSheet-Du6rTvgU.js} +1 -1
- package/dist/assets/MobileShareBridge-Lr8uenO_.js +4 -0
- package/dist/assets/MobileTabPageHeader-CtPwljra.js +2 -0
- package/dist/assets/{MultiRunWindow-DE5Aud3t.js → MultiRunWindow-CWM76eV8.js} +1 -1
- package/dist/assets/OnboardingScreen-CTkprkiv.js +1 -0
- package/dist/assets/{OverlayScrollbar-C9Ac564a.js → OverlayScrollbar-B7sVHXnC.js} +1 -1
- package/dist/assets/SettingsView-yHOoYleA.js +29 -0
- package/dist/assets/{SettingsWindow-BJn1_WFm.js → SettingsWindow-ByEjL6Nw.js} +1 -1
- package/dist/assets/{SetupTourDialog-DgY0tOMz.js → SetupTourDialog-CUvxcejj.js} +1 -1
- package/dist/assets/{TerminalView-CP3oW3mj.js → TerminalView-D1GkcJE3.js} +1 -1
- package/dist/assets/{ToolOutputDialog-BQgmj6rE.js → ToolOutputDialog-CcPSvHT6.js} +1 -1
- package/dist/assets/{VoiceSettings-DmBv5zlE.js → VoiceSettings--5_ayrgo.js} +1 -1
- package/dist/assets/{YuriLogo-CpccdHvS.js → YuriLogo-CBA_JITn.js} +1 -1
- package/dist/assets/YuriWordmark-Bkpex8se.js +1 -0
- package/dist/assets/{appThemeRegistry-l72ZmQkp.js → appThemeRegistry-9XjDBpox.js} +1 -1
- package/dist/assets/bootstrap-DGkBnhNP.js +3 -0
- package/dist/assets/button-1hulrRFb.js +1 -0
- package/dist/assets/{capgoAdapter-BJHkuJhe.js → capgoAdapter-BXVNgGXT.js} +1 -1
- package/dist/assets/{collapsible-BzCn4-sd.js → collapsible-1ZF6oX1u.js} +1 -1
- package/dist/assets/{context-menu-BIjCIXOg.js → context-menu-22yntREv.js} +1 -1
- package/dist/assets/desktop-BAmoc_34.js +1 -0
- package/dist/assets/{desktopHosts-CB0CTcMg.js → desktopHosts-CMglnUdS.js} +1 -1
- package/dist/assets/{desktopRelayRestore-C7pjf6fE.js → desktopRelayRestore-AE3_TnQz.js} +1 -1
- package/dist/assets/{device-CRM325xC.js → device-w1ioiqv3.js} +1 -1
- package/dist/assets/{diagram--zTR0vWJ.js → diagram-DOJPiCy7.js} +1 -1
- package/dist/assets/{dialog-rVkj8VgE.js → dialog-CQVu4teR.js} +1 -1
- package/dist/assets/{es-B8dNq0Lv.js → es-JU--16Gd.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-CmdNi_d0.js → fileMentionTouchSelection-DC_Tjhr4.js} +1 -1
- package/dist/assets/{fileReferenceActions-CvDFcgBH.js → fileReferenceActions-BhbJNduq.js} +1 -1
- package/dist/assets/{fr-DbzWoYOD.js → fr-BUZcRuMk.js} +1 -1
- package/dist/assets/{gitApi-sDNn8Eyy.js → gitApi-CzQwUwvd.js} +1 -1
- package/dist/assets/gitApiHttp-CIkpp8g-.js +7 -0
- package/dist/assets/{host-D776RHTx.js → host-CBfSyi4l.js} +1 -1
- package/dist/assets/{input-GVRUiwuQ.js → input-DRV16AFd.js} +1 -1
- package/dist/assets/insertionBoundaries-C7FBNvk1.js +1 -0
- package/dist/assets/{ja-BGk5BIrz.js → ja-BwtVLTXD.js} +1 -1
- package/dist/assets/{ko-Broo5A8H.js → ko--sLsRFpA.js} +1 -1
- package/dist/assets/main-CR1Jc44L.js +2 -0
- package/dist/assets/main-Cef8gzbX.js +169 -0
- package/dist/assets/{markdownHeightCache-C7UOJdkN.js → markdownHeightCache-DiVswDYm.js} +1 -1
- package/dist/assets/{mcpQueries-CYB7oOj1.js → mcpQueries-DukxUVzd.js} +1 -1
- package/dist/assets/miniChat-C93_bSRK.js +2 -0
- package/dist/assets/mobile-DF9tY4EV.js +2 -0
- package/dist/assets/{mobileBackNavigation-1On_J_sK.js → mobileBackNavigation-BgHWEzyW.js} +1 -1
- package/dist/assets/multirun-hYvBoS0d.js +3 -0
- package/dist/assets/{native-config-BX43kiuw.js → native-config-CbYntrYO.js} +1 -1
- package/dist/assets/{pl-not4wEra.js → pl-C4_4J5yA.js} +1 -1
- package/dist/assets/{platform-DFJEtBlo.js → platform-sEg2IOLZ.js} +1 -1
- package/dist/assets/{projectMeta-Bx2jAxAX.js → projectMeta-C8UBKLh9.js} +1 -1
- package/dist/assets/{pt-BR-3OzFQDGv.js → pt-BR-DvNC5K1q.js} +1 -1
- package/dist/assets/pwa-Dt9uU0i9.js +2 -0
- package/dist/assets/queue-abort-optimistic-D_SsLJLd.js +1 -0
- package/dist/assets/{readiness-DkcUwkyH.js → readiness-n9XOjS8O.js} +1 -1
- package/dist/assets/renderElectronMiniChatApp-CVtfpdY-.js +2 -0
- package/dist/assets/renderMobileApp-BPgoSEJm.js +28 -0
- package/dist/assets/runtime-ead7P81A.js +1 -0
- package/dist/assets/runtimeConfig-Cx9RXogi.js +2 -0
- package/dist/assets/runtimeEndpointReset-T6F3Ii6E.js +149 -0
- package/dist/assets/{select-LKr2A_1O.js → select-zok-B3g0.js} +1 -1
- package/dist/assets/sessionLookup-BsUFQTxv.js +1 -0
- package/dist/assets/{sortable-tabs-strip-DEIzwvmy.js → sortable-tabs-strip-4bXSWYDe.js} +1 -1
- package/dist/assets/{speechSettingsQueries-CCL0cFdo.js → speechSettingsQueries-C6dYJclL.js} +1 -1
- package/dist/assets/{store-CKIMMlXR.js → store-X3lU0obe.js} +4 -4
- package/dist/assets/{terminalApi-ChZhb60_.js → terminalApi-bbnqBofP.js} +1 -1
- package/dist/assets/{textarea-B4mWtnN5.js → textarea-5Kh0UllD.js} +1 -1
- package/dist/assets/{tooltip-BuZ86ipm.js → tooltip-BOFwKQWM.js} +1 -1
- package/dist/assets/{types-Divz_9Ip.js → types-CDpG4h8_.js} +1 -1
- package/dist/assets/{uk-DyZ2SwUJ.js → uk-Dvj0JjiC.js} +1 -1
- package/dist/assets/{useAppFontEffects-9x3cimW5.js → useAppFontEffects-CoFlWq69.js} +54 -54
- package/dist/assets/{useDesktopWindowControlsLayout-BSTtZJLs.js → useDesktopWindowControlsLayout-fOeDBr7J.js} +1 -1
- package/dist/assets/{useDictation-CwX05CAo.js → useDictation-cnIIE7Zs.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DvI6toj8.js → useEffectiveDirectory-385Vh00v.js} +1 -1
- package/dist/assets/{useFontPreferences-EsJ4FlIp.js → useFontPreferences-BfzbDU0G.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-B2yMgBp_.js → useMobileNavigationStore-D-EPMP4q.js} +11 -11
- package/dist/assets/{usePluginsStore-kYdUe2vQ.js → usePluginsStore-Bh4mG19B.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-aMYjp95H.js → useWorkerHighlightedLines-uRFLMeII.js} +1 -1
- package/dist/assets/{zh-CN-aNIWxYun.js → zh-CN-2Y6u8t24.js} +1 -1
- package/dist/assets/{zh-TW-B1IdCz5g.js → zh-TW-Z5wVv4Fb.js} +1 -1
- package/dist/index.html +25 -12
- package/dist/mini-chat.html +13 -12
- package/dist/mobile.html +13 -12
- package/package.json +1 -1
- package/dist/assets/AssistantContactStatus-Dz0_n8sU.js +0 -3
- package/dist/assets/MarkdownRenderer-D740lJLe.js +0 -2
- package/dist/assets/MobileShareBridge-DUHic62l.js +0 -4
- package/dist/assets/MobileTabPageHeader-CQdGjnUD.js +0 -2
- package/dist/assets/OnboardingScreen-CgQGvlEs.js +0 -1
- package/dist/assets/SettingsView-BMz_om1T.js +0 -29
- package/dist/assets/YuriWordmark-hZ6K7Smk.js +0 -1
- package/dist/assets/button-Cjciq1yh.js +0 -1
- package/dist/assets/desktop-JwYqThiw.js +0 -1
- package/dist/assets/gitApiHttp-Ddik7PM_.js +0 -7
- package/dist/assets/insertionBoundaries-j6ZrHN6l.js +0 -1
- package/dist/assets/main-DK7jJkPE.js +0 -2
- package/dist/assets/main-DaVaXEtj.js +0 -169
- package/dist/assets/miniChat-ta0lDPXm.js +0 -2
- package/dist/assets/mobile-BYn6ARaV.js +0 -2
- package/dist/assets/multirun-CPCxiOiA.js +0 -3
- package/dist/assets/persistence-D-rnhgr4.js +0 -3
- package/dist/assets/pwa-CXr1xG5T.js +0 -2
- package/dist/assets/queue-abort-optimistic-CkQ6siQp.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-D_LMfi6A.js +0 -2
- package/dist/assets/renderMobileApp-CkZ7AFaX.js +0 -28
- package/dist/assets/runtimeConfig-iYK0jM-r.js +0 -2
- package/dist/assets/runtimeEndpointReset-CcWm_Gnw.js +0 -149
- package/dist/assets/sessionLookup-CBbIIonR.js +0 -1
package/dist/index.html
CHANGED
|
@@ -537,6 +537,17 @@
|
|
|
537
537
|
#initial-loading .splash-session-progress[hidden] {
|
|
538
538
|
display: none;
|
|
539
539
|
}
|
|
540
|
+
#startup-connection-status {
|
|
541
|
+
position: absolute;
|
|
542
|
+
top: calc(100% + 24px);
|
|
543
|
+
width: min(360px, 85vw);
|
|
544
|
+
text-align: center;
|
|
545
|
+
font-size: calc(13 * var(--dpt));
|
|
546
|
+
color: var(--splash-stroke);
|
|
547
|
+
}
|
|
548
|
+
#startup-connection-status:not([hidden]) ~ .splash-session-progress {
|
|
549
|
+
top: calc(100% + 52px);
|
|
550
|
+
}
|
|
540
551
|
#initial-loading .splash-session-progress-track {
|
|
541
552
|
height: 4px;
|
|
542
553
|
overflow: hidden;
|
|
@@ -560,15 +571,15 @@
|
|
|
560
571
|
opacity: 0.72;
|
|
561
572
|
}
|
|
562
573
|
</style>
|
|
563
|
-
<script type="module" crossorigin src="/assets/main-
|
|
574
|
+
<script type="module" crossorigin src="/assets/main-CR1Jc44L.js"></script>
|
|
564
575
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
565
576
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
566
577
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
567
578
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-D0YWp3FJ.js">
|
|
568
579
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
569
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
570
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
571
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
580
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-BAmoc_34.js">
|
|
581
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-CMglnUdS.js">
|
|
582
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-AE3_TnQz.js">
|
|
572
583
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CzHs0bHY.js">
|
|
573
584
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-vDaAPGfl.js">
|
|
574
585
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
@@ -581,21 +592,22 @@
|
|
|
581
592
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-2dx7jbt9.js">
|
|
582
593
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
583
594
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
584
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
595
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
596
|
+
<link rel="modulepreload" crossorigin href="/assets/bootstrap-DGkBnhNP.js">
|
|
585
597
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-B-Wpqq5J.js">
|
|
586
598
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-C2Rs6TPz.js">
|
|
587
599
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
588
600
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
589
601
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
590
602
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-BP4P52ry.js">
|
|
591
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
592
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
603
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-CIkpp8g-.js">
|
|
604
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-bbnqBofP.js">
|
|
593
605
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-D6bwc3Kj.js">
|
|
594
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
595
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
596
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
597
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
598
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
606
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-sEg2IOLZ.js">
|
|
607
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CDpG4h8_.js">
|
|
608
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-BXVNgGXT.js">
|
|
609
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-CbYntrYO.js">
|
|
610
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-Cx9RXogi.js">
|
|
599
611
|
<link rel="stylesheet" crossorigin href="/assets/src-PTWgTO6W.css">
|
|
600
612
|
</head>
|
|
601
613
|
<body class="h-full bg-background text-foreground">
|
|
@@ -605,6 +617,7 @@
|
|
|
605
617
|
<div id="initial-loading">
|
|
606
618
|
<div class="splash-content">
|
|
607
619
|
<svg width="120" height="120" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Yuri loading icon"><path fill="var(--splash-logo-fill)" fill-rule="evenodd" d="M48.34 6.03L47.62 6.07L46.95 6.12L46.64 6.15L46.20 6.21L45.36 6.34L44.97 6.42L44.61 6.48L43.53 6.73L43.27 6.79L43.01 6.86L42.16 7.13L41.77 7.24L41.22 7.41L40.38 7.70L39.25 8.13L38.84 8.30L38.28 8.57L37.62 8.85L37.30 9.01L36.95 9.20L36.25 9.59L35.44 10.06L34.74 10.46L34.40 10.67L33.76 11.16L33.51 11.34L32.95 11.71L32.41 12.10L31.98 12.42L31.81 12.56L31.64 12.71L31.06 13.26L30.53 13.75L29.89 14.37L29.30 14.91L29.11 15.10L28.90 15.33L28.71 15.57L28.17 16.29L27.78 16.77L27.42 17.22L27.26 17.44L26.87 17.99L26.58 18.43L26.27 18.87L25.98 19.32L25.77 19.71L25.04 21.09L24.83 21.54L24.51 22.27L24.32 22.73L24.11 23.31L23.97 23.69L23.84 24.11L23.62 24.79L23.45 25.39L23.37 25.79L23.26 26.22L23.20 26.52L23.10 27.10L23.04 27.49L22.92 28.38L22.88 28.87L22.85 29.36L22.84 29.89L22.83 30.38L22.83 31.01L22.84 31.45L22.87 31.85L22.89 32.21L23.02 33.41L23.08 33.89L23.14 34.20L23.24 34.63L23.36 35.06L23.46 35.50L23.62 36.10L23.79 36.66L23.96 37.16L24.14 37.67L24.41 38.37L24.55 38.70L24.93 39.51L25.38 40.48L25.73 41.20L25.85 41.44L26.10 41.86L26.38 42.32L26.89 43.21L27.25 43.83L27.50 44.30L27.83 44.88L27.96 45.16L28.19 45.65L28.34 46.02L28.52 46.48L28.66 46.90L28.85 47.54L29.02 48.19L29.06 48.41L29.14 48.89L29.23 49.42L29.27 49.82L29.30 50.58L29.30 51.24L29.27 52.09L29.25 52.45L29.23 52.67L29.15 53.38L29.06 53.99L28.78 55.40L28.71 55.79L28.52 56.62L28.36 57.22L28.11 57.93L27.59 59.31L27.47 59.60L27.33 59.88L26.73 61.12L26.64 61.28L26.25 61.92L25.96 62.38L25.53 63.10L25.31 63.44L24.96 63.96L23.92 65.41L23.70 65.69L23.25 66.19L23.05 66.42L22.89 66.64L22.52 67.14L22.14 67.58L21.72 68.10L21.36 68.56L21.25 68.70L21.23 68.74L21.23 68.78L21.26 68.82L21.30 68.83L21.34 68.83L22.18 68.73L23.16 68.63L23.38 68.61L24.10 68.60L25.08 68.60L25.43 68.61L25.97 68.64L26.63 68.72L27.08 68.75L27.25 68.78L28.22 68.92L29.19 69.11L29.41 69.15L30.10 69.33L30.70 69.49L31.08 69.61L31.72 69.81L32.23 69.99L32.97 70.28L33.75 70.61L34.40 70.92L34.80 71.11L35.31 71.38L36.00 71.79L36.55 72.09L36.85 72.28L37.58 72.79L38.10 73.14L38.46 73.41L38.70 73.60L39.82 74.49L40.06 74.68L40.49 75.00L40.77 75.22L41.10 75.52L41.55 75.96L41.98 76.35L42.17 76.53L42.39 76.76L42.72 77.18L42.90 77.38L43.02 77.51L43.47 77.94L43.74 78.24L44.15 78.71L44.64 79.29L44.98 79.71L45.13 79.92L45.26 80.16L45.28 80.20L45.29 80.24L45.27 80.27L45.23 80.29L45.19 80.27L44.95 80.08L44.75 79.90L44.40 79.56L44.07 79.26L43.64 78.87L43.44 78.70L42.77 78.16L42.42 77.89L41.51 77.25L40.74 76.64L39.96 76.05L39.26 75.58L38.54 75.12L37.39 74.44L36.59 73.96L36.31 73.81L35.95 73.63L34.83 73.09L33.89 72.67L33.57 72.52L33.11 72.34L31.78 71.84L31.61 71.78L31.23 71.66L30.79 71.55L29.81 71.27L29.20 71.11L29.03 71.07L28.33 70.93L27.71 70.84L27.32 70.77L27.10 70.74L26.83 70.71L26.39 70.68L25.86 70.61L25.28 70.57L24.96 70.56L24.52 70.56L24.03 70.56L23.76 70.58L23.10 70.64L22.30 70.73L22.08 70.76L21.15 70.92L20.72 71.03L20.33 71.12L19.74 71.31L19.15 71.51L18.77 71.64L18.40 71.80L17.87 72.03L17.71 72.11L17.55 72.20L17.21 72.41L16.74 72.75L16.22 73.09L15.90 73.33L15.61 73.54L15.30 73.80L14.97 74.09L14.52 74.53L14.27 74.78L13.90 75.23L13.34 75.92L13.09 76.24L12.89 76.53L12.31 77.49L12.16 77.76L12.06 77.96L11.97 78.16L11.86 78.45L11.84 78.49L11.84 78.54L11.85 78.58L11.88 78.61L11.93 78.62L12.88 78.37L13.40 78.26L14.01 78.14L14.54 78.03L14.84 77.97L15.59 77.87L16.57 77.77L17.32 77.67L17.50 77.66L17.72 77.65L18.52 77.63L19.82 77.63L20.58 77.63L21.87 77.67L22.31 77.70L22.62 77.72L23.65 77.82L24.00 77.86L24.57 77.95L25.24 78.04L25.98 78.16L26.42 78.24L26.91 78.33L27.26 78.39L27.65 78.47L28.13 78.56L28.57 78.67L28.96 78.74L29.31 78.83L29.74 78.92L30.12 79.04L30.94 79.26L31.54 79.44L32.18 79.64L32.98 79.91L33.79 80.15L33.96 80.21L35.30 80.71L36.63 81.22L37.04 81.39L37.58 81.60L38.49 81.98L39.48 82.39L39.92 82.59L40.36 82.81L40.60 82.92L41.18 83.18L41.92 83.49L42.44 83.73L42.84 83.92L43.73 84.34L44.42 84.66L45.15 85.00L45.51 85.18L46.29 85.60L46.66 85.77L47.13 86.01L47.74 86.29L48.22 86.52L49.54 87.17L50.10 87.46L50.94 87.87L52.09 88.45L53.85 89.22L54.05 89.31L54.52 89.56L54.88 89.74L55.21 89.89L55.58 90.05L56.65 90.50L57.21 90.77L57.70 90.99L58.15 91.17L58.48 91.31L58.94 91.47L59.54 91.67L59.92 91.79L60.30 91.92L60.88 92.13L61.59 92.40L62.01 92.55L62.78 92.78L63.99 93.10L64.68 93.28L65.12 93.37L65.55 93.47L66.25 93.62L67.39 93.81L67.75 93.85L68.06 93.88L69.17 93.95L69.70 93.99L70.02 94.00L70.24 93.99L70.28 93.98L70.32 93.96L70.31 93.92L70.28 93.89L70.21 93.84L70.09 93.79L69.55 93.57L69.06 93.35L68.46 93.06L66.66 92.08L66.00 91.71L65.73 91.55L65.35 91.31L64.91 91.01L64.23 90.58L63.75 90.25L63.32 89.94L63.03 89.73L61.99 88.89L61.42 88.46L61.01 88.12L60.74 87.88L60.22 87.39L59.66 86.82L59.10 86.24L58.62 85.78L58.43 85.59L58.24 85.40L57.95 85.06L57.51 84.56L57.09 84.04L56.42 83.25L56.03 82.77L55.87 82.56L55.64 82.23L55.40 81.91L54.98 81.28L54.78 80.98L54.25 80.10L54.00 79.68L53.37 78.55L53.20 78.23L52.81 77.43L52.64 77.07L52.48 76.66L52.12 75.69L51.96 75.23L51.85 74.89L51.76 74.60L51.60 74.04L51.41 73.21L51.34 72.82L51.25 72.38L51.14 71.77L50.98 71.03L50.79 70.29L50.61 69.65L50.45 69.14L50.26 68.59L50.00 67.97L49.91 67.77L49.82 67.61L49.60 67.23L49.21 66.63L49.05 66.42L48.85 66.17L48.71 66.00L48.56 65.84L48.18 65.46L47.95 65.25L47.74 65.08L46.72 64.29L46.52 64.11L46.12 63.75L45.29 62.94L45.10 62.75L44.65 62.26L44.37 61.91L43.99 61.41L43.64 60.90L43.38 60.48L43.16 60.10L43.03 59.86L42.63 59.06L42.31 58.33L42.23 58.12L42.16 57.91L42.15 57.87L42.15 57.82L42.17 57.78L42.21 57.77L42.25 57.78L42.32 57.84L42.41 57.94L42.49 58.04L42.67 58.30L42.80 58.48L43.19 58.96L43.99 59.86L44.18 60.05L44.38 60.24L44.55 60.38L45.02 60.78L45.97 61.60L46.35 61.91L46.63 62.13L46.99 62.39L47.56 62.75L47.79 62.88L49.13 63.59L49.77 63.91L50.54 64.27L51.31 64.62L51.59 64.74L51.97 64.89L53.02 65.27L53.77 65.53L54.40 65.77L55.12 66.01L55.67 66.18L56.58 66.42L57.52 66.70L59.15 67.14L59.84 67.35L60.30 67.51L60.75 67.69L60.96 67.78L61.20 67.90L61.40 68.00L61.59 68.11L61.81 68.26L62.10 68.47L62.28 68.61L62.41 68.72L62.66 68.97L62.81 69.14L62.93 69.28L63.06 69.46L63.21 69.68L64.12 71.16L64.32 71.46L64.45 71.64L64.65 71.88L65.19 72.53L65.49 72.86L65.84 73.20L66.11 73.44L66.31 73.61L66.91 74.08L67.41 74.45L67.67 74.63L68.04 74.87L68.23 74.98L68.28 74.99L68.32 74.97L68.32 74.92L68.32 74.88L68.31 74.84L68.23 74.67L67.56 73.27L67.47 73.06L67.27 72.52L67.16 72.23L66.93 71.46L66.89 71.28L66.85 71.06L66.81 70.75L66.79 70.49L66.78 70.27L66.77 70.00L66.77 69.60L66.78 69.37L66.81 68.97L66.84 68.71L66.90 68.40L66.95 68.14L67.06 67.75L67.12 67.54L67.27 67.12L67.44 66.66L67.51 66.49L67.61 66.29L67.98 65.58L68.38 64.78L68.51 64.50L68.57 64.38L68.64 64.27L68.74 64.12L68.77 64.09L68.81 64.08L68.85 64.11L68.86 64.16L68.85 64.20L68.83 64.33L68.79 64.46L68.73 64.67L68.60 65.05L68.51 65.35L68.39 65.78L68.33 66.04L68.21 66.61L68.07 67.49L68.01 67.98L67.98 68.29L67.96 68.87L67.96 69.31L67.98 69.76L68.01 70.11L68.06 70.47L68.18 71.03L68.22 71.21L68.37 71.72L68.43 71.89L68.53 72.14L68.75 72.63L68.93 72.98L69.39 73.80L69.56 74.11L69.75 74.51L70.07 75.20L70.25 75.71L70.69 76.97L71.04 77.88L71.14 78.18L71.28 78.65L71.46 79.20L71.58 79.54L71.69 79.78L71.78 79.98L71.94 80.30L72.22 80.81L72.62 81.56L72.82 81.91L72.98 82.17L73.30 82.66L73.62 83.14L73.81 83.39L74.24 83.96L74.41 84.17L74.58 84.37L74.83 84.63L75.05 84.84L75.26 85.02L75.30 85.04L75.34 85.05L75.37 85.02L75.37 84.98L75.36 84.94L75.24 84.65L74.99 84.08L74.62 83.21L74.43 82.67L74.06 81.57L73.92 81.01L73.69 79.91L73.57 79.26L73.52 78.90L73.37 77.53L73.33 77.17L73.32 76.86L73.29 76.06L73.28 75.75L73.29 75.44L73.32 74.81L73.34 74.55L73.57 72.78L73.69 72.07L73.82 71.46L73.98 70.54L74.02 70.28L74.10 69.70L74.17 69.04L74.20 68.64L74.22 68.14L74.21 67.83L74.20 67.61L74.19 67.39L74.14 66.99L74.01 66.20L73.95 65.94L73.83 65.51L73.67 65.05L73.51 64.68L73.27 64.19L72.81 63.28L72.70 63.04L72.65 62.91L72.59 62.75L72.54 62.53L72.51 62.35L72.50 62.18L72.50 62.00L72.50 61.86L72.52 61.69L72.55 61.56L72.58 61.43L72.65 61.26L72.72 61.10L72.81 60.94L72.93 60.76L73.02 60.66L73.11 60.56L73.31 60.38L73.69 60.08L73.82 59.95L73.93 59.82L73.98 59.74L74.02 59.66L74.06 59.58L74.10 59.46L74.12 59.33L74.14 59.24L74.14 59.15L74.14 59.06L74.12 58.97L74.09 58.84L74.05 58.72L74.02 58.63L73.96 58.52L73.91 58.44L73.83 58.33L73.78 58.27L73.68 58.18L73.61 58.13L73.53 58.08L73.45 58.05L73.28 58.00L73.06 57.97L72.74 57.96L72.48 57.97L72.25 57.99L71.86 58.03L71.59 58.08L70.33 58.35L70.11 58.41L69.47 58.59L69.17 58.69L68.58 58.87L68.44 58.89L68.31 58.91L68.27 58.90L68.25 58.87L68.26 58.83L68.28 58.80L68.46 58.66L68.67 58.50L68.93 58.32L69.20 58.16L69.59 57.95L69.79 57.85L70.00 57.76L70.20 57.69L71.26 57.34L71.78 57.19L71.95 57.15L72.56 57.02L72.78 56.98L73.14 56.94L73.71 56.90L73.85 56.88L73.97 56.85L74.10 56.81L74.22 56.75L74.34 56.69L74.46 56.62L74.57 56.55L74.67 56.47L74.77 56.38L74.83 56.31L74.89 56.25L74.97 56.14L75.05 55.98L75.11 55.81L75.13 55.73L75.15 55.60L75.16 55.46L75.16 55.33L75.14 54.93L75.10 54.49L75.07 54.31L75.05 54.18L75.00 54.01L74.92 53.80L74.85 53.64L74.76 53.48L74.61 53.26L74.44 53.05L74.23 52.82L73.98 52.57L73.89 52.47L73.86 52.43L73.85 52.39L73.86 52.35L73.88 52.31L73.92 52.29L73.96 52.28L74.09 52.26L74.27 52.26L74.58 52.26L74.94 52.29L75.11 52.31L75.29 52.35L75.59 52.41L75.94 52.48L76.51 52.61L76.86 52.67L77.17 52.70L77.48 52.72L77.75 52.71L77.97 52.68L78.19 52.64L78.36 52.59L78.53 52.53L78.69 52.45L78.85 52.37L79.00 52.27L79.10 52.19L79.20 52.10L79.29 52.00L79.36 51.89L79.45 51.73L79.50 51.61L79.54 51.48L79.57 51.35L79.58 51.22L79.57 51.09L79.56 50.91L79.53 50.78L79.50 50.65L79.36 50.13L79.25 49.75L79.13 49.27L78.88 48.47L78.48 47.14L78.34 46.72L78.08 45.86L77.99 45.57L77.89 45.22L77.64 44.41L77.48 43.86L77.37 43.42L77.27 43.08L77.11 42.48L76.94 41.83L76.86 41.44L76.77 41.09L76.69 40.66L76.56 40.09L76.39 39.21L76.25 38.47L76.18 38.16L76.14 38.04L76.08 37.87L75.99 37.72L75.88 37.53L75.59 37.13L75.39 36.88L75.28 36.75L75.04 36.49L74.65 36.12L74.48 35.97L74.30 35.84L73.80 35.47L73.35 35.17L72.97 34.95L72.42 34.66L71.81 34.38L70.44 33.83L69.90 33.62L69.39 33.45L68.28 33.11L67.77 32.98L67.64 32.93L67.48 32.86L67.44 32.84L67.41 32.81L67.41 32.78L67.44 32.75L67.49 32.74L67.71 32.73L67.98 32.74L68.20 32.77L68.82 32.86L69.30 32.93L70.14 33.07L70.84 33.21L71.10 33.28L72.17 33.58L72.72 33.75L72.94 33.81L73.44 33.99L73.65 34.07L73.86 34.15L74.54 34.48L74.94 34.67L75.30 34.86L75.69 35.08L75.99 35.27L76.28 35.48L76.58 35.74L76.98 36.10L77.21 36.30L77.32 36.38L77.40 36.40L77.48 36.41L77.56 36.39L77.63 36.35L77.74 36.28L77.84 36.19L77.96 36.06L78.07 35.92L78.14 35.80L78.20 35.69L78.26 35.56L78.30 35.44L78.33 35.31L78.35 35.18L78.36 35.04L78.34 34.73L78.31 34.51L78.28 34.34L78.03 33.25L77.92 32.64L77.82 32.20L77.79 32.02L77.77 31.80L77.72 31.27L77.65 30.16L77.57 29.18L77.39 27.94L77.36 27.72L77.28 27.33L77.20 26.89L77.04 26.20L77.00 26.02L76.85 25.51L76.69 24.95L76.49 24.36L76.40 24.11L76.31 23.81L76.23 23.60L76.14 23.39L76.05 23.19L75.61 22.27L75.23 21.51L74.93 20.96L74.38 19.99L73.64 18.82L73.18 18.17L72.96 17.89L72.11 16.91L71.27 15.87L70.77 15.30L70.49 15.02L70.16 14.71L69.60 14.20L69.17 13.81L68.94 13.60L68.54 13.25L68.16 12.94L67.75 12.59L67.54 12.42L67.22 12.18L66.68 11.79L65.94 11.29L65.20 10.79L64.71 10.48L64.05 10.10L62.65 9.33L62.29 9.14L62.01 9.01L61.73 8.87L60.87 8.51L60.34 8.27L59.93 8.08L59.61 7.94L59.15 7.77L58.13 7.42L57.79 7.32L57.50 7.23L56.86 7.03L56.26 6.86L55.39 6.64L54.74 6.49L54.34 6.42L53.86 6.33L53.29 6.24L52.58 6.15L52.36 6.12L51.11 6.04L50.53 6.01L50.13 6.00L49.38 6.00L48.66 6.01ZM84.78 23.79L84.64 23.81L84.51 23.84L84.08 23.95L83.87 24.03L83.63 24.14L83.51 24.21L83.40 24.28L83.18 24.44L82.99 24.62L82.84 24.79L82.66 25.04L82.52 25.27L82.46 25.39L82.39 25.55L82.33 25.72L82.28 25.84L82.18 26.23L82.13 26.49L82.12 26.63L82.11 26.76L82.12 26.89L82.13 27.07L82.15 27.20L82.18 27.38L82.23 27.60L82.28 27.77L82.36 27.98L82.49 28.26L82.55 28.38L82.62 28.49L82.70 28.60L82.79 28.70L82.97 28.90L83.07 28.99L83.20 29.10L83.42 29.26L83.54 29.32L83.66 29.39L84.06 29.57L84.19 29.61L84.32 29.65L84.58 29.70L84.71 29.72L84.84 29.73L85.16 29.74L85.33 29.73L85.47 29.71L85.82 29.65L86.03 29.60L86.16 29.55L86.36 29.47L86.61 29.35L86.76 29.26L86.91 29.16L87.16 28.98L87.43 28.74L87.52 28.65L87.61 28.55L87.73 28.36L87.88 28.09L87.99 27.84L88.04 27.67L88.08 27.55L88.13 27.28L88.15 27.11L88.16 26.97L88.16 26.66L88.14 26.35L88.10 26.09L88.07 25.95L88.03 25.83L87.92 25.53L87.87 25.41L87.78 25.25L87.72 25.14L87.64 25.03L87.48 24.82L87.29 24.63L87.08 24.46L86.83 24.28L86.59 24.15L86.35 24.04L86.10 23.95L85.62 23.83L85.40 23.79L85.27 23.78L85.09 23.77L84.91 23.78ZM63.90 37.84L63.95 37.83L63.99 37.83L64.15 37.92L64.63 38.23L65.01 38.47L65.60 38.87L66.10 39.16L66.54 39.39L66.78 39.50L67.02 39.61L67.44 39.77L68.36 40.10L68.88 40.25L69.05 40.30L69.22 40.34L69.92 40.46L70.15 40.49L70.37 40.52L71.66 40.61L72.15 40.63L72.59 40.62L72.68 40.63L72.72 40.65L72.75 40.68L72.77 40.72L72.76 40.77L72.74 40.81L72.71 40.84L72.60 40.91L72.41 41.03L72.22 41.13L72.01 41.22L71.68 41.35L71.51 41.41L71.00 41.56L70.87 41.59L70.65 41.62L70.25 41.67L69.98 41.69L69.63 41.68L69.31 41.66L69.00 41.62L68.83 41.59L68.66 41.55L68.11 41.37L67.78 41.24L67.41 41.07L67.09 40.91L66.82 40.76L66.63 40.64L66.45 40.51L65.95 40.13L65.68 39.90L65.38 39.64L65.05 39.33L64.77 39.04L64.51 38.74L64.11 38.26L63.92 38.01L63.90 37.98L63.88 37.93L63.88 37.89Z"/></svg>
|
|
620
|
+
<div id="startup-connection-status" role="status" hidden></div>
|
|
608
621
|
<div id="startup-session-progress" class="splash-session-progress" hidden>
|
|
609
622
|
<div
|
|
610
623
|
id="startup-session-progress-track"
|
package/dist/mini-chat.html
CHANGED
|
@@ -77,15 +77,15 @@
|
|
|
77
77
|
.dark #initial-loading img { filter: invert(1); }
|
|
78
78
|
</style>
|
|
79
79
|
|
|
80
|
-
<script type="module" crossorigin src="/assets/miniChat-
|
|
80
|
+
<script type="module" crossorigin src="/assets/miniChat-C93_bSRK.js"></script>
|
|
81
81
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-D0YWp3FJ.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-BAmoc_34.js">
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-CMglnUdS.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-AE3_TnQz.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CzHs0bHY.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-vDaAPGfl.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
@@ -98,21 +98,22 @@
|
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-2dx7jbt9.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/bootstrap-DGkBnhNP.js">
|
|
102
103
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-B-Wpqq5J.js">
|
|
103
104
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-C2Rs6TPz.js">
|
|
104
105
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
105
106
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
106
107
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
107
108
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-BP4P52ry.js">
|
|
108
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-CIkpp8g-.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-bbnqBofP.js">
|
|
110
111
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-D6bwc3Kj.js">
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
112
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
113
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-sEg2IOLZ.js">
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CDpG4h8_.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-BXVNgGXT.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-CbYntrYO.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-Cx9RXogi.js">
|
|
116
117
|
<link rel="stylesheet" crossorigin href="/assets/src-PTWgTO6W.css">
|
|
117
118
|
</head>
|
|
118
119
|
<body class="h-full bg-background text-foreground">
|
package/dist/mobile.html
CHANGED
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
66
|
<style>.dark #mobile-startup-logo img { filter: invert(1); }</style>
|
|
67
|
-
<script type="module" crossorigin src="/assets/mobile-
|
|
67
|
+
<script type="module" crossorigin src="/assets/mobile-DF9tY4EV.js"></script>
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/runtime-auth-DBn9yahL.js">
|
|
70
70
|
<link rel="modulepreload" crossorigin href="/assets/runtime-switch-DEZ1K7qW.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="/assets/runtime-fetch-D0YWp3FJ.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="/assets/runtimeAPIRegistry-C2VogTny.js">
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-
|
|
74
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-BAmoc_34.js">
|
|
74
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopHosts-CMglnUdS.js">
|
|
75
|
+
<link rel="modulepreload" crossorigin href="/assets/desktopRelayRestore-AE3_TnQz.js">
|
|
76
76
|
<link rel="modulepreload" crossorigin href="/assets/vendor-base-ui-CzHs0bHY.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="/assets/vendor-zustand-vDaAPGfl.js">
|
|
78
78
|
<link rel="modulepreload" crossorigin href="/assets/vendor-effect-X1Hqc7ba.js">
|
|
@@ -85,21 +85,22 @@
|
|
|
85
85
|
<link rel="modulepreload" crossorigin href="/assets/queryRuntime-2dx7jbt9.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="/assets/vendor-pathe-vBmvQE8f.js">
|
|
87
87
|
<link rel="modulepreload" crossorigin href="/assets/pathNormalization-ewtPqJWn.js">
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/runtime-ead7P81A.js">
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/bootstrap-DGkBnhNP.js">
|
|
89
90
|
<link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-react-query-B-Wpqq5J.js">
|
|
90
91
|
<link rel="modulepreload" crossorigin href="/assets/fileQueries-C2Rs6TPz.js">
|
|
91
92
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-store-BVRgEtI-.js">
|
|
92
93
|
<link rel="modulepreload" crossorigin href="/assets/path-utils-jGozTg9d.js">
|
|
93
94
|
<link rel="modulepreload" crossorigin href="/assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js">
|
|
94
95
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-resource-BP4P52ry.js">
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/terminalApi-
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/gitApiHttp-CIkpp8g-.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/terminalApi-bbnqBofP.js">
|
|
97
98
|
<link rel="modulepreload" crossorigin href="/assets/runtime-file-download-D6bwc3Kj.js">
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/platform-
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/assets/types-
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/native-config-
|
|
102
|
-
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/platform-sEg2IOLZ.js">
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/types-CDpG4h8_.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/capgoAdapter-BXVNgGXT.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/native-config-CbYntrYO.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/runtimeConfig-Cx9RXogi.js">
|
|
103
104
|
<link rel="stylesheet" crossorigin href="/assets/src-PTWgTO6W.css">
|
|
104
105
|
</head>
|
|
105
106
|
<body class="h-full bg-background text-foreground">
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ToolOutputDialog-BQgmj6rE.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-auth-DBn9yahL.js","assets/runtime-switch-DEZ1K7qW.js","assets/runtime-fetch-D0YWp3FJ.js","assets/desktop-JwYqThiw.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/vendor-base-ui-CzHs0bHY.js","assets/useUIStore-CoWJ3ROq.js","assets/vendor-zustand-vDaAPGfl.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/vendor-react-DlzBev0S.js","assets/vendor-tanstack-react-query-B-Wpqq5J.js","assets/vendor-tanstack-query-core-Y_YoRHtC.js","assets/runtime-file-resource-BP4P52ry.js","assets/queryRuntime-2dx7jbt9.js","assets/fileQueries-C2Rs6TPz.js","assets/runtime-file-store-BVRgEtI-.js","assets/path-utils-jGozTg9d.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-download-D6bwc3Kj.js","assets/platform-DFJEtBlo.js","assets/vendor-pierre-diffs-BFiZ3IhI.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/vendor-reactuses-core-DWo5Wn6R.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/button-Cjciq1yh.js","assets/store-CKIMMlXR.js","assets/tour-Db44qwfs.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/useThemeSystem-CNzUUkFn.js","assets/vendor-framer-motion-DDMKlXiP.js","assets/Icon-BQczEnxm.js","assets/dialog-rVkj8VgE.js","assets/dialog-CTYD3Sbr.css","assets/tap-LkQum5bB.js","assets/themes-BgDJcxRc.js","assets/MobileWindowStack-DGLdgoGr.js","assets/appThemeRegistry-l72ZmQkp.js","assets/useMobileNavigationStore-B2yMgBp_.js","assets/gitApiHttp-Ddik7PM_.js","assets/vendor-opencode-client-cQ47ywrT.js","assets/vendor-effect-X1Hqc7ba.js","assets/persistence-D-rnhgr4.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-sonner-BEHGipm5.js","assets/useAssistantUIStore-BI_dAUjx.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/agentColors-DWSbQXy2.js","assets/rasterizePng-056Poix7.js","assets/MarkdownRenderer-D740lJLe.js","assets/useEffectiveDirectory-DvI6toj8.js","assets/markdownHeightCache-C7UOJdkN.js","assets/dualLimitLru-D8Sphgua.js","assets/toolHelpers-iEHVHQ9p.js","assets/image-loading-DKQOYtti.js","assets/image-loading-D9Z_BASK.css","assets/ImageLoadingPlaceholder-KksxJaKp.js","assets/useWorkerHighlightedLines-aMYjp95H.js","assets/markdownTheme-CHNl6tUv.js","assets/markdown-worker-oBGEB9Eg.js","assets/vendor-tanstack-react-virtual-DSFNK3qc.js","assets/mobileBackNavigation-1On_J_sK.js","assets/touch-gestures-CErgaXZ7.js","assets/ToolOutputDialog-CbGuK5bP.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n}from"./runtime-switch-DEZ1K7qW.js";import{a as r}from"./vendor-zustand-vDaAPGfl.js";import{d as i,f as a,g as o,h as s,m as c,ot as l,p as u,st as d,u as f}from"./vendor-base-ui-CzHs0bHY.js";import{r as p}from"./useUIStore-CoWJ3ROq.js";import{$ as m,B as h,J as g,K as _,U as v,X as y,q as b,st as x,z as S}from"./persistence-D-rnhgr4.js";import{n as C}from"./vendor-react-DlzBev0S.js";import{s as w}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{o as T}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{n as E,r as D}from"./platform-DFJEtBlo.js";import{a as O,i as k,m as A,o as j,p as M,s as N}from"./vendor-reactuses-core-DWo5Wn6R.js";import{f as ee,r as P,t as F}from"./button-Cjciq1yh.js";import{i as te,n as I}from"./MobileShareBridge-DUHic62l.js";import{N as L,T as ne,_ as R,f as z,g as B,h as V,j as H,n as re,r as U,u as W,v as ie,w as ae}from"./MobileDetailNavigation-BZeOHfd5.js";import{$n as oe,$r as se,Et as G,Qr as K,Y as ce,ja as le,s as ue}from"./useMobileNavigationStore-B2yMgBp_.js";import{n as de}from"./useAssistantUIStore-BI_dAUjx.js";import{a as fe}from"./fileMentionAutocompleteState-BZJqfgae.js";import{t as pe}from"./AgentAvatar-DHFLlQ7M.js";import{d as me,o as q,t as he}from"./vendor-framer-motion-DDMKlXiP.js";import{n as J}from"./Icon-BQczEnxm.js";import{t as Y}from"./scheduledTaskNavigation-Bp5rGr3m.js";import{D as ge,E as _e,O as ve,a as ye,c as be,d as xe,f as Se,g as Ce,h as we,l as Te,m as X,o as Ee,s as De,t as Oe,u as ke,w as Ae,x as je}from"./sessionLookup-CBbIIonR.js";import{a as Me,n as Ne,r as Pe,t as Fe}from"./fileMentionTouchSelection-CmdNi_d0.js";import{a as Ie,o as Le,t as Re}from"./MarkdownRenderer-D740lJLe.js";import{c as ze,s as Be}from"./image-loading-DKQOYtti.js";import{t as Ve}from"./ImageLoadingPlaceholder-KksxJaKp.js";import{t as He}from"./LoadingImage-Ch5MyA20.js";import{n as Ue}from"./textarea-B4mWtnN5.js";import{t as We}from"./vendor-motion-C9oiAdx-.js";import{i as Ge,n as Ke,r as qe}from"./assistant-attachment-cache-oatc8F4t.js";var Z=C(),Q=e(d(),1),$=l();function Je(e){let r=(0,Z.c)(12),{assistantID:i,position:a}=e,o=Q.useRef(null),s=Q.useRef(!1),c;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={busy:!1,done:!1,retryAt:0},r[0]=c):c=r[0];let l=Q.useRef(c),[u]=Q.useState(et),d;r[1]!==i||r[2]!==a||r[3]!==u?(d=()=>{let e=o.current;if(!e||!s.current||l.current.busy||l.current.done||Date.now()<l.current.retryAt||u.transport!==t()||u.generation!==n()||document.visibilityState!==`visible`||(E()?!document.documentElement.classList.contains(`yuri-native-app-active`):!document.hasFocus())||e.parentElement?.closest(`[inert], [aria-hidden="true"]`))return;let r=e.closest(`[data-assistant-contact-transcript]`);if(!r||r.scrollHeight-r.scrollTop-r.clientHeight>2)return;let c=e.getBoundingClientRect(),d=r.getBoundingClientRect(),f=window.visualViewport,p=f?.offsetTop??0,m=p+(f?.height??window.innerHeight);c.height<=0||c.width<=0||c.bottom>Math.min(d.bottom,m)||c.top<Math.max(d.top,p)||c.right<=Math.max(d.left,0)||c.left>=Math.min(d.right,window.innerWidth)||(l.current.busy=!0,W(i,a).then(()=>{l.current.done=!0}).catch(()=>{l.current.retryAt=Date.now()+15e3}).finally(()=>{l.current.busy=!1}))},r[1]=i,r[2]=a,r[3]=u,r[4]=d):d=r[4];let f=k(d),p;r[5]===f?p=r[6]:(p=e=>{s.current=e.some($e),f()},r[5]=f,r[6]=p);let m;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(m={threshold:1},r[7]=m):m=r[7],j(o,k(p),m),O(`visibilitychange`,f,Qe),O(`focus`,f,Ze),O(`resize`,f,Xe);let h,g;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>o.current?.closest(`[data-assistant-contact-transcript]`),g={passive:!0},r[8]=h,r[9]=g):(h=r[8],g=r[9]),O(`scroll`,f,h,g);let _;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(_={attributes:!0,attributeFilter:[`class`]},r[10]=_):_=r[10],M(f,Ye,_),N(f,15e3);let v;return r[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(`span`,{ref:o,"aria-hidden":`true`,className:`absolute bottom-0 left-0 block h-px w-px`,"data-assistant-read-marker":``}),r[11]=v):v=r[11],v}function Ye(){return document.documentElement}function Xe(){return window.visualViewport}function Ze(){return window}function Qe(){return document}function $e(e){return e.isIntersecting&&e.intersectionRatio===1}function et(){return{transport:t(),generation:n()}}var tt=()=>{},nt=Q.memo(ve),rt=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,it=Q.forwardRef(({query:e,isMobile:t,listId:n,onHighlightChange:r,onSelect:i,onClose:a},o)=>{let{t:s}=ee(),c=ze(),l=w({...se(c),select:rt}),u=Q.useMemo(()=>fe({sessions:l.data??[],currentSessionId:null,searchQuery:e,limit:e.trim()?10:3}),[l.data,e]),[d,f]=Q.useState({query:e,index:0}),p=Math.min(d.query===e?d.index:0,Math.max(0,u.length-1)),m=Q.useRef(null),h=Q.useRef([]),g=Q.useMemo(Fe,[]);O(`pointerdown`,e=>{e.target instanceof Node&&!m.current?.contains(e.target)&&a()},void 0,{capture:!0}),Q.useLayoutEffect(()=>{h.current[p]?.scrollIntoView?.({block:`nearest`})},[p]),Q.useLayoutEffect(()=>{r(u.length?`${n}-${p}`:void 0)},[p,n,u.length,r]);let _=k(t=>{if(t===`Escape`){a();return}u.length&&(t===`ArrowDown`&&f({query:e,index:(p+1)%u.length}),t===`ArrowUp`&&f({query:e,index:(p-1+u.length)%u.length}),(t===`Enter`||t===`Tab`)&&i(u[p]))});return Q.useImperativeHandle(o,()=>({keyDown:_}),[_]),(0,$.jsxs)(Ne,{ref:m,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)(J,{name:`close`,className:`size-4`})})]}),l.isPending?(0,$.jsx)(`p`,{role:`status`,className:`px-3 py-2 typography-meta text-muted-foreground`,children:s(`common.loading`)}):null,l.isError?(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:()=>void l.refetch(),children:s(`chat.history.retry`)})]}):null,l.isSuccess&&!u.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)(Ue,{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:u.map((r,a)=>(0,$.jsxs)(`div`,{id:`${n}-${a}`,role:`option`,"aria-selected":a===p,ref:e=>{h.current[a]=e},className:P(`flex min-h-10 cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 typography-ui-label`,Pe(t,a===p)),onMouseDown:e=>e.preventDefault(),onMouseMove:()=>f({query:e,index:a}),onPointerDown:e=>{e.pointerType===`touch`&&g.pointerDown(e.clientX,e.clientY)},onPointerMove:e=>{e.pointerType===`touch`&&g.pointerMove(e.clientX,e.clientY)},onPointerUp:e=>{e.pointerType===`touch`&&g.pointerUp(()=>i(r))&&(e.preventDefault(),e.stopPropagation())},onPointerCancel:()=>g.pointerCancel(),onClick:()=>g.click(()=>i(r)),children:[(0,$.jsx)(J,{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})]})]},`${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`)})]})}),at=e=>{let t=(0,Z.c)(120),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}=ee(),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}=ge(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,y;t[11]===a.value?y=t[12]:(y=()=>({canonical:a.value,document:v(a.value,new Map)}),t[11]=a.value,t[12]=y);let[C,w]=Q.useState(y),T;t[13]!==C.canonical||t[14]!==C.document||t[15]!==a.value?(T=C.canonical===a.value?C.document:v(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),[A,j]=Q.useState(!0),[M,N]=Q.useState(!1),[F,te]=Q.useState(),I=Q.useRef(null),L=Q.useRef(null),ne=Q.useRef(null),R=Q.useRef(null),z;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=be(),t[17]=z):z=t[17];let B=Q.useRef(z),V=Q.useId(),H;t[18]!==n||t[19]!==M||t[20]!==D||t[21]!==A||t[22]!==E.text||t[23]!==a.disabled||t[24]!==a.pending?(H=n&&!a.pending&&!a.disabled&&!A&&!M?Me({text:E.text,cursor:D}):null,t[18]=n,t[19]=M,t[20]=D,t[21]=A,t[22]=E.text,t[23]=a.disabled,t[24]=a.pending,t[25]=H):H=t[25];let re=H,U=re?.kind===`mention`?re:null,W;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>{R.current!==null&&(I.current?.focus({preventScroll:!0}),I.current?.setSelectionRange(R.current,R.current),R.current=null)},t[26]=W):W=t[26];let ie;t[27]===E?ie=t[28]:(ie=[E],t[27]=E,t[28]=ie),Q.useLayoutEffect(W,ie);let ae;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(ae=()=>j(!0),t[29]=ae):ae=t[29];let oe=k(ae),se;t[30]!==M||t[31]!==D||t[32]!==E||t[33]!==r?(se=(e,t,n)=>{let i=n===void 0||n,a=g(e);a.ok&&(i&&(B.current=Te(B.current,{before:De(E,[],{start:I.current?.selectionStart??D,end:I.current?.selectionEnd??D}),after:De(e,[],{start:t,end:t})})),M||(R.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]=se):se=t[34];let G=k(se),K;t[35]!==G||t[36]!==E||t[37]!==U||t[38]!==o?(K=e=>{if(!U)return;let t=e.title||o(`chat.fileMentionAutocomplete.untitledSession`),n=h(E,U.tokenStart,U.tokenEnd,{id:`session:${e.id}:${crypto.randomUUID()}`,kind:`session`,sessionId:e.id,display:x({trigger:`@`,icon:`chat-thread`,label:t})},{inlineBoundaries:!0,padDocumentEdges:!0}),r=n.caret+ +(n.document.text[n.caret]===` `);j(!0),G(n.document,r)},t[35]=G,t[36]=E,t[37]=U,t[38]=o,t[39]=K):K=t[39];let ce=k(K),le;t[40]!==n||t[41]!==G||t[42]!==E||t[43]!==a.disabled||t[44]!==a.pending?(le=e=>{if(!n||a.pending||a.disabled||!e.trim())return;let t=E.text?`${E.text} ${e}`:e,r=_(E,t,t.length,t.length);G(r.document,r.caret),j(!0)},t[40]=n,t[41]=G,t[42]=E,t[43]=a.disabled,t[44]=a.pending,t[45]=le):le=t[45];let ue=k(le),de;t[46]!==n||t[47]!==E.text||t[48]!==ue||t[49]!==r||t[50]!==i||t[51]!==a.disabled||t[52]!==a.pending?(de=e=>{if(!(!n||a.pending||a.disabled||!e.trim())){if(E.text){ue(e);return}r(e),i?.(e)}},t[46]=n,t[47]=E.text,t[48]=ue,t[49]=r,t[50]=i,t[51]=a.disabled,t[52]=a.pending,t[53]=de):de=t[53];let fe=k(de),pe;t[54]!==G||t[55]!==E?(pe=(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=S(n.selectionStart,n.selectionEnd,E.references)??{start:n.selectionStart,end:n.selectionEnd},i=g({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=_(E,E.text.slice(0,r.start)+E.text.slice(r.end),r.start,r.start);G(e.document,e.caret)}},t[54]=G,t[55]=E,t[56]=pe):pe=t[56];let me=k(pe),q;t[57]!==E.references||t[58]!==E.text?(q=Ce(E.text,E.references.map(ot))?.map(st),t[57]=E.references,t[58]=E.text,t[59]=q):q=t[59];let he=q,J=u&&E.text.length===0?`true`:void 0,Y;t[60]!==u||t[61]!==ue||t[62]!==a.disabled||t[63]!==a.pending||t[64]!==fe||t[65]!==f?(Y=u&&(0,$.jsx)(nt,{containerRef:s,disabled:!!(a.pending||a.disabled),onInsert:ue,onSend:fe,onRelease:tt,onHintChange:f}),t[60]=u,t[61]=ue,t[62]=a.disabled,t[63]=a.pending,t[64]=fe,t[65]=f,t[66]=Y):Y=t[66];let _e=E.text,ve=a.pending,ye;t[67]===a?ye=t[68]:(ye=()=>{a.pending||a.onSubmit()},t[67]=a,t[68]=ye);let Se=a.layout===`inline`?`py-3 leading-6`:`pt-4 pb-2`,we;t[69]!==a.textLayoutClassName||t[70]!==Se?(we=P(`whitespace-pre-wrap break-words overflow-hidden px-3 typography-markdown md:typography-ui-label`,Se,a.textLayoutClassName),t[69]=a.textLayoutClassName,t[70]=Se,t[71]=we):we=t[71];let X;t[72]!==G||t[73]!==E?(X=(e,t)=>{let n=_(E,e,t?.target.selectionStart??e.length,t?.target.selectionEnd??e.length);G(n.document,n.caret),j(t?.nativeEvent?.inputType===`insertFromPaste`)},t[72]=G,t[73]=E,t[74]=X):X=t[74];let Ee=U?V:void 0,Oe=U?F:void 0,Ne;t[75]===a.textareaProps?Ne=t[76]:(Ne=e=>{a.textareaProps?.onScroll?.(e),L.current&&(L.current.scrollTop=e.currentTarget.scrollTop,L.current.scrollLeft=e.currentTarget.scrollLeft)},t[75]=a.textareaProps,t[76]=Ne);let Pe,Fe;t[77]!==me||t[78]!==a.textareaProps?(Pe=e=>{a.textareaProps?.onCopy?.(e),e.defaultPrevented||me(e,!1)},Fe=e=>{a.textareaProps?.onCut?.(e),e.defaultPrevented||me(e,!0)},t[77]=me,t[78]=a.textareaProps,t[79]=Pe,t[80]=Fe):(Pe=t[79],Fe=t[80]);let Ie;t[81]===a.textareaProps?Ie=t[82]:(Ie=e=>{O(e.currentTarget.selectionStart),a.textareaProps?.onSelect?.(e)},t[81]=a.textareaProps,t[82]=Ie);let Le,Re;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Le=()=>{N(!0)},Re=e=>{N(!1),O(e.currentTarget.selectionStart)},t[83]=Le,t[84]=Re):(Le=t[83],Re=t[84]);let ze;t[85]!==G||t[86]!==M||t[87]!==E||t[88]!==U||t[89]!==a.textareaProps?(ze=e=>{if(a.textareaProps?.onKeyDown?.(e),!(e.defaultPrevented||Ae(e))){if(M){e.key===`Enter`&&e.preventDefault();return}if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`z`){let t=e.shiftKey?ke(B.current,E):xe(B.current,E);t&&(e.preventDefault(),B.current=t.history,G(t.snapshot.document,t.snapshot.selection.end,!1),j(!0));return}if(e.key===`Backspace`||e.key===`Delete`){let t=b(E,{key:e.key,selectionStart:e.currentTarget.selectionStart,selectionEnd:e.currentTarget.selectionEnd,altKey:e.altKey});if(t){e.preventDefault(),G(t.document,t.caret),j(!0);return}}U&&[`ArrowDown`,`ArrowUp`,`Enter`,`Tab`,`Escape`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),ne.current?.keyDown(e.key))}},t[85]=G,t[86]=M,t[87]=E,t[88]=U,t[89]=a.textareaProps,t[90]=ze):ze=t[90];let Be;t[91]!==a.textareaProps||t[92]!==Ee||t[93]!==Oe||t[94]!==Ne||t[95]!==Pe||t[96]!==Fe||t[97]!==Ie||t[98]!==ze?(Be={...a.textareaProps,"aria-controls":Ee,"aria-activedescendant":Oe,"aria-autocomplete":`list`,onScroll:Ne,onCopy:Pe,onCut:Fe,onSelect:Ie,onCompositionStart:Le,onCompositionEnd:Re,onKeyDown:ze},t[91]=a.textareaProps,t[92]=Ee,t[93]=Oe,t[94]=Ne,t[95]=Pe,t[96]=Fe,t[97]=Ie,t[98]=ze,t[99]=Be):Be=t[99];let Ve;t[100]!==oe||t[101]!==V||t[102]!==U||t[103]!==a.isMobile||t[104]!==ce?(Ve=U?(0,$.jsx)(it,{ref:ne,query:U.query,isMobile:a.isMobile??!1,listId:V,onHighlightChange:te,onSelect:ce,onClose:oe}):null,t[100]=oe,t[101]=V,t[102]=U,t[103]=a.isMobile,t[104]=ce,t[105]=Ve):Ve=t[105];let He;t[106]!==E.text||t[107]!==he||t[108]!==m||t[109]!==a||t[110]!==ye||t[111]!==we||t[112]!==X||t[113]!==Be||t[114]!==Ve?(He=(0,$.jsx)(je,{...a,value:_e,pending:ve,placeholder:m,disableInputWhilePending:!1,inputRef:I,onSubmit:ye,highlightedContent:he,highlightRef:L,textLayoutClassName:we,onChange:X,textareaProps:Be,children:Ve}),t[106]=E.text,t[107]=he,t[108]=m,t[109]=a,t[110]=ye,t[111]=we,t[112]=X,t[113]=Be,t[114]=Ve,t[115]=He):He=t[115];let Ue;return t[116]!==J||t[117]!==Y||t[118]!==He?(Ue=(0,$.jsxs)(`div`,{ref:s,className:`yuri-hold-to-talk-container`,"data-hold-to-talk-empty":J,children:[Y,He]}),t[116]=J,t[117]=Y,t[118]=He,t[119]=Ue):Ue=t[119],Ue};function ot(e){return{start:e.start,end:e.end,priority:103,...y(e)}}function st(e,t){return(0,$.jsx)(`span`,{className:e.className,children:e.visual?(0,$.jsx)(we,{visual:e.visual,text:e.text}):e.text},`${t}-${e.text.length}`)}var ct=`rounded-[1.35rem] border border-border/40 cursor-zoom-in`;function lt({assistantID:e,descriptor:t,onShowPopup:n}){let{t:r}=ee(),i=ze(),{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=Ie(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&&qe(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=k(async(t=!1)=>{if(x.current)return;let i=new AbortController;x.current=i,b(!0),v(!1);try{let a=await Ke(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=k(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)(He,{src:h,alt:w,contentFrame:!0,className:ct,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)(Ve,{className:`h-[var(--yuri-content-image-height)] w-[min(20rem,100%)] rounded-[1.35rem]`}):(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)(J,{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 ut(e){let t=(0,Z.c)(39),{part:n,onShowPopup:r}=e,{t:i}=ee(),a=/^(?:https?:|data:|blob:)/i.test(n.url)?n.url:``,o=Be(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=k(d);if(Ie(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)(He,{src:o,alt:u,contentFrame:!0,className:ct,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)(J,{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 dt(e){let t=(0,Z.c)(5),{assistantID:n,part:r,onShowPopup:i}=e,a=ze(),o;return t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==a?(o=`attachmentID`in r?(0,$.jsx)(lt,{assistantID:n,descriptor:r,onShowPopup:i},`${a}:${n}:${r.attachmentID}:${r.sha256}`):(0,$.jsx)(ut,{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 ft=Q.memo(e=>{let t=(0,Z.c)(32),{turn:n,retryDisabled:r,onRetry:l}=e,{t:d}=ee(),p;t[0]===d?p=t[1]:(p=d(`assistants.contact.sendError.viewDetails`),t[0]=d,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(J,{name:`exclamation-fill`,className:`size-[18px] text-[var(--status-error)]`,"data-assistant-contact-error-dot":``}),t[2]=m):m=t[2];let h;t[3]===p?h=t[4]:(h=(0,$.jsx)(s,{type:`button`,"aria-label":p,"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:m}),t[3]=p,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]===d?_=t[7]:(_=d(`assistants.contact.sendError.title`),t[6]=d,t[7]=_);let v;t[8]===_?v=t[9]:(v=(0,$.jsx)(i,{className:`typography-ui-label font-medium`,children:_}),t[8]=_,t[9]=v);let y;t[10]!==d||t[11]!==n.error?(y=n.error||d(`assistants.contact.sendFailed`),t[10]=d,t[11]=n.error,t[12]=y):y=t[12];let b;t[13]===y?b=t[14]:(b=(0,$.jsx)(f,{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]!==l||t[16]!==n.messageID?(x=()=>l(n.messageID),t[15]=l,t[16]=n.messageID,t[17]=x):x=t[17];let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(J,{name:`refresh`,className:`size-3`}),t[18]=S):S=t[18];let C;t[19]===d?C=t[20]:(C=d(`chat.history.retry`),t[19]=d,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)(c,{children:(0,$.jsx)(u,{side:`left`,align:`center`,sideOffset:6,collisionPadding:12,collisionAvoidance:g,className:`z-50`,children:(0,$.jsxs)(a,{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 pt(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)(ft,{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}var mt=[],ht=e=>e.flatMap(e=>e.type===`text`&&e.text.trim()?[e.text]:[]).join(`
|
|
3
|
-
`),gt=(e,t,n,r=Date.now())=>({assistantID:e,messageID:t,parts:n,status:`sending`,createdAt:r}),_t=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},vt=(e,t)=>{let n=e.filter(e=>e.assistantID===t);return n.length===e.length?e:n},yt=(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:[]}),bt=(e,t,n)=>{let r=e.bubbles.filter(e=>!t.has(e.bubbleIndex)).map((t,r)=>yt(e,t,n+r,t.done?`complete`:`streaming`));return e.status===`failed`?[...r,yt(e,null,n+r.length,`failed`)]:e.status===`admitted`||e.status===`streaming`?[...r,yt(e,null,n+r.length,`admitted`)]:r},xt=(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:ht(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=bt(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)},St=(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},Ct=(e,t)=>e.map(e=>e.messageID===t?{...e,status:`admitted`}:e),wt=(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}]},Tt=(e,t,n)=>!t?.turnID||!t.assistantID||n?.has(t.turnID)?e:wt(e,t.assistantID,t.turnID,t.admittedAt),Et=(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=Tt(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=Ot(u,{assistantID:n,turnID:e.turnID,status:`error`,error:e.text||`upstream_error`,occurredAt:s})));if(u=kt(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},Dt=(e,t)=>wt(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}}),Ot=(e,t,n={})=>n.requireExisting&&!e.some(e=>e.assistantID===t.assistantID&&e.turnID===t.turnID)?e:wt(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}:{}}),kt=(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},At=(e,t,n)=>e.map(e=>e.messageID===t?{...e,status:`failed`,error:n}:e),jt=(e,t)=>e instanceof H?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})`:L(e)?t.timedOut:e instanceof Error&&e.message.trim()?e.message:t.sendFailed,Mt=()=>{let e=!1;return{tryAcquire:()=>!e&&(e=!0,!0),release:()=>{e=!1}}},Nt=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:gt(e.assistantID,r,n,e.createdAt)}},Pt=e=>e.some(e=>e.status===`sending`),Ft=e=>e.some(e=>e.status===`admitted`||e.status===`streaming`),It=r(e=>({workingByID:{},setWorking:(t,n)=>e(e=>({workingByID:{...e.workingByID,[t]:n}}))})),Lt=({sending:e=!1,processing:t=!1,serverWorking:n=!1})=>e||t||n,Rt=(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=It(i),o;return n[2]!==a||n[3]!==r?(o=Lt({processing:a,serverWorking:r}),n[2]=a,n[3]=r,n[4]=o):o=n[4],o},zt=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}=ee(),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 _=It(g),v=!!(o||_),y=`calc(${f}px * var(--dpt-n, 1))`,b;t[3]===c?b=t[4]:(b=P(`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)(pe,{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};function Bt(e){let t=(0,Z.c)(6),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(J,{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,$.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,$.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 Vt=Q.createContext(null),Ht=[`grid h-[148px] w-[19rem] min-w-0 max-w-full shrink-0 grid-rows-[40px_20px_20px_48px] content-start cursor-pointer rounded-[1.35rem] bg-[var(--surface-muted)]`,`px-4 py-2.5 text-left typography-ui-label transition-colors duration-150 motion-reduce:transition-none`,`hover:bg-interactive-hover/45`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]`].join(` `),Ut=Ht,Wt=Ht,Gt=`row-start-1 mb-2 flex h-8 min-w-0 items-center gap-2`,Kt=`row-start-2 min-w-0 self-start truncate font-medium leading-5 text-foreground`,qt=`row-start-4 flex h-12 min-w-0 flex-col justify-center`;function Jt(e,t){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())}var Yt=e=>{let t=(0,Z.c)(36),{card:n,assistant:r,active:i}=e,a=i===void 0||i,{t:o}=ee(),s=_e(),c;t[0]===s?c=t[1]:(c=s&&!D(),t[0]=s,t[1]=c);let l=!!c,u=n.name,d=`${n.providerID}/${n.modelID}`,f=Q.useContext(Vt),p;t[2]!==n.assistantID||t[3]!==l||t[4]!==f?(p=()=>{if(f)return f({assistantID:n.assistantID});if(l){ue.getState().openAssistant(n.assistantID);return}de(n.assistantID)},t[2]=n.assistantID,t[3]=l,t[4]=f,t[5]=p):p=t[5];let m=k(p),h;t[6]===m?h=t[7]:(h=e=>{Jt(e,m)},t[6]=m,t[7]=h);let g=k(h),_;t[8]!==o||t[9]!==u?(_=o(`assistants.contact.card.assistant.aria`,{name:u}),t[8]=o,t[9]=u,t[10]=_):_=t[10];let v=r?.avatarSeed,y=a?!!(r?.working||r?.activeContactTurn):void 0,b;t[11]!==n.assistantID||t[12]!==v||t[13]!==y?(b=(0,$.jsx)(`span`,{className:`relative inline-block shrink-0 leading-none`,"aria-hidden":!0,children:(0,$.jsx)(zt,{name:n.assistantID,avatarSeed:v,size:32,working:y,showWorkingDot:!1,followPointer:!1})}),t[11]=n.assistantID,t[12]=v,t[13]=y,t[14]=b):b=t[14];let x;t[15]===o?x=t[16]:(x=o(`assistants.contact.card.assistant.label`),t[15]=o,t[16]=x);let S;t[17]===x?S=t[18]:(S=(0,$.jsx)(`span`,{className:`min-w-0 truncate text-[0.8em] leading-4 text-muted-foreground`,children:x}),t[17]=x,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(J,{name:`arrow-right-s`,weight:`medium`,className:`ml-auto size-4 shrink-0 text-muted-foreground`}),t[19]=C):C=t[19];let w;t[20]!==S||t[21]!==b?(w=(0,$.jsxs)(`div`,{className:Gt,children:[b,S,C]}),t[20]=S,t[21]=b,t[22]=w):w=t[22];let T;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(T=P(Kt,`row-span-2 self-center`),t[23]=T):T=t[23];let E;t[24]===u?E=t[25]:(E=(0,$.jsx)(`h3`,{className:T,title:u,children:u}),t[24]=u,t[25]=E);let O;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(O=P(qt,`justify-end pb-1`),t[26]=O):O=t[26];let A;t[27]===d?A=t[28]:(A=(0,$.jsx)(`div`,{className:O,children:(0,$.jsx)(`div`,{className:`flex h-4 min-w-0 items-center`,children:(0,$.jsx)(Bt,{value:d})})}),t[27]=d,t[28]=A);let j;return t[29]!==g||t[30]!==m||t[31]!==w||t[32]!==E||t[33]!==A||t[34]!==_?(j=(0,$.jsxs)(`article`,{className:Ut,role:`button`,tabIndex:0,"aria-label":_,"data-assistant-contact-card":`assistant`,onClick:m,onKeyDown:g,children:[w,E,A]}),t[29]=g,t[30]=m,t[31]=w,t[32]=E,t[33]=A,t[34]=_,t[35]=j):j=t[35],j},Xt=e=>!!(e&&typeof e==`object`&&!Array.isArray(e)),Zt=e=>typeof e==`string`&&/^([01]\d|2[0-3]):[0-5]\d$/.test(e),Qt=e=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=6,$t=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,en=e=>{if(!Xt(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)&&Zt(e.time);let t=Array.isArray(e.times)&&e.times.length>0&&e.times.every(Zt);return e.kind===`daily`?t||Zt(e.time):e.kind===`weekly`&&(t||Zt(e.time))&&Array.isArray(e.weekdays)&&e.weekdays.length>0&&e.weekdays.every(Qt)},tn=(e,t)=>{if(!$t(e)||!en(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}},nn=(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(Zt))].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(Qt))].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}},rn=e=>{let t=(0,Z.c)(44),{card:n,task:r}=e,{t:i}=ee(),a=n.name,o;t[0]!==n||t[1]!==i||t[2]!==r?(o=nn(tn(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(Vt),d;t[6]!==n.projectID||t[7]!==n.taskID||t[8]!==u?(d=()=>{if(u)return u({projectID:n.projectID,taskID:n.taskID});Y(n.projectID,n.taskID)},t[6]=n.projectID,t[7]=n.taskID,t[8]=u,t[9]=d):d=t[9];let f=k(d),p;t[10]===f?p=t[11]:(p=e=>{Jt(e,f)},t[10]=f,t[11]=p);let m=k(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)(J,{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)(J,{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:Gt,children:[v,y]}),t[21]=v,t[22]=b);let x;t[23]===a?x=t[24]:(x=(0,$.jsx)(`h3`,{className:Kt,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=P(qt,`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:Ut,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},an=(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`,on=e=>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,sn=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`,cn=e=>e.split(/[/\\]/u).filter(Boolean).at(-1)||e,ln=e=>{let t=(0,Z.c)(57),{card:n}=e,{t:r}=ee(),i=_e(),a;t[0]===i?a=t[1]:(a=i&&!D(),t[0]=i,t[1]=a);let o=!!a,s;t[2]===n.sessionID?s=t[3]:(s=e=>e.activeSessions.find(e=>e.id===n.sessionID)??e.archivedSessions.find(e=>e.id===n.sessionID)??null,t[2]=n.sessionID,t[3]=s);let c=K(s),l=ce(n.sessionID),u=(typeof c?.title==`string`&&c.title.trim()?c.title.trim():null)||n.title||r(`assistants.contact.card.session.untitled`),d=an(l?.type,n.status),f=on(d),m;t[4]!==n.directory||t[5]!==c?(m=typeof c?.directory==`string`&&c.directory.trim()?c.directory.trim():n.directory,t[4]=n.directory,t[5]=c,t[6]=m):m=t[6];let h=m,g;t[7]===h?g=t[8]:(g=cn(h),t[7]=h,t[8]=g);let _=g,v=oe(h).data?.current?.trim()||null,y;t[9]===c?y=t[10]:(y=Ee(c),t[9]=c,t[10]=y);let b=y,x=d===`complete`||d===`idle`?ye(c):null,S=Q.useContext(Vt),C;t[11]!==n.directory||t[12]!==n.sessionID||t[13]!==o||t[14]!==S?(C=()=>{let e=Oe(n.sessionID)?.directory||n.directory;if(S)return S({sessionId:n.sessionID,directory:e});G(n.sessionID,e,{phoneShell:o,switchToChat:!0}),o||p.getState().setActiveMainTab(`chat`)},t[11]=n.directory,t[12]=n.sessionID,t[13]=o,t[14]=S,t[15]=C):C=t[15];let w=k(C),T;t[16]===w?T=t[17]:(T=e=>{Jt(e,w)},t[16]=w,t[17]=T);let E=k(T),O=Wt,A=r(`assistants.contact.card.session.aria`,{title:u}),j;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(J,{name:`chat-thread`,weight:`medium`,className:`size-4 shrink-0`}),t[18]=j):j=t[18];let M;t[19]===r?M=t[20]:(M=r(`assistants.contact.card.session.label`),t[19]=r,t[20]=M);let N;t[21]===M?N=t[22]:(N=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-[0.8em] leading-4 text-muted-foreground`,children:[j,(0,$.jsx)(`span`,{className:`truncate`,children:M})]}),t[21]=M,t[22]=N);let F=f?(0,$.jsxs)(`span`,{"data-assistant-session-status":``,className:P(`ml-auto inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-[0.75em] leading-4`,sn(d)),children:[(0,$.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-current`,"aria-hidden":!0}),r(f)]}):null,te;t[23]!==N||t[24]!==F?(te=(0,$.jsxs)(`div`,{className:Gt,children:[N,F]}),t[23]=N,t[24]=F,t[25]=te):te=t[25];let I;t[26]===u?I=t[27]:(I=(0,$.jsx)(`h3`,{className:Kt,title:u,children:u}),t[26]=u,t[27]=I);let L=P(`flex min-w-0 items-center gap-1.5 text-foreground`,v&&`max-w-[45%] shrink-0`),ne;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(J,{name:`folder`,weight:`medium`,className:`size-3.5 shrink-0 text-muted-foreground`}),t[28]=ne):ne=t[28];let R;t[29]===_?R=t[30]:(R=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:_}),t[29]=_,t[30]=R);let z;t[31]!==h||t[32]!==L||t[33]!==R?(z=(0,$.jsxs)(`p`,{className:L,title:h,children:[ne,R]}),t[31]=h,t[32]=L,t[33]=R,t[34]=z):z=t[34];let B;t[35]===v?B=t[36]:(B=v?(0,$.jsxs)(`p`,{"data-contact-session-branch":``,className:`flex min-w-0 items-center gap-1 text-muted-foreground`,title:v,children:[(0,$.jsx)(J,{name:`git-branch`,weight:`medium`,className:`size-3 shrink-0`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:v})]}):null,t[35]=v,t[36]=B);let V;t[37]!==z||t[38]!==B?(V=(0,$.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:[z,B]}),t[37]=z,t[38]=B,t[39]=V):V=t[39];let H=x?(0,$.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,$.jsx)(J,{name:`code`,weight:`medium`,className:`size-3.5 shrink-0`}),x.additions===void 0?null:(0,$.jsxs)(`span`,{className:`text-[var(--status-success)]`,children:[`+`,x.additions]}),x.deletions===void 0?null:(0,$.jsxs)(`span`,{className:`text-[var(--status-error)]`,children:[`−`,x.deletions]}),x.files===void 0?null:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:x.files===1?r(`assistants.contact.card.session.changes.filesSingle`,{count:x.files}):r(`assistants.contact.card.session.changes.filesPlural`,{count:x.files})})]}):null,re;t[40]===b?re=t[41]:(re=b?(0,$.jsx)(Bt,{value:b}):null,t[40]=b,t[41]=re);let U;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(J,{name:`arrow-right-s`,weight:`medium`,className:`ml-auto size-4 shrink-0 text-muted-foreground`}),t[42]=U):U=t[42];let W;t[43]===re?W=t[44]:(W=(0,$.jsxs)(`div`,{"data-contact-session-bottom":``,className:`mt-auto flex h-4 min-w-0 flex-none items-center gap-2`,children:[re,U]}),t[43]=re,t[44]=W);let ie;t[45]!==V||t[46]!==H||t[47]!==W?(ie=(0,$.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:[V,H,W]}),t[45]=V,t[46]=H,t[47]=W,t[48]=ie):ie=t[48];let ae;return t[49]!==E||t[50]!==w||t[51]!==A||t[52]!==te||t[53]!==I||t[54]!==ie||t[55]!==O?(ae=(0,$.jsxs)(`article`,{className:O,role:`button`,tabIndex:0,"aria-label":A,"data-assistant-contact-card":`session`,onClick:w,onKeyDown:E,children:[te,I,ie]}),t[49]=E,t[50]=w,t[51]=A,t[52]=te,t[53]=I,t[54]=ie,t[55]=O,t[56]=ae):ae=t[56],ae},un=3e5,dn=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate();function fn(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||!dn(n,e)||e.getTime()-n.getTime()>un)&&t.set(r.messageID,r.createdAt),n=e)}return t}function pn(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`${dn(o,n)?t:(o.getFullYear()===n.getFullYear()?i:a).format(o)} ${r.format(o)}`}}var mn=2,hn=1500,gn=e=>({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}),_n=e=>e.scrollHeight-e.scrollTop-e.clientHeight,vn=e=>_n(e)<=mn,yn=(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},bn=e=>e.altKey||e.ctrlKey||e.metaKey?!1:e.key===`ArrowDown`||e.key===`PageDown`||e.key===`End`,xn=({active:e,assistantID:t,contentRevision:n,onLoadEarlier:r})=>{let i=Q.useRef(null),[a,o]=Q.useState(null),[s,c]=Q.useState(null),l=Q.useRef(!0),u=Q.useRef(null),d=Q.useRef(null),f=Q.useRef(null),p=Q.useRef(0),m=Q.useRef(null),h=Q.useRef(null),g=Q.useRef(e);g.current=e;let _=he(),v=Q.useRef(!1),y=Q.useRef(null),b=Q.useRef(null),x=k(()=>{y.current?.stop(),y.current=null,b.current=null}),S=Q.useMemo(()=>e=>{i.current=e,o(t=>t===e?t:e)},[]),C=Q.useMemo(()=>e=>{c(t=>t===e?t:e)},[]),w=k(()=>{let e=i.current;if(!e||!g.current||l.current)return;let t=e.getBoundingClientRect().top,n=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.getBoundingClientRect().bottom>t);u.current=n?{id:n.dataset.messageId,offset:n.getBoundingClientRect().top-t,scrollTop:e.scrollTop}:null}),T=k(()=>{let e=i.current,t=u.current;if(!e||!g.current||l.current)return;if(!t){w();return}let n=e.scrollTop-t.scrollTop;if(Math.abs(n)>.5&&m.current){p.current=e.scrollTop,w();return}let r=Array.from(e.querySelectorAll(`[data-message-id]`)).find(e=>e.dataset.messageId===t.id);if(!r){w();return}let a=r.getBoundingClientRect().top-e.getBoundingClientRect().top-(t.offset-n);Math.abs(a)>.5&&(e.scrollTop+=a),p.current=e.scrollTop,u.current={id:t.id,offset:r.getBoundingClientRect().top-e.getBoundingClientRect().top,scrollTop:e.scrollTop}}),E=k(()=>{x(),l.current=!1,p.current=i.current?.scrollTop??0,w()}),D=Q.useRef(null),j=k(e=>{let t=i.current;!g.current||!t||(D.current=e??null,l.current=!0,u.current=null,h.current=null,p.current=t.scrollTop)}),M=k(()=>{if(!g.current||!l.current)return!1;let e=i.current;if(!e)return!1;let t=gn(e),n=Math.min(p.current,Math.max(0,t.scrollHeight-t.clientHeight));if(t.scrollTop<n-.5)return x(),l.current=!1,p.current=t.scrollTop,w(),!1;let r=!v.current;if(r&&e.querySelector(`[data-message-id]`)&&(v.current=!0),vn(t))return x(),p.current=t.scrollTop,!1;let a=Math.max(0,t.scrollHeight-t.clientHeight);if(!r&&!_){if(b.current===a)return!1;x(),b.current=a;let t=D.current;return D.current=null,y.current=q(e.scrollTop,a,{duration:t?.duration??.22,ease:t?[...t.ease]:`easeOut`,onUpdate:t=>{if(!g.current||!l.current||i.current!==e)return;let n=Math.max(0,e.scrollHeight-e.clientHeight);if(e.scrollTop<Math.min(p.current,n)-.5){l.current=!1,x(),p.current=e.scrollTop,w();return}e.scrollTop=Math.min(Math.max(e.scrollTop,t),n),p.current=e.scrollTop},onComplete:()=>{y.current=null,b.current=null}}),!0}return x(),e.scrollTop=a,p.current=e.scrollTop,!0}),N=k(e=>{h.current={direction:e,expiresAt:performance.now()+hn}}),ee=k(()=>{let e=h.current;return e?performance.now()>e.expiresAt?(h.current=null,null):e.direction:null}),P=k(()=>{x(),l.current=!1,w()}),F=k(()=>{if(!g.current)return;let e=i.current;if(!e)return;let t=gn(e),n=t.scrollTop>p.current,a=Math.min(p.current,Math.max(0,t.scrollHeight-t.clientHeight));if(p.current=t.scrollTop,l.current){t.scrollTop<a-.5&&P();return}let o=ee();T(),t.scrollTop<=80&&o===`up`&&r?.(),n&&vn(t)&&(o===`down`||o===`scrollbar`)&&(l.current=!0)}),te=k(e=>{let t=i.current;if(!(!t||e.deltaY===0)){if(e.deltaY<0){if(X(t,e.target))return;N(`up`),P(),t.scrollTop<=80&&r?.();return}yn(t,e.target)||N(`down`)}}),I=k(e=>{h.current=null;let t=e.touches.item(0);m.current=t?{x:t.clientX,y:t.clientY,deltaX:0,deltaY:0}:null}),L=k(e=>{let t=i.current,n=e.touches.item(0);if(!t||!n){m.current=null;return}let a=m.current;if(!a)return;let o=n.clientY-a.y,s=o*a.deltaY<0,c=(s?0:a.deltaX)+n.clientX-a.x,l=(s?0:a.deltaY)+o;if(m.current={x:n.clientX,y:n.clientY,deltaX:c,deltaY:l},!(Math.abs(c)>=Math.abs(l))){if(l>0&&X(t,e.target)||l<0&&yn(t,e.target)){m.current.deltaX=0,m.current.deltaY=0;return}N(l>0?`up`:`down`),l>2&&(P(),t.scrollTop<=80&&r?.())}}),ne=k(()=>{m.current=null}),R=k(e=>{if(Se(e)){N(`up`),P(),(i.current?.scrollTop??1/0)<=80&&r?.();return}bn(e)&&N(`down`)}),z=k(e=>{let t=i.current;e.pointerType===`mouse`&&e.target===t&&N(`scrollbar`)});Q.useLayoutEffect(()=>{let n=e?t:null,r=i.current;(d.current!==n||f.current!==r)&&(x(),v.current=!1,d.current=n,f.current=r,l.current=!0,u.current=null,h.current=null,m.current=null,p.current=r?.scrollTop??0),e&&(M(),T())},[e,t,n,a,_]),Q.useLayoutEffect(()=>()=>{x()},[e,t,a,x]);let B=Q.useMemo(()=>()=>void 0,[]),V=e&&a?a:B,H=Q.useMemo(()=>({passive:!0}),[]);O(`scroll`,F,V,H),O(`wheel`,te,V,H),O(`touchstart`,I,V,H),O(`touchmove`,L,V,H),O(`touchend`,ne,V,H),O(`touchcancel`,ne,V,H),O(`keydown`,R,V),O(`pointerdown`,z,V,H);let re=k(()=>{M(),T()});return A(typeof ResizeObserver<`u`&&e?s:null,re),{scrollRef:S,contentRef:C,preparePrepend:E,followLatest:j}},Sn=.3,Cn=[.19919472913616398,.010644531250000006,.27920937042459737,.91025390625],wn=[.23,1,.32,1],Tn=me(...Cn),En=me(...wn),Dn=.15,On=.1,kn=.08,An=e=>({left:e.left,top:e.top,width:e.width,height:e.height}),jn=e=>Number.parseFloat(e)||0,Mn=(e,t,n)=>e+(t-e)*n,Nn=e=>[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius],Pn=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=t.left+jn(n.borderLeftWidth)+jn(n.paddingLeft),i=t.top+jn(n.borderTopWidth)+jn(n.paddingTop);return{left:r,top:i,width:t.right-jn(n.borderRightWidth)-jn(n.paddingRight)-r,height:t.bottom-jn(n.borderBottomWidth)-jn(n.paddingBottom)-i}},Fn=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`}),In=(e,t,n=!1)=>{if(!t.value.trim())return null;let r=window.getComputedStyle(e),i=Pn(t),a=t.parentElement?.querySelector(`[data-composer-highlight]`),o=Fn(window.getComputedStyle(t));return a&&(o.color=window.getComputedStyle(a).color),{compact:n,background:An(e.getBoundingClientRect()),backgroundColor:r.backgroundColor,radii:Nn(r),text:t.value,textBox:{...i,top:i.top-t.scrollTop},textStyle:o}},Ln=e=>{let t=document.createElement(`div`);return Object.assign(t.style,{position:`absolute`,pointerEvents:`none`,margin:`0px`,...e}),t},Rn=(e,t,n,r)=>(e.style.opacity=String(t),q(e,{opacity:[t,n]},{duration:r,ease:`linear`})),zn=(e,t,n=t,r)=>{let i=window.getComputedStyle(t),a=Nn(i),o=An(t.getBoundingClientRect()),s=Pn(t),c=e.compact?{...e.background,left:e.textBox.left-jn(i.paddingLeft),width:Math.min(e.background.width,Math.max(120,o.width+32))}:e.background,l={left:c.left,top:c.top+c.height-o.height},u={x:e.textBox.left-l.left-(s.left-o.left),y:e.textBox.top-l.top-(s.top-o.top)},d=Ln({position:`fixed`,left:`0px`,top:`0px`,overflow:`hidden`,zIndex:`60`,willChange:`transform, width, height`});d.setAttribute(`aria-hidden`,`true`),d.setAttribute(`data-assistant-contact-send-flight`,``),d.style.backgroundColor=e.backgroundColor;let f=Ln({...e.textStyle,left:`0px`,top:`0px`,width:`${e.textBox.width}px`});f.textContent=e.text;let p=Ln({...Fn(i),left:`0px`,top:`0px`,width:`${s.width}px`});p.textContent=t.textContent??``,d.append(f,p);let m=n=>{let r=Tn(n),i=En(n),m=An(t.getBoundingClientRect()),h=c,g=Mn(h.left,m.left,i),_=Mn(h.left+h.width,m.left+m.width,i),v=Mn(h.top+h.height,m.top+m.height,r),y=Mn(h.height,m.height,r),b=v-y;d.style.transform=`translate3d(${g}px, ${b}px, 0)`,d.style.width=`${_-g}px`,d.style.height=`${y}px`,d.style.borderRadius=a.map((t,n)=>`${Mn(jn(e.radii[n]),jn(t),r)}px`).join(` `);let x=m.left+(l.left-o.left)*(1-i),S=m.top+(l.top-o.top)*(1-r),C=`translate3d(${x+(s.left-o.left)+u.x*(1-r)-g}px, ${S+(s.top-o.top)+u.y*(1-r)-b}px, 0)`;f.style.transform=C,p.style.transform=C},h=!1,g=[],_=()=>{h||(h=!0,g.forEach(e=>e.stop()),d.remove(),n.style.visibility=``,r?.())};return n.style.visibility=`hidden`,m(0),document.body.appendChild(d),g.push(q(d,{backgroundColor:[e.backgroundColor,i.backgroundColor]},{duration:Dn,ease:`linear`}),Rn(f,1,0,On),Rn(p,0,1,kn),q(0,1,{duration:Sn,ease:`linear`,onUpdate:m,onComplete:_})),_},Bn=64,Vn=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)},Hn=e=>Array.from(e?.files||[]),Un=async(e,t=m)=>{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}},Wn=(e,t)=>{let n=[...e,...t];for(let e of n.slice(Bn))e.url.startsWith(`blob:`)&&URL.revokeObjectURL(e.url);return n.slice(0,Bn)},Gn=Le(()=>T(()=>import(`./ToolOutputDialog-BQgmj6rE.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,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]))),Kn=e=>e.trim().startsWith(`yuri.settle.`)||e.trim().startsWith(`oc.settle.`),qn=e=>e.status===`error`||e.status===`failed`&&e.messageID.endsWith(`:preview:failed`),Jn=e=>e.role===`assistant`&&e.status!==`error`&&e.parts.some(e=>e.type===`text`)?`${e.turnID}:assistant:${e.bubbleIndex}`:e.messageID,Yn=({assistant:e,warning:t,active:n,overlayHeader:r=!1})=>{let{t:i,locale:a}=ee(),o=ze(),s=p(e=>e.isMobile),c=V(),l=ie(),u=B(e.id,n),d=p(e=>e.isSettingsDialogOpen),f=n&&!d&&!u.hasMessageGap?ae(e,u.data):null,h=te(e.name).displayName||e.name,g=(e,t)=>{let n=e?l.data?.assistants.find(t=>t.id===e):void 0;return n?te(n.name).displayName||n.name:t||i(`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,o]);let w=Q.useRef(new Set),[T,E]=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,T]),Q.useEffect(()=>()=>{for(let e of w.current)URL.revokeObjectURL(e)},[]);let[D,O]=Q.useState([]),[A,j]=Q.useState(null),[M,N]=Q.useState({open:!1,title:``,content:``}),L=p(e=>e.setImagePreviewOpen),ne=k(e=>{(e.image||e.mermaid||e.video)&&(N(e),L(!0))}),re=k(e=>{N(t=>({...t,open:e})),L(e)});Q.useEffect(()=>()=>{L(!1)},[L]),Q.useEffect(()=>{S.current.clear(),x.current.clear(),E([]),O([]),j(null)},[o]);let W=Q.useMemo(()=>Mt(),[]),oe=Q.useRef(new Set),se=Q.useRef(new Map),G=It(e=>e.setWorking),K=u.data?.messages??mt,ce=Q.useMemo(()=>K.some(e=>e.parts.some(e=>e.type===`card`&&e.cardType===`schedule`&&$t(e))),[K]),ue=R(e.id,n&&ce),de=Q.useMemo(()=>{let e=new Map;for(let t of ue.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},[ue.data]),fe=_t(T,e.id),pe=vt(D,e.id),me=xt(K,fe,e.id,pe).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`&&Kn(e.text)))}),q=me.length-1;for(;q>=0&&qn(me[q]);)--q;let Y=me.filter((e,t)=>!qn(e)||t>q),ge=fn(Y),_e=he(),ve=`${o}:${e.id}`,ye=Q.useRef(null),be=ye.current,xe=be?.lastID?Y.findIndex(e=>Jn(e)===be.lastID):-1,Se=n&&!_e&&be?.scope===ve&&be.ready&&(be.lastID===null||xe>=0);Q.useLayoutEffect(()=>{let e=Y.at(-1);ye.current={scope:ve,ready:n&&u.isSuccess,lastID:e?Jn(e):null}});let Ce=new Date().toDateString(),we=i(`common.date.today`),Te=Q.useMemo(()=>pn(a,we,new Date(Ce)),[a,we,Ce]),X=Pt(fe),Ee=Ft(pe),De=!!(e.working||e.activeContactTurn),Oe=l.data?.revision??null,ke=pe.reduce((e,t)=>e+t.bubbles.reduce((e,t)=>e+t.text.length,0),0),Ae=new Map(pe.map(e=>[e.turnID,e])),je=Q.useRef(!1),Me=k(async(e=!1)=>{if(!(!n||je.current||u.isFetchingPreviousPage||u.isFillingMessageGap)&&!(e&&u.previousPageError)&&!(!u.hasPreviousPage&&!u.hasMessageGap)){je.current=!0,Fe();try{u.hasMessageGap?await u.retryMessageGap():await u.fetchPreviousPage()}catch{}finally{je.current=!1}}}),{scrollRef:Ne,contentRef:Pe,preparePrepend:Fe,followLatest:Ie}=xn({active:n,assistantID:e.id,contentRevision:`${Y[0]?.messageID}:${Y.length}:${ke}:${u.isFetchingPreviousPage}:${u.hasPreviousPage}:${u.isFillingMessageGap}`,onLoadEarlier:()=>{Me(!0)}}),Le=Q.useRef(null),Be=Q.useRef(null),Ve=Q.useRef(null),He=Q.useRef(null),Ue=Q.useRef(null),[Ke,qe]=Q.useState(null),Z=()=>{let e=Be.current?.querySelector(`[data-assistant-contact-composer-surface]`),t=e?.querySelector(`textarea`);return e&&t?In(e,t,!s):null};Q.useLayoutEffect(()=>{let e=Ve.current;if(!e)return;Ve.current=null;let t=Array.from(Le.current?.querySelectorAll(`[data-message-id]`)??[]).find(t=>t.dataset.messageId===e.messageID)?.querySelector(`[data-assistant-contact-text]`),n=()=>qe(t=>t?.messageID===e.messageID?null:t);if(!t){n();return}Ue.current?.(),Ue.current=zn(e.source,t,t,n)}),Q.useEffect(()=>()=>{Ve.current=null,Ue.current?.(),Ue.current=null},[n,e.id,o]),Q.useEffect(()=>{j(null),x.current.clear(),S.current.clear(),oe.current.clear(),se.current=new Map,E(t=>_t(t,e.id)),O(t=>vt(t,e.id)),N({open:!1,title:``,content:``}),L(!1)},[e.id,L]),Q.useEffect(()=>{for(let e of K){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)}}E(e=>St(e,K))},[K]),Q.useEffect(()=>{let t=new Set(fe.filter(e=>e.status===`sending`).map(e=>e.messageID));O(n=>Et(n,{assistantID:e.id,activeContactTurn:e.activeContactTurn?{turnID:e.activeContactTurn.turnID,admittedAt:e.activeContactTurn.admittedAt}:null,serverWorking:De,snapshotRevision:Oe,admissionRevisionByTurnID:se.current,pendingSendTurnIDs:t,messages:K,settledTurnIDs:oe.current}))},[e.activeContactTurn,e.id,K,fe,De,Oe]),Q.useEffect(()=>{G(e.id,X||Ee||De)},[e.id,Ee,X,De,G]),Q.useEffect(()=>{let t=e.id;return()=>{G(t,!1)}},[e.id,G]);let Ye=k(t=>{if(!(!(`assistantID`in t)||t.assistantID!==e.id)){if(t.type===`contact-turn-start`){oe.current.delete(t.turnID),O(e=>wt(e,t.assistantID,t.turnID,t.occurredAt));return}if(t.type===`contact-bubble-delta`){if(oe.current.has(t.turnID))return;O(e=>Dt(e,t));return}t.type===`contact-turn-end`&&(oe.current.add(t.turnID),O(e=>kt(Ot(e,t,{requireExisting:!0}),K)))}});Q.useEffect(()=>{if(n)return le(Ye)},[n,e.id]);let Xe=k(async e=>{if(X)return;let t=C.current,n=await Un(e);if(t.signal.aborted){n.attachments.forEach(e=>URL.revokeObjectURL(e.url));return}n.skippedTooLarge>0&&j(i(`assistants.contact.attachment.tooLarge`)),n.attachments.length!==0&&b(e=>Wn(e,n.attachments))}),Ze=k(e=>{let t=Vn(e.clipboardData);t.length!==0&&(e.preventDefault(),Xe(t))}),Qe=k(e=>{Array.from(e.dataTransfer?.types??[]).includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}),$e=k(e=>{let t=Hn(e.dataTransfer);t.length!==0&&(e.preventDefault(),Xe(t))}),et=k(async(t,r)=>{let a=C.current,o=e.id,s=r?x.current.get(r):void 0;if(r&&(!s||s.assistantID!==o))return;let l=s?.text??t??_,u=s?.attachments??y,d=Nt({gate:W,sending:Pt(fe),text:l,attachments:u,assistantID:o,createMessageID:()=>r||`yuri_contact_${m()}`});if(!d.ok)return;G(o,!0),x.current.set(d.messageID,{assistantID:o,text:l,attachments:u});let f=u.length===0&&t===void 0&&!r&&n&&!_e?Z():null;Ve.current=f?{messageID:d.messageID,source:f}:null,qe(f?{scope:ve,messageID:d.messageID}:null),He.current=f?d.messageID:He.current,r||(Ie(f?{duration:Sn,ease:Cn}:void 0),v(e=>e===l?``:e),b(e=>e.filter(e=>!u.includes(e)))),E(e=>e.some(e=>e.messageID===d.messageID)?e.map(e=>e.messageID===d.messageID?{...d.turn,createdAt:e.createdAt}:e):[...e,d.turn]),j(null);let p=()=>{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 Ge(o,e.file,e.id,a.signal),a.signal.aborted)return;S.current.set(n,r)}t.push(r)}if(a.signal.aborted)return;let n=[...d.parts.filter(e=>e.type===`text`),...t];E(e=>e.map(e=>e.messageID===d.messageID?{...e,parts:n}:e));let r=await z(o,d.messageID,{parts:n});if(a.signal.aborted)return;p(),typeof r.revision==`number`&&se.current.set(d.messageID,r.revision),E(e=>Ct(e,d.messageID)),oe.current.has(d.messageID)||O(e=>wt(e,o,d.messageID)),c.data?.serverInstanceID&&I({serverInstanceID:c.data.serverInstanceID,assistantID:o,name:h,avatarSeed:e.avatarSeed??o}).catch(()=>void 0)}catch(e){if(a.signal.aborted)return;if(e instanceof H&&e.code===`admission_timeout`)try{let e=await U(o,d.messageID);if(a.signal.aborted)return;if(e){p(),typeof e.revision==`number`&&se.current.set(d.messageID,e.revision),E(e=>Ct(e,d.messageID)),oe.current.has(d.messageID)||O(e=>wt(e,o,d.messageID));return}}catch{}let t=jt(e,{noProvider:i(`assistants.contact.noProvider`),sendFailed:i(`assistants.contact.sendFailed`),timedOut:i(`assistants.contact.timedOut`)});E(e=>At(e,d.messageID,t))}finally{W.release()}}),tt=k(e=>{et(void 0,e)}),nt=u.isError&&Y.length===0,rt=u.isSuccess&&Y.length===0,it=new Map(fe.map(e=>[e.messageID,e]));return(0,$.jsxs)(`div`,{ref:Le,className:`flex min-h-0 flex-1 flex-col bg-background`,children:[(0,$.jsxs)(`div`,{ref:Ne,className:P(`min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-4 sm:px-8`,s&&`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,nt?(0,$.jsxs)(`div`,{ref:Pe,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)(zt,{name:e.id,avatarSeed:e.avatarSeed,size:44,label:h,working:n?De: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)(J,{name:`error-warning`,className:`size-3`})})]}),(0,$.jsx)(`p`,{className:`mt-4 typography-ui-label font-medium text-foreground`,children:h}),(0,$.jsx)(`p`,{className:`mt-1.5 typography-ui leading-6 text-muted-foreground`,children:i(`assistants.contact.loadFailed`)}),(0,$.jsx)(F,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>void u.refetch(),children:i(`chat.history.retry`)})]}):rt?(0,$.jsxs)(`div`,{ref:Pe,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)(zt,{name:e.id,avatarSeed:e.avatarSeed,size:48,label:h,className:`opacity-90`,working:n?De:void 0,showWorkingDot:!1,followPointer:!1}),(0,$.jsx)(`p`,{className:`mt-5 typography-ui-header font-medium tracking-[-0.01em] text-foreground`,children:i(`assistants.conversation.emptyTitle`,{name:h})}),(0,$.jsx)(`p`,{className:`mt-2 max-w-xs typography-ui leading-6 text-muted-foreground/80`,children:i(`assistants.contact.empty`)})]}):(0,$.jsxs)(`div`,{ref:Pe,className:`relative mx-auto flex w-full max-w-[42rem] flex-col pb-12`,"data-assistant-contact-content":``,children:[u.isPending?(0,$.jsx)(`p`,{role:`status`,className:`py-3 text-center typography-micro text-muted-foreground`,children:i(`common.loading`)}):null,u.hasPreviousPage||u.hasMessageGap?(0,$.jsxs)(`div`,{className:`mb-3 flex flex-col items-center gap-1`,"data-assistant-contact-pagination":``,"aria-busy":u.isFetchingPreviousPage||u.isFillingMessageGap,children:[u.previousPageError?(0,$.jsx)(`p`,{role:`alert`,className:`typography-micro text-[var(--status-error)]`,children:i(`chat.history.loadOlderFailed`)}):null,u.hasMessageGap?(0,$.jsx)(`p`,{role:`status`,className:`typography-micro text-muted-foreground`,children:i(`assistants.contact.history.gap`)}):null,(0,$.jsx)(F,{type:`button`,size:`sm`,variant:`ghost`,disabled:u.isFetchingPreviousPage||u.isFillingMessageGap,onClick:()=>void Me(),children:i(u.isFetchingPreviousPage||u.isFillingMessageGap?`chat.history.loadingMore`:u.previousPageError||u.hasMessageGap?`chat.history.retry`:`chat.history.loadOlder`)})]}):null,Y.map((t,r)=>{let a=`${ve}:${Jn(t)}`,c=r>0?Y[r-1]:null,u=ge.get(t.messageID),d=u!==void 0,p=d?(0,$.jsx)(`div`,{className:`flex w-full justify-center px-4 pt-7 pb-4 first:pt-1`,"data-assistant-contact-time":``,children:(0,$.jsx)(`time`,{dateTime:new Date(u).toISOString(),className:`text-[11px] font-normal leading-4 tabular-nums text-muted-foreground/70`,children:Te(u)})}):null,m=t.role===`user`,_=t.role===`peer`,v=t.role===`assistant`&&!d&&c?.role===`assistant`&&c.turnID===t.turnID,y=c?.turnID!==t.turnID,b=!m&&(_||!v),x=_?g(t.fromAssistantID,t.fromAssistantName):h,S=_&&t.fromAssistantID?l.data?.assistants.find(e=>e.id===t.fromAssistantID):e,C=it.get(t.messageID),w=Ae.get(t.turnID),T=t.status===`failed`&&t.messageID.endsWith(`:preview:failed`),E=(e,t)=>m?(0,$.jsx)(pt,{failedTurn:n?C:void 0,retryDisabled:X,onRetry:tt,children:e},t):e;return t.status===`error`||T?(0,$.jsxs)(Q.Fragment,{children:[p,(0,$.jsxs)(`div`,{"data-message-id":t.messageID,"data-assistant-contact-error":``,className:P(`relative px-1`,!d&&`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||w?.error||i(`assistants.contact.sendFailed`)}),f?.messageID===t.messageID?(0,$.jsx)(Je,{assistantID:e.id,position:f},`${o}:${e.id}:${f.generation}:${f.ordinal}`):null]})]},a):(0,$.jsxs)(Q.Fragment,{children:[p,(0,$.jsxs)(We.div,{"data-message-id":t.messageID,initial:Se&&r>xe&&t.messageID!==He.current?{opacity:0,y:4}:!1,animate:{opacity:1,y:0},transition:{duration:_e?0:.18,ease:`easeOut`},className:P(`flex w-full`,m?`justify-end`:`justify-start`,d?`mt-0`:y?`mt-6 first:mt-0`:v?`mt-1.5`:`mt-3`),"data-assistant-contact-role":t.role,"data-assistant-contact-turn-status":C?.status??t.status,"data-assistant-contact-run-start":t.role===`assistant`&&!v?``:void 0,children:[m?null:(0,$.jsx)(`div`,{className:`mr-2.5 flex w-9 shrink-0 justify-center pt-0.5`,children:b?(0,$.jsx)(zt,{name:S?.id||t.fromAssistantID||e.id,avatarSeed:S?.avatarSeed??(t.fromAssistantID?void 0:e.avatarSeed),size:32,label:x,working:n?!!(S?.working||S?.activeContactTurn):void 0,showWorkingDot:!1,followPointer:!1}):(0,$.jsx)(`span`,{className:`size-8`,"aria-hidden":!0})}),(0,$.jsxs)(`div`,{className:P(`relative flex min-w-0 flex-col gap-1.5`,m?`max-w-[min(82%,30rem)] items-end`:`max-w-[min(84%,34rem)] items-start`),children:[_?(0,$.jsx)(`span`,{className:`mb-0.5 px-1 typography-micro text-muted-foreground/75`,children:i(`assistants.contact.peer.from`,{name:x})}):null,t.parts.map((r,o)=>{if(r.type===`card`&&r.cardType===`session`)return(0,$.jsx)(ln,{card:r},`${a}:card:${o}`);if(r.type===`card`&&r.cardType===`assistant`)return(0,$.jsx)(Yt,{card:r,assistant:l.data?.assistants.find(e=>e.id===r.assistantID),active:n},`${a}:card:${o}`);if(r.type===`card`&&r.cardType===`schedule`)return(0,$.jsx)(rn,{card:r,task:de.get(r.projectID)?.get(r.taskID)},`${a}:card:${o}`);if(r.type===`file`)return E((0,$.jsx)(dt,{assistantID:e.id,part:r,onShowPopup:ne},`${a}:file:${o}`),`${a}:file:${o}`);if(r.type===`text`&&Kn(r.text))return null;if(r.type===`text`&&(r.text.trim()||t.status===`streaming`)){let e=!m,n=e&&/^!\[(?:\\.|[^\]\\\n])*\]\(\s*(?:<[^>\n]+>|[^\s()]+)(?:\s+"[^"\n]*")?\s*\)$/.test(r.text.trim());return E((0,$.jsx)(`div`,{"aria-label":_?i(`assistants.contact.peer.aria`,{name:x}):void 0,"data-assistant-contact-text":``,"data-assistant-contact-media":n||void 0,className:P(`min-w-0 max-w-full [overflow-wrap:anywhere] rounded-[1.35rem] typography-markdown leading-6`,s&&!n&&`touch-manipulation [-webkit-user-select:all] [user-select:all]`,n?`p-0`:`px-4 py-2.5`,e?null:`whitespace-pre-wrap`,n?`text-foreground`:m?`rounded-[1.15rem] rounded-br-lg bg-[var(--primary-base)]/90 text-[var(--primary-foreground)]`:_?`rounded-[1.25rem] border border-dashed border-border/50 bg-[var(--surface-muted)]/70 text-foreground`:`bg-[var(--surface-muted)] text-foreground`),children:e?(0,$.jsx)(Re,{content:r.text,messageId:a,isAnimated:!1,isStreaming:t.status===`streaming`,variant:`assistant`,enableFileReferences:!1,onShowPopup:ne,className:`w-full min-w-0 [overflow-wrap:anywhere]`}):r.text},`${a}:text:${o}`),`${a}:text:${o}`)}return null}),C?.status===`sending`?(0,$.jsx)(`p`,{className:`absolute right-1 top-full mt-1 typography-micro text-muted-foreground/75`,children:i(`assistants.contact.sending`)}):null,f?.messageID===t.messageID?(0,$.jsx)(Je,{assistantID:e.id,position:f},`${o}:${e.id}:${f.generation}:${f.ordinal}`):null]})]})]},a)}),(0,$.jsx)(`div`,{className:`pointer-events-none absolute bottom-1 left-[2.875rem] flex h-10 items-center`,"data-assistant-contact-status-slot":``,children:!X&&Ke?.scope!==ve&&(Ee||De)?(0,$.jsxs)(We.div,{role:`status`,"aria-label":i(`assistants.contact.processing`),initial:!_e&&{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:_e?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:`absolute -left-[2.875rem] top-0.5 flex w-9 justify-center`,"data-assistant-contact-processing-avatar":``,children:(0,$.jsx)(zt,{name:e.id,avatarSeed:e.avatarSeed,size:32,label:h,working:n?De: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:Be,className:`relative z-10 shrink-0 bg-background 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:P(`relative w-full pt-1.5 pb-4`,s&&`bottom-safe-area yuri-mobile-composer`),onSubmit:e=>{e.preventDefault(),et()},onDragOver:Qe,onDrop:$e,children:(0,$.jsx)(`div`,{className:`chat-input-column relative overflow-visible`,children:(0,$.jsx)(at,{active:n,layout:`inline`,value:_,attachments:y,pending:X,isMobile:s,placeholder:i(`assistants.contact.placeholder`,{name:h}),sendLabel:i(`assistants.contact.send`),addFilesLabel:i(`assistants.contact.addFiles`),removeAttachmentLabel:i(`assistants.contact.removeAttachment`),fileAccept:`*/*`,onChange:e=>v(e),onVoiceSend:e=>{et(e)},onSubmit:()=>{et()},onAddFiles:e=>{Xe(e)},onRemoveAttachment:t=>{X||(S.current.delete(`${e.id}:${t}`),b(e=>e.filter(e=>e.id!==t)))},onPaste:Ze,onDragOver:Qe,onDrop:$e,className:P(`relative z-10`,s&&`yuri-mobile-composer-surface`),style:{borderRadius:`1.5rem`},"data-assistant-contact-composer-surface":``,textareaProps:{"aria-label":i(`assistants.contact.placeholder`,{name:h})}},`${o}:${e.id}`)})})]}),M.open?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Gn,{popup:M,onOpenChange:re,isMobile:s})}):null]})},Xn=e=>{for(let t=e.messages.length-1;t>=0;t--){let n=e.messages[t];if(n.parts.some(ne)&&Number.isFinite(new Date(n.createdAt).getTime()))return{timestamp:n.createdAt,empty:!1}}return{timestamp:void 0,empty:e.generation>=0&&e.olderComplete&&!e.hasMessageGap}},Zn=(e,t)=>{let n=(0,Z.c)(5),r;n[0]!==e||n[1]!==t?(r=re(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2];let i;return n[3]===r?i=n[4]:(i={...r,enabled:!1,select:Xn},n[3]=r,n[4]=i),w(i)},Qn=Q.memo(e=>{let t=(0,Z.c)(17),{assistantID:n,serverWorking:r,lastContactAt:i}=e,{t:a,locale:o}=ee(),s=Rt(n,r),c=Zn(n,ze()),l;t[0]!==c||t[1]!==i?(l=i!==void 0&&Number.isFinite(new Date(i).getTime())?i:c.data?.timestamp,t[0]=c,t[1]=i,t[2]=l):l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=new Date().toDateString(),t[3]=d):d=t[3];let f=d,p;t[4]===a?p=t[5]:(p=a(`common.date.today`),t[4]=a,t[5]=p);let m=p,h;bb0:{if(u===void 0){h=null;break bb0}let e;t[6]!==o||t[7]!==u||t[8]!==m?(e=pn(o,m,new Date(f))(u),t[6]=o,t[7]=u,t[8]=m,t[9]=e):e=t[9],h=e}let g=h,_;t[10]!==c||t[11]!==g||t[12]!==a||t[13]!==s?(_=s?a(`assistants.conversation.typing`):g?a(`assistants.conversation.lastContact`,{time:g}):c.data?.empty?a(`assistants.conversation.neverContacted`):c.isError?a(`assistants.contact.loadFailed`):a(`common.loading`),t[10]=c,t[11]=g,t[12]=a,t[13]=s,t[14]=_):_=t[14];let v=_,y;return t[15]===v?y=t[16]:(y=(0,$.jsx)(`span`,{className:`mt-1 block truncate typography-micro font-normal leading-4 text-muted-foreground/70`,"aria-live":`polite`,title:v,children:v}),t[15]=v,t[16]=y),y});export{Rt as a,zt as i,Yn as n,Vt as r,Qn as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkstreamRendererImpl-BFjWHQDE.js","assets/rolldown-runtime-hePW80VL.js","assets/vendor-base-ui-CzHs0bHY.js","assets/useUIStore-CoWJ3ROq.js","assets/runtime-switch-DEZ1K7qW.js","assets/runtime-auth-DBn9yahL.js","assets/vendor-zustand-vDaAPGfl.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/vendor-react-DlzBev0S.js","assets/fileQueries-C2Rs6TPz.js","assets/vendor-tanstack-react-query-B-Wpqq5J.js","assets/vendor-tanstack-query-core-Y_YoRHtC.js","assets/queryRuntime-2dx7jbt9.js","assets/runtime-fetch-D0YWp3FJ.js","assets/vendor-markstream-react-DfLaSG3W.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/vendor-markstream-core-Cm34iPLL.js","assets/vendor-floating-ui-dom-BHhLtF5l.js","assets/vendor-floating-ui-core-Co1I1lFV.js","assets/vendor-reactuses-core-DWo5Wn6R.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/button-Cjciq1yh.js","assets/desktop-JwYqThiw.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/store-CKIMMlXR.js","assets/tour-Db44qwfs.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/useMobileNavigationStore-B2yMgBp_.js","assets/gitApiHttp-Ddik7PM_.js","assets/vendor-opencode-client-cQ47ywrT.js","assets/vendor-effect-X1Hqc7ba.js","assets/persistence-D-rnhgr4.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/runtime-file-resource-BP4P52ry.js","assets/runtime-file-store-BVRgEtI-.js","assets/path-utils-jGozTg9d.js","assets/platform-DFJEtBlo.js","assets/vendor-sonner-BEHGipm5.js","assets/useAssistantUIStore-BI_dAUjx.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/useThemeSystem-CNzUUkFn.js","assets/tooltip-BuZ86ipm.js","assets/url-MRa-FtQa.js","assets/useEffectiveDirectory-DvI6toj8.js","assets/image-loading-DKQOYtti.js","assets/image-loading-D9Z_BASK.css","assets/LoadingImage-Ch5MyA20.js","assets/ImageLoadingPlaceholder-KksxJaKp.js","assets/markdownHeightCache-C7UOJdkN.js","assets/dualLimitLru-D8Sphgua.js","assets/MarkdownRendererImpl-DhJ9_BLd.js","assets/vendor-katex-DNVSTX6g.js","assets/themes-BgDJcxRc.js","assets/FadeInOnReveal-CuOJu25b.js","assets/markdownTheme-CHNl6tUv.js","assets/vendor-pierre-diffs-BFiZ3IhI.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/markdown-worker-oBGEB9Eg.js","assets/vendor-morphdom-BbKiNDAu.js","assets/vendor-dompurify-CeJNOzik.js","assets/vendor-pele-C1WTNWUm.js","assets/vendor-marked-WVekxjAN.js","assets/vendor-remend-C3cXc-tf.js","assets/fileReferenceActions-CvDFcgBH.js","assets/toolHelpers-iEHVHQ9p.js","assets/fileReferenceParser-1HHDBUum.js","assets/MarkstreamRendererImpl-EpBnVy9J.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{a as t}from"./vendor-zustand-vDaAPGfl.js";import{ot as n,st as r}from"./vendor-base-ui-CzHs0bHY.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as o}from"./button-Cjciq1yh.js";import{t as s}from"./useEffectiveDirectory-DvI6toj8.js";import{i as c,n as l,t as u}from"./markdownHeightCache-C7UOJdkN.js";var d=i(),f=e(r(),1),p=`yuri:chunk-import-reload`,m=250,h=3e4,g=[/Importing a module script failed/i,/Failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/Loading chunk \S+ failed/i,/ChunkLoadError/i];function _(e){if(e instanceof Error)return`${e.name}\n${e.message}\n${e.stack??``}`;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function v(e){let t=_(e);return g.some(e=>e.test(t))}function y(e){return`0.2.31-beta.2:${_(e).slice(0,500)}`}function b(e){if(typeof window>`u`)return;let t=Date.now(),n=y(e),r=null;try{let e=window.sessionStorage.getItem(p);if(e)try{r=JSON.parse(e)}catch{r=null}}catch{return}let i=typeof r?.timestamp==`number`?r.timestamp:0;if(!(r?.signature===n&&t-i<h)){try{window.sessionStorage.setItem(p,JSON.stringify({signature:n,timestamp:t}))}catch{return}console.error(`[refresh-debug] chunk-import-reload`,{error:_(e).slice(0,1e3)}),window.setTimeout(()=>{window.location.reload()},0)}}async function x(e,t={}){let n=t.retries??1,r;for(let t=0;t<=n;t+=1)try{return await e()}catch(e){if(r=e,!v(e)||t>=n)break;await new Promise(e=>setTimeout(e,m*(t+1)))}throw v(r)&&b(r),r}var S=e=>(0,f.lazy)(()=>x(e)),C=(e,t)=>!!t?.toLowerCase().startsWith(`video/`)||/^data:video\//i.test(e)||/\.(?:mp4|m4v|webm|mov|ogv|ogg)(?:[?#]|$)/i.test(e),w=(e,t)=>{try{let n=t??(typeof localStorage>`u`?null:localStorage);return!n||n.getItem(e)!==`0`}catch{return!0}},T=(e,t)=>{try{typeof localStorage<`u`&&localStorage.setItem(e,t?`1`:`0`)}catch{}},E=`yuri:markstream-react`,D=e=>w(E,e),O=t(e=>({markstreamReactEnabled:D(),setMarkstreamReactEnabled:t=>{T(E,t),e({markstreamReactEnabled:t})}})),k=null,A=()=>(k??=a(()=>import(`./MarkstreamRendererImpl-BFjWHQDE.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,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,79])).catch(e=>{throw k=null,e}),k),j=()=>{A().catch(()=>void 0)},M=null,N=()=>(M??=a(()=>import(`./MarkdownRendererImpl-DhJ9_BLd.js`).then(e=>e.n),__vite__mapDeps([55,1,4,5,24,25,2,3,6,7,8,9,10,11,12,13,14,40,56,20,21,22,23,26,16,27,28,29,30,31,32,33,34,35,36,37,38,39,41,42,43,44,54,45,57,47,48,49,50,58,53,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78])).catch(e=>{throw M=null,e}),M),P=()=>{N().catch(()=>void 0),D()&&j()},F=class extends f.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){console.warn(`[markstream-react] falling back to the current Markdown renderer`,e)}render(){return this.state.hasError?this.props.fallback:this.props.children}},I=f.createContext(!0),L=()=>f.useContext(I),R=n(),z=S(()=>N().then(e=>({default:e.MarkdownRenderer}))),B=S(()=>A().then(e=>({default:e.MarkstreamRenderer}))),V=S(()=>N().then(e=>({default:e.SimpleMarkdownRenderer}))),H=e=>e===`tool`?`markdown-content markdown-tool`:e===`reasoning`?`markdown-content markdown-reasoning`:`markdown-content leading-relaxed`,U=e=>{let t=(0,d.c)(15),n=O(K),r=typeof e.content==`string`?e.content:``,i=typeof e.variant==`string`?e.variant:`assistant`,a;t[0]!==r||t[1]!==n||t[2]!==e.reserveMeasuredHeight||t[3]!==i?(a=e.reserveMeasuredHeight?l(u(r,n?`markstream:${i}`:i)):void 0,t[0]=r,t[1]=n,t[2]=e.reserveMeasuredHeight,t[3]=i,t[4]=a):a=t[4];let s=a,f;t[5]!==e.className||t[6]!==e.variant?(f=o(`relative break-words w-full min-w-0`,H(e.variant),typeof e.className==`string`?e.className:void 0),t[5]=e.className,t[6]=e.variant,t[7]=f):f=t[7];let p;t[8]!==r||t[9]!==e.animated||t[10]!==s?(p=(0,R.jsx)(c,{animated:e.animated,content:r,reservedHeight:s}),t[8]=r,t[9]=e.animated,t[10]=s,t[11]=p):p=t[11];let m;return t[12]!==f||t[13]!==p?(m=(0,R.jsx)(`div`,{className:f,"aria-busy":`true`,"data-markdown-hydration":`deferred`,"data-markdown-ready":`false`,children:p}),t[12]=f,t[13]=p,t[14]=m):m=t[14],m},W=e=>{let t=(0,d.c)(13),n=L(),r=O(q);if(!n&&e.isStreaming!==!0){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1,reserveMeasuredHeight:!0}),t[0]=e,t[1]=n),n}let i;t[2]===e?i=t[3]:(i=(0,R.jsx)(f.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(z,{...e})}),t[2]=e,t[3]=i);let a=i,o;t[4]!==a||t[5]!==r||t[6]!==e?(o=r?(0,R.jsx)(F,{fallback:a,children:(0,R.jsx)(f.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(B,{...e})})}):a,t[4]=a,t[5]=r,t[6]=e,t[7]=o):o=t[7];let c=o,l;t[8]===e?l=t[9]:(l=t=>{if(!e.onShowPopup||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let n=t.target instanceof Element?t.target.closest(`a[href]`):null,r=n?.getAttribute(`href`);if(!r||!C(r))return;t.preventDefault(),t.stopPropagation();let i=n?.textContent?.trim()||r.split(/[/?#]/).filter(Boolean).pop()||r;e.onShowPopup({open:!0,title:i,content:``,video:{url:r,filename:i,directory:s()??``}})},t[8]=e,t[9]=l);let u;return t[10]!==c||t[11]!==l?(u=(0,R.jsx)(`div`,{className:`contents`,onClickCapture:l,children:c}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u},G=e=>{let t=(0,d.c)(4);if(!L()){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1}),t[0]=e,t[1]=n),n}let n;return t[2]===e?n=t[3]:(n=(0,R.jsx)(f.Suspense,{fallback:(0,R.jsx)(U,{...e}),children:(0,R.jsx)(V,{...e})}),t[2]=e,t[3]=n),n};function K(e){return e.markstreamReactEnabled}function q(e){return e.markstreamReactEnabled}export{C as a,P as i,G as n,S as o,I as r,W as t};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-capacitor-push-notifications-D5cqJIPw.js","assets/rolldown-runtime-hePW80VL.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/assistant-attachment-cache-oatc8F4t.js","assets/runtime-auth-DBn9yahL.js","assets/runtime-switch-DEZ1K7qW.js","assets/runtime-fetch-D0YWp3FJ.js","assets/runtime-file-resource-BP4P52ry.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/queryRuntime-2dx7jbt9.js","assets/vendor-tanstack-query-core-Y_YoRHtC.js","assets/fileQueries-C2Rs6TPz.js","assets/vendor-base-ui-CzHs0bHY.js","assets/vendor-react-DlzBev0S.js","assets/vendor-tanstack-react-query-B-Wpqq5J.js","assets/runtime-file-store-BVRgEtI-.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/path-utils-jGozTg9d.js","assets/useAssistantUIStore-BI_dAUjx.js","assets/vendor-zustand-vDaAPGfl.js","assets/useUIStore-CoWJ3ROq.js","assets/brand-storage-bootstrap-D4BW3w-M.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{E as n,b as r,w as i}from"./runtime-auth-DBn9yahL.js";import{c as a,i as o,l as s,n as c,r as l,t as u}from"./runtime-switch-DEZ1K7qW.js";import{n as d}from"./runtime-fetch-D0YWp3FJ.js";import{ot as f,st as p}from"./vendor-base-ui-CzHs0bHY.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{r as m}from"./useUIStore-CoWJ3ROq.js";import{$ as h,bt as g,kt as _,tt as v,yt as y}from"./persistence-D-rnhgr4.js";import{n as b}from"./vendor-react-DlzBev0S.js";import{a as x}from"./runtime-file-resource-BP4P52ry.js";import{a as ee,n as S,o as C,t as te}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{n as w,r as ne,t as re}from"./platform-DFJEtBlo.js";import{i as T}from"./vendor-reactuses-core-DWo5Wn6R.js";import{f as ie}from"./button-Cjciq1yh.js";import{C as ae,M as oe,c as se,o as ce,p as le,s as E,t as ue}from"./MobileDetailNavigation-BZeOHfd5.js";import{Ta as D,s as de}from"./useMobileNavigationStore-B2yMgBp_.js";import{i as O,n as fe}from"./useAssistantUIStore-BI_dAUjx.js";import{i as pe,t as me}from"./AgentAvatar-DHFLlQ7M.js";import{n as he}from"./Icon-BQczEnxm.js";import{n as ge,t as _e}from"./dialog-rVkj8VgE.js";import{t as ve}from"./rasterizePng-056Poix7.js";var k=t(p(),1),ye=b(),be=e=>`yuri.${e}PushOnboardingAttempted`,xe=e=>{if(typeof window>`u`)return!0;try{return window.localStorage.getItem(be(e))===`1`}catch{return!0}},Se=e=>{if(!(typeof window>`u`))try{window.localStorage.setItem(be(e),`1`)}catch{}},Ce=()=>{xe(`ios`)||(Se(`ios`),C(async()=>{let{PushNotifications:e}=await import(`./vendor-capacitor-push-notifications-D5cqJIPw.js`).then(e=>e.t);return{PushNotifications:e}},__vite__mapDeps([0,1,2])).then(async({PushNotifications:e})=>{(await e.checkPermissions().catch(()=>null))?.receive!==`granted`&&await e.requestPermissions().catch(()=>null)}).catch(()=>void 0))},we=()=>{xe(`android`)||Se(`android`)},Te=()=>{if(typeof window>`u`)return;let e=re();if(e!==`ios`&&e!==`android`)return;let t=m.getState();if(t.nativeNotificationsEnabled||t.setNativeNotificationsEnabled(!0),e===`ios`){Ce();return}we()},Ee=`yuri.mobile.connections.v1`,De=`yuri.mobile.`,Oe=`yuri.mobile.deviceId`,ke=()=>{try{let e=window.localStorage.getItem(Oe);if(e&&e.trim())return e.trim();let t=h();return window.localStorage.setItem(Oe,t),t}catch{return h()}},Ae=()=>`mobile:${ke()}`,je=()=>{try{let e=S.getPlatform();return e===`ios`||e===`android`?e:void 0}catch{return}},Me=12,Ne=8e3,Pe=2500,Fe=3e3,Ie=2500,A=e=>{let t=e.trim();if(!t)return``;let n=/^https?:\/\//i.test(t)?t:`http://${t}`,r=new URL(n);return r.hash=``,r.search=``,r.pathname=r.pathname.replace(/\/+$/,``),r.toString().replace(/\/+$/,``)},Le=e=>{try{return new URL(e).host}catch{return e}},j=e=>{try{return A(e)}catch{return e.trim().replace(/\/+$/g,``)}},Re=(e,t)=>j(e)===j(t),ze=e=>`relay:${e.serverId}@${e.relayUrl.trim()}`,Be=e=>`relay://${e.serverId}`,Ve=e=>e.candidates.filter(e=>e.kind===`direct`),M=e=>{let t=e.candidates.find(e=>e.kind===`relay`);return t&&t.kind===`relay`?t.relay:null},N=e=>{let t=Ve(e)[0];if(t)return t.url;let n=M(e);return n?Be(n):``},P=e=>{let t=M(e);if(t)return ze(t);let n=Ve(e)[0];return n?j(n.url):``},He=P,Ue=(e,t)=>{let n=e.find(e=>e.kind===`relay`),r=n&&n.kind===`relay`?n.relay.serverId:null,i=n&&n.kind===`relay`?n.relay.relayUrl.trim():null,a=new Set(e.filter(e=>e.kind===`direct`).map(e=>j(e.url)));return t.some(e=>e.kind===`relay`?r!==null&&e.relay.serverId===r&&e.relay.relayUrl.trim()===i:a.has(j(e.url)))},We=(e,t)=>t.id&&e.id===t.id?!0:Ue(e.candidates,t.candidates),Ge=e=>{let t=(()=>{try{return A(e)}catch{return``}})();return t?[{kind:`direct`,url:t}]:[]},Ke=e=>{if(e.candidates&&e.candidates.length>0)return e.candidates;let t=[];return typeof e.url==`string`&&e.url.trim()&&!/^relay:\/\//i.test(e.url.trim())&&t.push(...Ge(e.url)),e.relay&&t.push({kind:`relay`,relay:e.relay}),t},qe=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;if(typeof t.relayUrl!=`string`||!t.relayUrl.trim()||typeof t.serverId!=`string`||!t.serverId.trim())return null;let n=t.hostEncPubJwk;if(!n||typeof n!=`object`||Array.isArray(n))return null;let r=n;return r.kty!==`EC`||r.crv!==`P-256`||typeof r.x!=`string`||!r.x||typeof r.y!=`string`||!r.y?null:{relayUrl:t.relayUrl,serverId:t.serverId,hostEncPubJwk:{kty:`EC`,crv:`P-256`,x:r.x,y:r.y}}},Je=e=>{try{return JSON.stringify(e)}catch{return String(e)}},F=(e,t={})=>{Je(t)},I=(e,t={})=>{Je(t)},Ye=e=>{if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}},Xe=e=>{if(typeof e!=`string`)return e??void 0;try{return JSON.parse(e)}catch{return e}},Ze=async(e,t)=>{if(!w())return null;try{let{CapacitorHttp:n}=await C(async()=>{let{CapacitorHttp:e}=await import(`./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js`).then(e=>e.i);return{CapacitorHttp:e}},__vite__mapDeps([2,1])),r=Object.fromEntries(new Headers(t?.headers).entries()),i=await n.request({url:e,method:t?.method||`GET`,headers:r,data:Xe(t?.body)});return{ok:i.status>=200&&i.status<300,status:i.status,source:`native-http`,json:async()=>Ye(i.data)}}catch(t){return console.warn(`[mobile-connect]`,`native-http failed`,Je({url:e,error:t instanceof Error?t.message:String(t)})),null}},Qe=async(e,t)=>{let n=await fetch(e,t).catch(t=>(console.warn(`[mobile-connect]`,`browser-fetch failed`,Je({url:e,error:t instanceof Error?t.message:String(t)})),null));return n?{ok:n.ok,status:n.status,source:`browser-fetch`,json:()=>n.json()}:null},L=async(e,t,n)=>{let r,i=new Promise(t=>{r=window.setTimeout(()=>{n?.(),t(null)},e)});try{return await Promise.race([t,i])}catch{return null}finally{r!==void 0&&window.clearTimeout(r)}},R=async(e,t,n)=>{let r=n?.totalTimeoutMs??Ne,i=Date.now(),a=await L(Math.min(Pe,r),Ze(e,t));if(a)return a;let o=new AbortController;return L(Math.max(500,r-(Date.now()-i)),Qe(e,{...t,signal:o.signal}),()=>o.abort())},$e=async e=>{if(!e)return null;let t=await e.json().catch(()=>null);if(!t||typeof t!=`object`)return null;let n=t;return{authenticated:typeof n.authenticated==`boolean`?n.authenticated:void 0,disabled:typeof n.disabled==`boolean`?n.disabled:void 0,scope:typeof n.scope==`string`?n.scope:void 0}},z=15e3,et=async(e,t,r,i=z,a)=>{let o=n({relayUrl:e.relayUrl,serverId:e.serverId,hostEncPubJwk:e.hostEncPubJwk,...r?{grant:r}:{}}),s=e=>e===`ok`&&a?.keepTunnel?{outcome:e,tunnel:o}:(o.close(),{outcome:e});try{let e=t?{Authorization:`Bearer ${t}`}:void 0,n=await L(i,o.fetch(`/auth/session`,{headers:e}).catch(()=>null));if(F(`relay:session`,{ok:n?.ok===!0,status:n?.status??null,hasToken:!!t}),!n)return s(`unreachable`);if(n.status===401)return s(t?`auth-failed`:`needs-login`);if(!n.ok&&n.status!==404)return s(`auth-failed`);let r=await $e(n);return r&&r.disabled!==!0&&r.authenticated===!1?s(t?`auth-failed`:`needs-login`):s(`ok`)}catch(e){throw o.close(),e}},tt=(e,t,n,i,a)=>{let o=typeof window<`u`?window.location.origin:``,c={relayUrl:e.relayUrl,serverId:e.serverId,hostEncPubJwk:e.hostEncPubJwk,...n?{grant:n}:{}};a&&r(c,a),s({apiBaseUrl:o,clientToken:t,runtimeKey:i??ze(e),relay:c})},nt=e=>{if(!e||typeof e!=`object`)return null;let t=e;if(t.kind===`direct`)return typeof t.url==`string`&&t.url.trim()?{kind:`direct`,url:t.url}:null;if(t.kind===`relay`){let e=qe(t.relay);return e?{kind:`relay`,relay:e}:null}return null},rt=e=>{if(e.mode===`relay`){let t=qe(e.relay);return t?[{kind:`relay`,relay:t}]:[]}return typeof e.url==`string`?Ge(e.url):[]},B=()=>{if(typeof window>`u`)return[];let e;try{e=JSON.parse(window.localStorage.getItem(Ee)||`[]`)}catch{return[]}if(!Array.isArray(e))return[];let t=w();return e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let n=e;if(typeof n.id!=`string`)return[];let r=Array.isArray(n.candidates)?n.candidates.map(nt).filter(e=>!!e):rt(n);if(r.length===0)return[];let i=typeof n.clientToken==`string`&&n.clientToken.trim()?n.clientToken:void 0,a=typeof n.label==`string`&&n.label.trim()?n.label:Le(N({candidates:r})),o={id:n.id,label:a,candidates:r,lastUsedAt:typeof n.lastUsedAt==`number`?n.lastUsedAt:0};return t?[{...o,hasToken:!!n.hasToken||!!i}]:[{...o,clientToken:i,hasToken:!!i}]}).sort((e,t)=>t.lastUsedAt-e.lastUsedAt)},it=e=>e.kind===`relay`?{kind:`relay`,relay:{relayUrl:e.relay.relayUrl,serverId:e.relay.serverId,hostEncPubJwk:e.relay.hostEncPubJwk}}:{kind:`direct`,url:e.url},at=e=>{if(typeof window>`u`)return;let t=w(),n=e.slice(0,Me).map(e=>{let n={id:e.id,label:e.label,candidates:e.candidates.map(it),lastUsedAt:e.lastUsedAt};return t?{...n,hasToken:!!(e.hasToken||e.clientToken)}:{...n,clientToken:e.clientToken}});try{window.localStorage.setItem(Ee,JSON.stringify(n))}catch(e){throw console.warn(`[mobile-storage] failed to persist connection metadata`,e),e}},ot=(e,t,n=!0)=>{let r=e.find(e=>We(e,t)),i=w(),a={id:t.id||r?.id||h(),label:t.label,candidates:t.candidates,lastUsedAt:n?Date.now():r?.lastUsedAt??0,...i?{hasToken:t.hasToken??(!!t.clientToken||r?.hasToken||!1)}:{clientToken:t.clientToken??r?.clientToken,hasToken:!!(t.clientToken??r?.clientToken)}};return[a,...e.filter(e=>e.id!==a.id&&!We(e,t))].sort((e,t)=>t.lastUsedAt-e.lastUsedAt).slice(0,Me)},st=te,ct=0,lt=e=>`${De}token.${encodeURIComponent(e)}`,ut=async(e,t)=>{let n,r=new Promise(e=>{n=window.setTimeout(()=>e(t),Fe)});try{return await Promise.race([e.catch(()=>t),r])}finally{n!==void 0&&window.clearTimeout(n)}},dt=async(e,t,n)=>w()?ut(t().catch(t=>(console.warn(`[mobile-storage] ${e} failed`,t),n)),n):n,V=async e=>{I(`secure:read-start`,{key:e});let t=await dt(`secure:read`,async()=>(await st.internalGetItem({prefixedKey:lt(e),sync:!1})).data,null),n=typeof t==`string`&&t.trim()?t:void 0;return I(`secure:read`,{key:e,hasToken:!!n}),n},H=async(e,t)=>{I(`secure:write-start`,{key:e});let n=await dt(`secure:write`,async()=>(await st.internalSetItem({prefixedKey:lt(e),data:t,sync:!1,access:ct}),!0),!1);return I(`secure:write`,{key:e,ok:n}),n},ft=async e=>{await dt(`secure:delete`,async()=>(await st.internalRemoveItem({prefixedKey:lt(e),sync:!1}),!0),!1)},pt=async()=>{if(typeof window>`u`||!w())return;let e;try{e=JSON.parse(window.localStorage.getItem(Ee)||`[]`)}catch{return}if(!Array.isArray(e))return;let t=e.filter(e=>!!e&&typeof e==`object`&&typeof e.url==`string`&&typeof e.clientToken==`string`&&!!e.clientToken.trim());if(t.length!==0){I(`secure:migrate-start`,{count:t.length});for(let{url:e,clientToken:n}of t)await H(j(e),n);at(B()),I(`secure:migrate-done`,{count:t.length})}},mt=async()=>(await pt(),B()),ht=async e=>{let t=ot(B(),e);if(at(t),w()&&e.clientToken){let n=t[0];n&&await H(P(n),e.clientToken)}return t},gt=async e=>{let t=B(),n=t.find(t=>t.id===e)??null,r=t.filter(t=>t.id!==e);if(n){let e;if(w())try{e=await V(P(n))||void 0}catch{e=void 0}else typeof n.clientToken==`string`&&n.clientToken.trim()&&(e=n.clientToken.trim());if(e)try{let{clearAssistantAttachmentCacheForBearer:t}=await C(async()=>{let{clearAssistantAttachmentCacheForBearer:e}=await import(`./assistant-attachment-cache-oatc8F4t.js`).then(e=>e.t);return{clearAssistantAttachmentCacheForBearer:e}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,2]));await t(e,`forget-connection`)}catch{}}if(at(r),n&&w()&&await ft(P(n)),n){let e=P(n);try{let{useAssistantUIStore:t}=await C(async()=>{let{useAssistantUIStore:e}=await import(`./useAssistantUIStore-BI_dAUjx.js`).then(e=>e.a);return{useAssistantUIStore:e}},__vite__mapDeps([18,1,5,4,19,12,20,21,16]));t.getState().removeCatalogPartition(e);let{publishNativeAssistantCatalog:n}=await C(async()=>{let{publishNativeAssistantCatalog:e}=await Promise.resolve().then(()=>ln);return{publishNativeAssistantCatalog:e}},void 0);await n().catch(()=>void 0)}catch{console.warn(`[mobile-storage] connection catalog cleanup failed`)}}return r},_t=1500,U=async(e,t,n)=>{let r=n?.fast?{totalTimeoutMs:Ie}:void 0,i=M({candidates:e})?.serverId??null,a=e.find(e=>e.kind===`relay`)??null,o=e.filter(e=>e.kind===`direct`),s=async()=>{for(let e of o){let n=A(e.url)||e.url,a=t?{Authorization:`Bearer ${t}`}:void 0,o=await R(`${n}/health`,{method:`GET`},r);if(!o?.ok)continue;if(i){let e=await o.json().catch(()=>null),t=e&&typeof e==`object`?e.serverId:null;if(typeof t==`string`&&t&&t!==i){F(`probe:server-id-mismatch`,{url:n});continue}}let s=await R(`${n}/auth/session`,{method:`GET`,credentials:`include`,headers:a},r);if(s?.status===401)return{status:`needs-login`};if(!s||!s.ok&&s.status!==404)continue;let c=await $e(s);if(c&&c.disabled!==!0&&c.authenticated===!1)return{status:`needs-login`};let l=c?.disabled===!0;return!t&&w()&&!l&&c?.scope!==`client`?{status:`needs-login`}:{status:`ok`,transport:{kind:`direct`,url:n}}}return{status:`unreachable`}},c=async()=>{if(!a)return{status:`unreachable`};let{outcome:e,tunnel:r}=await et(a.relay,t,void 0,n?.fast?Ie:void 0,{keepTunnel:!0});return e===`ok`?{status:`ok`,transport:{kind:`relay`,relay:a.relay,tunnel:r}}:e===`needs-login`||e===`auth-failed`?{status:`needs-login`}:{status:`unreachable`}};return a?o.length===0?c():new Promise(e=>{let t=!1,n=!1,r,i=null,a=null,o=e=>{e?.status===`ok`&&e.transport.kind===`relay`&&e.transport.tunnel?.close()},l=n=>{t||(t=!0,e(n))},u=()=>{n||t||(r!==void 0&&(window.clearTimeout(r),r=void 0),c().then(e=>{if(a=e,t||n){o(e);return}if(e.status===`ok`||e.status===`needs-login`){l(e);return}i&&l(i)}))};s().then(e=>{if(i=e,!t){if(e.status===`ok`||e.status===`needs-login`){n=!0,r!==void 0&&window.clearTimeout(r),o(a),l(e);return}if(a){l(a);return}u()}}),r=window.setTimeout(u,_t)}):s()},W=(e,t,n)=>{e.kind===`relay`?tt(e.relay,t,n?.grant,n?.runtimeKey,e.tunnel):s({apiBaseUrl:e.url,clientToken:t,runtimeKey:n?.runtimeKey}),Mt()},vt=()=>{let e=B()[0];return e?.label?.trim()?e.label:null},yt=async()=>{await pt();let e=B()[0];if(!e)return!1;let t;if(w()){if(!e.hasToken||(t=await V(P(e)),!t))return!1}else if(t=e.clientToken,!t)return!1;let n=await U(e.candidates,t);return n.status===`ok`&&(await ht({id:e.id,label:e.label,candidates:e.candidates}),W(n.transport,t,{runtimeKey:P(e)}),!0)},bt=async(e,t)=>{let n=(await mt()).find(t=>P(t)===e);if(!n)return`missing`;let r=w()?n.hasToken?await V(e):void 0:n.clientToken;if(!r)return`auth-required`;let i=t?.transportPreference===`relay`?n.candidates.filter(e=>e.kind===`relay`):n.candidates;if(i.length===0)return`offline`;let a=await U(i,r,{fast:!0});return a.status===`needs-login`?`auth-required`:a.status===`ok`?(W(a.transport,r,{runtimeKey:e}),`connected`):`offline`},xt=async(e,t)=>{let n=``;try{n=A(e.url)}catch{return!1}if(!n)return!1;let r=e.clientToken?.trim()||void 0,i=r?{Authorization:`Bearer ${r}`}:void 0,a=t?.fast?{totalTimeoutMs:Ie}:void 0;if(!(await R(`${n}/health`,{method:`GET`,headers:i},a))?.ok)return!1;let o=await R(`${n}/auth/session`,{method:`GET`,credentials:`include`,headers:i},a);if(!o||!o.ok&&o.status!==404)return!1;let s=await $e(o);return!(s&&s.disabled!==!0&&s.authenticated===!1)},St=e=>[...e].sort((e,t)=>{let n=(e.priority??100)-(t.priority??100);if(n!==0)return n;let r=e=>e.type===`relay`?2:+!e.url.startsWith(`https://`);return r(e)-r(t)}).flatMap(e=>{if(e.type===`relay`){let t=qe({relayUrl:e.relayUrl,serverId:e.serverId,hostEncPubJwk:e.hostEncPubJwk});return t?[{kind:`relay`,relay:t}]:[]}return Ge(e.url)}),Ct=async e=>{let t=M({candidates:e})?.serverId??null;for(let r of e){if(r.kind===`relay`){let e=n(r.relay),t=await L(z,e.fetch(`/health`).catch(()=>null));if(F(`establish:relay:health`,{ok:t?.ok===!0,status:t?.status??null}),t?.ok)return{kind:`relay`,relay:r.relay,tunnel:e};e.close();continue}let e=A(r.url)||r.url,i=await R(`${e}/health`,{method:`GET`});if(F(`establish:direct:health`,{ok:i?.ok===!0,status:i?.status??null}),i?.ok){if(t){let n=await i.json().catch(()=>null),r=n&&typeof n==`object`?n.serverId:null;if(typeof r==`string`&&r&&r!==t){F(`establish:server-id-mismatch`,{url:e});continue}}return{kind:`direct`,url:e}}}return null},wt=async(e,t)=>{if(!i())return xt(e,t);let n=await L(t?.fast?Ie:z,d(`/auth/session`).then(e=>e).catch(()=>null));if(!n)return!0;if(n.status===401)return!1;if(!n.ok&&n.status!==404)return!0;let r=await $e(n);return!(r&&r.disabled!==!0&&r.authenticated===!1)},Tt=e=>e.kind===`relay`?i():!i()&&Re(e.url,u()),Et=()=>{let e=l();return e?B().find(t=>P(t)===e)??null:null},Dt=e=>{let t=l();return!!t&&P(e)===t},Ot=async()=>{let e=Et();if(!e)return`no-connection`;let t;if(t=w()?e.hasToken?await V(P(e)):void 0:e.clientToken,!t)return`unreachable`;let n=e.candidates.findIndex(e=>Tt(e.kind===`relay`?{kind:`relay`,relay:e.relay}:{kind:`direct`,url:e.url})),r=await U(n>=0?e.candidates.slice(0,n):e.candidates,t,{fast:!0});if(r.status===`ok`)return await ht({id:e.id,label:e.label,candidates:e.candidates}),W(r.transport,t,{runtimeKey:P(e)}),`switched`;if(r.status===`needs-login`)return`unreachable`;if(n>=0&&await wt({url:u(),clientToken:t},{fast:!0}))return Mt(),`unchanged`;let i=await U(n>=0?e.candidates.slice(n+1):[],t,{fast:!0});return i.status===`ok`?(await ht({id:e.id,label:e.label,candidates:e.candidates}),W(i.transport,t,{runtimeKey:P(e)}),`switched`):`unreachable`},kt=5e3,At=!1,jt=async()=>{if(At)return`skipped`;let e=Et();if(!e)return F(`candidates:refresh-skip`,{reason:`no-active-connection`}),`skipped`;let t=M(e);if(!t)return F(`candidates:refresh-skip`,{reason:`no-relay-candidate`}),`skipped`;At=!0;try{let n=await L(z,d(`/api/client-auth/connection/candidates`).then(e=>e).catch(()=>null));if(!n?.ok)return F(`candidates:refresh-skip`,{reason:`fetch-failed`,status:n?.status??null}),`skipped`;let r=await n.json().catch(()=>null);if(!r||r.serverId!==t.serverId)return F(`candidates:refresh-skip`,{reason:`server-id-mismatch`}),`skipped`;let i=Array.isArray(r.candidates)?r.candidates:[],a=[];for(let e of i){if(!e||typeof e!=`object`)continue;let t=e;if(t.type===`lan`&&typeof t.url==`string`)try{let e=A(t.url);e&&!a.includes(e)&&a.push(e)}catch{}}if(a.length===0)return F(`candidates:refresh-skip`,{reason:`no-lan-reported`}),`skipped`;let o=Ve(e).filter(e=>e.url.startsWith(`https://`)),s=[...a.map(e=>({kind:`direct`,url:e})),...o,{kind:`relay`,relay:t}];return JSON.stringify(e.candidates.map(it))===JSON.stringify(s.map(it))?`unchanged`:(F(`candidates:refreshed`,{lanCount:a.length}),await ht({id:e.id,label:e.label,candidates:s}),`updated`)}finally{At=!1}},Mt=()=>{typeof window>`u`||window.setTimeout(()=>{(async()=>{let e=await jt().catch(()=>`skipped`);F(`candidates:refresh-result`,{result:e}),e===`updated`&&i()&&await Ot().catch(()=>null)})()},kt)},Nt=e=>{let{t}=ie(),[n,r]=k.useState(()=>B()),[i,a]=k.useState(null),[o,s]=k.useState(null),[c,l]=k.useState(null),u=k.useRef(n),d=k.useRef(0),f=k.useRef(null),p=k.useRef(new Set),m=T(()=>{Te(),e(),p.current.forEach(e=>e())}),g=T(e=>(p.current.add(e),()=>p.current.delete(e))),_=T(e=>{d.current+=1,u.current=e,r(e)}),v=T(e=>{f.current=e,a(e)}),y=T(e=>{f.current===e&&(f.current=null,a(null))}),b=T(()=>s(t(`mobile.connect.history.updateFailed`)));k.useEffect(()=>{let e=!1,t=d.current;return mt().then(n=>{!e&&d.current===t&&_(n)}).catch(()=>{e||b()}),()=>{e=!0}},[_,b]);let x=T((e,t=!0)=>{let n=ot(u.current,e,t);return at(n),_(n),n}),ee=T(async e=>{if(!f.current){s(null),v(`connect`);try{let n=Ke(e);if(n.length===0){s(t(`mobile.connect.error.urlRequired`));return}let r=e.id?u.current.find(t=>t.id===e.id):u.current.find(e=>Ue(e.candidates,n)),i=e.label?.trim()||r?.label||Le(N({candidates:n})),a=e.relayGrant,o=e.clientToken?.trim()||void 0,c=!!o;o||(w()?r?.hasToken&&(o=await V(P(r))):o=r?.clientToken),F(`connect:start`,{candidates:n.map(e=>e.kind),hasToken:!!o});let d=await U(n,o);if(F(`connect:probe`,{status:d.status}),d.status===`unreachable`){s(t(`mobile.connect.error.unreachable`));return}if(d.status===`needs-login`){x({id:r?.id,label:i,candidates:n},!1),l({id:r?.id??h(),label:i,candidates:n,relay:M({candidates:n})??void 0,relayGrant:a});return}let f=P({candidates:n});o&&c&&w()&&await H(f,o),x({id:r?.id,label:i,candidates:n,clientToken:o}),W(d.transport,o??null,{runtimeKey:f,grant:a}),m()}catch(e){console.warn(`[mobile-connect] connect threw`,e),s(t(`mobile.connect.error.invalidUrl`))}finally{y(`connect`)}}}),S=T(async e=>{if(f.current)return;s(null),v(`pairing`);let n=St(e.candidates),r=null,i=!1;try{if(r=await Ct(n),!r){s(t(`mobile.connect.error.unreachable`));return}let a={method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify({pairingId:e.pairingId,secret:e.secret,clientLabel:`Yuri Mobile`,clientKind:`mobile`,deviceName:`Yuri Mobile`,devicePlatform:je(),dedupeKey:Ae()})},o=r.kind===`relay`?await L(z,r.tunnel.fetch(`/api/client-auth/pairing/redeem`,a).catch(()=>null)):await R(`${r.url}/api/client-auth/pairing/redeem`,a);if(!o?.ok){s(t(`mobile.connect.error.authRequired`));return}let c=await o.json().catch(()=>null),l=typeof c?.clientToken==`string`?c.clientToken.trim():``;if(!l){s(t(`mobile.connect.error.authRequired`));return}let u=typeof c?.server?.label==`string`?c.server.label:``,d=e.label||u||Le(N({candidates:n})),f=P({candidates:n});if(w()&&!await H(f,l)){s(t(`mobile.connect.error.authRequired`));return}x({label:d,candidates:n,clientToken:l}),W(r.kind===`relay`?{kind:`relay`,relay:r.relay,tunnel:r.tunnel}:{kind:`direct`,url:r.url},l,{runtimeKey:f}),i=r.kind===`relay`,m()}catch(e){console.warn(`[mobile-connect] pairing threw`,e),s(t(`mobile.connect.error.authRequired`))}finally{!i&&r?.kind===`relay`&&r.tunnel.close(),y(`pairing`)}}),C=T(async e=>{if(!c||!e.trim()||f.current)return;s(null),v(`password`);let{id:n,label:r,candidates:i}=c,a=null,o=!1;try{if(a=await Ct(i),!a){s(t(`mobile.connect.error.unreachable`));return}let c={method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify({password:e,trustDevice:!0,issueClientToken:!0,clientLabel:`Yuri Mobile`,clientKind:`mobile`,devicePlatform:je(),dedupeKey:Ae()})};F(`password:start`,{transport:a.kind});let u=a.kind===`relay`?await L(z,a.tunnel.fetch(`/auth/session`,c).catch(()=>null)):await R(`${a.url}/auth/session`,c);if(F(`password:done`,{ok:u?.ok===!0,status:u?.status??null}),!u?.ok){s(t(`mobile.connect.error.passwordFailed`));return}let d=await u.json().catch(()=>null),f=typeof d?.clientToken==`string`?d.clientToken.trim():``;if(F(`password:token`,{issued:!!f}),!f){if(a.kind===`direct`&&!w()){x({id:n,label:r,candidates:i}),l(null),W({kind:`direct`,url:a.url},null,{runtimeKey:P({candidates:i})}),m();return}s(t(`mobile.connect.error.authRequired`));return}w()&&await H(P({candidates:i}),f),x({id:n,label:r,candidates:i,clientToken:f}),l(null),W(a.kind===`relay`?{kind:`relay`,relay:a.relay,tunnel:a.tunnel}:{kind:`direct`,url:a.url},f,{runtimeKey:P({candidates:i})}),o=a.kind===`relay`,m()}catch(e){console.warn(`[mobile-connect] password threw`,e),s(t(`mobile.connect.error.passwordFailed`))}finally{!o&&a?.kind===`relay`&&a.tunnel.close(),y(`password`)}}),te=T(()=>{l(null),s(null)}),ne=T(async e=>{if(f.current)return null;v(`metadata`);try{s(null);let n=Ke(e),r=e.id?u.current.find(t=>t.id===e.id)??null:null;if(r){let e=n.filter(e=>e.kind===`direct`),t=Ve(r).filter(t=>t.url.startsWith(`https://`)&&!e.some(e=>Re(e.url,t.url))),i=M(r);n=[...e,...t,...i?[{kind:`relay`,relay:i}]:[]]}if(n.length===0)return s(t(`mobile.connect.error.urlRequired`)),null;let i=e.clientToken?.trim()||void 0,a=e.label?.trim()||Le(N({candidates:n}));if(w()){let e=P({candidates:n});if(i)await H(e,i);else if(r?.hasToken){let t=P(r);if(t&&e&&t!==e){let n=await V(t);n&&await H(e,n)}}}return x({id:e.id,label:a,candidates:n,clientToken:i},!1).find(e=>Ue(e.candidates,n))??null}catch{return s(t(`mobile.connect.history.updateFailed`)),null}finally{y(`metadata`)}}),re=T(async(e,n)=>{if(f.current||!n.trim())return null;let r=u.current.find(t=>t.id===e);if(!r)return null;v(`metadata`),s(null);try{let t={...r,label:n.trim()},i=u.current.map(n=>n.id===e?t:n);return at(i),_(i),t}catch{return s(t(`mobile.connect.history.updateFailed`)),null}finally{y(`metadata`)}}),ae=T(async e=>{if(f.current)return null;v(`metadata`),s(null);try{let t=u.current.find(t=>t.id===e)??null,n=await gt(e);return _(n),t}catch{return s(t(`mobile.connect.history.updateFailed`)),null}finally{y(`metadata`)}});return{connections:n,isBusy:i!==null,isPasswordBusy:i===`password`,error:o,pendingConnection:c,connect:ee,redeemPairingConnection:S,submitPassword:C,cancelPassword:te,saveConnection:ne,renameConnection:re,removeConnection:ae,subscribeConnected:g,setError:s}},Pt=async(e,t=3)=>{let n;for(let r=0;r<t;r+=1)try{await e();return}catch(e){n=e}throw n},Ft=async(e,t,n=2)=>{let r=[...new Map(e.map(e=>[e.operationID,e])).values()],i=0;await Promise.all(Array.from({length:Math.min(Math.max(1,n),r.length)},async()=>{for(;i<r.length;){let e=r[i++];try{e.cleanupPhase&&e.cleanupPhase!==`files-released`?await t.cleanup(e.operationID):await t.deliver(e.operationID)}catch{}}}))},It=e=>!!(e.serverInstanceID&&e.assistantID&&e.name&&e.avatarSeed&&e.serverLabel&&e.connectionKey),Lt=`yuri.mobile-share.draft-handoff.v1`,Rt=`mobile-share-handoff:`,zt=20971520,Bt=20971520,Vt=e=>`${Rt}${e}`,Ht=e=>e??(typeof window>`u`?null:window.localStorage),G=e=>{if(!e)return{};try{let t=JSON.parse(e.getItem(`yuri.mobile-share.draft-handoff.v1`)||`{}`);return Object.fromEntries(Object.entries(t).flatMap(([e,t])=>{let n=typeof t.assistantID==`string`?t.assistantID:Yt(t),r=typeof t.transportIdentity==`string`?t.transportIdentity:t.targetDraftKey?.transportIdentity;if(!n||typeof t.serverInstanceID!=`string`||typeof t.connectionKey!=`string`||!r)return[];let i=t.phase===`cancelled`?`cancelled`:t.phase===`materialized`?`materialized`:`materializing`;return[[e,{...t,draftID:e,assistantID:n,transportIdentity:r,phase:i}]]}))}catch{return{}}},Ut=(e,t)=>{if(!e)return!1;try{return e.setItem(Lt,JSON.stringify(t)),!0}catch{return!1}},Wt=(e,t)=>{let n=G(e);if(delete n[t],e)try{e.setItem(Lt,JSON.stringify(n))}catch{return}},K=(e,t)=>Ut(e,{...G(e),[t.draftID]:t}),Gt=(e,t)=>`native-share:${e}:${t}`,Kt=(e,t)=>t?e?`${e}\n\n${t}`:t:e,qt=e=>e.mime.startsWith(`image/`)&&e.byteSize>0&&e.byteSize<=zt,Jt=(e,t)=>!!t?.syntheticParts.some(t=>t.partID===Vt(e.draftID)&&t.text===``&&t.attachments.length===0&&t.synthetic===!0),Yt=e=>{let t=e.targetDraftKey?.owner;return t?.kind!==`surface`||typeof t.ownerID!=`string`||!t.ownerID.startsWith(`assistant:`)?null:t.ownerID.slice(10)||null},Xt=e=>({draftID:e.draftID,serverInstanceID:e.serverInstanceID,connectionKey:e.connectionKey,assistantID:e.assistantID,transportIdentity:e.transportIdentity}),Zt=async(e,t)=>{let n=Ht(t),r=[];for(let t of Object.values(G(n))){if(t.phase===`cancelled`){r.push(Xt(t));continue}if(t.phase===`materialized`)try{await e(t.draftID);let i={...t,phase:`cancelled`};if(!K(n,i))continue;r.push(Xt(i))}catch{continue}}return r},Qt=(e,t)=>{let n=Ht(t),r=G(n)[e.draftID];return!r||r.phase!==`cancelled`||r.serverInstanceID!==e.serverInstanceID||r.connectionKey!==e.connectionKey||r.assistantID!==e.assistantID||r.transportIdentity!==e.transportIdentity?!1:(Wt(n,e.draftID),!G(n)[e.draftID])},$t=async(e,t)=>{let n=_({transportIdentity:e.transportIdentity},`assistant:${e.assistantID}`),r=t.captureDraftRuntime();if(r.transportIdentity!==e.transportIdentity)return!1;let i=t.getDraft(n),a=Vt(e.draftID);try{if(!i||!i.syntheticParts.some(e=>e.partID===a)){await t.flushDraftPersistence();let n=t.captureDraftRuntime();return n.transportIdentity===e.transportIdentity&&n.generation===r.generation}let o=await t.commitDraftSnapshot({key:n,expectedRevision:i.revision,runtime:r,values:new Map,snapshot:{text:i.text,attachments:i.attachments,syntheticParts:i.syntheticParts.filter(e=>e.partID!==a),mentions:i.mentions,...i.composerReferences===void 0?{}:{composerReferences:i.composerReferences}}});if(!o.current||!o.durable)return!1;await t.flushDraftPersistence();let s=t.captureDraftRuntime();return s.transportIdentity===e.transportIdentity&&s.generation===r.generation}catch{return!1}},en=async(e,t)=>{if(e.attachments.length>10||!e.attachments.every(qt)||e.attachments.reduce((e,t)=>e+t.byteSize,0)>Bt)throw Error(`invalid_share_attachment`);let n=Ht(t.storage),r=_({transportIdentity:t.transportIdentity},`assistant:${e.assistantID}`),i=G(n)[e.draftID],a=!1;if(!i||y(i.targetDraftKey)!==y(r)){let a=t.input.getDraft(r);if(i={draftID:e.draftID,serverInstanceID:e.serverInstanceID,connectionKey:e.connectionKey,assistantID:e.assistantID,transportIdentity:t.transportIdentity,targetDraftKey:r,baseRevision:a?.revision??`absent`,resultText:Kt(a?.text??``,e.text),attachmentIDs:e.attachments.map((t,n)=>Gt(e.draftID,n)),phase:`materializing`},!K(n,i))throw Error(`handoff_journal_unavailable`)}if(i.phase===`cancelled`)return{durable:!0,cancelled:!0};(i.phase===`materialized`||Jt(i,t.input.getDraft(r)))&&(a=!0);for(let o=0;!a&&o<3;o++){let o=t.input.getDraft(r),s={...i,baseRevision:o?.revision??`absent`,resultText:Kt(o?.text??``,e.text),phase:`materializing`};if(!K(n,s))throw Error(`handoff_journal_unavailable`);i=s;let c=new Map,l=[];for(let n=0;n<e.attachments.length;n++){let r=e.attachments[n],a=i.attachmentIDs[n],o=g(a),s=await t.readAttachment(r);if(s.size!==r.byteSize)throw Error(`staged_file_unavailable`);c.set(o,s.type===r.mime?s:new Blob([s],{type:r.mime})),l.push({attachmentID:a,attachmentRefID:o,filename:r.originalName,mimeType:r.mime,size:r.byteSize,locator:{kind:`blob`,blobID:a},source:`local`})}let u={partID:Vt(e.draftID),text:``,attachments:[],synthetic:!0},d=o?.syntheticParts??[],f=await t.input.commitDraftSnapshot({key:r,expectedRevision:o?.revision??`absent`,runtime:t.input.captureDraftRuntime(),snapshot:{text:i.resultText,attachments:[...o?.attachments??[],...l],syntheticParts:d.some(e=>e.partID===u.partID)?d:[...d,u],mentions:o?.mentions??[],...o?.composerReferences===void 0?{}:{composerReferences:o.composerReferences}},values:c});if(f.durable&&f.current)a=!0;else if(f.status!==`conflict`)throw Error(`draft_handoff_${f.status}`)}if(!a)throw Error(`draft_handoff_conflict`);if(i.phase!==`materialized`&&(i={...i,phase:`materialized`},!K(n,i)))throw Error(`handoff_journal_unavailable`);try{await t.cancelDraft(e.draftID)}catch{return{durable:!0,cancelled:!1}}if(i={...i,phase:`cancelled`},!K(n,i))throw Error(`handoff_journal_unavailable`);return{durable:!0,cancelled:!0}},tn=ee(`YuriShare`),nn=null,rn=(e,t)=>l()===e&&c()===t,an=e=>{if(ne()){fe(e);return}let t=de.getState();t.setActiveTab(`assistant`),t.openAssistant(e)},on=async()=>{let e=(await tn.pendingAssistantOpen().catch(()=>null))?.request;if(!e)return!1;let t=await bt(e.connectionKey);if(t===`missing`)return await tn.ackAssistantOpen({requestID:e.requestID}).catch(()=>void 0),!0;if(t!==`connected`)return!0;let n=c();if(!rn(e.connectionKey,n))return!0;try{let[t,r]=await Promise.all([E(),se()]);if(!rn(e.connectionKey,n))return!0;let i=r.assistants.some(t=>t.id===e.assistantID&&t.enabled);if(!t.supported||!t.enabled||t.serverInstanceID!==e.serverInstanceID||!i)return await tn.ackAssistantOpen({requestID:e.requestID}),!0;an(e.assistantID),await tn.ackAssistantOpen({requestID:e.requestID})}catch{}return!0},q=async()=>S.getPlatform()===`android`?nn||(nn=on().finally(()=>{nn=null}),nn):!1,sn=e=>({displayName:e}),J=f();function cn(e){let t=(0,ye.c)(30),{draft:n,entries:r,busy:i,onSelect:a,onCancel:o}=e,{t:s}=ie(),c;t[0]!==i||t[1]!==n||t[2]!==o?(c=()=>{n&&!i&&o(n)},t[0]=i,t[1]=n,t[2]=o,t[3]=c):c=t[3];let l=T(c),u;t[4]===l?u=t[5]:(u=e=>{e||l()},t[4]=l,t[5]=u);let d=T(u),f;t[6]!==n||t[7]!==a?(f=e=>{n&&a(n,e)},t[6]=n,t[7]=a,t[8]=f):f=t[8];let p=T(f),m=!!n,h;t[9]===s?h=t[10]:(h=s(`assistants.shareWelcome.example.note.title`),t[9]=s,t[10]=h);let g;t[11]===s?g=t[12]:(g=s(`settings.common.actions.cancel`),t[11]=s,t[12]=g);let _;t[13]!==i||t[14]!==l||t[15]!==h||t[16]!==g?(_=(0,J.jsx)(ue,{title:h,backAriaLabel:g,onBack:l,backDisabled:i,overlay:!0}),t[13]=i,t[14]=l,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==i||t[19]!==r||t[20]!==p||t[21]!==s?(v=r.length?(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem)+0.75rem)]`,role:`listbox`,"aria-label":s(`assistants.listAria`),children:r.map(e=>{let t=sn(e.name).displayName||e.name;return(0,J.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":`false`,disabled:i,className:`flex w-full items-center gap-3 border-b border-border/60 px-3 py-4 text-left text-foreground transition-colors last:border-b-0 hover:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60`,onClick:()=>p(e),children:[(0,J.jsx)(me,{kind:`assistant`,name:e.avatarSeed,size:40,label:t,shape:`rounded`,className:`rounded-[0.5rem]`}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`span`,{className:`block truncate font-semibold`,children:t}),(0,J.jsx)(`span`,{className:`block truncate typography-small text-muted-foreground`,children:e.serverLabel})]}),(0,J.jsx)(he,{name:`arrow-right-s`,className:`size-4 shrink-0 text-muted-foreground`})]},`${e.connectionKey}:${e.assistantID}`)})}):(0,J.jsx)(`p`,{className:`px-5 pb-[max(1.25rem,env(safe-area-inset-bottom))] pt-[calc(max(0.25rem,var(--yuri-safe-area-top,0px))+var(--yuri-mobile-detail-navigation-height,3.5rem)+0.75rem)] typography-ui text-muted-foreground`,children:s(`assistants.state.unavailable`)}),t[18]=i,t[19]=r,t[20]=p,t[21]=s,t[22]=v):v=t[22];let y;t[23]!==_||t[24]!==v?(y=(0,J.jsxs)(ge,{className:`h-[100dvh] max-h-none w-screen max-w-none gap-0 overflow-hidden rounded-none border-0 bg-background p-0`,containerClassName:`items-stretch p-0`,overlayClassName:`bg-background`,showCloseButton:!1,children:[_,v]}),t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==d||t[27]!==m||t[28]!==y?(b=(0,J.jsx)(_e,{open:m,onOpenChange:d,children:y}),t[26]=d,t[27]=m,t[28]=y,t[29]=b):b=t[29],b}var ln=e({MobileShareBridge:()=>Un,donateNativeAssistantInteraction:()=>Mn,publishNativeAssistantCatalog:()=>jn,refreshNativeAssistantCatalog:()=>Q}),Y=ee(`YuriShare`),un=`yuri.mobile-share.outbox.v1`,dn=()=>S.isNativePlatform(),fn=()=>{try{return JSON.parse(window.localStorage.getItem(un)||`{}`)}catch{return{}}},pn=e=>{try{window.localStorage.setItem(un,JSON.stringify(e))}catch{}},X=e=>{let t=fn(),n=t[e.envelope.operationID];n&&n.updatedAt>e.updatedAt||(t[e.envelope.operationID]=e,pn(t))},Z=(e,t)=>l()===e&&c()===t,mn=new Map,hn=null,gn=null,_n=!1,vn=[],yn=0,bn=new Set,xn=new Map,Sn=1,Cn=e=>{e.map(e=>e.draftID).join(`
|
|
3
|
-
`)!==vn.map(e=>e.draftID).join(`
|
|
4
|
-
`)&&(vn=e,yn+=1,bn.forEach(e=>e()))},wn=e=>Cn(vn.filter(t=>t.draftID!==e)),Tn=e=>(bn.add(e),()=>bn.delete(e)),En=()=>yn,Dn=async e=>{if(!e.mime.startsWith(`image/`))throw Error(`unsupported_share_attachment`);let t=e.stagedPath.trim();if(!t)throw Error(`staged_file_unavailable`);let n=/^(?:data:|https?:|content:|file:)/i.test(t)?t:`file://${t}`,r=/^(?:data:|https?:)/i.test(n)?n:S.convertFileSrc(n);return x(()=>fetch(r).then(e=>{if(!e.ok)throw Error(`staged_file_unavailable`);return e.blob()}))},On=async e=>{let t=await Dn(e);return await new Promise((e,n)=>{let r=new FileReader;r.onerror=()=>n(Error(`staged_file_unavailable`)),r.onload=()=>typeof r.result==`string`?e(r.result):n(Error(`staged_file_unavailable`)),r.readAsDataURL(t)})},kn=async e=>{let t=[];if(e.text?.trim()&&t.push({type:`text`,text:e.text}),e.attachments.length>10)throw Error(`too_many_share_attachments`);for(let n of e.attachments){if(n.byteSize<=0||n.byteSize>20971520)throw Error(`invalid_share_attachment`);t.push({type:`file`,mime:n.mime,url:await On(n)})}if(t.length===0)throw Error(`empty_share`);return t},Q=async()=>{if(!dn())return;let e=l(),t=(await mt()).find(t=>He(t)===e);if(!t)return;let n=c();try{let[r,i]=await Promise.all([E(),ce()]);if(!Z(e,n)||!r.supported||!r.serverInstanceID)return;let a=r.serverInstanceID,o=i.assistants.map(n=>({serverInstanceID:a,assistantID:n.id,name:n.name,avatarSeed:n.avatarSeed??n.id,serverLabel:t.label,connectionKey:e,enabled:r.enabled&&n.enabled,isDefaultShareTarget:!1}));O.getState().replaceCatalogPartition({serverInstanceID:a,connectionKey:e,revision:i.revision,lastLoadedAt:Date.now(),entries:o}),await jn()}catch{}},An=0,jn=async()=>{if(!dn())return;let e=++An,t=[];for(let n of Object.values(O.getState().assistantCatalogByConnection).flatMap(e=>e.entries)){let r=sn(n.name),i=await ve(pe(`assistant`,n.avatarSeed),128);if(e!==An)return;t.push({...n,name:r.displayName||n.name,...i?{avatarPng:i}:{}})}await Y.updateCatalog({entries:t})},Mn=async e=>{if(S.getPlatform()!==`ios`)return;let t=await ve(pe(`assistant`,e.avatarSeed),128);await Y.donateAssistantInteraction({...e,...t?{avatarPng:t}:{}})},Nn=e=>{let t=mn.get(e.operationID);if(t)return t;let n=Fn(e);return mn.set(e.operationID,n),n.finally(()=>{mn.get(e.operationID)===n&&mn.delete(e.operationID)}).catch(()=>void 0),n},Pn=async e=>{e.cleanupPhase!==`files-released`&&(e.cleanupPhase===`server-completed`&&(await Pt(()=>Y.ack({operationID:e.envelope.operationID})),e={...e,state:`delivered`,cleanupPhase:`native-acked`,updatedAt:Date.now()},X(e)),e.cleanupPhase===`native-acked`&&(await Pt(()=>Y.releaseFiles({operationID:e.envelope.operationID})),X({...e,state:`delivered`,cleanupPhase:`files-released`,updatedAt:Date.now()})))},Fn=async e=>{let t=fn()[e.operationID];if(t?.cleanupPhase){await Pn(t);return}let n=t?.messageID?t:{envelope:e,messageID:v(`msg`),state:t?.state??`pending`,cleanupPhase:t?.cleanupPhase,updatedAt:Date.now(),error:t?.error};X(n),n={...n,state:`resolving-instance`,updatedAt:Date.now()},X(n);let r=Object.values(O.getState().assistantCatalogByConnection).find(t=>t.serverInstanceID===e.serverInstanceID&&t.entries.some(t=>t.assistantID===e.assistantID));if(!r){X({...n,state:`target-stale`,updatedAt:Date.now()});return}n={...n,state:`connecting`,updatedAt:Date.now()},X(n);let i=await bt(r.connectionKey);if(i===`auth-required`){X({...n,state:`auth-required`,updatedAt:Date.now()});return}if(i!==`connected`){X({...n,state:`offline`,updatedAt:Date.now()});return}let a=c(),s=null;if(Z(r.connectionKey,a)){try{if(await d(`/api/config/settings`).catch(()=>void 0),!Z(r.connectionKey,a))return;let[t,i]=await Promise.all([E(),ce()]);if(!Z(r.connectionKey,a)||!t.supported||t.serverInstanceID!==e.serverInstanceID){X({...n,state:`target-stale`,updatedAt:Date.now()});return}let c=i.assistants.find(t=>t.id===e.assistantID&&t.enabled);if(!t.enabled||!c){X({...n,state:`target-stale`,updatedAt:Date.now()});return}n={...n,state:`dispatching`,updatedAt:Date.now()},X(n);let l=await kn(e);if(!Z(r.connectionKey,a))return;n={...n,state:`reconciling`,updatedAt:Date.now()},X(n);let u=await le(c.id,e.operationID,n.messageID,l,e.source),f=await ae(u,o(),a),p=await se().catch(e=>(X({...n,state:`reconciling`,updatedAt:Date.now(),error:e instanceof Error?e.message:`snapshot_refresh_failed`}),null));if(!p)return;if(!Z(r.connectionKey,a)){X({...n,state:`reconciling`,updatedAt:Date.now(),error:`runtime_stale`});return}let m=p.assistants.find(e=>e.id===c.id);if(!m||m.sessionID!==f.sessionID){X({...n,state:`reconciling`,updatedAt:Date.now(),error:`assistant_binding_mismatch`});return}s=m.id}catch(e){if(e instanceof oe&&e.code===`share_unresolved`||e instanceof Error&&e.message===`runtime_stale`){X({...n,state:`reconciling`,updatedAt:Date.now(),error:e instanceof Error?e.message:`share_unresolved`});return}X({...n,state:`failed`,updatedAt:Date.now(),error:e instanceof Error?e.message:`dispatch_failed`});return}n={...n,state:`delivered`,cleanupPhase:`server-completed`,updatedAt:Date.now()},X(n),an(s),await Pn(n)}},In=async()=>hn||(hn=Ln().finally(()=>{hn=null}),hn),Ln=async()=>{if(!dn())return;let e=await Y.listPending().catch(()=>null),t=new Map((e?.envelopes??[]).map(e=>[e.operationID,e])),n=fn();await Ft([...[...t.values()].map(e=>({operationID:e.operationID,cleanupPhase:n[e.operationID]?.cleanupPhase})),...Object.values(n).filter(e=>!t.has(e.envelope.operationID)&&(!!(e.cleanupPhase&&e.cleanupPhase!==`files-released`)||e.state!==`delivered`&&e.state!==`auth-required`&&e.state!==`target-stale`)).map(e=>({operationID:e.envelope.operationID,cleanupPhase:e.cleanupPhase}))],{deliver:async e=>{let r=t.get(e)??n[e]?.envelope;r&&await Nn(r)},cleanup:async e=>{let t=fn()[e];t&&await Pn(t)}},Sn)},$=async()=>(_n=!0,gn||(gn=(async()=>{do _n=!1,await Hn();while(_n)})().finally(()=>{gn=null,_n&&$()}),gn)),Rn=async e=>{if(l()!==e.connectionKey&&await bt(e.connectionKey)!==`connected`)return!1;let t=c();if(!Z(e.connectionKey,t)||o()!==e.transportIdentity||(await d(`/api/config/settings`).catch(()=>void 0),!Z(e.connectionKey,t)||o()!==e.transportIdentity)||!await D.getState().hydrateDraftMetadata(e.transportIdentity)||!Z(e.connectionKey,t)||o()!==e.transportIdentity)return!1;let[n,r]=await Promise.all([E(),se()]);return!Z(e.connectionKey,t)||o()!==e.transportIdentity||!n.supported||!n.enabled||n.serverInstanceID!==e.serverInstanceID||!r.assistants.some(t=>t.id===e.assistantID&&t.enabled)?!1:(an(e.assistantID),!0)},zn=async e=>{let t=l(),n=c();if(await d(`/api/config/settings`).catch(()=>void 0),!Z(t,n))return null;try{let[r,i]=await Promise.all([E(),se()]);return!Z(t,n)||!r.supported||!r.enabled||r.serverInstanceID!==e.serverInstanceID||!i.assistants.some(t=>t.id===e.assistantID&&t.enabled)?null:{runtimeKey:t,generation:n,transportIdentity:o()}}catch{return null}},Bn=async e=>{let t=Object.values(O.getState().assistantCatalogByConnection).find(t=>t.serverInstanceID===e.serverInstanceID&&t.connectionKey===e.connectionKey&&t.entries.some(t=>t.assistantID===e.assistantID));if(!t)return!1;let n=await zn(e);if(!n&&(await bt(t.connectionKey,{transportPreference:`relay`})!==`connected`||(n=await zn(e),!n)))return!1;let{runtimeKey:r,generation:i,transportIdentity:a}=n;if(!await D.getState().hydrateDraftMetadata(a)||!Z(r,i)||o()!==a)return!1;let s=await en(e,{input:D.getState(),transportIdentity:a,cancelDraft:e=>Y.cancelDraft({draftID:e}),readAttachment:Dn});if(!s.durable||!s.cancelled||!Z(r,i)||o()!==a)return!1;let c={draftID:e.draftID,serverInstanceID:e.serverInstanceID,connectionKey:e.connectionKey,assistantID:e.assistantID,transportIdentity:a};return an(e.assistantID),await $t(c,D.getState())&&Qt(c),!0},Vn=e=>{let t=xn.get(e.draftID);if(t)return t;let n=Bn(e).catch(()=>!1).finally(()=>{xn.get(e.draftID)===n&&xn.delete(e.draftID)});return xn.set(e.draftID,n),n},Hn=async()=>{if(S.getPlatform()!==`android`)return;let e=await Zt(e=>Y.cancelDraft({draftID:e}));for(let t of e)try{await Rn(t)&&await $t(t,D.getState())&&Qt(t)}catch{}let t=await Y.listDrafts().catch(()=>null);if(!t)return;let n=[...t?.drafts??[]].sort((e,t)=>e.createdAt-t.createdAt);Cn(n.filter(e=>!It(e)));for(let e of n)It(e)&&await Vn(e)},Un=()=>{let e=(0,ye.c)(11);k.useSyncExternalStore(Tn,En,En);let t=O(Wn),[n,r]=k.useState(null),i=k.useRef(null),a;e[0]===t?a=e[1]:(a=Object.values(t).flatMap(Gn).filter(Kn).sort(qn),e[0]=t,e[1]=a);let o=a,s=vn[0]??null,c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(e,t)=>{i.current||(i.current=e.draftID,r(e.draftID),Vn({...e,serverInstanceID:t.serverInstanceID,assistantID:t.assistantID,name:t.name,avatarSeed:t.avatarSeed,serverLabel:t.serverLabel,connectionKey:t.connectionKey}).then(t=>{t&&wn(e.draftID)}).finally(()=>{i.current===e.draftID&&(i.current=null),r(t=>t===e.draftID?null:t)}))},e[2]=c):c=e[2];let l=T(c),u;e[3]===n?u=e[4]:(u=e=>{n!==e.draftID&&(wn(e.draftID),Y.cancelDraft({draftID:e.draftID}).catch(Jn))},e[3]=n,e[4]=u);let d=T(u),f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],e[5]=f):f=e[5],k.useEffect(rr,f);let p=n===s?.draftID,m;return e[6]!==d||e[7]!==o||e[8]!==l||e[9]!==p?(m=(0,J.jsx)(cn,{draft:s,entries:o,busy:p,onSelect:l,onCancel:d}),e[6]=d,e[7]=o,e[8]=l,e[9]=p,e[10]=m):m=e[10],m};function Wn(e){return e.assistantCatalogByConnection}function Gn(e){return e.entries}function Kn(e){return e.enabled}function qn(e,t){return Number(t.isDefaultShareTarget)-Number(e.isDefaultShareTarget)||e.serverLabel.localeCompare(t.serverLabel)||e.name.localeCompare(t.name)}function Jn(){$()}function Yn(){Q(),$(),q()}function Xn(){Q(),In(),$(),q()}function Zn(){In()}function Qn(){}function $n(){$()}function er(){}function tr(){q()}function nr(){}function rr(){if(!dn())return;Q(),In(),$(),q();let e=a(Yn),t=Xn;window.addEventListener(`yuri:system-resume`,t);let n=!1,r=null,i=null,o=null;return Y.addListener(`shareReceived`,Zn).then(e=>{n?e.remove():r=e}).catch(Qn),Y.addListener(`shareDraftReceived`,$n).then(e=>{n?e.remove():i=e}).catch(er),Y.addListener(`assistantOpenRequested`,tr).then(e=>{n?e.remove():o=e}).catch(nr),()=>{n=!0,e(),window.removeEventListener(`yuri:system-resume`,t),r&&r.remove(),i&&i.remove(),o&&o.remove()}}export{q as a,vt as c,He as d,Ot as f,sn as i,Dt as l,Mn as n,yt as o,Nt as p,Q as r,N as s,Un as t,mt as u};
|