@xopcai/xopc 0.0.276 → 0.0.277

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  3. package/dist/extensions/telegram/xopc.extension.json +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-sj_1IC5H.js → agent-avatar-dicebear-Cavbls0E.js} +1 -1
  5. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DyCyuJpi.js +1 -0
  6. package/dist/gateway/static/root/assets/{agents-CIzev0Qj.js → agents-DlDTItrB.js} +1 -1
  7. package/dist/gateway/static/root/assets/app-management-settings-panel-5gS0_LWl.js +1 -0
  8. package/dist/gateway/static/root/assets/{appearance-settings-BeXvF-dZ.js → appearance-settings-DHzZCJon.js} +1 -1
  9. package/dist/gateway/static/root/assets/apps-page-__yzruGu.js +1 -0
  10. package/dist/gateway/static/root/assets/{archive-plugin-BSgaIIGE.js → archive-plugin-Ia98yZe3.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-CGNt02hP.js → attachment-load-DiWW88c8.js} +1 -1
  12. package/dist/gateway/static/root/assets/{automations-page-DoafJiVA.js → automations-page-BuhTeGRJ.js} +1 -1
  13. package/dist/gateway/static/root/assets/automations-workspace-DaisbmEh.js +6 -0
  14. package/dist/gateway/static/root/assets/{binary-plugins-BsAL26Aq.js → binary-plugins-DDD48cJv.js} +1 -1
  15. package/dist/gateway/static/root/assets/{block-editor-BxB7m8aI.js → block-editor-0AWVCD3F.js} +3 -3
  16. package/dist/gateway/static/root/assets/{browser-automation-inputs-DGCqIPXT.js → browser-automation-inputs-DcVLoIzc.js} +1 -1
  17. package/dist/gateway/static/root/assets/{browser-automations-page-BNsO-Ip2.js → browser-automations-page-BKOYX5xV.js} +2 -2
  18. package/dist/gateway/static/root/assets/browser-settings-page-C7zjxscU.js +8 -0
  19. package/dist/gateway/static/root/assets/{button-B11EPpor.js → button-BA45yciM.js} +1 -1
  20. package/dist/gateway/static/root/assets/capabilities-settings-panel-7kZMT1r6.js +8 -0
  21. package/dist/gateway/static/root/assets/channels-settings-BKUh6hzO.js +1 -0
  22. package/dist/gateway/static/root/assets/{chat-terminal-dock-ZCFwco1W.js → chat-terminal-dock-CW9Byi8V.js} +2 -2
  23. package/dist/gateway/static/root/assets/connectors-page-m8J-F3u8.js +2 -0
  24. package/dist/gateway/static/root/assets/{cron-expression-C26e13YU.js → cron-expression-CjrWuy2m.js} +1 -1
  25. package/dist/gateway/static/root/assets/{date-picker-CpxFfgpg.js → date-picker-gdYmKC8W.js} +1 -1
  26. package/dist/gateway/static/root/assets/{dependency-picker-eCIGAfHa.js → dependency-picker-40BYmiMc.js} +1 -1
  27. package/dist/gateway/static/root/assets/{desktop-pet-_MSZvIDO.js → desktop-pet-By1z6tKE.js} +1 -1
  28. package/dist/gateway/static/root/assets/{desktop-pet-settings-feBnJWkV.js → desktop-pet-settings-ByjJqx9H.js} +1 -1
  29. package/dist/gateway/static/root/assets/device-pairing-wizard-CfWQfz7a.js +1 -0
  30. package/dist/gateway/static/root/assets/{dist-CpzYSoz7.js → dist-BGTk37IG.js} +1 -1
  31. package/dist/gateway/static/root/assets/{dist-DBS3OB8K.js → dist-CI_fqRk-.js} +1 -1
  32. package/dist/gateway/static/root/assets/{dist-DLmwHyAh.js → dist-Che_jiQF.js} +1 -1
  33. package/dist/gateway/static/root/assets/es2015-DBLcMg5B.js +41 -0
  34. package/dist/gateway/static/root/assets/{extension-debug-page-CotBlxJ-.js → extension-debug-page-DQO65KbM.js} +1 -1
  35. package/dist/gateway/static/root/assets/{extension-page-CFBmQ7U3.js → extension-page-Db32jip6.js} +1 -1
  36. package/dist/gateway/static/root/assets/{extension-settings-page-Cd1lfh8z.js → extension-settings-page-CL8Wx8lf.js} +1 -1
  37. package/dist/gateway/static/root/assets/gateway-settings-wLly-Kc1.js +1 -0
  38. package/dist/gateway/static/root/assets/{heartbeat-settings-DRG0u1ON.js → heartbeat-settings-CRXWu2q6.js} +1 -1
  39. package/dist/gateway/static/root/assets/home-page-FqgSwpmy.js +1 -0
  40. package/dist/gateway/static/root/assets/index-5UchbidQ.js +74 -0
  41. package/dist/gateway/static/root/assets/index-CXF9-BpI.css +2 -0
  42. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BLHsdFIQ.js → keyboard-shortcuts-settings-CjehhHPz.js} +1 -1
  43. package/dist/gateway/static/root/assets/local-app-workbench-page-DtYZa4GK.js +2 -0
  44. package/dist/gateway/static/root/assets/{local-apps-page-BjAj1xhq.js → local-apps-page-CrIdaTrK.js} +1 -1
  45. package/dist/gateway/static/root/assets/logs-page-FfSwV_VH.js +2 -0
  46. package/dist/gateway/static/root/assets/{management-settings-CPHxDaOw.js → management-settings-BakV5aOw.js} +1 -1
  47. package/dist/gateway/static/root/assets/{markdown-view-B2IR4E2r.js → markdown-view-DF3aJP_5.js} +4 -4
  48. package/dist/gateway/static/root/assets/{media-plugins-BUOzcXCL.js → media-plugins-Blv9U6Jp.js} +1 -1
  49. package/dist/gateway/static/root/assets/note-detail-panel-JbvyGdEX.js +5 -0
  50. package/dist/gateway/static/root/assets/notes-page-Dm7mE2FK.js +8 -0
  51. package/dist/gateway/static/root/assets/{page-tabs-BgEYFhqS.js → page-tabs-BQfVtLLC.js} +1 -1
  52. package/dist/gateway/static/root/assets/popover-select-DGmMQt4t.js +1 -0
  53. package/dist/gateway/static/root/assets/{preview-open-alternatives-C-pQIx6W.js → preview-open-alternatives-kjHFiO81.js} +1 -1
  54. package/dist/gateway/static/root/assets/{proactive-card-DfjMVJUW.js → proactive-card-Ap_wfos3.js} +1 -1
  55. package/dist/gateway/static/root/assets/{proactive-page-BGVcVsbd.js → proactive-page-D1lEuanT.js} +1 -1
  56. package/dist/gateway/static/root/assets/product-open-page-BazdmFYo.js +1 -0
  57. package/dist/gateway/static/root/assets/project-detail-page-h00lfcVI.js +1 -0
  58. package/dist/gateway/static/root/assets/projects-page-C2Bo1FAL.js +1 -0
  59. package/dist/gateway/static/root/assets/remote-access-hub-_bZYAl49.js +1 -0
  60. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DkAjFJ-9.js → runtime-tools-settings-panel-BhJlopSW.js} +2 -2
  61. package/dist/gateway/static/root/assets/{schema-form-BpDcuSsl.js → schema-form-cxoO_5I1.js} +1 -1
  62. package/dist/gateway/static/root/assets/sessions-page-F7CHsvPa.js +1 -0
  63. package/dist/gateway/static/root/assets/settings-advanced-gate-DtZSUX4H.js +1 -0
  64. package/dist/gateway/static/root/assets/{settings-form-section-RElRijJw.js → settings-form-section-BiRTWiBi.js} +1 -1
  65. package/dist/gateway/static/root/assets/{settings-page-CaixunoA.js → settings-page-D-Cb71pq.js} +1 -1
  66. package/dist/gateway/static/root/assets/setup-status-panel-VPfBsNVv.js +1 -0
  67. package/dist/gateway/static/root/assets/{share-preview-page-CC-bFOTf.js → share-preview-page-DciHfTay.js} +1 -1
  68. package/dist/gateway/static/root/assets/shares-settings-BS2pnWO0.js +1 -0
  69. package/dist/gateway/static/root/assets/{skill-reload-api-CcOtxf53.js → skill-reload-api-DX344nVV.js} +1 -1
  70. package/dist/gateway/static/root/assets/{skills-page-DmRvRxtY.js → skills-page-BhfKUsv7.js} +1 -1
  71. package/dist/gateway/static/root/assets/skills-page.utils-CU7PALQB.js +1 -0
  72. package/dist/gateway/static/root/assets/{system-settings-panel-DRIJ5mXq.js → system-settings-panel-GpjNbqvM.js} +1 -1
  73. package/dist/gateway/static/root/assets/task-detail-page-CElcQ9Sh.js +1 -0
  74. package/dist/gateway/static/root/assets/tunnel-api-Bhi_x_h4.js +1 -0
  75. package/dist/gateway/static/root/assets/{use-autosave-Cq4--C1i.js → use-autosave-LvCiBidm.js} +1 -1
  76. package/dist/gateway/static/root/assets/user-model-page-BydARq2C.js +2 -0
  77. package/dist/gateway/static/root/assets/{voice-api-key-field-CbJ6tKGI.js → voice-api-key-field-BlGysZxj.js} +1 -1
  78. package/dist/gateway/static/root/assets/work-discovery-overlay-DvIQOR5x.js +1 -0
  79. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-vw1229Fh.js → workflow-run-setup-panel-JIp60bXT.js} +2 -2
  80. package/dist/gateway/static/root/assets/workflows-page-B972t6zx.js +6 -0
  81. package/dist/gateway/static/root/index.html +9 -9
  82. package/dist/package.js +1 -1
  83. package/dist/packages/gateway-contract/src/tasks.js +6 -1
  84. package/dist/src/cli/commands/channels.js +1 -1
  85. package/dist/src/cli/commands/connectors.js +1 -1
  86. package/dist/src/cli/commands/extension-marketplace.js +2 -2
  87. package/dist/src/cli/commands/models.js +1 -1
  88. package/dist/src/cli/commands/onboard.js +1 -1
  89. package/dist/src/extensions/sdk/index.js +1 -1
  90. package/dist/src/extensions/update.js +1 -1
  91. package/dist/src/gateway/heartbeat/service.js +1 -1
  92. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  93. package/dist/src/gateway/hono/routes/tasks.js +7 -0
  94. package/dist/src/gateway/service/config-coordinator.js +1 -1
  95. package/dist/src/gateway/service.js +9 -9
  96. package/dist/src/heartbeat/index.js +1 -1
  97. package/dist/src/infra/update-runner.js +1 -1
  98. package/dist/src/notes/service.js +3 -2
  99. package/dist/src/tasks/home-query-service.js +1 -0
  100. package/dist/src/tasks/project-operating-view-service.js +7 -4
  101. package/dist/src/tasks/task-application-service.js +32 -2
  102. package/dist/src/tasks/task-context-assembler.js +6 -3
  103. package/dist/src/tasks/task-read-model-projector.js +7 -5
  104. package/dist/src/tasks/task-run-coordinator.js +2 -0
  105. package/dist/src/tasks/task-run-repository.js +4 -1
  106. package/dist/src/tui/backends/embedded-backend.js +1 -1
  107. package/package.json +2 -2
  108. package/dist/gateway/static/root/assets/agent-defaults-settings-panel-B5MRLEy8.js +0 -1
  109. package/dist/gateway/static/root/assets/app-management-settings-panel-DY3Vwxjq.js +0 -1
  110. package/dist/gateway/static/root/assets/apps-page-Ch_9Ffgk.js +0 -1
  111. package/dist/gateway/static/root/assets/automations-workspace-MACr99IO.js +0 -6
  112. package/dist/gateway/static/root/assets/browser-settings-page-Nvdoi0B1.js +0 -8
  113. package/dist/gateway/static/root/assets/capabilities-settings-panel-BluLJq5I.js +0 -8
  114. package/dist/gateway/static/root/assets/channels-settings-DYxxhcjb.js +0 -1
  115. package/dist/gateway/static/root/assets/connectors-page-Bpcp8UyE.js +0 -2
  116. package/dist/gateway/static/root/assets/device-pairing-wizard-D_fB0fml.js +0 -1
  117. package/dist/gateway/static/root/assets/es2015-BvLh9GaE.js +0 -41
  118. package/dist/gateway/static/root/assets/gateway-settings-BH35C8RI.js +0 -1
  119. package/dist/gateway/static/root/assets/home-page-BlZk-aD4.js +0 -1
  120. package/dist/gateway/static/root/assets/index-CfQor-TM.js +0 -74
  121. package/dist/gateway/static/root/assets/index-DKy1Qn1_.css +0 -2
  122. package/dist/gateway/static/root/assets/local-app-workbench-page-DJd71FlC.js +0 -2
  123. package/dist/gateway/static/root/assets/logs-page-5MWeZ6Ae.js +0 -2
  124. package/dist/gateway/static/root/assets/note-detail-panel-Bch98ut3.js +0 -5
  125. package/dist/gateway/static/root/assets/notes-page-CWO5dQKN.js +0 -8
  126. package/dist/gateway/static/root/assets/popover-select-Dz_Qis2R.js +0 -1
  127. package/dist/gateway/static/root/assets/product-open-page-DsQcgZkI.js +0 -1
  128. package/dist/gateway/static/root/assets/project-detail-page-DZFVirjV.js +0 -1
  129. package/dist/gateway/static/root/assets/projects-page-B2g6inq-.js +0 -1
  130. package/dist/gateway/static/root/assets/remote-access-hub-CbkUOkQY.js +0 -1
  131. package/dist/gateway/static/root/assets/sessions-page--7-w-0WS.js +0 -1
  132. package/dist/gateway/static/root/assets/settings-advanced-gate-BvZrH_sp.js +0 -1
  133. package/dist/gateway/static/root/assets/setup-status-panel-Ul06Y5YX.js +0 -1
  134. package/dist/gateway/static/root/assets/shares-settings-DwV2Wh7S.js +0 -1
  135. package/dist/gateway/static/root/assets/skills-page.utils-CT0-daZD.js +0 -1
  136. package/dist/gateway/static/root/assets/task-detail-page-BQjLHqSk.js +0 -1
  137. package/dist/gateway/static/root/assets/tunnel-api-IvWcgZdD.js +0 -1
  138. package/dist/gateway/static/root/assets/user-model-page-hwc5-nqV.js +0 -2
  139. package/dist/gateway/static/root/assets/work-discovery-overlay-BG2pmXL3.js +0 -1
  140. package/dist/gateway/static/root/assets/workflows-page-DZWpJHDr.js +0 -6
