ocean-brain 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/mcp.js +151 -37
  2. package/package.json +1 -1
  3. package/server/client/dist/assets/{Calendar-DyXzs5M3.js → Calendar-Kjy1PX6L.js} +1 -1
  4. package/server/client/dist/assets/{Graph-C8K4PJOn.js → Graph-Bl5K2qUw.js} +1 -1
  5. package/server/client/dist/assets/{Image.es-CFTbON7k.js → Image.es-BQfyKc2-.js} +1 -1
  6. package/server/client/dist/assets/{ModalActionRow-Hg6MY61u.js → ModalActionRow-DyOb58KJ.js} +1 -1
  7. package/server/client/dist/assets/Note-BfGma2Qc.css +1 -0
  8. package/server/client/dist/assets/Note-DN_ko2M3.js +1 -0
  9. package/server/client/dist/assets/{Reminders-jFhljND4.js → Reminders-BK-Uv9Ps.js} +1 -1
  10. package/server/client/dist/assets/{Search-X6QIR_m2.js → Search-ClHeWvmI.js} +1 -1
  11. package/server/client/dist/assets/{SurfaceCard-BV6y4bCo.js → SurfaceCard-nZNf9lyE.js} +1 -1
  12. package/server/client/dist/assets/{Tag-Ba2Dw4gH.js → Tag-Dph4V_kl.js} +1 -1
  13. package/server/client/dist/assets/{TagNotes-BRJv6sDI.js → TagNotes-CxP5qHZj.js} +1 -1
  14. package/server/client/dist/assets/{Trash.es-CPtRLE0y.js → Trash.es-BGoN5q9L.js} +1 -1
  15. package/server/client/dist/assets/{image.api-Dsrx9S-G.js → image.api-0mMkElZk.js} +1 -1
  16. package/server/client/dist/assets/{index-DpqKngJz.js → index-6lIw6jYW.js} +1 -1
  17. package/server/client/dist/assets/{index-BglnLSet.js → index-Ba2XPRI8.js} +30 -30
  18. package/server/client/dist/assets/{index-CD2bFEqK.css → index-DL7pUwq2.css} +1 -1
  19. package/server/client/dist/assets/manage-image-Br_kKxbb.js +1 -0
  20. package/server/client/dist/assets/{manage-image-detail-Dv3xofpe.js → manage-image-detail-9DzqbiqI.js} +1 -1
  21. package/server/client/dist/assets/{mcp-BijQkpfY.js → mcp-C_So91eX.js} +1 -1
  22. package/server/client/dist/assets/{placeholder-MNsco0AT.js → placeholder-i-uNe71U.js} +2 -2
  23. package/server/client/dist/assets/{trash-CiFJm_PK.js → trash-Cg3nJ1m5.js} +1 -1
  24. package/server/client/dist/assets/{useReminderMutate-yJak8FzP.js → useReminderMutate-tNMwwRnx.js} +1 -1
  25. package/server/client/dist/index.html +2 -2
  26. package/server/dist/modules/blocknote.js +91 -19
  27. package/server/dist/modules/blocknote.js.map +1 -1
  28. package/server/dist/modules/note-tag-filter.js +22 -0
  29. package/server/dist/modules/note-tag-filter.js.map +1 -0
  30. package/server/dist/schema/note/index.js +31 -0
  31. package/server/dist/schema/note/index.js.map +1 -1
  32. package/server/client/dist/assets/Note-BbgZvrC3.js +0 -1
  33. package/server/client/dist/assets/Note-PEevDKBh.css +0 -1
  34. package/server/client/dist/assets/manage-image-C6Y_0M5H.js +0 -1
package/dist/mcp.js CHANGED
@@ -208,6 +208,41 @@ var createMcpWriteSafetyCoordinator = (options = {}) => {
208
208
  };
209
209
  };
210
210
 
211
+ // src/mcp-note-output.ts
212
+ var formatBackReferenceLine = (backReference) => {
213
+ if (backReference.updatedAt) {
214
+ return `- ${backReference.id}: ${backReference.title} (updated: ${backReference.updatedAt})`;
215
+ }
216
+ return `- ${backReference.id}: ${backReference.title}`;
217
+ };
218
+ var formatMcpReadNoteOutput = ({
219
+ note,
220
+ backReferences,
221
+ maxLength
222
+ }) => {
223
+ let markdown = note.contentAsMarkdown;
224
+ const totalLength = markdown.length;
225
+ const truncated = maxLength > 0 && markdown.length > maxLength;
226
+ if (truncated) {
227
+ markdown = markdown.slice(0, maxLength);
228
+ }
229
+ const backReferenceLines = backReferences.length > 0 ? backReferences.map(formatBackReferenceLine) : ["- (none)"];
230
+ return [
231
+ `# ${note.title}`,
232
+ "",
233
+ `Tags: ${note.tags.map((tag) => tag.name).join(", ") || "(none)"}`,
234
+ `Created: ${note.createdAt}`,
235
+ `Updated: ${note.updatedAt}`,
236
+ ...truncated ? [`Content: ${totalLength} chars (showing first ${maxLength})`] : [],
237
+ "",
238
+ "Back References:",
239
+ ...backReferenceLines,
240
+ "",
241
+ markdown,
242
+ ...truncated ? ["\n... (truncated, use maxLength: 0 to read full content)"] : []
243
+ ].join("\n");
244
+ };
245
+
211
246
  // src/mcp.ts
212
247
  var __dirname = path2.dirname(fileURLToPath(import.meta.url));
