@xopcai/xopc 0.0.206 → 0.0.207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/README.zh-CN.md +7 -7
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-URW-e_me.js → activity-store-BmpM0zwM.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BLK6kRCJ.js → agent-avatar-dicebear-DhK5wi6_.js} +1 -1
- package/dist/gateway/static/root/assets/agents-Bc3Lc-n2.js +68 -0
- package/dist/gateway/static/root/assets/{api-C_MS4arC.js → api-CzaAcDOn.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CnUN6BJk.js → app-management-settings-panel-Dqj5G_cd.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-C8Nx8hZE.js → appearance-settings-Bm1uLGMi.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BKtwU47-.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-C7FqeJZD.js → archive-plugin-CgnzBplN.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DCYQgsYE.js → attachment-load-Cuybcmhn.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-ilGeRLDN.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Bf1WROsh.js → binary-plugins-D6BBx6Ps.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BPK08Pjv.js → block-editor-Dk1c3Spa.js} +3 -3
- package/dist/gateway/static/root/assets/browser-settings-page-BCu8AZbs.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-cqVoDHyp.js → browser-workflow-inputs-DvfIzCgV.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Des1UTsS.js → browser-workflows-page-DZScuPlF.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BbWQBtTe.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-D4MjqV2a.js → capability-presets-api-hoA8R_J1.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-BTVU46Yn.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-CcimZduy.js → channel-recipient-api-BS8I65NT.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-BEQsC9a9.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-DRwbgtOT.js +1 -0
- package/dist/gateway/static/root/assets/chat-terminal-dock-BIPhWBDI.js +36 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B1njb2Cr.css → chat-terminal-dock-uQUnjRtf.css} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CUvFu8jh.js → connectors-api-B_78jmvM.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BJoHjWnu.js → connectors-page-w_3kpqbc.js} +2 -2
- package/dist/gateway/static/root/assets/{cron-expression-hFSZZpvM.js → cron-expression-BBheaBIr.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CKZ0gc-Y.js → date-picker-CDwj7UrT.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-zv1oHtg4.js → dependency-picker-Dnrc2qZe.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DY9ykMtD.js → desktop-pet-Bj_vUjXp.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-XiSmmt26.js → desktop-pet-settings-uiCwJJk4.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CZkgk15r.js → directory-picker-path-field-D0zUQ-TO.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CTppsTEi.js → extension-debug-page-_GZ4y2da.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CHRTUvAa.js → extension-page-scR96Edg.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-z2UBx25A.js → extension-settings-page-CILsAwxx.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DzFPJTnm.js → gateway-config-api-984O_4wM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CGpoH1gU.js → gateway-config-swr-D4hvsdJA.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DBa2I6VM.js → gateway-settings-aF4eQHo3.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Te-TREBt.js → gateway-startup-retry-Deo5-O87.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DyQGGdBu.js → heartbeat-settings-D5DrFWH6.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-EkT4eGeP.js → home-page-DiMWxngC.js} +2 -2
- package/dist/gateway/static/root/assets/{index-CrwXzRpA.js → index-DzKLVgY-.js} +47 -47
- package/dist/gateway/static/root/assets/index-wR5jX-lw.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-fb0zS8pk.js → keyboard-shortcuts-settings-DGmOlNcB.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-De8vuwu1.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DFdheruU.js → local-apps-page-CzS2sCxg.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CieddUjx.js → locale-store-C7xtkP3D.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-BI9stsVO.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-D3PsQ612.js → management-settings-Cpxs43JB.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-x5K52Thz.js → markdown-split-CQvFHxUa.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-Cjjey5Y6.js → markdown-view-BRwrSbwM.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DNtEkRAh.js → media-plugins-Bs9MsiaM.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Dxk5Rzj_.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-nWEqlwDw.js → notes-page-Dux_g6aZ.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-CGafcgJ8.js +4 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CXcIKVi9.js → preview-open-alternatives-fvhtN4Y2.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CZLJudPk.js → product-open-page-f_jbg-9N.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-Cf1v94LO.js → project-detail-page-C6mNsjYr.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BRMZkNht.js → projects-page-D1G6VIxR.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CIez6X0x.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-RYjduQV6.js → runtime-tools-settings-panel-zapSiJrv.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form--1ZXg4qC.js → schema-form-CFyz8y5v.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-6irxQjHb.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CRb0QTG2.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-71-8j3zt.js → settings-form-section-DCiK4TIq.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-C5Jn1l0q.js → settings-loading-skeleton-DFUJEv4G.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-TYYGe6kZ.js → settings-page-Cnp9Bdd0.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-jA5I-17g.js → setup-status-panel-BFMGTGBO.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BMUQIGfk.js → share-preview-page-DA8nA4cz.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CaKfvJzQ.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BOBUcYr5.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-BzZT1SKg.js → skills-page-BJJACxzz.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DnaBw5Ji.js → skills-page.utils--1-vOg3V.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DqiPQgVI.js → system-settings-panel-DY0lIaXY.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-Ciuwe7AG.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-BP3_RpaY.js → theme-store-DoyRfkoi.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BJkQ-vpu.js → use-autosave-DzIR5Lxf.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-BP8-sOPi.js → user-context-page-yf18T_BZ.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-C6c8e7Mx.js → voice-api-key-field-B7MZS8tS.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CCNjWKql.js → work-discovery-overlay-zyX6yxxF.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-2e5J0sIp.js +1 -0
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-Cj1vPWRM.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-D37zWlWY.js +5 -0
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-vWi33CZJ.js → working-directory-picker-modal-Bm7cox3y.js} +1 -1
- package/dist/gateway/static/root/index.html +10 -10
- package/dist/package.js +1 -1
- package/dist/src/agent/embedded/transcript-runtime.d.ts +2 -1
- package/dist/src/agent/embedded/transcript-runtime.js +38 -4
- package/dist/src/agent/inbound/inbound-loop.d.ts +1 -1
- package/dist/src/agent/memory/compaction-ledger.d.ts +11 -0
- package/dist/src/agent/memory/compaction-ledger.js +108 -0
- package/dist/src/agent/memory/compaction-serializer.d.ts +2 -0
- package/dist/src/agent/memory/compaction-serializer.js +52 -0
- package/dist/src/agent/memory/compaction-source-planner.d.ts +20 -0
- package/dist/src/agent/memory/compaction-source-planner.js +67 -0
- package/dist/src/agent/memory/compaction.d.ts +11 -5
- package/dist/src/agent/memory/compaction.js +245 -153
- package/dist/src/agent/prompt/sections/behavior.js +1 -1
- package/dist/src/agent/prompt/sections/memory-skills.js +4 -2
- package/dist/src/agent/prompt/sections/tooling.js +2 -0
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +1 -1
- package/dist/src/agent/tools/factory.js +5 -0
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/session-recall-tool.d.ts +7 -0
- package/dist/src/agent/tools/session-recall-tool.js +82 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/schema.d.ts +1 -0
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/service/run-gateway-agent.js +3 -3
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/session/compaction-types.d.ts +30 -0
- package/dist/src/session/compaction-types.js +35 -0
- package/dist/src/session/manager.d.ts +3 -0
- package/dist/src/session/session-context-for-llm.d.ts +4 -2
- package/dist/src/session/session-context-for-llm.js +2 -1
- package/dist/src/session/store.d.ts +10 -1
- package/dist/src/session/store.js +55 -23
- package/dist/src/session/types.d.ts +3 -2
- package/dist/src/storage/sqlite/index.d.ts +1 -1
- package/dist/src/storage/sqlite/index.js +2 -2
- package/dist/src/storage/sqlite/migrations/123_remove_v2_compaction_boundaries.sql +25 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/transcript-repository.d.ts +24 -1
- package/dist/src/storage/sqlite/transcript-repository.js +78 -29
- package/dist/src/user-context/config.d.ts +4 -0
- package/dist/src/user-context/config.js +2 -0
- package/package.json +3 -3
- package/skills/THIRD_PARTY_NOTICES.md +1 -1
- package/skills/engineering/define-task/SKILL.md +48 -0
- package/skills/engineering/define-task/references/task-contract-rubric.md +15 -0
- package/dist/gateway/static/root/assets/agents-D5HVmdNx.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-DKCA_LFY.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-BEOE4ZKM.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CLRmMdU9.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BNcVi4ar.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-uFwW2ah5.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-DSLP8OjS.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-D0OR6Ylw.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-wpi7abPg.js +0 -38
- package/dist/gateway/static/root/assets/index-BpLqHdfz.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-CCC3Cvb8.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-B6jfkNDF.js +0 -2
- package/dist/gateway/static/root/assets/messages-CySMn8WL.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-QstkgWsW.js +0 -4
- package/dist/gateway/static/root/assets/remote-access-hub-D55FTXZw.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-C5Yy6eIn.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BqO_8bUh.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Dru1a2rZ.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-C8iqS6kF.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DQP5vDr-.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-DL_Ie0s2.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-DLO-dMSN.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-B4-k2FHB.js +0 -5
- package/dist/src/agent/memory/compaction-planner.d.ts +0 -16
- package/dist/src/agent/memory/compaction-planner.js +0 -168
- package/dist/src/agent/memory/summary-generator.d.ts +0 -46
- package/dist/src/agent/memory/summary-generator.js +0 -229
- package/skills/engineering/define-goal/SKILL.md +0 -41
- package/skills/engineering/define-goal/references/objective-rubric.md +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{d as n}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as r}from"./notes-workbench-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{d as n}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as r}from"./notes-workbench-CGafcgJ8.js";var i=e(),a=t();function o(){let e=(0,i.c)(2),{noteId:t}=n(),o;return e[0]===t?o=e[1]:(o=(0,a.jsx)(r,{selectedNoteId:t,basePath:`/notes`,managePageHeader:!0,showLibrary:!0,allowMediaCapture:!0,listWidthStorageKey:`xopc.notes.listWidth`}),e[0]=t,e[1]=o),o}export{o as NotesPage};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-Dk1c3Spa.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-DzKLVgY-.js","assets/preload-helper-zJ_50EbN.js","assets/Combination-14nmIgxH.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-C230izr8.js","assets/markdown-view-BRwrSbwM.js","assets/dist-BPoKqzeH.js","assets/chunk-KS7C4IRE-BMhrPKJC.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/locale-store-C7xtkP3D.js","assets/messages-Dxk5Rzj_.js","assets/cn-JdwAhgNB.js","assets/product-delivery-tRr-7IxY.js","assets/schemas-zIBW3wiV.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-B12xeflb.css","assets/dist-DY4Af0fY.js","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/working-directory-picker-modal-Bm7cox3y.js","assets/loader-circle-CifKLtgG.js","assets/button-CSEbl4zT.js","assets/form-field-width-DJw_jULe.js","assets/interaction-BmQogeqz.js","assets/settings-form-draft-Dy10ldo8.js","assets/popover-select-BzdnTy3h.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/copy-Dv6d4Dvw.js","assets/external-link-DjqjBmc3.js","assets/globe-DSSGFWFn.js","assets/middleware-Pd0e8Igk.js","assets/tool-activity-R8V9l6nk.js","assets/config-reload-event-Bjh2zoKp.js","assets/gateway-config-swr-D4hvsdJA.js","assets/gateway-startup-retry-Deo5-O87.js","assets/activity-store-BmpM0zwM.js","assets/theme-store-DoyRfkoi.js","assets/index-wR5jX-lw.css","assets/vendor-codemirror-DRr7hFaD.js","assets/with-selector-aYPsXwdl.js","assets/block-editor-D4ZIVQbk.css","assets/markdown-editor-TWGaF7Xa.js","assets/code-editor-dFzqyDXS.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{l as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as o,r as s}from"./popover-select-BzdnTy3h.js";import{t as c}from"./loader-circle-CifKLtgG.js";import{t as l}from"./plus-Q2yW6OE7.js";import{t as u}from"./x-B_N4OPjy.js";import{t as d}from"./cn-JdwAhgNB.js";import{t as f}from"./button-CSEbl4zT.js";import{t as p}from"./messages-Dxk5Rzj_.js";import{l as m,n as h}from"./locale-store-C7xtkP3D.js";import{i as g}from"./theme-store-DoyRfkoi.js";import{a as _,i as v,n as y,o as b,r as x,s as S,t as C}from"./dist-BPoKqzeH.js";import{i as w}from"./vendor-swr-BIWyz7Rc.js";import{r as T}from"./settings-form-draft-Dy10ldo8.js";import{An as E,Ar as D,As as O,Cn as k,Cr as A,Dc as j,Dn as M,Dr as N,En as P,Er as F,Gs as I,Hs as L,Js as R,Kc as z,Ks as B,Ll as ee,Ml as V,Mr as H,Na as te,Or as ne,Ps as U,Qc as re,Sn as ie,Sr as ae,Tn as W,Tr as oe,Ul as se,Va as ce,Vl as G,Wl as le,Ws as ue,Xc as K,Xs as de,_c as fe,_n as q,al as J,as as pe,bn as me,c as he,dn as Y,fn as ge,fs as _e,gn as ve,hn as ye,hs as be,is as xe,jc as Se,jr as Ce,kc as we,kn as X,kr as Te,ks as Ee,l as De,mn as Oe,o as ke,os as Ae,pn as je,ql as Me,rc as Ne,s as Pe,sc as Fe,ss as Ie,u as Le,un as Re,vn as ze,vs as Be,wn as Ve,wr as He,xn as Ue,yl as We,yn as Ge,ys as Ke}from"./index-DzKLVgY-.js";var Z=n(),Q=e(t(),1),$=r(),qe=(0,Q.createContext)(null);function Je(){let e=(0,Z.c)(1),t=(0,Q.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,Z.c)(22),{children:n,closeLabel:r}=e,i=r===void 0?`Close`:r,[a,o]=(0,Q.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 f=l,p=a!==null,m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>{e||o(null)},t[2]=m):m=t[2];let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(_,{className:`fixed inset-0 z-[70] bg-scrim/90 backdrop-blur-sm`}),t[3]=h):h=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=d(`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 v=a?.alt||`Image preview`,w;t[5]===v?w=t[6]:(w=(0,$.jsx)(S,{className:`sr-only`,children:v}),t[5]=v,t[6]=w);let T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(u,{className:`size-5`,"aria-hidden":!0}),t[7]=T):T=t[7];let E;t[8]===i?E=t[9]:(E=(0,$.jsx)(y,{asChild:!0,children:(0,$.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:T})}),t[8]=i,t[9]=E);let D;t[10]===a?D=t[11]:(D=a?(0,$.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]!==w?(O=(0,$.jsxs)(b,{children:[h,(0,$.jsxs)(x,{className:g,"aria-describedby":void 0,children:[w,E,D]})]}),t[12]=E,t[13]=D,t[14]=w,t[15]=O):O=t[15];let k;t[16]!==O||t[17]!==p?(k=(0,$.jsx)(C,{open:p,onOpenChange:m,children:O}),t[16]=O,t[17]=p,t[18]=k):k=t[18];let A;return t[19]!==n||t[20]!==k?(A=(0,$.jsxs)(qe.Provider,{value:f,children:[n,k]}),t[19]=n,t[20]=k,t[21]=A):A=t[21],A}function Ze(e){let t=(0,Z.c)(15),{noteId:n,attachmentId:r,className:i}=e,[a,o]=(0,Q.useState)(!1),s;t[0]!==r||t[1]!==n?(s=H(n,r),t[0]=r,t[1]=n,t[2]=s):s=t[2];let c=s;if(a){let e;t[3]===i?e=t[4]:(e=d(`flex size-12 shrink-0 items-center justify-center rounded-lg border border-edge-subtle bg-surface-hover text-fg-muted`,i),t[3]=i,t[4]=e);let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(we,{className:`size-4`}),t[5]=n):n=t[5];let r;return t[6]===e?r=t[7]:(r=(0,$.jsx)(`div`,{className:e,"aria-hidden":!0,children:n}),t[6]=e,t[7]=r),r}let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>o(!0),t[8]=l):l=t[8];let u;t[9]===i?u=t[10]:(u=d(`size-12 shrink-0 rounded-lg border border-edge-subtle bg-surface-hover object-cover`,i),t[9]=i,t[10]=u);let f;return t[11]!==n||t[12]!==c||t[13]!==u?(f=(0,$.jsx)(E,{src:c,expectedNoteId:n,alt:``,loading:`lazy`,draggable:!1,onLoadFailed:l,className:u}),t[11]=n,t[12]=c,t[13]=u,t[14]=f):f=t[14],f}var Qe=6e4,$e=36e5,et=864e5;function tt(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function nt(e,t,n){let r=t-e;if(r<Qe)return n.justNow;if(r<$e){let e=Math.floor(r/Qe);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=tt(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(e>=i-et)return n.yesterday+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(r<7*et){let e=Math.floor(r/et);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function rt(e,t,n){let r=tt(t);if(e>=r)return n.today;if(e>=r-et)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(void 0,{month:`long`,day:`numeric`}):i.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function it(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function at(e){if(!Number.isFinite(e)||e<0)return`0:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,`0`)}`}function ot(e){let t=(0,Z.c)(38),{noteId:n,attachmentId:r,durationSec:i,className:a}=e,{playing:o,loading:s,currentTime:l,duration:u,noteId:f,attachmentId:p}=Ce(),m=Ce(ct),h=f===n&&p===r,g=h&&o,_=h&&s,v=h?l:0,y=h&&u>0?u:i??0,b=y>0?Math.min(v/y*100,100):0,x;t[0]!==r||t[1]!==i||t[2]!==n||t[3]!==m?(x=e=>{e.stopPropagation(),m(n,r,i)},t[0]=r,t[1]=i,t[2]=n,t[3]=m,t[4]=x):x=t[4];let S=x,C;t[5]!==r||t[6]!==i||t[7]!==n||t[8]!==m?(C=e=>{(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),e.preventDefault(),m(n,r,i))},t[5]=r,t[6]=i,t[7]=n,t[8]=m,t[9]=C):C=t[9];let w=C,T;t[10]===a?T=t[11]:(T=d(`flex items-center gap-2`,a),t[10]=a,t[11]=T);let E=g?`bg-accent text-white`:`bg-accent/10 text-accent hover:bg-accent/20`,D;t[12]===E?D=t[13]:(D=d(`flex size-7 shrink-0 items-center justify-center rounded-full transition-colors`,E),t[12]=E,t[13]=D);let O=g?`Pause`:`Play`,k;t[14]!==_||t[15]!==g?(k=_?(0,$.jsx)(c,{className:`size-3.5 animate-spin`}):g?(0,$.jsx)(R,{className:`size-3.5`}):(0,$.jsx)(L,{className:`size-3.5 ml-0.5`}),t[14]=_,t[15]=g,t[16]=k):k=t[16];let A;t[17]!==S||t[18]!==w||t[19]!==D||t[20]!==O||t[21]!==k?(A=(0,$.jsx)(`button`,{type:`button`,onClick:S,onKeyDown:w,className:D,"aria-label":O,children:k}),t[17]=S,t[18]=w,t[19]=D,t[20]=O,t[21]=k,t[22]=A):A=t[22];let j=`${b}%`,M;t[23]===j?M=t[24]:(M=(0,$.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-accent/10`,children:(0,$.jsx)(`div`,{className:`h-full rounded-full bg-accent transition-[width] duration-200 ease-linear`,style:{width:j}})}),t[23]=j,t[24]=M);let N;t[25]!==y||t[26]!==h||t[27]!==v?(N=at(h&&v>0?v:y),t[25]=y,t[26]=h,t[27]=v,t[28]=N):N=t[28];let P;t[29]===N?P=t[30]:(P=(0,$.jsx)(`span`,{className:`text-[10px] tabular-nums text-fg-muted`,children:N}),t[29]=N,t[30]=P);let F;t[31]!==M||t[32]!==P?(F=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[M,P]}),t[31]=M,t[32]=P,t[33]=F):F=t[33];let I;return t[34]!==F||t[35]!==T||t[36]!==A?(I=(0,$.jsxs)(`div`,{className:T,onClick:st,children:[A,F]}),t[34]=F,t[35]=T,t[36]=A,t[37]=I):I=t[37],I}function st(e){return e.stopPropagation()}function ct(e){return e.toggle}function lt(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function ut(e){let t=(0,Z.c)(88),{note:n,selected:r,onPress:i,onPin:a,onArchive:o,onDelete:s,labels:c,timeLabels:l}=e,u=r===void 0?!1:r,f;t[0]!==c||t[1]!==n?(f=lt(n,c),t[0]=c,t[1]=n,t[2]=f):f=t[2];let p=f,m=!n.snippet?.trim(),[h]=(0,Q.useState)(mt),g;t[3]!==n.createdAt||t[4]!==h||t[5]!==l?(g=nt(n.createdAt,h,l),t[3]=n.createdAt,t[4]=h,t[5]=l,t[6]=g):g=t[6];let _=g,v,y;t[7]!==n.id||t[8]!==i?(v=()=>i(n.id),y=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),i(n.id))},t[7]=n.id,t[8]=i,t[9]=v,t[10]=y):(v=t[9],y=t[10]);let b=u?`bg-surface-active hover:bg-surface-active`:`bg-transparent hover:bg-surface-panel/70`,x;t[11]===b?x=t[12]:(x=d(`group relative flex cursor-pointer flex-col gap-2 overflow-hidden rounded-lg px-3 py-2.5`,`transition-colors duration-150 ease-out`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-rail`,b),t[11]=b,t[12]=x);let S=u?`true`:void 0,C;t[13]===u?C=t[14]:(C=u?(0,$.jsx)(`span`,{className:`pointer-events-none absolute inset-y-2 left-0 w-0.5 rounded-r-pill bg-accent`,"aria-hidden":!0}):null,t[13]=u,t[14]=C);let w;t[15]!==n.coverAttachmentId||t[16]!==n.id||t[17]!==n.kind||t[18]!==n.voiceAttachmentId||t[19]!==n.voiceDurationSec?(w=n.coverAttachmentId?(0,$.jsx)(Ze,{noteId:n.id,attachmentId:n.coverAttachmentId}):n.kind===`voice`&&n.voiceAttachmentId?(0,$.jsx)(ot,{noteId:n.id,attachmentId:n.voiceAttachmentId,durationSec:n.voiceDurationSec,className:`mt-0.5 w-28 shrink-0`}):null,t[15]=n.coverAttachmentId,t[16]=n.id,t[17]=n.kind,t[18]=n.voiceAttachmentId,t[19]=n.voiceDurationSec,t[20]=w):w=t[20];let T;t[21]===n.title?T=t[22]:(T=n.title&&(0,$.jsx)(`h3`,{className:`mb-0.5 truncate text-sm font-semibold text-fg`,children:n.title}),t[21]=n.title,t[22]=T);let E=n.title?`text-fg-muted`:m?`italic text-fg-muted`:`text-fg`,D;t[23]===E?D=t[24]:(D=d(`truncate text-sm leading-5`,E),t[23]=E,t[24]=D);let O;t[25]!==p||t[26]!==D?(O=(0,$.jsx)(`p`,{className:D,children:p}),t[25]=p,t[26]=D,t[27]=O):O=t[27];let k;t[28]!==T||t[29]!==O?(k=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[T,O]}),t[28]=T,t[29]=O,t[30]=k):k=t[30];let j;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(re,{className:`size-4`}),t[31]=j):j=t[31];let M;t[32]===c.actions?M=t[33]:(M=(0,$.jsx)(N,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:pt,className:`shrink-0 rounded-md p-1 text-fg-muted opacity-100 transition-opacity hover:bg-surface-panel focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent lg:opacity-0 lg:group-hover:opacity-100 lg:focus-visible:opacity-100`,"aria-label":c.actions,title:c.actions,children:j})}),t[32]=c.actions,t[33]=M);let P;t[34]!==n.id||t[35]!==n.pinned||t[36]!==a?(P=()=>a(n.id,!n.pinned),t[34]=n.id,t[35]=n.pinned,t[36]=a,t[37]=P):P=t[37];let L;t[38]===n.pinned?L=t[39]:(L=n.pinned?(0,$.jsx)(ue,{className:`size-4`}):(0,$.jsx)(I,{className:`size-4`}),t[38]=n.pinned,t[39]=L);let R=n.pinned?c.unpin:c.pin,z;t[40]!==P||t[41]!==L||t[42]!==R?(z=(0,$.jsxs)(A,{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`,onSelect:P,children:[L,R]}),t[40]=P,t[41]=L,t[42]=R,t[43]=z):z=t[43];let B;t[44]!==n.id||t[45]!==o?(B=()=>o(n.id),t[44]=n.id,t[45]=o,t[46]=B):B=t[46];let ee;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(le,{className:`size-4`}),t[47]=ee):ee=t[47];let V;t[48]!==c.archive||t[49]!==B?(V=(0,$.jsxs)(A,{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`,onSelect:B,children:[ee,c.archive]}),t[48]=c.archive,t[49]=B,t[50]=V):V=t[50];let H;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(F,{className:`my-1 h-px bg-edge-subtle`}),t[51]=H):H=t[51];let te;t[52]!==n.id||t[53]!==s?(te=()=>s(n.id),t[52]=n.id,t[53]=s,t[54]=te):te=t[54];let ne;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(pe,{className:`size-4`}),t[55]=ne):ne=t[55];let U;t[56]!==c.delete||t[57]!==te?(U=(0,$.jsxs)(A,{className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-red-500 outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:te,children:[ne,c.delete]}),t[56]=c.delete,t[57]=te,t[58]=U):U=t[58];let ie;t[59]!==z||t[60]!==V||t[61]!==U?(ie=(0,$.jsx)(He,{children:(0,$.jsxs)(ae,{className:`z-50 min-w-[140px] rounded-xl border border-edge bg-surface-panel p-1 shadow-lg`,sideOffset:4,align:`end`,onClick:ft,children:[z,V,H,U]})}),t[59]=z,t[60]=V,t[61]=U,t[62]=ie):ie=t[62];let W;t[63]!==M||t[64]!==ie?(W=(0,$.jsxs)(oe,{children:[M,ie]}),t[63]=M,t[64]=ie,t[65]=W):W=t[65];let se;t[66]!==w||t[67]!==k||t[68]!==W?(se=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[w,k,W]}),t[66]=w,t[67]=k,t[68]=W,t[69]=se):se=t[69];let ce;t[70]===n.pinned?ce=t[71]:(ce=n.pinned&&(0,$.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-accent/10 px-1.5 py-0.5 text-xs font-medium text-accent`,children:(0,$.jsx)(I,{className:`size-3`})}),t[70]=n.pinned,t[71]=ce);let G;t[72]===n.tags?G=t[73]:(G=n.tags?.slice(0,2).map(dt),t[72]=n.tags,t[73]=G);let K;t[74]===_?K=t[75]:(K=(0,$.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:_}),t[74]=_,t[75]=K);let de;t[76]!==ce||t[77]!==G||t[78]!==K?(de=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[ce,G,K]}),t[76]=ce,t[77]=G,t[78]=K,t[79]=de):de=t[79];let fe;return t[80]!==se||t[81]!==de||t[82]!==v||t[83]!==y||t[84]!==x||t[85]!==S||t[86]!==C?(fe=(0,$.jsxs)(`article`,{role:`button`,tabIndex:0,onClick:v,onKeyDown:y,className:x,"aria-current":S,children:[C,se,de]}),t[80]=se,t[81]=de,t[82]=v,t[83]=y,t[84]=x,t[85]=S,t[86]=C,t[87]=fe):fe=t[87],fe}function dt(e){return(0,$.jsx)(`span`,{className:`max-w-24 truncate rounded-md bg-surface-hover px-1.5 py-0.5 text-xs text-fg-muted`,children:e},e)}function ft(e){return e.stopPropagation()}function pt(e){return e.stopPropagation()}function mt(){return Date.now()}function ht(e){let t=(0,Z.c)(45),{title:n,description:r,prompt:i,coverage:o,className:s,variant:c}=e,l=c===void 0?`card`:c,u=h(vt),m=p(u).automations.suggestions,g=p(u).automations,_=a(),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={revalidateOnFocus:!1,refreshInterval:15e3},t[0]=v):v=t[0];let{data:y}=w(o?`automation-suggestion-coverage`:null,_t,v),b=o?y?.automations.find(e=>De(e,o)):void 0,x=b?Pe(b,g):[];if(l===`titleAction`){if(b){let e;t[1]===s?e=t[2]:(e=d(`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,$.jsx)(We,{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]===_?r=t[5]:(r=()=>_(`/automations`),t[4]=_,t[5]=r),(0,$.jsxs)(`section`,{className:e,children:[n,(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,children:m.coveredTitle}),(0,$.jsx)(f,{variant:`ghost`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:r,children:m.manage})]})}let e;t[6]===s?e=t[7]:(e=d(`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,$.jsx)(fe,{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,$.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]!==_||t[13]!==i?(c=()=>{_(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[12]=_,t[13]=i,t[14]=c):c=t[14];let l;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(Ke,{className:`size-3.5`,"aria-hidden":!0}),t[15]=l):l=t[15],(0,$.jsxs)(`section`,{className:e,children:[a,o,(0,$.jsxs)(f,{variant:`secondary`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:c,children:[l,m.setup]})]})}if(b){let e;t[16]===s?e=t[17]:(e=d(`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,$.jsx)(We,{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]===_?r=t[20]:(r=()=>_(`/automations`),t[19]=_,t[20]=r);let i;return t[21]!==m||t[22]!==r?(i=(0,$.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,$.jsx)(f,{variant:`ghost`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:r,children:m.manage})}),t[21]=m,t[22]=r,t[23]=i):i=t[23],(0,$.jsxs)(`section`,{className:e,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:m.coveredTitle}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:he(m.coveredDescription,{name:b.name})})]})]}),(0,$.jsxs)(`div`,{className:`mt-2 rounded-md bg-surface-base/55 px-2.5 py-2`,children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg`,children:g.explain.whyCovered}),(0,$.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:x.map(gt)})]}),i]})}let S;t[24]===s?S=t[25]:(S=d(`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,$.jsx)(fe,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[26]=C):C=t[26];let T;t[27]===n?T=t[28]:(T=(0,$.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[27]=n,t[28]=T);let E;t[29]===r?E=t[30]:(E=(0,$.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:r}),t[29]=r,t[30]=E);let D;t[31]!==T||t[32]!==E?(D=(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[C,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[T,E]})]}),t[31]=T,t[32]=E,t[33]=D):D=t[33];let O;t[34]!==_||t[35]!==i?(O=()=>{_(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[34]=_,t[35]=i,t[36]=O):O=t[36];let k;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(Ke,{className:`size-3.5`,"aria-hidden":!0}),t[37]=k):k=t[37];let A;t[38]!==m.create||t[39]!==O?(A=(0,$.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,$.jsxs)(f,{variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:O,children:[k,m.create]})}),t[38]=m.create,t[39]=O,t[40]=A):A=t[40];let j;return t[41]!==A||t[42]!==S||t[43]!==D?(j=(0,$.jsxs)(`section`,{className:S,children:[D,A]}),t[41]=A,t[42]=S,t[43]=D,t[44]=j):j=t[44],j}function gt(e){return(0,$.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function _t(){return Le.list()}function vt(e){return e.language}function yt(e){let t=(0,Z.c)(4),{values:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.map(bt),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:r}),t[2]=r,t[3]=i),i}function bt(e,t){return(0,$.jsx)(`li`,{children:e},`${t}:${e}`)}function xt(e){let t=(0,Z.c)(35),{noteId:n}=e,r=h(wt),i;t[0]===r?i=t[1]:(i=p(r),t[0]=r,t[1]=i);let a=i.notes.discussionCapture,o,s;t[2]===n?(o=t[3],s=t[4]):(o=[`note-discussion-document`,n],s=()=>Re(n),t[2]=n,t[3]=o,t[4]=s);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c={revalidateOnFocus:!1},t[5]=c):c=t[5];let{data:l,mutate:u}=w(o,s,c),d,f;if(t[6]===u?(d=t[7],f=t[8]):(d=()=>{let e=e=>{let t=e.detail;t&&u(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(Ct);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 u();return window.addEventListener(`discussion-segment-updated`,e),window.addEventListener(`discussion-updated`,t),()=>{window.removeEventListener(`discussion-segment-updated`,e),window.removeEventListener(`discussion-updated`,t)}},f=[u],t[6]=u,t[7]=d,t[8]=f),(0,Q.useEffect)(d,f),!l)return null;let{discussion:m,transcript:g}=l,_=l.organization?.organization,v=[`stopping`,`sealing`,`organizing`].includes(m.status),y;t[9]!==a.actionItems||t[10]!==a.decisions||t[11]!==a.openQuestions||t[12]!==a.organization||t[13]!==a.risks||t[14]!==_?(y=_?(0,$.jsxs)(`section`,{className:`border-b border-edge-subtle px-6 py-5`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-accent-fg`,children:[(0,$.jsx)(Ke,{className:`size-4`,"aria-hidden":!0}),a.organization]}),(0,$.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:_.summary}),(0,$.jsxs)(`div`,{className:`mt-4 grid gap-4 text-sm leading-6 text-fg sm:grid-cols-2`,children:[_.decisions.length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`font-medium`,children:a.decisions}),(0,$.jsx)(yt,{values:_.decisions})]}):null,_.actionItems.length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`font-medium`,children:a.actionItems}),(0,$.jsx)(yt,{values:_.actionItems.map(St)})]}):null,_.risks.length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`font-medium`,children:a.risks}),(0,$.jsx)(yt,{values:_.risks})]}):null,_.openQuestions.length>0?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`font-medium`,children:a.openQuestions}),(0,$.jsx)(yt,{values:_.openQuestions})]}):null]})]}):null,t[9]=a.actionItems,t[10]=a.decisions,t[11]=a.openQuestions,t[12]=a.organization,t[13]=a.risks,t[14]=_,t[15]=y):y=t[15];let b;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(Ne,{className:`size-4 text-accent`,"aria-hidden":!0}),t[16]=b):b=t[16];let x=m.status===`recording`?a.draftTranscript:a.fullTranscript,S;t[17]===x?S=t[18]:(S=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[b,x]}),t[17]=x,t[18]=S);let C;t[19]===m.status?C=t[20]:(C=m.status===`needs_attention`?(0,$.jsx)(xe,{className:`size-3.5 text-danger`}):m.status===`completed`?(0,$.jsx)(We,{className:`size-3.5 text-success`}):null,t[19]=m.status,t[20]=C);let T=v?a.finalizing:m.status===`needs_attention`?m.failureMessage:null,E;t[21]!==C||t[22]!==T?(E=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-fg-muted`,children:[C,T]}),t[21]=C,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==S||t[25]!==E?(D=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[S,E]}),t[24]=S,t[25]=E,t[26]=D):D=t[26];let O=g.text||a.waitingTranscript,k;t[27]===O?k=t[28]:(k=(0,$.jsx)(`div`,{className:`mt-3 max-h-48 overflow-y-auto whitespace-pre-wrap text-sm leading-6 text-fg-muted`,children:O}),t[27]=O,t[28]=k);let A;t[29]!==D||t[30]!==k?(A=(0,$.jsxs)(`section`,{className:`px-6 py-4`,children:[D,k]}),t[29]=D,t[30]=k,t[31]=A):A=t[31];let j;return t[32]!==A||t[33]!==y?(j=(0,$.jsxs)(`div`,{className:`max-h-[45%] shrink-0 overflow-y-auto border-b border-edge-subtle`,children:[y,A]}),t[32]=A,t[33]=y,t[34]=j):j=t[34],j}function St(e){return e.title}function Ct(e,t){return e.sequence-t.sequence}function wt(e){return e.language}var Tt={edit:B,ai_edit:Ke,sync:U,restore:se};function Et(e,t){return{edit:t.triggerEdit,ai_edit:t.triggerAiEdit,sync:t.triggerSync,restore:t.triggerRestore}[e]??e}function Dt({noteId:e,activeTimestamp:t,onSelect:n,onClose:r,onRestored:i}){let a=p(h(e=>e.language)).notes,o=a,{data:s}=w(e?[`note-history`,e]:null,()=>q(e)),[c,l]=(0,Q.useState)(!1),[f,m]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),v=(0,Q.useCallback)(async t=>{l(!0),_(null);try{await P(e,t),m(null),i()}catch{_(a.restoreFailed)}finally{l(!1)}},[e,a.restoreSuccess,a.restoreFailed,i]),y=Date.now();return(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,$.jsx)(Se,{className:`size-4`,"aria-hidden":!0}),a.history]}),(0,$.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,$.jsx)(u,{className:`size-4`,"aria-hidden":!0})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[g?(0,$.jsx)(`p`,{className:`border-b border-danger/20 bg-danger-soft px-4 py-2 text-xs text-danger`,role:`alert`,children:g}):null,s?.length?(0,$.jsx)(`ul`,{className:`divide-y divide-edge`,children:s.map(e=>{let r=Tt[e.trigger]??B,i=t===e.timestamp,s=f===e.timestamp;return(0,$.jsxs)(`li`,{children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:d(`w-full px-4 py-3 text-left transition-colors`,i?`bg-accent/10`:`hover:bg-surface-hover`),children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(r,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:Et(e.trigger,a)}),(0,$.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:nt(e.timestamp,y,o)})]}),e.snippet&&(0,$.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted/60`,children:e.snippet})]}),i&&(0,$.jsx)(`div`,{className:`border-t border-edge/50 px-4 py-2`,children:s?(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:a.restoreConfirm}),(0,$.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),v(e.timestamp)},disabled:c,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:c?`...`:a.restore}),(0,$.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),m(null)},className:`shrink-0 rounded-lg px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover`,children:`Cancel`})]}):(0,$.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),m(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:a.restore})})]},e.timestamp)})}):(0,$.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:a.historyEmpty}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted/60`,children:a.historyEmptyDescription})]})]})]})}function Ot(e){let t=(0,Z.c)(10),{noteId:n,note:r,catalyzing:i,onCatalyze:o,onClose:s,noteThreads:c,openingChat:l,onOpenChat:u,onOpenNewChat:f}=e,m=p(h(Ft)).notes,g=a(),_=r?.aiDeep?.catalysis,v=_?.report??null,y;t[0]===n?y=t[1]:(y=n?[`note-agent-context-status`,n]:null,t[0]=n,t[1]=y);let b;t[2]===n?b=t[3]:(b=()=>ye(n),t[2]=n,t[3]=b);let x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x={revalidateOnFocus:!1},t[4]=x):x=t[4];let{data:S,mutate:C,isLoading:T}=w(y,b,x),E;t[5]===n?E=t[6]:(E=async e=>{try{await W(n,e)}catch{}},t[5]=n,t[6]=E);let D=E,O;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(Ke,{className:`size-4 text-accent`,"aria-hidden":!0}),t[7]=O):O=t[7];let k;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(G,{className:`size-4 rotate-180`,"aria-hidden":!0}),t[8]=k):k=t[8];let A;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(Fe,{className:`size-4 text-accent`,"aria-hidden":!0}),t[9]=A):A=t[9],(0,$.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[O,(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:m.catalysisSectionTitle})]}),(0,$.jsx)(`button`,{type:`button`,onClick:s,"aria-label":m.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:k})]}),(0,$.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,$.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-fg-muted`,children:m.catalysisSectionDescription}),S?(0,$.jsxs)(`section`,{className:`mb-4 rounded-xl bg-surface-base p-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:m.contextStatusTitle}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>void C(()=>Ve(n),{revalidate:!1}),disabled:T,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:m.contextRebuild}),(0,$.jsx)(`span`,{className:d(`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,$.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:m.contextStatusDetail.replace(`{{attachments}}`,String(S.attachments.length)).replace(`{{tokens}}`,String(S.tokenEstimate??0))}),S.attachments.length>0?(0,$.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:S.attachments.slice(0,5).map(Pt)}):null]}):null,(0,$.jsx)(`button`,{type:`button`,onClick:o,disabled:i,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:i?m.processing:v?m.recatalyze:m.catalyzeAction}),v?(0,$.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:m.valueHypothesis}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:v.valueHypothesis})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:m.targetUsers}),(0,$.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:v.targetUsers.slice(0,5).map(Nt)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:m.keyQuestions}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:v.keyQuestions.slice(0,3).map(Mt)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:m.mvpPathLabel}),(0,$.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:v.mvpPath.slice(0,3).map(jt)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:m.risks}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:v.risks.slice(0,3).map(At)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:m.nextActions}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:v.nextActions.slice(0,4).map(kt)})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:m.confidenceLabel.replace(`{{percent}}`,String(Math.round(v.confidence*100)))}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>void D(`helpful`),className:d(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,_?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":m.feedbackHelpfulAria,children:(0,$.jsx)(Ae,{className:`size-3.5`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>void D(`not_helpful`),className:d(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,_?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":m.feedbackNotHelpfulAria,children:(0,$.jsx)(Ie,{className:`size-3.5`,"aria-hidden":!0})})]})]})]}):(0,$.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:m.noCatalysisReportHint}),(0,$.jsxs)(`section`,{className:`mt-6 rounded-xl bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[A,m.relatedThreadsTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:m.relatedThreadsDescription})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:u,disabled:l,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:l?m.openingChat:m.openThread}),(0,$.jsx)(`button`,{type:`button`,onClick:f,disabled:l,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:m.newThread})]})]}),c.length>0?(0,$.jsx)(`div`,{className:`space-y-2`,children:c.slice(0,5).map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>g(`/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,$.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.name||m.noteDiscussionFallback}),(0,$.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:m.messageCount.replace(`{{count}}`,String(e.messageCount??0))})]},e.key))}):(0,$.jsx)(`div`,{className:`rounded-lg border border-dashed border-edge-subtle px-3 py-5 text-center text-sm text-fg-muted`,children:m.noThreads})]})]})]})}function kt(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`rounded bg-accent/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-accent`,children:e.kind}),(0,$.jsx)(`span`,{children:e.text})]},`${e.kind}:${e.text}`)}function At(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-fg-muted`}),(0,$.jsx)(`span`,{children:e})]},e)}function jt(e,t){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsxs)(`span`,{className:`text-fg-muted`,children:[t+1,`.`]}),(0,$.jsx)(`span`,{children:e})]},e)}function Mt(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent`}),(0,$.jsx)(`span`,{children:e})]},e)}function Nt(e){return(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e)}function Pt(e){return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-hover px-2 py-1.5 text-xs`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.fileName}),(0,$.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:e.status})]},e.attachmentId)}function Ft(e){return e.language}var It=()=>i(()=>import(`./block-editor-Dk1c3Spa.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])),Lt=()=>i(()=>import(`./markdown-editor-TWGaF7Xa.js`).then(e=>e.n),__vite__mapDeps([47,1,3,44,5,48])),Rt=(0,Q.lazy)(()=>It().then(e=>({default:e.BlockEditor}))),zt=(0,Q.lazy)(()=>Lt().then(e=>({default:e.MarkdownEditor})));function Bt(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-6 py-4`,"aria-busy":!0,children:[(0,$.jsx)(`div`,{className:`h-8 w-56 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,$.jsx)(`div`,{className:`mt-6 h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,$.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,$.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function Vt(e){let t=(0,Z.c)(14),{mode:n,onModeChange:r,labels:i}=e,a;t[0]===i.edit?a=t[1]:(a={id:`wysiwyg`,label:i.edit,Icon:z},t[0]=i.edit,t[1]=a);let o;t[2]===i.source?o=t[3]:(o={id:`source`,label:i.source,Icon:J},t[2]=i.source,t[3]=o);let s;t[4]===i.preview?s=t[5]:(s={id:`preview`,label:i.preview,Icon:K},t[4]=i.preview,t[5]=s);let c;t[6]!==a||t[7]!==o||t[8]!==s?(c=[a,o,s],t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9];let l=c,u;return t[10]!==n||t[11]!==l||t[12]!==r?(u=(0,$.jsx)(`div`,{className:`flex items-center gap-0.5 rounded-lg border border-edge p-0.5`,children:l.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>r(t),onMouseEnter:()=>{t===`wysiwyg`&&It(),t===`source`&&Lt()},onFocus:()=>{t===`wysiwyg`&&It(),t===`source`&&Lt()},className:d(`inline-flex items-center gap-1 rounded-lg px-2 py-1 text-xs font-medium transition-colors`,n===t?`bg-surface-hover text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,$.jsx)(a,{className:`size-3.5`,"aria-hidden":!0}),i]},t)})}),t[10]=n,t[11]=l,t[12]=r,t[13]=u):u=t[13],u}function Ht(e){let t=(0,Z.c)(15),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:s,onOpenSearch:c,autoFocus:l,onAutoFocusConsumed:u}=e,d=a===void 0?!0:a,f=s===void 0?!0:s,m=l===void 0?!1:l,g=h(Ut),_;t[0]===g?_=t[1]:(_=p(g),t[0]=g,t[1]=_);let v=_.notes.lightboxClose,y;t[2]!==m||t[3]!==o||t[4]!==f||t[5]!==n||t[6]!==u||t[7]!==r||t[8]!==c||t[9]!==i||t[10]!==d?(y=(0,$.jsx)(Wt,{noteId:n,onBack:r,onSaved:i,showBackButton:d,backButtonClassName:o,clearHeaderOnCleanup:f,onOpenSearch:c,autoFocus:m,onAutoFocusConsumed:u}),t[2]=m,t[3]=o,t[4]=f,t[5]=n,t[6]=u,t[7]=r,t[8]=c,t[9]=i,t[10]=d,t[11]=y):y=t[11];let b;return t[12]!==v||t[13]!==y?(b=(0,$.jsx)(Xe,{closeLabel:v,children:y}),t[12]=v,t[13]=y,t[14]=b):b=t[14],b}function Ut(e){return e.language}function Wt({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:o=!0,onOpenSearch:s,autoFocus:c=!1,onAutoFocusConsumed:l}){let u=h(e=>e.language),f=p(u).notes,m=p(u).automations.suggestions,_=a(),v=g(e=>e.resolved)===`dark`,{openImage:y}=Je(),[b,x]=(0,Q.useState)(`wysiwyg`),[S,C]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(!1),[j,N]=(0,Q.useState)(``),[P,F]=(0,Q.useState)(360),[I,L]=(0,Q.useState)(!1),[R,z]=(0,Q.useState)(!1),[B,ee]=(0,Q.useState)(!1),[V,H]=(0,Q.useState)(null),te=(0,Q.useRef)(!1),U=(0,Q.useRef)(!1),re=(0,Q.useRef)(null),ie=(0,Q.useRef)(null),ae=(0,Q.useRef)(null),W=(0,Q.useRef)(null),oe=(0,Q.useRef)(null),se=(0,Q.useRef)(null),le=(0,Q.useRef)(null),ue=(0,Q.useRef)(null),K=(0,Q.useRef)(null),de=ce(e=>e.setPageHeader),fe=ce(e=>e.clearPageHeader),{data:q,mutate:J}=w(e?[`note-detail`,e]:null,()=>Oe(e)),{data:pe=[],mutate:he}=w(e?[`note-threads`,e]:null,()=>ze(e),{revalidateOnFocus:!1}),ge=T!==null;(0,Q.useEffect)(()=>{if(!e)return;let t=t=>{t.detail?.noteId===e&&J()};return window.addEventListener(`note-updated`,t),()=>window.removeEventListener(`note-updated`,t)},[J,e]),(0,Q.useEffect)(()=>{te.current=!1,N(``),E(null),C(null),U.current=!1,K.current=null},[e]),(0,Q.useEffect)(()=>{!q||te.current||(N(q.title??``),te.current=!0)},[q]),(0,Q.useEffect)(()=>{if(!c||!q||ge||K.current===e)return;let t=window.requestAnimationFrame(()=>{ue.current?.focus(),l?.()});return K.current=e,()=>window.cancelAnimationFrame(t)},[c,ge,q,e,l]);let _e=q?new Date(q.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,ye=(0,Q.useMemo)(()=>r?(0,$.jsx)(`button`,{type:`button`,onClick:t,"aria-label":f.back,className:d(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,Me,i),children:(0,$.jsx)(G,{className:`size-4`,"aria-hidden":!0})}):null,[i,f.back,t,r]),be=(0,Q.useCallback)(t=>{N(t),e&&(W.current=t,ie.current&&clearTimeout(ie.current),ie.current=setTimeout(async()=>{let t=W.current;if(W.current=null,t!==null){A(!0);try{await M(e,{title:t}),await J(),n?.()}catch{}finally{A(!1)}}},600))},[e,J,n]),xe=(0,Q.useMemo)(()=>(0,$.jsxs)(`div`,{className:d(`flex min-w-0 items-center gap-2`,Me),children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:j||_e||void 0,children:j||_e}),k?(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:f.saving}):null]}),[f.saving,k,_e,j]),Ce=(0,Q.useCallback)(async(t=!1)=>{ee(!0),H(null);try{let n=await me(e,{forceNew:t});await J(),await he(),_(`/chat/${encodeURIComponent(n.sessionKey)}`)}catch(e){H(`${f.chatOpenFailedTitle}: ${e instanceof Error?e.message:f.chatOpenFailedMessage}`)}finally{ee(!1)}},[J,he,_,e,f.chatOpenFailedMessage,f.chatOpenFailedTitle]),we=(0,Q.useCallback)(async()=>{z(!0),H(null);try{await Y(e),await J()}catch(e){H(`${f.catalysisFailed}: ${e instanceof Error?e.message:f.chatOpenFailedMessage}`)}finally{z(!1)}},[J,e]),Ee=(0,Q.useCallback)(()=>{C(S===`breakdown`?null:`breakdown`),!q?.aiDeep?.catalysis?.report&&!R&&we()},[S,R,we,q?.aiDeep?.catalysis?.report]),De=(0,Q.useCallback)(()=>{let t=T?.markdown??ae.current??q?.markdown??``,n=T?.title??j,r=Te([n,t].filter(Boolean).join(`
|
|
3
|
+
|
|
4
|
+
`));return{source:{type:`note`,id:e,title:n||f.titlePlaceholder},text:r,language:D(r,u)}},[u,f.titlePlaceholder,q?.markdown,e,T,j]),Ae=(0,Q.useMemo)(()=>(0,$.jsxs)(`div`,{className:d(`flex items-center gap-2`,Me),children:[s?(0,$.jsx)(`button`,{type:`button`,onClick:s,"aria-label":f.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,$.jsx)(O,{className:`size-4`,"aria-hidden":!0})}):null,(0,$.jsx)(ne,{input:De,labels:{read:f.readAloud,preparing:f.readAloudPreparing,pause:f.readAloudPause,resume:f.readAloudResume,retry:f.readAloudRetry},showLabel:!0}),(0,$.jsxs)(`button`,{type:`button`,onClick:Ee,disabled:R,"aria-label":f.catalysisSectionTitle,className:d(`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`,S===`breakdown`?`bg-accent/10 text-accent`:`bg-accent/10 text-fg hover:bg-accent/15`),children:[(0,$.jsx)(Ke,{className:`size-3.5`,"aria-hidden":!0}),R?f.catalyzing:f.catalyzeButton]}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>Ce(!1),disabled:B,className:d(`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,$.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0}),B?f.openingChat:f.openChatButton]}),(0,$.jsx)(Vt,{mode:b,onModeChange:x,labels:{edit:f.modeEdit,source:f.modeSource,preview:f.modePreview}}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>C(S===`history`?null:`history`),"aria-label":f.history,className:d(`rounded-lg p-1.5 transition-colors`,S===`history`?`bg-accent/10 text-accent`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:(0,$.jsx)(Se,{className:`size-4`,"aria-hidden":!0})})]}),[R,Ee,Ce,b,f.history,f.modeEdit,f.modePreview,f.modeSource,B,S,s,f.searchDialogTitle,f.readAloud,f.readAloudPause,f.readAloudPreparing,f.readAloudResume,f.readAloudRetry,De]);(0,Q.useLayoutEffect)(()=>(de({startExtra:ye,main:q?xe:null,end:q?Ae:null}),()=>{o&&fe()}),[o,fe,Ae,xe,ye,q,de]);let je=(0,Q.useCallback)(t=>{e&&(ae.current=t,re.current&&clearTimeout(re.current),re.current=setTimeout(async()=>{let t=ae.current;if(ae.current=null,t!==null){A(!0),H(null);try{await M(e,{markdown:t}),await J(),n?.()}catch(e){H(`${f.saveFailed}: ${e instanceof Error?e.message:f.saveFailedHint}`)}finally{A(!1)}}},600))},[e,J,f.saveFailed,f.saveFailedHint,n]),Ne=(0,Q.useCallback)(t=>{ve(e,t.timestamp).then(e=>{e&&E(e)})},[e]),Pe=(0,Q.useCallback)(()=>{C(null),E(null)},[]),Ie=(0,Q.useCallback)(()=>{C(null),E(null),J(),n?.()},[J,n]);if((0,Q.useEffect)(()=>()=>{re.current&&clearTimeout(re.current),ie.current&&clearTimeout(ie.current);let t=ae.current,n=W.current;ae.current=null,W.current=null;let r={};t!==null&&(r.markdown=t),n!==null&&(r.title=n),Object.keys(r).length>0&&M(e,r)},[e]),q===void 0)return(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,$.jsx)(`div`,{className:`size-6 animate-spin rounded-full border-2 border-accent border-t-transparent`})});if(q===null)return(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-center`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:f.notFoundTitle}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:f.notFoundDescription}),(0,$.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:f.back})]});let Le=ge?T.title??``:j,Re=ge?T.markdown??``:q.markdown??``,Be=new Date(q.createdAt).getTime(),Ve=Number.isFinite(Be)&&Date.now()-Be<3600*1e3?(0,$.jsx)(ht,{title:m.noteCreatedTitle,description:m.noteCreatedDescription,prompt:m.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,$.jsxs)(`div`,{className:`flex h-full min-h-0 gap-3 p-4 sm:px-5`,children:[(0,$.jsxs)(`div`,{className:`mx-auto flex min-h-0 min-w-0 w-full max-w-[60rem] flex-1 flex-col`,children:[V?(0,$.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:V}):null,(0,$.jsx)(ke,{eventType:`note.created`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,$.jsx)(ke,{eventType:`note.updated`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,$.jsxs)(`div`,{ref:oe,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:[(0,$.jsx)(xt,{noteId:e}),ge?(0,$.jsxs)(`div`,{className:`h-full overflow-y-auto px-6 py-4`,children:[Le&&(0,$.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg/70`,children:Le}),Re?(0,$.jsx)(X,{noteId:e,content:Re,className:`opacity-80`}):(0,$.jsx)(`p`,{className:`italic text-fg-muted`,children:f.emptyPreview})]}):(0,$.jsxs)($.Fragment,{children:[b===`wysiwyg`&&(0,$.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,$.jsx)(`input`,{ref:ue,type:`text`,value:j,onChange:e=>be(e.target.value),onCompositionStart:()=>{U.current=!0},onCompositionEnd:()=>{U.current=!1},onKeyDown:e=>{let t=e.nativeEvent;e.key===`Enter`&&!U.current&&!t.isComposing&&(e.preventDefault(),(oe.current?.querySelector(`.ProseMirror`))?.focus())},placeholder:f.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`}),Ve]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Bt,{}),children:(0,$.jsx)(Rt,{initialContent:q.markdown??``,onChange:je,noteId:e},`wysiwyg-${e}`)})})]}),b===`source`&&(0,$.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,$.jsx)(`input`,{ref:ue,type:`text`,value:j,onChange:e=>be(e.target.value),placeholder:f.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`}),Ve]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Bt,{}),children:(0,$.jsx)(zt,{initialContent:q.markdown??``,onChange:je,isDark:v},`source-${e}`)})})]}),b===`preview`&&(0,$.jsxs)(`div`,{className:`h-full overflow-y-auto px-6 py-4`,onClick:e=>{let t=e.target;t instanceof HTMLImageElement&&y(t.currentSrc||t.src,t.alt)},children:[j&&(0,$.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg`,children:j}),q.markdown?(0,$.jsx)(X,{noteId:e,content:q.markdown,className:`[&_img]:cursor-zoom-in`}):(0,$.jsx)(`p`,{className:`italic text-fg-muted`,children:f.emptyPreview})]})]})]})]}),(0,$.jsx)(`div`,{ref:se,className:d(`relative flex min-h-0 shrink-0 flex-col overflow-hidden`,!I&&`transition-[width] duration-300 ease-in-out`),style:{width:S?P:0},children:(0,$.jsxs)(`div`,{ref:le,className:`flex min-h-0 flex-1 flex-col`,style:{width:P},children:[(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),L(!0);let n=e.clientX,r=P,i=e.pointerId,a=0,o=P,s=P,c=()=>{a=0,s=o,S&&se.current?.style.setProperty(`width`,`${s}px`),le.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{}L(!1),F(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:d(`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`,I&&`before:!bg-edge/80 dark:before:!bg-edge/85`,`touch-none select-none`)}),(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:S===`history`?(0,$.jsx)(Dt,{noteId:e,activeTimestamp:T?.timestamp??null,onSelect:Ne,onClose:Pe,onRestored:Ie}):S===`breakdown`?(0,$.jsx)(Ot,{noteId:e,note:q??null,catalyzing:R,onCatalyze:we,onClose:()=>C(null),noteThreads:pe,openingChat:B,onOpenChat:()=>Ce(!1),onOpenNewChat:()=>Ce(!0)}):null})]})})]})}var Gt=3e4;function Kt(){if(!(typeof MediaRecorder>`u`))return[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function qt({placeholder:e,submitLabel:t,actionsLabel:n,imageLabel:r,voiceLabel:i,stopRecordingLabel:a,onCapture:o,onImagePick:s,onVoiceCapture:c,onVoiceError:u,recordingLabel:f,imageDisabled:p=!1,voiceDisabled:m=!1,onDiscussionCapture:h,discussionCaptureLabel:g}){let[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(0),[T,E]=(0,Q.useState)(!1),D=(0,Q.useRef)(null),O=(0,Q.useRef)(null),k=(0,Q.useRef)(null),M=(0,Q.useRef)([]),P=(0,Q.useRef)(0),F=(0,Q.useRef)(null),I=(0,Q.useRef)(null),L=(0,Q.useCallback)(()=>{F.current&&=(clearInterval(F.current),null),I.current&&=(clearTimeout(I.current),null),k.current?.getTracks().forEach(e=>e.stop()),k.current=null,O.current=null,M.current=[],S(!1),w(0)},[]);(0,Q.useEffect)(()=>()=>L(),[L]);let R=(0,Q.useCallback)(async()=>{let e=O.current;if(!e||e.state!==`recording`)return;E(!0),await new Promise(t=>{e.addEventListener(`stop`,()=>t(),{once:!0}),e.stop()});let t=Math.max(1,Math.round((Date.now()-P.current)/1e3)),n=e.mimeType||Kt()||`audio/webm`,r=new Blob(M.current,{type:n});if(L(),r.size>0&&c){let e=n.includes(`mp4`)?`m4a`:n.includes(`ogg`)?`ogg`:`webm`,i=new File([r],`voice-${Date.now()}.${e}`,{type:n});try{await c(i,t)}finally{E(!1)}return}E(!1)},[L,c]),z=(0,Q.useCallback)(async()=>{if(!(!c||T||x)){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`){u?.();return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});k.current=e;let t=Kt(),n=t?new MediaRecorder(e,{mimeType:t}):new MediaRecorder(e);O.current=n,M.current=[],P.current=Date.now(),n.ondataavailable=e=>{e.data.size>0&&M.current.push(e.data)},n.start(),S(!0),w(0),F.current=setInterval(()=>{w(Math.round((Date.now()-P.current)/1e3))},250),I.current=setTimeout(()=>{R()},Gt)}catch{L(),u?.()}}},[L,c,u,x,R,T]),B=(0,Q.useCallback)(async()=>{let e=_.trim();if(!(!e||y)){b(!0),v(``);try{await o(e)}catch{v(e)}finally{b(!1),D.current?.focus()}}},[_,y,o]),V=(0,Q.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),B())},[B]),H=y||T,te=!!(s||c||h);return(0,$.jsxs)(`div`,{className:d(`flex items-center gap-1.5 rounded-2xl border border-edge bg-surface-panel p-2 shadow-float dark:shadow-elevated`,`focus-within:border-accent focus-within:ring-1 focus-within:ring-accent`,x&&`border-danger ring-1 ring-danger/40`),"aria-busy":H,children:[x?(0,$.jsx)(`button`,{type:`button`,onClick:()=>void R(),disabled:T,className:`shrink-0 rounded-lg bg-danger-soft p-2 text-danger transition-colors hover:bg-danger-soft disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":a,title:a,"aria-pressed":`true`,children:(0,$.jsx)(be,{className:`size-4 fill-current`,"aria-hidden":!0})}):te?(0,$.jsxs)(oe,{children:[(0,$.jsx)(N,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,disabled:H,className:`shrink-0 rounded-lg p-2 text-fg-muted transition-colors 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`,"aria-label":n,title:n,children:(0,$.jsx)(l,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(He,{children:(0,$.jsxs)(ae,{side:`top`,align:`start`,sideOffset:8,className:`z-50 min-w-44 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[s?(0,$.jsxs)(A,{disabled:p,onSelect:s,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 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,$.jsx)(j,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),r]}):null,c?(0,$.jsxs)(A,{disabled:m,onSelect:()=>void z(),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 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,$.jsx)(Ne,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),i]}):null,h?(0,$.jsxs)(A,{onSelect:h,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,$.jsx)(ee,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),g]}):null]})})]}):null,x?(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate py-1.5 text-sm text-danger`,children:f.replace(`{{seconds}}`,String(C))}):(0,$.jsx)(`textarea`,{ref:D,value:_,onChange:e=>v(e.target.value),onKeyDown:V,placeholder:e,"aria-label":e,rows:1,disabled:H,className:`max-h-28 min-h-8 flex-1 resize-none overflow-y-auto bg-transparent py-1.5 text-sm leading-5 text-fg placeholder:text-fg-muted focus:outline-none disabled:opacity-60`,style:{fieldSizing:`content`}}),(0,$.jsx)(`button`,{type:`button`,disabled:!_.trim()||H||x,onClick:()=>void B(),"aria-label":t,title:t,className:d(`shrink-0 rounded-lg p-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,_.trim()&&!H&&!x?`bg-accent text-white hover:bg-accent-hover`:`text-fg-disabled`),children:(0,$.jsx)(Ee,{className:`size-4`,"aria-hidden":!0})})]})}var Jt={statusFilter:`all`,kindFilter:`all`,pinnedOnly:!1},Yt=240,Xt=320,Zt=520,Qt=560;function $t(e){if(globalThis.localStorage===void 0)return Xt;try{let t=globalThis.localStorage.getItem(e);if(!t)return Xt;let n=Number(t);return Number.isFinite(n)?n:Xt}catch{return Xt}}function en(e,t){if(globalThis.localStorage!==void 0)try{globalThis.localStorage.setItem(e,String(Math.round(t)))}catch{}}var tn={thought:_e,todo:Be,voice:Ne,media:j,bookmark:V,mixed:_e,task:Be};function nn(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function rn(e,t){return e.statusFilter===t.patch.statusFilter&&e.kindFilter===t.patch.kindFilter&&e.pinnedOnly===t.patch.pinnedOnly}function an(e,t){return`${e.replace(/\/$/,``)}/${encodeURIComponent(t)}`}function on({selectedNoteId:e,basePath:t,managePageHeader:n=!1,showLibrary:r=!0,allowMediaCapture:i=!0,projectId:c,listTitle:f,listDescription:g,emptyText:E,emptyDescription:D,listWidthStorageKey:A=`xopc.notes.listWidth`}){let j=p(h(e=>e.language)).notes,N=!!m(e=>e.token),[P,F]=(0,Q.useReducer)(T,Jt),[I,L]=(0,Q.useState)(!1),[R,z]=(0,Q.useState)(``),[B,ee]=(0,Q.useState)(0),[V,H]=(0,Q.useState)(()=>$t(A)),[ne,U]=(0,Q.useState)(!1),[re,ae]=(0,Q.useState)(!1),[W,oe]=(0,Q.useState)(!1),[se,G]=(0,Q.useState)(null),[le,ue]=(0,Q.useState)(null),K=(0,Q.useRef)(null),fe=(0,Q.useRef)(null),[q]=(0,Q.useState)(()=>Date.now()),J=a(),pe=(0,Q.useCallback)(e=>{let t=K.current?.clientWidth??window.innerWidth,n=Math.max(Yt,t-Qt);return Math.max(Yt,Math.min(Math.min(Zt,n),e))},[]),me=(0,Q.useCallback)(e=>{let t=pe(e);H(t),en(A,t)},[pe,A]);(0,Q.useLayoutEffect)(()=>{H(e=>pe(e))},[pe]);let{data:he,mutate:Y,isLoading:ve}=w((0,Q.useMemo)(()=>N?[`notes-list`,c,P.statusFilter,P.kindFilter,P.pinnedOnly]:null,[N,c,P.statusFilter,P.kindFilter,P.pinnedOnly]),()=>Ge({status:P.statusFilter===`all`?void 0:P.statusFilter,kind:P.kindFilter===`all`?void 0:P.kindFilter,projectId:c,pinned:P.pinnedOnly?!0:void 0,limit:100,sortBy:`createdAt`,sortOrder:`desc`}),{keepPreviousData:!0}),ye=ve&&!he,be=he?.items??[],xe=he?.total??0,Se=R.trim(),{data:Ce,isLoading:we}=w(N&&I&&Se?[`notes-search`,c,Se]:null,()=>Ge({search:Se,projectId:c,limit:30,sortBy:`updatedAt`,sortOrder:`desc`})),X=Ce?.items??[],Te=e?be.some(t=>t.id===e):!0;(0,Q.useEffect)(()=>{ee(0)},[Se]),(0,Q.useEffect)(()=>{B>=X.length&&ee(Math.max(0,X.length-1))},[B,X.length]),(0,Q.useEffect)(()=>{let e=()=>{Y()};return window.addEventListener(`note-updated`,e),()=>window.removeEventListener(`note-updated`,e)},[Y]);let Ee=ce(e=>e.setPageHeader),De=ce(e=>e.clearPageHeader),Oe=j.noteCount.replace(`{{count}}`,String(xe)),ke=!r&&xe===0&&g?g:Oe,Ae=j.searchDialogTitle,Ne=j.searchClose,Pe=j.searchClear,Fe=(0,Q.useMemo)(()=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>L(!0),className:d(`inline-flex h-9 items-center gap-2 rounded-lg border border-edge bg-surface-base px-3 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,Me),"aria-label":Ae,children:[(0,$.jsx)(O,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:Ae})]}),[Ae]);(0,Q.useLayoutEffect)(()=>{if(n)return N?(Ee({startExtra:null,main:(0,$.jsxs)(`div`,{className:d(`flex min-w-0 items-center gap-2`,Me),children:[(0,$.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold tracking-tight text-fg`,children:f??j.title}),Oe?(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:Oe}):null]}),end:Fe}),()=>De()):(De(),()=>De())},[De,N,Fe,f,n,j.title,Oe,e,Ee]);let Ie=(0,Q.useMemo)(()=>({justNow:j.justNow,minutesAgo:j.minutesAgo,today:j.today,yesterday:j.yesterday,daysAgo:j.daysAgo}),[j.justNow,j.minutesAgo,j.today,j.yesterday,j.daysAgo]),Le=(0,Q.useMemo)(()=>[{id:`recent`,label:j.viewRecent,patch:{statusFilter:`all`,kindFilter:`all`,pinnedOnly:!1}},{id:`inbox`,label:j.filterInbox,patch:{statusFilter:`inbox`,kindFilter:`all`,pinnedOnly:!1}},{id:`pinned`,label:j.pinned,patch:{statusFilter:`all`,kindFilter:`all`,pinnedOnly:!0}},{id:`tasks`,label:j.viewTasks,patch:{statusFilter:`all`,kindFilter:`todo`,pinnedOnly:!1}},{id:`voice`,label:j.kindVoice,patch:{statusFilter:`all`,kindFilter:`voice`,pinnedOnly:!1}},{id:`media`,label:j.kindMedia,patch:{statusFilter:`all`,kindFilter:`media`,pinnedOnly:!1}},{id:`bookmarks`,label:j.kindBookmark,patch:{statusFilter:`all`,kindFilter:`bookmark`,pinnedOnly:!1}},{id:`processed`,label:j.filterProcessed,patch:{statusFilter:`processed`,kindFilter:`all`,pinnedOnly:!1}},{id:`archive`,label:j.filterArchived,patch:{statusFilter:`archived`,kindFilter:`all`,pinnedOnly:!1}}],[j.filterArchived,j.filterInbox,j.filterProcessed,j.kindBookmark,j.kindMedia,j.kindVoice,j.pinned,j.viewRecent,j.viewTasks]),Re=Le.find(e=>rn(P,e))??Le[0],ze=f??Re.label,Be=(0,Q.useCallback)(async e=>{G(null);try{let n=c?await ge({markdown:e,kind:`thought`,projectId:c,channel:`web`}):await Ue(e,`web`);await Y(),J(an(t,n.id))}catch(e){throw G(`${j.quickCaptureFailed}: ${e instanceof Error?e.message:j.quickCaptureFailedHint}`),e}},[t,Y,j.quickCaptureFailed,j.quickCaptureFailedHint,J,c]),Ve=(0,Q.useCallback)(async()=>{if(!W){oe(!0),G(null);try{let e=await ge({markdown:``,kind:`thought`,projectId:c,channel:`web`});F({type:`patch`,patch:Jt}),await Y(),ue(e.id),J(an(t,e.id))}catch(e){G(`${j.createBlankFailed}: ${e instanceof Error?e.message:j.createBlankFailedHint}`)}finally{oe(!1)}}},[t,W,Y,j.createBlankFailed,j.createBlankFailedHint,J,c]),He=(0,Q.useCallback)(()=>{let e=document.createElement(`input`);e.type=`file`,e.accept=`image/*`,e.onchange=async()=>{let t=e.files?.[0];if(t)try{G(null),await ie(t,`web`),await Y()}catch(e){G(`${j.imageUploadFailed}: ${e instanceof Error?e.message:j.imageUploadFailedHint}`)}},e.click()},[Y,j.imageUploadFailed,j.imageUploadFailedHint]),We=(0,Q.useCallback)(async(e,t)=>{try{G(null),await k(e,t,`web`),await Y()}catch(e){G(`${j.voiceUploadFailed}: ${e instanceof Error?e.message:j.voiceUploadFailedHint}`)}},[Y,j.voiceUploadFailed,j.voiceUploadFailedHint]),Ke=(0,Q.useCallback)(()=>{G(`${j.voiceCaptureFailed}: ${j.voiceCaptureFailedHint}`)},[j.voiceCaptureFailed,j.voiceCaptureFailedHint]),Z=(0,Q.useCallback)(async(e,t)=>{await M(e,{pinned:t}),await Y()},[Y]),qe=(0,Q.useCallback)(async e=>{await M(e,{status:`archived`}),await Y()},[Y]),Je=(0,Q.useCallback)(async e=>{await je(e),await Y()},[Y]),Ye=(0,Q.useCallback)(e=>{J(an(t,e))},[t,J]),Xe=(0,Q.useCallback)(e=>{J(an(t,e)),L(!1)},[t,J]),Ze=(0,Q.useCallback)(e=>{if(X.length){if(e.key===`ArrowDown`)e.preventDefault(),ee(e=>Math.min(X.length-1,e+1));else if(e.key===`ArrowUp`)e.preventDefault(),ee(e=>Math.max(0,e-1));else if(e.key===`Enter`){e.preventDefault();let t=X[B]??X[0];t&&Xe(t.id)}}},[B,Xe,X]),Qe=(0,Q.useCallback)(e=>{e.preventDefault();let t=e.currentTarget,n=fe.current;t.setPointerCapture(e.pointerId),U(!0);let r=K.current?.clientWidth??window.innerWidth,i=Math.max(Yt,r-Qt),a=Math.min(Zt,i),o=e=>Math.max(Yt,Math.min(a,e)),s=e.clientX,c=o(V),l=e.pointerId,u=0,d=c,f=c;n&&(n.style.transition=`none`,n.style.width=`${c}px`);let p=()=>{u=0,f=d,n&&(n.style.width=`${f}px`)},m=e=>{d=o(c+e.clientX-s),u===0&&(u=window.requestAnimationFrame(p))},h=()=>{u!==0&&(window.cancelAnimationFrame(u),p());try{t.releasePointerCapture(l)}catch{}U(!1),K.current?.style.setProperty(`--notes-list-width`,`${f}px`),n&&(n.style.removeProperty(`transition`),n.style.removeProperty(`width`)),H(f),en(A,f),window.removeEventListener(`pointermove`,m),window.removeEventListener(`pointerup`,h),window.removeEventListener(`pointercancel`,h)};window.addEventListener(`pointermove`,m),window.addEventListener(`pointerup`,h),window.addEventListener(`pointercancel`,h)},[A,V]);(0,Q.useEffect)(()=>{let e=e=>{e.defaultPrevented||e.repeat||e.key.toLowerCase()!==`n`||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||(e.preventDefault(),Ve())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Ve]);let $e=(0,Q.useCallback)(e=>{e.key===`ArrowLeft`?(e.preventDefault(),me(V-16)):e.key===`ArrowRight`?(e.preventDefault(),me(V+16)):e.key===`Home`?(e.preventDefault(),me(Yt)):e.key===`End`&&(e.preventDefault(),me(Zt))},[me,V]);return N?(0,$.jsxs)(`div`,{ref:K,className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-base`,style:{"--notes-list-width":`${V}px`},children:[(0,$.jsxs)(`section`,{ref:fe,className:d(`relative flex min-h-0 w-full shrink-0 flex-col overflow-hidden border-r border-edge bg-surface-rail`,!ne&&`lg:transition-[width] lg:duration-[280ms] lg:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:lg:transition-none`,re?`lg:w-0 lg:min-w-0 lg:max-w-0 lg:pointer-events-none`:`lg:w-[var(--notes-list-width)]`,e&&`hidden lg:flex`),"aria-hidden":re?!0:void 0,children:[(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-edge-subtle p-3`,children:[se?(0,$.jsx)(`p`,{className:`mb-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:se}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[r?(0,$.jsx)(o,{value:Re.id,onChange:e=>{let t=Le.find(t=>t.id===e.target.value);t&&F({type:`patch`,patch:t.patch})},className:`-ml-1 h-7 w-full max-w-44 rounded-lg border border-transparent bg-transparent px-2 text-sm font-semibold text-fg transition-colors hover:border-edge hover:bg-surface-base focus:border-accent focus:bg-surface-base focus:outline-none focus:ring-1 focus:ring-accent`,"aria-label":j.libraryTitle,children:Le.map(e=>(0,$.jsx)(s,{value:e.id,children:e.label},e.id))}):(0,$.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:ze}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:ke})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>ae(!0),className:`hidden 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 lg:inline-flex`,"aria-label":j.collapseNotesList,title:j.collapseNotesList,children:(0,$.jsx)(de,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:Ve,disabled:W,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 disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":j.createBlankNote,title:j.createBlankShortcut,children:(0,$.jsx)(l,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>L(!0),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`,"aria-label":j.searchDialogTitle,title:j.searchDialogTitle,children:(0,$.jsx)(O,{className:`size-4`,"aria-hidden":!0})})]})]})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 py-3 [scrollbar-gutter:stable]`,children:ye?(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:[1,2,3,4].map(e=>(0,$.jsx)(`div`,{className:`h-20 animate-pulse rounded-lg bg-surface-hover`},e))}):be.length===0?(0,$.jsxs)(`div`,{className:`flex h-full min-h-48 flex-col items-center justify-center gap-2 px-6 py-10 text-center`,children:[(0,$.jsx)(`span`,{className:`mb-1 inline-flex size-12 items-center justify-center rounded-xl border border-edge-subtle bg-surface-base text-fg-muted`,children:(0,$.jsx)(_e,{className:`size-6`,"aria-hidden":!0})}),(0,$.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:e&&!Te?j.noteOutsideCurrentView:E??j.noNotes}),e&&!Te?null:(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:D??j.noNotesDescription})]}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e&&!Te?(0,$.jsx)(`div`,{className:`mb-2 rounded-lg border border-edge-subtle bg-surface-base px-3 py-2 text-xs leading-5 text-fg-muted`,children:j.noteOutsideCurrentView}):null,be.map((t,n)=>{let r=n>0?it(be[n-1].createdAt):null;return(0,$.jsxs)(`div`,{children:[it(t.createdAt)!==r&&(0,$.jsx)(`div`,{className:d(`px-3 pb-1.5 pt-2 text-xs font-medium text-fg-muted`,n===0&&`pt-0`),children:rt(t.createdAt,q,Ie)}),(0,$.jsx)(ut,{note:t,selected:t.id===e,onPress:Ye,onPin:Z,onArchive:qe,onDelete:Je,timeLabels:Ie,labels:{pin:j.pin,unpin:j.unpin,archive:j.archive,delete:j.delete,actions:j.noteActions,imageNote:j.imageNote,noText:j.noText}})]},t.id)})]})}),(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle p-3`,children:(0,$.jsx)(qt,{placeholder:j.quickCapturePlaceholder,submitLabel:j.quickCaptureSubmit,actionsLabel:j.quickCaptureActions,imageLabel:j.quickCaptureImage,voiceLabel:j.quickCaptureVoice,stopRecordingLabel:j.stopRecording,onCapture:Be,onImagePick:i?He:void 0,onVoiceCapture:i?We:void 0,onVoiceError:Ke,recordingLabel:j.recording,discussionCaptureLabel:j.discussionCapture.title,onDiscussionCapture:()=>te(c)})})]}),(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":j.resizeNotesList,"aria-valuemin":Yt,"aria-valuemax":Zt,"aria-valuenow":Math.round(V),tabIndex:0,onPointerDown:Qe,onDoubleClick:()=>me(Xt),onKeyDown:$e,title:j.resizeNotesList,className:d(`group relative z-10 hidden shrink-0 cursor-col-resize touch-none select-none items-center justify-center bg-surface-base lg:flex`,`lg:transition-[width,opacity] lg:duration-[280ms] lg:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:lg:transition-none`,re?`lg:w-0 lg:opacity-0 lg:pointer-events-none`:`lg:w-2 lg:opacity-100`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-0`),children:(0,$.jsx)(`span`,{"aria-hidden":!0,className:d(`h-full w-px bg-edge transition-[background-color,transform] duration-150`,`group-hover:bg-accent/70 group-focus-visible:bg-accent`,ne&&`bg-accent scale-x-[2]`)})}),(0,$.jsxs)(`section`,{className:d(`relative min-w-0 flex-1 bg-surface-base`,!e&&`hidden lg:flex`),children:[re?(0,$.jsx)(`button`,{type:`button`,onClick:()=>ae(!1),className:`absolute left-3 top-3 z-10 hidden size-8 items-center justify-center rounded-lg border border-edge bg-surface-base text-fg-muted shadow-surface transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent lg:inline-flex`,"aria-label":j.expandNotesList,title:j.expandNotesList,children:(0,$.jsx)(de,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})}):null,e?(0,$.jsx)(Ht,{noteId:e,onBack:()=>J(t),onSaved:()=>void Y(),backButtonClassName:`lg:hidden`,clearHeaderOnCleanup:!1,onOpenSearch:()=>L(!0),autoFocus:e===le,onAutoFocusConsumed:()=>ue(null)}):(0,$.jsx)(`div`,{className:`flex h-full min-h-0 flex-1 items-center justify-center px-8 text-center`,children:(0,$.jsxs)(`div`,{className:`max-w-sm`,children:[(0,$.jsx)(_e,{className:`mx-auto size-9 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-base font-semibold text-fg`,children:j.emptyEditorTitle}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:j.emptyEditorDescription}),(0,$.jsxs)(`button`,{type:`button`,onClick:Ve,disabled:W,className:`mt-5 inline-flex items-center gap-2 rounded-lg bg-accent px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,$.jsx)(l,{className:`size-4`,"aria-hidden":!0}),W?j.creatingBlankNote:j.createBlankNote]})]})})]}),(0,$.jsx)(C,{open:I,onOpenChange:L,children:(0,$.jsxs)(b,{children:[(0,$.jsx)(_,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(x,{className:`fixed left-1/2 top-24 z-[90] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-float focus:outline-none`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(S,{className:`text-sm font-semibold text-fg`,children:Ae}),(0,$.jsx)(v,{className:`sr-only`,children:j.searchPlaceholder}),(0,$.jsx)(y,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,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`,"aria-label":Ne,children:(0,$.jsx)(u,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`p-4`,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(O,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`input`,{type:`search`,value:R,onChange:e=>z(e.target.value),onKeyDown:Ze,placeholder:j.searchPlaceholder,className:`w-full rounded-lg border border-edge bg-surface-base py-2 pl-9 pr-10 text-sm text-fg placeholder:text-fg-muted focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent`}),R?(0,$.jsx)(`button`,{type:`button`,onClick:()=>z(``),className:`absolute right-2 top-1/2 inline-flex size-7 -translate-y-1/2 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":Pe,children:(0,$.jsx)(u,{className:`size-3.5`,"aria-hidden":!0})}):null]}),(0,$.jsx)(`div`,{className:`mt-4 max-h-[min(28rem,calc(100vh-14rem))] overflow-y-auto [scrollbar-gutter:stable]`,children:Se?we&&!Ce?(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:[1,2,3].map(e=>(0,$.jsx)(`div`,{className:`h-16 animate-pulse rounded-lg bg-surface-hover`},e))}):X.length===0?(0,$.jsxs)(`div`,{className:`flex min-h-40 flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,$.jsx)(_e,{className:`size-7 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:j.searchNoResults}),(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:j.searchNoResultsDescription})]}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`p`,{className:`px-2 pb-1 text-xs text-fg-muted`,children:j.searchResultsCount.replace(`{{count}}`,String(Ce?.total??X.length))}),X.map((e,t)=>{let n=tn[e.kind]||_e,r=nn(e,{imageNote:j.imageNote,noText:j.noText});return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>Xe(e.id),onMouseEnter:()=>ee(t),className:d(`flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors`,t===B?`bg-surface-active`:`hover:bg-surface-hover`),children:[(0,$.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.title||r}),(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:nt(e.updatedAt,q,Ie)})]}),e.title?(0,$.jsx)(`span`,{className:`mt-0.5 block line-clamp-2 text-xs leading-5 text-fg-muted`,children:r}):null,e.tags?.length?(0,$.jsx)(`span`,{className:`mt-1 flex min-w-0 flex-wrap gap-1`,children:e.tags.slice(0,3).map(e=>(0,$.jsx)(`span`,{className:`max-w-24 truncate rounded-md bg-surface-hover px-1.5 py-0.5 text-xs text-fg-muted`,children:e},e))}):null]})]},e.id)})]}):(0,$.jsxs)(`div`,{className:`flex min-h-40 flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,$.jsx)(O,{className:`size-7 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:j.searchEmptyTitle}),(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:j.searchEmptyDescription})]})})]})]})]})})]}):(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,$.jsx)(_e,{className:`size-10 text-fg-muted`}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:j.needToken})]})}export{Je as n,on as t};
|
|
@@ -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{n as a}from"./interaction-BmQogeqz.js";import{jo as o}from"./index-
|
|
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{n as a}from"./interaction-BmQogeqz.js";import{jo as o}from"./index-DzKLVgY-.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=o()&&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=o()&&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`,a.transition,a.press,a.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`,a.transition,a.press,a.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`,a.transition,a.press,a.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{n as e,t}from"./vendor-react-BOUWij0V.js";import{c as n,r,t as i}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as a}from"./locale-store-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{c as n,r,t as i}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as a}from"./locale-store-C7xtkP3D.js";import{i as o}from"./vendor-swr-BIWyz7Rc.js";import{a as s,r as c}from"./product-delivery-tRr-7IxY.js";import{Aa as l}from"./index-DzKLVgY-.js";import{n as u}from"./api-CzaAcDOn.js";var d=e();function f(e){return e.installationState===`installed`&&e.enabled&&e.status===`installed`?`/extensions/${encodeURIComponent(e.extensionId)}`:`/local-apps/${encodeURIComponent(e.id)}`}var p=t();function m(){let e=(0,d.c)(14),t=n(),i=a(h)===`zh`,m=c(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=o(_?[`local-app-open`,_]:null,()=>u(_));if(!m){let t=i?`这个打开链接无效。`:`This open link is invalid.`,n;return e[0]!==t||e[1]!==i?(n=(0,p.jsx)(g,{message:t,zh:i}),e[0]=t,e[1]=i,e[2]=n):n=e[2],n}if(m.kind!==`local_app`){let t=s({...m,title:m.id,capabilities:[`open`]}),n;return e[3]!==t||e[4]!==i?(n=t?(0,p.jsx)(r,{to:t,replace:!0}):(0,p.jsx)(g,{message:i?`这个内容无法在应用中打开。`:`This content cannot be opened in the app.`,zh:i}),e[3]=t,e[4]=i,e[5]=n):n=e[5],n}if(y){let t=typeof y==`object`&&y&&`status`in y&&y.status===404?i?`找不到这个本地应用,它可能已被删除。`:`This local app was not found and may have been deleted.`:y instanceof Error?y.message:i?`无法打开这个本地应用。`:`Unable to open this local app.`,n;return e[6]!==t||e[7]!==i?(n=(0,p.jsx)(g,{message:t,zh:i}),e[6]=t,e[7]=i,e[8]=n):n=e[8],n}if(v){let t;e[9]===v?t=e[10]:(t=f(v),e[9]=v,e[10]=t);let n;return e[11]===t?n=e[12]:(n=(0,p.jsx)(r,{to:t,replace:!0}),e[11]=t,e[12]=n),n}let b;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 px-3 py-6 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,p.jsx)(l,{className:`h-6 w-48`}),(0,p.jsx)(l,{className:`h-32 rounded-xl`})]}),e[13]=b):b=e[13],b}function h(e){return e.language}function g(e){let t=(0,d.c)(7),{message:n,zh:r}=e,a;t[0]===n?a=t[1]:(a=(0,p.jsx)(`p`,{children:n}),t[0]=n,t[1]=a);let o=r?`查看本地应用`:`View local apps`,s;t[2]===o?s=t[3]:(s=(0,p.jsx)(i,{className:`mt-3 inline-flex font-medium text-accent hover:underline`,to:`/local-apps`,children:o}),t[2]=o,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,p.jsxs)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,role:`alert`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}export{m as ProductOpenPage};
|