@xopcai/xopc 0.0.346 → 0.0.347

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 (109) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-M2vuj6W3.js → agent-avatar-dicebear-CoiIwwcu.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-B_d0WGFm.js → agent-defaults-settings-panel-CMnbBav3.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agent-plugin-dialog-egTQDEeV.js → agent-plugin-dialog-SJIZZLqo.js} +1 -1
  6. package/dist/gateway/static/root/assets/{agents-BbwmG8Kl.js → agents-CB-eDUCf.js} +3 -3
  7. package/dist/gateway/static/root/assets/{agents-admin-api-Dlw9XxYa.js → agents-admin-api-DZsBZ9R6.js} +1 -1
  8. package/dist/gateway/static/root/assets/{app-management-settings-panel-IxWZDAeT.js → app-management-settings-panel-6zwkqMLD.js} +1 -1
  9. package/dist/gateway/static/root/assets/{appearance-settings-C56szwjn.js → appearance-settings-DiWUyQlA.js} +1 -1
  10. package/dist/gateway/static/root/assets/{apps-page-Cqoc4xoi.js → apps-page-Dhtxj66a.js} +1 -1
  11. package/dist/gateway/static/root/assets/{archive-plugin-Ce3TNO-R.js → archive-plugin-12JlrV5S.js} +1 -1
  12. package/dist/gateway/static/root/assets/{automations-page-4so9_Bya.js → automations-page-DkCvD50d.js} +1 -1
  13. package/dist/gateway/static/root/assets/{automations-workspace-CP3GH1iA.js → automations-workspace-BWrYnsIk.js} +1 -1
  14. package/dist/gateway/static/root/assets/{binary-plugins-l6tKp21u.js → binary-plugins-PhtCEjXI.js} +1 -1
  15. package/dist/gateway/static/root/assets/{block-editor-cj2RNjQs.js → block-editor-ClfFgVfs.js} +1 -1
  16. package/dist/gateway/static/root/assets/{browser-automation-inputs-C9W2EklQ.js → browser-automation-inputs-BgK2Ma4E.js} +1 -1
  17. package/dist/gateway/static/root/assets/{browser-automations-page-CbTkFxIX.js → browser-automations-page-Cln2uM_F.js} +1 -1
  18. package/dist/gateway/static/root/assets/{browser-settings-page-KMfDs9dO.js → browser-settings-page-BtqTwprD.js} +1 -1
  19. package/dist/gateway/static/root/assets/{capabilities-Co9ZxHHB.js → capabilities-C2vyJC-B.js} +1 -1
  20. package/dist/gateway/static/root/assets/{capabilities-page-cm2Q7EfF.js → capabilities-page-eKbC_K_v.js} +2 -2
  21. package/dist/gateway/static/root/assets/{capabilities-settings-panel-CIe5qsxW.js → capabilities-settings-panel-Cga_BvtH.js} +1 -1
  22. package/dist/gateway/static/root/assets/{capability-header-actions-D2ASOs4Z.js → capability-header-actions-BlSn4DO-.js} +1 -1
  23. package/dist/gateway/static/root/assets/{channels-D-DnLz_c.js → channels-CUNI7YuR.js} +1 -1
  24. package/dist/gateway/static/root/assets/{chat-terminal-dock-DaQrqzCz.js → chat-terminal-dock-CjJ3yFld.js} +1 -1
  25. package/dist/gateway/static/root/assets/computer-settings-page-L7oHWFBe.js +1 -0
  26. package/dist/gateway/static/root/assets/{connector-service-page-Cq7t7AJq.js → connector-service-page-5522WTzU.js} +1 -1
  27. package/dist/gateway/static/root/assets/{connectors-page-BH53KX8Y.js → connectors-page-C2AUOcWz.js} +1 -1
  28. package/dist/gateway/static/root/assets/{date-picker-CcfRQKmj.js → date-picker-CX-fcLaj.js} +1 -1
  29. package/dist/gateway/static/root/assets/{dependency-picker-b9Tif8dg.js → dependency-picker-aQFvZft6.js} +1 -1
  30. package/dist/gateway/static/root/assets/{desktop-pet-BHe6Cb51.js → desktop-pet-C4Uhyxe8.js} +1 -1
  31. package/dist/gateway/static/root/assets/{desktop-pet-settings-wgA6yOo1.js → desktop-pet-settings-Cfe9_J1_.js} +1 -1
  32. package/dist/gateway/static/root/assets/{device-pairing-wizard-fv8c6u1o.js → device-pairing-wizard-CKpSUyhq.js} +1 -1
  33. package/dist/gateway/static/root/assets/{directory-picker-path-field-DM2YpM4N.js → directory-picker-path-field-C8SJyIWD.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-debug-page-B-Y_Zk8L.js → extension-debug-page-D6cI3rxD.js} +1 -1
  35. package/dist/gateway/static/root/assets/{extension-page-BC1m3MlB.js → extension-page-hAhyhLBd.js} +1 -1
  36. package/dist/gateway/static/root/assets/{extension-settings-page-Cu3cfeJj.js → extension-settings-page-BaVBR7JT.js} +1 -1
  37. package/dist/gateway/static/root/assets/{gateway-config-swr-ukBQYwfH.js → gateway-config-swr-COCA8geG.js} +1 -1
  38. package/dist/gateway/static/root/assets/{gateway-realtime-DvNfXjan.js → gateway-realtime-Blcloycq.js} +1 -1
  39. package/dist/gateway/static/root/assets/gateway-realtime-store-B87bp5kF.js +1 -0
  40. package/dist/gateway/static/root/assets/{gateway-settings-pxmn3b8n.js → gateway-settings-CDbZ2_6H.js} +1 -1
  41. package/dist/gateway/static/root/assets/{gateway-startup-retry-CVpOj205.js → gateway-startup-retry-CradGmBo.js} +1 -1
  42. package/dist/gateway/static/root/assets/{home-page-DOsvv2rU.js → home-page-B7KbsJKW.js} +1 -1
  43. package/dist/gateway/static/root/assets/{image-generation-api-zxx0qG9z.js → image-generation-api-CCe_-wBX.js} +1 -1
  44. package/dist/gateway/static/root/assets/{imports-page-CWYDLeqJ.js → imports-page-B86kmOio.js} +1 -1
  45. package/dist/gateway/static/root/assets/{index-DsIQD44S.js → index-BXK396ki.js} +8 -8
  46. package/dist/gateway/static/root/assets/index-DUAz4R7d.css +1 -0
  47. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BEkTI6mv.js → keyboard-shortcuts-settings-hrPwzRF0.js} +1 -1
  48. package/dist/gateway/static/root/assets/{local-app-workbench-page-aSXZL05r.js → local-app-workbench-page-xxr8vk61.js} +1 -1
  49. package/dist/gateway/static/root/assets/{local-apps-page-BJThsekO.js → local-apps-page-DjGpad5m.js} +1 -1
  50. package/dist/gateway/static/root/assets/{local-session-drafts-Dt_Yx7kq.js → local-session-drafts-CIcrQnQp.js} +1 -1
  51. package/dist/gateway/static/root/assets/{locale-store-B008NR-f.js → locale-store-K7mHrs6W.js} +1 -1
  52. package/dist/gateway/static/root/assets/{logs-page-WlqqTmpk.js → logs-page-BaNpykh9.js} +1 -1
  53. package/dist/gateway/static/root/assets/{management-settings-j_npowOA.js → management-settings-BFX3uxYe.js} +1 -1
  54. package/dist/gateway/static/root/assets/{markdown-view-BjDzimRP.js → markdown-view-BNVvybMV.js} +1 -1
  55. package/dist/gateway/static/root/assets/{media-plugins-DhYWGP6O.js → media-plugins-N8-QJc33.js} +1 -1
  56. package/dist/gateway/static/root/assets/messages-CY3XVeek.js +3 -0
  57. package/dist/gateway/static/root/assets/{note-detail-panel-CYcNB2Pf.js → note-detail-panel-Cd2Xn69o.js} +3 -3
  58. package/dist/gateway/static/root/assets/notes-page-Bsl4HbT9.js +8 -0
  59. package/dist/gateway/static/root/assets/{page-context-capture-button-BfmOqRGN.js → page-context-capture-button-BmgyQ8lB.js} +1 -1
  60. package/dist/gateway/static/root/assets/{page-tabs-aFGUXE53.js → page-tabs-yZZdLTLc.js} +1 -1
  61. package/dist/gateway/static/root/assets/{preview-open-alternatives-BCEnqJTC.js → preview-open-alternatives-BWqdZ75S.js} +1 -1
  62. package/dist/gateway/static/root/assets/{product-open-page-DHcx6kDT.js → product-open-page-ysuSrfYK.js} +1 -1
  63. package/dist/gateway/static/root/assets/{project-detail-page-ChKkovsq.js → project-detail-page-Cw4eSr4K.js} +1 -1
  64. package/dist/gateway/static/root/assets/{projects-page-Lt3HXMRm.js → projects-page-B2Y4n5sK.js} +1 -1
  65. package/dist/gateway/static/root/assets/{registry-api-EPj5O77m.js → registry-api-DKxVZeHC.js} +1 -1
  66. package/dist/gateway/static/root/assets/{remote-access-hub-B94Vc-fj.js → remote-access-hub-DYwr2taY.js} +1 -1
  67. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DNU19xEH.js → runtime-tools-settings-panel-C8OZvZxC.js} +1 -1
  68. package/dist/gateway/static/root/assets/{scenes-page-BgzfnfOB.js → scenes-page-R9FSDMyC.js} +1 -1
  69. package/dist/gateway/static/root/assets/{schema-form-MKBLqh8C.js → schema-form-DEK9fasz.js} +1 -1
  70. package/dist/gateway/static/root/assets/{session-api-D5BlAIge.js → session-api-DoE_8MbN.js} +1 -1
  71. package/dist/gateway/static/root/assets/{session-manager-DcFS0yfO.js → session-manager-B9ZJw1W4.js} +1 -1
  72. package/dist/gateway/static/root/assets/{sessions-page-sYWhgEMH.js → sessions-page-BpFoEKF1.js} +1 -1
  73. package/dist/gateway/static/root/assets/settings-advanced-gate-DjmP_P8-.js +1 -0
  74. package/dist/gateway/static/root/assets/{settings-form-section-C2gcfyxy.js → settings-form-section-DEWe2yXX.js} +1 -1
  75. package/dist/gateway/static/root/assets/{settings-page-CYd6_yBb.js → settings-page-J9m511lP.js} +1 -1
  76. package/dist/gateway/static/root/assets/{setup-status-panel-CUbH_YtB.js → setup-status-panel-CzXfd8sp.js} +1 -1
  77. package/dist/gateway/static/root/assets/{share-preview-page-Dxwq4fx1.js → share-preview-page-CfN124hX.js} +1 -1
  78. package/dist/gateway/static/root/assets/{shares-settings-CqwHm0Mf.js → shares-settings-CTsg7oUv.js} +1 -1
  79. package/dist/gateway/static/root/assets/{skill-api-C9k6G-tI.js → skill-api-DKKacicr.js} +1 -1
  80. package/dist/gateway/static/root/assets/skill-reload-api-CPUdkUW4.js +1 -0
  81. package/dist/gateway/static/root/assets/{skills-page-CFiCgbAs.js → skills-page-DaehgBFO.js} +1 -1
  82. package/dist/gateway/static/root/assets/{system-settings-panel-1tXKr0cJ.js → system-settings-panel-CBABQnDB.js} +1 -1
  83. package/dist/gateway/static/root/assets/{task-detail-page-BBQ3sk4y.js → task-detail-page-C7Vpoc1R.js} +1 -1
  84. package/dist/gateway/static/root/assets/{tunnel-api-COo0rSrc.js → tunnel-api-h8J8sWvL.js} +1 -1
  85. package/dist/gateway/static/root/assets/{usage-page-DHXG-2Rr.js → usage-page-BqN4hLxa.js} +1 -1
  86. package/dist/gateway/static/root/assets/{use-autosave-CJfX4SWk.js → use-autosave-DAYoOcKf.js} +1 -1
  87. package/dist/gateway/static/root/assets/{user-model-page-d-Gjs-EX.js → user-model-page-Bog1W3OS.js} +1 -1
  88. package/dist/gateway/static/root/assets/{voice-api-key-field-D0gWz3iO.js → voice-api-key-field-C2SX3Gb3.js} +1 -1
  89. package/dist/gateway/static/root/assets/{voice-config-api-BnnUzr07.js → voice-config-api-C9HKTnnD.js} +1 -1
  90. package/dist/gateway/static/root/assets/{work-discovery-overlay-CDAZKFVO.js → work-discovery-overlay-F0tCV50t.js} +1 -1
  91. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Db0lk_9G.js → workflow-run-setup-panel-BWyDzuu9.js} +1 -1
  92. package/dist/gateway/static/root/assets/{workflows-page-Dj89Gagd.js → workflows-page-ClBQeXmf.js} +1 -1
  93. package/dist/gateway/static/root/index.html +15 -15
  94. package/dist/package.js +1 -1
  95. package/dist/src/computer/errors.js +1 -0
  96. package/dist/src/gateway/hono/routes/sessions.js +9 -0
  97. package/dist/src/gateway/service/sessions-api.d.ts +2 -3
  98. package/dist/src/gateway/service/sessions-api.js +5 -0
  99. package/dist/src/session/execution-detail.d.ts +16 -0
  100. package/dist/src/session/execution-detail.js +150 -0
  101. package/dist/src/tui/tui.js +1 -1
  102. package/package.json +3 -3
  103. package/dist/gateway/static/root/assets/computer-settings-page-C-59NTyH.js +0 -1
  104. package/dist/gateway/static/root/assets/gateway-realtime-store-DGQMXjfI.js +0 -1
  105. package/dist/gateway/static/root/assets/index-y6kxoLV2.css +0 -1
  106. package/dist/gateway/static/root/assets/messages-aVTaD9Mj.js +0 -3
  107. package/dist/gateway/static/root/assets/notes-page-4D1-mt6Y.js +0 -8
  108. package/dist/gateway/static/root/assets/settings-advanced-gate-alf3atpI.js +0 -1
  109. package/dist/gateway/static/root/assets/skill-reload-api-D9bB-ANm.js +0 -1