213
248
  var pkg = JSON.parse(
@@ -220,6 +255,7 @@ var OCEAN_BRAIN_MCP_TOOLS = {
220
255
  updateNote: "ocean_brain_update_note",
221
256
  listTags: "ocean_brain_list_tags",
222
257
  listNotesByTag: "ocean_brain_list_notes_by_tag",
258
+ listNotesByTags: "ocean_brain_list_notes_by_tags",
223
259
  listRecentNotes: "ocean_brain_list_recent_notes",
224
260
  writeSafetyStatus: "ocean_brain_write_safety_status",
225
261
  findNoteCleanupCandidates: "ocean_brain_find_note_cleanup_candidates",
@@ -227,6 +263,7 @@ var OCEAN_BRAIN_MCP_TOOLS = {
227
263
  deleteNote: "ocean_brain_delete_note"
228
264
  };
229
265
  var noteLayoutSchema = z2.enum(["narrow", "wide", "full"]);
266
+ var tagMatchModeSchema = z2.enum(["and", "or"]);
230
267
  var normalizeOceanBrainTagName = (name) => {
231
268
  const trimmedName = name.trim();
232
269
  if (!trimmedName) {
@@ -238,6 +275,29 @@ var normalizeOceanBrainTagName = (name) => {
238
275
  }
239
276
  return normalizedName;
240
277
  };
278
+ var normalizeOceanBrainTagNames = (names) => {
279
+ return Array.from(
280
+ new Set(names.map(normalizeOceanBrainTagName))
281
+ );
282
+ };
283
+ var fetchOceanBrainTags = async (serverUrl, token, query) => {
284
+ const data = await graphql(serverUrl, token, `
285
+ query ($searchFilter: SearchFilterInput, $pagination: PaginationInput) {
286
+ allTags(searchFilter: $searchFilter, pagination: $pagination) {
287
+ totalCount
288
+ tags {
289
+ id
290
+ name
291
+ referenceCount
292
+ }
293
+ }
294
+ }
295
+ `, {
296
+ searchFilter: { query },
297
+ pagination: { limit: 100, offset: 0 }
298
+ });
299
+ return data?.allTags;
300
+ };
241
301
  async function graphql(serverUrl, token, query, variables) {
242
302
  const response = await fetch(`${serverUrl}/graphql/mcp`, {
243
303
  method: "POST",
@@ -328,7 +388,7 @@ async function startMcpServer(serverUrl, token, options = {}) {
328
388
  );
329
389
  server.tool(
330
390
  OCEAN_BRAIN_MCP_TOOLS.readNote,
331
- "Read an Ocean Brain note by ID. Returns truncated content by default (1000 chars). Set maxLength to 0 only when full content is necessary.",
391
+ "Read an Ocean Brain note by ID. Returns truncated content by default (1000 chars) and includes a back-reference summary. Set maxLength to 0 only when full content is necessary.",
332
392
  {
333
393
  id: z2.string().describe("Note ID"),
334
394
  maxLength: z2.number().optional().default(1e3).describe("Max content length in characters. 0 for full content. (default: 1000)")
@@ -344,27 +404,19 @@ async function startMcpServer(serverUrl, token, options = {}) {
344
404
  updatedAt
345
405
  tags { id name }
346
406
  }
407
+ backReferences(id: $id) {
408
+ id
409
+ title
410
+ }
347
411
  }
348
412
  `, { id });
349
413
  const note = data?.note;
350
- let markdown = note.contentAsMarkdown;
351
- const totalLength = markdown.length;
352
- let truncated = false;
353
- if (maxLength > 0 && markdown.length > maxLength) {
354
- markdown = markdown.slice(0, maxLength);
355
- truncated = true;
356
- }
357
- const output = [
358
- `# ${note.title}`,
359
- "",
360
- `Tags: ${note.tags.map((t) => t.name).join(", ") || "(none)"}`,
361
- `Created: ${note.createdAt}`,
362
- `Updated: ${note.updatedAt}`,
363
- ...truncated ? [`Content: ${totalLength} chars (showing first ${maxLength})`] : [],
364
- "",
365
- markdown,
366
- ...truncated ? ["\n... (truncated, use maxLength: 0 to read full content)"] : []
367
- ].join("\n");
414
+ const backReferences = data?.backReferences ?? [];
415
+ const output = formatMcpReadNoteOutput({
416
+ note,
417
+ backReferences,
418
+ maxLength
419
+ });
368
420
  return {
369
421
  content: [{
370
422
  type: "text",
@@ -375,7 +427,7 @@ async function startMcpServer(serverUrl, token, options = {}) {
375
427
  );
376
428
  server.tool(
377
429
  OCEAN_BRAIN_MCP_TOOLS.createNote,
378
- "Create an Ocean Brain note from markdown through the MCP write path. In MCP markdown, use explicit tags like [@project] or [#project], and use [[Note Title]] for note links.",
430
+ "Create an Ocean Brain note from markdown through the MCP write path. In MCP markdown, use explicit tags like [@project] or [#project], and use [[Note Title]] for note links. When writing linked notes, prefer creating or organizing the reference target note first. A single link is enough for Ocean Brain to surface a back reference on the other note.",
379
431
  {
380
432
  title: z2.string().describe("Note title"),
381
433
  markdown: z2.string().optional().default("").describe("Markdown body for the new note. In MCP markdown, tags must use [@tag] or [#tag]. Defaults to an empty note body."),
@@ -398,7 +450,7 @@ async function startMcpServer(serverUrl, token, options = {}) {
398
450
  );
399
451
  server.tool(
400
452
  OCEAN_BRAIN_MCP_TOOLS.updateNote,
401
- "Update an Ocean Brain note from markdown through the MCP write path. In MCP markdown, use explicit tags like [@project] or [#project], and use [[Note Title]] for note links.",
453
+ "Update an Ocean Brain note from markdown through the MCP write path. In MCP markdown, use explicit tags like [@project] or [#project], and use [[Note Title]] for note links. When you add linked notes, prefer organizing the reference target note first. A single link is enough for Ocean Brain to surface a back reference on the other note.",
402
454
  {
403
455
  id: z2.string().describe("Note ID to update"),
404
456
  title: z2.string().optional().describe("New note title"),
@@ -460,22 +512,7 @@ async function startMcpServer(serverUrl, token, options = {}) {
460
512
  },
461
513
  async ({ tag, limit, offset }) => {
462
514
  const normalizedTag = normalizeOceanBrainTagName(tag);
463
- const tagsData = await graphql(serverUrl, token, `
464
- query ($searchFilter: SearchFilterInput, $pagination: PaginationInput) {
465
- allTags(searchFilter: $searchFilter, pagination: $pagination) {
466
- totalCount
467
- tags {
468
- id
469
- name
470
- referenceCount
471
- }
472
- }
473
- }
474
- `, {
475
- searchFilter: { query: normalizedTag },
476
- pagination: { limit: 100, offset: 0 }
477
- });
478
- const tagResult = tagsData?.allTags;
515
+ const tagResult = await fetchOceanBrainTags(serverUrl, token, normalizedTag);
479
516
  const exactMatches = tagResult.tags.filter((item) => item.name === normalizedTag);
480
517
  if (exactMatches.length === 0) {
481
518
  return {
@@ -530,6 +567,83 @@ async function startMcpServer(serverUrl, token, options = {}) {
530
567
  };
531
568
  }
532
569
  );
570
+ server.tool(
571
+ OCEAN_BRAIN_MCP_TOOLS.listNotesByTags,
572
+ "List Ocean Brain notes for multiple tag names. Supports AND/OR matching and resolves each input tag to the canonical Ocean Brain tag name first.",
573
+ {
574
+ tags: z2.array(z2.string()).min(1).describe("Tag names to inspect. You can pass @project or project values."),
575
+ mode: tagMatchModeSchema.optional().default("and").describe("Tag match mode. Use and for intersection, or for union. Defaults to and."),
576
+ limit: z2.number().optional().default(20).describe("Max results (default: 20)"),
577
+ offset: z2.number().optional().default(0).describe("Pagination offset (default: 0)")
578
+ },
579
+ async ({ tags, mode, limit, offset }) => {
580
+ const normalizedTags = normalizeOceanBrainTagNames(tags);
581
+ const tagResults = await Promise.all(
582
+ normalizedTags.map(async (normalizedTag) => {
583
+ const result = await fetchOceanBrainTags(serverUrl, token, normalizedTag);
584
+ const exactMatches = result.tags.filter((item) => item.name === normalizedTag);
585
+ return {
586
+ normalizedTag,
587
+ exactMatches
588
+ };
589
+ })
590
+ );
591
+ const matchedTags = tagResults.filter((tagResult) => tagResult.exactMatches.length > 0).map((tagResult) => {
592
+ const selectedTag = tagResult.exactMatches[0];
593
+ return {
594
+ id: selectedTag.id,
595
+ name: selectedTag.name,
596
+ referenceCount: selectedTag.referenceCount,
597
+ duplicateExactMatchCount: tagResult.exactMatches.length
598
+ };
599
+ });
600
+ const missingTags = tagResults.filter((tagResult) => tagResult.exactMatches.length === 0).map((tagResult) => tagResult.normalizedTag);
601
+ let noteResult = {
602
+ totalCount: 0,
603
+ notes: []
604
+ };
605
+ if (mode === "and" && missingTags.length === 0 || mode === "or" && matchedTags.length > 0) {
606
+ const notesData = await graphql(serverUrl, token, `
607
+ query ($tagNames: [String!]!, $mode: TagMatchMode!, $pagination: PaginationInput) {
608
+ notesByTagNames(tagNames: $tagNames, mode: $mode, pagination: $pagination) {
609
+ totalCount
610
+ notes {
611
+ id
612
+ title
613
+ updatedAt
614
+ tags { id name }
615
+ }
616
+ }
617
+ }
618
+ `, {
619
+ tagNames: normalizedTags,
620
+ mode,
621
+ pagination: { limit, offset }
622
+ });
623
+ noteResult = notesData?.notesByTagNames;
624
+ }
625
+ return {
626
+ content: [{
627
+ type: "text",
628
+ text: JSON.stringify({
629
+ requestedTags: tags,
630
+ normalizedTags,
631
+ mode,
632
+ allTagsFound: missingTags.length === 0,
633
+ missingTags,
634
+ tags: matchedTags,
635
+ totalCount: noteResult.totalCount,
636
+ notes: noteResult.notes.map((note) => ({
637
+ id: note.id,
638
+ title: note.title,
639
+ updatedAt: note.updatedAt,
640
+ tags: note.tags.map((item) => item.name)
641
+ }))
642
+ }, null, 2)
643
+ }]
644
+ };
645
+ }
646
+ );
533
647
  server.tool(
534
648
  OCEAN_BRAIN_MCP_TOOLS.listRecentNotes,
535
649
  "List recently updated Ocean Brain notes. Returns titles and tags only. Use ocean_brain_read_note to get full content for a specific note.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ocean-brain",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,4 +1,4 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{p as ae,T as b,L as se,N as re,c as Y,d as f,s as ne,a as oe,M as R,b as ie,S as le,e as U,B as Z,f as ce,g as de,u as P,q,h as Q,P as me,i as ue,j as he,C as ge}from"./index-BglnLSet.js";import{a as n}from"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const pe=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),n.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),B=n.forwardRef((a,t)=>n.createElement(ae,{ref:t,...a,weights:pe}));B.displayName="InfoIcon";const xe=B,ye=({children:a,className:t=""})=>e.jsxs("div",{className:`flex items-start gap-2.5 rounded-[12px] border border-border-subtle bg-hover-subtle/50 px-4 py-3 ${t}`,children:[e.jsx(xe,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(b,{as:"div",variant:"meta",weight:"medium",tone:"secondary",children:a})]}),fe=({day:a,cellClassName:t,dayNumberClassName:s,isCurrentMonth:l,items:i,overflowCount:c,onOpenOverflow:u})=>e.jsxs("div",{className:`min-h-[196px] rounded-[16px] border p-2.5 ${t}`.trim(),children:[e.jsx("div",{className:"mb-2.5 flex justify-end",children:e.jsx(b,{as:"span",variant:"label",className:`flex h-7 w-7 items-center justify-center rounded-[10px] ${s}`.trim(),children:a})}),l&&i.length>0?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[i,c>0?e.jsxs("button",{type:"button",onClick:u,className:"focus-ring-soft w-full rounded-[10px] border border-dashed border-border-subtle/70 bg-subtle/70 py-1 text-center text-micro font-semibold text-fg-tertiary outline-none transition-colors hover:border-border-secondary/70 hover:bg-hover-subtle hover:text-fg-secondary",children:["+",c," more"]}):null]}):null]}),K=({params:a,toneClassName:t="",header:s,title:l,meta:i,titleClassName:c=""})=>e.jsx(se,{to:re,params:a,className:"focus-ring-soft group block rounded-[8px] outline-none",children:e.jsxs("div",{className:Y("flex items-start gap-1.5 rounded-[8px] px-1.5 py-1 transition-colors group-hover:bg-hover-subtle",t),children:[s?e.jsx("span",{className:"mt-[2px] flex h-4 w-4 shrink-0 items-center justify-center text-fg-tertiary",children:s}):e.jsx("span",{"aria-hidden":"true",className:"mt-[6px] h-1.5 w-1.5 shrink-0 rounded-full bg-fg-placeholder"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(b,{as:"div",variant:"label",weight:"medium",tone:"secondary",className:Y("line-clamp-1",c),children:l}),i?e.jsx(b,{as:"div",variant:"micro",weight:"medium",tone:"tertiary",className:"mt-0.5",children:i}):null]})]})}),be=({note:a,type:t})=>e.jsx(K,{params:{id:a.id},header:e.jsx(ne,{size:12}),title:a.title,meta:f(Number(t==="create"?a.createdAt:a.updatedAt)).format("HH:mm")}),je=({reminder:a})=>e.jsx(K,{params:{id:String(a.note?.id??a.noteId)},header:e.jsx(oe,{size:12}),title:a.content||a.note?.title||"No title",titleClassName:a.completed?"line-through":"",meta:f(Number(a.reminderDate)).format("HH:mm")}),T=3,H=(a,t)=>a.map(s=>s.type==="note"?e.jsx(be,{note:s.item,type:t},`note-${s.item.id}`):e.jsx(je,{reminder:s.item},`reminder-${s.item.id}`)),ve=({year:a,month:t,day:s,isCurrentMonth:l,isSunday:i,isToday:c,isPast:u,notes:h,reminders:g,type:v})=>{const[M,N]=n.useState(!1),x=n.useMemo(()=>{const r=h.map(m=>({type:"note",item:m})),d=g.map(m=>({type:"reminder",item:m}));return u?[...r,...d]:[...d,...r]},[u,h,g]),D=x.length>T,C=n.useMemo(()=>H(x.slice(0,T),v),[x,v]),S=n.useMemo(()=>H(x,v),[x,v]),A=n.useCallback(()=>N(!0),[]),w=n.useCallback(()=>N(!1),[]),$=()=>l?c?"border-border-secondary/70 bg-[color:color-mix(in_srgb,var(--surface)_88%,var(--accent-soft-primary)_12%)]":"bg-surface border-border-subtle":"bg-muted/18 border-border-subtle/70",k=()=>c?"bg-cta text-fg-on-filled font-semibold":l?i?"text-fg-weekend font-bold":"text-fg-secondary font-bold":"text-fg-disabled opacity-55";return e.jsxs(e.Fragment,{children:[e.jsx(fe,{day:s,cellClassName:$(),dayNumberClassName:k(),isCurrentMonth:l,items:C,overflowCount:D?x.length-T:0,onOpenOverflow:A}),D&&e.jsxs(R,{isOpen:M,onClose:w,children:[e.jsx(R.Header,{title:`${a}/${String(t).padStart(2,"0")}/${String(s).padStart(2,"0")}`,onClose:w}),e.jsxs(R.Body,{children:[e.jsxs(R.Description,{className:"sr-only",children:["View all notes and reminders scheduled for day ",s,"."]}),e.jsx("div",{className:"flex max-h-[60vh] flex-col gap-2 overflow-y-auto",children:S})]})]})]})},Ne=n.memo(ve),Me=["January","February","March","April","May","June","July","August","September","October","November","December"],De=({month:a,year:t,type:s,onPrevMonth:l,onNextMonth:i,onToday:c,onTypeChange:u})=>e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-end gap-x-2.5 gap-y-1",children:[e.jsx(b,{as:"h1",variant:"display",weight:"bold",tracking:"tighter",className:"text-2xl leading-none sm:text-[2.15rem]",children:Me[a-1]}),e.jsx(b,{as:"span",variant:"subheading",weight:"medium",tone:"secondary",tracking:"tight",className:"pb-0.5",children:t})]}),e.jsx(b,{as:"p",variant:"meta",weight:"medium",tone:"secondary",children:"Track note activity and reminders across the month"})]}),e.jsx("div",{className:"flex lg:justify-end",children:e.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(b,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Note date"}),e.jsxs(le,{value:s,onValueChange:g=>u(g),variant:"ghost",size:"sm",children:[e.jsx(U,{value:"create",children:"Created"}),e.jsx(U,{value:"update",children:"Updated"})]})]}),e.jsx("div",{className:"h-5 w-px bg-divider"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:c,children:"Today"}),e.jsx(Z,{variant:"ghost",size:"icon-sm",onClick:l,children:e.jsx(ce,{width:18,height:18})}),e.jsx(Z,{variant:"ghost",size:"icon-sm",onClick:i,children:e.jsx(de,{width:18,height:18})})]})]})})]}),we=`
1
+ import{j as e}from"./note-vendor-BofYbzmZ.js";import{p as ae,T as b,L as se,N as re,c as Y,d as f,s as ne,a as oe,M as R,b as ie,S as le,e as U,B as Z,f as ce,g as de,u as P,q,h as Q,P as me,i as ue,j as he,C as ge}from"./index-Ba2XPRI8.js";import{a as n}from"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const pe=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),n.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),B=n.forwardRef((a,t)=>n.createElement(ae,{ref:t,...a,weights:pe}));B.displayName="InfoIcon";const xe=B,ye=({children:a,className:t=""})=>e.jsxs("div",{className:`flex items-start gap-2.5 rounded-[12px] border border-border-subtle bg-hover-subtle/50 px-4 py-3 ${t}`,children:[e.jsx(xe,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(b,{as:"div",variant:"meta",weight:"medium",tone:"secondary",children:a})]}),fe=({day:a,cellClassName:t,dayNumberClassName:s,isCurrentMonth:l,items:i,overflowCount:c,onOpenOverflow:u})=>e.jsxs("div",{className:`min-h-[196px] rounded-[16px] border p-2.5 ${t}`.trim(),children:[e.jsx("div",{className:"mb-2.5 flex justify-end",children:e.jsx(b,{as:"span",variant:"label",className:`flex h-7 w-7 items-center justify-center rounded-[10px] ${s}`.trim(),children:a})}),l&&i.length>0?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[i,c>0?e.jsxs("button",{type:"button",onClick:u,className:"focus-ring-soft w-full rounded-[10px] border border-dashed border-border-subtle/70 bg-subtle/70 py-1 text-center text-micro font-semibold text-fg-tertiary outline-none transition-colors hover:border-border-secondary/70 hover:bg-hover-subtle hover:text-fg-secondary",children:["+",c," more"]}):null]}):null]}),K=({params:a,toneClassName:t="",header:s,title:l,meta:i,titleClassName:c=""})=>e.jsx(se,{to:re,params:a,className:"focus-ring-soft group block rounded-[8px] outline-none",children:e.jsxs("div",{className:Y("flex items-start gap-1.5 rounded-[8px] px-1.5 py-1 transition-colors group-hover:bg-hover-subtle",t),children:[s?e.jsx("span",{className:"mt-[2px] flex h-4 w-4 shrink-0 items-center justify-center text-fg-tertiary",children:s}):e.jsx("span",{"aria-hidden":"true",className:"mt-[6px] h-1.5 w-1.5 shrink-0 rounded-full bg-fg-placeholder"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(b,{as:"div",variant:"label",weight:"medium",tone:"secondary",className:Y("line-clamp-1",c),children:l}),i?e.jsx(b,{as:"div",variant:"micro",weight:"medium",tone:"tertiary",className:"mt-0.5",children:i}):null]})]})}),be=({note:a,type:t})=>e.jsx(K,{params:{id:a.id},header:e.jsx(ne,{size:12}),title:a.title,meta:f(Number(t==="create"?a.createdAt:a.updatedAt)).format("HH:mm")}),je=({reminder:a})=>e.jsx(K,{params:{id:String(a.note?.id??a.noteId)},header:e.jsx(oe,{size:12}),title:a.content||a.note?.title||"No title",titleClassName:a.completed?"line-through":"",meta:f(Number(a.reminderDate)).format("HH:mm")}),T=3,H=(a,t)=>a.map(s=>s.type==="note"?e.jsx(be,{note:s.item,type:t},`note-${s.item.id}`):e.jsx(je,{reminder:s.item},`reminder-${s.item.id}`)),ve=({year:a,month:t,day:s,isCurrentMonth:l,isSunday:i,isToday:c,isPast:u,notes:h,reminders:g,type:v})=>{const[M,N]=n.useState(!1),x=n.useMemo(()=>{const r=h.map(m=>({type:"note",item:m})),d=g.map(m=>({type:"reminder",item:m}));return u?[...r,...d]:[...d,...r]},[u,h,g]),D=x.length>T,C=n.useMemo(()=>H(x.slice(0,T),v),[x,v]),S=n.useMemo(()=>H(x,v),[x,v]),A=n.useCallback(()=>N(!0),[]),w=n.useCallback(()=>N(!1),[]),$=()=>l?c?"border-border-secondary/70 bg-[color:color-mix(in_srgb,var(--surface)_88%,var(--accent-soft-primary)_12%)]":"bg-surface border-border-subtle":"bg-muted/18 border-border-subtle/70",k=()=>c?"bg-cta text-fg-on-filled font-semibold":l?i?"text-fg-weekend font-bold":"text-fg-secondary font-bold":"text-fg-disabled opacity-55";return e.jsxs(e.Fragment,{children:[e.jsx(fe,{day:s,cellClassName:$(),dayNumberClassName:k(),isCurrentMonth:l,items:C,overflowCount:D?x.length-T:0,onOpenOverflow:A}),D&&e.jsxs(R,{isOpen:M,onClose:w,variant:"inspect",children:[e.jsx(R.Header,{title:`${a}/${String(t).padStart(2,"0")}/${String(s).padStart(2,"0")}`,onClose:w}),e.jsxs(R.Body,{children:[e.jsxs(R.Description,{className:"sr-only",children:["View all notes and reminders scheduled for day ",s,"."]}),e.jsx("div",{className:"flex max-h-[60vh] flex-col gap-2 overflow-y-auto",children:S})]})]})]})},Ne=n.memo(ve),Me=["January","February","March","April","May","June","July","August","September","October","November","December"],De=({month:a,year:t,type:s,onPrevMonth:l,onNextMonth:i,onToday:c,onTypeChange:u})=>e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-end gap-x-2.5 gap-y-1",children:[e.jsx(b,{as:"h1",variant:"display",weight:"bold",tracking:"tighter",className:"text-2xl leading-none sm:text-[2.15rem]",children:Me[a-1]}),e.jsx(b,{as:"span",variant:"subheading",weight:"medium",tone:"secondary",tracking:"tight",className:"pb-0.5",children:t})]}),e.jsx(b,{as:"p",variant:"meta",weight:"medium",tone:"secondary",children:"Track note activity and reminders across the month"})]}),e.jsx("div",{className:"flex lg:justify-end",children:e.jsxs("div",{className:"surface-base inline-flex flex-wrap items-center gap-3 rounded-[16px] px-3.5 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(b,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Note date"}),e.jsxs(le,{value:s,onValueChange:g=>u(g),variant:"ghost",size:"sm",children:[e.jsx(U,{value:"create",children:"Created"}),e.jsx(U,{value:"update",children:"Updated"})]})]}),e.jsx("div",{className:"h-5 w-px bg-divider"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:c,children:"Today"}),e.jsx(Z,{variant:"ghost",size:"icon-sm",onClick:l,children:e.jsx(ce,{width:18,height:18})}),e.jsx(Z,{variant:"ghost",size:"icon-sm",onClick:i,children:e.jsx(de,{width:18,height:18})})]})]})})]}),we=`
2
2
  query NotesInDateRange($dateRange: DateRangeInput) {
3
3
  notesInDateRange(dateRange: $dateRange) {
4
4
  id
@@ -1 +1 @@
1
- import{j as t}from"./note-vendor-BofYbzmZ.js";import{a as i,F as _}from"./graph-vendor-CUxe67Lr.js";import{Q as U,P as C,n as Y,i as G,o as J,r as X,t as ee,v as ne,q as te,N as re,E as oe,T as N,w as se}from"./index-BglnLSet.js";import"./note-core-BCgMq5QA.js";const ae=s=>{let a=0;for(let r=0;r<s.length;r++)a+=s.charCodeAt(r);return a},ie={background:"#f4f6f8",nodeHub:"#2c2f36",nodeSelected:"#111318",nodeConnected:"#636b76",nodeDefault:["#d6dbe1","#c8ced6","#b7bec7","#a7afb9"],nodeDimmed:["rgba(214,219,225,0.28)","rgba(200,206,214,0.24)","rgba(183,190,199,0.24)","rgba(167,175,185,0.2)"],nodeHubDimmed:"rgba(44,47,54,0.16)",nodeStroke:"#eef1f4",nodeSelectedStroke:"#a6b0bc",labelBackground:"rgba(246,248,250,0.92)",labelText:"#222831",labelFontFamily:"Pretendard Variable, Pretendard, system-ui, sans-serif",linkIdle:"rgba(99, 107, 117, 0.34)",linkConnected:"#68717c",linkDimmed:"rgba(127, 136, 146, 0.12)",legendHub:"#2c2f36"},le={background:"#121316",nodeHub:"#d6dce3",nodeSelected:"#eef1f5",nodeConnected:"#9099a4",nodeDefault:["#343a43","#2d333c","#262c35","#20262f"],nodeDimmed:["rgba(52,58,67,0.28)","rgba(45,51,60,0.24)","rgba(38,44,53,0.22)","rgba(32,38,47,0.2)"],nodeHubDimmed:"rgba(214,220,227,0.16)",nodeStroke:"#171c23",nodeSelectedStroke:"#7f8a97",labelBackground:"rgba(16,18,22,0.9)",labelText:"#eef2f6",labelFontFamily:"Pretendard Variable, Pretendard, system-ui, sans-serif",linkIdle:"rgba(118, 127, 138, 0.42)",linkConnected:"#a2abb6",linkDimmed:"rgba(118, 127, 138, 0.1)",legendHub:"#d6dce3"};function D(s){return s==="dark"?le:ie}function de(s,a){const r=D(s),{connections:g,colorIndex:y,selectedNodeId:d,nodeId:b,isConnected:c}=a,h=d===b;return d!==null&&!h&&!c?g>3?r.nodeHubDimmed:r.nodeDimmed[y%r.nodeDimmed.length]:h?r.nodeSelected:c?r.nodeConnected:g>3?r.nodeHub:r.nodeDefault[y%r.nodeDefault.length]}function ce(s,a){const r=D(s);return a.selectedNodeId!==null&&!a.isConnected?r.linkDimmed:a.isConnected?r.linkConnected:r.linkIdle}function ue(s,a){const r=D(s);return`${a.emphasize?"700":"400"} ${a.fontSize}px ${r.labelFontFamily}`}function z(s){return s<=1?3.5:s<=3?4.5:s<=6?5.5:Math.min(7,5.5+Math.sqrt(s)*.5)}const fe=t.jsx(C,{title:"Knowledge Graph",description:t.jsx(G,{width:184,height:16,className:"rounded-full"}),children:t.jsx("div",{className:"flex h-[600px] items-center justify-center",children:t.jsx(G,{width:"100%",height:"100%"})})});function he(){const s=J(),a=i.useRef(null),r=i.useRef(null),[g,y]=i.useState({width:800,height:600}),[d,b]=i.useState(null),{theme:c}=X(e=>e),h=D(c),v=i.useRef(h);v.current=h;const{data:w}=ee({queryKey:te.notes.graph(),queryFn:async()=>{const e=await ne();if(e.type==="error")throw e;return e.noteGraph}}),l=i.useMemo(()=>{if(w.nodes.length===0)return null;const e=w.nodes.filter(o=>o.connections>0);if(e.length===0)return null;const n=new Set(e.map(o=>o.id));return{nodes:e,links:w.links.filter(o=>n.has(o.source)&&n.has(o.target))}},[w]);i.useEffect(()=>{if(!l)return;const e=()=>{if(!a.current)return;const n=a.current.getBoundingClientRect();y({width:n.width,height:Math.max(600,window.innerHeight-150)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[l]),i.useEffect(()=>{if(!l||!r.current)return;const e=window.setTimeout(()=>{r.current?.zoomToFit(400,50)},500);return()=>window.clearTimeout(e)},[l]);const R=i.useRef(d);R.current=d;const B=i.useCallback(e=>{if(R.current===e.id){s({to:re,params:{id:e.id}});return}b(e.id)},[s]),L=i.useCallback(()=>{b(null)},[]),K=i.useCallback(e=>{a.current&&(a.current.style.cursor=e?"pointer":"default")},[]),I=i.useRef(!1),q=i.useCallback(()=>{I.current||(I.current=!0,r.current?.enableZoomInteraction(!1))},[]),A=i.useCallback(()=>{I.current=!1,r.current?.enableZoomInteraction(!0)},[]),E=i.useRef(new Map),O=i.useMemo(()=>{const e=new Map;if(l)for(const n of l.links)e.has(n.source)||e.set(n.source,new Set),e.has(n.target)||e.set(n.target,new Set),e.get(n.source)?.add(n.target),e.get(n.target)?.add(n.source);return e},[l]);E.current=O;const Z=i.useCallback((e,n,o)=>{const u=v.current,f=d,p=E.current,m=z(e.connections),x=e.x||0,S=e.y||0,k=f===e.id,T=f?p.get(f)?.has(e.id)??!1:!1,Q=f!==null&&!k&&!T,V=ae(e.id);if(n.beginPath(),n.arc(x,S,m,0,Math.PI*2),n.fillStyle=de(c,{connections:e.connections,colorIndex:V,selectedNodeId:f,nodeId:e.id,isConnected:T}),n.fill(),Q)return;n.strokeStyle=u.nodeStroke,n.lineWidth=(k?2:1)/o,n.stroke(),k&&(n.beginPath(),n.arc(x,S,m+2/o,0,Math.PI*2),n.strokeStyle=u.nodeSelectedStroke,n.lineWidth=1.5/o,n.stroke());const W=T&&e.connections>=4;if(k||W||o>2.5){const H=e.title||"Untitled",P=Math.max(10/o,2.5);n.font=ue(c,{fontSize:P,emphasize:k}),n.textAlign="center",n.textBaseline="top";const M=n.measureText(H).width,j=2/o,F=S+m+3/o;n.fillStyle=u.labelBackground,n.fillRect(x-M/2-j,F,M+j*2,P+j*2),n.fillStyle=u.labelText,n.fillText(H,x,F+j)}},[d,c]),$=i.useCallback((e,n,o)=>{const u=d,f=e.source,p=e.target,m=u?f.id===u||p.id===u:!1;n.beginPath(),n.moveTo(f.x||0,f.y||0),n.lineTo(p.x||0,p.y||0),n.strokeStyle=ce(c,{selectedNodeId:u,isConnected:m}),n.lineWidth=m?2/o:.5/o,n.stroke()},[d,c]);return l?t.jsx(C,{title:"Knowledge Graph",description:`${l.nodes.length} linked notes, ${l.links.length} connections`,children:t.jsxs("div",{ref:a,className:"surface-base graph-canvas relative overflow-hidden",style:{"--graph-bg":h.background},children:[d&&(()=>{const e=l.nodes.find(n=>n.id===d);return e?t.jsxs("div",{className:"surface-floating absolute top-3 left-3 z-10 flex items-center gap-2 px-3 py-2",children:[t.jsx(N,{as:"span",variant:"meta",weight:"semibold",truncate:!0,className:"max-w-48",children:e.title}),t.jsxs(N,{as:"span",variant:"label",tone:"tertiary",children:[e.connections," links"]}),t.jsx("button",{type:"button",onClick:()=>b(null),className:"focus-ring-soft ml-1 flex h-6 w-6 cursor-pointer items-center justify-center rounded-[8px] text-fg-tertiary transition-colors hover:bg-hover-subtle hover:text-fg-default","aria-label":"Deselect node",children:t.jsx(se,{className:"h-3.5 w-3.5"})})]}):null})(),t.jsxs("div",{className:"surface-floating absolute top-3 right-3 z-10 flex flex-col gap-1.5 px-3 py-2.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"legend-dot h-2.5 w-2.5 shrink-0 rounded-full",style:{"--legend-color":h.legendHub}}),t.jsx(N,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Hub notes (4+ connections)"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"legend-dot h-2.5 w-2.5 shrink-0 rounded-full",style:{"--legend-color":h.nodeConnected}}),t.jsx(N,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Connected notes"})]})]}),t.jsx(_,{ref:r,graphData:l,width:g.width,height:g.height,nodeId:"id",nodeLabel:"",nodeCanvasObject:Z,nodePointerAreaPaint:(e,n,o)=>{o.beginPath(),o.arc(e.x||0,e.y||0,Math.max(z(e.connections)+4,10),0,2*Math.PI),o.fillStyle=n,o.fill()},linkCanvasObject:$,linkCanvasObjectMode:()=>"replace",linkDirectionalParticles:0,onNodeClick:B,onNodeHover:K,onBackgroundClick:L,onNodeDrag:q,onNodeDragEnd:A,warmupTicks:30,cooldownTicks:80,d3AlphaDecay:.05,d3VelocityDecay:.3,enableZoomInteraction:!0,enablePanInteraction:!0,minZoom:.3,maxZoom:5})]})}):t.jsx(C,{title:"Knowledge Graph",description:"0 linked notes, 0 connections",children:t.jsx(oe,{title:"No constellations yet",description:"Link your notes together and watch your own starry sky unfold"})})}function ke(){return t.jsx(U,{fallback:fe,errorTitle:"Failed to load graph",errorDescription:"Retry loading your linked note constellation",renderError:({error:s,retry:a})=>t.jsx(C,{title:"Knowledge Graph",children:t.jsx(Y,{title:"Failed to load graph",description:"Retry loading your linked note constellation",error:s,onRetry:a})}),children:t.jsx(he,{})})}export{ke as default};
1
+ import{j as t}from"./note-vendor-BofYbzmZ.js";import{a as i,F as _}from"./graph-vendor-CUxe67Lr.js";import{Q as U,P as C,n as Y,i as G,o as J,r as X,t as ee,v as ne,q as te,N as re,E as oe,T as N,w as se}from"./index-Ba2XPRI8.js";import"./note-core-BCgMq5QA.js";const ae=s=>{let a=0;for(let r=0;r<s.length;r++)a+=s.charCodeAt(r);return a},ie={background:"#f4f6f8",nodeHub:"#2c2f36",nodeSelected:"#111318",nodeConnected:"#636b76",nodeDefault:["#d6dbe1","#c8ced6","#b7bec7","#a7afb9"],nodeDimmed:["rgba(214,219,225,0.28)","rgba(200,206,214,0.24)","rgba(183,190,199,0.24)","rgba(167,175,185,0.2)"],nodeHubDimmed:"rgba(44,47,54,0.16)",nodeStroke:"#eef1f4",nodeSelectedStroke:"#a6b0bc",labelBackground:"rgba(246,248,250,0.92)",labelText:"#222831",labelFontFamily:"Pretendard Variable, Pretendard, system-ui, sans-serif",linkIdle:"rgba(99, 107, 117, 0.34)",linkConnected:"#68717c",linkDimmed:"rgba(127, 136, 146, 0.12)",legendHub:"#2c2f36"},le={background:"#121316",nodeHub:"#d6dce3",nodeSelected:"#eef1f5",nodeConnected:"#9099a4",nodeDefault:["#343a43","#2d333c","#262c35","#20262f"],nodeDimmed:["rgba(52,58,67,0.28)","rgba(45,51,60,0.24)","rgba(38,44,53,0.22)","rgba(32,38,47,0.2)"],nodeHubDimmed:"rgba(214,220,227,0.16)",nodeStroke:"#171c23",nodeSelectedStroke:"#7f8a97",labelBackground:"rgba(16,18,22,0.9)",labelText:"#eef2f6",labelFontFamily:"Pretendard Variable, Pretendard, system-ui, sans-serif",linkIdle:"rgba(118, 127, 138, 0.42)",linkConnected:"#a2abb6",linkDimmed:"rgba(118, 127, 138, 0.1)",legendHub:"#d6dce3"};function D(s){return s==="dark"?le:ie}function de(s,a){const r=D(s),{connections:g,colorIndex:y,selectedNodeId:d,nodeId:b,isConnected:c}=a,h=d===b;return d!==null&&!h&&!c?g>3?r.nodeHubDimmed:r.nodeDimmed[y%r.nodeDimmed.length]:h?r.nodeSelected:c?r.nodeConnected:g>3?r.nodeHub:r.nodeDefault[y%r.nodeDefault.length]}function ce(s,a){const r=D(s);return a.selectedNodeId!==null&&!a.isConnected?r.linkDimmed:a.isConnected?r.linkConnected:r.linkIdle}function ue(s,a){const r=D(s);return`${a.emphasize?"700":"400"} ${a.fontSize}px ${r.labelFontFamily}`}function z(s){return s<=1?3.5:s<=3?4.5:s<=6?5.5:Math.min(7,5.5+Math.sqrt(s)*.5)}const fe=t.jsx(C,{title:"Knowledge Graph",description:t.jsx(G,{width:184,height:16,className:"rounded-full"}),children:t.jsx("div",{className:"flex h-[600px] items-center justify-center",children:t.jsx(G,{width:"100%",height:"100%"})})});function he(){const s=J(),a=i.useRef(null),r=i.useRef(null),[g,y]=i.useState({width:800,height:600}),[d,b]=i.useState(null),{theme:c}=X(e=>e),h=D(c),v=i.useRef(h);v.current=h;const{data:w}=ee({queryKey:te.notes.graph(),queryFn:async()=>{const e=await ne();if(e.type==="error")throw e;return e.noteGraph}}),l=i.useMemo(()=>{if(w.nodes.length===0)return null;const e=w.nodes.filter(o=>o.connections>0);if(e.length===0)return null;const n=new Set(e.map(o=>o.id));return{nodes:e,links:w.links.filter(o=>n.has(o.source)&&n.has(o.target))}},[w]);i.useEffect(()=>{if(!l)return;const e=()=>{if(!a.current)return;const n=a.current.getBoundingClientRect();y({width:n.width,height:Math.max(600,window.innerHeight-150)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[l]),i.useEffect(()=>{if(!l||!r.current)return;const e=window.setTimeout(()=>{r.current?.zoomToFit(400,50)},500);return()=>window.clearTimeout(e)},[l]);const R=i.useRef(d);R.current=d;const B=i.useCallback(e=>{if(R.current===e.id){s({to:re,params:{id:e.id}});return}b(e.id)},[s]),L=i.useCallback(()=>{b(null)},[]),K=i.useCallback(e=>{a.current&&(a.current.style.cursor=e?"pointer":"default")},[]),I=i.useRef(!1),q=i.useCallback(()=>{I.current||(I.current=!0,r.current?.enableZoomInteraction(!1))},[]),A=i.useCallback(()=>{I.current=!1,r.current?.enableZoomInteraction(!0)},[]),E=i.useRef(new Map),O=i.useMemo(()=>{const e=new Map;if(l)for(const n of l.links)e.has(n.source)||e.set(n.source,new Set),e.has(n.target)||e.set(n.target,new Set),e.get(n.source)?.add(n.target),e.get(n.target)?.add(n.source);return e},[l]);E.current=O;const Z=i.useCallback((e,n,o)=>{const u=v.current,f=d,p=E.current,m=z(e.connections),x=e.x||0,S=e.y||0,k=f===e.id,T=f?p.get(f)?.has(e.id)??!1:!1,Q=f!==null&&!k&&!T,V=ae(e.id);if(n.beginPath(),n.arc(x,S,m,0,Math.PI*2),n.fillStyle=de(c,{connections:e.connections,colorIndex:V,selectedNodeId:f,nodeId:e.id,isConnected:T}),n.fill(),Q)return;n.strokeStyle=u.nodeStroke,n.lineWidth=(k?2:1)/o,n.stroke(),k&&(n.beginPath(),n.arc(x,S,m+2/o,0,Math.PI*2),n.strokeStyle=u.nodeSelectedStroke,n.lineWidth=1.5/o,n.stroke());const W=T&&e.connections>=4;if(k||W||o>2.5){const H=e.title||"Untitled",P=Math.max(10/o,2.5);n.font=ue(c,{fontSize:P,emphasize:k}),n.textAlign="center",n.textBaseline="top";const M=n.measureText(H).width,j=2/o,F=S+m+3/o;n.fillStyle=u.labelBackground,n.fillRect(x-M/2-j,F,M+j*2,P+j*2),n.fillStyle=u.labelText,n.fillText(H,x,F+j)}},[d,c]),$=i.useCallback((e,n,o)=>{const u=d,f=e.source,p=e.target,m=u?f.id===u||p.id===u:!1;n.beginPath(),n.moveTo(f.x||0,f.y||0),n.lineTo(p.x||0,p.y||0),n.strokeStyle=ce(c,{selectedNodeId:u,isConnected:m}),n.lineWidth=m?2/o:.5/o,n.stroke()},[d,c]);return l?t.jsx(C,{title:"Knowledge Graph",description:`${l.nodes.length} linked notes, ${l.links.length} connections`,children:t.jsxs("div",{ref:a,className:"surface-base graph-canvas relative overflow-hidden",style:{"--graph-bg":h.background},children:[d&&(()=>{const e=l.nodes.find(n=>n.id===d);return e?t.jsxs("div",{className:"surface-floating absolute top-3 left-3 z-10 flex items-center gap-2 px-3 py-2",children:[t.jsx(N,{as:"span",variant:"meta",weight:"semibold",truncate:!0,className:"max-w-48",children:e.title}),t.jsxs(N,{as:"span",variant:"label",tone:"tertiary",children:[e.connections," links"]}),t.jsx("button",{type:"button",onClick:()=>b(null),className:"focus-ring-soft ml-1 flex h-6 w-6 cursor-pointer items-center justify-center rounded-[8px] text-fg-tertiary transition-colors hover:bg-hover-subtle hover:text-fg-default","aria-label":"Deselect node",children:t.jsx(se,{className:"h-3.5 w-3.5"})})]}):null})(),t.jsxs("div",{className:"surface-floating absolute top-3 right-3 z-10 flex flex-col gap-1.5 px-3 py-2.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"legend-dot h-2.5 w-2.5 shrink-0 rounded-full",style:{"--legend-color":h.legendHub}}),t.jsx(N,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Hub notes (4+ connections)"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"legend-dot h-2.5 w-2.5 shrink-0 rounded-full",style:{"--legend-color":h.nodeConnected}}),t.jsx(N,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Connected notes"})]})]}),t.jsx(_,{ref:r,graphData:l,width:g.width,height:g.height,nodeId:"id",nodeLabel:"",nodeCanvasObject:Z,nodePointerAreaPaint:(e,n,o)=>{o.beginPath(),o.arc(e.x||0,e.y||0,Math.max(z(e.connections)+4,10),0,2*Math.PI),o.fillStyle=n,o.fill()},linkCanvasObject:$,linkCanvasObjectMode:()=>"replace",linkDirectionalParticles:0,onNodeClick:B,onNodeHover:K,onBackgroundClick:L,onNodeDrag:q,onNodeDragEnd:A,warmupTicks:30,cooldownTicks:80,d3AlphaDecay:.05,d3VelocityDecay:.3,enableZoomInteraction:!0,enablePanInteraction:!0,minZoom:.3,maxZoom:5})]})}):t.jsx(C,{title:"Knowledge Graph",description:"0 linked notes, 0 connections",children:t.jsx(oe,{title:"No constellations yet",description:"Link your notes together and watch your own starry sky unfold"})})}function ke(){return t.jsx(U,{fallback:fe,errorTitle:"Failed to load graph",errorDescription:"Retry loading your linked note constellation",renderError:({error:s,retry:a})=>t.jsx(C,{title:"Knowledge Graph",children:t.jsx(Y,{title:"Failed to load graph",description:"Retry loading your linked note constellation",error:s,onRetry:a})}),children:t.jsx(he,{})})}export{ke as default};
@@ -1 +1 @@
1
- import{a}from"./graph-vendor-CUxe67Lr.js";import{p as m}from"./index-BglnLSet.js";const n=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),a.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]),e=a.forwardRef((l,t)=>a.createElement(m,{ref:t,...l,weights:n}));e.displayName="ImageIcon";const Z=e;export{Z as I};
1
+ import{a}from"./graph-vendor-CUxe67Lr.js";import{p as m}from"./index-Ba2XPRI8.js";const n=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),a.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]),e=a.forwardRef((l,t)=>a.createElement(m,{ref:t,...l,weights:n}));e.displayName="ImageIcon";const Z=e;export{Z as I};
@@ -1 +1 @@
1
- import{a as e}from"./graph-vendor-CUxe67Lr.js";import{p as n}from"./index-BglnLSet.js";import{j as r}from"./note-vendor-BofYbzmZ.js";const m=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),e.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),t=e.forwardRef((a,l)=>e.createElement(n,{ref:l,...a,weights:m}));t.displayName="PlusIcon";const s=t;function p({children:a}){return r.jsx("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:a})}export{p as M,s as n};
1
+ import{a as e}from"./graph-vendor-CUxe67Lr.js";import{p as n}from"./index-Ba2XPRI8.js";import{j as r}from"./note-vendor-BofYbzmZ.js";const m=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),e.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),t=e.forwardRef((a,l)=>e.createElement(n,{ref:l,...a,weights:m}));t.displayName="PlusIcon";const s=t;function p({children:a}){return r.jsx("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:a})}export{p as M,s as n};
@@ -0,0 +1 @@
1
+ ._Reference_bpj91_1{display:inline-flex;align-items:center;cursor:pointer;font-size:.75rem;font-weight:600;padding:2px 10px;border-radius:9999px;background:color-mix(in srgb,var(--elevated) 72%,var(--hover-subtle));border:1px solid var(--border-subtle);color:var(--fg-secondary);transition:background-color .15s ease,border-color .15s ease,color .15s ease}._Reference_bpj91_1:hover{background:var(--elevated);border-color:var(--border-secondary);color:var(--fg-default)}._Reference_bpj91_1:focus-visible{outline:2px solid var(--border-focus);outline-offset:2px}html.dark ._Reference_bpj91_1{background:color-mix(in srgb,var(--elevated) 82%,var(--hover-subtle))}._Tag_8xu23_1{display:inline-flex;align-items:center;cursor:pointer;font-size:.75rem;font-weight:600;padding:2px 10px;border-radius:9999px;background:var(--emphasis);border:1px solid var(--border-secondary);color:var(--fg-secondary);transition:background-color .15s ease,border-color .15s ease,color .15s ease}._Tag_8xu23_1:hover{background:var(--hover-subtle);border-color:var(--border-secondary);color:var(--fg-default)}._Tag_8xu23_1:focus-visible{outline:2px solid var(--border-focus);outline-offset:2px}html.dark ._Tag_8xu23_1{background:var(--emphasis)}
@@ -0,0 +1 @@
1
+ import{j as e,U as Q,y as me,v as ue,i as $,k as he,X as pe,F as fe}from"./note-vendor-BofYbzmZ.js";import{p as G,T as u,c as R,t as W,I as xe,q as M,M as j,B as E,J,K as ge,u as ye,O as be,U as ve,V as je,d as w,W as X,o as ee,N as Y,G as Ne,X as te,Y as we,z as Ce,Z as Me,r as ke,_ as Z,$ as Re,a0 as Ae,a1 as Ee,a2 as I,g as Se,a3 as Te,k as He,D as ae,m as se,Q as O,P as z,n as P,j as De,i as H,a4 as Le,a5 as Ve,a6 as Ze,a7 as Ie,a8 as Fe,L as Oe,a9 as _}from"./index-Ba2XPRI8.js";import{a}from"./graph-vendor-CUxe67Lr.js";import{u as Pe}from"./image.api-0mMkElZk.js";import{V as $e,a2 as Ye,a3 as ze,A as Ue}from"./note-core-BCgMq5QA.js";import{M as ne,n as Be}from"./ModalActionRow-DyOb58KJ.js";import{u as _e,R as qe}from"./useReminderMutate-tNMwwRnx.js";const Ke=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),a.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Z"}))]]),Qe=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M87.5,151.52l64-64a12,12,0,0,1,17,17l-64,64a12,12,0,0,1-17-17Zm131-114a60.08,60.08,0,0,0-84.87,0L103.51,67.61a12,12,0,0,0,17,17l30.07-30.06a36,36,0,0,1,50.93,50.92L171.4,135.52a12,12,0,1,0,17,17l30.08-30.06A60.09,60.09,0,0,0,218.45,37.55ZM135.52,171.4l-30.07,30.08a36,36,0,0,1-50.92-50.93l30.06-30.07a12,12,0,0,0-17-17L37.55,133.58a60,60,0,0,0,84.88,84.87l30.06-30.07a12,12,0,0,0-17-17Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M209.94,113.94l-96,96a48,48,0,0,1-67.88-67.88l96-96a48,48,0,0,1,67.88,67.88Z",opacity:"0.2"}),a.createElement("path",{d:"M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM144.56,173.66l-21.45,21.45a44,44,0,0,1-62.22-62.22l21.45-21.46a8,8,0,0,1,11.32,11.31L72.2,144.2a28,28,0,0,0,39.6,39.6l21.45-21.46a8,8,0,0,1,11.31,11.32Zm-34.9-16a8,8,0,0,1-11.32-11.32l48-48a8,8,0,0,1,11.32,11.32Zm85.45-34.55-21.45,21.45a8,8,0,0,1-11.32-11.31L183.8,111.8a28,28,0,0,0-39.6-39.6L122.74,93.66a8,8,0,0,1-11.31-11.32l21.46-21.45a44,44,0,0,1,62.22,62.22Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M164.25,91.75a6,6,0,0,1,0,8.49l-64,64a6,6,0,0,1-8.49-8.48l64-64A6,6,0,0,1,164.25,91.75ZM214.2,41.8a54.07,54.07,0,0,0-76.38,0L107.75,71.85a6,6,0,0,0,8.49,8.49l30.07-30.06a42,42,0,0,1,59.41,59.41l-30.08,30.07a6,6,0,1,0,8.49,8.49l30.07-30.07A54,54,0,0,0,214.2,41.8ZM139.76,175.64l-30.07,30.08a42,42,0,0,1-59.41-59.41l30.06-30.07a6,6,0,0,0-8.49-8.49l-30,30.07a54,54,0,0,0,76.38,76.39l30.07-30.08a6,6,0,0,0-8.49-8.49Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M162.84,93.16a4,4,0,0,1,0,5.66l-64,64a4,4,0,0,1-5.66-5.66l64-64A4,4,0,0,1,162.84,93.16Zm49.95-49.95a52.07,52.07,0,0,0-73.56,0L109.17,73.27a4,4,0,0,0,5.65,5.66l30.07-30.06a44,44,0,0,1,62.24,62.24l-30.07,30.06a4,4,0,0,0,5.66,5.66l30.07-30.06A52.07,52.07,0,0,0,212.79,43.21ZM141.17,177.06l-30.06,30.07a44,44,0,0,1-62.24-62.24l30.06-30.06a4,4,0,0,0-5.66-5.66L43.21,139.23a52,52,0,0,0,73.56,73.56l30.06-30.07a4,4,0,1,0-5.66-5.66Z"}))]]),re=a.forwardRef((t,n)=>a.createElement(G,{ref:n,...t,weights:Ke}));re.displayName="FileIcon";const Ge=re,oe=a.forwardRef((t,n)=>a.createElement(G,{ref:n,...t,weights:Qe}));oe.displayName="LinkSimpleIcon";const We=oe;function U({icon:t,title:n,className:o}){return e.jsxs("div",{className:R("flex items-center gap-2",o),children:[e.jsx("div",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center text-current",children:t}),e.jsx(u,{as:"span",variant:"label",weight:"semibold",className:"text-current",children:n})]})}function Je({title:t,description:n,selected:o=!1,onClick:i,children:r}){return e.jsxs("button",{type:"button","aria-pressed":o,className:`focus-ring-soft flex w-full items-start justify-between gap-3 p-3 text-left transition-colors sm:p-4 ${o?"surface-floating bg-elevated":"rounded-[14px] border border-border-subtle bg-transparent hover:border-border-secondary hover:bg-hover-subtle"}`,onClick:i,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(u,{as:"div",variant:"body",weight:"semibold",tone:o?"default":"secondary",children:t}),e.jsx(u,{as:"div",variant:"meta",weight:"medium",tone:o?"secondary":"tertiary",className:"mt-1",children:n})]}),r?e.jsx("div",{className:"shrink-0",children:r}):null]})}const Xe=t=>{const{data:n}=W({queryKey:M.notes.backReferences(t.noteId),async queryFn(){const o=await xe(t.noteId);if(o.type==="error")throw o;return o.backReferences}});return t.render(n)},et=[{value:"narrow",label:"Narrow",description:"Optimized for reading long-form content"},{value:"wide",label:"Wide",description:"Balanced width suitable for most content"},{value:"full",label:"Full Width",description:"Maximize screen space utilization"}];function tt({isOpen:t,onClose:n,onSave:o,currentLayout:i="wide"}){const[r,l]=a.useState(i);a.useEffect(()=>{t&&l(i)},[t,i]);const s=()=>{o(r),n()};return e.jsxs(j,{isOpen:t,onClose:n,variant:"compact",children:[e.jsx(j.Header,{title:"Layout Settings",onClose:n}),e.jsx(j.Body,{children:e.jsx("div",{className:"flex flex-col gap-3 sm:gap-4",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(u,{as:"div",variant:"body",weight:"semibold",tone:"secondary",children:"Note layout"}),e.jsx("div",{className:"flex flex-col gap-2",children:et.map(c=>e.jsx(Je,{title:c.label,description:c.description,selected:r===c.value,onClick:()=>l(c.value)},c.value))})]})})}),e.jsx(j.Footer,{children:e.jsxs(ne,{children:[e.jsx(E,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),e.jsx(E,{variant:"primary",size:"sm",onClick:s,children:"Apply"})]})})]})}const at=(t,n)=>t||(n==="mobile"?"Mobile browser":n==="mcp"?"MCP":"Web browser");function st({isOpen:t,noteId:n,onClose:o,onRestored:i}){const r=J(),l=ge(),s=ye({queryKey:M.notes.snapshots(n),queryFn:async()=>{const m=await be(n);if(m.type==="error")throw m;return m.noteSnapshots},enabled:t}),c=ve({mutationFn:je,onSuccess:async m=>{if(m.type==="error"){r(m.errors[0].message);return}await Promise.all([l.invalidateQueries({queryKey:M.notes.detail(n),exact:!0}),l.invalidateQueries({queryKey:M.notes.listAll(),exact:!1}),l.invalidateQueries({queryKey:M.notes.tagListAll(),exact:!1}),l.invalidateQueries({queryKey:M.notes.pinned(),exact:!0}),l.invalidateQueries({queryKey:M.notes.backReferences(n),exact:!0}),l.invalidateQueries({queryKey:M.notes.snapshots(n),exact:!1})]),r("Previous version restored."),i?.(m.restoreNoteSnapshot),o()}});return e.jsxs(j,{isOpen:t,onClose:o,variant:"inspect",children:[e.jsx(j.Header,{title:"Restore Previous Version",onClose:o}),e.jsx(j.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(u,{as:"p",variant:"meta",tone:"secondary",children:"Choose a previous snapshot to restore this note back to that state."}),s.isLoading&&e.jsx(u,{as:"div",variant:"meta",tone:"secondary",children:"Loading previous versions..."}),!s.isLoading&&s.data?.length===0&&e.jsx(u,{as:"div",variant:"meta",tone:"secondary",className:"rounded-[14px] border border-border-subtle bg-hover-subtle/50 px-4 py-3",children:"A recovery snapshot will appear after the first edit in a session and older ones are cleaned up automatically."}),!s.isLoading&&s.data&&s.data.length>0&&e.jsx("div",{className:"flex flex-col gap-2",children:s.data.map(m=>e.jsx("div",{className:"surface-base p-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs(u,{as:"p",variant:"body",weight:"semibold",children:["Before ",at(m.meta.label,m.meta.entrypoint)," edit"]}),e.jsx(u,{as:"p",variant:"meta",truncate:!0,tone:"secondary",children:m.title}),e.jsx(u,{as:"p",variant:"label",tone:"tertiary",children:w(m.createdAt).format("YYYY-MM-DD HH:mm:ss")})]}),e.jsx(E,{size:"sm",isLoading:c.isPending,onClick:()=>c.mutate(m.id),children:"Restore"})]})},m.id))})]})})]})}const nt="_Reference_bpj91_1",rt={Reference:nt},ot=X.bind(rt),it={type:"reference",propSchema:{id:{default:""},title:{default:"Unknown"}},content:"none"};function lt(t){const n=ee(),o=()=>{t.editor.blur(),n({to:Y,params:{id:t.inlineContent.props.id}})},i=r=>{r.preventDefault(),r.stopPropagation()};return e.jsx("span",{role:"link",tabIndex:0,contentEditable:!1,className:ot("Reference"),onMouseDown:i,onClick:r=>{i(r),o()},onKeyDown:r=>{r.key!=="Enter"&&r.key!==" "||(i(r),o())},children:e.jsxs("span",{children:["[",t.inlineContent.props.title,"]"]})})}const ct=Q(it,{render:t=>e.jsx(lt,{...t})}),dt="_Tag_8xu23_1",mt={Tag:dt},ut=X.bind(mt),ht={type:"tag",propSchema:{id:{default:""},tag:{default:"@Unknown"}},content:"none"};function pt(t){const n=ee(),o=()=>{t.editor.blur(),n({to:Ne,params:{id:t.inlineContent.props.id},search:{page:1}})},i=r=>{r.preventDefault(),r.stopPropagation()};return e.jsx("span",{role:"link",tabIndex:0,contentEditable:!1,className:ut("Tag"),onMouseDown:i,onClick:r=>{i(r),o()},onKeyDown:r=>{r.key!=="Enter"&&r.key!==" "||(i(r),o())},children:e.jsx("span",{children:t.inlineContent.props.tag})})}const ft=Q(ht,{render:t=>e.jsx(pt,{...t})}),xt=()=>{const t=ue(),[n,o]=a.useState([]),i={1:"pl-3",2:"pl-[26px]",3:"pl-[40px]",4:"pl-[54px]",5:"pl-[68px]",6:"pl-[82px]"};a.useEffect(()=>{const s=()=>{const m=t.document,C=[],y=N=>{for(const g of N){if(g.type==="heading"){const p=g,S=p.props.level||1,T=p.content?.map(A=>A.text||"").join("")||"";T.trim()&&C.push({id:g.id,level:S,text:T})}g.children&&Array.isArray(g.children)&&y(g.children)}};y(m),o(C)};s();const c=t.onChange?.(s);return()=>{c&&c()}},[t]);const r=s=>{t.setTextCursorPosition(s);const c=document.querySelector(`[data-id="${s}"]`);c&&c.scrollIntoView({behavior:"smooth",block:"center"})},l=e.jsx(U,{icon:e.jsx(te,{className:"h-3.5 w-3.5"}),title:"Table of Contents",className:"text-fg-tertiary"});return n.length===0?e.jsxs("div",{className:"surface-base w-full p-4",children:[l,e.jsx(u,{as:"p",variant:"meta",tone:"secondary",className:"mt-2",children:"Add headings to your document to generate a table of contents"})]}):e.jsxs("div",{className:"surface-base w-full p-4",children:[e.jsx("div",{className:"mb-2",children:l}),e.jsx("nav",{className:"space-y-0.5",children:n.map(s=>{const c=s.level===1;return e.jsxs("button",{type:"button",onClick:()=>r(s.id),className:R("focus-ring-soft","flex","w-full","items-center","gap-2","rounded-[10px]","px-2.5","py-1.5",i[s.level]??"pl-2.5","text-left","transition-colors","hover:bg-hover-subtle",c?"text-fg-default":"text-fg-secondary"),children:[e.jsxs(u,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"min-w-[1.5rem]",children:["H",s.level]}),e.jsx(u,{as:"span",variant:"body",weight:c?"semibold":"medium",className:"line-clamp-2 text-current",children:s.text})]},s.id)})})]})},gt=me({type:"tableOfContents",propSchema:{},content:"none"},{render:()=>e.jsx(xt,{})})(),yt=$e.create({inlineContentSpecs:{...ze,tag:ft,reference:ct},blockSpecs:{...Ye,tableOfContents:gt}}),bt=({editor:t})=>e.jsx($,{triggerCharacter:"/",getItems:async n=>Ue([...he(t).filter(o=>o.title!=="Audio"&&o.title!=="Video"&&o.title!=="File"),{title:"Table of Contents",subtext:"Insert a table of contents based on headings",onItemClick:()=>{t.insertBlocks([{type:"tableOfContents"}],t.getTextCursorPosition().block,"after")},aliases:["toc","table of contents","contents","outline","index"],group:"Other",icon:e.jsx(te,{})}],n)}),vt=({onClick:t})=>e.jsx($,{triggerCharacter:"[",getItems:async n=>{const o=await we({query:n,limit:5});if(o.type==="error")return[];const{notes:i}=o.allNotes;return i.map(r=>({title:r.title,onItemClick:()=>t({type:"reference",props:{id:r.id,title:r.title}})}))}}),jt=({onClick:t})=>e.jsx($,{triggerCharacter:"@",getItems:async n=>{const o=await Ce({query:n,limit:5});if(o.type==="error")return[];const{tags:i}=o.allTags,r=i.some(s=>s.name!==`@${n}`),l=[{title:"Add a new tag",onItemClick:async()=>{const s=await Me({name:"@"+n});if(s.type==="error")return;const{id:c,name:m}=s.createTag;t({type:"tag",props:{id:c,tag:m}})}}];return i.length===0?l:i.map(s=>({title:s.name,onItemClick:()=>t({type:"tag",props:{id:s.id,tag:s.name}})})).concat(n&&r?l:[])}});async function Nt(t){return new Promise((n,o)=>{const i=new FileReader;i.readAsDataURL(t),i.onload=()=>n(i.result),i.onerror=r=>o(r)})}const wt=a.forwardRef(({content:t,editable:n,onChange:o},i)=>{const{theme:r}=ke(s=>s),l=pe({schema:yt,initialContent:t&&JSON.parse(t)||void 0,uploadFile:async s=>Pe({base64:await Nt(s)})},[]);return a.useImperativeHandle(i,()=>({getContent:()=>JSON.stringify(l.document)})),e.jsxs(fe,{slashMenu:!1,theme:r,editor:l,editable:n,onChange:o,children:[e.jsx(bt,{editor:l}),e.jsx(vt,{onClick:s=>{l.insertInlineContent([s," "])}}),e.jsx(jt,{onClick:s=>{l.insertInlineContent([s," "])}})]})}),q={low:{active:"border-border-secondary bg-elevated text-fg-default",inactive:"border-transparent bg-transparent text-fg-muted hover:bg-hover-subtle"},medium:{active:"border-border-secondary bg-elevated text-fg-default",inactive:"border-transparent bg-transparent text-fg-muted hover:bg-hover-subtle"},high:{active:"border-border-secondary bg-elevated text-fg-default",inactive:"border-transparent bg-transparent text-fg-muted hover:bg-hover-subtle"}};function Ct({isOpen:t,onClose:n,onSave:o,reminder:i,mode:r}){const[l,s]=a.useState(new Date),[c,m]=a.useState("medium"),[C,y]=a.useState("");a.useEffect(()=>{t&&r==="edit"&&i?(s(new Date(Number(i.reminderDate))),m(i.priority||"medium"),y(i.content||"")):t&&r==="create"&&(s(new Date),m("medium"),y(""))},[t,r,i]);const N=()=>{o(l,c,C||void 0),n()},g=p=>c===p?q[p].active:q[p].inactive;return e.jsxs(j,{isOpen:t,onClose:n,variant:"form",children:[e.jsx(j.Header,{title:r==="create"?"Create Reminder":"Edit Reminder",onClose:n}),e.jsx(j.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Z,{children:"Date & Time"}),e.jsx(Re,{type:"datetime-local",size:"sm",value:w(l).format("YYYY-MM-DDTHH:mm"),onChange:p=>s(new Date(p.target.value))})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Z,{children:"Content"}),e.jsx(Ae,{size:"sm",placeholder:"Enter reminder content (optional)",value:C,onChange:p=>y(p.target.value)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Z,{children:"Priority"}),e.jsxs(Ee,{type:"single",value:c,onValueChange:p=>p&&m(p),className:"gap-1.5 border-none rounded-[14px] bg-muted/70 p-1 sm:gap-2",children:[e.jsx(I,{value:"low",className:`flex-1 rounded-[10px] border ${g("low")}`,children:e.jsx(u,{as:"span",weight:"medium",className:"text-current",children:"Low"})}),e.jsx(I,{value:"medium",className:`flex-1 rounded-[10px] border ${g("medium")}`,children:e.jsx(u,{as:"span",weight:"medium",className:"text-current",children:"Medium"})}),e.jsx(I,{value:"high",className:`flex-1 rounded-[10px] border ${g("high")}`,children:e.jsx(u,{as:"span",weight:"medium",className:"text-current",children:"High"})})]})]})]})}),e.jsx(j.Footer,{children:e.jsxs(ne,{children:[e.jsx(E,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),e.jsx(E,{variant:"primary",size:"sm",onClick:N,children:r==="create"?"Create":"Save"})]})})]})}function Mt({noteId:t}){const[n,o]=a.useState(!1),[i,r]=a.useState(!1),[l,s]=a.useState("create"),[c,m]=a.useState(void 0),{onCreate:C,onUpdate:y,onDelete:N}=_e(),g=()=>{s("create"),m(void 0),r(!0)},p=f=>{s("edit"),m(f),r(!0)},S=(f,x,d)=>{l==="create"?C(t,f,x,()=>{r(!1)},d):l==="edit"&&c&&y(c.id,t,{reminderDate:f,priority:x,content:d},()=>{r(!1)})},T=f=>{y(f.id,t,{completed:!f.completed})},A=f=>{const x=w(Number(f)),d=w();return x.isSame(d,"day")?`Today at ${x.format("HH:mm")}`:x.isSame(d.add(1,"day"),"day")?`Tomorrow at ${x.format("HH:mm")}`:x.format("YYYY-MM-DD HH:mm")},L=f=>{const x=w(Number(f)),d=w(),v=x.diff(d,"hour");return v<=6?"high":v<=24?"medium":"low"},D=f=>{const x=w(Number(f)),d=w(),v=x.diff(d,"hour"),k=x.diff(d,"minute")%60;return v<0||k<0?"Overdue":v===0?`${k}m remaining`:`${v}h ${k}m remaining`};return e.jsxs("div",{className:"surface-base mb-5 p-4",children:[e.jsxs("div",{className:R("flex items-center justify-between",!n&&"mb-3"),children:[e.jsx("button",{type:"button",onClick:()=>o(!n),className:"focus-ring-soft flex items-center gap-2 rounded-[10px] px-2 py-1.5 text-fg-tertiary transition-colors hover:bg-hover-subtle hover:text-fg-default",children:e.jsx(U,{icon:n?e.jsx(Se,{size:12}):e.jsx(Te,{size:12}),title:"Reminders"})}),!n&&e.jsxs(E,{size:"sm",variant:"ghost",onClick:g,children:[e.jsx(Be,{className:"w-3 h-3"}),e.jsx(u,{as:"span",variant:"label",className:"hidden sm:inline",children:"Add"})]})]}),!n&&e.jsx(qe,{noteId:t,searchParams:{offset:0,limit:9999},render:({reminders:f,totalCount:x})=>e.jsx("div",{className:"flex flex-col gap-2",children:f.length===0?e.jsx(u,{as:"p",variant:"meta",tone:"secondary",className:"py-3 text-center",children:x===0?"No reminders yet":"All reminders complete"}):e.jsx("div",{className:"flex flex-col",children:f.map(d=>{const v=d.priority||L(d.reminderDate),k=D(d.reminderDate),V=k==="Overdue";return e.jsxs("div",{className:R("flex items-center gap-2.5 px-2 py-1.5"),children:[e.jsx(He,{checked:d.completed,onChange:()=>T(d),size:"sm"}),e.jsx(u,{as:"div",variant:"body",weight:"medium",className:R("truncate flex-1 min-w-0",d.completed&&"line-through opacity-40"),children:d.content||A(d.reminderDate)}),e.jsxs("div",{className:R("shrink-0 flex items-center gap-1",d.completed&&"opacity-40"),children:[d.content&&e.jsx(u,{as:"span",variant:"meta",tone:"secondary",children:A(d.reminderDate)}),!d.completed&&e.jsx(u,{as:"span",variant:"label",weight:"medium",tone:V||v==="high"?"error":"tertiary",className:R(d.content&&'before:content-["·"] before:mr-1'),children:k})]}),e.jsx(ae,{button:e.jsxs("button",{type:"button",className:"focus-ring-soft inline-flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-secondary outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default",children:[e.jsx(se,{size:16,className:"text-current"}),e.jsx("span",{className:"sr-only",children:"Reminder actions"})]}),items:[{name:"Edit",onClick:()=>p(d)},{name:"Delete",onClick:()=>N(d.id,t)}]})]},d.id)})})})}),e.jsx(Ct,{isOpen:i,onClose:()=>r(!1),onSave:S,reminder:c,mode:l})]})}const ie=De(Y),K=t=>w(Number(t)).format("YYYY-MM-DD HH:mm:ss"),F=()=>typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`,kt={narrow:"max-w-[640px]",wide:"max-w-[896px]",full:"max-w-full px-4"},Rt=e.jsx(z,{title:"Loading note",variant:"none",children:e.jsxs("main",{className:"mx-auto max-w-[896px]",children:[e.jsx(H,{className:"mb-8",height:"66px"}),e.jsx(H,{className:"ml-12 mb-8",height:"150px"}),e.jsx(H,{className:"mb-5",height:"80px"}),e.jsx(H,{height:"80px"})]})});function At({id:t}){const n=J(),o=ie.useNavigate(),i=a.useRef(null),r=a.useRef(null),l=a.useRef(F()),{data:s}=W({queryKey:M.notes.detail(t),queryFn:async()=>{const h=await Le(t);if(h.type==="error")throw h;return h.note},gcTime:0}),[c,m]=a.useState(s.title),[C,y]=a.useState(()=>K(s.updatedAt)),[N,g]=a.useState(s.pinned),[p,S]=a.useState(s.layout||"wide"),[T,A]=a.useState(!1),[L,D]=a.useState(!1),[f,x]=Ve(1e3);a.useEffect(()=>{m(s.title),g(s.pinned),S(s.layout||"wide"),y(K(s.updatedAt))},[s.layout,s.pinned,s.title,s.updatedAt]),a.useEffect(()=>{l.current=F()},[t]);const d=async({title:h="",content:b=""})=>{x(async()=>{const B=await _({id:t,title:h,content:b,editSessionId:l.current});if(B.type==="error"){n(B.errors[0].message);return}m(h),y(w().format("YYYY-MM-DD HH:mm:ss"))})},v=()=>{d({title:c,content:i.current?.getContent()})},k=h=>{m(h),d({title:h,content:i.current?.getContent()})},V=async h=>{const b=await _({id:t,layout:h,editSessionId:l.current});if(b.type==="error"){n(b.errors[0].message);return}S(h),n("Layout has been updated.")},{onCreate:le,onDelete:ce,onPinned:de}=Ze();return e.jsx(z,{title:c,variant:"none",children:e.jsxs("main",{className:R("mx-auto",kt[p]),children:[e.jsx("div",{className:"surface-floating sticky top-20 z-[1001] mb-7 px-5 pt-4 pb-3.5",children:e.jsxs("div",{className:"flex flex-col gap-3.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-5",children:[e.jsxs("div",{className:"min-w-0 flex-1 pt-0.5",children:[e.jsx(u,{as:"div",variant:"micro",weight:"semibold",tracking:"widest",transform:"uppercase",tone:"tertiary",className:"mb-1.5",children:"Thought in progress"}),e.jsx("input",{ref:r,placeholder:"Title",className:"text-heading sm:text-display w-full bg-transparent font-semibold leading-[1.25] tracking-[-0.02em] outline-none",type:"text",value:c,onChange:h=>k(h.target.value)})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(ae,{button:e.jsxs("button",{type:"button",className:"focus-ring-soft inline-flex h-9 w-9 items-center justify-center rounded-[12px] border border-transparent bg-transparent text-fg-tertiary outline-none transition-colors hover:border-border-subtle hover:bg-hover-subtle hover:text-fg-default",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Note actions"})]}),items:[{name:N?"Unpin":"Pin",onClick:()=>de(t,N,()=>{g(h=>!h)})},{name:"Change layout",onClick:()=>A(!0)},{type:"separator"},{name:"Clone this note",onClick:()=>le(r.current?.value||"untitled",i.current?.getContent()||"",p)},{name:"Restore previous version",onClick:()=>D(!0)},{type:"separator"},{name:"Delete",onClick:()=>ce(t,()=>{o({to:Ie,search:{page:1}})})}]}),e.jsx(E,{size:"sm",variant:"subtle",isLoading:f,onClick:v,children:"Save"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-t border-border-subtle/80 pt-3",children:[N&&e.jsxs(u,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center gap-1.5",children:[e.jsx(Fe,{className:"h-3 w-3",weight:"fill"}),"Pinned"]}),N&&e.jsx("span",{className:"h-1 w-1 rounded-full bg-border-secondary"}),e.jsxs(u,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Last saved ",C]})]})]})}),e.jsx(wt,{ref:i,content:s.content,onChange:v},`${t}:${s.updatedAt}`),e.jsx(O,{fallback:e.jsx(H,{className:"mb-5",height:"80px"}),errorTitle:"Failed to load reminders",errorDescription:"Retry loading reminder details for this note.",renderError:({error:h,retry:b})=>e.jsx(P,{title:"Failed to load reminders",description:"Retry loading reminder details for this note.",error:h,onRetry:b,showBackAction:!1,showHomeAction:!1}),children:e.jsx(Mt,{noteId:t})}),e.jsx(O,{fallback:e.jsx(H,{height:"80px"}),errorTitle:"Failed to load back references",errorDescription:"Retry loading notes that link back here.",renderError:({error:h,retry:b})=>e.jsx(P,{title:"Failed to load back references",description:"Retry loading notes that link back here.",error:h,onRetry:b,showBackAction:!1,showHomeAction:!1}),children:e.jsx(Xe,{noteId:t,render:h=>h&&h.length>0&&e.jsxs("div",{className:"surface-base p-4",children:[e.jsx(U,{icon:e.jsx(We,{className:"h-3.5 w-3.5"}),title:"Back References",className:"mb-3 text-fg-tertiary"}),e.jsx("ul",{className:"flex flex-col",children:h.map(b=>e.jsx("li",{children:e.jsxs(Oe,{to:Y,params:{id:b.id},className:"flex items-center gap-2 rounded-[10px] px-2.5 py-1.5 text-fg-secondary transition-colors hover:bg-hover-subtle hover:text-fg-default",children:[e.jsx(Ge,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),e.jsx(u,{as:"span",variant:"body",weight:"medium",className:"text-current",children:b.title})]})},b.id))})]})})}),e.jsx(tt,{isOpen:T,onClose:()=>A(!1),onSave:V,currentLayout:p}),e.jsx(st,{isOpen:L,noteId:t,onClose:()=>D(!1),onRestored:()=>{l.current=F()}})]})})}function Zt(){const{id:t}=ie.useParams();if(!t)throw new Error("Note id is required.");return e.jsx(O,{fallback:Rt,errorTitle:"Failed to load note",errorDescription:"Retry loading the note editor.",resetKeys:[t],renderError:({error:n,retry:o})=>e.jsx(z,{title:"Note",variant:"none",children:e.jsx(P,{title:"Failed to load note",description:"Retry loading the note editor.",error:n,onRetry:o})}),children:e.jsx(At,{id:t},t)})}export{Zt as default};
@@ -1 +1 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{k as $,T as h,L as H,N as E,D as M,m as L,d as x,Q as S,P as v,E as O,l as U,i as o,j as C,R as I}from"./index-BglnLSet.js";import"./graph-vendor-CUxe67Lr.js";import{u as P,R as Y}from"./useReminderMutate-yJak8FzP.js";import"./note-core-BCgMq5QA.js";const u={high:"bg-priority-high",medium:"bg-priority-medium",low:"bg-priority-low"};function A({reminder:t,onUpdate:l,onDelete:g}){const f=y=>{const r=x(Number(y)),m=x();return r.isSame(m,"day")?`Today at ${r.format("HH:mm")}`:r.isSame(m.add(1,"day"),"day")?`Tomorrow at ${r.format("HH:mm")}`:r.format("YYYY-MM-DD HH:mm")},a=y=>{const r=x(Number(y)),m=x(),b=r.diff(m,"hour"),N=r.diff(m,"minute")%60;return b<0||N<0?"Overdue":b===0?`${N}m remaining`:`${b}h ${N}m remaining`},d=a(t.reminderDate)==="Overdue",i=t.priority||"low",s=i==="high"?"High":i==="medium"?"Medium":"Low",p=u[i],c=t.noteId.toString(),n=d?"text-fg-error":"text-fg-tertiary",j=t.content?.trim()||t.note?.title||"Untitled reminder",R=t.note?.title||"Untitled note",T=!!(t.content?.trim()&&t.note?.title),D=a(t.reminderDate),k=f(t.reminderDate);return e.jsxs("div",{className:"surface-base flex flex-col gap-2.5 px-4 py-3 sm:flex-row sm:items-center sm:gap-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-2.5 sm:items-center",children:[e.jsx($,{checked:t.completed,onChange:()=>l(t.id,c,{completed:!t.completed}),size:"sm"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",className:t.completed?"truncate line-through opacity-45":"truncate",children:j}),T&&e.jsx(h,{as:"div",variant:"meta",tone:"secondary",className:t.completed?"mt-0.5 truncate opacity-45":"mt-0.5 truncate",children:e.jsx(H,{to:E,params:{id:String(t.note?.id??t.noteId)},className:"transition-colors hover:text-fg-default hover:underline",children:R})})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 sm:shrink-0",children:[e.jsx("span",{className:`h-3 w-3 shrink-0 rounded-full border border-border-subtle ${p}`,"aria-label":`${s} priority`,title:`${s} priority`}),e.jsx(h,{as:"span",variant:"meta",weight:"medium",tone:"secondary",className:t.completed?"opacity-45":void 0,children:k}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-border-secondary"}),e.jsx(h,{as:"span",variant:"label",weight:"medium",className:t.completed?"opacity-45":n,children:D})]}),e.jsx("div",{className:"flex items-center justify-end gap-1.5 sm:shrink-0",children:e.jsx(M,{button:e.jsxs("button",{type:"button",className:"focus-ring-soft inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] border border-transparent bg-transparent text-fg-tertiary outline-none transition-colors hover:border-border-subtle hover:bg-hover-subtle hover:text-fg-default",children:[e.jsx(L,{className:"h-5 w-5 text-current"}),e.jsx("span",{className:"sr-only",children:"Reminder actions"})]}),items:[{name:"Delete",onClick:()=>g(t.id,c)}]})})]})}const w=C(I),B=[{label:"High",className:u.high},{label:"Medium",className:u.medium},{label:"Low",className:u.low}];function q(){const t=w.useNavigate(),{page:l}=w.useSearch(),{onUpdate:g,onDelete:f}=P(),a=25,d=e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:B.map(({label:i,className:s})=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`h-2.5 w-2.5 rounded-full border border-border-subtle ${s}`,"aria-hidden":"true"}),e.jsx(h,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:i})]},i))});return e.jsx(S,{fallback:e.jsx(v,{title:"Reminders",heading:e.jsx(o,{width:164,height:24,className:"rounded-full"}),description:e.jsx(o,{width:224,height:16,className:"rounded-full"}),headerRight:d,children:e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx(o,{height:"60px"}),e.jsx(o,{height:"60px"}),e.jsx(o,{height:"60px"}),e.jsx(o,{height:"60px"})]})}),errorTitle:"Failed to load reminders",errorDescription:"Retry loading the upcoming reminder list",resetKeys:[l,a],children:e.jsx(Y,{searchParams:{offset:(l-1)*a,limit:a},render:({reminders:i,totalCount:s})=>{const p=s>0?`Reminders (${s})`:void 0,c="Review reminders created from notes and mark them complete here";return i.length===0?e.jsx(v,{title:"Reminders",heading:p,description:c,headerRight:d,children:e.jsx(O,{title:"No upcoming reminders",description:"Add a reminder inside any note to see it here"})}):e.jsx(v,{title:"Reminders",heading:p,description:c,headerRight:d,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-col gap-2.5",children:i.map(n=>e.jsx(A,{reminder:n,onUpdate:g,onDelete:f},n.id))}),s&&a<s&&e.jsx(U,{page:l,last:Math.ceil(s/a),onChange:n=>{t({search:j=>({...j,page:n})})}})]})})}})})}export{q as default};
1
+ import{j as e}from"./note-vendor-BofYbzmZ.js";import{k as $,T as h,L as H,N as E,D as M,m as L,d as x,Q as S,P as v,E as O,l as U,i as o,j as C,R as I}from"./index-Ba2XPRI8.js";import"./graph-vendor-CUxe67Lr.js";import{u as P,R as Y}from"./useReminderMutate-tNMwwRnx.js";import"./note-core-BCgMq5QA.js";const u={high:"bg-priority-high",medium:"bg-priority-medium",low:"bg-priority-low"};function A({reminder:t,onUpdate:l,onDelete:g}){const f=y=>{const r=x(Number(y)),m=x();return r.isSame(m,"day")?`Today at ${r.format("HH:mm")}`:r.isSame(m.add(1,"day"),"day")?`Tomorrow at ${r.format("HH:mm")}`:r.format("YYYY-MM-DD HH:mm")},a=y=>{const r=x(Number(y)),m=x(),b=r.diff(m,"hour"),N=r.diff(m,"minute")%60;return b<0||N<0?"Overdue":b===0?`${N}m remaining`:`${b}h ${N}m remaining`},d=a(t.reminderDate)==="Overdue",i=t.priority||"low",s=i==="high"?"High":i==="medium"?"Medium":"Low",p=u[i],c=t.noteId.toString(),n=d?"text-fg-error":"text-fg-tertiary",j=t.content?.trim()||t.note?.title||"Untitled reminder",R=t.note?.title||"Untitled note",T=!!(t.content?.trim()&&t.note?.title),D=a(t.reminderDate),k=f(t.reminderDate);return e.jsxs("div",{className:"surface-base flex flex-col gap-2.5 px-4 py-3 sm:flex-row sm:items-center sm:gap-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-2.5 sm:items-center",children:[e.jsx($,{checked:t.completed,onChange:()=>l(t.id,c,{completed:!t.completed}),size:"sm"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(h,{as:"p",variant:"body",weight:"semibold",className:t.completed?"truncate line-through opacity-45":"truncate",children:j}),T&&e.jsx(h,{as:"div",variant:"meta",tone:"secondary",className:t.completed?"mt-0.5 truncate opacity-45":"mt-0.5 truncate",children:e.jsx(H,{to:E,params:{id:String(t.note?.id??t.noteId)},className:"transition-colors hover:text-fg-default hover:underline",children:R})})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 sm:shrink-0",children:[e.jsx("span",{className:`h-3 w-3 shrink-0 rounded-full border border-border-subtle ${p}`,"aria-label":`${s} priority`,title:`${s} priority`}),e.jsx(h,{as:"span",variant:"meta",weight:"medium",tone:"secondary",className:t.completed?"opacity-45":void 0,children:k}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-border-secondary"}),e.jsx(h,{as:"span",variant:"label",weight:"medium",className:t.completed?"opacity-45":n,children:D})]}),e.jsx("div",{className:"flex items-center justify-end gap-1.5 sm:shrink-0",children:e.jsx(M,{button:e.jsxs("button",{type:"button",className:"focus-ring-soft inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] border border-transparent bg-transparent text-fg-tertiary outline-none transition-colors hover:border-border-subtle hover:bg-hover-subtle hover:text-fg-default",children:[e.jsx(L,{className:"h-5 w-5 text-current"}),e.jsx("span",{className:"sr-only",children:"Reminder actions"})]}),items:[{name:"Delete",onClick:()=>g(t.id,c)}]})})]})}const w=C(I),B=[{label:"High",className:u.high},{label:"Medium",className:u.medium},{label:"Low",className:u.low}];function q(){const t=w.useNavigate(),{page:l}=w.useSearch(),{onUpdate:g,onDelete:f}=P(),a=25,d=e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:B.map(({label:i,className:s})=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`h-2.5 w-2.5 rounded-full border border-border-subtle ${s}`,"aria-hidden":"true"}),e.jsx(h,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:i})]},i))});return e.jsx(S,{fallback:e.jsx(v,{title:"Reminders",heading:e.jsx(o,{width:164,height:24,className:"rounded-full"}),description:e.jsx(o,{width:224,height:16,className:"rounded-full"}),headerRight:d,children:e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx(o,{height:"60px"}),e.jsx(o,{height:"60px"}),e.jsx(o,{height:"60px"}),e.jsx(o,{height:"60px"})]})}),errorTitle:"Failed to load reminders",errorDescription:"Retry loading the upcoming reminder list",resetKeys:[l,a],children:e.jsx(Y,{searchParams:{offset:(l-1)*a,limit:a},render:({reminders:i,totalCount:s})=>{const p=s>0?`Reminders (${s})`:void 0,c="Review reminders created from notes and mark them complete here";return i.length===0?e.jsx(v,{title:"Reminders",heading:p,description:c,headerRight:d,children:e.jsx(O,{title:"No upcoming reminders",description:"Add a reminder inside any note to see it here"})}):e.jsx(v,{title:"Reminders",heading:p,description:c,headerRight:d,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-col gap-2.5",children:i.map(n=>e.jsx(A,{reminder:n,onUpdate:g,onDelete:f},n.id))}),s&&a<s&&e.jsx(U,{page:l,last:Math.ceil(s/a),onChange:n=>{t({search:j=>({...j,page:n})})}})]})})}})})}export{q as default};
@@ -1 +1 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{P as m,E as f,Q as N,x as b,T as h,L as w,N as S,l as E,j as k,y as $,i as d}from"./index-BglnLSet.js";import{a as R}from"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const L=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=({children:t,match:s})=>{const r=s.trim();if(!r)return e.jsx("span",{children:t});const a=L(r),n=new RegExp(`(${a})`,"gi"),l=new RegExp(`^${a}$`,"i"),c=t.split(n);return e.jsx("span",{children:c.map((i,o)=>l.test(i)?e.jsx("mark",{children:i},o):e.jsx(R.Fragment,{children:i},o))})},j=k($),y=180,x=t=>t.replace(/\s+/g," ").trim(),T=(t,s)=>{const r=x(t),a=x(s).toLowerCase();if(!a)return r;const n=r.toLowerCase().indexOf(a);if(n===-1)return r.length>y?`${r.slice(0,y-1).trimEnd()}…`:r;const l=Math.max(0,n-56),c=Math.min(r.length,n+a.length+84);let i=r.slice(l,c).trim();return l>0&&(i=`…${i}`),c<r.length&&(i=`${i}…`),i},A=t=>Array.isArray(t)?t.map(s=>{if(!s||typeof s!="object")return"";const r=s.text;return typeof r=="string"?r:""}).join(""):"",B=(t,s)=>t==="heading"?`Heading ${typeof s?.level=="number"?s.level:1}`:t==="bulletListItem"?"Bullet":t==="numberedListItem"?"Numbered":t==="checkListItem"?"Checklist":t==="quote"?"Quote":t==="codeBlock"?"Code":"Content",v=(t,s)=>{Array.isArray(t)&&t.forEach(r=>{if(!r||typeof r!="object")return;const a=typeof r.type=="string"?r.type:void 0,n=typeof r.props=="object"&&r.props?r.props:void 0,l=x(A(r.content));l&&s.push({label:B(a,n),text:l});const c=r.children;Array.isArray(c)&&v(c,s)})},C=(t,s)=>{try{const r=JSON.parse(t),a=[];if(v(r,a),a.length===0)return[];const n=x(s).toLowerCase(),l=n?a.filter(i=>i.text.toLowerCase().includes(n)):a;return(l.length>0?l:a).slice(0,2).map(i=>({...i,text:T(i.text,s)}))}catch{return[]}},P=t=>t===1?"1 result":`${t} results`,M=()=>"Open the note to inspect matching content.",z=(t,s)=>`${P(s)} for "${t}"`,I=()=>e.jsx(m,{title:"Search",variant:"default",description:e.jsx(d,{width:208,height:16,className:"rounded-full"}),children:e.jsx("main",{className:"flex flex-col gap-3",children:Array.from({length:2},(t,s)=>e.jsxs("div",{className:"surface-base flex flex-col gap-3 p-4",children:[e.jsx(d,{width:"34%",height:18,className:"rounded-full"}),e.jsx("div",{className:"rounded-[14px] bg-muted px-3 py-3",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{width:84,height:12,className:"rounded-full"}),e.jsx(d,{width:"100%",height:14,className:"mt-2 rounded-full"}),e.jsx(d,{width:"82%",height:14,className:"mt-1.5 rounded-full"})]}),e.jsxs("div",{className:"border-t border-border-subtle pt-2",children:[e.jsx(d,{width:72,height:12,className:"rounded-full"}),e.jsx(d,{width:"94%",height:14,className:"mt-2 rounded-full"})]})]})})]},s))})});function F(){const t=j.useNavigate(),{page:s,query:r}=j.useSearch(),a=r.trim(),n=10;return a?e.jsx(N,{fallback:e.jsx(I,{}),errorTitle:"Failed to load search results",errorDescription:`Retry loading results for "${a}".`,resetKeys:[a,s],children:e.jsx(b,{searchParams:{query:a,limit:n,offset:(s-1)*n,fields:["content"]},render:({notes:l,totalCount:c})=>e.jsx(m,{title:"Search",description:z(a,c),variant:"default",children:e.jsxs("main",{className:"flex flex-col gap-4",children:[l.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:l.map(i=>{const o=C(i.content,a);return e.jsxs("article",{className:"surface-base flex flex-col gap-3 p-4",children:[e.jsx(h,{as:"h2",variant:"body",weight:"semibold",tracking:"tight",children:e.jsx(w,{to:S,params:{id:i.id},className:"transition-colors hover:text-fg-default/85",children:e.jsx(g,{match:a,children:i.title||"Untitled"})})}),o.length>0?e.jsx("div",{className:"rounded-[14px] bg-muted px-3 py-3",children:e.jsx("div",{className:"flex flex-col gap-2",children:o.map((u,p)=>e.jsxs("div",{className:p>0?"border-t border-border-subtle pt-2":void 0,children:[e.jsx(h,{as:"div",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",tone:"tertiary",children:u.label}),e.jsx(h,{as:"p",variant:"meta",tone:"secondary",className:"mt-1 leading-[1.65]",children:e.jsx(g,{match:a,children:u.text})})]},`${i.id}:${u.label}:${p}`))})}):e.jsx(h,{as:"p",variant:"meta",tone:"secondary",className:"leading-[1.65]",children:M()})]},i.id)})}):e.jsx(f,{title:"No results found",description:"Try searching for a different word or phrase"}),c>n&&e.jsx(E,{page:s,last:Math.ceil(c/n),onChange:i=>{t({search:o=>({...o,page:i})})}})]})})})}):e.jsx(m,{title:"Search",description:"Search note titles and matching sections across your workspace",variant:"default",children:e.jsx("main",{children:e.jsx(f,{title:"Start searching",description:"Enter a keyword to look through note titles and matching content"})})})}export{F as default};
1
+ import{j as e}from"./note-vendor-BofYbzmZ.js";import{P as m,E as f,Q as N,x as b,T as h,L as w,N as S,l as E,j as k,y as $,i as d}from"./index-Ba2XPRI8.js";import{a as R}from"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const L=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=({children:t,match:s})=>{const r=s.trim();if(!r)return e.jsx("span",{children:t});const a=L(r),n=new RegExp(`(${a})`,"gi"),l=new RegExp(`^${a}$`,"i"),c=t.split(n);return e.jsx("span",{children:c.map((i,o)=>l.test(i)?e.jsx("mark",{children:i},o):e.jsx(R.Fragment,{children:i},o))})},j=k($),y=180,x=t=>t.replace(/\s+/g," ").trim(),T=(t,s)=>{const r=x(t),a=x(s).toLowerCase();if(!a)return r;const n=r.toLowerCase().indexOf(a);if(n===-1)return r.length>y?`${r.slice(0,y-1).trimEnd()}…`:r;const l=Math.max(0,n-56),c=Math.min(r.length,n+a.length+84);let i=r.slice(l,c).trim();return l>0&&(i=`…${i}`),c<r.length&&(i=`${i}…`),i},A=t=>Array.isArray(t)?t.map(s=>{if(!s||typeof s!="object")return"";const r=s.text;return typeof r=="string"?r:""}).join(""):"",B=(t,s)=>t==="heading"?`Heading ${typeof s?.level=="number"?s.level:1}`:t==="bulletListItem"?"Bullet":t==="numberedListItem"?"Numbered":t==="checkListItem"?"Checklist":t==="quote"?"Quote":t==="codeBlock"?"Code":"Content",v=(t,s)=>{Array.isArray(t)&&t.forEach(r=>{if(!r||typeof r!="object")return;const a=typeof r.type=="string"?r.type:void 0,n=typeof r.props=="object"&&r.props?r.props:void 0,l=x(A(r.content));l&&s.push({label:B(a,n),text:l});const c=r.children;Array.isArray(c)&&v(c,s)})},C=(t,s)=>{try{const r=JSON.parse(t),a=[];if(v(r,a),a.length===0)return[];const n=x(s).toLowerCase(),l=n?a.filter(i=>i.text.toLowerCase().includes(n)):a;return(l.length>0?l:a).slice(0,2).map(i=>({...i,text:T(i.text,s)}))}catch{return[]}},P=t=>t===1?"1 result":`${t} results`,M=()=>"Open the note to inspect matching content.",z=(t,s)=>`${P(s)} for "${t}"`,I=()=>e.jsx(m,{title:"Search",variant:"default",description:e.jsx(d,{width:208,height:16,className:"rounded-full"}),children:e.jsx("main",{className:"flex flex-col gap-3",children:Array.from({length:2},(t,s)=>e.jsxs("div",{className:"surface-base flex flex-col gap-3 p-4",children:[e.jsx(d,{width:"34%",height:18,className:"rounded-full"}),e.jsx("div",{className:"rounded-[14px] bg-muted px-3 py-3",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{width:84,height:12,className:"rounded-full"}),e.jsx(d,{width:"100%",height:14,className:"mt-2 rounded-full"}),e.jsx(d,{width:"82%",height:14,className:"mt-1.5 rounded-full"})]}),e.jsxs("div",{className:"border-t border-border-subtle pt-2",children:[e.jsx(d,{width:72,height:12,className:"rounded-full"}),e.jsx(d,{width:"94%",height:14,className:"mt-2 rounded-full"})]})]})})]},s))})});function F(){const t=j.useNavigate(),{page:s,query:r}=j.useSearch(),a=r.trim(),n=10;return a?e.jsx(N,{fallback:e.jsx(I,{}),errorTitle:"Failed to load search results",errorDescription:`Retry loading results for "${a}".`,resetKeys:[a,s],children:e.jsx(b,{searchParams:{query:a,limit:n,offset:(s-1)*n,fields:["content"]},render:({notes:l,totalCount:c})=>e.jsx(m,{title:"Search",description:z(a,c),variant:"default",children:e.jsxs("main",{className:"flex flex-col gap-4",children:[l.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:l.map(i=>{const o=C(i.content,a);return e.jsxs("article",{className:"surface-base flex flex-col gap-3 p-4",children:[e.jsx(h,{as:"h2",variant:"body",weight:"semibold",tracking:"tight",children:e.jsx(w,{to:S,params:{id:i.id},className:"transition-colors hover:text-fg-default/85",children:e.jsx(g,{match:a,children:i.title||"Untitled"})})}),o.length>0?e.jsx("div",{className:"rounded-[14px] bg-muted px-3 py-3",children:e.jsx("div",{className:"flex flex-col gap-2",children:o.map((u,p)=>e.jsxs("div",{className:p>0?"border-t border-border-subtle pt-2":void 0,children:[e.jsx(h,{as:"div",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",tone:"tertiary",children:u.label}),e.jsx(h,{as:"p",variant:"meta",tone:"secondary",className:"mt-1 leading-[1.65]",children:e.jsx(g,{match:a,children:u.text})})]},`${i.id}:${u.label}:${p}`))})}):e.jsx(h,{as:"p",variant:"meta",tone:"secondary",className:"leading-[1.65]",children:M()})]},i.id)})}):e.jsx(f,{title:"No results found",description:"Try searching for a different word or phrase"}),c>n&&e.jsx(E,{page:s,last:Math.ceil(c/n),onChange:i=>{t({search:o=>({...o,page:i})})}})]})})})}):e.jsx(m,{title:"Search",description:"Search note titles and matching sections across your workspace",variant:"default",children:e.jsx("main",{children:e.jsx(f,{title:"Start searching",description:"Enter a keyword to look through note titles and matching content"})})})}export{F as default};
@@ -1 +1 @@
1
- import{j as f}from"./note-vendor-BofYbzmZ.js";import{au as o}from"./index-BglnLSet.js";const u=o("surface-base",{variants:{tone:{default:"",elevated:"surface-elevated"},padding:{default:"p-4",compact:"px-3 py-2.5",roomy:"p-6",flush:"overflow-hidden"}},defaultVariants:{tone:"default",padding:"default"}});function i({children:a,className:e,flush:t=!1,padding:d="default",tone:s="default"}){const r=t?"flush":d;return f.jsx("div",{className:u({tone:s,padding:r,className:e}),children:a})}export{i as S};
1
+ import{j as f}from"./note-vendor-BofYbzmZ.js";import{au as o}from"./index-Ba2XPRI8.js";const u=o("surface-base",{variants:{tone:{default:"",elevated:"surface-elevated"},padding:{default:"p-4",compact:"px-3 py-2.5",roomy:"p-6",flush:"overflow-hidden"}},defaultVariants:{tone:"default",padding:"default"}});function i({children:a,className:e,flush:t=!1,padding:d="default",tone:s="default"}){const r=t?"flush":d;return f.jsx("div",{className:u({tone:s,padding:r,className:e}),children:a})}export{i as S};
@@ -1 +1 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{t as p,z as m,q as u,A as f,Q as j,P as h,F as o,L as y,G as T,T as c,l as w,E as b,i as s,j as v,H as N}from"./index-BglnLSet.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const A=a=>{const{data:t}=p({queryKey:u.tags.list(a.searchParams),async queryFn(){const i=await m({offset:a.searchParams.offset,limit:a.searchParams.limit});if(i.type==="error")throw i;return i.allTags}});return a.render(t)},R=100,G=8,P=12,x=v(N);function q(){const a=x.useNavigate(),{page:t}=x.useSearch(),{containerRef:i,limit:n}=f({minItemWidth:R,gap:G,rows:P});return e.jsx("div",{ref:i,children:e.jsx(j,{fallback:e.jsx(h,{title:"Tags",heading:e.jsx(s,{width:120,height:24,className:"rounded-full"}),description:e.jsx(s,{width:188,height:16,className:"rounded-full"}),children:e.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[e.jsx(s,{width:"90px",height:"36px"}),e.jsx(s,{width:"120px",height:"36px"}),e.jsx(s,{width:"80px",height:"36px"}),e.jsx(s,{width:"100px",height:"36px"}),e.jsx(s,{width:"110px",height:"36px"}),e.jsx(s,{width:"70px",height:"36px"})]})}),errorTitle:"Failed to load tags",errorDescription:"Retry loading the tag catalog",resetKeys:[t,n],children:e.jsx(A,{searchParams:{offset:(t-1)*n,limit:n},render:({tags:d,totalCount:l})=>e.jsx(h,{title:"Tags",heading:l>0?`Tags (${l})`:void 0,description:"Browse the tags you added with @ across your notes",children:e.jsx(o,{fallback:e.jsx(b,{title:"No tags yet",description:"Add @tags inside notes and they will appear here"}),children:d.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2.5",children:d.map(r=>e.jsxs(y,{to:T,params:{id:r.id},search:{page:1},className:"inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-hover-subtle px-3 py-1.5 text-fg-secondary transition-colors hover:border-border-secondary hover:bg-hover hover:text-fg-default",children:[e.jsx(c,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:r.name}),e.jsx(c,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"text-current/70",children:r.referenceCount})]},r.id))}),e.jsx(o,{fallback:null,children:l&&n<l&&e.jsx(w,{page:t,last:Math.ceil(l/n),onChange:r=>{a({search:g=>({...g,page:r})})}})})]})})})})})})}export{q as default};
1
+ import{j as e}from"./note-vendor-BofYbzmZ.js";import{t as p,z as m,q as u,A as f,Q as j,P as h,F as o,L as y,G as T,T as c,l as w,E as b,i as s,j as v,H as N}from"./index-Ba2XPRI8.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const A=a=>{const{data:t}=p({queryKey:u.tags.list(a.searchParams),async queryFn(){const i=await m({offset:a.searchParams.offset,limit:a.searchParams.limit});if(i.type==="error")throw i;return i.allTags}});return a.render(t)},R=100,G=8,P=12,x=v(N);function q(){const a=x.useNavigate(),{page:t}=x.useSearch(),{containerRef:i,limit:n}=f({minItemWidth:R,gap:G,rows:P});return e.jsx("div",{ref:i,children:e.jsx(j,{fallback:e.jsx(h,{title:"Tags",heading:e.jsx(s,{width:120,height:24,className:"rounded-full"}),description:e.jsx(s,{width:188,height:16,className:"rounded-full"}),children:e.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[e.jsx(s,{width:"90px",height:"36px"}),e.jsx(s,{width:"120px",height:"36px"}),e.jsx(s,{width:"80px",height:"36px"}),e.jsx(s,{width:"100px",height:"36px"}),e.jsx(s,{width:"110px",height:"36px"}),e.jsx(s,{width:"70px",height:"36px"})]})}),errorTitle:"Failed to load tags",errorDescription:"Retry loading the tag catalog",resetKeys:[t,n],children:e.jsx(A,{searchParams:{offset:(t-1)*n,limit:n},render:({tags:d,totalCount:l})=>e.jsx(h,{title:"Tags",heading:l>0?`Tags (${l})`:void 0,description:"Browse the tags you added with @ across your notes",children:e.jsx(o,{fallback:e.jsx(b,{title:"No tags yet",description:"Add @tags inside notes and they will appear here"}),children:d.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2.5",children:d.map(r=>e.jsxs(y,{to:T,params:{id:r.id},search:{page:1},className:"inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-hover-subtle px-3 py-1.5 text-fg-secondary transition-colors hover:border-border-secondary hover:bg-hover hover:text-fg-default",children:[e.jsx(c,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:r.name}),e.jsx(c,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"text-current/70",children:r.referenceCount})]},r.id))}),e.jsx(o,{fallback:null,children:l&&n<l&&e.jsx(w,{page:t,last:Math.ceil(l/n),onChange:r=>{a({search:g=>({...g,page:r})})}})})]})})})})})})}export{q as default};
@@ -1 +1 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{t as f,aa as j,q as p,a6 as y,Q as N,P as g,F as h,ab as P,l as T,E as v,i as d,j as q,G as w}from"./index-BglnLSet.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const b=s=>{const{data:r}=f({queryKey:p.notes.tagList(s.searchParams),async queryFn(){const t=await j({query:s.searchParams.query,offset:s.searchParams.offset,limit:s.searchParams.limit});if(t.type==="error")throw t;return t.tagNotes}});return s.render(r)},c=q(w);function S(){const s=c.useNavigate(),{id:r}=c.useParams(),{page:t}=c.useSearch(),i=25,{onDelete:u,onPinned:m}=y();return e.jsx(N,{fallback:e.jsx(g,{title:"Tagged Notes",heading:e.jsx(d,{width:148,height:24,className:"rounded-full"}),description:e.jsx(d,{width:196,height:16,className:"rounded-full"}),variant:"default",children:e.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[e.jsx(d,{height:"112px"}),e.jsx(d,{height:"112px"}),e.jsx(d,{height:"112px"})]})}),errorTitle:"Failed to load tagged notes",errorDescription:"Retry loading notes for this tag",resetKeys:[r,t,i],children:e.jsx(b,{searchParams:{query:r,offset:(t-1)*i,limit:i},render:({notes:o,totalCount:n})=>{const l=o.flatMap(a=>a.tags).find(a=>a.id===r)?.name;return e.jsx(g,{title:l??"Tagged Notes",heading:l?n>0?`${l} (${n})`:l:"Tagged Notes",description:"Browse every note linked to this tag",variant:"default",children:e.jsx(h,{fallback:e.jsx(v,{title:"No tagged notes yet",description:"Notes tagged with this label will appear here"}),children:o.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-5",children:o.map(a=>e.jsx(P,{...a,onPinned:()=>m(a.id,a.pinned),onDelete:()=>u(a.id)},a.id))}),e.jsx(h,{fallback:null,children:n&&i<n&&e.jsx(T,{page:t,last:Math.ceil(n/i),onChange:a=>{s({search:x=>({...x,page:a})})}})})]})})})}})})}export{S as default};
1
+ import{j as e}from"./note-vendor-BofYbzmZ.js";import{t as f,aa as j,q as p,a6 as y,Q as N,P as g,F as h,ab as P,l as T,E as v,i as d,j as q,G as w}from"./index-Ba2XPRI8.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const b=s=>{const{data:r}=f({queryKey:p.notes.tagList(s.searchParams),async queryFn(){const t=await j({query:s.searchParams.query,offset:s.searchParams.offset,limit:s.searchParams.limit});if(t.type==="error")throw t;return t.tagNotes}});return s.render(r)},c=q(w);function S(){const s=c.useNavigate(),{id:r}=c.useParams(),{page:t}=c.useSearch(),i=25,{onDelete:u,onPinned:m}=y();return e.jsx(N,{fallback:e.jsx(g,{title:"Tagged Notes",heading:e.jsx(d,{width:148,height:24,className:"rounded-full"}),description:e.jsx(d,{width:196,height:16,className:"rounded-full"}),variant:"default",children:e.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[e.jsx(d,{height:"112px"}),e.jsx(d,{height:"112px"}),e.jsx(d,{height:"112px"})]})}),errorTitle:"Failed to load tagged notes",errorDescription:"Retry loading notes for this tag",resetKeys:[r,t,i],children:e.jsx(b,{searchParams:{query:r,offset:(t-1)*i,limit:i},render:({notes:o,totalCount:n})=>{const l=o.flatMap(a=>a.tags).find(a=>a.id===r)?.name;return e.jsx(g,{title:l??"Tagged Notes",heading:l?n>0?`${l} (${n})`:l:"Tagged Notes",description:"Browse every note linked to this tag",variant:"default",children:e.jsx(h,{fallback:e.jsx(v,{title:"No tagged notes yet",description:"Notes tagged with this label will appear here"}),children:o.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-5",children:o.map(a=>e.jsx(P,{...a,onPinned:()=>m(a.id,a.pinned),onDelete:()=>u(a.id)},a.id))}),e.jsx(h,{fallback:null,children:n&&i<n&&e.jsx(T,{page:t,last:Math.ceil(n/i),onChange:a=>{s({search:x=>({...x,page:a})})}})})]})})})}})})}export{S as default};
@@ -1 +1 @@
1
- import{a}from"./graph-vendor-CUxe67Lr.js";import{p as l}from"./index-BglnLSet.js";const r=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M218.34,119.6,183.6,154.34a46.58,46.58,0,0,1-44.31,12.26c-.31.34-.62.67-.95,1L103.6,202.34A46.63,46.63,0,1,1,37.66,136.4L72.4,101.66A46.6,46.6,0,0,1,116.71,89.4c.31-.34.62-.67,1-1L152.4,53.66a46.63,46.63,0,0,1,65.94,65.94Z",opacity:"0.2"}),a.createElement("path",{d:"M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,7.78,8.22H152a8,8,0,0,0,8-7.78A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM115.7,192.49a43.31,43.31,0,0,1-55-66.43l25.37-25.37a43.35,43.35,0,0,1,61.25,0,42.9,42.9,0,0,1,9.95,15.43,8,8,0,1,1-15,5.6A27.33,27.33,0,0,0,97.37,112L72,137.37a27.32,27.32,0,0,0,34.68,41.91,8,8,0,1,1,9,13.21Zm79.61-62.55-25.37,25.37A43,43,0,0,1,139.32,168h0a43.35,43.35,0,0,1-40.53-28.12,8,8,0,1,1,15-5.6A27.35,27.35,0,0,0,139.28,152h0a27.14,27.14,0,0,0,19.32-8L184,118.63a27.32,27.32,0,0,0-34.68-41.91,8,8,0,1,1-9-13.21,43.32,43.32,0,0,1,55,66.43Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M238,88.18a52.42,52.42,0,0,1-15.4,35.66l-34.75,34.75A52.28,52.28,0,0,1,150.62,174h-.05A52.63,52.63,0,0,1,98,119.9a6,6,0,0,1,6-5.84h.17a6,6,0,0,1,5.83,6.16A40.62,40.62,0,0,0,150.58,162h0a40.4,40.4,0,0,0,28.73-11.9l34.75-34.74A40.63,40.63,0,0,0,156.63,57.9l-11,11a6,6,0,0,1-8.49-8.49l11-11a52.62,52.62,0,0,1,74.43,0A52.83,52.83,0,0,1,238,88.18Zm-127.62,98.9-11,11A40.36,40.36,0,0,1,70.6,210h0a40.63,40.63,0,0,1-28.7-69.36L76.62,105.9A40.63,40.63,0,0,1,146,135.77a6,6,0,0,0,5.83,6.16H152a6,6,0,0,0,6-5.84A52.63,52.63,0,0,0,68.14,97.42L33.38,132.16A52.63,52.63,0,0,0,70.56,222h0a52.26,52.26,0,0,0,37.22-15.42l11-11a6,6,0,1,0-8.49-8.48Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z"}))]]),m=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),a.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),n=a.forwardRef((e,t)=>a.createElement(l,{ref:t,...e,weights:r}));n.displayName="LinkIcon";const V=n,h=a.forwardRef((e,t)=>a.createElement(l,{ref:t,...e,weights:m}));h.displayName="TrashIcon";const Z=h;export{V as c,Z as n};
1
+ import{a}from"./graph-vendor-CUxe67Lr.js";import{p as l}from"./index-Ba2XPRI8.js";const r=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M218.34,119.6,183.6,154.34a46.58,46.58,0,0,1-44.31,12.26c-.31.34-.62.67-.95,1L103.6,202.34A46.63,46.63,0,1,1,37.66,136.4L72.4,101.66A46.6,46.6,0,0,1,116.71,89.4c.31-.34.62-.67,1-1L152.4,53.66a46.63,46.63,0,0,1,65.94,65.94Z",opacity:"0.2"}),a.createElement("path",{d:"M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,7.78,8.22H152a8,8,0,0,0,8-7.78A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM115.7,192.49a43.31,43.31,0,0,1-55-66.43l25.37-25.37a43.35,43.35,0,0,1,61.25,0,42.9,42.9,0,0,1,9.95,15.43,8,8,0,1,1-15,5.6A27.33,27.33,0,0,0,97.37,112L72,137.37a27.32,27.32,0,0,0,34.68,41.91,8,8,0,1,1,9,13.21Zm79.61-62.55-25.37,25.37A43,43,0,0,1,139.32,168h0a43.35,43.35,0,0,1-40.53-28.12,8,8,0,1,1,15-5.6A27.35,27.35,0,0,0,139.28,152h0a27.14,27.14,0,0,0,19.32-8L184,118.63a27.32,27.32,0,0,0-34.68-41.91,8,8,0,1,1-9-13.21,43.32,43.32,0,0,1,55,66.43Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M238,88.18a52.42,52.42,0,0,1-15.4,35.66l-34.75,34.75A52.28,52.28,0,0,1,150.62,174h-.05A52.63,52.63,0,0,1,98,119.9a6,6,0,0,1,6-5.84h.17a6,6,0,0,1,5.83,6.16A40.62,40.62,0,0,0,150.58,162h0a40.4,40.4,0,0,0,28.73-11.9l34.75-34.74A40.63,40.63,0,0,0,156.63,57.9l-11,11a6,6,0,0,1-8.49-8.49l11-11a52.62,52.62,0,0,1,74.43,0A52.83,52.83,0,0,1,238,88.18Zm-127.62,98.9-11,11A40.36,40.36,0,0,1,70.6,210h0a40.63,40.63,0,0,1-28.7-69.36L76.62,105.9A40.63,40.63,0,0,1,146,135.77a6,6,0,0,0,5.83,6.16H152a6,6,0,0,0,6-5.84A52.63,52.63,0,0,0,68.14,97.42L33.38,132.16A52.63,52.63,0,0,0,70.56,222h0a52.26,52.26,0,0,0,37.22-15.42l11-11a6,6,0,1,0-8.49-8.48Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z"}))]]),m=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),a.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),n=a.forwardRef((e,t)=>a.createElement(l,{ref:t,...e,weights:r}));n.displayName="LinkIcon";const V=n,h=a.forwardRef((e,t)=>a.createElement(l,{ref:t,...e,weights:m}));h.displayName="TrashIcon";const Z=h;export{V as c,Z as n};
@@ -1,4 +1,4 @@
1
- import{h as t,ag as n}from"./index-BglnLSet.js";function o({limit:a=50,offset:e=0}={}){return t(`query FetchImages($pagination: PaginationInput) {
1
+ import{h as t,ag as n}from"./index-Ba2XPRI8.js";function o({limit:a=50,offset:e=0}={}){return t(`query FetchImages($pagination: PaginationInput) {
2
2
  allImages(pagination: $pagination) {
3
3
  totalCount
4
4
  images {