@xopcai/xopc 0.0.174 → 0.0.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CyEDJeIt.js → activity-store-DsFM1upC.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DF7Bol6I.js → agent-avatar-dicebear-DvdMLOga.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BVjlpbeZ.js +2 -0
- package/dist/gateway/static/root/assets/{api-DYunqroX.js → api-BdPLCCBm.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DwyUxpgY.js → api-Bop4IQRW.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B4xJyvDu.js → app-management-settings-panel-DMLDOHul.js} +1 -1
- package/dist/gateway/static/root/assets/appearance-settings-DbI9foFR.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-njqxLWYD.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DWhBmmjD.js → archive-plugin-Dfdxuwvb.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BOpZfa_I.js → attachment-load-Dn3RlnYD.js} +2 -2
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-DonnL2dL.js → attachment-preview-renderer-Cmo-5BP5.js} +2 -2
- package/dist/gateway/static/root/assets/{attachment-process-heavy-RnGYy9bC.js → attachment-process-heavy-B2_kr5EA.js} +3 -3
- package/dist/gateway/static/root/assets/{automation-suggestion-card-Byu3I7Rs.js → automation-suggestion-card-Bc0Y7A9u.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-D-eweHZJ.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-6AG1qatz.js → binary-plugins-0XtB-xC0.js} +2 -2
- package/dist/gateway/static/root/assets/{block-editor-CJhrn98_.js → block-editor-C4fXWbEE.js} +6 -6
- package/dist/gateway/static/root/assets/browser-settings-page-lC86-drr.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CBVb4mt9.js → browser-workflow-inputs-CZmzNymN.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Cq4XUKbu.js → browser-workflows-page-CBYM9HqG.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-6tYNfHqJ.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-hbW4NAKO.js → capability-presets-api-BiJxmmhW.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Co-ymbd9.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-CzMjHb17.js → channel-recipient-api-BKTUZDp-.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-D46eVjaQ.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-BMRAO4zZ.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-B9Au6gMZ.js → connector-logo-Pr4RIKjj.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-Dw1eYbRi.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-B8cZuQUt.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CNff5TFb.js → desktop-pet-settings-CEQacUDF.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Bf956uo-.js → directory-picker-path-field-DWnxdZtc.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CHM8FE1g.js → dreaming-settings-D2e2w2Ho.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-ZqM_0eUs.js → extension-debug-page-BLjTGbv3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D4hvXOMM.js → extension-page-D2_UC6hy.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-GsqxaJjA.js → extension-settings-page-BsH6o_PX.js} +1 -1
- package/dist/gateway/static/root/assets/{focus-detail-page-CE6uwrl1.js → focus-detail-page-BBXUtxRB.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-B4THmgnS.js → gateway-config-api-C-DkC6UJ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CPv-MxGE.js → gateway-settings-DEOGiimF.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-MP3K71pP.js → gateway-startup-retry-BlSLh1TF.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-CSFcRE_N.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-VjRArfAJ.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-DCcDuIjG.js → goals-config-api-CcdS9qek.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-BAcErdch.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-o9QMXvNq.js → goals-settings-BY7crl0z.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DixwpXnH.js → heartbeat-settings-DtTkS0gs.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BOGH9FGi.js → image-generation-api-WGgkbwDZ.js} +1 -1
- package/dist/gateway/static/root/assets/index-2UImfRDC.js +212 -0
- package/dist/gateway/static/root/assets/index-CS9sVShT.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-D4o4ZPF6.js → keyboard-shortcuts-settings-C5lpWQ3f.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Cl0fcPL4.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-GzMmpO7G.js → local-apps-page-b05wWvXG.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CAuhEGCn.js → locale-store-sToMfHX_.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-cDE1jLJv.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-CIX8D1pv.js → markdown-split-0gPVst5y.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Bp3eIA45.js → media-plugins-Rxyq_KTm.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CarlxqXV.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-RVFiYAoO.js → notes-page-DRhNDl_Q.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-BKNBk0Uf.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-BGAYH3Ef.js → page-tabs-cOEOQqHh.js} +1 -1
- package/dist/gateway/static/root/assets/pdf-D4PI9qAw.js +54 -0
- package/dist/gateway/static/root/assets/pdf.worker.min-CHFwMXne.mjs +29 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BM6pDkHp.js → preview-open-alternatives-BopOLFvu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BiMetEmn.js → product-open-page-DWVPmmOq.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BhjEXNQW.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-B80e69PH.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CwdVob6H.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-BdjV8MK5.js → save-bar-controls-BfZmKe1t.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-ChlqXU46.js → schedule-field-Cpi4jCRV.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DDKf5ZSH.js → schema-form-OXFkcZQe.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BGt3Asj6.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BnTdM9Nn.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CPG0KGVs.js → settings-form-section-BwqkZCHJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DRSDHucM.js → settings-loading-skeleton-BbqH_S3Y.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CeB7_xD0.js → settings-page-BoxC-JSa.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BENrkwd0.js → settings-page-layout-Ddu2iGaW.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-z1Lwv0js.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DIzczJkG.js → share-preview-page-CVazOFjy.js} +2 -2
- package/dist/gateway/static/root/assets/shares-settings-C4lXuyQj.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DSuIDkeI.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-xgZczqVe.js +2 -0
- package/dist/gateway/static/root/assets/skills-page.utils-DgyB1tSo.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-Dp4d5Q1B.js → system-settings-panel-BoLSQL65.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-CbGc1laW.js → theme-store-CBNcGOfj.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-gochWrny.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-DwPk3OPL.js → typed-models-lib-DvRnr7YB.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CXrEu2dw.js → use-channel-catalog-CA9BFVB7.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-CEfIy4WZ.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DFoA79LB.js → voice-api-key-field-v8tgylEZ.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-B-3MClaf.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-CEsFEdax.js +1 -0
- package/dist/gateway/static/root/assets/work-page-CT9AHnq6.js +3 -0
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-CC3cJn5k.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-C-1-_Zp1.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +8 -8
- package/dist/src/agent/context/execution-scope.d.ts +26 -0
- package/dist/src/agent/context/execution-scope.js +84 -0
- package/dist/src/agent/context/project-context.d.ts +3 -1
- package/dist/src/agent/context/project-context.js +26 -8
- package/dist/src/agent/embedded/model-runtime.d.ts +1 -2
- package/dist/src/agent/embedded/model-runtime.js +17 -29
- package/dist/src/agent/embedded/session-runner.js +2 -3
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +1 -0
- package/dist/src/agent/prompt/system-prompt.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +7 -4
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/session/session-config-service.d.ts +4 -1
- package/dist/src/agent/session/session-config-service.js +5 -3
- package/dist/src/agent/session/session-inspector.d.ts +6 -0
- package/dist/src/agent/session/session-inspector.js +9 -2
- package/dist/src/agent/skills/hub-pull.js +1 -1
- package/dist/src/agent/skills/index.d.ts +2 -0
- package/dist/src/agent/skills/index.js +14 -5
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/test-framework.js +1 -1
- package/dist/src/agent/workflow/subagent-runner.js +2 -0
- package/dist/src/agent/workflow/types.d.ts +1 -0
- package/dist/src/auth/model-credential-store.d.ts +17 -0
- package/dist/src/auth/model-credential-store.js +110 -0
- package/dist/src/auth/oauth/github-copilot.js +2 -2
- package/dist/src/auth/oauth/openai-codex.js +98 -7
- package/dist/src/auth/oauth/types.d.ts +4 -1
- package/dist/src/auth/oauth/xopc-cloud.js +124 -6
- package/dist/src/automations/domain/defaults.d.ts +1 -0
- package/dist/src/automations/domain/defaults.js +4 -0
- package/dist/src/automations/domain/index.d.ts +1 -0
- package/dist/src/automations/domain/index.js +2 -1
- package/dist/src/automations/index.js +2 -1
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/skills.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/schema.d.ts +21 -0
- package/dist/src/config/schema.js +12 -2
- 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 +3 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -0
- package/dist/src/gateway/hono/oauth-async.d.ts +5 -0
- package/dist/src/gateway/hono/oauth-async.js +20 -8
- package/dist/src/gateway/hono/routes/config-patch/gateway.d.ts +1 -1
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +9 -0
- package/dist/src/gateway/hono/routes/goals.js +13 -0
- package/dist/src/gateway/hono/routes/home.d.ts +16 -3
- package/dist/src/gateway/hono/routes/home.js +98 -25
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/project-skills.d.ts +3 -0
- package/dist/src/gateway/hono/routes/project-skills.js +119 -0
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/sessions-api.d.ts +2 -1
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/projects/index.d.ts +1 -0
- package/dist/src/projects/index.js +2 -1
- package/dist/src/projects/project-skill-service.d.ts +67 -0
- package/dist/src/projects/project-skill-service.js +131 -0
- package/dist/src/providers/index.js +4 -2
- package/dist/src/providers/provider-auth-service.d.ts +22 -0
- package/dist/src/providers/provider-auth-service.js +66 -0
- package/dist/src/providers/register-runtime-providers.d.ts +6 -0
- package/dist/src/providers/register-runtime-providers.js +55 -0
- package/dist/src/providers/xopc-cloud-account-service.d.ts +2 -2
- package/dist/src/providers/xopc-cloud-account-service.js +6 -5
- package/dist/src/providers/xopc-cloud-config.d.ts +3 -0
- package/dist/src/providers/xopc-cloud-config.js +13 -0
- package/dist/src/providers/xopc-cloud-model-source.d.ts +2 -2
- package/dist/src/providers/xopc-cloud-model-source.js +6 -5
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/thinking-resolve.d.ts +8 -0
- package/dist/src/session/thinking-resolve.js +6 -3
- package/dist/src/storage/sqlite/home-attention-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/home-attention-repository.js +21 -0
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/migrations/067_home_attention_acknowledgements.sql +9 -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/schema.sql +10 -0
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/tui/xopc-tui-keybindings.d.ts +44 -4
- package/dist/src/workflows/engine/workflow-engine.d.ts +1 -0
- package/dist/src/workflows/engine/workflow-engine.js +2 -0
- package/dist/src/workflows/service/workflow-run-service.js +11 -5
- package/dist/src/workflows/service/workflow-session-bridge.js +2 -1
- package/package.json +5 -5
- package/dist/gateway/static/root/assets/agents-BVxEFPQ5.js +0 -2
- package/dist/gateway/static/root/assets/appearance-settings-B2PQxRiu.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BtIgd82S.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-CG_SCH5b.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CfLqPWZC.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DCJmm6cR.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-CnkAYvWI.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-DtqqFpDn.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-C-5yHbc0.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CaHfs8YF.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-CvFMKYdb.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-DAeb82xP.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-CwLSp01r.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-DvJQ6_4M.js +0 -2
- package/dist/gateway/static/root/assets/index-CfXiRNN5.css +0 -1
- package/dist/gateway/static/root/assets/index-eyttVNS_.js +0 -212
- package/dist/gateway/static/root/assets/local-app-workbench-page-CPcfqn_A.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-DXABWCZp.js +0 -7
- package/dist/gateway/static/root/assets/messages-BiBdO1-O.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-DgJzZRX3.js +0 -4
- package/dist/gateway/static/root/assets/pdf-epILhEOn.js +0 -54
- package/dist/gateway/static/root/assets/pdf.worker.min-iDqQPrd3.mjs +0 -31
- package/dist/gateway/static/root/assets/project-detail-page-DF7F70Vg.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Cw3jyi5s.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-ChAJsaNY.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BxZIxt7z.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DcDLS0xV.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-4Xa9NA7v.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BpN0o5Cf.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DvF2UAaL.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CGKXpNfy.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-BhgCeDuO.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Dy_fKAK_.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BWkjb1NK.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DLBNFse5.js +0 -1
- package/dist/gateway/static/root/assets/work-page-Bn5RXMIE.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BuniGPO0.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-_vFhRrAl.js +0 -11
|
@@ -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-BKNBk0Uf.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-C4fXWbEE.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-2UImfRDC.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/chunk-KS7C4IRE-BMhrPKJC.js","assets/vendor-swr-BIWyz7Rc.js","assets/createLucideIcon-DPHK1VkS.js","assets/check-DUBLcKHA.js","assets/circle-alert-BEjgurr2.js","assets/middleware-Pd0e8Igk.js","assets/locale-store-sToMfHX_.js","assets/messages-CarlxqXV.js","assets/cn-JdwAhgNB.js","assets/schemas-DgQq6Z5S.js","assets/product-delivery-BTRT9kCS.js","assets/config-reload-event-Bjh2zoKp.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/gateway-startup-retry-BlSLh1TF.js","assets/activity-store-DsFM1upC.js","assets/theme-store-CBNcGOfj.js","assets/index-CS9sVShT.css","assets/vendor-codemirror--gTq3YAI.js","assets/with-selector-aYPsXwdl.js","assets/block-editor-D4ZIVQbk.css","assets/markdown-editor-BvUebh3C.js","assets/code-editor-D4_k-6QN.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{t as o}from"./cn-JdwAhgNB.js";import{t as s}from"./messages-CarlxqXV.js";import{l as c,n as l}from"./locale-store-sToMfHX_.js";import{i as u}from"./theme-store-CBNcGOfj.js";import{i as d}from"./vendor-swr-BIWyz7Rc.js";import{$c as f,$n as p,Bo as m,Bu as h,Cc as g,Ci as _,Cl as v,Cr as y,Ei as b,Er as x,Eu as S,Fc as C,Go as w,Ho as T,Ic as E,Iu as D,Js as O,Ks as k,Lc as A,Lu as j,Nc as M,Ns as N,Nt as P,Pu as F,Si as I,Ti as ee,To as te,U as ne,Uo as re,Vc as L,Vo as R,Wl as ie,Wo as z,Yc as ae,_ as oe,_r as se,ac as B,ar as V,bl as H,br as U,cr as W,dr as G,ec as K,er as ce,fr as le,gc as ue,gl as de,gr as fe,hc as pe,hr as me,is as he,iu as ge,jc as _e,lr as q,mr as ve,nl as J,ns as ye,oc as be,or as xe,pr as Se,ql as Ce,qo as we,qs as Te,rc as Y,sr as Ee,tr as De,tu as Oe,ur as ke,vr as Ae,wi as je,wl as Me,wr as Ne,xi as X,xl as Pe,xr as Fe,yr as Ie,zc as Le,zl as Re,zo as ze}from"./index-2UImfRDC.js";import{t as Be}from"./automation-suggestion-card-Bc0Y7A9u.js";var Z=n(),Q=e(t(),1),$=r(),Ve=(0,Q.createContext)(null);function He(){let e=(0,Z.c)(1),t=(0,Q.useContext)(Ve);if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={openImage:Ue},e[0]=t):t=e[0],t}return t}function Ue(){}function We(e){let t=(0,Z.c)(22),{children:n,closeLabel:r}=e,i=r===void 0?`Close`:r,[a,s]=(0,Q.useState)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(e,t)=>{s({src:e,alt:t})},t[0]=c):c=t[0];let l=c,u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={openImage:l},t[1]=u):u=t[1];let d=u,f=a!==null,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e||s(null)},t[2]=p):p=t[2];let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(re,{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=o(`fixed inset-0 z-[71] flex items-center justify-center p-4 outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`),t[4]=g):g=t[4];let _=a?.alt||`Image preview`,v;t[5]===_?v=t[6]:(v=(0,$.jsx)(w,{className:`sr-only`,children:_}),t[5]=_,t[6]=v);let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(N,{className:`size-5`,"aria-hidden":!0}),t[7]=y):y=t[7];let b;t[8]===i?b=t[9]:(b=(0,$.jsx)(m,{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:y})}),t[8]=i,t[9]=b);let x;t[10]===a?x=t[11]:(x=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]=x);let S;t[12]!==b||t[13]!==x||t[14]!==v?(S=(0,$.jsxs)(z,{children:[h,(0,$.jsxs)(R,{className:g,"aria-describedby":void 0,children:[v,b,x]})]}),t[12]=b,t[13]=x,t[14]=v,t[15]=S):S=t[15];let C;t[16]!==S||t[17]!==f?(C=(0,$.jsx)(ze,{open:f,onOpenChange:p,children:S}),t[16]=S,t[17]=f,t[18]=C):C=t[18];let T;return t[19]!==n||t[20]!==C?(T=(0,$.jsxs)(Ve.Provider,{value:d,children:[n,C]}),t[19]=n,t[20]=C,t[21]=T):T=t[21],T}function Ge(e){let t=(0,Z.c)(15),{noteId:n,attachmentId:r,className:i}=e,[a,s]=(0,Q.useState)(!1),c;t[0]!==r||t[1]!==n?(c=x(n,r),t[0]=r,t[1]=n,t[2]=c):c=t[2];let l=c;if(a){let e;t[3]===i?e=t[4]:(e=o(`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)(v,{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 u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(!0),t[8]=u):u=t[8];let d;t[9]===i?d=t[10]:(d=o(`size-12 shrink-0 rounded-lg border border-edge-subtle bg-surface-hover object-cover`,i),t[9]=i,t[10]=d);let f;return t[11]!==n||t[12]!==l||t[13]!==d?(f=(0,$.jsx)(Ne,{src:l,expectedNoteId:n,alt:``,loading:`lazy`,draggable:!1,onLoadFailed:u,className:d}),t[11]=n,t[12]=l,t[13]=d,t[14]=f):f=t[14],f}var Ke=6e4,qe=36e5,Je=864e5;function Ye(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function Xe(e,t,n){let r=t-e;if(r<Ke)return n.justNow;if(r<qe){let e=Math.floor(r/Ke);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=Ye(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(e>=i-Je)return n.yesterday+` `+new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`});if(r<7*Je){let e=Math.floor(r/Je);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function Ze(e,t,n){let r=Ye(t);if(e>=r)return n.today;if(e>=r-Je)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 Qe(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function $e(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 et(e){let t=(0,Z.c)(38),{noteId:n,attachmentId:r,durationSec:i,className:a}=e,{playing:s,loading:c,currentTime:l,duration:u,noteId:d,attachmentId:f}=De(),p=De(nt),m=d===n&&f===r,h=m&&s,g=m&&c,_=m?l:0,v=m&&u>0?u:i??0,y=v>0?Math.min(_/v*100,100):0,b;t[0]!==r||t[1]!==i||t[2]!==n||t[3]!==p?(b=e=>{e.stopPropagation(),p(n,r,i)},t[0]=r,t[1]=i,t[2]=n,t[3]=p,t[4]=b):b=t[4];let x=b,S;t[5]!==r||t[6]!==i||t[7]!==n||t[8]!==p?(S=e=>{(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),e.preventDefault(),p(n,r,i))},t[5]=r,t[6]=i,t[7]=n,t[8]=p,t[9]=S):S=t[9];let C=S,w;t[10]===a?w=t[11]:(w=o(`flex items-center gap-2`,a),t[10]=a,t[11]=w);let T=h?`bg-accent text-white`:`bg-accent/10 text-accent hover:bg-accent/20`,E;t[12]===T?E=t[13]:(E=o(`flex size-7 shrink-0 items-center justify-center rounded-full transition-colors`,T),t[12]=T,t[13]=E);let D=h?`Pause`:`Play`,O;t[14]!==g||t[15]!==h?(O=g?(0,$.jsx)(J,{className:`size-3.5 animate-spin`}):h?(0,$.jsx)(Le,{className:`size-3.5`}):(0,$.jsx)(M,{className:`size-3.5 ml-0.5`}),t[14]=g,t[15]=h,t[16]=O):O=t[16];let k;t[17]!==x||t[18]!==C||t[19]!==E||t[20]!==D||t[21]!==O?(k=(0,$.jsx)(`button`,{type:`button`,onClick:x,onKeyDown:C,className:E,"aria-label":D,children:O}),t[17]=x,t[18]=C,t[19]=E,t[20]=D,t[21]=O,t[22]=k):k=t[22];let A=`${y}%`,j;t[23]===A?j=t[24]:(j=(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:A}})}),t[23]=A,t[24]=j);let N;t[25]!==v||t[26]!==m||t[27]!==_?(N=$e(m&&_>0?_:v),t[25]=v,t[26]=m,t[27]=_,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]!==j||t[32]!==P?(F=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[j,P]}),t[31]=j,t[32]=P,t[33]=F):F=t[33];let I;return t[34]!==F||t[35]!==w||t[36]!==k?(I=(0,$.jsxs)(`div`,{className:w,onClick:tt,children:[k,F]}),t[34]=F,t[35]=w,t[36]=k,t[37]=I):I=t[37],I}function tt(e){return e.stopPropagation()}function nt(e){return e.toggle}function rt(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function it(e){let t=(0,Z.c)(80),{note:n,selected:r,onPress:i,onPin:a,onArchive:s,onDelete:c,labels:l,timeLabels:u}=e,d=r===void 0?!1:r,f;t[0]!==l||t[1]!==n?(f=rt(n,l),t[0]=l,t[1]=n,t[2]=f):f=t[2];let p=f,m=!n.snippet?.trim(),[h]=(0,Q.useState)(ct),g;t[3]!==n.createdAt||t[4]!==h||t[5]!==u?(g=Xe(n.createdAt,h,u),t[3]=n.createdAt,t[4]=h,t[5]=u,t[6]=g):g=t[6];let v=g,y,x;t[7]!==n.id||t[8]!==i?(y=()=>i(n.id),x=e=>{(e.key===`Enter`||e.key===` `)&&i(n.id)},t[7]=n.id,t[8]=i,t[9]=y,t[10]=x):(y=t[9],x=t[10]);let S=d?`bg-surface-active hover:bg-surface-active`:`bg-surface-base hover:bg-surface-hover`,w;t[11]===S?w=t[12]:(w=o(`group relative flex cursor-pointer flex-col gap-2 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-panel`,S),t[11]=S,t[12]=w);let T=d?`true`:void 0,D;t[13]!==n.coverAttachmentId||t[14]!==n.id||t[15]!==n.kind||t[16]!==n.voiceAttachmentId||t[17]!==n.voiceDurationSec?(D=n.coverAttachmentId?(0,$.jsx)(Ge,{noteId:n.id,attachmentId:n.coverAttachmentId}):n.kind===`voice`&&n.voiceAttachmentId?(0,$.jsx)(et,{noteId:n.id,attachmentId:n.voiceAttachmentId,durationSec:n.voiceDurationSec,className:`mt-0.5 w-28 shrink-0`}):null,t[13]=n.coverAttachmentId,t[14]=n.id,t[15]=n.kind,t[16]=n.voiceAttachmentId,t[17]=n.voiceDurationSec,t[18]=D):D=t[18];let O;t[19]===n.title?O=t[20]:(O=n.title&&(0,$.jsx)(`h3`,{className:`mb-0.5 truncate text-sm font-semibold text-fg`,children:n.title}),t[19]=n.title,t[20]=O);let A=n.title?`text-fg-muted`:m?`italic text-fg-muted`:`text-fg`,M;t[21]===A?M=t[22]:(M=o(`truncate text-sm leading-5`,A),t[21]=A,t[22]=M);let N;t[23]!==p||t[24]!==M?(N=(0,$.jsx)(`p`,{className:M,children:p}),t[23]=p,t[24]=M,t[25]=N):N=t[25];let P;t[26]!==O||t[27]!==N?(P=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[O,N]}),t[26]=O,t[27]=N,t[28]=P):P=t[28];let F;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(b,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:st,className:`shrink-0 rounded-md p-1 text-fg-muted opacity-0 transition-opacity group-hover:opacity-100 hover:bg-surface-panel focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":`Actions`,children:(0,$.jsx)(Ce,{className:`size-4`})})}),t[29]=F):F=t[29];let te;t[30]!==n.id||t[31]!==n.pinned||t[32]!==a?(te=()=>a(n.id,!n.pinned),t[30]=n.id,t[31]=n.pinned,t[32]=a,t[33]=te):te=t[33];let ne;t[34]===n.pinned?ne=t[35]:(ne=n.pinned?(0,$.jsx)(C,{className:`size-4`}):(0,$.jsx)(E,{className:`size-4`}),t[34]=n.pinned,t[35]=ne);let re=n.pinned?l.unpin:l.pin,L;t[36]!==te||t[37]!==ne||t[38]!==re?(L=(0,$.jsxs)(I,{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:te,children:[ne,re]}),t[36]=te,t[37]=ne,t[38]=re,t[39]=L):L=t[39];let R;t[40]!==n.id||t[41]!==s?(R=()=>s(n.id),t[40]=n.id,t[41]=s,t[42]=R):R=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(j,{className:`size-4`}),t[43]=ie):ie=t[43];let z;t[44]!==l.archive||t[45]!==R?(z=(0,$.jsxs)(I,{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:R,children:[ie,l.archive]}),t[44]=l.archive,t[45]=R,t[46]=z):z=t[46];let ae;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(ee,{className:`my-1 h-px bg-edge-subtle`}),t[47]=ae):ae=t[47];let oe;t[48]!==n.id||t[49]!==c?(oe=()=>c(n.id),t[48]=n.id,t[49]=c,t[50]=oe):oe=t[50];let se;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(k,{className:`size-4`}),t[51]=se):se=t[51];let B;t[52]!==l.delete||t[53]!==oe?(B=(0,$.jsxs)(I,{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:oe,children:[se,l.delete]}),t[52]=l.delete,t[53]=oe,t[54]=B):B=t[54];let V;t[55]!==L||t[56]!==z||t[57]!==B?(V=(0,$.jsxs)(je,{children:[F,(0,$.jsx)(_,{children:(0,$.jsxs)(X,{className:`z-50 min-w-[140px] rounded-xl border border-edge bg-surface-panel p-1 shadow-lg`,sideOffset:4,align:`end`,onClick:ot,children:[L,z,ae,B]})})]}),t[55]=L,t[56]=z,t[57]=B,t[58]=V):V=t[58];let H;t[59]!==P||t[60]!==V||t[61]!==D?(H=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[D,P,V]}),t[59]=P,t[60]=V,t[61]=D,t[62]=H):H=t[62];let U;t[63]===n.pinned?U=t[64]:(U=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)(E,{className:`size-3`})}),t[63]=n.pinned,t[64]=U);let W;t[65]===n.tags?W=t[66]:(W=n.tags?.slice(0,2).map(at),t[65]=n.tags,t[66]=W);let G;t[67]===v?G=t[68]:(G=(0,$.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:v}),t[67]=v,t[68]=G);let K;t[69]!==U||t[70]!==W||t[71]!==G?(K=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[U,W,G]}),t[69]=U,t[70]=W,t[71]=G,t[72]=K):K=t[72];let ce;return t[73]!==H||t[74]!==K||t[75]!==y||t[76]!==x||t[77]!==w||t[78]!==T?(ce=(0,$.jsxs)(`article`,{role:`button`,tabIndex:0,onClick:y,onKeyDown:x,className:w,"aria-current":T,children:[H,K]}),t[73]=H,t[74]=K,t[75]=y,t[76]=x,t[77]=w,t[78]=T,t[79]=ce):ce=t[79],ce}function at(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 ot(e){return e.stopPropagation()}function st(e){return e.stopPropagation()}function ct(){return Date.now()}var lt={edit:A,ai_edit:be,sync:g,restore:D};function ut(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=s(l(e=>e.language)).notes,c=a,{data:u}=d(e?[`note-history`,e]:null,()=>G(e)),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(null),g=(0,Q.useCallback)(async t=>{p(!0);try{await U(e,t),h(null),i()}catch{we({type:`error`,title:a.restoreFailed})}finally{p(!1)}},[e,a.restoreSuccess,a.restoreFailed,i]),_=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)(Me,{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)(N,{className:`size-4`,"aria-hidden":!0})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:u?.length?(0,$.jsx)(`ul`,{className:`divide-y divide-edge`,children:u.map(e=>{let r=lt[e.trigger]??A,i=t===e.timestamp,s=m===e.timestamp;return(0,$.jsxs)(`li`,{children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:o(`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:ut(e.trigger,a)}),(0,$.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:Xe(e.timestamp,_,c)})]}),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(),g(e.timestamp)},disabled:f,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:f?`...`:a.restore}),(0,$.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),h(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(),h(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 ft(e){let t=(0,Z.c)(10),{noteId:n,note:r,catalyzing:i,onCatalyze:c,onClose:u,noteThreads:p,openingChat:m,onOpenChat:h,onOpenNewChat:g}=e,_=s(l(yt)).notes,v=a(),y=r?.aiDeep?.catalysis,b=y?.report??null,x;t[0]===n?x=t[1]:(x=n?[`note-agent-context-status`,n]:null,t[0]=n,t[1]=x);let S;t[2]===n?S=t[3]:(S=()=>q(n),t[2]=n,t[3]=S);let C;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(C={revalidateOnFocus:!1},t[4]=C):C=t[4];let{data:w,mutate:T,isLoading:E}=d(x,S,C),D;t[5]===n?D=t[6]:(D=async e=>{try{await Ie(n,e)}catch{}},t[5]=n,t[6]=D);let k=D,A;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(be,{className:`size-4 text-accent`,"aria-hidden":!0}),t[7]=A):A=t[7];let j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(F,{className:`size-4 rotate-180`,"aria-hidden":!0}),t[8]=j):j=t[8];let M;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(f,{className:`size-4 text-accent`,"aria-hidden":!0}),t[9]=M):M=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:[A,(0,$.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:_.catalysisSectionTitle})]}),(0,$.jsx)(`button`,{type:`button`,onClick:u,"aria-label":_.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:j})]}),(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:_.catalysisSectionDescription}),w?(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:_.contextStatusTitle}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>void T(()=>Ae(n),{revalidate:!1}),disabled:E,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:_.contextRebuild}),(0,$.jsx)(`span`,{className:o(`rounded-full px-2 py-0.5 text-[11px] font-medium`,w.status===`ready`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`:w.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:w.status})]}),(0,$.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:_.contextStatusDetail.replace(`{{attachments}}`,String(w.attachments.length)).replace(`{{tokens}}`,String(w.tokenEstimate??0))}),w.attachments.length>0?(0,$.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:w.attachments.slice(0,5).map(vt)}):null]}):null,(0,$.jsx)(`button`,{type:`button`,onClick:c,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?_.processing:b?_.recatalyze:_.catalyzeAction}),b?(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:_.valueHypothesis}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:b.valueHypothesis})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.targetUsers}),(0,$.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:b.targetUsers.slice(0,5).map(_t)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.keyQuestions}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.keyQuestions.slice(0,3).map(gt)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.mvpPathLabel}),(0,$.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.mvpPath.slice(0,3).map(ht)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.risks}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.risks.slice(0,3).map(mt)})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:_.nextActions}),(0,$.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:b.nextActions.slice(0,4).map(pt)})]}),(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:_.confidenceLabel.replace(`{{percent}}`,String(Math.round(b.confidence*100)))}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>void k(`helpful`),className:o(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,y?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":_.feedbackHelpfulAria,children:(0,$.jsx)(Te,{className:`size-3.5`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>void k(`not_helpful`),className:o(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,y?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":_.feedbackNotHelpfulAria,children:(0,$.jsx)(O,{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:_.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:[M,_.relatedThreadsTitle]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:_.relatedThreadsDescription})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:h,disabled:m,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:m?_.openingChat:_.openThread}),(0,$.jsx)(`button`,{type:`button`,onClick:g,disabled:m,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:_.newThread})]})]}),p.length>0?(0,$.jsx)(`div`,{className:`space-y-2`,children:p.slice(0,5).map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>v(`/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||_.noteDiscussionFallback}),(0,$.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:_.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:_.noThreads})]})]})]})}function pt(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 mt(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 ht(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 gt(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 _t(e){return(0,$.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e)}function vt(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 yt(e){return e.language}var bt=()=>i(()=>import(`./block-editor-C4fXWbEE.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])),xt=()=>i(()=>import(`./markdown-editor-BvUebh3C.js`).then(e=>e.n),__vite__mapDeps([28,1,3,25,5,29])),St=(0,Q.lazy)(()=>bt().then(e=>({default:e.BlockEditor}))),Ct=(0,Q.lazy)(()=>xt().then(e=>({default:e.MarkdownEditor})));function wt(){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 Tt(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:Re},t[0]=i.edit,t[1]=a);let s;t[2]===i.source?s=t[3]:(s={id:`source`,label:i.source,Icon:Oe},t[2]=i.source,t[3]=s);let c;t[4]===i.preview?c=t[5]:(c={id:`preview`,label:i.preview,Icon:ie},t[4]=i.preview,t[5]=c);let l;t[6]!==a||t[7]!==s||t[8]!==c?(l=[a,s,c],t[6]=a,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=l,d;return t[10]!==n||t[11]!==u||t[12]!==r?(d=(0,$.jsx)(`div`,{className:`flex items-center gap-0.5 rounded-lg border border-edge p-0.5`,children:u.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>r(t),onMouseEnter:()=>{t===`wysiwyg`&&bt(),t===`source`&&xt()},onFocus:()=>{t===`wysiwyg`&&bt(),t===`source`&&xt()},className:o(`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]=u,t[12]=r,t[13]=d):d=t[13],d}function Et(e){let t=(0,Z.c)(15),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:c,onOpenSearch:u,autoFocus:d,onAutoFocusConsumed:f}=e,p=a===void 0?!0:a,m=c===void 0?!0:c,h=d===void 0?!1:d,g=l(Dt),_;t[0]===g?_=t[1]:(_=s(g),t[0]=g,t[1]=_);let v=_.notes.lightboxClose,y;t[2]!==h||t[3]!==o||t[4]!==m||t[5]!==n||t[6]!==f||t[7]!==r||t[8]!==u||t[9]!==i||t[10]!==p?(y=(0,$.jsx)(Ot,{noteId:n,onBack:r,onSaved:i,showBackButton:p,backButtonClassName:o,clearHeaderOnCleanup:m,onOpenSearch:u,autoFocus:h,onAutoFocusConsumed:f}),t[2]=h,t[3]=o,t[4]=m,t[5]=n,t[6]=f,t[7]=r,t[8]=u,t[9]=i,t[10]=p,t[11]=y):y=t[11];let b;return t[12]!==v||t[13]!==y?(b=(0,$.jsx)(We,{closeLabel:v,children:y}),t[12]=v,t[13]=y,t[14]=b):b=t[14],b}function Dt(e){return e.language}function Ot({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:c=!0,onOpenSearch:m,autoFocus:g=!1,onAutoFocusConsumed:_}){let v=l(e=>e.language),b=s(v).notes,x=s(v).automations.suggestions,S=a(),C=u(e=>e.resolved)===`dark`,{openImage:w}=He(),[T,E]=(0,Q.useState)(`wysiwyg`),[D,O]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(!1),[N,P]=(0,Q.useState)(``),[I,ee]=(0,Q.useState)(360),[re,L]=(0,Q.useState)(!1),[R,ie]=(0,Q.useState)(!1),[z,ae]=(0,Q.useState)(!1),se=(0,Q.useRef)(!1),B=(0,Q.useRef)(!1),H=(0,Q.useRef)(null),U=(0,Q.useRef)(null),G=(0,Q.useRef)(null),K=(0,Q.useRef)(null),de=(0,Q.useRef)(null),fe=(0,Q.useRef)(null),pe=(0,Q.useRef)(null),me=(0,Q.useRef)(null),he=(0,Q.useRef)(null),ge=te(e=>e.setPageHeader),_e=te(e=>e.clearPageHeader),{data:q,mutate:J}=d(e?[`note-detail`,e]:null,()=>W(e)),{data:ye=[],mutate:xe}=d(e?[`note-threads`,e]:null,()=>le(e),{revalidateOnFocus:!1}),Se=k!==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)(()=>{se.current=!1,P(``),A(null),O(null),B.current=!1,he.current=null},[e]),(0,Q.useEffect)(()=>{!q||se.current||(P(q.title??``),se.current=!0)},[q]),(0,Q.useEffect)(()=>{if(!g||!q||Se||he.current===e)return;let t=window.requestAnimationFrame(()=>{me.current?.focus(),_?.()});return he.current=e,()=>window.cancelAnimationFrame(t)},[g,Se,q,e,_]);let Ce=q?new Date(q.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,Te=(0,Q.useMemo)(()=>r?(0,$.jsx)(`button`,{type:`button`,onClick:t,"aria-label":b.back,className:o(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,h,i),children:(0,$.jsx)(F,{className:`size-4`,"aria-hidden":!0})}):null,[i,b.back,t,r]),Y=(0,Q.useCallback)(t=>{P(t),e&&(K.current=t,U.current&&clearTimeout(U.current),U.current=setTimeout(async()=>{let t=K.current;if(K.current=null,t!==null){M(!0);try{await Fe(e,{title:t}),await J(),n?.()}catch{}finally{M(!1)}}},600))},[e,J,n]),Ee=(0,Q.useMemo)(()=>(0,$.jsxs)(`div`,{className:o(`flex min-w-0 items-center gap-2`,h),children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:N||Ce||void 0,children:N||Ce}),j?(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:b.saving}):null]}),[b.saving,j,Ce,N]),De=(0,Q.useCallback)(async(t=!1)=>{ae(!0);try{let n=await ve(e,{forceNew:t});await J(),await xe(),S(`/chat/${encodeURIComponent(n.sessionKey)}`)}catch(e){we({type:`error`,title:b.chatOpenFailedTitle,message:e instanceof Error?e.message:b.chatOpenFailedMessage})}finally{ae(!1)}},[J,xe,S,e,b.chatOpenFailedMessage,b.chatOpenFailedTitle]),Oe=(0,Q.useCallback)(async()=>{ie(!0);try{await V(e),await J()}catch(e){we({type:`error`,title:b.catalysisFailed,message:e instanceof Error?e.message:b.chatOpenFailedMessage})}finally{ie(!1)}},[J,e]),Ae=(0,Q.useCallback)(()=>{O(D===`breakdown`?null:`breakdown`),!q?.aiDeep?.catalysis?.report&&!R&&Oe()},[D,R,Oe,q?.aiDeep?.catalysis?.report]),je=(0,Q.useCallback)(()=>{let t=k?.markdown??G.current??q?.markdown??``,n=k?.title??N,r=p([n,t].filter(Boolean).join(`
|
|
3
|
+
|
|
4
|
+
`));return{source:{type:`note`,id:e,title:n||b.titlePlaceholder},text:r,language:ce(r,v)}},[v,b.titlePlaceholder,q?.markdown,e,k,N]),Ne=(0,Q.useMemo)(()=>(0,$.jsxs)(`div`,{className:o(`flex items-center gap-2`,h),children:[m?(0,$.jsx)(`button`,{type:`button`,onClick:m,"aria-label":b.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)(ue,{className:`size-4`,"aria-hidden":!0})}):null,(0,$.jsx)(ne,{input:je,labels:{read:b.readAloud,preparing:b.readAloudPreparing,pause:b.readAloudPause,resume:b.readAloudResume,retry:b.readAloudRetry},showLabel:!0}),(0,$.jsxs)(`button`,{type:`button`,onClick:Ae,disabled:R,"aria-label":b.catalysisSectionTitle,className:o(`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`,D===`breakdown`?`bg-accent/10 text-accent`:`bg-accent/10 text-fg hover:bg-accent/15`),children:[(0,$.jsx)(be,{className:`size-3.5`,"aria-hidden":!0}),R?b.catalyzing:b.catalyzeButton]}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>De(!1),disabled:z,className:o(`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)(f,{className:`size-3.5`,"aria-hidden":!0}),z?b.openingChat:b.openChatButton]}),(0,$.jsx)(Tt,{mode:T,onModeChange:E,labels:{edit:b.modeEdit,source:b.modeSource,preview:b.modePreview}}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>O(D===`history`?null:`history`),"aria-label":b.history,className:o(`rounded-lg p-1.5 transition-colors`,D===`history`?`bg-accent/10 text-accent`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:(0,$.jsx)(Me,{className:`size-4`,"aria-hidden":!0})})]}),[R,Ae,De,T,b.history,b.modeEdit,b.modePreview,b.modeSource,z,D,m,b.searchDialogTitle,b.readAloud,b.readAloudPause,b.readAloudPreparing,b.readAloudResume,b.readAloudRetry,je]);(0,Q.useLayoutEffect)(()=>(ge({startExtra:Te,main:q?Ee:null,end:q?Ne:null}),()=>{c&&_e()}),[c,_e,Ne,Ee,Te,q,ge]);let X=(0,Q.useCallback)(t=>{e&&(G.current=t,H.current&&clearTimeout(H.current),H.current=setTimeout(async()=>{let t=G.current;if(G.current=null,t!==null){M(!0);try{await Fe(e,{markdown:t}),await J(),n?.()}catch(e){we({type:`error`,title:b.saveFailed,message:e instanceof Error?e.message:b.saveFailedHint})}finally{M(!1)}}},600))},[e,J,b.saveFailed,b.saveFailedHint,n]),Pe=(0,Q.useCallback)(t=>{ke(e,t.timestamp).then(e=>{e&&A(e)})},[e]),Ie=(0,Q.useCallback)(()=>{O(null),A(null)},[]),Le=(0,Q.useCallback)(()=>{O(null),A(null),J(),n?.()},[J,n]);if((0,Q.useEffect)(()=>()=>{H.current&&clearTimeout(H.current),U.current&&clearTimeout(U.current);let t=G.current,n=K.current;G.current=null,K.current=null;let r={};t!==null&&(r.markdown=t),n!==null&&(r.title=n),Object.keys(r).length>0&&Fe(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:b.notFoundTitle}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:b.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:b.back})]});let Re=Se?k.title??``:N,ze=Se?k.markdown??``:q.markdown??``,Z=new Date(q.createdAt).getTime(),Ve=Number.isFinite(Z)&&Date.now()-Z<3600*1e3?(0,$.jsx)(Be,{title:x.noteCreatedTitle,description:x.noteCreatedDescription,prompt:x.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:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,$.jsx)(oe,{eventType:`note.created`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,$.jsx)(oe,{eventType:`note.updated`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,$.jsx)(`div`,{ref:de,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:Se?(0,$.jsxs)(`div`,{className:`h-full overflow-y-auto px-6 py-4`,children:[Re&&(0,$.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg/70`,children:Re}),ze?(0,$.jsx)(y,{noteId:e,content:ze,className:`opacity-80`}):(0,$.jsx)(`p`,{className:`italic text-fg-muted`,children:b.emptyPreview})]}):(0,$.jsxs)($.Fragment,{children:[T===`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:me,type:`text`,value:N,onChange:e=>Y(e.target.value),onCompositionStart:()=>{B.current=!0},onCompositionEnd:()=>{B.current=!1},onKeyDown:e=>{let t=e.nativeEvent;e.key===`Enter`&&!B.current&&!t.isComposing&&(e.preventDefault(),(de.current?.querySelector(`.ProseMirror`))?.focus())},placeholder:b.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)(wt,{}),children:(0,$.jsx)(St,{initialContent:q.markdown??``,onChange:X,noteId:e},`wysiwyg-${e}`)})})]}),T===`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:me,type:`text`,value:N,onChange:e=>Y(e.target.value),placeholder:b.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)(wt,{}),children:(0,$.jsx)(Ct,{initialContent:q.markdown??``,onChange:X,isDark:C},`source-${e}`)})})]}),T===`preview`&&(0,$.jsxs)(`div`,{className:`h-full overflow-y-auto px-6 py-4`,onClick:e=>{let t=e.target;t instanceof HTMLImageElement&&w(t.currentSrc||t.src,t.alt)},children:[N&&(0,$.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg`,children:N}),q.markdown?(0,$.jsx)(y,{noteId:e,content:q.markdown,className:`[&_img]:cursor-zoom-in`}):(0,$.jsx)(`p`,{className:`italic text-fg-muted`,children:b.emptyPreview})]})]})})]}),(0,$.jsx)(`div`,{ref:fe,className:o(`relative flex min-h-0 shrink-0 flex-col overflow-hidden`,!re&&`transition-[width] duration-300 ease-in-out`),style:{width:D?I:0},children:(0,$.jsxs)(`div`,{ref:pe,className:`flex min-h-0 flex-1 flex-col`,style:{width:I},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=I,i=e.pointerId,a=0,o=I,s=I,c=()=>{a=0,s=o,D&&fe.current?.style.setProperty(`width`,`${s}px`),pe.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),ee(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:o(`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`,re&&`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:D===`history`?(0,$.jsx)(dt,{noteId:e,activeTimestamp:k?.timestamp??null,onSelect:Pe,onClose:Ie,onRestored:Le}):D===`breakdown`?(0,$.jsx)(ft,{noteId:e,note:q??null,catalyzing:R,onCatalyze:Oe,onClose:()=>O(null),noteThreads:ye,openingChat:z,onOpenChat:()=>De(!1),onOpenNewChat:()=>De(!0)}):null})]})})]})}var kt=3e4;function At(){if(!(typeof MediaRecorder>`u`))return[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`,`audio/ogg;codecs=opus`].find(e=>MediaRecorder.isTypeSupported(e))}function jt({placeholder:e,sendLabel:t,onCapture:n,onImagePick:r,onVoiceCapture:i,recordingLabel:a=`Recording…`,imageDisabled:s=!1,voiceDisabled:c=!1}){let[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(0),[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(null),b=(0,Q.useRef)(null),x=(0,Q.useRef)(null),S=(0,Q.useRef)([]),C=(0,Q.useRef)(0),w=(0,Q.useRef)(null),T=(0,Q.useRef)(null),E=(0,Q.useCallback)(()=>{w.current&&=(clearInterval(w.current),null),T.current&&=(clearTimeout(T.current),null),x.current?.getTracks().forEach(e=>e.stop()),x.current=null,b.current=null,S.current=[],m(!1),g(0)},[]);(0,Q.useEffect)(()=>()=>E(),[E]);let D=(0,Q.useCallback)(async()=>{let e=b.current;if(!e||e.state!==`recording`)return;v(!0),await new Promise(t=>{e.addEventListener(`stop`,()=>t(),{once:!0}),e.stop()});let t=Math.max(1,Math.round((Date.now()-C.current)/1e3)),n=e.mimeType||At()||`audio/webm`,r=new Blob(S.current,{type:n});if(E(),r.size>0&&i){let e=n.includes(`mp4`)?`m4a`:n.includes(`ogg`)?`ogg`:`webm`,a=new File([r],`voice-${Date.now()}.${e}`,{type:n});try{await i(a,t)}finally{v(!1)}return}v(!1)},[E,i]),O=(0,Q.useCallback)(async()=>{if(!(!i||_||p)&&!(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`))try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=At(),n=t?new MediaRecorder(e,{mimeType:t}):new MediaRecorder(e);x.current=e,b.current=n,S.current=[],C.current=Date.now(),n.ondataavailable=e=>{e.data.size>0&&S.current.push(e.data)},n.start(),m(!0),g(0),w.current=setInterval(()=>{g(Math.round((Date.now()-C.current)/1e3))},250),T.current=setTimeout(()=>{D()},kt)}catch{E()}},[E,i,p,D,_]),k=(0,Q.useCallback)(()=>{if(p){D();return}O()},[p,O,D]),A=(0,Q.useCallback)(async e=>{let t=l.trim();if(!(!t||d)){f(!0),u(``);try{await n(t,e)}catch{u(t)}finally{f(!1),y.current?.focus()}}},[l,d,n]),j=(0,Q.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),A()),e.key===`Enter`&&e.shiftKey&&(e.preventDefault(),A({navigate:!1}))},[A]),M=d||_;return(0,$.jsxs)(`div`,{className:o(`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`,p&&`border-danger ring-1 ring-danger/40`),children:[r&&(0,$.jsx)(`button`,{type:`button`,onClick:r,disabled:M||s||p,className:`shrink-0 rounded-lg p-2 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Image`,children:(0,$.jsx)(Pe,{className:`size-4`})}),i&&(0,$.jsx)(`button`,{type:`button`,onClick:k,disabled:M||c||d,className:o(`shrink-0 rounded-lg p-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,p?`bg-danger-soft text-danger hover:bg-danger-soft`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),"aria-label":p?`Stop recording`:`Voice`,"aria-pressed":p,children:p?(0,$.jsx)(Y,{className:`size-4 fill-current`}):(0,$.jsx)(ae,{className:`size-4`})}),p?(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate py-1.5 text-sm text-danger`,children:a.replace(`{{seconds}}`,String(h))}):(0,$.jsx)(`textarea`,{ref:y,value:l,onChange:e=>u(e.target.value),onKeyDown:j,placeholder:e,rows:1,disabled:M,className:`min-h-8 flex-1 resize-none 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:!l.trim()||M||p,onClick:e=>void A({navigate:!e.shiftKey}),"aria-label":t,className:o(`shrink-0 rounded-lg p-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,l.trim()&&!M&&!p?`text-accent hover:bg-accent-soft`:`text-fg-disabled`),children:(0,$.jsx)(pe,{className:`size-4`})})]})}var Mt={statusFilter:`all`,kindFilter:`all`,pinnedOnly:!1},Nt=240,Pt=320,Ft=520,It=560;function Lt(e){if(globalThis.localStorage===void 0)return Pt;try{let t=globalThis.localStorage.getItem(e);if(!t)return Pt;let n=Number(t);return Number.isFinite(n)?n:Pt}catch{return Pt}}function Rt(e,t){if(globalThis.localStorage!==void 0)try{globalThis.localStorage.setItem(e,String(Math.round(t)))}catch{}}var zt={thought:K,todo:B,voice:ae,media:Pe,bookmark:S,mixed:K,task:B};function Bt(e,t){return e.snippet?.trim()?e.snippet:e.coverAttachmentId?t.imageNote:t.noText}function Vt(e,t){return e.statusFilter===t.patch.statusFilter&&e.kindFilter===t.patch.kindFilter&&e.pinnedOnly===t.patch.pinnedOnly}function Ht(e,t){return`${e.replace(/\/$/,``)}/${encodeURIComponent(t)}`}function Ut({selectedNoteId:e,basePath:t,managePageHeader:n=!1,showLibrary:r=!0,allowMediaCapture:i=!0,listTag:u,captureTags:f=[],listTitle:p,listDescription:g,emptyText:_,emptyDescription:v,listWidthStorageKey:y=`xopc.notes.listWidth`}){let b=s(l(e=>e.language)).notes,x=!!c(e=>e.token),[C,D]=(0,Q.useReducer)(P,Mt),[O,k]=(0,Q.useState)(!1),[A,M]=(0,Q.useState)(``),[F,I]=(0,Q.useState)(0),[ee,ne]=(0,Q.useState)(()=>Lt(y)),[ie,oe]=(0,Q.useState)(!1),[V,U]=(0,Q.useState)(!1),[W,G]=(0,Q.useState)(!1),[ce,le]=(0,Q.useState)(null),pe=(0,Q.useRef)(null),q=(0,Q.useRef)(null),[ve]=(0,Q.useState)(()=>Date.now()),J=a(),be=(0,Q.useCallback)(e=>{let t=pe.current?.clientWidth??window.innerWidth,n=Math.max(Nt,t-It);return Math.max(Nt,Math.min(Math.min(Ft,n),e))},[]),Ce=(0,Q.useCallback)(e=>{let t=be(e);ne(t),Rt(y,t)},[be,y]);(0,Q.useLayoutEffect)(()=>{ne(e=>be(e))},[be]);let{data:Te,mutate:Y,isLoading:De}=d((0,Q.useMemo)(()=>x?[`notes-list`,u,C.statusFilter,C.kindFilter,C.pinnedOnly]:null,[x,u,C.statusFilter,C.kindFilter,C.pinnedOnly]),()=>Se({status:C.statusFilter===`all`?void 0:C.statusFilter,kind:C.kindFilter===`all`?void 0:C.kindFilter,tag:u,pinned:C.pinnedOnly?!0:void 0,limit:100,sortBy:`createdAt`,sortOrder:`desc`}),{keepPreviousData:!0}),Oe=De&&!Te,ke=Te?.items??[],Ae=Te?.total??0,je=A.trim(),{data:Me,isLoading:Ne}=d(x&&O&&je?[`notes-search`,u,je]:null,()=>Se({search:je,tag:u,limit:30,sortBy:`updatedAt`,sortOrder:`desc`})),X=Me?.items??[],Ie=e?ke.some(t=>t.id===e):!0;(0,Q.useEffect)(()=>{I(0)},[je]),(0,Q.useEffect)(()=>{F>=X.length&&I(Math.max(0,X.length-1))},[F,X.length]),(0,Q.useEffect)(()=>{let e=()=>{Y()};return window.addEventListener(`note-updated`,e),()=>window.removeEventListener(`note-updated`,e)},[Y]);let Le=te(e=>e.setPageHeader),Re=te(e=>e.clearPageHeader),Be=Ae>0?b.noteCount.replace(`{{count}}`,String(Ae)):null,Z=b.searchDialogTitle,Ve=b.searchClose,He=b.searchClear,Ue=(0,Q.useMemo)(()=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>k(!0),className:o(`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`,h),"aria-label":Z,children:[(0,$.jsx)(ue,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:Z})]}),[Z]);(0,Q.useLayoutEffect)(()=>{if(n)return x?(Le({startExtra:null,main:(0,$.jsxs)(`div`,{className:o(`flex min-w-0 items-center gap-2`,h),children:[(0,$.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold tracking-tight text-fg`,children:p??b.title}),Be?(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted`,children:Be}):null]}),end:Ue}),()=>Re()):(Re(),()=>Re())},[Re,x,Ue,p,n,b.title,Be,e,Le]);let We=(0,Q.useMemo)(()=>({justNow:b.justNow,minutesAgo:b.minutesAgo,today:b.today,yesterday:b.yesterday,daysAgo:b.daysAgo}),[b.justNow,b.minutesAgo,b.today,b.yesterday,b.daysAgo]),Ge=(0,Q.useMemo)(()=>[{id:`recent`,label:b.viewRecent,description:b.viewRecentDescription,icon:ge,patch:{statusFilter:`all`,kindFilter:`all`,pinnedOnly:!1}},{id:`inbox`,label:b.filterInbox,description:b.viewInboxDescription,icon:H,patch:{statusFilter:`inbox`,kindFilter:`all`,pinnedOnly:!1}},{id:`pinned`,label:b.pinned,description:b.viewPinnedDescription,icon:E,patch:{statusFilter:`all`,kindFilter:`all`,pinnedOnly:!0}},{id:`tasks`,label:b.viewTasks,description:b.viewTasksDescription,icon:B,patch:{statusFilter:`all`,kindFilter:`todo`,pinnedOnly:!1}},{id:`voice`,label:b.kindVoice,description:b.viewVoiceDescription,icon:ae,patch:{statusFilter:`all`,kindFilter:`voice`,pinnedOnly:!1}},{id:`media`,label:b.kindMedia,description:b.viewMediaDescription,icon:Pe,patch:{statusFilter:`all`,kindFilter:`media`,pinnedOnly:!1}},{id:`bookmarks`,label:b.kindBookmark,description:b.viewBookmarksDescription,icon:S,patch:{statusFilter:`all`,kindFilter:`bookmark`,pinnedOnly:!1}},{id:`processed`,label:b.filterProcessed,description:b.viewProcessedDescription,icon:de,patch:{statusFilter:`processed`,kindFilter:`all`,pinnedOnly:!1}},{id:`archive`,label:b.filterArchived,description:b.viewArchiveDescription,icon:j,patch:{statusFilter:`archived`,kindFilter:`all`,pinnedOnly:!1}}],[b.filterArchived,b.filterInbox,b.filterProcessed,b.kindBookmark,b.kindMedia,b.kindVoice,b.pinned,b.viewArchiveDescription,b.viewBookmarksDescription,b.viewInboxDescription,b.viewMediaDescription,b.viewPinnedDescription,b.viewProcessedDescription,b.viewRecent,b.viewRecentDescription,b.viewTasks,b.viewTasksDescription,b.viewVoiceDescription]),Ke=Ge.find(e=>Vt(C,e))??Ge[0],qe=p??Ke.label,Je=g??Ke.description,Ye=(0,Q.useCallback)(async(e,n)=>{let r=f.length?await xe({markdown:e,kind:`thought`,tags:f,channel:`web`}):await me(e,`web`);await Y(),n?.navigate!==!1&&J(Ht(t,r.id))},[t,f,Y,J]),$e=(0,Q.useCallback)(async()=>{if(!W){G(!0);try{let e=await xe({markdown:``,kind:`thought`,tags:f,channel:`web`});D({type:`patch`,patch:Mt}),await Y(),le(e.id),J(Ht(t,e.id))}catch(e){we({type:`error`,title:b.createBlankFailed,message:e instanceof Error?e.message:b.createBlankFailedHint})}finally{G(!1)}}},[t,f,W,Y,b.createBlankFailed,b.createBlankFailedHint,J]),et=(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{await fe(t,`web`),await Y()}catch(e){we({type:`error`,title:b.imageUploadFailed,message:e instanceof Error?e.message:b.imageUploadFailedHint})}},e.click()},[Y,b.imageUploadFailed,b.imageUploadFailedHint]),tt=(0,Q.useCallback)(async(e,t)=>{try{await se(e,t,`web`),await Y()}catch(e){we({type:`error`,title:b.voiceUploadFailed,message:e instanceof Error?e.message:b.voiceUploadFailedHint})}},[Y,b.voiceUploadFailed,b.voiceUploadFailedHint]),nt=(0,Q.useCallback)(async(e,t)=>{await Fe(e,{pinned:t}),await Y()},[Y]),rt=(0,Q.useCallback)(async e=>{await Fe(e,{status:`archived`}),await Y()},[Y]),at=(0,Q.useCallback)(async e=>{await Ee(e),await Y()},[Y]),ot=(0,Q.useCallback)(e=>{J(Ht(t,e))},[t,J]),st=(0,Q.useCallback)(e=>{J(Ht(t,e)),k(!1)},[t,J]),ct=(0,Q.useCallback)(e=>{if(X.length){if(e.key===`ArrowDown`)e.preventDefault(),I(e=>Math.min(X.length-1,e+1));else if(e.key===`ArrowUp`)e.preventDefault(),I(e=>Math.max(0,e-1));else if(e.key===`Enter`){e.preventDefault();let t=X[F]??X[0];t&&st(t.id)}}},[F,st,X]),lt=(0,Q.useCallback)(e=>{e.preventDefault();let t=e.currentTarget,n=q.current;t.setPointerCapture(e.pointerId),oe(!0);let r=pe.current?.clientWidth??window.innerWidth,i=Math.max(Nt,r-It),a=Math.min(Ft,i),o=e=>Math.max(Nt,Math.min(a,e)),s=e.clientX,c=o(ee),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{}oe(!1),pe.current?.style.setProperty(`--notes-list-width`,`${f}px`),n&&(n.style.removeProperty(`transition`),n.style.removeProperty(`width`)),ne(f),Rt(y,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)},[y,ee]);(0,Q.useEffect)(()=>{let e=e=>{e.defaultPrevented||e.repeat||e.key.toLowerCase()!==`n`||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||(e.preventDefault(),$e())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[$e]);let ut=(0,Q.useCallback)(e=>{e.key===`ArrowLeft`?(e.preventDefault(),Ce(ee-16)):e.key===`ArrowRight`?(e.preventDefault(),Ce(ee+16)):e.key===`Home`?(e.preventDefault(),Ce(Nt)):e.key===`End`&&(e.preventDefault(),Ce(Ft))},[Ce,ee]);return x?(0,$.jsxs)(`div`,{ref:pe,className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-panel`,style:{"--notes-list-width":`${ee}px`},children:[(0,$.jsxs)(`section`,{ref:q,className:o(`relative flex min-h-0 w-full shrink-0 flex-col overflow-hidden bg-surface-panel`,!ie&&`lg:transition-[width] lg:duration-[280ms] lg:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:lg:transition-none`,V?`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":V?!0:void 0,children:[(0,$.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r?(0,$.jsx)(ye,{value:Ke.id,onChange:e=>{let t=Ge.find(t=>t.id===e.target.value);t&&D({type:`patch`,patch:t.patch})},className:`-ml-1 block max-w-44 truncate rounded-lg border border-transparent bg-transparent px-1 py-0.5 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":b.libraryTitle,children:Ge.map(e=>(0,$.jsx)(he,{value:e.id,children:e.label},e.id))}):(0,$.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:qe}),(0,$.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:Be??Je})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>U(!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":b.collapseNotesList,title:b.collapseNotesList,children:(0,$.jsx)(L,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:$e,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":b.createBlankNote,title:b.createBlankShortcut,children:(0,$.jsx)(_e,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>k(!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":b.searchDialogTitle,children:(0,$.jsx)(ue,{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:Oe?(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))}):ke.length===0?(0,$.jsxs)(`div`,{className:`flex min-h-[min(40vh,20rem)] flex-col items-center justify-center gap-2 px-6 py-16 text-center`,children:[(0,$.jsx)(K,{className:`size-8 text-fg-muted`}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:e&&!Ie?b.noteOutsideCurrentView:_??b.noNotes}),e&&!Ie?null:(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:v??b.noNotesDescription})]}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e&&!Ie?(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:b.noteOutsideCurrentView}):null,ke.map((t,n)=>{let r=n>0?Qe(ke[n-1].createdAt):null;return(0,$.jsxs)(`div`,{children:[Qe(t.createdAt)!==r&&(0,$.jsx)(`div`,{className:o(`px-3 pb-1.5 pt-2 text-xs font-medium text-fg-muted`,n===0&&`pt-0`),children:Ze(t.createdAt,ve,We)}),(0,$.jsx)(it,{note:t,selected:t.id===e,onPress:ot,onPin:nt,onArchive:rt,onDelete:at,timeLabels:We,labels:{pin:b.pin,unpin:b.unpin,archive:b.archive,delete:b.delete,imageNote:b.imageNote,noText:b.noText}})]},t.id)})]})}),(0,$.jsx)(`div`,{className:`shrink-0 border-t border-edge-subtle p-3`,children:(0,$.jsx)(jt,{placeholder:b.quickCapturePlaceholder,sendLabel:b.send,onCapture:Ye,onImagePick:i?et:void 0,onVoiceCapture:i?tt:void 0,recordingLabel:b.recording})})]}),(0,$.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":b.resizeNotesList,"aria-valuemin":Nt,"aria-valuemax":Ft,"aria-valuenow":Math.round(ee),tabIndex:0,onPointerDown:lt,onDoubleClick:()=>Ce(Pt),onKeyDown:ut,title:b.resizeNotesList,className:o(`group relative hidden shrink-0 cursor-col-resize touch-none select-none items-center justify-center lg:flex`,`lg:transition-[width,opacity] lg:duration-[280ms] lg:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:lg:transition-none`,V?`lg:w-0 lg:opacity-0 lg:pointer-events-none`:`lg:w-3 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:o(`h-8 w-1 rounded-pill opacity-0 transition-[background-color,opacity,transform] duration-150`,`bg-edge-strong/55 group-hover:opacity-100 group-focus-visible:opacity-100`,`group-hover:scale-y-110 group-focus-visible:scale-y-110`,ie&&`bg-accent opacity-100 scale-y-125`)})}),(0,$.jsxs)(`section`,{className:o(`relative min-w-0 flex-1 bg-surface-panel`,!e&&`hidden lg:flex`),children:[V?(0,$.jsx)(`button`,{type:`button`,onClick:()=>U(!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":b.expandNotesList,title:b.expandNotesList,children:(0,$.jsx)(L,{className:`size-4`,strokeWidth:1.5,"aria-hidden":!0})}):null,e?(0,$.jsx)(Et,{noteId:e,onBack:()=>J(t),onSaved:()=>void Y(),backButtonClassName:`lg:hidden`,clearHeaderOnCleanup:!1,onOpenSearch:()=>k(!0),autoFocus:e===ce,onAutoFocusConsumed:()=>le(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)(K,{className:`mx-auto size-9 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`h2`,{className:`mt-4 text-base font-semibold text-fg`,children:b.emptyEditorTitle}),(0,$.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:b.emptyEditorDescription}),(0,$.jsxs)(`button`,{type:`button`,onClick:$e,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)(_e,{className:`size-4`,"aria-hidden":!0}),W?b.creatingBlankNote:b.createBlankNote]})]})})]}),(0,$.jsx)(ze,{open:O,onOpenChange:k,children:(0,$.jsxs)(z,{children:[(0,$.jsx)(re,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,$.jsxs)(R,{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)(w,{className:`text-sm font-semibold text-fg`,children:Z}),(0,$.jsx)(T,{className:`sr-only`,children:b.searchPlaceholder}),(0,$.jsx)(m,{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":Ve,children:(0,$.jsx)(N,{className:`size-4`,"aria-hidden":!0})})})]}),(0,$.jsxs)(`div`,{className:`p-4`,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(ue,{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:A,onChange:e=>M(e.target.value),onKeyDown:ct,placeholder:b.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`}),A?(0,$.jsx)(`button`,{type:`button`,onClick:()=>M(``),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":He,children:(0,$.jsx)(N,{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:je?Ne&&!Me?(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)(K,{className:`size-7 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:b.searchNoResults}),(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:b.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:b.searchResultsCount.replace(`{{count}}`,String(Me?.total??X.length))}),X.map((e,t)=>{let n=zt[e.kind]||K,r=Bt(e,{imageNote:b.imageNote,noText:b.noText});return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>st(e.id),onMouseEnter:()=>I(t),className:o(`flex w-full items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors`,t===F?`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:Xe(e.updatedAt,ve,We)})]}),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)(ue,{className:`size-7 text-fg-muted`,"aria-hidden":!0}),(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:b.searchEmptyTitle}),(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:b.searchEmptyDescription})]})})]})]})]})})]}):(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,$.jsx)(K,{className:`size-10 text-fg-muted`}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:b.needToken})]})}export{He as n,Ut as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-JdwAhgNB.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./cn-JdwAhgNB.js";import{ws as a}from"./index-2UImfRDC.js";var o=n(),s=e(t(),1),c=r();function l(e){let t=(0,o.c)(40),{items:n,activeTab:r,onChange:l,ariaLabel:u,tabIdPrefix:d,panelIdPrefix:f,className:p,buttonClassName:m,selectedClassName:h,unselectedClassName:g,countClassName:_,onReorder:v}=e,y=h===void 0?`bg-accent-soft text-accent-fg`:h,b=g===void 0?`text-fg-muted hover:bg-surface-hover hover:text-fg`:g,[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(null),w(null)},t[0]=T):T=t[0];let E=T,D;t[1]===p?D=t[2]:(D=i(`-mx-1 flex gap-1 overflow-x-auto px-1 pb-1`,p),t[1]=p,t[2]=D);let O;t[3]===v?O=t[4]:(O=e=>{if(!v)return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||w(null)},t[3]=v,t[4]=O);let k;t[5]!==r||t[6]!==n||t[7]!==l?(k=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=n.findIndex(e=>e.id===r);t<0||l(n[(t+(e.key===`ArrowRight`?1:-1)+n.length)%n.length].id)},t[5]=r,t[6]=n,t[7]=l,t[8]=k):k=t[8];let A;if(t[9]!==r||t[10]!==m||t[11]!==_||t[12]!==x||t[13]!==C||t[14]!==n||t[15]!==l||t[16]!==v||t[17]!==f||t[18]!==y||t[19]!==d||t[20]!==b){let e;t[22]!==r||t[23]!==m||t[24]!==_||t[25]!==x||t[26]!==C||t[27]!==l||t[28]!==v||t[29]!==f||t[30]!==y||t[31]!==d||t[32]!==b?(e=e=>{let{id:t,icon:n,label:o,count:s,suffix:u,title:p}=e,h=t===r,g=x===t,T=C?.id===t&&C.position===`before`,D=C?.id===t&&C.position===`after`;return(0,c.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":h,id:d?`${d}-${t}`:void 0,"aria-controls":f?`${f}-${t}`:void 0,"aria-grabbed":v?g:void 0,draggable:!!v,title:p,className:i(`relative inline-flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,a.press,h?y:b,v&&`cursor-grab active:cursor-grabbing`,g&&`scale-[0.98] border border-edge bg-surface-active/60 opacity-55 shadow-surface`,(T||D)&&!g&&`bg-surface-hover text-fg`,m),onClick:()=>l(t),onDragStart:e=>{v&&(S(t),w(null),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t))},onDragOver:e=>{if(!v||!x)return;if(x===t){w(null);return}e.preventDefault(),e.dataTransfer.dropEffect=`move`;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX<n.left+n.width/2?`before`:`after`;w(e=>e?.id===t&&e.position===r?e:{id:t,position:r})},onDrop:e=>{!v||!x||x===t||(e.preventDefault(),v(x,t,C?.id===t?C.position:`before`),E())},onDragEnd:E,children:[T?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -left-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null,n?(0,c.jsx)(n,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}):null,(0,c.jsx)(`span`,{children:o}),s==null?null:(0,c.jsx)(`span`,{className:i(`rounded-full bg-surface-hover px-1.5 py-0.5 text-[10px] tabular-nums text-fg-subtle`,_),children:s}),u,D?(0,c.jsx)(`span`,{className:`pointer-events-none absolute -right-0.5 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-full bg-accent shadow-[0_0_0_2px_var(--color-surface-panel)]`,"aria-hidden":!0}):null]},t)},t[22]=r,t[23]=m,t[24]=_,t[25]=x,t[26]=C,t[27]=l,t[28]=v,t[29]=f,t[30]=y,t[31]=d,t[32]=b,t[33]=e):e=t[33],A=n.map(e),t[9]=r,t[10]=m,t[11]=_,t[12]=x,t[13]=C,t[14]=n,t[15]=l,t[16]=v,t[17]=f,t[18]=y,t[19]=d,t[20]=b,t[21]=A}else A=t[21];let j;return t[34]!==u||t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==A?(j=(0,c.jsx)(`nav`,{"aria-label":u,className:D,role:`tablist`,onDragLeave:O,onKeyDown:k,children:A}),t[34]=u,t[35]=D,t[36]=O,t[37]=k,t[38]=A,t[39]=j):j=t[39],j}export{l as t};
|