@@ -1,8 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a,m as o,u as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as c}from"./popover-select-0p9PIHRy.js";import{t as l}from"./ellipsis-0k4rZLoy.js";import{f as u}from"./markdown-view-BjDzimRP.js";import{t as d}from"./loader-circle-CifKLtgG.js";import{t as f}from"./plus-Q2yW6OE7.js";import{t as p}from"./search-DA7gz22f.js";import{t as m}from"./x-B_N4OPjy.js";import{t as h}from"./messages-aVTaD9Mj.js";import{t as g}from"./cn-JdwAhgNB.js";import{c as _,f as v,n as y}from"./locale-store-B008NR-f.js";import{i as b}from"./vendor-swr-BIWyz7Rc.js";import{t as x}from"./skeleton-BwbyijEw.js";import{Bn as S,Dc as C,Hn as ee,Mc as te,Rn as ne,Ro as re,Ta as w,Uc as T,Uu as E,Vn as ie,Wl as D,Wn as O,Xu as ae,Yn as oe,_c as se,ad as ce,ar as k,cn as A,dn as j,fl as le,fn as M,hr as N,id as ue,ir as de,ln as fe,lu as pe,mr as me,nd as P,pc as F,pn as he,qn as ge,ru as _e,sd as ve,sl as ye,sn as be,td as xe,tr as Se,un as I,vl as L,vr as Ce,xo as we,za as Te,zn as Ee}from"./index-DsIQD44S.js";import{i as De,t as Oe}from"./note-detail-panel-CYcNB2Pf.js";var R=n(),z=e(t(),1),B=r();function V({projectId:e}){let t=y(e=>e.language)===`zh`,n=i(),r=(0,z.useRef)(null),a=(0,z.useRef)(null),[o,s]=(0,z.useState)(null),[c,l]=(0,z.useState)(null),[u,d]=(0,z.useState)(null);async function f(){let t=a.current;if(!(!t||o!==null)){s(0),l(null);try{let r=await he();if(r.consentAcknowledgedAt==null){d(r.consentPolicyVersion);return}let i=await be(t.file,t.requestId),o=await M({clientRequestId:t.requestId,contextProjectId:e,source:`web`,consentPolicyVersion:r.consentPolicyVersion});t.discussionId=o.discussion.id,await I({...i,serverDiscussionId:o.discussion.id,projectId:e}),o.discussion.audioAttachmentId||await A(i,o.discussion.id,s),await fe(t.requestId),a.current=null,n(`/notes/${encodeURIComponent(o.note.id)}`)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(null)}}}return(0,B.jsxs)(`div`,{className:`inline-flex flex-wrap items-center gap-2 text-xs`,children:[(0,B.jsx)(`input`,{ref:r,hidden:!0,type:`file`,accept:`audio/*,.m4a,.wav,.mp3,.webm,.ogg`,onChange:e=>{let n=e.target.files?.[0];if(e.target.value=``,n){if(!n.size||n.size>1073741824){l(t?`音频须为 1 字节至 1 GiB`:`Audio must be between 1 byte and 1 GiB`);return}a.current={file:n,requestId:crypto.randomUUID()},f()}}}),(0,B.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md p-2 hover:bg-surface-hover`,disabled:o!==null,onClick:()=>c&&a.current?void f():r.current?.click(),children:[(0,B.jsx)(F,{className:`size-3.5`}),o===null?c&&a.current?t?`重试导入`:`Retry import`:t?`导入录音`:`Import recording`:`${o}%`]}),u===null?null:(0,B.jsxs)(`span`,{children:[t?`请确认你有权上传此录音,并允许配置的语音服务处理。`:`Confirm permission to upload this recording and process it with your configured speech service.`,(0,B.jsx)(`button`,{type:`button`,className:`p-2 text-accent`,onClick:()=>void j(u).then(()=>(d(null),f())).catch(e=>l(String(e))),children:t?`确认导入`:`Confirm import`})]}),c?(0,B.jsx)(`span`,{role:`alert`,className:`text-danger`,children:c}):null]})}async function H(e){e.note??=await ge({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 N(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,` `)}](${Ce(t,e.id)})`);e.note=await me(t,{markdown:`${e.markdown}\n\n## ${e.materialHeading}\n\n${n.join(`
2
-
3
- `)}`})}return{noteId:t,conversationId:(await k(t,{projectId:e.projectId})).conversationId}}function U(e,t,n){let r=new URLSearchParams({draft:n.replace(`{{id}}`,t),autoSend:`1`});return`/chat/${encodeURIComponent(e)}?${r}`}var W={meeting:xe,requirements:pe,research:T,weekly:E};function ke({projects:e,projectId:t,onProjectChange:n,onCreated:r,labels:a,projectsLoading:o,projectsError:s}){let l=a.home,u=i(),[f,p]=(0,z.useState)(``),[h,_]=(0,z.useState)(null),[v,y]=(0,z.useState)([]),[b,x]=(0,z.useState)(!1),[S,C]=(0,z.useState)(null),[ee,re]=(0,z.useState)(``),w=(0,z.useRef)(null),T=(0,z.useRef)(!1),E=(0,z.useRef)(null),ie=(0,z.useRef)(null),D=b||!!w.current,O=h?l.templateOptions[h]:null,ae=!!(f.trim()||v.length);async function oe(){if(!(T.current||!ae&&!w.current)){T.current=!0,x(!0),C(null),w.current??={requestId:crypto.randomUUID(),title:f.trim().split(`
4
- `)[0]?.slice(0,80)||O?.label||a.titlePlaceholder,markdown:`## ${l.requestHeading}\n\n${O?`${O.prompt}\n`:``}${f.trim()}`,projectId:t||void 0,files:[...v],attachments:[],materialHeading:l.materialsHeading};try{let e=await H(w.current);r(),u(U(e.conversationId,e.noteId,l.agentPrompt))}catch(e){w.current.note&&r(),C(e instanceof Error?e.message:a.quickCaptureFailedHint)}finally{T.current=!1,x(!1)}}}function se(){w.current=null,C(null),p(``),y([]),_(null),ie.current?.focus()}return(0,B.jsxs)(`section`,{"aria-label":l.askLabel,children:[(0,B.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),oe()},className:`relative rounded-xl border border-edge bg-surface-panel p-4 focus-within:border-accent/60 sm:p-5`,children:[(0,B.jsxs)(`fieldset`,{disabled:D,className:`min-w-0`,children:[(0,B.jsxs)(`label`,{htmlFor:`notes-home-prompt`,className:`flex items-center gap-2 text-xs font-medium text-accent-fg`,children:[(0,B.jsx)(te,{className:`size-4`,"aria-hidden":!0}),l.askLabel]}),O?(0,B.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,B.jsxs)(`p`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`font-medium`,children:[O.label,` · `]}),O.prompt.split(`
5
-
6
- `)[0]]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>_(null),"aria-label":a.searchClear,className:`shrink-0 rounded p-1 hover:bg-surface-hover`,children:(0,B.jsx)(m,{className:`size-3.5`})})]}):null,(0,B.jsx)(`textarea`,{ref:ie,id:`notes-home-prompt`,value:f,onChange:e=>p(e.target.value),placeholder:O?O.prompt.split(`
7
-
8
- `).at(-1):l.askPlaceholder,rows:2,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),oe())},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,B.jsx)(`ul`,{className:`mb-3 flex flex-wrap gap-2`,children:v.map((e,t)=>(0,B.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,B.jsx)(ye,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name}),(0,B.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,B.jsx)(m,{className:`size-3`})})]},`${e.name}-${t}`))}):null,(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 sm:pr-40`,children:[(0,B.jsx)(`div`,{className:`w-44 max-w-full`,children:(0,B.jsx)(c,{value:t,options:e.filter(e=>e.name.toLowerCase().includes(ee.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,B.jsx)(_e,{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:D,loading:o,statusMessage:s?l.projectsLoadFailed:void 0,searchPlaceholder:l.projectSearch,searchValue:ee,onSearchChange:re})}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>E.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,B.jsx)(ye,{className:`size-4`,"aria-hidden":!0}),l.addMaterials]}),(0,B.jsx)(`input`,{ref:E,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,B.jsx)(`div`,{className:`mt-2 flex justify-end sm:absolute sm:bottom-5 sm:right-5 sm:mt-0`,children:(0,B.jsxs)(`button`,{type:`submit`,disabled:b||!w.current&&!ae,className:`inline-flex h-9 items-center gap-2 rounded-lg bg-accent px-4 text-sm font-medium text-on-accent 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,B.jsx)(d,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,B.jsx)(P,{className:`size-4`,"aria-hidden":!0}),b?l.creating:S?l.retry:l.agentCreate]})})]}),S?(0,B.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,B.jsx)(`p`,{children:S}),w.current?.note?(0,B.jsx)(`p`,{className:`mt-1`,children:l.partialFailure}):null,(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3`,children:[w.current?.note?(0,B.jsx)(`button`,{type:`button`,onClick:()=>u(`/notes/${encodeURIComponent(w.current.note.id)}?edit=1`),className:`underline`,children:l.openSavedDraft}):null,(0,B.jsx)(`button`,{type:`button`,onClick:se,className:`underline`,children:l.newRequest})]})]}):null,(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-1 gap-y-1 text-xs text-fg-muted`,children:[(0,B.jsx)(`span`,{className:`mr-1 py-2`,children:l.templates}),Object.keys(W).map(e=>{let t=W[e];return(0,B.jsxs)(`button`,{type:`button`,disabled:D,"aria-pressed":h===e,onClick:()=>{_(h===e?null:e),ie.current?.focus()},className:g(`inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover disabled:opacity-50`,h===e&&`bg-accent-soft text-accent-fg`),children:[(0,B.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),l.templateOptions[e].label]},e)}),(0,B.jsx)(V,{}),(0,B.jsxs)(`button`,{type:`button`,disabled:b,onClick:()=>ne(),className:`ml-auto inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover`,children:[(0,B.jsx)(L,{className:`size-3.5`,"aria-hidden":!0}),l.recordDiscussion]})]})]})}function Ae(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 je(e){let t=e.snippet?.trim()??``,n=e.title?.trim();return n&&t.startsWith(n)?t.slice(n.length).replace(/^[\s::·—-]+/,``):t}var G=`touch-target 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 K(){let e=y(e=>e.language),t=h(e).notes,n=t.home,r=_(e=>e.conversationId),o=we(e=>e.setPageHeader),u=we(e=>e.clearPageHeader),m=i(),{pathname:ne,search:T}=s(),[E,k]=a(),A=E.get(`projectId`)||``,j=E.get(`view`)||`all`,M=E.get(`unassigned`)===`true`||j===`unassigned`,N=E.get(`search`)||``,[fe]=Te(N,250),[P,F]=(0,z.useState)(A),[he,ye]=(0,z.useState)(``),[be,I]=(0,z.useState)(null),[L,Ce]=(0,z.useState)(!1),[Oe,R]=(0,z.useState)(new Set),[V,H]=(0,z.useState)(null),[U,W]=(0,z.useState)(null),K=(0,z.useRef)(new Set),q=(0,z.useRef)(null),J=(0,z.useRef)(!1),Me=(0,z.useRef)(null),Ne=Ae(E,fe),Y=(Ne.offset??0)/12,{data:Pe,error:Fe,isLoading:Ie,mutate:Le}=b(r?[`notes-home`,r,Ne]:null,()=>de(Ne)),{data:Re,error:ze,isLoading:X,mutate:Be}=b(r?[`notes-home-projects`,r]:null,Se),Z=Re?.items??[],Ve=Z.find(e=>e.id===A)?.name??n.projectNotes,He=Pe?.items??[],Q=Pe?.total??0,Ue=Ie||N!==fe,We=(0,z.useMemo)(()=>({justNow:t.justNow,minutesAgo:t.minutesAgo,today:t.today,yesterday:t.yesterday,daysAgo:t.daysAgo,locale:v(e)}),[e,t.justNow,t.minutesAgo,t.today,t.yesterday,t.daysAgo]),[Ge,Ke]=(0,z.useState)(()=>Date.now());(0,z.useEffect)(()=>{F(A)},[A]),(0,z.useEffect)(()=>{let e=window.setInterval(()=>Ke(Date.now()),6e4);return()=>window.clearInterval(e)},[]);let $=(0,z.useCallback)(()=>{Le().catch(()=>void 0),Be().catch(()=>void 0)},[Le,Be]);(0,z.useEffect)(()=>{let e=[`note-updated`,`note-created`,`note-deleted`,`project-updated`,`project-created`,`project-deleted`];return e.forEach(e=>window.addEventListener(e,$)),()=>e.forEach(e=>window.removeEventListener(e,$))},[$]);let qe=(0,z.useCallback)((e,t=!1)=>{let n=`${ne}${T}`,r=new URLSearchParams({returnTo:n});t&&r.set(`edit`,`1`),m(`/notes/${encodeURIComponent(e)}?${r}`)},[ne,T,m]),Je=(0,z.useCallback)(async()=>{if(!(J.current||!r)){J.current=!0,Ce(!0),I(null),q.current??={key:crypto.randomUUID(),projectId:P||void 0};try{let e=await ge({markdown:``,kind:`thought`,projectId:q.current.projectId},q.current.key);q.current=null,$(),qe(e.id,!0)}catch(e){I(`${t.createBlankFailed}: ${e instanceof Error?e.message:t.createBlankFailedHint}`)}finally{J.current=!1,Ce(!1)}}},[P,t.createBlankFailed,t.createBlankFailedHint,qe,$,r]),Ye=(0,z.useCallback)(e=>{k(t=>{let n=new URLSearchParams(t);return e?n.set(`search`,e):n.delete(`search`),n.delete(`page`),n},{replace:!0})},[k]);function Xe(e,t=`all`){let n=new URLSearchParams;e&&n.set(`projectId`,e),t===`unassigned`?n.set(`unassigned`,`true`):t!==`all`&&n.set(`view`,t),F(e),k(n)}function Ze(e){k(t=>{let n=new URLSearchParams(t);return M&&n.set(`unassigned`,`true`),e===`all`?n.delete(`view`):n.set(`view`,e),n.delete(`page`),n})}async function Qe(e,n){if(!K.current.has(e)){K.current.add(e),R(new Set(K.current)),I(null);try{await me(e,{pinned:n}),$()}catch(e){I(`${t.actionFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{K.current.delete(e),R(new Set(K.current))}}}async function $e(){let e=V;if(!(!e||U)){H(null),W(e.id),I(null);try{await oe(e.id),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e.id}})),$()}catch(e){I(`${t.deleteFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{W(null)}}}if((0,z.useLayoutEffect)(()=>{if(!r){u();return}return o({startExtra:null,main:(0,B.jsx)(`h1`,{className:`truncate text-base font-semibold text-fg`,children:t.title}),end:(0,B.jsxs)(`div`,{className:g(`flex min-w-0 items-center gap-2`,re),children:[(0,B.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,B.jsx)(p,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,B.jsx)(`input`,{ref:Me,type:`search`,value:N,onChange:e=>Ye(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,B.jsxs)(`button`,{type:`button`,onClick:()=>void Je(),disabled:L,"aria-label":n.blankNote,className:g(G,`border border-edge bg-surface-panel text-fg`),children:[L?(0,B.jsx)(d,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,B.jsx)(f,{className:`size-4`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:n.blankNote})]})]})}),()=>u()},[u,Je,L,n.blankNote,t.searchDialogTitle,t.searchPlaceholder,t.title,N,o,Ye,r]),(0,z.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(),Je()),e.key.toLowerCase()===`f`&&(e.preventDefault(),Me.current?.focus()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Je]),!r)return(0,B.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:le},{id:`favorites`,label:n.favorites,Icon:C},{id:`unassigned`,label:n.unassigned,Icon:D},{id:`archived`,label:t.filterArchived,Icon:ve}],tt=A?`project:${A}`:M?`unassigned`:`all`;return(0,B.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-panel`,children:[(0,B.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,B.jsxs)(`button`,{type:`button`,onClick:()=>Xe(``,e),"aria-current":!A&&(e===`unassigned`?M:!M&&j===e)?`page`:void 0,className:g(G,`justify-start px-2 text-left text-xs`,!A&&(e===`unassigned`?M:!M&&j===e)&&`bg-surface-hover font-medium text-fg`),children:[(0,B.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),t]},e)),(0,B.jsx)(`span`,{className:`mb-1 mt-7 px-2 text-xs text-fg-muted`,children:n.projects}),X?[0,1,2].map(e=>(0,B.jsx)(x,{className:`mb-2 h-8 w-full`},e)):Z.slice(0,8).map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>Xe(e.id),"aria-current":A===e.id?`page`:void 0,className:g(G,`justify-start px-2 text-left text-xs`,A===e.id&&`bg-surface-hover font-medium text-fg`),children:[(0,B.jsx)(_e,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id)),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>m(`/projects`),className:g(G,`mt-2 justify-start px-2 text-xs`),children:[n.allProjects,(0,B.jsx)(ue,{className:`ml-auto size-3`,"aria-hidden":!0})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,B.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col px-4 py-4 sm:px-6 sm:py-7 lg:px-8 lg:py-9`,children:[(0,B.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4`,children:[(0,B.jsx)(`h2`,{className:`min-w-0 break-words text-2xl font-semibold tracking-tight text-fg`,children:A?Ve:M?n.unassigned:n.homeTitle}),A?(0,B.jsxs)(`button`,{type:`button`,onClick:()=>m(`/projects/${encodeURIComponent(A)}`),className:g(G,`text-xs`),children:[n.openProject,(0,B.jsx)(ue,{className:`size-3.5`,"aria-hidden":!0})]}):null]}),be?(0,B.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:be}):null,(0,B.jsx)(`div`,{className:`order-3 mt-6 sm:order-none sm:mt-0`,children:(0,B.jsx)(ke,{projects:Z,projectId:P,onProjectChange:F,onCreated:$,labels:t,projectsLoading:X,projectsError:!!ze})}),ze?(0,B.jsxs)(`div`,{role:`alert`,className:`mt-4 flex items-center gap-3 text-xs text-danger`,children:[(0,B.jsx)(`span`,{children:n.projectsLoadFailed}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>void Be().catch(()=>void 0),className:`underline`,children:n.retry})]}):null,!A&&!M&&(X||Z.length>0)?(0,B.jsxs)(`section`,{className:`order-4 mt-8 sm:order-none`,"aria-label":n.continueProjects,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.continueProjects}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>m(`/projects`),className:`text-xs text-fg-muted hover:text-fg`,children:n.allProjects})]}),(0,B.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:X?[0,1,2].map(e=>(0,B.jsx)(x,{className:`h-28 w-full`},e)):Z.slice(0,3).map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>Xe(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,B.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,B.jsx)(_e,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.description?(0,B.jsx)(`p`,{className:`mt-2 hidden line-clamp-1 text-xs text-fg-muted sm:block`,children:e.description}):null,(0,B.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center justify-between gap-1 text-xs text-fg-muted sm:mt-3`,children:[(0,B.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(e.noteCount))}),(0,B.jsx)(`span`,{children:e.updatedAt?De(e.updatedAt,Ge,We):n.emptyProject})]})]},e.id))})]}):null,(0,B.jsxs)(`section`,{className:`order-2 mt-2 pb-6 sm:order-none sm:mt-8`,"aria-label":n.recentNotes,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:A?n.projectNotes:n.recentNotes}),(0,B.jsx)(`div`,{className:`w-48 max-w-full`,children:(0,B.jsx)(c,{value:tt,allowEmpty:!1,ariaLabel:n.projects,placeholder:n.allNotes,options:[{value:`all`,label:n.allNotes},{value:`unassigned`,label:n.unassigned},...Z.filter(e=>e.name.toLowerCase().includes(he.toLowerCase())).map(e=>({value:`project:${e.id}`,label:e.name}))],selectedLabel:A?Ve:M?n.unassigned:n.allNotes,triggerClassName:`h-8 bg-surface-panel text-xs`,loading:X,searchPlaceholder:n.projectSearch,searchValue:he,onSearchChange:ye,onChange:e=>Xe(e.startsWith(`project:`)?e.slice(8):``,e===`unassigned`?e:`all`)})})]}),(0,B.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,B.jsx)(`button`,{type:`button`,"aria-pressed":j===e||e===`all`&&j===`unassigned`,onClick:()=>Ze(e),className:g(`touch-target border-b-2 border-transparent py-3 text-xs text-fg-muted hover:text-fg`,(j===e||e===`all`&&j===`unassigned`)&&`border-fg font-medium text-fg`),children:t},e)),(0,B.jsx)(`span`,{className:`ml-auto py-3 text-xs text-fg-muted`,children:n.sortUpdated})]}),Fe?(0,B.jsxs)(`div`,{className:`py-10 text-center`,role:`alert`,children:[(0,B.jsx)(`p`,{className:`text-sm text-danger`,children:n.loadFailed}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>void Le().catch(()=>void 0),className:g(G,`mt-2`),children:n.retry})]}):Ue?(0,B.jsx)(`div`,{"aria-busy":`true`,className:`divide-y divide-edge`,children:[0,1,2,3].map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-3 py-4`,children:[(0,B.jsx)(x,{className:`h-10 w-8 shrink-0`}),(0,B.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,B.jsx)(x,{className:`h-4 w-2/3`}),(0,B.jsx)(x,{className:`h-3 w-1/2`})]})]},e))}):He.length===0?(0,B.jsxs)(`div`,{className:`flex flex-col items-center px-4 py-12 text-center`,children:[(0,B.jsx)(le,{className:`mb-4 size-8 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,B.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:N||j!==`all`&&j!==`unassigned`?n.noMatches:A?n.projectEmpty:n.emptyTitle}),(0,B.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:N||j!==`all`&&j!==`unassigned`?n.noMatchesHint:A?n.projectEmptyHint:n.emptyDescription})]}):(0,B.jsx)(`ul`,{className:`divide-y divide-edge`,children:He.map(e=>{let r=e.voiceAttachmentId||e.kind===`voice`?xe:e.kind===`bookmark`?ae:pe,i=je(e)||(e.coverAttachmentId?t.imageNote:t.noText);return(0,B.jsxs)(`li`,{className:`group flex min-w-0 items-center gap-3 py-4`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>qe(e.id),className:`touch-target flex min-w-0 flex-1 items-center gap-3 rounded-md text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,B.jsx)(`span`,{className:`flex h-10 w-8 shrink-0 items-center justify-center rounded-md border border-edge text-fg-muted`,children:(0,B.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-base font-medium text-fg sm:text-sm group-hover:text-accent-fg`,children:e.title||i.slice(0,48)||t.titlePlaceholder}),(0,B.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,B.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-accent-fg`,children:[(0,B.jsx)(te,{className:`size-3`,"aria-hidden":!0}),n.agentEditLabel,(0,B.jsx)(`span`,{"aria-hidden":!0,children:`·`})]}):null,(0,B.jsx)(`span`,{className:`truncate`,children:i})]}),(0,B.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`mt-1.5 block text-xs text-fg-muted sm:hidden`,children:De(e.updatedAt,Ge,We)})]})]}),(0,B.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,B.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`hidden w-24 shrink-0 text-right text-xs text-fg-muted sm:block`,children:De(e.updatedAt,Ge,We)}),(0,B.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:`touch-target 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,B.jsx)(C,{className:g(`size-4`,e.pinned&&`fill-current text-fg`),"aria-hidden":!0})}),(0,B.jsxs)(ee,{children:[(0,B.jsx)(O,{asChild:!0,children:(0,B.jsx)(`button`,{type:`button`,disabled:U===e.id,"aria-label":`${t.noteActions}: ${e.title||t.titlePlaceholder}`,className:`touch-target 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:U===e.id?(0,B.jsx)(d,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,B.jsx)(l,{className:`size-4`,"aria-hidden":!0})})}),(0,B.jsx)(ie,{children:(0,B.jsx)(Ee,{align:`end`,sideOffset:4,className:`z-50 min-w-36 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:(0,B.jsxs)(S,{className:`touch-target 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:()=>H(e),children:[(0,B.jsx)(se,{className:`size-4`,"aria-hidden":!0}),t.delete]})})})]})]},e.id)})}),!Ue&&!Fe&&Q>0?(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 text-xs text-fg-muted`,"aria-live":`polite`,children:[(0,B.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(Q))}),Q>12||Y>0?(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":n.previousPage,disabled:Y===0,className:G,onClick:()=>k(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(Y-1)),t}),children:(0,B.jsx)(ce,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsxs)(`span`,{children:[Y+1,` / `,Math.max(1,Math.ceil(Q/12))]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":n.nextPage,disabled:(Y+1)*12>=Q,className:G,onClick:()=>k(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(Y+1)),t}),children:(0,B.jsx)(ue,{className:`size-4`,"aria-hidden":!0})})]}):null]}):null]})]})}),(0,B.jsx)(w,{open:V!==null,title:t.deleteConfirmTitle,description:t.deleteConfirmDescription.replace(`{{title}}`,V?.title||t.titlePlaceholder),confirmLabel:t.deleteConfirmLabel,cancelLabel:t.deleteCancelLabel,destructive:!0,onConfirm:()=>void $e(),onCancel:()=>H(null)})]})}function q(){let e=(0,R.c)(12),{noteId:t}=o(),n=i(),[r]=a(),s;e[0]===r?s=e[1]:(s=u(r.get(`returnTo`),`/notes`,[`/chat`,`/projects`,`/notes`,`/tasks`]),e[0]=r,e[1]=s);let c=s,l;e[2]!==n||e[3]!==c?(l=()=>{n(c)},e[2]=n,e[3]=c,e[4]=l):l=e[4];let d=l;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,B.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-6xl flex-1 flex-col`,children:(0,B.jsx)(Oe,{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 J(){let e=(0,R.c)(2),{noteId:t}=o(),n;return e[0]===t?n=e[1]:(n=t?(0,B.jsx)(q,{}):(0,B.jsx)(K,{}),e[0]=t,e[1]=n),n}export{J as NotesPage};
@@ -1 +0,0 @@
1
- import{Dn as e}from"./index-DsIQD44S.js";function t(t){let{children:n,fallback:r}=t,i=r===void 0?null:r;return e()?n:i}export{t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-aKtaBQYM.js";import{i as t,r as n}from"./locale-store-B008NR-f.js";import{zi as r}from"./index-DsIQD44S.js";var i=e({reloadSkills:()=>a});async function a(){let e=await t(n(`/api/skills/reload`),{method:`POST`});if(!e.ok)throw Error(await r(e))}export{i as n,a as t};