@@ -1 +1 @@
1
- import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./messages-BGc-OJWg.js";import{ea as i}from"./index-CfQor-TM.js";import{t as a}from"./preview-open-alternatives-C-pQIx6W.js";import{t as o}from"./use-blob-object-url-D4BFuzZB.js";var s=t();e();var c=n();function l(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`audio`}),t[0]=e,t[1]=n),n}function u(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`video`}),t[0]=e,t[1]=n),n}function d(e){let t=(0,s.c)(8),{props:n,kind:r}=e,a;bb0:{if(!n.binaryBuffer){a=null;break bb0}let e;if(t[0]!==r||t[1]!==n.binaryBuffer||t[2]!==n.descriptor.fileName||t[3]!==n.descriptor.mimeType){let a=i(n.descriptor.fileName)??n.descriptor.mimeType;e=new Blob([n.binaryBuffer],{type:a||`${r}/*`}),t[0]=r,t[1]=n.binaryBuffer,t[2]=n.descriptor.fileName,t[3]=n.descriptor.mimeType,t[4]=e}else e=t[4];a=e}let l=o(a);if(!l)return null;let u;return t[5]!==r||t[6]!==l?(u=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto bg-surface-base p-4 dark:bg-surface-hover/20`,children:r===`audio`?(0,c.jsx)(`audio`,{src:l,controls:!0,className:`w-full max-w-2xl`}):(0,c.jsx)(`video`,{src:l,controls:!0,playsInline:!0,className:`max-h-full max-w-full rounded-md bg-black`})}),t[5]=r,t[6]=l,t[7]=u):u=t[7],u}function f(e){let t=(0,s.c)(12),n;t[0]===e.language?n=t[1]:(n=r(e.language),t[0]=e.language,t[1]=n);let i=n,o=e.descriptor.context===`workspace`,l=o?`${i.workspace.cannotPreviewType} ${i.workspace.openElsewhereHint}`:i.chat.attachmentPreviewOpenElsewhereHint,u=o?i.workspace.openSystemApp:void 0,d=o?i.workspace.chooseApp:void 0,f;return t[2]!==i.chat.attachmentPreviewDownloadFull||t[3]!==e.actions.canChooseOpenWithApp||t[4]!==e.actions.canOpenWithSystemApp||t[5]!==e.actions.onChooseOpenWithApp||t[6]!==e.actions.onDownload||t[7]!==e.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==d?(f=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:(0,c.jsx)(a,{message:l,downloadLabel:i.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:e.actions.onOpenWithSystemApp,canOpenWithSystemApp:e.actions.canOpenWithSystemApp,chooseAppLabel:d,onChooseOpenWithApp:e.actions.onChooseOpenWithApp,canChooseOpenWithApp:e.actions.canChooseOpenWithApp})}),t[2]=i.chat.attachmentPreviewDownloadFull,t[3]=e.actions.canChooseOpenWithApp,t[4]=e.actions.canOpenWithSystemApp,t[5]=e.actions.onChooseOpenWithApp,t[6]=e.actions.onDownload,t[7]=e.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}export{l as AudioPreviewPluginView,f as UnsupportedPreviewPluginView,u as VideoPreviewPluginView};
1
+ import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./messages-BGc-OJWg.js";import{ea as i}from"./index-5UchbidQ.js";import{t as a}from"./preview-open-alternatives-kjHFiO81.js";import{t as o}from"./use-blob-object-url-D4BFuzZB.js";var s=t();e();var c=n();function l(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`audio`}),t[0]=e,t[1]=n),n}function u(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`video`}),t[0]=e,t[1]=n),n}function d(e){let t=(0,s.c)(8),{props:n,kind:r}=e,a;bb0:{if(!n.binaryBuffer){a=null;break bb0}let e;if(t[0]!==r||t[1]!==n.binaryBuffer||t[2]!==n.descriptor.fileName||t[3]!==n.descriptor.mimeType){let a=i(n.descriptor.fileName)??n.descriptor.mimeType;e=new Blob([n.binaryBuffer],{type:a||`${r}/*`}),t[0]=r,t[1]=n.binaryBuffer,t[2]=n.descriptor.fileName,t[3]=n.descriptor.mimeType,t[4]=e}else e=t[4];a=e}let l=o(a);if(!l)return null;let u;return t[5]!==r||t[6]!==l?(u=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto bg-surface-base p-4 dark:bg-surface-hover/20`,children:r===`audio`?(0,c.jsx)(`audio`,{src:l,controls:!0,className:`w-full max-w-2xl`}):(0,c.jsx)(`video`,{src:l,controls:!0,playsInline:!0,className:`max-h-full max-w-full rounded-md bg-black`})}),t[5]=r,t[6]=l,t[7]=u):u=t[7],u}function f(e){let t=(0,s.c)(12),n;t[0]===e.language?n=t[1]:(n=r(e.language),t[0]=e.language,t[1]=n);let i=n,o=e.descriptor.context===`workspace`,l=o?`${i.workspace.cannotPreviewType} ${i.workspace.openElsewhereHint}`:i.chat.attachmentPreviewOpenElsewhereHint,u=o?i.workspace.openSystemApp:void 0,d=o?i.workspace.chooseApp:void 0,f;return t[2]!==i.chat.attachmentPreviewDownloadFull||t[3]!==e.actions.canChooseOpenWithApp||t[4]!==e.actions.canOpenWithSystemApp||t[5]!==e.actions.onChooseOpenWithApp||t[6]!==e.actions.onDownload||t[7]!==e.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==d?(f=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:(0,c.jsx)(a,{message:l,downloadLabel:i.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:e.actions.onOpenWithSystemApp,canOpenWithSystemApp:e.actions.canOpenWithSystemApp,chooseAppLabel:d,onChooseOpenWithApp:e.actions.onChooseOpenWithApp,canChooseOpenWithApp:e.actions.canChooseOpenWithApp})}),t[2]=i.chat.attachmentPreviewDownloadFull,t[3]=e.actions.canChooseOpenWithApp,t[4]=e.actions.canOpenWithSystemApp,t[5]=e.actions.onChooseOpenWithApp,t[6]=e.actions.onDownload,t[7]=e.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}export{l as AudioPreviewPluginView,f as UnsupportedPreviewPluginView,u as VideoPreviewPluginView};
@@ -0,0 +1,5 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-0AWVCD3F.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-5UchbidQ.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-CI_fqRk-.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-DF3aJP_5.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-Cq1tE_3b.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/locale-store-BkJ7g35d.js","assets/messages-BGc-OJWg.js","assets/cn-JdwAhgNB.js","assets/app-link-BiBXVEvp.js","assets/product-delivery-CCC4FJ3Y.js","assets/schemas-BaskVM5g.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-Y68dCxuc.css","assets/dist-Che_jiQF.js","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/popover-select-DGmMQt4t.js","assets/skeleton-BwbyijEw.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/settings-shell-layer-context-DCp6ykjQ.js","assets/circle-check-C23XjkUj.js","assets/clock-3-DnrAnuyZ.js","assets/copy-Dv6d4Dvw.js","assets/external-link-DjqjBmc3.js","assets/git-branch-Dh9uxTot.js","assets/globe-DSSGFWFn.js","assets/loader-circle-CifKLtgG.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/middleware-Pd0e8Igk.js","assets/files-Be5viEFY.js","assets/tool-activity-R8V9l6nk.js","assets/button-BA45yciM.js","assets/registry-api-CTq8EECj.js","assets/gateway-startup-retry-CVTa5HSS.js","assets/config-reload-event-Bjh2zoKp.js","assets/gateway-config-swr-cd8owslz.js","assets/electron-env-DH5wF8X8.js","assets/activity-store-SJZ5fS17.js","assets/theme-store-mV6Cm2vj.js","assets/index-CXF9-BpI.css","assets/vendor-codemirror-DFxP3B9T.js","assets/with-selector-aYPsXwdl.js","assets/block-editor-D4ZIVQbk.css","assets/markdown-editor-BhBJANcx.js","assets/code-editor-CXIH8jQw.js","assets/languages-BFe8nIOO.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{d as a}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{t as o}from"./check-DUBLcKHA.js";import{n as s,r as c}from"./popover-select-DGmMQt4t.js";import{t as l}from"./circle-check-C23XjkUj.js";import{t as u}from"./copy-Dv6d4Dvw.js";import{t as d}from"./external-link-DjqjBmc3.js";import{t as f}from"./loader-circle-CifKLtgG.js";import{t as p}from"./message-circle-Badhj-4D.js";import{t as m}from"./x-B_N4OPjy.js";import{t as h}from"./cn-JdwAhgNB.js";import{f as g,n as _}from"./locale-store-BkJ7g35d.js";import{t as v}from"./messages-BGc-OJWg.js";import{a as y,i as b,n as x,o as S,r as C,s as w,t as T}from"./dist-BGTk37IG.js";import{t as E}from"./copy-to-clipboard-HOJ79TWv.js";import{i as D}from"./vendor-swr-BIWyz7Rc.js";import{t as O}from"./button-BA45yciM.js";import{i as k}from"./theme-store-mV6Cm2vj.js";import{t as A}from"./skeleton-BwbyijEw.js";import{An as j,Au as M,Bl as N,Cn as P,Ei as F,En as I,Fl as L,Gn as R,Gs as z,In as ee,Jn as te,Ki as ne,Kn as re,Ks as ie,Ln as ae,Mc as B,Mn as oe,Nn as se,On as ce,Pn as V,Si as le,Sn as ue,Ti as de,Tn as fe,To as pe,Un as H,Us as me,Vl as U,Wc as he,Wn as ge,Ws as _e,Xl as ve,Xn as ye,Xt as be,a as xe,al as Se,ar as Ce,bc as W,bn as we,c as G,co as Te,ec as K,er as q,fu as Ee,hc as De,ic as Oe,jn as ke,ju as Ae,kn as je,l as Me,nr as Ne,o as Pe,or as Fe,qn as J,rr as Ie,s as Y,tr as Le,uc as Re,vi as ze,wn as Be,xl as Ve,xn as He,yi as Ue,yn as We,yt as Ge,zn as Ke}from"./index-5UchbidQ.js";var X=n(),Z=e(t(),1),Q=r(),qe=(0,Z.createContext)(null);function Je(){let e=(0,X.c)(1),t=(0,Z.useContext)(qe);if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={openImage:Ye},e[0]=t):t=e[0],t}return t}function Ye(){}function Xe(e){let t=(0,X.c)(22),{children:n,closeLabel:r}=e,i=r===void 0?`Close`:r,[a,o]=(0,Z.useState)(null),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(e,t)=>{o({src:e,alt:t})},t[0]=s):s=t[0];let c=s,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={openImage:c},t[1]=l):l=t[1];let u=l,d=a!==null,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{e||o(null)},t[2]=f):f=t[2];let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(y,{className:`fixed inset-0 z-[70] bg-scrim/90 backdrop-blur-sm`}),t[3]=p):p=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=h(`fixed inset-0 z-[71] flex items-center justify-center p-4 outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`),t[4]=g):g=t[4];let _=a?.alt||`Image preview`,v;t[5]===_?v=t[6]:(v=(0,Q.jsx)(w,{className:`sr-only`,children:_}),t[5]=_,t[6]=v);let b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(m,{className:`size-5`,"aria-hidden":!0}),t[7]=b):b=t[7];let E;t[8]===i?E=t[9]:(E=(0,Q.jsx)(x,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":i,className:`absolute right-4 top-4 z-10 rounded-lg bg-surface-panel/80 p-2 text-fg-muted backdrop-blur transition-colors hover:bg-surface-hover hover:text-fg`,children:b})}),t[8]=i,t[9]=E);let D;t[10]===a?D=t[11]:(D=a?(0,Q.jsx)(`img`,{src:a.src,alt:a.alt??``,className:`max-h-[min(90vh,900px)] max-w-[min(95vw,1200px)] rounded-lg object-contain shadow-lg`}):null,t[10]=a,t[11]=D);let O;t[12]!==E||t[13]!==D||t[14]!==v?(O=(0,Q.jsxs)(S,{children:[p,(0,Q.jsxs)(C,{className:g,"aria-describedby":void 0,children:[v,E,D]})]}),t[12]=E,t[13]=D,t[14]=v,t[15]=O):O=t[15];let k;t[16]!==O||t[17]!==d?(k=(0,Q.jsx)(T,{open:d,onOpenChange:f,children:O}),t[16]=O,t[17]=d,t[18]=k):k=t[18];let A;return t[19]!==n||t[20]!==k?(A=(0,Q.jsxs)(qe.Provider,{value:u,children:[n,k]}),t[19]=n,t[20]=k,t[21]=A):A=t[21],A}var $=6e4,Ze=36e5,Qe=864e5;function $e(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function et(e,t,n){let r=t-e;if(r<$)return n.justNow;if(r<Ze){let e=Math.floor(r/$);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=$e(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(e>=i-Qe)return n.yesterday+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(r<7*Qe){let e=Math.floor(r/Qe);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(n.locale,{month:`short`,day:`numeric`})}function tt(e,t,n){let r=$e(t);if(e>=r)return n.today;if(e>=r-Qe)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(n.locale,{month:`long`,day:`numeric`}):i.toLocaleDateString(n.locale,{year:`numeric`,month:`long`,day:`numeric`})}function nt(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function rt(e){let t=(0,X.c)(45),{title:n,description:r,prompt:i,coverage:o,className:s,variant:c}=e,u=c===void 0?`card`:c,d=_(ot),f=v(d).automations.suggestions,p=v(d).automations,m=a(),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1,refreshInterval:15e3},t[0]=g):g=t[0];let{data:y}=D(o?`automation-suggestion-coverage`:null,at,g),b=o?y?.automations.find(e=>G(e,o)):void 0,x=b?Pe(b,p):[];if(u===`titleAction`){if(b){let e;t[1]===s?e=t[2]:(e=h(`flex min-w-0 items-center gap-2 rounded-lg border border-emerald-500/25 bg-emerald-500/10 px-2.5 py-1.5`,s),t[1]=s,t[2]=e);let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(l,{className:`size-3.5 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[3]=n):n=t[3];let r;return t[4]===m?r=t[5]:(r=()=>m(`/automations`),t[4]=m,t[5]=r),(0,Q.jsxs)(`section`,{className:e,children:[n,(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,children:f.coveredTitle}),(0,Q.jsx)(O,{variant:`ghost`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:r,children:f.manage})]})}let e;t[6]===s?e=t[7]:(e=h(`flex min-w-0 items-center gap-2 rounded-lg bg-surface-panel px-2.5 py-1.5 shadow-surface`,s),t[6]=s,t[7]=e);let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(Se,{className:`size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),t[8]=a):a=t[8];let o;t[9]!==r||t[10]!==n?(o=(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,title:r,children:n}),t[9]=r,t[10]=n,t[11]=o):o=t[11];let c;t[12]!==m||t[13]!==i?(c=()=>{m(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[12]=m,t[13]=i,t[14]=c):c=t[14];let u;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(Oe,{className:`size-3.5`,"aria-hidden":!0}),t[15]=u):u=t[15],(0,Q.jsxs)(`section`,{className:e,children:[a,o,(0,Q.jsxs)(O,{variant:`secondary`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:c,children:[u,f.setup]})]})}if(b){let e;t[16]===s?e=t[17]:(e=h(`rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-3`,s),t[16]=s,t[17]=e);let n;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(l,{className:`mt-0.5 size-4 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[18]=n):n=t[18];let r;t[19]===m?r=t[20]:(r=()=>m(`/automations`),t[19]=m,t[20]=r);let i;return t[21]!==f||t[22]!==r?(i=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsx)(O,{variant:`ghost`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:r,children:f.manage})}),t[21]=f,t[22]=r,t[23]=i):i=t[23],(0,Q.jsxs)(`section`,{className:e,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:f.coveredTitle}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:Y(f.coveredDescription,{name:b.name})})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 rounded-md bg-surface-base/55 px-2.5 py-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg`,children:p.explain.whyCovered}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:x.map(it)})]}),i]})}let S;t[24]===s?S=t[25]:(S=h(`rounded-lg bg-surface-panel p-3 shadow-surface`,s),t[24]=s,t[25]=S);let C;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(Se,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[26]=C):C=t[26];let w;t[27]===n?w=t[28]:(w=(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[27]=n,t[28]=w);let T;t[29]===r?T=t[30]:(T=(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:r}),t[29]=r,t[30]=T);let E;t[31]!==w||t[32]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[C,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[w,T]})]}),t[31]=w,t[32]=T,t[33]=E):E=t[33];let k;t[34]!==m||t[35]!==i?(k=()=>{m(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[34]=m,t[35]=i,t[36]=k):k=t[36];let A;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(Oe,{className:`size-3.5`,"aria-hidden":!0}),t[37]=A):A=t[37];let j;t[38]!==f.create||t[39]!==k?(j=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsxs)(O,{variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:k,children:[A,f.create]})}),t[38]=f.create,t[39]=k,t[40]=j):j=t[40];let M;return t[41]!==j||t[42]!==S||t[43]!==E?(M=(0,Q.jsxs)(`section`,{className:S,children:[E,j]}),t[41]=j,t[42]=S,t[43]=E,t[44]=M):M=t[44],M}function it(e){return(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function at(){return Me.list()}function ot(e){return e.language}function st(e){let t=(0,X.c)(4),{values:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.map(ct),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:r}),t[2]=r,t[3]=i),i}function ct(e,t){return(0,Q.jsx)(`li`,{children:e},`${t}:${e}`)}function lt(e){let t=(0,X.c)(10),{noteId:n,attachmentId:r,label:i,unavailableLabel:a}=e,[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(!1),u,d;if(t[0]!==r||t[1]!==n?(u=()=>{let e=!1,t=!1;return s(null),l(!1),Ce(n,r).then(i=>{if(e=!0,t){Fe(n,r);return}s(i)}).catch(()=>{t||l(!0)}),()=>{t=!0,e&&Fe(n,r)}},d=[r,n],t[0]=r,t[1]=n,t[2]=u,t[3]=d):(u=t[2],d=t[3]),(0,Z.useEffect)(u,d),c){let e;return t[4]===a?e=t[5]:(e=(0,Q.jsx)(`p`,{className:`text-xs text-danger`,children:a}),t[4]=a,t[5]=e),e}if(!o){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(A,{className:`h-10 w-full max-w-md`}),t[6]=e):e=t[6],e}let f;return t[7]!==i||t[8]!==o?(f=(0,Q.jsx)(`audio`,{controls:!0,preload:`metadata`,src:o,className:`w-full max-w-md`,"aria-label":i}),t[7]=i,t[8]=o,t[9]=f):f=t[9],f}function ut(e){let t=(0,X.c)(39),{noteId:n}=e,r=v(_(pt)).notes.discussionCapture,i,a;t[0]===n?(i=t[1],a=t[2]):(i=[`note-discussion-document`,n],a=()=>be(n),t[0]=n,t[1]=i,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o={revalidateOnFocus:!1},t[3]=o):o=t[3];let{data:s,mutate:c}=D(i,a,o),u,d;if(t[4]===c?(u=t[5],d=t[6]):(u=()=>{let e=e=>{let t=e.detail;t&&c(e=>{if(!e||e.discussion.id!==t.discussionId)return e;let n=e.transcript.segments.filter(e=>e.sequence!==t.segment.sequence).concat(t.segment).sort(ft);return{...e,discussion:{...e.discussion,transcriptRevision:t.transcriptRevision},transcript:{...e.transcript,revision:t.transcriptRevision,segments:n,text:t.text,stats:t.stats}}},{revalidate:!1})},t=()=>void c();return window.addEventListener(`discussion-segment-updated`,e),window.addEventListener(`discussion-updated`,t),()=>{window.removeEventListener(`discussion-segment-updated`,e),window.removeEventListener(`discussion-updated`,t)}},d=[c],t[4]=c,t[5]=u,t[6]=d),(0,Z.useEffect)(u,d),!s)return null;let{discussion:f,transcript:p}=s,m=s.organization?.organization,h=[`stopping`,`sealing`,`organizing`].includes(f.status),g=p.stats.uploaded+p.stats.transcribing,y=p.stats.failed>0?r.failedSegments.replace(`{{count}}`,String(p.stats.failed)):g>0?r.processingSegments.replace(`{{count}}`,String(g)):h?r.finalizing:f.status===`completed`?r.transcriptReady:null,b;t[7]!==r.actionItems||t[8]!==r.decisions||t[9]!==r.openQuestions||t[10]!==r.organization||t[11]!==r.risks||t[12]!==m?(b=m?(0,Q.jsxs)(`section`,{className:`border-b border-edge-subtle px-6 py-5`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-accent-fg`,children:[(0,Q.jsx)(Oe,{className:`size-4`,"aria-hidden":!0}),r.organization]}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:m.summary}),(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-4 text-sm leading-6 text-fg sm:grid-cols-2 xl:grid-cols-1`,children:[m.decisions.length>0?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`font-medium`,children:r.decisions}),(0,Q.jsx)(st,{values:m.decisions})]}):null,m.actionItems.length>0?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`font-medium`,children:r.actionItems}),(0,Q.jsx)(st,{values:m.actionItems.map(dt)})]}):null,m.risks.length>0?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`font-medium`,children:r.risks}),(0,Q.jsx)(st,{values:m.risks})]}):null,m.openQuestions.length>0?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`font-medium`,children:r.openQuestions}),(0,Q.jsx)(st,{values:m.openQuestions})]}):null]})]}):null,t[7]=r.actionItems,t[8]=r.decisions,t[9]=r.openQuestions,t[10]=r.organization,t[11]=r.risks,t[12]=m,t[13]=b):b=t[13];let x;t[14]!==r.recordingAudio||t[15]!==r.recordingUnavailable||t[16]!==f.audioAttachmentId||t[17]!==n?(x=f.audioAttachmentId?(0,Q.jsxs)(`section`,{className:`border-b border-edge-subtle px-6 py-4`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,Q.jsx)(he,{className:`size-4 text-accent`,"aria-hidden":!0}),r.recordingAudio]}),(0,Q.jsx)(lt,{noteId:n,attachmentId:f.audioAttachmentId,label:r.recordingAudio,unavailableLabel:r.recordingUnavailable})]}):null,t[14]=r.recordingAudio,t[15]=r.recordingUnavailable,t[16]=f.audioAttachmentId,t[17]=n,t[18]=x):x=t[18];let S;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(he,{className:`size-4 text-accent`,"aria-hidden":!0}),t[19]=S):S=t[19];let C=f.status===`recording`?r.draftTranscript:r.fullTranscript,w;t[20]===C?w=t[21]:(w=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[S,C]}),t[20]=C,t[21]=w);let T;t[22]===f.status?T=t[23]:(T=f.status===`needs_attention`?(0,Q.jsx)(me,{className:`size-3.5 text-danger`}):f.status===`completed`?(0,Q.jsx)(l,{className:`size-3.5 text-success`}):null,t[22]=f.status,t[23]=T);let E=f.status===`needs_attention`?f.failureMessage:y,O;t[24]!==T||t[25]!==E?(O=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-fg-muted`,children:[T,E]}),t[24]=T,t[25]=E,t[26]=O):O=t[26];let k;t[27]!==w||t[28]!==O?(k=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[w,O]}),t[27]=w,t[28]=O,t[29]=k):k=t[29];let A=p.text||r.waitingTranscript,j;t[30]===A?j=t[31]:(j=(0,Q.jsx)(`div`,{className:`mt-3 max-h-48 overflow-y-auto whitespace-pre-wrap text-sm leading-6 text-fg-muted xl:max-h-none xl:overflow-visible`,children:A}),t[30]=A,t[31]=j);let M;t[32]!==k||t[33]!==j?(M=(0,Q.jsxs)(`section`,{className:`px-6 py-4`,children:[k,j]}),t[32]=k,t[33]=j,t[34]=M):M=t[34];let N;return t[35]!==M||t[36]!==b||t[37]!==x?(N=(0,Q.jsxs)(`aside`,{className:`max-h-[45%] shrink-0 overflow-y-auto border-b border-edge-subtle xl:h-full xl:max-h-none xl:w-[clamp(20rem,34%,27rem)] xl:border-r xl:border-b-0`,children:[b,x,M]}),t[35]=M,t[36]=b,t[37]=x,t[38]=N):N=t[38],N}function dt(e){return e.title}function ft(e,t){return e.sequence-t.sequence}function pt(e){return e.language}var mt={edit:B,ai_edit:Oe,sync:W,restore:Ae};function ht(e,t){return{edit:t.triggerEdit,ai_edit:t.triggerAiEdit,sync:t.triggerSync,restore:t.triggerRestore}[e]??e}function gt({noteId:e,activeTimestamp:t,onSelect:n,onClose:r,onRestored:i}){let a=_(e=>e.language),o=v(a).notes,s={justNow:o.justNow,minutesAgo:o.minutesAgo,today:o.today,yesterday:o.yesterday,daysAgo:o.daysAgo,locale:g(a)},{data:c}=D(e?[`note-history`,e]:null,()=>V(e)),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[p,y]=(0,Z.useState)(null),b=(0,Z.useCallback)(async t=>{u(!0),y(null);try{await J(e,t),f(null),i()}catch{y(o.restoreFailed)}finally{u(!1)}},[e,o.restoreSuccess,o.restoreFailed,i]),x=Date.now();return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,Q.jsx)(Ve,{className:`size-4`,"aria-hidden":!0}),o.history]}),(0,Q.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg p-1 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(m,{className:`size-4`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[p?(0,Q.jsx)(`p`,{className:`border-b border-danger/20 bg-danger-soft px-4 py-2 text-xs text-danger`,role:`alert`,children:p}):null,c?.length?(0,Q.jsx)(`ul`,{className:`divide-y divide-edge`,children:c.map(e=>{let r=mt[e.trigger]??B,i=t===e.timestamp,a=d===e.timestamp;return(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:h(`w-full px-4 py-3 text-left transition-colors`,i?`bg-accent/10`:`hover:bg-surface-hover`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(r,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:ht(e.trigger,o)}),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:et(e.timestamp,x,s)})]}),e.snippet&&(0,Q.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted/60`,children:e.snippet})]}),i&&(0,Q.jsx)(`div`,{className:`border-t border-edge/50 px-4 py-2`,children:a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:o.restoreConfirm}),(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),b(e.timestamp)},disabled:l,className:`shrink-0 rounded-lg bg-accent px-3 py-1 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:opacity-50`,children:l?`...`:o.restore}),(0,Q.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f(null)},className:`shrink-0 rounded-lg px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover`,children:`Cancel`})]}):(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),f(e.timestamp)},className:`rounded-lg bg-surface-hover px-3 py-1 text-xs font-medium text-fg transition-colors hover:bg-accent hover:text-on-accent`,children:o.restore})})]},e.timestamp)})}):(0,Q.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:o.historyEmpty}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted/60`,children:o.historyEmptyDescription})]})]})]})}function _t({noteId:e,note:t,catalyzing:n,onCatalyze:r,onClose:i,noteThreads:o,openingChat:s,onOpenChat:c,onOpenNewChat:l}){let u=v(_(e=>e.language)).notes,d=a(),f=t?.aiDeep?.catalysis,m=f?.report??null,[g,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(!1),{data:S,mutate:C,isLoading:w}=D(e?[`note-agent-context-status`,e]:null,()=>ke(e),{revalidateOnFocus:!1}),T=(0,Z.useCallback)(async()=>{if(!b){x(!0),y(null);try{await C(()=>H(e),{revalidate:!1})}catch(e){y(`${u.contextRebuildFailed}: ${e instanceof Error?e.message:u.quickCaptureFailedHint}`)}finally{x(!1)}}},[b,C,u.contextRebuildFailed,u.quickCaptureFailedHint,e]),E=(0,Z.useCallback)(async t=>{try{await ge(e,t)}catch{}},[e]);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Oe,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:u.catalysisSectionTitle})]}),(0,Q.jsx)(`button`,{type:`button`,onClick:i,"aria-label":u.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(M,{className:`size-4 rotate-180`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,Q.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-fg-muted`,children:u.catalysisSectionDescription}),S?(0,Q.jsxs)(`section`,{className:`mb-4 rounded-xl bg-surface-base p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.contextStatusTitle}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void T(),disabled:w||b,className:`rounded-md px-1.5 py-0.5 text-[11px] font-medium text-accent transition-colors hover:bg-accent/10 disabled:cursor-not-allowed disabled:opacity-50`,children:b?u.processing:u.contextRebuild}),(0,Q.jsx)(`span`,{className:h(`rounded-full px-2 py-0.5 text-[11px] font-medium`,S.status===`ready`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`:S.status===`partial`?`bg-amber-500/10 text-amber-600 dark:text-amber-300`:`bg-red-500/10 text-red-600 dark:text-red-300`),children:S.status})]}),(0,Q.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:u.contextStatusDetail.replace(`{{attachments}}`,String(S.attachments.length)).replace(`{{tokens}}`,String(S.tokenEstimate??0))}),g?(0,Q.jsx)(`p`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:g}):null,S.attachments.length>0?(0,Q.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:S.attachments.slice(0,5).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-hover px-2 py-1.5 text-xs`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:e.status})]},e.attachmentId))}):null]}):null,(0,Q.jsx)(`button`,{type:`button`,onClick:r,disabled:n,className:`w-full rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:n?u.processing:m?u.recatalyze:u.catalyzeAction}),m?(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.valueHypothesis}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:m.valueHypothesis})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.targetUsers}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:m.targetUsers.slice(0,5).map(e=>(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.keyQuestions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:m.keyQuestions.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.mvpPathLabel}),(0,Q.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:m.mvpPath.slice(0,3).map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-fg-muted`,children:[t+1,`.`]}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.risks}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:m.risks.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-fg-muted`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.nextActions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:m.nextActions.slice(0,4).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`rounded bg-accent/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-accent`,children:e.kind}),(0,Q.jsx)(`span`,{children:e.text})]},`${e.kind}:${e.text}`))})]}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:u.confidenceLabel.replace(`{{percent}}`,String(Math.round(m.confidence*100)))}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void E(`helpful`),className:h(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackHelpfulAria,children:(0,Q.jsx)(z,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void E(`not_helpful`),className:h(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackNotHelpfulAria,children:(0,Q.jsx)(ie,{className:`size-3.5`,"aria-hidden":!0})})]})]})]}):(0,Q.jsx)(`div`,{className:`mt-4 rounded-lg border border-dashed border-edge-subtle px-3 py-6 text-center text-sm text-fg-muted`,children:u.noCatalysisReportHint}),(0,Q.jsxs)(`section`,{className:`mt-6 rounded-xl bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,Q.jsx)(p,{className:`size-4 text-accent`,"aria-hidden":!0}),u.relatedThreadsTitle]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:u.relatedThreadsDescription})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:c,disabled:s,className:`rounded-lg border border-edge px-2.5 py-1.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,children:s?u.openingChat:u.openThread}),(0,Q.jsx)(`button`,{type:`button`,onClick:l,disabled:s,className:`rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:u.newThread})]})]}),o.length>0?(0,Q.jsx)(`div`,{className:`space-y-2`,children:o.slice(0,5).map(e=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>d(`/chat/${encodeURIComponent(e.key)}`),className:`w-full rounded-lg border border-edge-subtle px-3 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.name||u.noteDiscussionFallback}),(0,Q.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:u.messageCount.replace(`{{count}}`,String(e.messageCount??0))})]},e.key))}):(0,Q.jsx)(`div`,{className:`rounded-lg border border-dashed border-edge-subtle px-3 py-5 text-center text-sm text-fg-muted`,children:u.noThreads})]})]})]})}var vt=[{value:`86400000`,zh:`24 小时`,en:`24 hours`},{value:`604800000`,zh:`7 天`,en:`7 days`},{value:`2592000000`,zh:`30 天`,en:`30 days`}];function yt({open:e,onOpenChange:t,note:n}){let r=_(e=>e.language)===`zh`,i=r?Ct:wt,{data:a,mutate:l}=D(e?[`note-shares`,n.id]:null,()=>ee(n.id)),p=D(e?`hosted-share-auth-status`:null,le),h=p.data===!0,g=D(e&&h?`hosted-publication-capabilities`:null,Ue),v=g.data?.publishing.allowed===!0,k=D(e&&h?[`hosted-note-publications`,n.id]:null,()=>se(n.id)),[A,j]=(0,Z.useState)(new Set),[M,N]=(0,Z.useState)(`86400000`),[P,L]=(0,Z.useState)(``),[z,te]=(0,Z.useState)(``),[ne,ie]=(0,Z.useState)(`hosted`),[ae,B]=(0,Z.useState)(!1),[oe,V]=(0,Z.useState)(null),[ue,fe]=(0,Z.useState)(null),[pe,H]=(0,Z.useState)(!1),[me,U]=(0,Z.useState)(null),he=(0,Z.useMemo)(()=>{let e=new Set;return n.markdown.replace(/xopc-attachment:\/\/notes\/([^/]+)\/([^\s)]+)/gi,(t,r,i)=>{try{decodeURIComponent(r)===n.id&&e.add(decodeURIComponent(i))}catch{}return t}),(n.attachments??[]).filter(t=>e.has(t.id))},[n.attachments,n.id,n.markdown]);(0,Z.useEffect)(()=>{e&&(j(new Set(he.map(e=>e.id))),fe(null),H(!1),U(null))},[e,he]);let ge=async()=>{B(!0),U(null);try{let e={expectedNoteVersion:n.updatedAt,attachmentIds:[...A],ttlMs:Number(M),maxViews:P.trim()?Number(P):null,description:z.trim()||void 0};ne===`hosted`?(fe((await I(n.id,e)).shareUrl),await k.mutate()):(fe((await ce(n.id,e)).payload.shareUrl),await l())}catch(e){U(e instanceof Error?e.message:String(e))}finally{B(!1)}},_e=async(e,t)=>{V(e.id),U(null);try{t===`refresh`?await R(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...A]}):await de(e.id),await k.mutate()}catch(e){U(e instanceof Error?e.message:String(e))}finally{V(null)}},ve=async(e,t)=>{V(e.id),U(null);try{t===`refresh`?await re(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[...A]}):t===`extend`?await ze(e.id,864e5):await F(e.id),await l()}catch(e){U(e instanceof Error?e.message:String(e))}finally{V(null)}},ye=async e=>{U(null);try{if(!await E(e)){H(!1),U(i.copyFailed);return}H(!0),window.setTimeout(()=>H(!1),1500)}catch{H(!1),U(i.copyFailed)}};return(0,Q.jsx)(T,{open:e,onOpenChange:t,children:(0,Q.jsxs)(S,{children:[(0,Q.jsx)(y,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(C,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-popover outline-none`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between border-b border-edge px-5 py-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(w,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,Q.jsx)(Re,{className:`size-4`}),i.title]}),(0,Q.jsx)(b,{className:`mt-1 text-xs text-fg-muted`,children:i.description})]}),(0,Q.jsx)(x,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-fg-muted hover:bg-surface-hover`,"aria-label":i.close,children:(0,Q.jsx)(m,{className:`size-4`})})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,Q.jsxs)(`section`,{className:`rounded-lg border border-edge-subtle bg-surface-subtle p-4`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.title||i.untitled}),(0,Q.jsx)(`p`,{className:`mt-2 line-clamp-4 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,children:n.markdown||i.empty}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:i.privateExcluded})]}),he.length>0?(0,Q.jsxs)(`section`,{className:`mt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.attachments}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:he.map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center gap-3 rounded-lg border border-edge-subtle px-3 py-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:A.has(e.id),onChange:()=>j(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),className:`accent-accent`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:St(e.size)})]},e.id))})]}):null,(0,Q.jsxs)(`section`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.delivery,(0,Q.jsxs)(s,{value:ne,onChange:e=>ie(e.target.value),children:[(0,Q.jsx)(c,{value:`hosted`,children:i.deliveryHosted}),(0,Q.jsx)(c,{value:`local`,children:i.deliveryLocal})]})]}),ne===`hosted`&&p.data===!1?(0,Q.jsx)(`div`,{className:`sm:col-span-2`,children:(0,Q.jsx)(Ge,{providerId:`xopc-share`,displayName:`XOPC Hosted Share`,connected:!1,onConnected:()=>void p.mutate(!0,{revalidate:!1})})}):null,ne===`hosted`&&h&&g.data&&!v?(0,Q.jsx)(`p`,{className:`rounded-lg border border-warning/30 bg-warning-soft px-3 py-2 text-xs text-warning sm:col-span-2`,children:i.hostedDisabled}):null,(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.expires,(0,Q.jsx)(s,{value:M,onChange:e=>N(e.target.value),children:vt.map(e=>(0,Q.jsx)(c,{value:e.value,children:r?e.zh:e.en},e.value))})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.maxViews,(0,Q.jsx)(`input`,{type:`number`,min:1,max:1e3,value:P,onChange:e=>L(e.target.value),placeholder:i.unlimited,className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.publicDescription,(0,Q.jsx)(`input`,{value:z,onChange:e=>te(e.target.value),className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]})]}),ue?(0,Q.jsx)(`div`,{className:`mt-5 rounded-lg border border-success/25 bg-success-soft p-3`,children:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(`input`,{readOnly:!0,value:ue,className:`min-w-0 flex-1 bg-transparent text-xs text-fg outline-none`}),(0,Q.jsxs)(O,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void ye(ue),children:[pe?(0,Q.jsx)(o,{className:`size-4`}):(0,Q.jsx)(u,{className:`size-4`}),pe?i.copied:i.copy]}),(0,Q.jsxs)(O,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>window.open(ue,`_blank`,`noopener,noreferrer`),children:[(0,Q.jsx)(d,{className:`size-4`}),i.open]})]})}):null,me?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,children:me}):null,(a?.items.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.activeLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:a.items.map(e=>(0,Q.jsx)(xt,{share:e,busy:oe===e.id,t:i,onCopy:ye,onAction:ve},e.id))})]}):null,(k.data?.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.hostedLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:k.data.map(e=>(0,Q.jsx)(bt,{publication:e,stale:e.source?.version!==String(n.updatedAt),busy:oe===e.id,publishingAllowed:v,t:i,onCopy:ye,onAction:_e},e.id))})]}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,Q.jsx)(x,{asChild:!0,children:(0,Q.jsx)(O,{type:`button`,variant:`ghost`,children:i.close})}),(0,Q.jsxs)(O,{type:`button`,onClick:()=>void ge(),disabled:ae||ne===`hosted`&&(!h||!v),children:[ae?(0,Q.jsx)(f,{className:`size-4 animate-spin`}):(0,Q.jsx)(Re,{className:`size-4`}),ae?i.creating:i.create]})]})]})]})})}function bt(e){let t=(0,X.c)(64),{publication:n,stale:r,busy:i,publishingAllowed:a,t:o,onCopy:s,onAction:c}=e,l=n.revoked||n.expired,p=l&&`opacity-60`,m;t[0]===p?m=t[1]:(m=h(`rounded-lg border border-edge-subtle p-3`,p),t[0]=p,t[1]=m);let g=r&&!l?o.stale:l?o.inactive:o.active,_;t[2]===g?_=t[3]:(_=(0,Q.jsx)(`span`,{children:g}),t[2]=g,t[3]=_);let v;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`span`,{children:`·`}),t[4]=v):v=t[4];let y=n.maxViews===null?``:` / ${n.maxViews}`,b;t[5]!==n.viewCount||t[6]!==o.views||t[7]!==y?(b=(0,Q.jsxs)(`span`,{children:[o.views,` `,n.viewCount,y]}),t[5]=n.viewCount,t[6]=o.views,t[7]=y,t[8]=b):b=t[8];let x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(`span`,{children:`·`}),t[9]=x):x=t[9];let S;t[10]!==n.revision||t[11]!==o.revision?(S=(0,Q.jsxs)(`span`,{children:[o.revision,` `,n.revision]}),t[10]=n.revision,t[11]=o.revision,t[12]=S):S=t[12];let C;t[13]!==_||t[14]!==b||t[15]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[_,v,b,x,S]}),t[13]=_,t[14]=b,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.shareUrl?w=t[18]:(w=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[17]=n.shareUrl,t[18]=w);let T;t[19]!==C||t[20]!==w?(T=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[C,w]}),t[19]=C,t[20]=w,t[21]=T):T=t[21];let E;t[22]===i?E=t[23]:(E=i?(0,Q.jsx)(f,{className:`size-4 animate-spin text-fg-muted`}):null,t[22]=i,t[23]=E);let D;t[24]!==T||t[25]!==E?(D=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,E]}),t[24]=T,t[25]=E,t[26]=D):D=t[26];let k=!a,A;t[27]!==s||t[28]!==n.shareUrl?(A=()=>void s(n.shareUrl),t[27]=s,t[28]=n.shareUrl,t[29]=A):A=t[29];let j;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(u,{className:`size-3.5`}),t[30]=j):j=t[30];let M;t[31]!==o.copy||t[32]!==k||t[33]!==A?(M=(0,Q.jsxs)(O,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:k,onClick:A,children:[j,o.copy]}),t[31]=o.copy,t[32]=k,t[33]=A,t[34]=M):M=t[34];let N=!a,P;t[35]===n.shareUrl?P=t[36]:(P=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=P);let F;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(d,{className:`size-3.5`}),t[37]=F):F=t[37];let I;t[38]!==o.open||t[39]!==N||t[40]!==P?(I=(0,Q.jsxs)(O,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:N,onClick:P,children:[F,o.open]}),t[38]=o.open,t[39]=N,t[40]=P,t[41]=I):I=t[41];let L;t[42]!==i||t[43]!==l||t[44]!==c||t[45]!==n||t[46]!==a||t[47]!==r||t[48]!==o.refresh?(L=r&&!l?(0,Q.jsxs)(O,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i||!a,onClick:()=>void c(n,`refresh`),children:[(0,Q.jsx)(W,{className:`size-3.5`}),o.refresh]}):null,t[42]=i,t[43]=l,t[44]=c,t[45]=n,t[46]=a,t[47]=r,t[48]=o.refresh,t[49]=L):L=t[49];let R;t[50]!==i||t[51]!==c||t[52]!==n||t[53]!==o.revoke?(R=n.revoked?null:(0,Q.jsxs)(O,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i,onClick:()=>void c(n,`revoke`),children:[(0,Q.jsx)(_e,{className:`size-3.5`}),o.revoke]}),t[50]=i,t[51]=c,t[52]=n,t[53]=o.revoke,t[54]=R):R=t[54];let z;t[55]!==M||t[56]!==I||t[57]!==L||t[58]!==R?(z=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[M,I,L,R]}),t[55]=M,t[56]=I,t[57]=L,t[58]=R,t[59]=z):z=t[59];let ee;return t[60]!==D||t[61]!==m||t[62]!==z?(ee=(0,Q.jsxs)(`div`,{className:m,children:[D,z]}),t[60]=D,t[61]=m,t[62]=z,t[63]=ee):ee=t[63],ee}function xt(e){let t=(0,X.c)(68),{share:n,busy:r,t:i,onCopy:a,onAction:o}=e,s=n.revoked||n.expired,c=s&&`opacity-60`,l;t[0]===c?l=t[1]:(l=h(`rounded-lg border border-edge-subtle p-3`,c),t[0]=c,t[1]=l);let p=n.stale&&!s?i.stale:s?i.inactive:i.active,m;t[2]===p?m=t[3]:(m=(0,Q.jsx)(`span`,{children:p}),t[2]=p,t[3]=m);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(`span`,{children:`·`}),t[4]=g):g=t[4];let _=n.maxViews===null?``:` / ${n.maxViews}`,v;t[5]!==n.viewCount||t[6]!==i.views||t[7]!==_?(v=(0,Q.jsxs)(`span`,{children:[i.views,` `,n.viewCount,_]}),t[5]=n.viewCount,t[6]=i.views,t[7]=_,t[8]=v):v=t[8];let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`span`,{children:`·`}),t[9]=y):y=t[9];let b;t[10]===n.expiresAt?b=t[11]:(b=new Date(n.expiresAt).toLocaleDateString(),t[10]=n.expiresAt,t[11]=b);let x;t[12]===b?x=t[13]:(x=(0,Q.jsx)(`span`,{children:b}),t[12]=b,t[13]=x);let S;t[14]!==x||t[15]!==m||t[16]!==v?(S=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[m,g,v,y,x]}),t[14]=x,t[15]=m,t[16]=v,t[17]=S):S=t[17];let C;t[18]===n.shareUrl?C=t[19]:(C=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[18]=n.shareUrl,t[19]=C);let w;t[20]!==S||t[21]!==C?(w=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[S,C]}),t[20]=S,t[21]=C,t[22]=w):w=t[22];let T;t[23]===r?T=t[24]:(T=r?(0,Q.jsx)(f,{className:`size-4 animate-spin text-fg-muted`}):null,t[23]=r,t[24]=T);let E;t[25]!==w||t[26]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[w,T]}),t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]!==a||t[29]!==n.shareUrl?(D=()=>void a(n.shareUrl),t[28]=a,t[29]=n.shareUrl,t[30]=D):D=t[30];let k;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(u,{className:`size-3.5`}),t[31]=k):k=t[31];let A;t[32]!==i.copy||t[33]!==D?(A=(0,Q.jsxs)(O,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:D,children:[k,i.copy]}),t[32]=i.copy,t[33]=D,t[34]=A):A=t[34];let j;t[35]===n.shareUrl?j=t[36]:(j=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=j);let M;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(d,{className:`size-3.5`}),t[37]=M):M=t[37];let N;t[38]!==i.open||t[39]!==j?(N=(0,Q.jsxs)(O,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:j,children:[M,i.open]}),t[38]=i.open,t[39]=j,t[40]=N):N=t[40];let P;t[41]!==r||t[42]!==s||t[43]!==o||t[44]!==n||t[45]!==i.refresh?(P=n.stale&&!s?(0,Q.jsxs)(O,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`refresh`),children:[(0,Q.jsx)(W,{className:`size-3.5`}),i.refresh]}):null,t[41]=r,t[42]=s,t[43]=o,t[44]=n,t[45]=i.refresh,t[46]=P):P=t[46];let F;t[47]!==r||t[48]!==s||t[49]!==o||t[50]!==n||t[51]!==i.extend?(F=s?null:(0,Q.jsx)(O,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`extend`),children:i.extend}),t[47]=r,t[48]=s,t[49]=o,t[50]=n,t[51]=i.extend,t[52]=F):F=t[52];let I;t[53]!==r||t[54]!==o||t[55]!==n||t[56]!==i.revoke?(I=n.revoked?null:(0,Q.jsxs)(O,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`revoke`),children:[(0,Q.jsx)(_e,{className:`size-3.5`}),i.revoke]}),t[53]=r,t[54]=o,t[55]=n,t[56]=i.revoke,t[57]=I):I=t[57];let L;t[58]!==A||t[59]!==N||t[60]!==P||t[61]!==F||t[62]!==I?(L=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[A,N,P,F,I]}),t[58]=A,t[59]=N,t[60]=P,t[61]=F,t[62]=I,t[63]=L):L=t[63];let R;return t[64]!==E||t[65]!==l||t[66]!==L?(R=(0,Q.jsxs)(`div`,{className:l,children:[E,L]}),t[64]=E,t[65]=l,t[66]=L,t[67]=R):R=t[67],R}function St(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}var Ct={title:`分享笔记`,description:`创建一个无需登录即可查看的只读快照。`,close:`关闭`,untitled:`无标题笔记`,empty:`空笔记`,privateExcluded:`不会分享标签、AI 元数据、项目、讨论、历史版本或未引用附件。`,attachments:`包含的附件`,expires:`有效期`,maxViews:`最多查看次数`,unlimited:`不限`,publicDescription:`公开说明(可选)`,create:`创建分享链接`,creating:`创建中…`,copy:`复制`,copied:`已复制`,open:`打开`,activeLinks:`这条笔记的分享`,copyFailed:`无法复制到剪贴板,请手动选择链接并复制。`,delivery:`发布方式`,deliveryHosted:`平台托管(外网稳定访问)`,deliveryLocal:`本机直连(需要隧道或公网部署)`,hostedLinks:`平台托管发布`,revision:`版本`,hostedDisabled:`管理员已暂停你的公网分享能力。已有托管链接当前不可访问,但仍可撤销。`,stale:`旧版本`,inactive:`已失效`,active:`有效`,views:`查看`,refresh:`更新快照`,extend:`延长 24 小时`,revoke:`撤销`},wt={title:`Share Note`,description:`Create a read-only snapshot that opens without sign-in.`,close:`Close`,untitled:`Untitled Note`,empty:`Empty Note`,privateExcluded:`Tags, AI metadata, projects, discussions, history, and unreferenced attachments are excluded.`,attachments:`Included attachments`,expires:`Expires`,maxViews:`Maximum views`,unlimited:`Unlimited`,publicDescription:`Public description (optional)`,create:`Create share link`,creating:`Creating…`,copy:`Copy`,copied:`Copied`,open:`Open`,activeLinks:`Shares for this Note`,copyFailed:`Could not copy to the clipboard. Select the link and copy it manually.`,delivery:`Publishing method`,deliveryHosted:`Hosted platform (stable public access)`,deliveryLocal:`Direct from this device (requires public access)`,hostedLinks:`Hosted publications`,revision:`Revision`,hostedDisabled:`An administrator has paused public sharing for your account. Existing hosted links are unavailable, but can still be revoked.`,stale:`Older version`,inactive:`Inactive`,active:`Active`,views:`Views`,refresh:`Update snapshot`,extend:`Extend 24 hours`,revoke:`Revoke`};function Tt(e){let t=(0,X.c)(18),{input:n,labels:r,showLabel:i}=e,a=i===void 0?!0:i,o;t[0]===n?o=t[1]:(o=n(),t[0]=n,t[1]=o);let s=o.source.id,c;t[2]===s?c=t[3]:(c=e=>e.source?.type===`note`&&e.source.id===s&&e.status!==`idle`,t[2]=s,t[3]=c);let l=Le(c),u;t[4]===s?u=t[5]:(u=e=>e.source?.type===`note`&&e.source.id===s&&e.status===`preparing`,t[4]=s,t[5]=u);let d=Le(u),f=Le(Et),p;t[6]!==n||t[7]!==r||t[8]!==d||t[9]!==a?(p=(0,Q.jsx)(q,{input:n,labels:r,disabled:d,showLabel:a}),t[6]=n,t[7]=r,t[8]=d,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==l||t[12]!==r||t[13]!==f?(m=l?(0,Q.jsx)(`button`,{type:`button`,onClick:f,title:r.stop,"aria-label":r.stop,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(K,{className:`size-3.5`,"aria-hidden":!0})}):null,t[11]=l,t[12]=r,t[13]=f,t[14]=m):m=t[14];let h;return t[15]!==p||t[16]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function Et(e){return e.stop}function Dt(e,t){let n=Ne(t.replace(/^\s*(`{3,}|~{3,})[^\n]*$/gm,``).replace(/xopc-attachment:\/\/[^\s)]+/g,``).replace(/^(\s*[-*+]\s+)\[[ xX]\]\s*/gm,`$1`)),r=Ne(e);return!r||n.split(`
3
+ `)[0]===r?n:[r,n].filter(Boolean).join(`
4
+
5
+ `)}var Ot=()=>i(()=>import(`./block-editor-0AWVCD3F.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])),kt=()=>i(()=>import(`./markdown-editor-BhBJANcx.js`),__vite__mapDeps([55,1,52,5,56,57,3])),At=(0,Z.lazy)(()=>Ot().then(e=>({default:e.BlockEditor}))),jt=(0,Z.lazy)(()=>kt().then(e=>({default:e.MarkdownEditor})));function Mt(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-6 py-4`,"aria-busy":!0,children:[(0,Q.jsx)(`div`,{className:`h-8 w-56 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-6 h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function Nt(e){let t=(0,X.c)(29),{mode:n,onModeChange:r,labels:i}=e,a;t[0]===i.edit?a=t[1]:(a={id:`wysiwyg`,label:i.edit,Icon:L},t[0]=i.edit,t[1]=a);let s;t[2]===i.source?s=t[3]:(s={id:`source`,label:i.source,Icon:ve},t[2]=i.source,t[3]=s);let c;t[4]===i.preview?c=t[5]:(c={id:`preview`,label:i.preview,Icon:N},t[4]=i.preview,t[5]=c);let l;t[6]!==a||t[7]!==s||t[8]!==c?(l=[a,s,c],t[6]=a,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=l,d;t[10]!==n||t[11]!==u?(d=u.find(e=>e.id===n)??u[0],t[10]=n,t[11]=u,t[12]=d):d=t[12];let f=d,p=f.Icon,m=Pt,h;t[13]===p?h=t[14]:(h=(0,Q.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),t[13]=p,t[14]=h);let g;t[15]===f.label?g=t[16]:(g=(0,Q.jsx)(`span`,{children:f.label}),t[15]=f.label,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(Ee,{className:`size-3 text-fg-subtle`,"aria-hidden":!0}),t[17]=_):_=t[17];let v;t[18]!==f.label||t[19]!==h||t[20]!==g?(v=(0,Q.jsx)(Be,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-label":f.label,className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-edge px-2.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[h,g,_]})}),t[18]=f.label,t[19]=h,t[20]=g,t[21]=v):v=t[21];let y;t[22]!==n||t[23]!==u||t[24]!==r?(y=(0,Q.jsx)(He,{children:(0,Q.jsx)(We,{align:`end`,sideOffset:6,className:`z-50 min-w-36 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:u.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,Q.jsxs)(we,{onSelect:()=>r(t),onPointerMove:()=>m(t),onFocus:()=>m(t),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(a,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:i}),n===t?(0,Q.jsx)(o,{className:`size-4 text-accent`,"aria-hidden":!0}):null]},t)})})}),t[22]=n,t[23]=u,t[24]=r,t[25]=y):y=t[25];let b;return t[26]!==y||t[27]!==v?(b=(0,Q.jsxs)(ue,{modal:!1,children:[v,y]}),t[26]=y,t[27]=v,t[28]=b):b=t[28],b}function Pt(e){e===`wysiwyg`&&Ot(),e===`source`&&kt()}function Ft(e){let t=(0,X.c)(16),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:s,onOpenSearch:c,autoFocus:l,initialMode:u,onAutoFocusConsumed:d}=e,f=a===void 0?!0:a,p=s===void 0?!0:s,m=l===void 0?!1:l,h=_(It),g;t[0]===h?g=t[1]:(g=v(h),t[0]=h,t[1]=g);let y=g.notes.lightboxClose,b;t[2]!==m||t[3]!==o||t[4]!==p||t[5]!==u||t[6]!==n||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==i||t[11]!==f?(b=(0,Q.jsx)(Lt,{noteId:n,onBack:r,onSaved:i,showBackButton:f,backButtonClassName:o,clearHeaderOnCleanup:p,onOpenSearch:c,autoFocus:m,initialMode:u,onAutoFocusConsumed:d}),t[2]=m,t[3]=o,t[4]=p,t[5]=u,t[6]=n,t[7]=d,t[8]=r,t[9]=c,t[10]=i,t[11]=f,t[12]=b):b=t[12];let x;return t[13]!==y||t[14]!==b?(x=(0,Q.jsx)(Xe,{closeLabel:y,children:b}),t[13]=y,t[14]=b,t[15]=x):x=t[15],x}function It(e){return e.language}function Lt({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:s=!0,onOpenSearch:c,autoFocus:l=!1,initialMode:u=`wysiwyg`,onAutoFocusConsumed:d}){let f=_(e=>e.language),m=v(f).notes,g=v(f).automations.suggestions,y=a(),b=k(e=>e.resolved)===`dark`,{openImage:x}=Je(),[S,C]=(0,Z.useState)(u),[w,T]=(0,Z.useState)(null),[E,O]=(0,Z.useState)(null),[A,N]=(0,Z.useState)(!1),[F,I]=(0,Z.useState)(``),[L,R]=(0,Z.useState)(360),[z,ee]=(0,Z.useState)(!1),[re,ie]=(0,Z.useState)(!1),[B,se]=(0,Z.useState)(!1),[ce,V]=(0,Z.useState)(null),[le,de]=(0,Z.useState)(!1),[H,me]=(0,Z.useState)(null),[he,ge]=(0,Z.useState)(!1),[ve,be]=(0,Z.useState)(!1),Se=(0,Z.useRef)(!1),Ce=(0,Z.useRef)(!1),W=(0,Z.useRef)(null),G=(0,Z.useRef)(null),K=(0,Z.useRef)(null),q=(0,Z.useRef)(null),Ee=(0,Z.useRef)(null),ke=(0,Z.useRef)(null),Ae=(0,Z.useRef)(null),Me=(0,Z.useRef)(null),Ne=(0,Z.useRef)(null),Pe=Te(e=>e.setPageHeader),Fe=Te(e=>e.clearPageHeader),{data:J,mutate:Y,error:ze}=D(e?[`note-detail`,e]:null,()=>j(e)),{data:Ue=[],mutate:Ge}=D(e?[`note-threads`,e]:null,()=>ae(e),{revalidateOnFocus:!1}),X=E!==null,qe=(0,Z.useCallback)(e=>{V(`${m.refreshFailed}: ${e instanceof Error?e.message:m.quickCaptureFailedHint}`)},[m.quickCaptureFailedHint,m.refreshFailed]);(0,Z.useEffect)(()=>{if(!e)return;let t=t=>{t.detail?.noteId===e&&Y().catch(qe)};return window.addEventListener(`note-updated`,t),()=>window.removeEventListener(`note-updated`,t)},[Y,e,qe]),(0,Z.useEffect)(()=>{Se.current=!1,I(``),O(null),T(null),Ce.current=!1,Ne.current=null},[e]),(0,Z.useEffect)(()=>{!J||Se.current||(I(J.title??``),Se.current=!0)},[J]),(0,Z.useEffect)(()=>{if(!l||!J||X||Ne.current===e)return;let t=window.requestAnimationFrame(()=>{Me.current?.focus(),d?.()});return Ne.current=e,()=>window.cancelAnimationFrame(t)},[l,X,J,e,d]);let Ye=J?new Date(J.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,Xe=(0,Z.useMemo)(()=>r?(0,Q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":m.back,className:h(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,pe,i),children:(0,Q.jsx)(M,{className:`size-4`,"aria-hidden":!0})}):null,[i,m.back,t,r]),$=(0,Z.useCallback)(()=>{let t=Le.getState();t.source?.type===`note`&&t.source.id===e&&t.stop()},[e]),Ze=(0,Z.useCallback)(e=>{e!==`preview`&&$(),C(e)},[$]),Qe=(0,Z.useCallback)(t=>{$(),I(t),e&&(q.current=t,G.current&&clearTimeout(G.current),G.current=setTimeout(async()=>{let t=q.current;if(q.current=null,t!==null){N(!0);try{await te(e,{title:t}),await Y(),n?.()}catch{}finally{N(!1)}}},600))},[$,e,Y,n]),$e=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:h(`flex min-w-0 items-center gap-2`,pe),children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:F||Ye||void 0,children:F||Ye}),A?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:m.saving}):null]}),[m.saving,A,Ye,F]),et=(0,Z.useCallback)(async(t=!1)=>{se(!0),V(null);try{let n=await Ke(e,{forceNew:t});await Y(),await Ge(),y(`/chat/${encodeURIComponent(n.sessionKey)}`)}catch(e){V(`${m.chatOpenFailedTitle}: ${e instanceof Error?e.message:m.chatOpenFailedMessage}`)}finally{se(!1)}},[Y,Ge,y,e,m.chatOpenFailedMessage,m.chatOpenFailedTitle]),tt=(0,Z.useCallback)(async()=>{ie(!0),V(null);try{await fe(e),await Y()}catch(e){V(`${m.catalysisFailed}: ${e instanceof Error?e.message:m.chatOpenFailedMessage}`)}finally{ie(!1)}},[Y,e]),nt=(0,Z.useCallback)(()=>{T(w===`breakdown`?null:`breakdown`),!J?.aiDeep?.catalysis?.report&&!re&&tt()},[w,re,tt,J?.aiDeep?.catalysis?.report]),it=(0,Z.useCallback)(()=>{let t=E?E.markdown??``:K.current??J?.markdown??``,n=E?E.title??``:F,r=Dt(n,t);return{source:{type:`note`,id:e,title:n||m.titlePlaceholder},text:r,language:Ie(r,f)}},[f,m.titlePlaceholder,J?.markdown,e,E,F]),at=(0,Z.useCallback)(async()=>{W.current&&clearTimeout(W.current),G.current&&clearTimeout(G.current),W.current=null,G.current=null;let t=K.current,r=q.current;K.current=null,q.current=null;let i={};if(t!==null&&(i.markdown=t),r!==null&&(i.title=r),Object.keys(i).length===0)return J??null;N(!0);try{let t=await te(e,i);return await Y(t,{revalidate:!1}),n?.(),t}catch(e){return V(`${m.saveFailed}: ${e instanceof Error?e.message:m.saveFailedHint}`),null}finally{N(!1)}},[Y,m.saveFailed,m.saveFailedHint,J,e,n]),ot=(0,Z.useCallback)(async()=>{V(null);let e=await at();e&&(me(e),de(!0))},[at]),st=(0,Z.useCallback)(async()=>{if(!(ve||A)){ge(!1),be(!0),V(null),$(),W.current&&clearTimeout(W.current),G.current&&clearTimeout(G.current),W.current=null,G.current=null,K.current=null,q.current=null;try{await je(e),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e}})),n?.(),t()}catch(e){V(`${m.deleteFailed}: ${e instanceof Error?e.message:m.quickCaptureFailedHint}`)}finally{be(!1)}}},[ve,m.deleteFailed,m.quickCaptureFailedHint,e,t,n,A,$]),ct=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:h(`flex min-w-0 items-center gap-1 sm:gap-2`,pe),children:[c?(0,Q.jsx)(`button`,{type:`button`,onClick:c,"aria-label":m.searchDialogTitle,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(De,{className:`size-4`,"aria-hidden":!0})}):null,(0,Q.jsx)(Tt,{input:it,showLabel:!1,labels:{read:m.readAloud,preparing:m.readAloudPreparing,pause:m.readAloudPause,resume:m.readAloudResume,retry:m.readAloudRetry,stop:m.readAloudStop}}),(0,Q.jsxs)(`button`,{type:`button`,onClick:nt,disabled:re,"aria-label":m.catalysisSectionTitle,className:h(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50`,w===`breakdown`?`bg-accent/10 text-accent`:`bg-accent/10 text-fg hover:bg-accent/15`),children:[(0,Q.jsx)(Oe,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:re?m.catalyzing:m.catalyzeButton})]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>et(!1),"aria-label":m.openChatButton,disabled:B,className:h(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors`,`border border-edge text-fg-muted hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`),children:[(0,Q.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:B?m.openingChat:m.openChatButton})]}),(0,Q.jsx)(Nt,{mode:S,onModeChange:Ze,labels:{edit:m.modeEdit,source:m.modeSource,preview:m.modePreview}}),(0,Q.jsxs)(ue,{modal:!1,children:[(0,Q.jsx)(Be,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":m.noteActions,title:m.noteActions,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(U,{className:`size-4`,"aria-hidden":!0})})}),(0,Q.jsx)(He,{children:(0,Q.jsxs)(We,{align:`end`,sideOffset:6,className:`z-50 min-w-40 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,Q.jsxs)(we,{onSelect:()=>void ot(),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(Re,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),f===`zh`?`分享`:`Share`]}),(0,Q.jsxs)(we,{onSelect:()=>T(w===`history`?null:`history`),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(Ve,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:m.history}),w===`history`?(0,Q.jsx)(o,{className:`size-4 text-accent`,"aria-hidden":!0}):null]}),(0,Q.jsx)(P,{className:`my-1 h-px bg-edge-subtle`}),(0,Q.jsxs)(we,{disabled:ve||A,onSelect:()=>ge(!0),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,Q.jsx)(_e,{className:`size-4`,"aria-hidden":!0}),m.delete]})]})})]})]}),[re,nt,et,S,m.history,m.modeEdit,m.modePreview,m.modeSource,B,w,c,m.searchDialogTitle,m.readAloud,m.readAloudPause,m.readAloudPreparing,m.readAloudResume,m.readAloudRetry,m.readAloudStop,Ze,it,ot,ve,A,f,m.delete,ge]);(0,Z.useLayoutEffect)(()=>(Pe({startExtra:Xe,main:J?$e:null,end:J?ct:null}),()=>{s&&Fe()}),[s,Fe,ct,$e,Xe,J,Pe]);let lt=(0,Z.useCallback)(t=>{e&&($(),K.current=t,W.current&&clearTimeout(W.current),W.current=setTimeout(async()=>{let t=K.current;if(K.current=null,t!==null){N(!0),V(null);try{await te(e,{markdown:t}),await Y(),n?.()}catch(e){V(`${m.saveFailed}: ${e instanceof Error?e.message:m.saveFailedHint}`)}finally{N(!1)}}},600))},[$,e,Y,m.saveFailed,m.saveFailedHint,n]),dt=(0,Z.useCallback)(t=>{oe(e,t.timestamp).then(e=>{e&&($(),O(e))})},[e,$]),ft=(0,Z.useCallback)(()=>{$(),T(null),O(null)},[$]),pt=(0,Z.useCallback)(()=>{$(),T(null),O(null),Y().catch(qe),n?.()},[Y,n,qe,$]);if((0,Z.useEffect)(()=>()=>{W.current&&clearTimeout(W.current),G.current&&clearTimeout(G.current);let t=K.current,n=q.current;K.current=null,q.current=null;let r={};t!==null&&(r.markdown=t),n!==null&&(r.title=n),Object.keys(r).length>0&&te(e,r).catch(()=>void 0)},[e]),J===void 0)return ze?(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:m.home.loadFailed}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void Y().catch(qe),className:`rounded-lg border border-edge px-3 py-2 text-sm text-fg hover:bg-surface-hover`,children:m.home.retry}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`text-sm text-fg-muted hover:text-fg`,children:m.back})]}):(0,Q.jsx)(Mt,{});if(J===null)return(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-center`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:m.notFoundTitle}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:m.notFoundDescription}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-lg border border-edge px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:m.back})]});let mt=X?E.title??``:F,ht=X?E.markdown??``:K.current??J.markdown??``,vt=new Date(J.createdAt).getTime(),bt=Number.isFinite(vt)&&Date.now()-vt<3600*1e3?(0,Q.jsx)(rt,{title:g.noteCreatedTitle,description:g.noteCreatedDescription,prompt:g.noteCreatedPrompt,coverage:{eventType:`note.created`,source:`notes`,eventPayload:{noteId:e}},variant:`titleAction`,className:`ml-3 hidden max-w-[18rem] shrink-0 md:flex`}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 gap-3 p-4 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`mx-auto flex min-h-0 min-w-0 w-full max-w-[60rem] flex-1 flex-col`,children:[ce?(0,Q.jsx)(`p`,{className:`mb-3 shrink-0 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:ce}):null,(0,Q.jsx)(xe,{eventType:`note.created`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,Q.jsx)(xe,{eventType:`note.updated`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,Q.jsxs)(`div`,{ref:Ee,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel xl:flex-row`,children:[(0,Q.jsx)(ut,{noteId:e}),(0,Q.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,children:X?(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,children:[mt&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg/70`,children:mt}),ht?(0,Q.jsx)(ye,{noteId:e,content:ht,className:`opacity-80`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:m.emptyPreview})]}):(0,Q.jsxs)(Q.Fragment,{children:[S===`wysiwyg`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Me,type:`text`,value:F,onChange:e=>Qe(e.target.value),onCompositionStart:()=>{Ce.current=!0},onCompositionEnd:()=>{Ce.current=!1},onKeyDown:e=>{let t=e.nativeEvent;e.key===`Enter`&&!Ce.current&&!t.isComposing&&(e.preventDefault(),(Ee.current?.querySelector(`.ProseMirror`))?.focus())},placeholder:m.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),bt]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(Mt,{}),children:(0,Q.jsx)(At,{initialContent:J.markdown??``,onChange:lt,noteId:e},`wysiwyg-${e}`)})})]}),S===`source`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:Me,type:`text`,value:F,onChange:e=>Qe(e.target.value),placeholder:m.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),bt]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(Mt,{}),children:(0,Q.jsx)(jt,{initialContent:J.markdown??``,onChange:lt,isDark:b},`source-${e}`)})})]}),S===`preview`&&(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,onClick:e=>{let t=e.target;t instanceof HTMLImageElement&&x(t.currentSrc||t.src,t.alt)},children:[F&&!J.markdown.trimStart().startsWith(`# ${F.trim()}\n`)&&J.markdown.trim()!==`# ${F.trim()}`&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg`,children:F}),J.markdown?(0,Q.jsx)(ye,{noteId:e,content:J.markdown,className:`[&_img]:cursor-zoom-in`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:m.emptyPreview})]})]})})]})]}),(0,Q.jsx)(`div`,{ref:ke,className:h(`relative flex min-h-0 shrink-0 flex-col overflow-hidden`,!z&&`transition-[width] duration-300 ease-in-out`),style:{width:w?L:0},children:(0,Q.jsxs)(`div`,{ref:Ae,className:`flex min-h-0 flex-1 flex-col`,style:{width:L},children:[(0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),ee(!0);let n=e.clientX,r=L,i=e.pointerId,a=0,o=L,s=L,c=()=>{a=0,s=o,w&&ke.current?.style.setProperty(`width`,`${s}px`),Ae.current?.style.setProperty(`width`,`${s}px`)},l=e=>{let t=r-(e.clientX-n);o=Math.max(280,Math.min(600,Math.round(t))),a===0&&(a=window.requestAnimationFrame(c))},u=()=>{a!==0&&(window.cancelAnimationFrame(a),c());try{t.releasePointerCapture(i)}catch{}ee(!1),R(s),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,u)};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,u)},className:h(`absolute left-0 top-0 z-10 h-full w-2 -translate-x-1/2 cursor-col-resize`,`before:content-[''] before:pointer-events-none before:absolute before:left-1/2 before:top-0 before:h-full before:w-px before:-translate-x-1/2`,`before:bg-transparent before:transition-[background-color] before:duration-150`,`hover:before:bg-edge/65 dark:hover:before:bg-edge/75`,z&&`before:!bg-edge/80 dark:before:!bg-edge/85`,`touch-none select-none`)}),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:w===`history`?(0,Q.jsx)(gt,{noteId:e,activeTimestamp:E?.timestamp??null,onSelect:dt,onClose:ft,onRestored:pt}):w===`breakdown`?(0,Q.jsx)(_t,{noteId:e,note:J??null,catalyzing:re,onCatalyze:tt,onClose:()=>T(null),noteThreads:Ue,openingChat:B,onOpenChat:()=>et(!1),onOpenNewChat:()=>et(!0)}):null})]})})]}),H?(0,Q.jsx)(yt,{open:le,onOpenChange:de,note:H}):null,(0,Q.jsx)(ne,{open:he,title:m.deleteConfirmTitle,description:m.deleteConfirmDescription.replace(`{{title}}`,J.title||m.titlePlaceholder),confirmLabel:m.deleteConfirmLabel,cancelLabel:m.deleteCancelLabel,destructive:!0,onConfirm:()=>void st(),onCancel:()=>ge(!1)})]})}export{Je as a,et as i,nt as n,tt as r,Ft as t};
@@ -0,0 +1,8 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,h as a,p as o,u as s}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{t as c}from"./popover-select-DGmMQt4t.js";import{d as l}from"./markdown-view-DF3aJP_5.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{t as d}from"./plus-Q2yW6OE7.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./cn-JdwAhgNB.js";import{c as m,f as h,n as g}from"./locale-store-BkJ7g35d.js";import{t as _}from"./messages-BGc-OJWg.js";import{i as v}from"./vendor-swr-BIWyz7Rc.js";import{t as y}from"./skeleton-BwbyijEw.js";import{$s as b,Au as x,Bc as S,Dn as C,Du as ee,Eu as w,Fc as T,Fl as te,Fn as E,Jn as D,Ki as ne,Mu as O,Ol as re,Qn as k,Rn as A,Sn as ie,To as ae,Vl as oe,Wc as j,Ws as se,Yn as M,_a as ce,bn as le,bu as ue,co as de,gc as N,gl as fe,hc as pe,ic as me,kn as he,ku as ge,pu as P,wn as _e,xn as ve,yn as ye,za as F,zn as be}from"./index-5UchbidQ.js";import{i as xe,t as I}from"./note-detail-panel-JbvyGdEX.js";var L=e(t(),1),R=n();async function Se(e){e.note??=await C({title:e.title,markdown:e.markdown,projectId:e.projectId,channel:`web`},e.requestId);let t=e.note.id;for(let n=e.attachments.length;n<e.files.length;n++)e.attachments.push(await M(t,e.files[n],`${e.requestId}:file:${n}`));if(e.attachments.length){let n=e.attachments.map(e=>`[${e.fileName.replace(/[\\[\]]/g,`\\$&`).replace(/[\r\n]/g,` `)}](${k(t,e.id)})`);e.note=await D(t,{markdown:`${e.markdown}\n\n## ${e.materialHeading}\n\n${n.join(`
2
+
3
+ `)}`})}return{noteId:t,sessionKey:(await be(t,{projectId:e.projectId})).sessionKey}}function Ce(e,t,n){let r=new URLSearchParams({draft:n.replace(`{{id}}`,t),autoSend:`1`});return`/chat/${encodeURIComponent(e)}?${r}`}var z=r(),B={meeting:w,requirements:te,research:N,weekly:P};function we({projects:e,projectId:t,onProjectChange:n,onCreated:r,labels:a,projectsLoading:o,projectsError:s}){let l=a.home,d=i(),[m,h]=(0,L.useState)(``),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)([]),[b,x]=(0,L.useState)(!1),[S,C]=(0,L.useState)(null),[w,te]=(0,L.useState)(``),E=(0,L.useRef)(null),D=(0,L.useRef)(!1),ne=(0,L.useRef)(null),O=(0,L.useRef)(null),k=b||!!E.current,A=g?l.templateOptions[g]:null,ie=!!(m.trim()||v.length);async function ae(){if(!(D.current||!ie&&!E.current)){D.current=!0,x(!0),C(null),E.current??={requestId:crypto.randomUUID(),title:m.trim().split(`
4
+ `)[0]?.slice(0,80)||A?.label||a.titlePlaceholder,markdown:`## ${l.requestHeading}\n\n${A?`${A.prompt}\n`:``}${m.trim()}`,projectId:t||void 0,files:[...v],attachments:[],materialHeading:l.materialsHeading};try{let e=await Se(E.current);r(),d(Ce(e.sessionKey,e.noteId,l.agentPrompt))}catch(e){E.current.note&&r(),C(e instanceof Error?e.message:a.quickCaptureFailedHint)}finally{D.current=!1,x(!1)}}}function oe(){E.current=null,C(null),h(``),y([]),_(null),O.current?.focus()}return(0,z.jsxs)(`section`,{"aria-label":l.askLabel,children:[(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),ae()},className:`relative rounded-xl border border-edge bg-surface-panel p-4 focus-within:border-accent/60 sm:p-5`,children:[(0,z.jsxs)(`fieldset`,{disabled:k,className:`min-w-0`,children:[(0,z.jsxs)(`label`,{htmlFor:`notes-home-prompt`,className:`flex items-center gap-2 text-xs font-medium text-accent-fg`,children:[(0,z.jsx)(me,{className:`size-4`,"aria-hidden":!0}),l.askLabel]}),A?(0,z.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 rounded-lg bg-accent-soft px-3 py-2 text-xs leading-5 text-accent-fg`,children:[(0,z.jsxs)(`p`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`span`,{className:`font-medium`,children:[A.label,` · `]}),A.prompt.split(`
5
+
6
+ `)[0]]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>_(null),"aria-label":a.searchClear,className:`shrink-0 rounded p-1 hover:bg-surface-hover`,children:(0,z.jsx)(f,{className:`size-3.5`})})]}):null,(0,z.jsx)(`textarea`,{ref:O,id:`notes-home-prompt`,value:m,onChange:e=>h(e.target.value),placeholder:A?A.prompt.split(`
7
+
8
+ `).at(-1):l.askPlaceholder,rows:2,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),ae())},className:`mt-2 min-h-16 w-full resize-y bg-transparent py-2 text-base leading-6 text-fg outline-none placeholder:text-fg-muted sm:text-sm`}),v.length?(0,z.jsx)(`ul`,{className:`mb-3 flex flex-wrap gap-2`,children:v.map((e,t)=>(0,z.jsxs)(`li`,{className:`flex max-w-full items-center gap-2 rounded-md border border-edge px-2 py-1 text-xs text-fg-muted`,children:[(0,z.jsx)(T,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name}),(0,z.jsx)(`button`,{type:`button`,"aria-label":`${l.removeMaterial}: ${e.name}`,onClick:()=>y(e=>e.filter((e,n)=>n!==t)),className:`rounded p-1 hover:bg-surface-hover`,children:(0,z.jsx)(f,{className:`size-3`})})]},`${e.name}-${t}`))}):null,(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 sm:pr-40`,children:[(0,z.jsx)(`div`,{className:`w-44 max-w-full`,children:(0,z.jsx)(c,{value:t,options:e.filter(e=>e.name.toLowerCase().includes(w.toLowerCase())).map(e=>({value:e.id,label:e.name})),selectedLabel:t?e.find(e=>e.id===t)?.name:l.unassigned,placeholder:l.unassigned,emptyLabel:l.unassigned,ariaLabel:l.assignProject,triggerIcon:(0,z.jsx)(re,{className:`size-4 shrink-0`,"aria-hidden":!0}),triggerClassName:`h-8 border-transparent bg-transparent px-2 text-xs text-fg-muted hover:bg-surface-hover`,onChange:n,disabled:k,loading:o,statusMessage:s?l.projectsLoadFailed:void 0,searchPlaceholder:l.projectSearch,searchValue:w,onSearchChange:te})}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>ne.current?.click(),className:`inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover`,children:[(0,z.jsx)(T,{className:`size-4`,"aria-hidden":!0}),l.addMaterials]}),(0,z.jsx)(`input`,{ref:ne,type:`file`,multiple:!0,className:`hidden`,"aria-label":l.addMaterials,onChange:e=>{let t=Array.from(e.target.files??[]);y(e=>[...e,...t]),e.target.value=``}})]})]}),(0,z.jsx)(`div`,{className:`mt-2 flex justify-end sm:absolute sm:bottom-5 sm:right-5 sm:mt-0`,children:(0,z.jsxs)(`button`,{type:`submit`,disabled:b||!E.current&&!ie,className:`inline-flex h-9 items-center gap-2 rounded-lg bg-accent px-4 text-sm font-medium text-white hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,children:[b?(0,z.jsx)(u,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,z.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),b?l.creating:S?l.retry:l.agentCreate]})})]}),S?(0,z.jsxs)(`div`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-3 text-xs text-danger`,role:`alert`,children:[(0,z.jsx)(`p`,{children:S}),E.current?.note?(0,z.jsx)(`p`,{className:`mt-1`,children:l.partialFailure}):null,(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3`,children:[E.current?.note?(0,z.jsx)(`button`,{type:`button`,onClick:()=>d(`/notes/${encodeURIComponent(E.current.note.id)}?edit=1`),className:`underline`,children:l.openSavedDraft}):null,(0,z.jsx)(`button`,{type:`button`,onClick:oe,className:`underline`,children:l.newRequest})]})]}):null,(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-1 gap-y-1 text-xs text-fg-muted`,children:[(0,z.jsx)(`span`,{className:`mr-1 py-2`,children:l.templates}),Object.keys(B).map(e=>{let t=B[e];return(0,z.jsxs)(`button`,{type:`button`,disabled:k,"aria-pressed":g===e,onClick:()=>{_(g===e?null:e),O.current?.focus()},className:p(`inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover disabled:opacity-50`,g===e&&`bg-accent-soft text-accent-fg`),children:[(0,z.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),l.templateOptions[e].label]},e)}),(0,z.jsxs)(`button`,{type:`button`,disabled:b,onClick:()=>F(),className:`ml-auto inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover`,children:[(0,z.jsx)(j,{className:`size-3.5`,"aria-hidden":!0}),l.recordDiscussion]})]})]})}function Te(e,t){let n=Number(e.get(`page`)??0),r=Number.isSafeInteger(n)&&n>=0?n:0,i=e.get(`view`);return{projectId:e.get(`projectId`)||void 0,unassigned:e.get(`unassigned`)===`true`||i===`unassigned`||void 0,pinned:i===`favorites`?!0:void 0,agentEdited:i===`agent`||void 0,status:i===`archived`?`archived`:void 0,search:t.trim()||void 0,sortBy:`updatedAt`,sortOrder:`desc`,limit:12,offset:r*12}}function Ee(e){let t=e.snippet?.trim()??``,n=e.title?.trim();return n&&t.startsWith(n)?t.slice(n.length).replace(/^[\s::·—-]+/,``):t}var V=`inline-flex min-h-9 items-center justify-center gap-2 rounded-lg px-3 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50`;function H(){let e=g(e=>e.language),t=_(e).notes,n=t.home,r=m(e=>e.sessionKey),o=de(e=>e.setPageHeader),l=de(e=>e.clearPageHeader),f=i(),{pathname:ee,search:T}=s(),[k,j]=a(),M=k.get(`projectId`)||``,N=k.get(`view`)||`all`,P=k.get(`unassigned`)===`true`||N===`unassigned`,F=k.get(`search`)||``,[be]=ce(F,250),[I,R]=(0,L.useState)(M),[Se,Ce]=(0,L.useState)(``),[B,H]=(0,L.useState)(null),[U,De]=(0,L.useState)(!1),[Oe,ke]=(0,L.useState)(new Set),[Ae,je]=(0,L.useState)(null),[Me,Ne]=(0,L.useState)(null),W=(0,L.useRef)(new Set),G=(0,L.useRef)(null),Pe=(0,L.useRef)(!1),Fe=(0,L.useRef)(null),Ie=Te(k,be),K=(Ie.offset??0)/12,{data:Le,error:Re,isLoading:ze,mutate:Be}=v(r?[`notes-home`,r,Ie]:null,()=>A(Ie)),{data:Ve,error:He,isLoading:q,mutate:J}=v(r?[`notes-home-projects`,r]:null,E),Y=Ve?.items??[],Ue=Y.find(e=>e.id===M)?.name??n.projectNotes,We=Le?.items??[],X=Le?.total??0,Ge=ze||F!==be,Ke=(0,L.useMemo)(()=>({justNow:t.justNow,minutesAgo:t.minutesAgo,today:t.today,yesterday:t.yesterday,daysAgo:t.daysAgo,locale:h(e)}),[e,t.justNow,t.minutesAgo,t.today,t.yesterday,t.daysAgo]),[qe,Je]=(0,L.useState)(()=>Date.now());(0,L.useEffect)(()=>{R(M)},[M]),(0,L.useEffect)(()=>{let e=window.setInterval(()=>Je(Date.now()),6e4);return()=>window.clearInterval(e)},[]);let Z=(0,L.useCallback)(()=>{Be().catch(()=>void 0),J().catch(()=>void 0)},[Be,J]);(0,L.useEffect)(()=>{let e=[`note-updated`,`note-created`,`note-deleted`,`project-updated`,`project-created`,`project-deleted`];return e.forEach(e=>window.addEventListener(e,Z)),()=>e.forEach(e=>window.removeEventListener(e,Z))},[Z]);let Ye=(0,L.useCallback)((e,t=!1)=>{let n=`${ee}${T}`,r=new URLSearchParams({returnTo:n});t&&r.set(`edit`,`1`),f(`/notes/${encodeURIComponent(e)}?${r}`)},[ee,T,f]),Q=(0,L.useCallback)(async()=>{if(!(Pe.current||!r)){Pe.current=!0,De(!0),H(null),G.current??={key:crypto.randomUUID(),projectId:I||void 0};try{let e=await C({markdown:``,kind:`thought`,projectId:G.current.projectId},G.current.key);G.current=null,Z(),Ye(e.id,!0)}catch(e){H(`${t.createBlankFailed}: ${e instanceof Error?e.message:t.createBlankFailedHint}`)}finally{Pe.current=!1,De(!1)}}},[I,t.createBlankFailed,t.createBlankFailedHint,Ye,Z,r]),Xe=(0,L.useCallback)(e=>{j(t=>{let n=new URLSearchParams(t);return e?n.set(`search`,e):n.delete(`search`),n.delete(`page`),n},{replace:!0})},[j]);function $(e,t=`all`){let n=new URLSearchParams;e&&n.set(`projectId`,e),t===`unassigned`?n.set(`unassigned`,`true`):t!==`all`&&n.set(`view`,t),R(e),j(n)}function Ze(e){j(t=>{let n=new URLSearchParams(t);return P&&n.set(`unassigned`,`true`),e===`all`?n.delete(`view`):n.set(`view`,e),n.delete(`page`),n})}async function Qe(e,n){if(!W.current.has(e)){W.current.add(e),ke(new Set(W.current)),H(null);try{await D(e,{pinned:n}),Z()}catch(e){H(`${t.actionFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{W.current.delete(e),ke(new Set(W.current))}}}async function $e(){let e=Ae;if(!(!e||Me)){je(null),Ne(e.id),H(null);try{await he(e.id),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e.id}})),Z()}catch(e){H(`${t.deleteFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{Ne(null)}}}if((0,L.useLayoutEffect)(()=>{if(!r){l();return}return o({startExtra:null,main:(0,z.jsx)(`h1`,{className:`truncate text-base font-semibold text-fg`,children:t.title}),end:(0,z.jsxs)(`div`,{className:p(`flex min-w-0 items-center gap-2`,ae),children:[(0,z.jsxs)(`label`,{className:`flex h-9 w-32 min-w-0 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2 sm:w-48`,children:[(0,z.jsx)(pe,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,z.jsx)(`input`,{ref:Fe,type:`search`,value:F,onChange:e=>Xe(e.target.value),"aria-label":t.searchDialogTitle,placeholder:t.searchPlaceholder,className:`min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-muted`})]}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void Q(),disabled:U,"aria-label":n.blankNote,className:p(V,`border border-edge bg-surface-panel text-fg`),children:[U?(0,z.jsx)(u,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,z.jsx)(d,{className:`size-4`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`hidden sm:inline`,children:n.blankNote})]})]})}),()=>l()},[l,Q,U,n.blankNote,t.searchDialogTitle,t.searchPlaceholder,t.title,F,o,Xe,r]),(0,L.useEffect)(()=>{let e=e=>{!(e.metaKey||e.ctrlKey)||e.altKey||e.isComposing||e.target?.closest(`input, textarea, [contenteditable="true"], [role="dialog"]`)||(e.key.toLowerCase()===`n`&&(e.preventDefault(),Q()),e.key.toLowerCase()===`f`&&(e.preventDefault(),Fe.current?.focus()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Q]),!r)return(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-fg-muted`,children:t.needToken});let et=[{id:`all`,label:n.homeNav,Icon:S},{id:`favorites`,label:n.favorites,Icon:b},{id:`unassigned`,label:n.unassigned,Icon:fe},{id:`archived`,label:t.filterArchived,Icon:O}],tt=M?`project:${M}`:P?`unassigned`:`all`;return(0,z.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-panel`,children:[(0,z.jsxs)(`aside`,{className:`hidden w-44 shrink-0 flex-col gap-1 overflow-y-auto px-3 py-6 xl:flex`,"aria-label":n.homeNav,children:[et.map(({id:e,label:t,Icon:n})=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>$(``,e),"aria-current":!M&&(e===`unassigned`?P:!P&&N===e)?`page`:void 0,className:p(V,`justify-start px-2 text-left text-xs`,!M&&(e===`unassigned`?P:!P&&N===e)&&`bg-surface-hover font-medium text-fg`),children:[(0,z.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),t]},e)),(0,z.jsx)(`span`,{className:`mb-1 mt-7 px-2 text-xs text-fg-muted`,children:n.projects}),q?[0,1,2].map(e=>(0,z.jsx)(y,{className:`mb-2 h-8 w-full`},e)):Y.slice(0,8).map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>$(e.id),"aria-current":M===e.id?`page`:void 0,className:p(V,`justify-start px-2 text-left text-xs`,M===e.id&&`bg-surface-hover font-medium text-fg`),children:[(0,z.jsx)(re,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id)),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>f(`/projects`),className:p(V,`mt-2 justify-start px-2 text-xs`),children:[n.allProjects,(0,z.jsx)(ge,{className:`ml-auto size-3`,"aria-hidden":!0})]})]}),(0,z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col px-4 py-4 sm:py-7 sm:px-8 lg:px-10 lg:py-9`,children:[(0,z.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4`,children:[(0,z.jsx)(`h2`,{className:`min-w-0 break-words text-2xl font-semibold tracking-tight text-fg`,children:M?Ue:P?n.unassigned:n.homeTitle}),M?(0,z.jsxs)(`button`,{type:`button`,onClick:()=>f(`/projects/${encodeURIComponent(M)}`),className:p(V,`text-xs`),children:[n.openProject,(0,z.jsx)(ge,{className:`size-3.5`,"aria-hidden":!0})]}):null]}),B?(0,z.jsx)(`p`,{className:`mb-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:B}):null,(0,z.jsx)(`div`,{className:`order-3 mt-6 sm:order-none sm:mt-0`,children:(0,z.jsx)(we,{projects:Y,projectId:I,onProjectChange:R,onCreated:Z,labels:t,projectsLoading:q,projectsError:!!He})}),He?(0,z.jsxs)(`div`,{role:`alert`,className:`mt-4 flex items-center gap-3 text-xs text-danger`,children:[(0,z.jsx)(`span`,{children:n.projectsLoadFailed}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void J().catch(()=>void 0),className:`underline`,children:n.retry})]}):null,!M&&!P&&(q||Y.length>0)?(0,z.jsxs)(`section`,{className:`order-4 mt-8 sm:order-none`,"aria-label":n.continueProjects,children:[(0,z.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.continueProjects}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>f(`/projects`),className:`text-xs text-fg-muted hover:text-fg`,children:n.allProjects})]}),(0,z.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:q?[0,1,2].map(e=>(0,z.jsx)(y,{className:`h-28 w-full`},e)):Y.slice(0,3).map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>$(e.id),className:`min-w-0 rounded-lg border border-edge bg-surface-panel p-3 text-left transition-colors sm:p-4 hover:bg-surface-base focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,z.jsx)(re,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.description?(0,z.jsx)(`p`,{className:`mt-2 hidden line-clamp-1 text-xs text-fg-muted sm:block`,children:e.description}):null,(0,z.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center justify-between gap-1 text-xs text-fg-muted sm:mt-3`,children:[(0,z.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(e.noteCount))}),(0,z.jsx)(`span`,{children:e.updatedAt?xe(e.updatedAt,qe,Ke):n.emptyProject})]})]},e.id))})]}):null,(0,z.jsxs)(`section`,{className:`order-2 mt-2 pb-6 sm:order-none sm:mt-8`,"aria-label":n.recentNotes,children:[(0,z.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:M?n.projectNotes:n.recentNotes}),(0,z.jsx)(`div`,{className:`w-48 max-w-full`,children:(0,z.jsx)(c,{value:tt,allowEmpty:!1,ariaLabel:n.projects,placeholder:n.allNotes,options:[{value:`all`,label:n.allNotes},{value:`unassigned`,label:n.unassigned},...Y.filter(e=>e.name.toLowerCase().includes(Se.toLowerCase())).map(e=>({value:`project:${e.id}`,label:e.name}))],selectedLabel:M?Ue:P?n.unassigned:n.allNotes,triggerClassName:`h-8 bg-surface-panel text-xs`,loading:q,searchPlaceholder:n.projectSearch,searchValue:Se,onSearchChange:Ce,onChange:e=>$(e.startsWith(`project:`)?e.slice(8):``,e===`unassigned`?e:`all`)})})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 border-b border-edge`,"aria-label":t.libraryTitle,children:[[{id:`all`,label:t.filterAll},{id:`agent`,label:n.agentEdited},{id:`favorites`,label:n.favorites},{id:`archived`,label:t.filterArchived}].map(({id:e,label:t})=>(0,z.jsx)(`button`,{type:`button`,"aria-pressed":N===e||e===`all`&&N===`unassigned`,onClick:()=>Ze(e),className:p(`border-b-2 border-transparent py-3 text-xs text-fg-muted hover:text-fg`,(N===e||e===`all`&&N===`unassigned`)&&`border-fg font-medium text-fg`),children:t},e)),(0,z.jsx)(`span`,{className:`ml-auto py-3 text-xs text-fg-muted`,children:n.sortUpdated})]}),Re?(0,z.jsxs)(`div`,{className:`py-10 text-center`,role:`alert`,children:[(0,z.jsx)(`p`,{className:`text-sm text-danger`,children:n.loadFailed}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Be().catch(()=>void 0),className:p(V,`mt-2`),children:n.retry})]}):Ge?(0,z.jsx)(`div`,{"aria-busy":`true`,className:`divide-y divide-edge`,children:[0,1,2,3].map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-3 py-4`,children:[(0,z.jsx)(y,{className:`h-10 w-8 shrink-0`}),(0,z.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,z.jsx)(y,{className:`h-4 w-2/3`}),(0,z.jsx)(y,{className:`h-3 w-1/2`})]})]},e))}):We.length===0?(0,z.jsxs)(`div`,{className:`flex flex-col items-center px-4 py-12 text-center`,children:[(0,z.jsx)(S,{className:`mb-4 size-8 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,z.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:F||N!==`all`&&N!==`unassigned`?n.noMatches:M?n.projectEmpty:n.emptyTitle}),(0,z.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:F||N!==`all`&&N!==`unassigned`?n.noMatchesHint:M?n.projectEmptyHint:n.emptyDescription})]}):(0,z.jsx)(`ul`,{className:`divide-y divide-edge`,children:We.map(e=>{let r=e.voiceAttachmentId||e.kind===`voice`?w:e.kind===`bookmark`?ue:te,i=Ee(e)||(e.coverAttachmentId?t.imageNote:t.noText);return(0,z.jsxs)(`li`,{className:`group flex min-w-0 items-center gap-3 py-4`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Ye(e.id),className:`flex min-w-0 flex-1 items-center gap-3 rounded-md text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,z.jsx)(`span`,{className:`flex h-10 w-8 shrink-0 items-center justify-center rounded-md border border-edge text-fg-muted`,children:(0,z.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg group-hover:text-accent-fg`,children:e.title||i.slice(0,48)||t.titlePlaceholder}),(0,z.jsxs)(`span`,{className:`mt-1 flex min-w-0 items-center gap-1.5 text-xs text-fg-muted`,children:[e.lastEditTrigger===`ai_edit`?(0,z.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-accent-fg`,children:[(0,z.jsx)(me,{className:`size-3`,"aria-hidden":!0}),n.agentEditLabel,(0,z.jsx)(`span`,{"aria-hidden":!0,children:`·`})]}):null,(0,z.jsx)(`span`,{className:`truncate`,children:i})]})]})]}),(0,z.jsx)(`span`,{className:`hidden max-w-32 truncate text-xs text-fg-muted md:block`,title:e.projects?.map(e=>e.name).join(` · `),children:e.projects?.map(e=>e.name).join(` · `)||n.unassigned}),(0,z.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`hidden w-24 shrink-0 text-right text-xs text-fg-muted sm:block`,children:xe(e.updatedAt,qe,Ke)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Qe(e.id,!e.pinned),disabled:Oe.has(e.id),"aria-label":`${e.pinned?n.unfavorite:n.favorite}: ${e.title||t.titlePlaceholder}`,"aria-pressed":!!e.pinned,className:`inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:(0,z.jsx)(b,{className:p(`size-4`,e.pinned&&`fill-current text-fg`),"aria-hidden":!0})}),(0,z.jsxs)(ie,{children:[(0,z.jsx)(_e,{asChild:!0,children:(0,z.jsx)(`button`,{type:`button`,disabled:Me===e.id,"aria-label":`${t.noteActions}: ${e.title||t.titlePlaceholder}`,className:`inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:Me===e.id?(0,z.jsx)(u,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,z.jsx)(oe,{className:`size-4`,"aria-hidden":!0})})}),(0,z.jsx)(ve,{children:(0,z.jsx)(ye,{align:`end`,sideOffset:4,className:`z-50 min-w-36 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:(0,z.jsxs)(le,{className:`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft`,onSelect:()=>je(e),children:[(0,z.jsx)(se,{className:`size-4`,"aria-hidden":!0}),t.delete]})})})]})]},e.id)})}),!Ge&&!Re&&X>0?(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 text-xs text-fg-muted`,"aria-live":`polite`,children:[(0,z.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(X))}),X>12||K>0?(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":n.previousPage,disabled:K===0,className:V,onClick:()=>j(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(K-1)),t}),children:(0,z.jsx)(x,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsxs)(`span`,{children:[K+1,` / `,Math.max(1,Math.ceil(X/12))]}),(0,z.jsx)(`button`,{type:`button`,"aria-label":n.nextPage,disabled:(K+1)*12>=X,className:V,onClick:()=>j(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(K+1)),t}),children:(0,z.jsx)(ge,{className:`size-4`,"aria-hidden":!0})})]}):null]}):null]})]})}),(0,z.jsx)(ne,{open:Ae!==null,title:t.deleteConfirmTitle,description:t.deleteConfirmDescription.replace(`{{title}}`,Ae?.title||t.titlePlaceholder),confirmLabel:t.deleteConfirmLabel,cancelLabel:t.deleteCancelLabel,destructive:!0,onConfirm:()=>void $e(),onCancel:()=>je(null)})]})}function U(){let e=(0,R.c)(12),{noteId:t}=o(),n=i(),[r]=a(),s;e[0]===r?s=e[1]:(s=l(r.get(`returnTo`),`/notes`,[`/chat`,`/projects`,`/notes`,`/tasks`]),e[0]=r,e[1]=s);let c=s,u;e[2]!==n||e[3]!==c?(u=()=>{n(c)},e[2]=n,e[3]=c,e[4]=u):u=e[4];let d=u;if(!t)return null;let f=r.get(`edit`)===`1`?`wysiwyg`:`preview`,p;e[5]===r?p=e[6]:(p=r.get(`edit`),e[5]=r,e[6]=p);let m=p===`1`,h;return e[7]!==d||e[8]!==t||e[9]!==f||e[10]!==m?(h=(0,z.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-6xl flex-1 flex-col`,children:(0,z.jsx)(I,{noteId:t,onBack:d,initialMode:f,autoFocus:m},t)}),e[7]=d,e[8]=t,e[9]=f,e[10]=m,e[11]=h):h=e[11],h}function De(){let e=(0,R.c)(2),{noteId:t}=o(),n;return e[0]===t?n=e[1]:(n=t?(0,z.jsx)(U,{}):(0,z.jsx)(H,{}),e[0]=t,e[1]=n),n}export{De as NotesPage};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-JdwAhgNB.js";import{us as a}from"./index-CfQor-TM.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-accent-soft text-accent-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=n.findIndex(e=>e.id===r);t<0||l(n[(t+(e.key===`ArrowRight`?1:-1)+n.length)%n.length].id)},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-[10px] tabular-nums text-fg-subtle`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-JdwAhgNB.js";import{us as a}from"./index-5UchbidQ.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-accent-soft text-accent-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=n.findIndex(e=>e.id===r);t<0||l(n[(t+(e.key===`ArrowRight`?1:-1)+n.length)%n.length].id)},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-[10px] tabular-nums text-fg-subtle`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{t as a}from"./createLucideIcon-DPHK1VkS.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./cn-JdwAhgNB.js";import{a as c,f as l,g as u,h as d,i as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y}from"./es2015-DBLcMg5B.js";import{i as b,n as x}from"./dist-CxGUk8J-.js";import{a as S,i as C,n as w,r as T,t as E}from"./dist-CI_fqRk-.js";import{t as D}from"./skeleton-BwbyijEw.js";import{a as O,s as k,t as A}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as ee,r as j}from"./settings-shell-layer-context-DCp6ykjQ.js";var M=a(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),N=r(),P=t({Anchor:()=>me,Arrow:()=>_e,Close:()=>ge,Content:()=>he,Popover:()=>V,PopoverAnchor:()=>H,PopoverArrow:()=>Y,PopoverClose:()=>J,PopoverContent:()=>q,PopoverPortal:()=>G,PopoverTrigger:()=>U,Portal:()=>Q,Root:()=>X,Trigger:()=>Z,createPopoverScope:()=>te}),F=e(n(),1),I=i(),L=`Popover`,[R,te]=d(L,[S]),z=S(),[ne,B]=R(L),V=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=z(t),c=F.useRef(null),[u,d]=F.useState(!1),[f,p]=l({prop:r,defaultProp:i??!1,onChange:a,caller:L});return(0,I.jsx)(C,{...s,children:(0,I.jsx)(ne,{scope:t,contentId:h(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:F.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:F.useCallback(()=>d(!0),[]),onCustomAnchorRemove:F.useCallback(()=>d(!1),[]),modal:o,children:n})})};V.displayName=L;var re=`PopoverAnchor`,H=F.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B(re,n),a=z(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return F.useEffect(()=>(o(),()=>s()),[o,s]),(0,I.jsx)(E,{...a,...r,ref:t})});H.displayName=re;var ie=`PopoverTrigger`,U=F.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B(ie,n),a=z(n),o=b(t,i.triggerRef),s=(0,I.jsx)(y.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":pe(i.open),...r,ref:o,onClick:u(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(E,{asChild:!0,...a,children:s})});U.displayName=ie;var W=`PopoverPortal`,[ae,oe]=R(W,{forceMount:void 0}),G=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=B(W,t);return(0,I.jsx)(ae,{scope:t,forceMount:n,children:(0,I.jsx)(f,{present:n||a.open,children:(0,I.jsx)(c,{asChild:!0,container:i,children:r})})})};G.displayName=W;var K=`PopoverContent`,q=F.forwardRef((e,t)=>{let n=oe(K,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=B(K,e.__scopePopover);return(0,I.jsx)(f,{present:r||a.open,children:a.modal?(0,I.jsx)(ce,{...i,ref:t}):(0,I.jsx)(le,{...i,ref:t})})});q.displayName=K;var se=x(`PopoverContent.RemoveScroll`),ce=F.forwardRef((e,t)=>{let n=B(K,e.__scopePopover),r=F.useRef(null),i=b(t,r),a=F.useRef(!1);return F.useEffect(()=>{let e=r.current;if(e)return v(e)},[]),(0,I.jsx)(p,{as:se,allowPinchZoom:!0,children:(0,I.jsx)(ue,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:u(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:u(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:u(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),le=F.forwardRef((e,t)=>{let n=B(K,e.__scopePopover),r=F.useRef(!1),i=F.useRef(!1);return(0,I.jsx)(ue,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),ue=F.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=B(K,n),p=z(n);return g(),(0,I.jsx)(m,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(_,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,I.jsx)(T,{"data-state":pe(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),de=`PopoverClose`,J=F.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B(de,n);return(0,I.jsx)(y.button,{type:`button`,...r,ref:t,onClick:u(e.onClick,()=>i.onOpenChange(!1))})});J.displayName=de;var fe=`PopoverArrow`,Y=F.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=z(n);return(0,I.jsx)(w,{...i,...r,ref:t})});Y.displayName=fe;function pe(e){return e?`open`:`closed`}var X=V,me=H,Z=U,Q=G,he=q,ge=J,_e=Y;function ve(e,t=!1){if(!t)return A;switch(e){case`modal`:return O;case`page`:return k;default:return`z-50`}}function ye(e){let t=(0,N.c)(14),{options:n,values:r,multiple:i,onChange:a,ariaLabel:o}=e,c=i===void 0?!1:i,l=(0,F.useId)(),u;if(t[0]!==c||t[1]!==l||t[2]!==a||t[3]!==n||t[4]!==r){let e;t[6]!==c||t[7]!==l||t[8]!==a||t[9]!==r?(e=e=>(0,I.jsxs)(`label`,{className:s(`flex min-h-10 min-w-0 items-center gap-3 rounded-md px-2 py-2 text-sm text-fg has-focus-visible:ring-2 has-focus-visible:ring-accent`,e.disabled?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-hover`),children:[(0,I.jsx)(`input`,{type:c?`checkbox`:`radio`,name:l,value:e.value,checked:r.includes(e.value),disabled:e.disabled,className:`shrink-0 accent-accent`,onChange:t=>a(c?t.target.checked?[...r,e.value]:r.filter(t=>t!==e.value):[e.value])}),e.icon,(0,I.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.label})]},e.value),t[6]=c,t[7]=l,t[8]=a,t[9]=r,t[10]=e):e=t[10],u=n.map(e),t[0]=c,t[1]=l,t[2]=a,t[3]=n,t[4]=r,t[5]=u}else u=t[5];let d;return t[11]!==o||t[12]!==u?(d=(0,I.jsx)(`fieldset`,{"aria-label":o,className:`min-w-0 space-y-0.5`,children:u}),t[11]=o,t[12]=u,t[13]=d):d=t[13],d}var be=`flex max-h-[min(20rem,var(--radix-popover-content-available-height))] flex-col overflow-hidden`,xe=`min-h-0 flex-1 overflow-y-auto overscroll-y-contain touch-pan-y [scrollbar-gutter:stable]`;function Se({value:e,options:t,placeholder:n,allowEmpty:r=!0,emptyLabel:i=n,emptyDisabled:a=!1,disabledValues:c,disabled:l,id:u,ariaLabel:d,ariaLabelledBy:f,title:p,triggerClassName:m,triggerIcon:h,contentClassName:g,side:_=`bottom`,align:v=`start`,onChange:y,searchPlaceholder:b,searchValue:x,onSearchChange:S,loading:C=!1,statusMessage:w,selectedLabel:T}){let[E,O]=(0,F.useState)(!1),k=ee(),A=j(),N=ve(k,A!==null),P=t.find(t=>t.value===e),L=T??P?.label??(e?`${e} · unavailable`:n),R;return(0,I.jsxs)(X,{open:E,onOpenChange:O,children:[(0,I.jsx)(Z,{asChild:!0,children:(0,I.jsxs)(`button`,{id:u,type:`button`,"aria-label":d,"aria-labelledby":f,title:p,disabled:l,className:s(`box-border flex h-10 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-edge bg-surface-subtle px-3 text-left text-sm font-normal text-fg`,`hover:border-edge-strong focus-visible:outline-none focus-visible:border-edge-strong`,l&&`cursor-not-allowed opacity-50 hover:border-edge`,m),children:[h,(0,I.jsx)(`span`,{className:s(`min-w-0 truncate`,!e&&`text-fg-subtle`),children:L}),(0,I.jsx)(M,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})}),(0,I.jsx)(Q,{container:A??void 0,children:(0,I.jsxs)(he,{side:_,align:v,sideOffset:4,collisionPadding:8,className:s(N,be,`w-[var(--radix-popover-trigger-width)] min-w-[16rem] rounded-lg border border-edge bg-surface-panel p-1 shadow-popover outline-none`,g),children:[b?(0,I.jsx)(`input`,{type:`search`,"aria-label":b,placeholder:b,value:x,onChange:e=>S?.(e.target.value),className:`mb-1 w-full shrink-0 rounded-md bg-surface-base px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}):null,(0,I.jsxs)(`div`,{"data-select-scroll-region":!0,className:s(xe,`max-h-64`),children:[r?(0,I.jsxs)(`button`,{type:`button`,disabled:a,className:s(`flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,e===``&&`bg-surface-active font-medium`,a&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{a||(y(``),O(!1))},children:[(0,I.jsx)(o,{className:s(`size-4 shrink-0`,e!==``&&`invisible`),"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-fg-subtle`,children:i})]}):null,C?(0,I.jsx)(`div`,{className:`space-y-2 p-2`,"aria-busy":`true`,children:[0,1,2].map(e=>(0,I.jsx)(D,{className:`h-8 w-full`},e))}):null,w&&!C?(0,I.jsx)(`p`,{role:`status`,className:`px-3 py-2 text-xs text-fg-muted`,children:w}):null,(C?[]:t).map(t=>{let n=t.disabled===!0||c?.has(t.value)===!0&&t.value!==e,r=t.group&&t.group!==R;return R=t.group,(0,I.jsxs)(F.Fragment,{children:[r?(0,I.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-fg-subtle`,children:t.group}):null,(0,I.jsxs)(`button`,{type:`button`,disabled:n,className:s(`flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,t.value===e&&`bg-surface-active font-medium`,n&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{n||(y(t.value),O(!1))},children:[t.icon??(0,I.jsx)(o,{className:s(`size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label}),t.icon?(0,I.jsx)(o,{className:s(`ml-auto size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":!0}):null]})]},`${t.group??``}:${t.value}`)})]})]})})]})}function $(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map($).join(``):(0,F.isValidElement)(e)?$(e.props.children):``}function Ce(e,t){let n=[];return F.Children.forEach(e,e=>{if(!(0,F.isValidElement)(e))return;if(e.type===F.Fragment){n.push(...Ce(e.props.children,t));return}if(e.type===Te){let t=e.props;n.push(...Ce(t.children,$(t.label)));return}if(e.type!==we)return;let r=e.props,i=$(r.children).trim(),a=r.value==null?i:String(r.value);n.push({value:a,label:i,disabled:r.disabled,group:t})}),n}function we(e){return null}function Te(e){return null}function Ee(e){if(!e)return;let t=e.split(/\s+/).filter(Boolean).filter(e=>{let t=e.includes(`:`)?e.slice(e.lastIndexOf(`:`)+1):e;return t===`block`||t===`inline-block`||t===`inline-flex`||t===`flex`||t===`flex-1`||t===`flex-auto`||t===`flex-initial`||t===`flex-none`||t===`grow`||t===`shrink`||t===`min-w-0`||t===`min-h-0`||t.startsWith(`w-`)||t.startsWith(`min-w-`)||t.startsWith(`max-w-`)||t.startsWith(`basis-`)||t.startsWith(`grow-`)||t.startsWith(`shrink-`)||t.startsWith(`self-`)||t.startsWith(`order-`)||t.startsWith(`col-`)||t.startsWith(`row-`)});return t.length===0?void 0:t.join(` `)}function De(e){let t=(0,N.c)(66),n,r,i,a,o,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({align:n,children:r,className:i,contentClassName:a,disabled:o,id:c,onChange:l,placeholder:u,side:f,triggerClassName:p,value:m,...d}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=(0,F.useId)(),g=m==null?``:String(m),_,v,y,b,x,S,C,w,T,E;if(t[13]!==r||t[14]!==i||t[15]!==o||t[16]!==h||t[17]!==c||t[18]!==u||t[19]!==d.name||t[20]!==g){let e=Ce(r);b=e.find(ke),v=b!==void 0,y=b?.label||u||``,w=o||void 0,t[31]===i?T=t[32]:(T=Ee(i),t[31]=i,t[32]=T),E=d.name,_=Se,x=c??h,S=g,C=e.filter(Oe),t[13]=r,t[14]=i,t[15]=o,t[16]=h,t[17]=c,t[18]=u,t[19]=d.name,t[20]=g,t[21]=_,t[22]=v,t[23]=y,t[24]=b,t[25]=x,t[26]=S,t[27]=C,t[28]=w,t[29]=T,t[30]=E}else _=t[21],v=t[22],y=t[23],b=t[24],x=t[25],S=t[26],C=t[27],w=t[28],T=t[29],E=t[30];let D=u??y,O=b?.disabled===!0,k=d[`aria-label`],A=d[`aria-labelledby`],ee=d.title,j;t[33]!==i||t[34]!==p?(j=s(i,p),t[33]=i,t[34]=p,t[35]=j):j=t[35];let M;t[36]===l?M=t[37]:(M=e=>l?.({target:{value:e},currentTarget:{value:e}}),t[36]=l,t[37]=M);let P;t[38]!==_||t[39]!==n||t[40]!==v||t[41]!==a||t[42]!==o||t[43]!==y||t[44]!==d.title||t[45]!==f||t[46]!==x||t[47]!==A||t[48]!==j||t[49]!==M||t[50]!==S||t[51]!==C||t[52]!==D||t[53]!==O||t[54]!==k?(P=(0,I.jsx)(_,{id:x,value:S,options:C,placeholder:D,allowEmpty:v,emptyLabel:y,emptyDisabled:O,disabled:o,ariaLabel:k,ariaLabelledBy:A,title:ee,side:f,align:n,triggerClassName:j,contentClassName:a,onChange:M}),t[38]=_,t[39]=n,t[40]=v,t[41]=a,t[42]=o,t[43]=y,t[44]=d.title,t[45]=f,t[46]=x,t[47]=A,t[48]=j,t[49]=M,t[50]=S,t[51]=C,t[52]=D,t[53]=O,t[54]=k,t[55]=P):P=t[55];let L;t[56]!==o||t[57]!==d.name||t[58]!==g?(L=(0,I.jsx)(`input`,{name:d.name,value:g,readOnly:!0,hidden:!0,disabled:o}),t[56]=o,t[57]=d.name,t[58]=g,t[59]=L):L=t[59];let R;return t[60]!==P||t[61]!==L||t[62]!==w||t[63]!==T||t[64]!==E?(R=(0,I.jsxs)(`div`,{"aria-disabled":w,className:T,"data-select-name":E,children:[P,L]}),t[60]=P,t[61]=L,t[62]=w,t[63]=T,t[64]=E,t[65]=R):R=t[65],R}function Oe(e){return e.value!==``}function ke(e){return e.value===``}export{be as a,_e as c,Q as d,X as f,M as h,ye as i,ge as l,P as m,De as n,xe as o,Z as p,we as r,ve as s,Se as t,he as u};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./download-Dk-ZjtO6.js";import{t as r}from"./external-link-DjqjBmc3.js";import{t as i}from"./cn-JdwAhgNB.js";import{t as a}from"./electron-env-DH5wF8X8.js";import{us as o}from"./index-CfQor-TM.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=a()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=a()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=i(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,o.transition,o.press,o.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,o.transition,o.press,o.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=i(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-white shadow-sm`,o.transition,o.press,o.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(n,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};
1
+ import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./download-Dk-ZjtO6.js";import{t as r}from"./external-link-DjqjBmc3.js";import{t as i}from"./cn-JdwAhgNB.js";import{t as a}from"./electron-env-DH5wF8X8.js";import{us as o}from"./index-5UchbidQ.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=a()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=a()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=i(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,o.transition,o.press,o.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,o.transition,o.press,o.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=i(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-white shadow-sm`,o.transition,o.press,o.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(n,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{t as i}from"./markdown-view-B2IR4E2r.js";import{t as a}from"./button-B11EPpor.js";import{Yt as o,na as s}from"./index-CfQor-TM.js";function c(e){return e?{locale:`zh`,title:`交给我的事`,subtitle:`记住你交代的事,有进展时把成果带回来。`,cards:`助理带回的内容`,templates:`可以交代的事`,settings:`助理提醒`,levels:{off:`关闭`,quiet:`尽量安静`,balanced:`重要时找我`,active:`及时跟进`},inherit:`继承全局`,save:`保存`,saved:`已保存`,level:`什么时候找你`,delivery:`提醒方式`,inbox:`仅展示卡片`,important:`重要变化时通知`,scope:`关注项目`,enable:`启用`,enabled:`已启用`,paused:`已暂停`,instructions:`关注偏好`,instructionsHint:`例如:只有影响对外承诺时才提醒我。`,interval:`兜底检查间隔(分钟,留空跟随程度)`,connection:`会议准备需要已连接且允许主动分析的日历来源。`,eventOnly:`此模板由业务事件触发。`,meetingWindows:`会议前 24 小时和 2 小时检查。`,quietStart:`免打扰开始(小时)`,quietEnd:`免打扰结束(小时)`,timezone:`时区`,limit:`每日通知上限`,pause:`暂停一小时`,resume:`结束暂停`,privacy:`提醒频率不会改变助理可以查看或执行的范围;这些范围仍按每件事的授权执行。`,empty:`暂时没有需要关注的变化。你可以先交代一件事。`,all:`全部`,unread:`未读`,resolved:`已处理`,more:`下一页`,first:`返回首页`,whyNow:`为什么现在`,recommendation:`建议`,evidence:`依据`,investigated:`已检查`,read:`标为已读`,resolve:`已处理`,snooze:`一小时后`,less:`少提醒这类`,pauseTemplate:`暂停此服务`,expired:`已过期`,result:`执行结果`,retry:`重试`,close:`返回卡片列表`,runs:`进展记录`,noRuns:`还没有进展记录`,lastCheck:`上次核对`,nextCheck:`下次核对`,chooseProject:`选择项目`,choose:`选择`,loading:`正在处理`,kinds:{briefing:`简报`,reminder:`提醒`,risk:`风险`,recommendation:`建议`,decision:`待决定`,receipt:`执行回执`}}:{locale:`en`,title:`Delegated work`,subtitle:`Remember what you delegate and bring useful results back.`,cards:`Assistant updates`,templates:`Things to delegate`,settings:`Assistant notifications`,levels:{off:`Off`,quiet:`Keep it quiet`,balanced:`When it matters`,active:`Keep me updated`},inherit:`Use global level`,save:`Save`,saved:`Saved`,level:`When should the assistant notify you?`,delivery:`Delivery`,inbox:`Show in Workbench only`,important:`Notify on important changes`,scope:`Project`,enable:`Enable`,enabled:`Enabled`,paused:`Paused`,instructions:`What matters to you`,instructionsHint:`For example: only alert me when an external commitment is affected.`,interval:`Fallback scan interval (minutes; blank uses level)`,connection:`Meeting preparation needs a connected calendar authorized for proactive analysis.`,eventOnly:`This template runs on business events.`,meetingWindows:`Checks 24 hours and 2 hours before meetings.`,quietStart:`Quiet hours start`,quietEnd:`Quiet hours end`,timezone:`Timezone`,limit:`Daily notification limit`,pause:`Pause for one hour`,resume:`Resume`,privacy:`Notification frequency does not change what the assistant can read or do. Each delegated item keeps its own permissions.`,empty:`No changes need attention yet. Delegate something to get started.`,all:`All`,unread:`Unread`,resolved:`Resolved`,more:`Next page`,first:`First page`,whyNow:`Why now`,recommendation:`Recommendation`,evidence:`Evidence`,investigated:`Checked`,read:`Mark read`,resolve:`Resolve`,snooze:`In one hour`,less:`Fewer alerts like this`,pauseTemplate:`Pause service`,expired:`Expired`,result:`Result`,retry:`Retry`,close:`Back to updates`,runs:`Progress`,noRuns:`No progress yet`,lastCheck:`Last checked`,nextCheck:`Next check`,chooseProject:`Choose a project`,choose:`Choose`,loading:`Working`,kinds:{briefing:`Briefing`,reminder:`Reminder`,risk:`Risk`,recommendation:`Recommendation`,decision:`Decision`,receipt:`Receipt`}}}function l(e,t,n){if(n!==`zh`)return t;let r={communication_follow_up:[`邮件跟进`,`关注已委托的邮件往来,准备跟进草稿并持续等待回复。`],meeting_preparation:[`会议准备`,`在会议前检查议程与资料,提示需要提前准备的事项。`],project_delivery_risk:[`项目交付风险`,`关注项目任务、依赖与承诺,发现可能影响交付的变化。`],automation_failure_impact:[`自动化失败影响`,`分析自动化故障的实际影响,提醒需要你处理的问题。`],blocked_work:[`工作阻塞`,`检查受阻任务及依赖,指出下一步可以推进的工作。`],discussion_follow_up:[`讨论后续`,`关注讨论中的结论与未完成事项,提示需要跟进的行动。`]}[e];return r?{title:r[0],description:r[1]}:t}function u(e,t){return t===`zh`?{approval_required:`等待确认`,executing:`正在执行`,rejected:`已拒绝`,completed:`已完成`,insight:`已生成卡片`,below_threshold:`未达到提醒标准`,succeeded:`检查完成`,succeeded_with_insight:`已生成卡片`,succeeded_no_insight:`无须提醒`,no_insight:`无须提醒`,running:`检查中`,pending:`等待检查`,retryable:`等待重试`,failed:`检查失败`,discarded:`已取消`,unchanged:`内容未变化`,routine:`常规变化`,insufficient_evidence:`证据不足`,duplicate:`重复发现`,disabled:`服务已关闭`,source_changed:`资料已变化,将按最新情况继续检查`,source_unavailable:`来源不可用`,low_value:`未达到提醒标准`,policy_changed:`设置已变化`}[e]??e.replaceAll(`_`,` `):e.replaceAll(`_`,` `)}function d(e,t){return e.project?.name??l(e.scenarioKey,{title:e.scenarioKey.replaceAll(`_`,` `),description:``},t?`zh`:`en`).title}function f(e){return e.completedAt?`completed`:e.effectiveEnabled?`active`:`paused`}function p(e){return e.status===`completed`?`completed`:e.status===`watching`&&e.enabled?`active`:`paused`}function m(e,t){if(e.completedAt)return t?`这件事已结束`:`This work has ended`;if(!e.effectiveEnabled)return t?`已暂停,恢复后继续跟进`:`Paused until you resume it`;if(e.pending)return t?`正在核对最新情况`:`Checking the latest context`;if(e.latestRun?.error)return t?`最近一次核对未完成`:`The latest check did not finish`;let n=e.latestRun?.reason??e.latestRun?.status;return[`no_insight`,`succeeded_no_insight`,`below_threshold`,`low_value`,`unchanged`,`routine`].includes(n??``)?t?`已核对,暂无需要你处理的变化`:`Checked; nothing needs your attention`:[`insight`,`succeeded_with_insight`].includes(n??``)?t?`已准备一项新内容`:`A new result is ready`:n===`approval_required`?t?`有一项决定等你处理`:`A decision needs your attention`:e.latestRun?t?`已完成最近一次核对`:`The latest check is complete`:t?`已记住,等待相关变化`:`Remembered and waiting for a relevant change`}function h(e,t){return e.completedAt?t?`不会再跟进`:`No more follow-up`:e.effectiveEnabled?e.schedule?.nextDueAt?`${t?`下次核对`:`Next check`} ${y(e.schedule.nextDueAt,t)}`:t?`相关资料变化时继续`:`Continues when related context changes`:t?`恢复后继续`:`Continues when resumed`}function g(e,t){return e.filter(e=>e.subscriptionId===t).sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt))[0]}function _(e,t){return e?e.decision?`${t?`等你决定`:`Waiting for your decision`}:${e.title}`:e.artifact?`${t?`最新成果`:`Latest result`}:${e.artifact.title}`:`${t?`最新变化`:`Latest update`}:${e.title}`:t?`还没有需要交付的新成果`:`No new result needs delivery yet`}function v(e,t){return e.status===`completed`?t?`这件事已结束`:`This work has ended`:e.status===`paused`||!e.enabled?t?`已暂停,恢复后继续跟进`:`Paused until you resume it`:e.sourceAvailable?e.syncFailed?t?`最近一次邮箱同步未完成`:`The latest email sync did not finish`:e.latestDirection===`sent`?t?`已同步发件,继续等待回复`:`Sent message found; waiting for a reply`:t?`正在等待回复或约定时间`:`Waiting for a reply or the agreed time`:t?`需要重新连接邮箱`:`Reconnect the email account`}function y(e,t){return new Date(e).toLocaleString(t?`zh-CN`:`en-US`)}function b(e,t){return[`no_insight`,`succeeded_no_insight`,`below_threshold`,`low_value`,`unchanged`,`routine`].includes(e)?t?`核对完成,没有需要你处理的变化`:`Checked; nothing needed your attention`:[`insight`,`succeeded_with_insight`].includes(e)?t?`准备了一项新内容`:`Prepared a new result`:e===`approval_required`?t?`发现一项需要你决定的事`:`Found a decision that needs you`:e===`failed`||e===`retryable`?t?`这次核对没有完成`:`This check did not finish`:e===`running`||e===`pending`?t?`正在核对最新情况`:`Checking the latest context`:t?`完成了一次核对`:`Completed a check`}var x=e(t(),1),S=n();function C({card:e,copy:t,refresh:n,detail:c=!1}){let l=t.locale===`zh`,[d,f]=(0,x.useState)(!1),[p,m]=(0,x.useState)(``),[h,g]=(0,x.useState)(!1),[_,v]=(0,x.useState)(e.artifact?.content??``),[y,b]=(0,x.useState)(e.taskDraft),C=![`withdrawn`,`expired`,`resolved`].includes(e.status),w=`${e.communication?l?`继续办理这件事。请读取最新卡片、成果和邮件往来,展示完整草稿与收件人让我确认后再发送:`:`Read the latest card, artifact and email thread. Show the full draft and recipients for my approval before sending: `:l?`继续讨论这件事,请先读取最新卡片和成果:`:`Continue this work. First read the latest card and artifact: `}xopc_use mode=proactive command=${e.communication?`continue_card`:`get_card`} args={"id":"${e.id}"}`,T=e.communication?.sessionKey?`/chat/${encodeURIComponent(e.communication.sessionKey)}?${new URLSearchParams({draft:w,autoSend:`1`})}`:s(w,void 0,{projectScope:`none`}),E=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`;async function D(t,r={}){f(!0),m(``);try{await o(`/api/inbox/judgments/${encodeURIComponent(e.id)}/actions`,`POST`,{...r,actionId:t,expectedRevision:e.revision,idempotencyKey:crypto.randomUUID()}),g(!1),n()}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,S.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,S.jsxs)(`div`,{className:`mb-2 flex flex-wrap justify-between gap-2 text-xs text-fg-muted`,children:[(0,S.jsx)(`span`,{children:e.artifact?l?`已为你准备`:`Prepared for you`:t.kinds[e.kind]}),(0,S.jsx)(`time`,{dateTime:e.updatedAt,children:new Date(e.updatedAt).toLocaleString()})]}),(0,S.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e.title}),(0,S.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-sm text-fg-muted`,children:e.summary}),!c&&(0,S.jsx)(r,{className:`mt-4 inline-block text-sm font-medium text-accent`,to:`/assistant-work?item=${encodeURIComponent(e.id)}`,children:e.decision?l?`查看并决定`:`Review decision`:e.artifact?l?`打开准备好的成果`:`Open prepared work`:l?`查看变化`:`View update`}),c&&e.artifact&&(0,S.jsxs)(`section`,{className:`mt-5 border-t border-edge pt-5`,children:[(0,S.jsx)(`h3`,{className:`mb-3 font-medium text-fg`,children:e.artifact.title}),h?(0,S.jsxs)(`label`,{className:`text-sm`,children:[l?`编辑成果`:`Edit prepared work`,(0,S.jsx)(`textarea`,{rows:12,maxLength:12e3,className:E,value:_,onChange:e=>v(e.target.value)})]}):(0,S.jsx)(i,{content:e.artifact.content}),C&&!h&&(0,S.jsx)(a,{className:`mt-3`,variant:`ghost`,onClick:()=>{navigator.clipboard.writeText(e.artifact.content).catch(e=>m(String(e)))},children:l?`复制成果`:`Copy`}),C&&(0,S.jsx)(`div`,{className:`mt-3 flex gap-2`,children:h?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(a,{disabled:d||!_.trim(),onClick:()=>void D(`edit_artifact`,{artifact:{...e.artifact,content:_}}),children:t.save}),(0,S.jsx)(a,{variant:`ghost`,onClick:()=>{g(!1),v(e.artifact.content)},children:l?`取消`:`Cancel`})]}):(0,S.jsx)(a,{variant:`ghost`,onClick:()=>g(!0),children:l?`修改成果`:`Edit`})})]}),c&&e.decision&&C&&(0,S.jsxs)(`section`,{className:`mt-5 rounded-xl border border-edge p-4`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:e.decision.question}),y&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:l?`确认后创建项目待办,不会自动启动执行。`:`Creates a project task without starting execution.`}),(0,S.jsxs)(`label`,{className:`mt-3 block text-sm`,children:[l?`待办标题`:`Task title`,(0,S.jsx)(`input`,{className:E,maxLength:160,value:y.title,onChange:e=>b({...y,title:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`mt-3 block text-sm`,children:[l?`具体内容`:`Task objective`,(0,S.jsx)(`textarea`,{className:E,maxLength:1200,rows:4,value:y.objective,onChange:e=>b({...y,objective:e.target.value})})]})]}),(0,S.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.decision.options.map((e,t)=>(0,S.jsx)(a,{variant:t===0?`primary`:`ghost`,disabled:d||e.id===`approve`&&y!==void 0&&(!y.title.trim()||!y.objective.trim()),onClick:()=>void D(`decide`,{choice:e.id,...e.id===`approve`&&y?{taskDraft:y}:{}}),children:e.label},e.id))})]}),e.followUp&&(0,S.jsxs)(`div`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm`,children:[(0,S.jsx)(r,{className:`text-accent`,to:`/tasks/${encodeURIComponent(e.followUp.taskId)}`,children:e.followUp.title}),(0,S.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:e.followUp.phase===`closed`?l?`任务已结束:${e.followUp.resolution??`—`}`:`Task closed: ${e.followUp.resolution??`—`}`:l?`待办已创建,仍在跟进实际进展。`:`Task created; following its progress.`})]}),e.actionStatus===`failed`&&![`expired`,`withdrawn`].includes(e.status)&&(0,S.jsxs)(`div`,{className:`mt-3 text-sm text-danger`,children:[e.actionError,(0,S.jsx)(a,{disabled:d,onClick:()=>void D(`retry`),children:t.retry})]}),c&&(0,S.jsxs)(`details`,{className:`mt-4 text-sm text-fg-muted`,children:[(0,S.jsxs)(`summary`,{className:`cursor-pointer`,children:[t.whyNow,` · `,t.evidence]}),(0,S.jsx)(`p`,{className:`mt-2`,children:e.whyNow}),(0,S.jsx)(`ul`,{className:`mt-2 space-y-2`,children:e.evidence.map(e=>(0,S.jsxs)(`li`,{children:[e.route?(0,S.jsx)(r,{className:`text-accent`,to:e.route,children:e.label}):e.label,e.excerpt&&(0,S.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.excerpt})]},e.id))})]}),c&&C&&(0,S.jsx)(r,{className:`mt-4 inline-block text-sm text-accent`,to:T,children:e.communication?l?`审阅草稿并继续办理`:`Review draft and continue`:l?`接着聊这件事`:`Continue in chat`}),c&&C&&(0,S.jsxs)(`details`,{className:`mt-4 text-sm`,children:[(0,S.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:l?`调整或收起`:`Adjust or dismiss`}),(0,S.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,S.jsx)(a,{disabled:d,onClick:()=>void D(`handled`),children:l?`我已处理`:`Already handled`}),(0,S.jsx)(a,{disabled:d,onClick:()=>void D(`resolve`),children:l?`这条不用`:`Dismiss`}),(0,S.jsx)(a,{disabled:d,onClick:()=>void D(`snooze`),children:t.snooze}),(0,S.jsx)(r,{className:`p-2 text-accent`,to:e.communication?`/assistant-work?follow-up=${encodeURIComponent(e.communication.id)}`:`/assistant-work?delegation=${encodeURIComponent(e.subscriptionId)}`,children:l?`修改关注要求`:`Adjust instructions`})]})]}),!C&&(0,S.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:e.status===`resolved`?l?`已收起;事项进度以实际结果为准。`:`Dismissed; work progress is tracked separately.`:e.status===`expired`?l?`资料已变化或有效期已过,旧成果仅供参考。`:`Sources changed or this work expired. Review current context before acting.`:u(e.status,t.locale)}),p&&(0,S.jsxs)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:[p,(0,S.jsx)(a,{variant:`ghost`,onClick:n,children:l?`刷新最新内容`:`Refresh latest version`})]})]})}export{d as a,_ as c,b as d,c as f,m as i,p as l,f as n,y as o,h as r,g as s,C as t,v as u};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{t as i}from"./markdown-view-DF3aJP_5.js";import{t as a}from"./button-BA45yciM.js";import{Yt as o,na as s}from"./index-5UchbidQ.js";function c(e){return e?{locale:`zh`,title:`交给我的事`,subtitle:`记住你交代的事,有进展时把成果带回来。`,cards:`助理带回的内容`,templates:`可以交代的事`,settings:`助理提醒`,levels:{off:`关闭`,quiet:`尽量安静`,balanced:`重要时找我`,active:`及时跟进`},inherit:`继承全局`,save:`保存`,saved:`已保存`,level:`什么时候找你`,delivery:`提醒方式`,inbox:`仅展示卡片`,important:`重要变化时通知`,scope:`关注项目`,enable:`启用`,enabled:`已启用`,paused:`已暂停`,instructions:`关注偏好`,instructionsHint:`例如:只有影响对外承诺时才提醒我。`,interval:`兜底检查间隔(分钟,留空跟随程度)`,connection:`会议准备需要已连接且允许主动分析的日历来源。`,eventOnly:`此模板由业务事件触发。`,meetingWindows:`会议前 24 小时和 2 小时检查。`,quietStart:`免打扰开始(小时)`,quietEnd:`免打扰结束(小时)`,timezone:`时区`,limit:`每日通知上限`,pause:`暂停一小时`,resume:`结束暂停`,privacy:`提醒频率不会改变助理可以查看或执行的范围;这些范围仍按每件事的授权执行。`,empty:`暂时没有需要关注的变化。你可以先交代一件事。`,all:`全部`,unread:`未读`,resolved:`已处理`,more:`下一页`,first:`返回首页`,whyNow:`为什么现在`,recommendation:`建议`,evidence:`依据`,investigated:`已检查`,read:`标为已读`,resolve:`已处理`,snooze:`一小时后`,less:`少提醒这类`,pauseTemplate:`暂停此服务`,expired:`已过期`,result:`执行结果`,retry:`重试`,close:`返回卡片列表`,runs:`进展记录`,noRuns:`还没有进展记录`,lastCheck:`上次核对`,nextCheck:`下次核对`,chooseProject:`选择项目`,choose:`选择`,loading:`正在处理`,kinds:{briefing:`简报`,reminder:`提醒`,risk:`风险`,recommendation:`建议`,decision:`待决定`,receipt:`执行回执`}}:{locale:`en`,title:`Delegated work`,subtitle:`Remember what you delegate and bring useful results back.`,cards:`Assistant updates`,templates:`Things to delegate`,settings:`Assistant notifications`,levels:{off:`Off`,quiet:`Keep it quiet`,balanced:`When it matters`,active:`Keep me updated`},inherit:`Use global level`,save:`Save`,saved:`Saved`,level:`When should the assistant notify you?`,delivery:`Delivery`,inbox:`Show in Workbench only`,important:`Notify on important changes`,scope:`Project`,enable:`Enable`,enabled:`Enabled`,paused:`Paused`,instructions:`What matters to you`,instructionsHint:`For example: only alert me when an external commitment is affected.`,interval:`Fallback scan interval (minutes; blank uses level)`,connection:`Meeting preparation needs a connected calendar authorized for proactive analysis.`,eventOnly:`This template runs on business events.`,meetingWindows:`Checks 24 hours and 2 hours before meetings.`,quietStart:`Quiet hours start`,quietEnd:`Quiet hours end`,timezone:`Timezone`,limit:`Daily notification limit`,pause:`Pause for one hour`,resume:`Resume`,privacy:`Notification frequency does not change what the assistant can read or do. Each delegated item keeps its own permissions.`,empty:`No changes need attention yet. Delegate something to get started.`,all:`All`,unread:`Unread`,resolved:`Resolved`,more:`Next page`,first:`First page`,whyNow:`Why now`,recommendation:`Recommendation`,evidence:`Evidence`,investigated:`Checked`,read:`Mark read`,resolve:`Resolve`,snooze:`In one hour`,less:`Fewer alerts like this`,pauseTemplate:`Pause service`,expired:`Expired`,result:`Result`,retry:`Retry`,close:`Back to updates`,runs:`Progress`,noRuns:`No progress yet`,lastCheck:`Last checked`,nextCheck:`Next check`,chooseProject:`Choose a project`,choose:`Choose`,loading:`Working`,kinds:{briefing:`Briefing`,reminder:`Reminder`,risk:`Risk`,recommendation:`Recommendation`,decision:`Decision`,receipt:`Receipt`}}}function l(e,t,n){if(n!==`zh`)return t;let r={communication_follow_up:[`邮件跟进`,`关注已委托的邮件往来,准备跟进草稿并持续等待回复。`],meeting_preparation:[`会议准备`,`在会议前检查议程与资料,提示需要提前准备的事项。`],project_delivery_risk:[`项目交付风险`,`关注项目任务、依赖与承诺,发现可能影响交付的变化。`],automation_failure_impact:[`自动化失败影响`,`分析自动化故障的实际影响,提醒需要你处理的问题。`],blocked_work:[`工作阻塞`,`检查受阻任务及依赖,指出下一步可以推进的工作。`],discussion_follow_up:[`讨论后续`,`关注讨论中的结论与未完成事项,提示需要跟进的行动。`]}[e];return r?{title:r[0],description:r[1]}:t}function u(e,t){return t===`zh`?{approval_required:`等待确认`,executing:`正在执行`,rejected:`已拒绝`,completed:`已完成`,insight:`已生成卡片`,below_threshold:`未达到提醒标准`,succeeded:`检查完成`,succeeded_with_insight:`已生成卡片`,succeeded_no_insight:`无须提醒`,no_insight:`无须提醒`,running:`检查中`,pending:`等待检查`,retryable:`等待重试`,failed:`检查失败`,discarded:`已取消`,unchanged:`内容未变化`,routine:`常规变化`,insufficient_evidence:`证据不足`,duplicate:`重复发现`,disabled:`服务已关闭`,source_changed:`资料已变化,将按最新情况继续检查`,source_unavailable:`来源不可用`,low_value:`未达到提醒标准`,policy_changed:`设置已变化`}[e]??e.replaceAll(`_`,` `):e.replaceAll(`_`,` `)}function d(e,t){return e.project?.name??l(e.scenarioKey,{title:e.scenarioKey.replaceAll(`_`,` `),description:``},t?`zh`:`en`).title}function f(e){return e.completedAt?`completed`:e.effectiveEnabled?`active`:`paused`}function p(e){return e.status===`completed`?`completed`:e.status===`watching`&&e.enabled?`active`:`paused`}function m(e,t){if(e.completedAt)return t?`这件事已结束`:`This work has ended`;if(!e.effectiveEnabled)return t?`已暂停,恢复后继续跟进`:`Paused until you resume it`;if(e.pending)return t?`正在核对最新情况`:`Checking the latest context`;if(e.latestRun?.error)return t?`最近一次核对未完成`:`The latest check did not finish`;let n=e.latestRun?.reason??e.latestRun?.status;return[`no_insight`,`succeeded_no_insight`,`below_threshold`,`low_value`,`unchanged`,`routine`].includes(n??``)?t?`已核对,暂无需要你处理的变化`:`Checked; nothing needs your attention`:[`insight`,`succeeded_with_insight`].includes(n??``)?t?`已准备一项新内容`:`A new result is ready`:n===`approval_required`?t?`有一项决定等你处理`:`A decision needs your attention`:e.latestRun?t?`已完成最近一次核对`:`The latest check is complete`:t?`已记住,等待相关变化`:`Remembered and waiting for a relevant change`}function h(e,t){return e.completedAt?t?`不会再跟进`:`No more follow-up`:e.effectiveEnabled?e.schedule?.nextDueAt?`${t?`下次核对`:`Next check`} ${y(e.schedule.nextDueAt,t)}`:t?`相关资料变化时继续`:`Continues when related context changes`:t?`恢复后继续`:`Continues when resumed`}function g(e,t){return e.filter(e=>e.subscriptionId===t).sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt))[0]}function _(e,t){return e?e.decision?`${t?`等你决定`:`Waiting for your decision`}:${e.title}`:e.artifact?`${t?`最新成果`:`Latest result`}:${e.artifact.title}`:`${t?`最新变化`:`Latest update`}:${e.title}`:t?`还没有需要交付的新成果`:`No new result needs delivery yet`}function v(e,t){return e.status===`completed`?t?`这件事已结束`:`This work has ended`:e.status===`paused`||!e.enabled?t?`已暂停,恢复后继续跟进`:`Paused until you resume it`:e.sourceAvailable?e.syncFailed?t?`最近一次邮箱同步未完成`:`The latest email sync did not finish`:e.latestDirection===`sent`?t?`已同步发件,继续等待回复`:`Sent message found; waiting for a reply`:t?`正在等待回复或约定时间`:`Waiting for a reply or the agreed time`:t?`需要重新连接邮箱`:`Reconnect the email account`}function y(e,t){return new Date(e).toLocaleString(t?`zh-CN`:`en-US`)}function b(e,t){return[`no_insight`,`succeeded_no_insight`,`below_threshold`,`low_value`,`unchanged`,`routine`].includes(e)?t?`核对完成,没有需要你处理的变化`:`Checked; nothing needed your attention`:[`insight`,`succeeded_with_insight`].includes(e)?t?`准备了一项新内容`:`Prepared a new result`:e===`approval_required`?t?`发现一项需要你决定的事`:`Found a decision that needs you`:e===`failed`||e===`retryable`?t?`这次核对没有完成`:`This check did not finish`:e===`running`||e===`pending`?t?`正在核对最新情况`:`Checking the latest context`:t?`完成了一次核对`:`Completed a check`}var x=e(t(),1),S=n();function C({card:e,copy:t,refresh:n,detail:c=!1}){let l=t.locale===`zh`,[d,f]=(0,x.useState)(!1),[p,m]=(0,x.useState)(``),[h,g]=(0,x.useState)(!1),[_,v]=(0,x.useState)(e.artifact?.content??``),[y,b]=(0,x.useState)(e.taskDraft),C=![`withdrawn`,`expired`,`resolved`].includes(e.status),w=`${e.communication?l?`继续办理这件事。请读取最新卡片、成果和邮件往来,展示完整草稿与收件人让我确认后再发送:`:`Read the latest card, artifact and email thread. Show the full draft and recipients for my approval before sending: `:l?`继续讨论这件事,请先读取最新卡片和成果:`:`Continue this work. First read the latest card and artifact: `}xopc_use mode=proactive command=${e.communication?`continue_card`:`get_card`} args={"id":"${e.id}"}`,T=e.communication?.sessionKey?`/chat/${encodeURIComponent(e.communication.sessionKey)}?${new URLSearchParams({draft:w,autoSend:`1`})}`:s(w,void 0,{projectScope:`none`}),E=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`;async function D(t,r={}){f(!0),m(``);try{await o(`/api/inbox/judgments/${encodeURIComponent(e.id)}/actions`,`POST`,{...r,actionId:t,expectedRevision:e.revision,idempotencyKey:crypto.randomUUID()}),g(!1),n()}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,S.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,S.jsxs)(`div`,{className:`mb-2 flex flex-wrap justify-between gap-2 text-xs text-fg-muted`,children:[(0,S.jsx)(`span`,{children:e.artifact?l?`已为你准备`:`Prepared for you`:t.kinds[e.kind]}),(0,S.jsx)(`time`,{dateTime:e.updatedAt,children:new Date(e.updatedAt).toLocaleString()})]}),(0,S.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e.title}),(0,S.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-sm text-fg-muted`,children:e.summary}),!c&&(0,S.jsx)(r,{className:`mt-4 inline-block text-sm font-medium text-accent`,to:`/assistant-work?item=${encodeURIComponent(e.id)}`,children:e.decision?l?`查看并决定`:`Review decision`:e.artifact?l?`打开准备好的成果`:`Open prepared work`:l?`查看变化`:`View update`}),c&&e.artifact&&(0,S.jsxs)(`section`,{className:`mt-5 border-t border-edge pt-5`,children:[(0,S.jsx)(`h3`,{className:`mb-3 font-medium text-fg`,children:e.artifact.title}),h?(0,S.jsxs)(`label`,{className:`text-sm`,children:[l?`编辑成果`:`Edit prepared work`,(0,S.jsx)(`textarea`,{rows:12,maxLength:12e3,className:E,value:_,onChange:e=>v(e.target.value)})]}):(0,S.jsx)(i,{content:e.artifact.content}),C&&!h&&(0,S.jsx)(a,{className:`mt-3`,variant:`ghost`,onClick:()=>{navigator.clipboard.writeText(e.artifact.content).catch(e=>m(String(e)))},children:l?`复制成果`:`Copy`}),C&&(0,S.jsx)(`div`,{className:`mt-3 flex gap-2`,children:h?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(a,{disabled:d||!_.trim(),onClick:()=>void D(`edit_artifact`,{artifact:{...e.artifact,content:_}}),children:t.save}),(0,S.jsx)(a,{variant:`ghost`,onClick:()=>{g(!1),v(e.artifact.content)},children:l?`取消`:`Cancel`})]}):(0,S.jsx)(a,{variant:`ghost`,onClick:()=>g(!0),children:l?`修改成果`:`Edit`})})]}),c&&e.decision&&C&&(0,S.jsxs)(`section`,{className:`mt-5 rounded-xl border border-edge p-4`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:e.decision.question}),y&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:l?`确认后创建项目待办,不会自动启动执行。`:`Creates a project task without starting execution.`}),(0,S.jsxs)(`label`,{className:`mt-3 block text-sm`,children:[l?`待办标题`:`Task title`,(0,S.jsx)(`input`,{className:E,maxLength:160,value:y.title,onChange:e=>b({...y,title:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`mt-3 block text-sm`,children:[l?`具体内容`:`Task objective`,(0,S.jsx)(`textarea`,{className:E,maxLength:1200,rows:4,value:y.objective,onChange:e=>b({...y,objective:e.target.value})})]})]}),(0,S.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.decision.options.map((e,t)=>(0,S.jsx)(a,{variant:t===0?`primary`:`ghost`,disabled:d||e.id===`approve`&&y!==void 0&&(!y.title.trim()||!y.objective.trim()),onClick:()=>void D(`decide`,{choice:e.id,...e.id===`approve`&&y?{taskDraft:y}:{}}),children:e.label},e.id))})]}),e.followUp&&(0,S.jsxs)(`div`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm`,children:[(0,S.jsx)(r,{className:`text-accent`,to:`/tasks/${encodeURIComponent(e.followUp.taskId)}`,children:e.followUp.title}),(0,S.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:e.followUp.phase===`closed`?l?`任务已结束:${e.followUp.resolution??`—`}`:`Task closed: ${e.followUp.resolution??`—`}`:l?`待办已创建,仍在跟进实际进展。`:`Task created; following its progress.`})]}),e.actionStatus===`failed`&&![`expired`,`withdrawn`].includes(e.status)&&(0,S.jsxs)(`div`,{className:`mt-3 text-sm text-danger`,children:[e.actionError,(0,S.jsx)(a,{disabled:d,onClick:()=>void D(`retry`),children:t.retry})]}),c&&(0,S.jsxs)(`details`,{className:`mt-4 text-sm text-fg-muted`,children:[(0,S.jsxs)(`summary`,{className:`cursor-pointer`,children:[t.whyNow,` · `,t.evidence]}),(0,S.jsx)(`p`,{className:`mt-2`,children:e.whyNow}),(0,S.jsx)(`ul`,{className:`mt-2 space-y-2`,children:e.evidence.map(e=>(0,S.jsxs)(`li`,{children:[e.route?(0,S.jsx)(r,{className:`text-accent`,to:e.route,children:e.label}):e.label,e.excerpt&&(0,S.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.excerpt})]},e.id))})]}),c&&C&&(0,S.jsx)(r,{className:`mt-4 inline-block text-sm text-accent`,to:T,children:e.communication?l?`审阅草稿并继续办理`:`Review draft and continue`:l?`接着聊这件事`:`Continue in chat`}),c&&C&&(0,S.jsxs)(`details`,{className:`mt-4 text-sm`,children:[(0,S.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:l?`调整或收起`:`Adjust or dismiss`}),(0,S.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,S.jsx)(a,{disabled:d,onClick:()=>void D(`handled`),children:l?`我已处理`:`Already handled`}),(0,S.jsx)(a,{disabled:d,onClick:()=>void D(`resolve`),children:l?`这条不用`:`Dismiss`}),(0,S.jsx)(a,{disabled:d,onClick:()=>void D(`snooze`),children:t.snooze}),(0,S.jsx)(r,{className:`p-2 text-accent`,to:e.communication?`/assistant-work?follow-up=${encodeURIComponent(e.communication.id)}`:`/assistant-work?delegation=${encodeURIComponent(e.subscriptionId)}`,children:l?`修改关注要求`:`Adjust instructions`})]})]}),!C&&(0,S.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:e.status===`resolved`?l?`已收起;事项进度以实际结果为准。`:`Dismissed; work progress is tracked separately.`:e.status===`expired`?l?`资料已变化或有效期已过,旧成果仅供参考。`:`Sources changed or this work expired. Review current context before acting.`:u(e.status,t.locale)}),p&&(0,S.jsxs)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:[p,(0,S.jsx)(a,{variant:`ghost`,onClick:n,children:l?`刷新最新内容`:`Refresh latest version`})]})]})}export{d as a,_ as c,b as d,c as f,m as i,p as l,f as n,y as o,h as r,g as s,C as t,v as u};