ocean-brain 0.3.2 → 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 (50) hide show
  1. package/dist/mcp.js +153 -39
  2. package/package.json +1 -1
  3. package/server/client/dist/assets/Calendar-Kjy1PX6L.js +25 -0
  4. package/server/client/dist/assets/Graph-Bl5K2qUw.js +1 -0
  5. package/server/client/dist/assets/{Image.es-Dnn4SMzG.js → Image.es-BQfyKc2-.js} +1 -1
  6. package/server/client/dist/assets/{ModalActionRow-B3vNjcDc.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-BK-Uv9Ps.js +1 -0
  10. package/server/client/dist/assets/Search-ClHeWvmI.js +1 -0
  11. package/server/client/dist/assets/SurfaceCard-nZNf9lyE.js +1 -0
  12. package/server/client/dist/assets/Tag-Dph4V_kl.js +1 -0
  13. package/server/client/dist/assets/TagNotes-CxP5qHZj.js +1 -0
  14. package/server/client/dist/assets/{Trash.es-DLiHgjNo.js → Trash.es-BGoN5q9L.js} +1 -1
  15. package/server/client/dist/assets/{image.api-CjJgNbC0.js → image.api-0mMkElZk.js} +1 -1
  16. package/server/client/dist/assets/index-6lIw6jYW.js +1 -0
  17. package/server/client/dist/assets/index-Ba2XPRI8.js +205 -0
  18. package/server/client/dist/assets/index-DL7pUwq2.css +1 -0
  19. package/server/client/dist/assets/manage-image-Br_kKxbb.js +1 -0
  20. package/server/client/dist/assets/manage-image-detail-9DzqbiqI.js +1 -0
  21. package/server/client/dist/assets/mcp-C_So91eX.js +1 -0
  22. package/server/client/dist/assets/placeholder-i-uNe71U.js +34 -0
  23. package/server/client/dist/assets/trash-Cg3nJ1m5.js +1 -0
  24. package/server/client/dist/assets/useReminderMutate-tNMwwRnx.js +82 -0
  25. package/server/client/dist/index.html +2 -2
  26. package/server/dist/modules/blocknote.js +181 -35
  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/Calendar-DynpmB3D.js +0 -25
  33. package/server/client/dist/assets/Callout-tNHgPhLM.js +0 -1
  34. package/server/client/dist/assets/Graph-DMXLUfCv.js +0 -1
  35. package/server/client/dist/assets/Note-PDMuj62M.js +0 -1
  36. package/server/client/dist/assets/Note-PEevDKBh.css +0 -1
  37. package/server/client/dist/assets/Reminders-ComtTLuN.js +0 -1
  38. package/server/client/dist/assets/Search-BJeZTbVu.js +0 -1
  39. package/server/client/dist/assets/SurfaceCard-DAcVMY4f.js +0 -1
  40. package/server/client/dist/assets/Tag-BuNCDGD5.js +0 -1
  41. package/server/client/dist/assets/TagNotes-ajFOP5pZ.js +0 -1
  42. package/server/client/dist/assets/index-CDrZmLC2.js +0 -1
  43. package/server/client/dist/assets/index-DAZMX8bQ.css +0 -1
  44. package/server/client/dist/assets/index-DqFkOWbi.js +0 -205
  45. package/server/client/dist/assets/manage-image-CVyZTDT_.js +0 -1
  46. package/server/client/dist/assets/manage-image-detail-Bp17tylS.js +0 -1
  47. package/server/client/dist/assets/mcp-BpD7VH-d.js +0 -1
  48. package/server/client/dist/assets/placeholder-DSf4QF4v.js +0 -34
  49. package/server/client/dist/assets/trash-Ceb17h_s.js +0 -1
  50. package/server/client/dist/assets/useReminderMutate-CzyOQ_VB.js +0 -82
@@ -15,6 +15,7 @@ import {
15
15
  restoreTrashedNoteById,
16
16
  trashNoteById
17
17
  } from "../../modules/note-trash.js";
18
+ import { buildNoteTagNamesWhere, normalizeNoteTagNames } from "../../modules/note-tag-filter.js";
18
19
  const noteType = gql`
19
20
  input PaginationInput {
20
21
  limit: Int!
@@ -39,6 +40,11 @@ const noteType = gql`
39
40
  full
40
41
  }
41
42
 
43
+ enum TagMatchMode {
44
+ and
45
+ or
46
+ }
47
+
42
48
  input NoteInput {
43
49
  title: String
44
50
  content: String
@@ -156,6 +162,7 @@ const noteQuery = gql`
156
162
  type Query {
157
163
  allNotes(searchFilter: SearchFilterInput, pagination: PaginationInput): Notes!
158
164
  tagNotes(searchFilter: SearchFilterInput, pagination: PaginationInput): Notes!
165
+ notesByTagNames(tagNames: [String!]!, mode: TagMatchMode!, pagination: PaginationInput): Notes!
159
166
  notesInDateRange(dateRange: DateRangeInput): [Note!]!
160
167
  pinnedNotes: [Note!]!
161
168
  imageNotes(src: String!): [Note!]!
@@ -292,6 +299,30 @@ const noteResolvers = {
292
299
  notes: $notes
293
300
  };
294
301
  },
302
+ notesByTagNames: async (_, {
303
+ tagNames,
304
+ mode,
305
+ pagination
306
+ }) => {
307
+ const normalizedTagNames = normalizeNoteTagNames(tagNames);
308
+ if (normalizedTagNames.length === 0) {
309
+ return {
310
+ totalCount: 0,
311
+ notes: []
312
+ };
313
+ }
314
+ const where = buildNoteTagNamesWhere(normalizedTagNames, mode);
315
+ const $notes = models.note.findMany({
316
+ orderBy: { updatedAt: "desc" },
317
+ where,
318
+ take: Number(pagination.limit),
319
+ skip: Number(pagination.offset)
320
+ });
321
+ return {
322
+ totalCount: models.note.count({ where }),
323
+ notes: $notes
324
+ };
325
+ },
295
326
  pinnedNotes: async () => models.note.findMany({
296
327
  orderBy: [
297
328
  { order: "asc" },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/schema/note/index.ts"],"sourcesContent":["import type { IResolvers } from '@graphql-tools/utils';\nimport type { Request } from 'express';\n\nimport models from '~/models.js';\nimport { gql } from '~/modules/graphql.js';\nimport {\n getNoteCleanupPreview,\n listNoteCleanupCandidates\n} from '~/modules/note-cleanup.js';\nimport {\n captureNoteBaseline,\n createSnapshotMetaFromUserAgent,\n listNoteSnapshots,\n restoreNoteSnapshot\n} from '~/modules/note-snapshot.js';\nimport {\n listTrashedNotes,\n restoreTrashedNoteById,\n trashNoteById\n} from '~/modules/note-trash.js';\n\nimport type { Note, Prisma } from '~/models.js';\nimport type { Pagination, SearchFilter, NoteInput } from '~/types/index.js';\n\nexport const noteType = gql`\n input PaginationInput {\n limit: Int!\n offset: Int!\n }\n\n input SearchFilterInput {\n query: String!\n sortBy: String\n sortOrder: String\n pinnedFirst: Boolean\n }\n\n input DateRangeInput {\n start: String!\n end: String!\n }\n\n enum NoteLayout {\n narrow\n wide\n full\n }\n\n input NoteInput {\n title: String\n content: String\n layout: NoteLayout\n }\n\n input NoteOrderInput {\n id: ID!\n order: Int!\n }\n\n type Tag {\n id: ID!\n name: String!\n createdAt: String!\n updatedAt: String!\n }\n\n type Note {\n id: ID!\n title: String!\n content: String!\n contentAsMarkdown: String!\n createdAt: String!\n updatedAt: String!\n pinned: Boolean!\n order: Int!\n layout: NoteLayout!\n tags: [Tag!]!\n }\n\n type Notes {\n totalCount: Int!\n notes: [Note!]!\n }\n\n type NoteCleanupBackReference {\n id: ID!\n title: String!\n }\n\n type NoteCleanupCandidate {\n id: ID!\n title: String!\n updatedAt: String!\n pinned: Boolean!\n tagNames: [String!]!\n reminderCount: Int!\n backReferenceCount: Int!\n matchedTerms: [String!]!\n reasons: [String!]!\n requiresForce: Boolean!\n forceReasons: [String!]!\n }\n\n type NoteCleanupPreview {\n id: ID!\n title: String!\n updatedAt: String!\n pinned: Boolean!\n tagNames: [String!]!\n reminderCount: Int!\n backReferences: [NoteCleanupBackReference!]!\n orphanedTagNames: [String!]!\n requiresForce: Boolean!\n forceReasons: [String!]!\n }\n\n type NoteSnapshotMeta {\n entrypoint: String\n label: String\n }\n\n type NoteSnapshot {\n id: ID!\n title: String!\n createdAt: String!\n meta: NoteSnapshotMeta!\n }\n\n type DeletedNote {\n id: ID!\n title: String!\n createdAt: String!\n updatedAt: String!\n deletedAt: String!\n pinned: Boolean!\n order: Int!\n layout: NoteLayout!\n tagNames: [String!]!\n }\n\n type DeletedNotes {\n totalCount: Int!\n notes: [DeletedNote!]!\n }\n`;\n\nexport const noteQuery = gql`\n type GraphNode {\n id: ID!\n title: String!\n connections: Int!\n }\n\n type GraphLink {\n source: ID!\n target: ID!\n }\n\n type NoteGraph {\n nodes: [GraphNode!]!\n links: [GraphLink!]!\n }\n\n type Query {\n allNotes(searchFilter: SearchFilterInput, pagination: PaginationInput): Notes!\n tagNotes(searchFilter: SearchFilterInput, pagination: PaginationInput): Notes!\n notesInDateRange(dateRange: DateRangeInput): [Note!]!\n pinnedNotes: [Note!]!\n imageNotes(src: String!): [Note!]!\n backReferences(id: ID!): [Note]!\n note(id: ID!): Note!\n noteCleanupCandidates(query: String, pagination: PaginationInput): [NoteCleanupCandidate!]!\n noteCleanupPreview(id: ID!): NoteCleanupPreview\n noteSnapshots(id: ID!, limit: Int): [NoteSnapshot!]!\n trashedNotes(pagination: PaginationInput): DeletedNotes!\n noteGraph: NoteGraph!\n }\n`;\n\nexport const noteMutation = gql`\n type Mutation {\n createNote(note: NoteInput!): Note!\n updateNote(id: ID!, note: NoteInput!, editSessionId: String): Note!\n deleteNote(id: ID!): Boolean!\n restoreNoteSnapshot(id: ID!): Note!\n restoreTrashedNote(id: ID!): Note!\n pinNote(id: ID!, pinned: Boolean!): Note!\n reorderNotes(notes: [NoteOrderInput!]!): [Note!]!\n }\n`;\n\nexport const noteTypeDefs = `\n ${noteType}\n ${noteQuery}\n ${noteMutation}\n`;\n\ninterface BlockNote<T = unknown> {\n id: string;\n type: string;\n props: T;\n content?: BlockNote<T>[];\n children?: BlockNote<T>[];\n}\n\nconst extractBlocksByType = <T>(type: string, dataArray: BlockNote[]): BlockNote<T>[] => {\n let result: BlockNote[] = [];\n\n for (const data of dataArray) {\n if (data.type === type) {\n result.push(data);\n }\n\n if (data.children && data.children.length > 0) {\n result = result.concat(extractBlocksByType(type, data.children));\n }\n\n if (data.content && data.content.length > 0) {\n for (const contentItem of data.content) {\n if (contentItem.type === type) {\n result.push(contentItem);\n }\n }\n }\n }\n\n return result as unknown as BlockNote<T>[];\n};\n\nexport const noteResolvers: IResolvers = {\n Query: {\n allNotes: async (_, {\n searchFilter,\n pagination\n }: {\n searchFilter: SearchFilter;\n pagination: Pagination;\n }) => {\n const queryItems = searchFilter.query.split(' ');\n const included = queryItems\n .filter((item: string) => !item.startsWith('-'))\n .map((word: string) => `%${word}%`);\n const excluded = queryItems\n .filter((item: string) => item.startsWith('-'))\n .map((item: string) => item.slice(1))\n .map((word: string) => `%${word}%`);\n\n const where: Prisma.NoteWhereInput = {\n AND: [\n ...included.map((keyword: string) => ({\n OR: [\n { title: { contains: keyword } },\n { content: { contains: keyword } }\n ]\n })),\n ...excluded.map((keyword: string) => ({\n NOT: {\n OR: [\n { title: { contains: keyword } },\n { content: { contains: keyword } }\n ]\n }\n }))\n ]\n };\n\n const sortBy = searchFilter.sortBy || 'updatedAt';\n const sortOrder = searchFilter.sortOrder || 'desc';\n const pinnedFirst = searchFilter.pinnedFirst || false;\n\n const orderBy: Prisma.NoteOrderByWithRelationInput[] = [];\n\n if (pinnedFirst) {\n orderBy.push({ pinned: 'desc' });\n }\n\n if (sortBy === 'createdAt') {\n orderBy.push({ createdAt: sortOrder as 'asc' | 'desc' });\n } else {\n orderBy.push({ updatedAt: sortOrder as 'asc' | 'desc' });\n }\n\n const $notes = models.note.findMany({\n orderBy,\n where,\n take: Number(pagination.limit),\n skip: Number(pagination.offset)\n });\n return {\n totalCount: models.note.count({ where }),\n notes: $notes\n };\n },\n notesInDateRange: async (_, { dateRange }: {\n dateRange: {\n start: string;\n end: string;\n };\n }) => {\n const where: Prisma.NoteWhereInput = {\n OR: [\n {\n updatedAt: {\n gte: new Date(dateRange.start),\n lte: new Date(dateRange.end)\n }\n },\n {\n createdAt: {\n gte: new Date(dateRange.start),\n lte: new Date(dateRange.end)\n }\n }\n ]\n };\n\n const $notes = await models.note.findMany({\n orderBy: { createdAt: 'asc' },\n where\n });\n\n return $notes;\n },\n tagNotes: async (_, {\n searchFilter,\n pagination\n }: {\n searchFilter: SearchFilter;\n pagination: Pagination;\n }) => {\n const where: Prisma.NoteWhereInput = { tags: { some: { id: Number(searchFilter.query) } } };\n\n const $notes = models.note.findMany({\n orderBy: { updatedAt: 'desc' },\n where,\n take: Number(pagination.limit),\n skip: Number(pagination.offset)\n });\n return {\n totalCount: models.note.count({ where }),\n notes: $notes\n };\n },\n pinnedNotes: async () => models.note.findMany({\n orderBy: [\n { order: 'asc' },\n { updatedAt: 'desc' }\n ],\n where: { pinned: true }\n }),\n imageNotes: async (_, { src }) => models.note.findMany({\n orderBy: { updatedAt: 'desc' },\n where: { content: { contains: src } }\n }),\n backReferences: async (_, { id }: Note) => {\n return models.note.findMany({\n orderBy: [\n { pinned: 'desc' },\n { updatedAt: 'desc' }\n ],\n where: { content: { contains: `reference\",\"props\":{\"id\":\"${id}\"` } }\n });\n },\n note: async (_, { id }: Note) => {\n const $note = await models.note.findUnique({ where: { id: Number(id) } });\n if (!$note) {\n throw 'NOT FOUND';\n }\n if ($note.content) {\n const blocks = extractBlocksByType<{\n id: string;\n title: string;\n }>('reference', JSON.parse($note.content));\n if (blocks.length > 0) {\n const referenceIds = blocks.map(block => Number(block.props.id));\n const $references = await models.note.findMany({ where: { id: { in: referenceIds } } });\n const newContent = $references.reduce<string>((acc: string, $reference: Note) => {\n const reference = blocks.find(block => Number(block.props.id) === $reference.id);\n if (reference && reference.props.title !== $reference.title) {\n return acc.replace(\n `reference\",\"props\":{\"id\":\"${reference.props.id}\",\"title\":\"${reference.props.title}\"`,\n `reference\",\"props\":{\"id\":\"${$reference.id}\",\"title\":\"${$reference.title}\"`\n );\n }\n return acc;\n }, $note.content);\n if (newContent !== $note.content) {\n try {\n JSON.parse(newContent);\n return await models.note.update({\n where: { id: $note.id },\n data: { content: newContent }\n });\n } catch {\n // Keep the stored content unchanged if the synchronized payload becomes invalid.\n }\n }\n }\n }\n return $note;\n },\n noteCleanupCandidates: async (_, {\n query,\n pagination = {\n limit: 20,\n offset: 0\n }\n }: {\n query?: string;\n pagination: Pagination;\n }) => {\n const result = await listNoteCleanupCandidates({\n keywords: query\n ? query.split(/[,\\s]+/).map((keyword) => keyword.trim()).filter(Boolean)\n : undefined,\n limit: Number(pagination.limit),\n offset: Number(pagination.offset)\n });\n\n return result.notes;\n },\n noteCleanupPreview: async (_, { id }: { id: string }) => {\n return getNoteCleanupPreview(Number(id));\n },\n noteSnapshots: async (_, {\n id,\n limit = 5\n }: {\n id: string;\n limit?: number;\n }) => {\n return listNoteSnapshots(Number(id), Number(limit));\n },\n trashedNotes: async (_, {\n pagination = {\n limit: 25,\n offset: 0\n }\n }: {\n pagination: Pagination;\n }) => {\n return listTrashedNotes({\n limit: Number(pagination.limit),\n offset: Number(pagination.offset)\n });\n },\n noteGraph: async () => {\n const $notes = await models.note.findMany({\n select: {\n id: true,\n title: true,\n content: true\n }\n });\n\n const nodes: Array<{ id: string; title: string; connections: number }> = [];\n const links: Array<{ source: string; target: string }> = [];\n const connectionCount: Record<string, number> = {};\n const linkSet = new Set<string>();\n\n // Extract all references from each note\n for (const $note of $notes) {\n if ($note.content) {\n try {\n const blocks = extractBlocksByType<{ id: string }>('reference', JSON.parse($note.content));\n for (const block of blocks) {\n const targetId = block.props.id;\n // Avoid self-references and duplicate links\n if (targetId && String($note.id) !== targetId) {\n const linkKey = `${$note.id}-${targetId}`;\n const reverseLinkKey = `${targetId}-${$note.id}`;\n if (!linkSet.has(linkKey) && !linkSet.has(reverseLinkKey)) {\n linkSet.add(linkKey);\n links.push({\n source: String($note.id),\n target: targetId\n });\n // Count connections for both nodes\n connectionCount[String($note.id)] = (connectionCount[String($note.id)] || 0) + 1;\n connectionCount[targetId] = (connectionCount[targetId] || 0) + 1;\n }\n }\n }\n } catch {\n // Skip notes with invalid JSON content\n }\n }\n }\n\n // Build nodes array with connection counts\n for (const $note of $notes) {\n nodes.push({\n id: String($note.id),\n title: $note.title || 'Untitled',\n connections: connectionCount[String($note.id)] || 0\n });\n }\n\n return {\n nodes,\n links\n };\n }\n },\n Mutation: {\n createNote: async (_, { note }: { note: NoteInput }) => {\n const PLACEHOLDER_PREFIX = '{%';\n const PLACEHOLDER_SUFFIX = '%}';\n\n const replacePlaceholder = async (content: string) => {\n const placeholders = content.matchAll(new RegExp(`${PLACEHOLDER_PREFIX}([^}]+)${PLACEHOLDER_SUFFIX}`, 'g'));\n const $placeholders = await models.placeholder.findMany({\n select: {\n template: true,\n replacement: true\n },\n where: { template: { in: Array.from(new Set(Array.from(placeholders, p => p[1]))) } }\n });\n\n for (const $placeholder of $placeholders) {\n content = content.replace(new RegExp(`${PLACEHOLDER_PREFIX}${$placeholder.template}${PLACEHOLDER_SUFFIX}`, 'g'), $placeholder.replacement);\n }\n return content;\n };\n\n const replacedTitle = await replacePlaceholder(note.title);\n const replacedContent = await replacePlaceholder(note.content);\n\n const $note = await models.note.create({\n data: {\n title: replacedTitle,\n content: replacedContent,\n ...(note.layout && { layout: note.layout })\n }\n });\n if (note.content) {\n const blocks = extractBlocksByType<{ id: string }>(\n 'tag',\n JSON.parse(note.content)\n );\n\n return await models.note.update({\n where: { id: $note.id },\n data: { tags: { set: blocks.map(block => ({ id: Number(block.props.id) })) } }\n });\n }\n\n return $note;\n },\n updateNote: async (_, {\n id,\n note,\n editSessionId\n }: {\n id: number;\n note: NoteInput;\n editSessionId?: string;\n }, context: {\n req?: Request;\n }) => {\n const userAgentHeader = context.req?.headers['user-agent'];\n const userAgent = Array.isArray(userAgentHeader) ? userAgentHeader[0] : userAgentHeader;\n let blocks: BlockNote<{ id: string }>[] = [];\n\n if (note.content) {\n blocks = extractBlocksByType<{ id: string }>(\n 'tag',\n JSON.parse(note.content)\n );\n }\n\n await captureNoteBaseline({\n noteId: Number(id),\n ...(editSessionId ? { editSessionId } : {}),\n meta: createSnapshotMetaFromUserAgent(userAgent)\n });\n\n const $note = await models.note.update({\n where: { id: Number(id) },\n data: {\n ...note,\n ...(note.content ? { tags: { set: blocks.map(block => ({ id: Number(block.props.id) })) } } : {})\n }\n });\n return $note;\n },\n deleteNote: async (_, { id }: Note) => {\n const trashedNote = await trashNoteById(Number(id));\n\n if (!trashedNote) {\n throw 'NOT FOUND';\n }\n\n return true;\n },\n restoreNoteSnapshot: async (_, { id }: { id: string }, context: {\n req?: Request;\n }) => {\n const userAgentHeader = context.req?.headers['user-agent'];\n const userAgent = Array.isArray(userAgentHeader) ? userAgentHeader[0] : userAgentHeader;\n const note = await restoreNoteSnapshot(Number(id), { meta: createSnapshotMetaFromUserAgent(userAgent) });\n\n if (!note) {\n throw 'NOT FOUND';\n }\n\n return note;\n },\n restoreTrashedNote: async (_, { id }: { id: string }) => {\n const note = await restoreTrashedNoteById(Number(id));\n\n if (!note) {\n throw 'NOT FOUND';\n }\n\n return note;\n },\n pinNote: (_, { id, pinned }: Note) => models.note.update({\n where: { id: Number(id) },\n data: { pinned: Boolean(pinned) }\n }),\n reorderNotes: async (_, { notes }: { notes: Array<{ id: string; order: number }> }) => {\n const updatePromises = notes.map(({ id, order }) =>\n models.note.update({\n where: { id: Number(id) },\n data: { order }\n })\n );\n return await Promise.all(updatePromises);\n }\n },\n Note: {\n tags: async (note: Note) => await models.tag.findMany({ where: { notes: { some: { id: note.id } } } }),\n contentAsMarkdown: async (note: Note) => {\n const { blocksToMarkdown } = await import('~/modules/blocknote.js');\n return blocksToMarkdown(note.content);\n }\n }\n};\n"],"mappings":"AAGA,OAAO,YAAY;AACnB,SAAS,WAAW;AACpB;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAKA,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC;AAAA,IACrG,mBAAmB,OAAO,SAAe;AACrC,YAAM,EAAE,iBAAiB,IAAI,MAAM,OAAO,wBAAwB;AAClE,aAAO,iBAAiB,KAAK,OAAO;AAAA,IACxC;AAAA,EACJ;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/schema/note/index.ts"],"sourcesContent":["import type { IResolvers } from '@graphql-tools/utils';\nimport type { Request } from 'express';\n\nimport models from '~/models.js';\nimport { gql } from '~/modules/graphql.js';\nimport {\n getNoteCleanupPreview,\n listNoteCleanupCandidates\n} from '~/modules/note-cleanup.js';\nimport {\n captureNoteBaseline,\n createSnapshotMetaFromUserAgent,\n listNoteSnapshots,\n restoreNoteSnapshot\n} from '~/modules/note-snapshot.js';\nimport {\n listTrashedNotes,\n restoreTrashedNoteById,\n trashNoteById\n} from '~/modules/note-trash.js';\nimport { buildNoteTagNamesWhere, normalizeNoteTagNames, type NoteTagMatchMode } from '~/modules/note-tag-filter.js';\n\nimport type { Note, Prisma } from '~/models.js';\nimport type { Pagination, SearchFilter, NoteInput } from '~/types/index.js';\n\nexport const noteType = gql`\n input PaginationInput {\n limit: Int!\n offset: Int!\n }\n\n input SearchFilterInput {\n query: String!\n sortBy: String\n sortOrder: String\n pinnedFirst: Boolean\n }\n\n input DateRangeInput {\n start: String!\n end: String!\n }\n\n enum NoteLayout {\n narrow\n wide\n full\n }\n\n enum TagMatchMode {\n and\n or\n }\n\n input NoteInput {\n title: String\n content: String\n layout: NoteLayout\n }\n\n input NoteOrderInput {\n id: ID!\n order: Int!\n }\n\n type Tag {\n id: ID!\n name: String!\n createdAt: String!\n updatedAt: String!\n }\n\n type Note {\n id: ID!\n title: String!\n content: String!\n contentAsMarkdown: String!\n createdAt: String!\n updatedAt: String!\n pinned: Boolean!\n order: Int!\n layout: NoteLayout!\n tags: [Tag!]!\n }\n\n type Notes {\n totalCount: Int!\n notes: [Note!]!\n }\n\n type NoteCleanupBackReference {\n id: ID!\n title: String!\n }\n\n type NoteCleanupCandidate {\n id: ID!\n title: String!\n updatedAt: String!\n pinned: Boolean!\n tagNames: [String!]!\n reminderCount: Int!\n backReferenceCount: Int!\n matchedTerms: [String!]!\n reasons: [String!]!\n requiresForce: Boolean!\n forceReasons: [String!]!\n }\n\n type NoteCleanupPreview {\n id: ID!\n title: String!\n updatedAt: String!\n pinned: Boolean!\n tagNames: [String!]!\n reminderCount: Int!\n backReferences: [NoteCleanupBackReference!]!\n orphanedTagNames: [String!]!\n requiresForce: Boolean!\n forceReasons: [String!]!\n }\n\n type NoteSnapshotMeta {\n entrypoint: String\n label: String\n }\n\n type NoteSnapshot {\n id: ID!\n title: String!\n createdAt: String!\n meta: NoteSnapshotMeta!\n }\n\n type DeletedNote {\n id: ID!\n title: String!\n createdAt: String!\n updatedAt: String!\n deletedAt: String!\n pinned: Boolean!\n order: Int!\n layout: NoteLayout!\n tagNames: [String!]!\n }\n\n type DeletedNotes {\n totalCount: Int!\n notes: [DeletedNote!]!\n }\n`;\n\nexport const noteQuery = gql`\n type GraphNode {\n id: ID!\n title: String!\n connections: Int!\n }\n\n type GraphLink {\n source: ID!\n target: ID!\n }\n\n type NoteGraph {\n nodes: [GraphNode!]!\n links: [GraphLink!]!\n }\n\n type Query {\n allNotes(searchFilter: SearchFilterInput, pagination: PaginationInput): Notes!\n tagNotes(searchFilter: SearchFilterInput, pagination: PaginationInput): Notes!\n notesByTagNames(tagNames: [String!]!, mode: TagMatchMode!, pagination: PaginationInput): Notes!\n notesInDateRange(dateRange: DateRangeInput): [Note!]!\n pinnedNotes: [Note!]!\n imageNotes(src: String!): [Note!]!\n backReferences(id: ID!): [Note]!\n note(id: ID!): Note!\n noteCleanupCandidates(query: String, pagination: PaginationInput): [NoteCleanupCandidate!]!\n noteCleanupPreview(id: ID!): NoteCleanupPreview\n noteSnapshots(id: ID!, limit: Int): [NoteSnapshot!]!\n trashedNotes(pagination: PaginationInput): DeletedNotes!\n noteGraph: NoteGraph!\n }\n`;\n\nexport const noteMutation = gql`\n type Mutation {\n createNote(note: NoteInput!): Note!\n updateNote(id: ID!, note: NoteInput!, editSessionId: String): Note!\n deleteNote(id: ID!): Boolean!\n restoreNoteSnapshot(id: ID!): Note!\n restoreTrashedNote(id: ID!): Note!\n pinNote(id: ID!, pinned: Boolean!): Note!\n reorderNotes(notes: [NoteOrderInput!]!): [Note!]!\n }\n`;\n\nexport const noteTypeDefs = `\n ${noteType}\n ${noteQuery}\n ${noteMutation}\n`;\n\ninterface BlockNote<T = unknown> {\n id: string;\n type: string;\n props: T;\n content?: BlockNote<T>[];\n children?: BlockNote<T>[];\n}\n\nconst extractBlocksByType = <T>(type: string, dataArray: BlockNote[]): BlockNote<T>[] => {\n let result: BlockNote[] = [];\n\n for (const data of dataArray) {\n if (data.type === type) {\n result.push(data);\n }\n\n if (data.children && data.children.length > 0) {\n result = result.concat(extractBlocksByType(type, data.children));\n }\n\n if (data.content && data.content.length > 0) {\n for (const contentItem of data.content) {\n if (contentItem.type === type) {\n result.push(contentItem);\n }\n }\n }\n }\n\n return result as unknown as BlockNote<T>[];\n};\n\nexport const noteResolvers: IResolvers = {\n Query: {\n allNotes: async (_, {\n searchFilter,\n pagination\n }: {\n searchFilter: SearchFilter;\n pagination: Pagination;\n }) => {\n const queryItems = searchFilter.query.split(' ');\n const included = queryItems\n .filter((item: string) => !item.startsWith('-'))\n .map((word: string) => `%${word}%`);\n const excluded = queryItems\n .filter((item: string) => item.startsWith('-'))\n .map((item: string) => item.slice(1))\n .map((word: string) => `%${word}%`);\n\n const where: Prisma.NoteWhereInput = {\n AND: [\n ...included.map((keyword: string) => ({\n OR: [\n { title: { contains: keyword } },\n { content: { contains: keyword } }\n ]\n })),\n ...excluded.map((keyword: string) => ({\n NOT: {\n OR: [\n { title: { contains: keyword } },\n { content: { contains: keyword } }\n ]\n }\n }))\n ]\n };\n\n const sortBy = searchFilter.sortBy || 'updatedAt';\n const sortOrder = searchFilter.sortOrder || 'desc';\n const pinnedFirst = searchFilter.pinnedFirst || false;\n\n const orderBy: Prisma.NoteOrderByWithRelationInput[] = [];\n\n if (pinnedFirst) {\n orderBy.push({ pinned: 'desc' });\n }\n\n if (sortBy === 'createdAt') {\n orderBy.push({ createdAt: sortOrder as 'asc' | 'desc' });\n } else {\n orderBy.push({ updatedAt: sortOrder as 'asc' | 'desc' });\n }\n\n const $notes = models.note.findMany({\n orderBy,\n where,\n take: Number(pagination.limit),\n skip: Number(pagination.offset)\n });\n return {\n totalCount: models.note.count({ where }),\n notes: $notes\n };\n },\n notesInDateRange: async (_, { dateRange }: {\n dateRange: {\n start: string;\n end: string;\n };\n }) => {\n const where: Prisma.NoteWhereInput = {\n OR: [\n {\n updatedAt: {\n gte: new Date(dateRange.start),\n lte: new Date(dateRange.end)\n }\n },\n {\n createdAt: {\n gte: new Date(dateRange.start),\n lte: new Date(dateRange.end)\n }\n }\n ]\n };\n\n const $notes = await models.note.findMany({\n orderBy: { createdAt: 'asc' },\n where\n });\n\n return $notes;\n },\n tagNotes: async (_, {\n searchFilter,\n pagination\n }: {\n searchFilter: SearchFilter;\n pagination: Pagination;\n }) => {\n const where: Prisma.NoteWhereInput = { tags: { some: { id: Number(searchFilter.query) } } };\n\n const $notes = models.note.findMany({\n orderBy: { updatedAt: 'desc' },\n where,\n take: Number(pagination.limit),\n skip: Number(pagination.offset)\n });\n return {\n totalCount: models.note.count({ where }),\n notes: $notes\n };\n },\n notesByTagNames: async (_, {\n tagNames,\n mode,\n pagination\n }: {\n tagNames: string[];\n mode: NoteTagMatchMode;\n pagination: Pagination;\n }) => {\n const normalizedTagNames = normalizeNoteTagNames(tagNames);\n\n if (normalizedTagNames.length === 0) {\n return {\n totalCount: 0,\n notes: []\n };\n }\n\n const where = buildNoteTagNamesWhere(normalizedTagNames, mode);\n\n const $notes = models.note.findMany({\n orderBy: { updatedAt: 'desc' },\n where,\n take: Number(pagination.limit),\n skip: Number(pagination.offset)\n });\n\n return {\n totalCount: models.note.count({ where }),\n notes: $notes\n };\n },\n pinnedNotes: async () => models.note.findMany({\n orderBy: [\n { order: 'asc' },\n { updatedAt: 'desc' }\n ],\n where: { pinned: true }\n }),\n imageNotes: async (_, { src }) => models.note.findMany({\n orderBy: { updatedAt: 'desc' },\n where: { content: { contains: src } }\n }),\n backReferences: async (_, { id }: Note) => {\n return models.note.findMany({\n orderBy: [\n { pinned: 'desc' },\n { updatedAt: 'desc' }\n ],\n where: { content: { contains: `reference\",\"props\":{\"id\":\"${id}\"` } }\n });\n },\n note: async (_, { id }: Note) => {\n const $note = await models.note.findUnique({ where: { id: Number(id) } });\n if (!$note) {\n throw 'NOT FOUND';\n }\n if ($note.content) {\n const blocks = extractBlocksByType<{\n id: string;\n title: string;\n }>('reference', JSON.parse($note.content));\n if (blocks.length > 0) {\n const referenceIds = blocks.map(block => Number(block.props.id));\n const $references = await models.note.findMany({ where: { id: { in: referenceIds } } });\n const newContent = $references.reduce<string>((acc: string, $reference: Note) => {\n const reference = blocks.find(block => Number(block.props.id) === $reference.id);\n if (reference && reference.props.title !== $reference.title) {\n return acc.replace(\n `reference\",\"props\":{\"id\":\"${reference.props.id}\",\"title\":\"${reference.props.title}\"`,\n `reference\",\"props\":{\"id\":\"${$reference.id}\",\"title\":\"${$reference.title}\"`\n );\n }\n return acc;\n }, $note.content);\n if (newContent !== $note.content) {\n try {\n JSON.parse(newContent);\n return await models.note.update({\n where: { id: $note.id },\n data: { content: newContent }\n });\n } catch {\n // Keep the stored content unchanged if the synchronized payload becomes invalid.\n }\n }\n }\n }\n return $note;\n },\n noteCleanupCandidates: async (_, {\n query,\n pagination = {\n limit: 20,\n offset: 0\n }\n }: {\n query?: string;\n pagination: Pagination;\n }) => {\n const result = await listNoteCleanupCandidates({\n keywords: query\n ? query.split(/[,\\s]+/).map((keyword) => keyword.trim()).filter(Boolean)\n : undefined,\n limit: Number(pagination.limit),\n offset: Number(pagination.offset)\n });\n\n return result.notes;\n },\n noteCleanupPreview: async (_, { id }: { id: string }) => {\n return getNoteCleanupPreview(Number(id));\n },\n noteSnapshots: async (_, {\n id,\n limit = 5\n }: {\n id: string;\n limit?: number;\n }) => {\n return listNoteSnapshots(Number(id), Number(limit));\n },\n trashedNotes: async (_, {\n pagination = {\n limit: 25,\n offset: 0\n }\n }: {\n pagination: Pagination;\n }) => {\n return listTrashedNotes({\n limit: Number(pagination.limit),\n offset: Number(pagination.offset)\n });\n },\n noteGraph: async () => {\n const $notes = await models.note.findMany({\n select: {\n id: true,\n title: true,\n content: true\n }\n });\n\n const nodes: Array<{ id: string; title: string; connections: number }> = [];\n const links: Array<{ source: string; target: string }> = [];\n const connectionCount: Record<string, number> = {};\n const linkSet = new Set<string>();\n\n // Extract all references from each note\n for (const $note of $notes) {\n if ($note.content) {\n try {\n const blocks = extractBlocksByType<{ id: string }>('reference', JSON.parse($note.content));\n for (const block of blocks) {\n const targetId = block.props.id;\n // Avoid self-references and duplicate links\n if (targetId && String($note.id) !== targetId) {\n const linkKey = `${$note.id}-${targetId}`;\n const reverseLinkKey = `${targetId}-${$note.id}`;\n if (!linkSet.has(linkKey) && !linkSet.has(reverseLinkKey)) {\n linkSet.add(linkKey);\n links.push({\n source: String($note.id),\n target: targetId\n });\n // Count connections for both nodes\n connectionCount[String($note.id)] = (connectionCount[String($note.id)] || 0) + 1;\n connectionCount[targetId] = (connectionCount[targetId] || 0) + 1;\n }\n }\n }\n } catch {\n // Skip notes with invalid JSON content\n }\n }\n }\n\n // Build nodes array with connection counts\n for (const $note of $notes) {\n nodes.push({\n id: String($note.id),\n title: $note.title || 'Untitled',\n connections: connectionCount[String($note.id)] || 0\n });\n }\n\n return {\n nodes,\n links\n };\n }\n },\n Mutation: {\n createNote: async (_, { note }: { note: NoteInput }) => {\n const PLACEHOLDER_PREFIX = '{%';\n const PLACEHOLDER_SUFFIX = '%}';\n\n const replacePlaceholder = async (content: string) => {\n const placeholders = content.matchAll(new RegExp(`${PLACEHOLDER_PREFIX}([^}]+)${PLACEHOLDER_SUFFIX}`, 'g'));\n const $placeholders = await models.placeholder.findMany({\n select: {\n template: true,\n replacement: true\n },\n where: { template: { in: Array.from(new Set(Array.from(placeholders, p => p[1]))) } }\n });\n\n for (const $placeholder of $placeholders) {\n content = content.replace(new RegExp(`${PLACEHOLDER_PREFIX}${$placeholder.template}${PLACEHOLDER_SUFFIX}`, 'g'), $placeholder.replacement);\n }\n return content;\n };\n\n const replacedTitle = await replacePlaceholder(note.title);\n const replacedContent = await replacePlaceholder(note.content);\n\n const $note = await models.note.create({\n data: {\n title: replacedTitle,\n content: replacedContent,\n ...(note.layout && { layout: note.layout })\n }\n });\n if (note.content) {\n const blocks = extractBlocksByType<{ id: string }>(\n 'tag',\n JSON.parse(note.content)\n );\n\n return await models.note.update({\n where: { id: $note.id },\n data: { tags: { set: blocks.map(block => ({ id: Number(block.props.id) })) } }\n });\n }\n\n return $note;\n },\n updateNote: async (_, {\n id,\n note,\n editSessionId\n }: {\n id: number;\n note: NoteInput;\n editSessionId?: string;\n }, context: {\n req?: Request;\n }) => {\n const userAgentHeader = context.req?.headers['user-agent'];\n const userAgent = Array.isArray(userAgentHeader) ? userAgentHeader[0] : userAgentHeader;\n let blocks: BlockNote<{ id: string }>[] = [];\n\n if (note.content) {\n blocks = extractBlocksByType<{ id: string }>(\n 'tag',\n JSON.parse(note.content)\n );\n }\n\n await captureNoteBaseline({\n noteId: Number(id),\n ...(editSessionId ? { editSessionId } : {}),\n meta: createSnapshotMetaFromUserAgent(userAgent)\n });\n\n const $note = await models.note.update({\n where: { id: Number(id) },\n data: {\n ...note,\n ...(note.content ? { tags: { set: blocks.map(block => ({ id: Number(block.props.id) })) } } : {})\n }\n });\n return $note;\n },\n deleteNote: async (_, { id }: Note) => {\n const trashedNote = await trashNoteById(Number(id));\n\n if (!trashedNote) {\n throw 'NOT FOUND';\n }\n\n return true;\n },\n restoreNoteSnapshot: async (_, { id }: { id: string }, context: {\n req?: Request;\n }) => {\n const userAgentHeader = context.req?.headers['user-agent'];\n const userAgent = Array.isArray(userAgentHeader) ? userAgentHeader[0] : userAgentHeader;\n const note = await restoreNoteSnapshot(Number(id), { meta: createSnapshotMetaFromUserAgent(userAgent) });\n\n if (!note) {\n throw 'NOT FOUND';\n }\n\n return note;\n },\n restoreTrashedNote: async (_, { id }: { id: string }) => {\n const note = await restoreTrashedNoteById(Number(id));\n\n if (!note) {\n throw 'NOT FOUND';\n }\n\n return note;\n },\n pinNote: (_, { id, pinned }: Note) => models.note.update({\n where: { id: Number(id) },\n data: { pinned: Boolean(pinned) }\n }),\n reorderNotes: async (_, { notes }: { notes: Array<{ id: string; order: number }> }) => {\n const updatePromises = notes.map(({ id, order }) =>\n models.note.update({\n where: { id: Number(id) },\n data: { order }\n })\n );\n return await Promise.all(updatePromises);\n }\n },\n Note: {\n tags: async (note: Note) => await models.tag.findMany({ where: { notes: { some: { id: note.id } } } }),\n contentAsMarkdown: async (note: Note) => {\n const { blocksToMarkdown } = await import('~/modules/blocknote.js');\n return blocksToMarkdown(note.content);\n }\n }\n};\n"],"mappings":"AAGA,OAAO,YAAY;AACnB,SAAS,WAAW;AACpB;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,wBAAwB,6BAAoD;AAK9E,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AO,EAAE,IAAI,OAAO,EAAE,EAAE;AAAA,MACxB,MAAM,EAAE,QAAQ,QAAQ,MAAM,EAAE;AAAA,IACpC,CAAC;AAAA,IACD,cAAc,OAAO,GAAG,EAAE,MAAM,MAAuD;AACnF,YAAM,iBAAiB,MAAM;AAAA,QAAI,CAAC,EAAE,IAAI,MAAM,MAC1C,OAAO,KAAK,OAAO;AAAA,UACf,OAAO,EAAE,IAAI,OAAO,EAAE,EAAE;AAAA,UACxB,MAAM,EAAE,MAAM;AAAA,QAClB,CAAC;AAAA,MACL;AACA,aAAO,MAAM,QAAQ,IAAI,cAAc;AAAA,IAC3C;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACF,MAAM,OAAO,SAAe,MAAM,OAAO,IAAI,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC;AAAA,IACrG,mBAAmB,OAAO,SAAe;AACrC,YAAM,EAAE,iBAAiB,IAAI,MAAM,OAAO,wBAAwB;AAClE,aAAO,iBAAiB,KAAK,OAAO;AAAA,IACxC;AAAA,EACJ;AACJ;","names":[]}
@@ -1,25 +0,0 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{L as Z,N as ee,d as y,s as te,M as R,T as se,a as P,B as w,b as ne,c as re,u as q,q as F,g as z,P as ae,S as oe,e as le,C as ce}from"./index-DqFkOWbi.js";import{a as d}from"./graph-vendor-CUxe67Lr.js";import{C as ie}from"./Callout-tNHgPhLM.js";import"./note-core-BCgMq5QA.js";const de=({day:n,cellClassName:t,dayNumberClassName:s,isCurrentMonth:l,items:o,overflowCount:c,onOpenOverflow:m})=>e.jsxs("div",{className:`min-h-[200px] rounded-[14px] border p-2 ${t}`.trim(),children:[e.jsx("div",{className:"mb-2 flex justify-end",children:e.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-[8px] text-label ${s}`.trim(),children:n})}),l&&o.length>0?e.jsxs("div",{className:"flex flex-col gap-1",children:[o,c>0?e.jsxs("button",{type:"button",onClick:m,className:"text-micro rounded-[10px] py-1 text-center font-semibold text-fg-tertiary transition-colors hover:bg-hover-subtle hover:text-fg-muted",children:["+",c," more"]}):null]}):null]}),B=({params:n,toneClassName:t="",header:s,title:l,meta:o,titleClassName:c=""})=>e.jsx(Z,{to:ee,params:n,className:"group block",children:e.jsxs("div",{className:`rounded-[6px] bg-emphasis flex h-full flex-col justify-center px-1.5 py-0.5 transition-colors group-hover:bg-hover-subtle ${t}`.trim(),children:[e.jsxs("div",{className:`flex items-center gap-1 text-label line-clamp-1 font-semibold text-fg-default ${c}`.trim(),children:[s?e.jsx("span",{className:"shrink-0 text-fg-muted",children:s}):null,l]}),o?e.jsx("div",{className:"text-micro font-medium text-fg-secondary",children:o}):null]})}),ue=({note:n,type:t})=>e.jsx(B,{params:{id:n.id},title:n.title,meta:y(Number(t==="create"?n.createdAt:n.updatedAt)).format("HH:mm")}),me=({reminder:n})=>e.jsx(B,{params:{id:String(n.note?.id??n.noteId)},header:e.jsx(te,{size:12}),title:n.content||n.note?.title||"No title",titleClassName:n.completed?"line-through":"",meta:y(Number(n.reminderDate)).format("HH:mm")}),O=3,H=(n,t)=>n.map(s=>s.type==="note"?e.jsx(ue,{note:s.item,type:t},`note-${s.item.id}`):e.jsx(me,{reminder:s.item},`reminder-${s.item.id}`)),ge=({year:n,month:t,day:s,isCurrentMonth:l,isSunday:o,isToday:c,isPast:m,notes:g,reminders:f,type:j})=>{const[M,N]=d.useState(!1),x=d.useMemo(()=>{const r=g.map(u=>({type:"note",item:u})),i=f.map(u=>({type:"reminder",item:u}));return m?[...r,...i]:[...i,...r]},[m,g,f]),D=x.length>O,S=d.useMemo(()=>H(x.slice(0,O),j),[x,j]),$=d.useMemo(()=>H(x,j),[x,j]),E=d.useCallback(()=>N(!0),[]),v=d.useCallback(()=>N(!1),[]),k=()=>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",I=()=>c?"bg-cta text-fg-on-filled font-semibold":l?o?"text-fg-weekend font-bold":"text-fg-secondary font-bold":"text-fg-disabled opacity-55";return e.jsxs(e.Fragment,{children:[e.jsx(de,{day:s,cellClassName:k(),dayNumberClassName:I(),isCurrentMonth:l,items:S,overflowCount:D?x.length-O:0,onOpenOverflow:E}),D&&e.jsxs(R,{isOpen:M,onClose:v,children:[e.jsx(R.Header,{title:`${n}/${String(t).padStart(2,"0")}/${String(s).padStart(2,"0")}`,onClose:v}),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:$})]})]})]})},he=d.memo(ge),xe=["January","February","March","April","May","June","July","August","September","October","November","December"],pe=({month:n,year:t,type:s,onPrevMonth:l,onNextMonth:o,onToday:c,onTypeChange:m})=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-baseline gap-2.5",children:[e.jsx("span",{className:"text-2xl sm:text-3xl font-bold tracking-tight text-fg-default",children:xe[n-1]}),e.jsx("span",{className:"text-lg sm:text-xl font-medium text-fg-placeholder",children:t})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(se,{type:"single",variant:"pills",size:"sm",value:s,onValueChange:g=>g&&m(g),children:[e.jsx(P,{value:"create",children:"Create date"}),e.jsx(P,{value:"update",children:"Update date"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{variant:"ghost",size:"sm",onClick:c,children:"Today"}),e.jsx(w,{variant:"ghost",size:"icon-sm",onClick:l,children:e.jsx(ne,{width:18,height:18})}),e.jsx(w,{variant:"ghost",size:"icon-sm",onClick:o,children:e.jsx(re,{width:18,height:18})})]})]})]}),ye=`
2
- query NotesInDateRange($dateRange: DateRangeInput) {
3
- notesInDateRange(dateRange: $dateRange) {
4
- id
5
- title
6
- createdAt
7
- updatedAt
8
- }
9
- }
10
- `,fe=`
11
- query RemindersInDateRange($dateRange: DateRangeInput) {
12
- remindersInDateRange(dateRange: $dateRange) {
13
- id
14
- noteId
15
- reminderDate
16
- completed
17
- priority
18
- content
19
- note {
20
- id
21
- title
22
- }
23
- }
24
- }
25
- `,be=async n=>{const t=await z(ye,{dateRange:n});if(t.type==="error")throw t;return t.notesInDateRange},je=async n=>{const t=await z(fe,{dateRange:n});if(t.type==="error")throw t;return t.remindersInDateRange},Ne=({year:n,month:t})=>{const s=`${n}-${String(t).padStart(2,"0")}-01`,l=t===12?1:t+1,c=`${t===12?n+1:n}-${String(l).padStart(2,"0")}-01`,m={start:s,end:c},g=q({queryKey:F.calendar.notesInDateRange(n,t),queryFn:()=>be(m)}),f=q({queryKey:F.reminders.inDateRange(n,t),queryFn:()=>je(m)});return{notes:g.data??[],reminders:f.data??[],isLoading:g.isLoading||f.isLoading,isError:g.isError||f.isError}},Me=["SUN","MON","TUE","WED","THU","FRI","SAT"],De=[],ve=[],Q=le(ce);function ke(){const n=Q.useNavigate(),{year:t,month:s,type:l}=Q.useSearch(),o=d.useRef(null),c=d.useRef(!1),m=d.useRef(0),g=d.useRef(0),f=d.useCallback(r=>{c.current=!0,m.current=r.pageX-(o.current?.offsetLeft??0),g.current=o.current?.scrollLeft??0,o.current&&(o.current.style.cursor="grabbing",o.current.style.userSelect="none")},[]),j=d.useCallback(r=>{if(!c.current||!o.current)return;r.preventDefault();const u=(r.pageX-o.current.offsetLeft-m.current)*1.2;o.current.scrollLeft=g.current-u},[]),M=d.useCallback(()=>{c.current=!1,o.current&&(o.current.style.cursor="grab",o.current.style.userSelect="")},[]),{notes:N,reminders:x,isLoading:D,isError:S}=Ne({year:t,month:s}),$=d.useMemo(()=>{const r=y(),i=`${r.year()}-${r.month()+1}-${r.date()}`,u=new Map;for(const a of N){const p=l==="create"?y(Number(a.createdAt)):y(Number(a.updatedAt)),h=`${p.year()}-${p.month()+1}-${p.date()}`,b=u.get(h)||[];b.push(a),u.set(h,b)}const T=new Map;for(const a of x){const p=y(Number(a.reminderDate)),h=`${p.year()}-${p.month()+1}-${p.date()}`,b=T.get(h)||[];b.push(a),T.set(h,b)}const K=new Date(t,s-1,1),V=new Date(t,s,0),L=K.getDay(),A=V.getDate(),C=[],_=s===1?12:s-1,Y=s===1?t-1:t,W=new Date(Y,_,0).getDate();for(let a=L-1;a>=0;a--)C.push({day:W-a,isCurrentMonth:!1,year:Y,month:_});for(let a=1;a<=A;a++)C.push({day:a,isCurrentMonth:!0,year:t,month:s});const U=(L+A)%7,X=U===0?0:7-U,J=s===12?1:s+1,G=s===12?t+1:t;for(let a=1;a<=X;a++)C.push({day:a,isCurrentMonth:!1,year:G,month:J});return C.map((a,p)=>{const h=`${a.year}-${a.month}-${a.day}`,b=y(`${a.year}-${String(a.month).padStart(2,"0")}-${String(a.day).padStart(2,"0")}`);return{key:h,year:a.year,month:a.month,day:a.day,isCurrentMonth:a.isCurrentMonth,isSunday:p%7===0,isToday:h===i,isPast:b.isBefore(r,"day"),notes:u.get(h)||De,reminders:T.get(h)||ve}})},[t,s,N,x,l]),E=()=>{const r=s===1?12:s-1,i=s===1?t-1:t;n({search:u=>({...u,month:r,year:i})})},v=()=>{const r=s===12?1:s+1,i=s===12?t+1:t;n({search:u=>({...u,month:r,year:i})})},k=()=>{n({search:r=>({...r,month:y().month()+1,year:y().year()})})},I=r=>{r&&n({search:i=>({...i,type:r})})};return e.jsx(ae,{title:"Calendar",variant:"none",children:S?e.jsx(ie,{children:"Failed to load calendar data. Please try again later."}):e.jsxs("div",{className:"surface-base",children:[e.jsx("div",{className:"border-b border-border-subtle px-3 py-3",children:e.jsx(pe,{month:s,year:t,type:l,onPrevMonth:E,onNextMonth:v,onToday:k,onTypeChange:I})}),e.jsx("div",{ref:o,className:"overflow-x-auto cursor-grab px-3 pb-3 pt-2",onMouseDown:f,onMouseMove:j,onMouseUp:M,onMouseLeave:M,children:e.jsxs("div",{className:"min-w-[1260px]",children:[e.jsx("div",{className:"grid grid-cols-7 gap-1.5 mb-2",children:Me.map((r,i)=>e.jsx("div",{className:`py-2 text-center text-label font-semibold uppercase tracking-[0.12em] ${i===0?"text-fg-weekend":"text-fg-tertiary"}`,children:r},r))}),D?e.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:Array.from({length:35}).map((r,i)=>e.jsx(oe,{height:180},i))}):e.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:$.map(r=>e.jsx(he,{year:r.year,month:r.month,day:r.day,isCurrentMonth:r.isCurrentMonth,isSunday:r.isSunday,isToday:r.isToday,isPast:r.isPast,notes:r.notes,reminders:r.reminders,type:l},r.key))})]})})]})})}export{ke as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./note-vendor-BofYbzmZ.js";import{a as e}from"./graph-vendor-CUxe67Lr.js";import{p as n}from"./index-DqFkOWbi.js";const l=new Map([["bold",e.createElement(e.Fragment,null,e.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",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.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",e.createElement(e.Fragment,null,e.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",e.createElement(e.Fragment,null,e.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",e.createElement(e.Fragment,null,e.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",e.createElement(e.Fragment,null,e.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"}))]]),m=e.forwardRef((a,t)=>e.createElement(n,{ref:t,...a,weights:l}));m.displayName="InfoIcon";const s=m,A=({children:a,className:t=""})=>r.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:[r.jsx(s,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary"}),r.jsx("div",{className:"text-sm font-medium text-fg-secondary",children:a})]});export{A as C};
@@ -1 +0,0 @@
1
- import{j as r}from"./note-vendor-BofYbzmZ.js";import{a as i,F as V}from"./graph-vendor-CUxe67Lr.js";import{Q as W,P as j,h as _,S as U,i as Y,j as J,k as X,l as ee,q as te,N as ne,E as re,o as oe}from"./index-DqFkOWbi.js";import"./note-core-BCgMq5QA.js";const se=s=>{let a=0;for(let n=0;n<s.length;n++)a+=s.charCodeAt(n);return a},ae={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"},ie={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 C(s){return s==="dark"?ie:ae}function le(s,a){const n=C(s),{connections:g,colorIndex:y,selectedNodeId:d,nodeId:b,isConnected:c}=a,h=d===b;return d!==null&&!h&&!c?g>3?n.nodeHubDimmed:n.nodeDimmed[y%n.nodeDimmed.length]:h?n.nodeSelected:c?n.nodeConnected:g>3?n.nodeHub:n.nodeDefault[y%n.nodeDefault.length]}function de(s,a){const n=C(s);return a.selectedNodeId!==null&&!a.isConnected?n.linkDimmed:a.isConnected?n.linkConnected:n.linkIdle}function ce(s,a){const n=C(s);return`${a.emphasize?"700":"400"} ${a.fontSize}px ${n.labelFontFamily}`}function F(s){return s<=1?3.5:s<=3?4.5:s<=6?5.5:Math.min(7,5.5+Math.sqrt(s)*.5)}const ue=r.jsx(j,{title:"Knowledge Graph",children:r.jsx("div",{className:"flex h-[600px] items-center justify-center",children:r.jsx(U,{width:"100%",height:"100%"})})});function fe(){const s=Y(),a=i.useRef(null),n=i.useRef(null),[g,y]=i.useState({width:800,height:600}),[d,b]=i.useState(null),{theme:c}=J(e=>e),h=C(c),D=i.useRef(h);D.current=h;const{data:x}=X({queryKey:te.notes.graph(),queryFn:async()=>{const e=await ee();if(e.type==="error")throw e;return e.noteGraph}}),l=i.useMemo(()=>{if(x.nodes.length===0)return null;const e=x.nodes.filter(o=>o.connections>0);if(e.length===0)return null;const t=new Set(e.map(o=>o.id));return{nodes:e,links:x.links.filter(o=>t.has(o.source)&&t.has(o.target))}},[x]);i.useEffect(()=>{if(!l)return;const e=()=>{if(!a.current)return;const t=a.current.getBoundingClientRect();y({width:t.width,height:Math.max(600,window.innerHeight-150)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[l]),i.useEffect(()=>{if(!l||!n.current)return;const e=window.setTimeout(()=>{n.current?.zoomToFit(400,50)},500);return()=>window.clearTimeout(e)},[l]);const T=i.useRef(d);T.current=d;const G=i.useCallback(e=>{if(T.current===e.id){s({to:ne,params:{id:e.id}});return}b(e.id)},[s]),z=i.useCallback(()=>{b(null)},[]),B=i.useCallback(e=>{a.current&&(a.current.style.cursor=e?"pointer":"default")},[]),I=i.useRef(!1),L=i.useCallback(()=>{I.current||(I.current=!0,n.current?.enableZoomInteraction(!1))},[]),K=i.useCallback(()=>{I.current=!1,n.current?.enableZoomInteraction(!0)},[]),R=i.useRef(new Map),q=i.useMemo(()=>{const e=new Map;if(l)for(const t of l.links)e.has(t.source)||e.set(t.source,new Set),e.has(t.target)||e.set(t.target,new Set),e.get(t.source)?.add(t.target),e.get(t.target)?.add(t.source);return e},[l]);R.current=q;const A=i.useCallback((e,t,o)=>{const u=D.current,f=d,p=R.current,m=F(e.connections),w=e.x||0,S=e.y||0,k=f===e.id,v=f?p.get(f)?.has(e.id)??!1:!1,Z=f!==null&&!k&&!v,$=se(e.id);if(t.beginPath(),t.arc(w,S,m,0,Math.PI*2),t.fillStyle=le(c,{connections:e.connections,colorIndex:$,selectedNodeId:f,nodeId:e.id,isConnected:v}),t.fill(),Z)return;t.strokeStyle=u.nodeStroke,t.lineWidth=(k?2:1)/o,t.stroke(),k&&(t.beginPath(),t.arc(w,S,m+2/o,0,Math.PI*2),t.strokeStyle=u.nodeSelectedStroke,t.lineWidth=1.5/o,t.stroke());const Q=v&&e.connections>=4;if(k||Q||o>2.5){const E=e.title||"Untitled",H=Math.max(10/o,2.5);t.font=ce(c,{fontSize:H,emphasize:k}),t.textAlign="center",t.textBaseline="top";const P=t.measureText(E).width,N=2/o,M=S+m+3/o;t.fillStyle=u.labelBackground,t.fillRect(w-P/2-N,M,P+N*2,H+N*2),t.fillStyle=u.labelText,t.fillText(E,w,M+N)}},[d,c]),O=i.useCallback((e,t,o)=>{const u=d,f=e.source,p=e.target,m=u?f.id===u||p.id===u:!1;t.beginPath(),t.moveTo(f.x||0,f.y||0),t.lineTo(p.x||0,p.y||0),t.strokeStyle=de(c,{selectedNodeId:u,isConnected:m}),t.lineWidth=m?2/o:.5/o,t.stroke()},[d,c]);return l?r.jsx(j,{title:"Knowledge Graph",description:`${l.nodes.length} linked notes, ${l.links.length} connections`,children:r.jsxs("div",{ref:a,className:"surface-base graph-canvas relative overflow-hidden",style:{"--graph-bg":h.background},children:[d&&(()=>{const e=l.nodes.find(t=>t.id===d);return e?r.jsxs("div",{className:"surface-floating absolute top-3 left-3 z-10 flex items-center gap-2 px-3 py-2",children:[r.jsx("span",{className:"text-meta max-w-48 truncate font-semibold text-fg-default",children:e.title}),r.jsxs("span",{className:"text-label text-fg-tertiary",children:[e.connections," links"]}),r.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:r.jsx(oe,{className:"h-3.5 w-3.5"})})]}):null})(),r.jsxs("div",{className:"surface-floating absolute top-3 right-3 z-10 flex flex-col gap-1.5 px-3 py-2.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"legend-dot h-2.5 w-2.5 shrink-0 rounded-full",style:{"--legend-color":h.legendHub}}),r.jsx("span",{className:"text-label font-medium text-fg-secondary",children:"Hub notes (4+ connections)"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"legend-dot h-2.5 w-2.5 shrink-0 rounded-full",style:{"--legend-color":h.nodeConnected}}),r.jsx("span",{className:"text-label font-medium text-fg-secondary",children:"Connected notes"})]})]}),r.jsx(V,{ref:n,graphData:l,width:g.width,height:g.height,nodeId:"id",nodeLabel:"",nodeCanvasObject:A,nodePointerAreaPaint:(e,t,o)=>{o.beginPath(),o.arc(e.x||0,e.y||0,Math.max(F(e.connections)+4,10),0,2*Math.PI),o.fillStyle=t,o.fill()},linkCanvasObject:O,linkCanvasObjectMode:()=>"replace",linkDirectionalParticles:0,onNodeClick:G,onNodeHover:B,onBackgroundClick:z,onNodeDrag:L,onNodeDragEnd:K,warmupTicks:30,cooldownTicks:80,d3AlphaDecay:.05,d3VelocityDecay:.3,enableZoomInteraction:!0,enablePanInteraction:!0,minZoom:.3,maxZoom:5})]})}):r.jsx(j,{title:"Knowledge Graph",children:r.jsx(re,{title:"No constellations yet",description:"Link your notes together and watch your own starry sky unfold."})})}function pe(){return r.jsx(W,{fallback:ue,errorTitle:"Failed to load graph",errorDescription:"Retry loading your linked note constellation.",renderError:({error:s,retry:a})=>r.jsx(j,{title:"Knowledge Graph",children:r.jsx(_,{title:"Failed to load graph",description:"Retry loading your linked note constellation.",error:s,onRetry:a})}),children:r.jsx(fe,{})})}export{pe as default};
@@ -1 +0,0 @@
1
- import{j as e,U as V,y as ie,v as ce,i as Y,k as de,X as me,F as ue}from"./note-vendor-BofYbzmZ.js";import{p as xe,k as G,z as fe,q as C,M as j,B as M,A as W,G as pe,u as he,H as ge,I as ye,J as be,d as N,K as J,L as Z,N as z,x as je,O as S,U as X,V as ve,v as Ne,W as we,j as Ce,X as O,Y as ke,Z as Se,T as Re,a as $,c as Me,_ as Te,$ as Ae,D as ee,m as te,Q as F,P as U,h as P,e as Ee,S as E,a0 as Le,a1 as De,a2 as He,a3 as Oe,a4 as $e,a5 as q}from"./index-DqFkOWbi.js";import{a as n}from"./graph-vendor-CUxe67Lr.js";import{u as Ie}from"./image.api-CjJgNbC0.js";import{V as Fe,a2 as Pe,a3 as Ye,A as Ze}from"./note-core-BCgMq5QA.js";import{M as se,n as ze}from"./ModalActionRow-B3vNjcDc.js";import{u as Ue,R as Be,s as qe}from"./useReminderMutate-CzyOQ_VB.js";const _e=new Map([["bold",n.createElement(n.Fragment,null,n.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",n.createElement(n.Fragment,null,n.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"}),n.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",n.createElement(n.Fragment,null,n.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",n.createElement(n.Fragment,null,n.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",n.createElement(n.Fragment,null,n.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",n.createElement(n.Fragment,null,n.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"}))]]),ae=n.forwardRef((t,a)=>n.createElement(xe,{ref:a,...t,weights:_e}));ae.displayName="LinkSimpleIcon";const Qe=ae;function Ke({title:t,description:a,selected:r=!1,onClick:o,children:l}){return e.jsxs("button",{type:"button","aria-pressed":r,className:`focus-ring-soft flex w-full items-start justify-between gap-3 p-3 text-left transition-colors sm:p-4 ${r?"surface-floating bg-elevated":"rounded-[14px] border border-border-subtle bg-transparent hover:border-border-secondary hover:bg-hover-subtle"}`,onClick:o,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:`text-sm font-semibold sm:text-base ${r?"text-fg-default":"text-fg-secondary"}`,children:t}),e.jsx("div",{className:`mt-1 text-xs font-medium sm:text-sm ${r?"text-fg-tertiary":"text-fg-placeholder"}`,children:a})]}),l?e.jsx("div",{className:"shrink-0",children:l}):null]})}const Ve=t=>{const{data:a}=G({queryKey:C.notes.backReferences(t.noteId),async queryFn(){const r=await fe(t.noteId);if(r.type==="error")throw r;return r.backReferences}});return t.render(a)},Ge=[{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 We({isOpen:t,onClose:a,onSave:r,currentLayout:o="wide"}){const[l,i]=n.useState(o);n.useEffect(()=>{t&&i(o)},[t,o]);const s=()=>{r(l),a()};return e.jsxs(j,{isOpen:t,onClose:a,children:[e.jsx(j.Header,{title:"Layout Settings",onClose:a}),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("label",{className:"text-sm font-semibold text-fg-secondary",children:"Note Layout"}),e.jsx("div",{className:"flex flex-col gap-2",children:Ge.map(c=>e.jsx(Ke,{title:c.label,description:c.description,selected:l===c.value,onClick:()=>i(c.value)},c.value))})]})})}),e.jsx(j.Footer,{children:e.jsxs(se,{children:[e.jsx(M,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(M,{variant:"primary",size:"sm",onClick:s,children:"Apply"})]})})]})}const Je=(t,a)=>t||(a==="mobile"?"Mobile browser":a==="mcp"?"MCP":"Web browser");function Xe({isOpen:t,noteId:a,onClose:r,onRestored:o}){const l=W(),i=pe(),s=he({queryKey:C.notes.snapshots(a),queryFn:async()=>{const m=await ge(a);if(m.type==="error")throw m;return m.noteSnapshots},enabled:t}),c=ye({mutationFn:be,onSuccess:async m=>{if(m.type==="error"){l(m.errors[0].message);return}await Promise.all([i.invalidateQueries({queryKey:C.notes.detail(a),exact:!0}),i.invalidateQueries({queryKey:C.notes.listAll(),exact:!1}),i.invalidateQueries({queryKey:C.notes.tagListAll(),exact:!1}),i.invalidateQueries({queryKey:C.notes.pinned(),exact:!0}),i.invalidateQueries({queryKey:C.notes.backReferences(a),exact:!0}),i.invalidateQueries({queryKey:C.notes.snapshots(a),exact:!1})]),l("Previous version restored."),o?.(m.restoreNoteSnapshot),r()}});return e.jsxs(j,{isOpen:t,onClose:r,children:[e.jsx(j.Header,{title:"Restore Previous Version",onClose:r}),e.jsx(j.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:"Choose a previous snapshot to restore this note back to that state."}),s.isLoading&&e.jsx("div",{className:"text-sm text-fg-secondary",children:"Loading previous versions..."}),!s.isLoading&&s.data?.length===0&&e.jsx("div",{className:"rounded-[14px] border border-border-subtle bg-hover-subtle/50 px-4 py-3 text-sm text-fg-secondary",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("p",{className:"text-sm font-semibold",children:["Before ",Je(m.meta.label,m.meta.entrypoint)," edit"]}),e.jsx("p",{className:"truncate text-sm text-fg-secondary",children:m.title}),e.jsx("p",{className:"text-xs text-fg-placeholder",children:N(m.createdAt).format("YYYY-MM-DD HH:mm:ss")})]}),e.jsx(M,{size:"sm",isLoading:c.isPending,onClick:()=>c.mutate(m.id),children:"Restore"})]})},m.id))})]})})]})}const et="_Reference_6yru9_1",tt={Reference:et},st=J.bind(tt),at=V({type:"reference",propSchema:{id:{default:""},title:{default:"Unknown"}},content:"none"},{render:t=>e.jsx("span",{className:st("Reference"),children:e.jsx(Z,{to:z,params:{id:t.inlineContent.props.id},children:e.jsxs("span",{children:["[",t.inlineContent.props.title,"]"]})})})}),nt="_Tag_16liq_1",rt={Tag:nt},ot=J.bind(rt),lt=V({type:"tag",propSchema:{id:{default:""},tag:{default:"@Unknown"}},content:"none"},{render:t=>e.jsx("span",{className:ot("Tag"),children:e.jsx(Z,{to:je,params:{id:t.inlineContent.props.id},search:{page:1},children:e.jsx("span",{children:t.inlineContent.props.tag})})})}),it=()=>{const t=ce(),[a,r]=n.useState([]),o={1:"pl-3",2:"pl-[26px]",3:"pl-[40px]",4:"pl-[54px]",5:"pl-[68px]",6:"pl-[82px]"};n.useEffect(()=>{const s=()=>{const m=t.document,w=[],g=v=>{for(const h of v){if(h.type==="heading"){const x=h,T=x.props.level||1,A=x.content?.map(R=>R.text||"").join("")||"";A.trim()&&w.push({id:h.id,level:T,text:A})}h.children&&Array.isArray(h.children)&&g(h.children)}};g(m),r(w)};s();const c=t.onChange?.(s);return()=>{c&&c()}},[t]);const l=s=>{t.setTextCursorPosition(s);const c=document.querySelector(`[data-id="${s}"]`);c&&c.scrollIntoView({behavior:"smooth",block:"center"})},i=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),e.jsx("span",{className:"text-label font-semibold uppercase tracking-[0.12em] text-fg-tertiary",children:"Table of Contents"})]});return a.length===0?e.jsxs("div",{className:"surface-base w-full p-4",children:[i,e.jsx("p",{className:"mt-2 text-meta text-fg-tertiary",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:i}),e.jsx("nav",{className:"space-y-0.5",children:a.map(s=>{const c=s.level===1;return e.jsxs("button",{type:"button",onClick:()=>l(s.id),className:S("focus-ring-soft","flex","w-full","items-center","gap-2","rounded-[10px]","px-2.5","py-1.5",o[s.level]??"pl-2.5","text-left","transition-colors","hover:bg-hover-subtle",c?"text-fg-default":"text-fg-secondary"),children:[e.jsxs("span",{className:"text-label min-w-[1.5rem] font-semibold uppercase tracking-[0.08em] text-fg-tertiary",children:["H",s.level]}),e.jsx("span",{className:`text-meta line-clamp-2 ${c?"font-semibold":"font-medium"}`,children:s.text})]},s.id)})})]})},ct=ie({type:"tableOfContents",propSchema:{},content:"none"},{render:()=>e.jsx(it,{})})(),dt=Fe.create({inlineContentSpecs:{...Ye,tag:lt,reference:at},blockSpecs:{...Pe,tableOfContents:ct}}),mt=({editor:t})=>e.jsx(Y,{triggerCharacter:"/",getItems:async a=>Ze([...de(t).filter(r=>r.title!=="Audio"&&r.title!=="Video"&&r.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(X,{})}],a)}),ut=({onClick:t})=>e.jsx(Y,{triggerCharacter:"[",getItems:async a=>{const r=await ve({query:a,limit:5});if(r.type==="error")return[];const{notes:o}=r.allNotes;return o.map(l=>({title:l.title,onItemClick:()=>t({type:"reference",props:{id:l.id,title:l.title}})}))}}),xt=({onClick:t})=>e.jsx(Y,{triggerCharacter:"@",getItems:async a=>{const r=await Ne({query:a,limit:5});if(r.type==="error")return[];const{tags:o}=r.allTags,l=o.some(s=>s.name!==`@${a}`),i=[{title:"Add a new tag",onItemClick:async()=>{const s=await we({name:"@"+a});if(s.type==="error")return;const{id:c,name:m}=s.createTag;t({type:"tag",props:{id:c,tag:m}})}}];return o.length===0?i:o.map(s=>({title:s.name,onItemClick:()=>t({type:"tag",props:{id:s.id,tag:s.name}})})).concat(a&&l?i:[])}});async function ft(t){return new Promise((a,r)=>{const o=new FileReader;o.readAsDataURL(t),o.onload=()=>a(o.result),o.onerror=l=>r(l)})}const pt=n.forwardRef(({content:t,editable:a,onChange:r},o)=>{const{theme:l}=Ce(s=>s),i=me({schema:dt,initialContent:t&&JSON.parse(t)||void 0,uploadFile:async s=>Ie({base64:await ft(s)})},[]);return n.useImperativeHandle(o,()=>({getContent:()=>JSON.stringify(i.document)})),e.jsxs(ue,{slashMenu:!1,theme:l,editor:i,editable:a,onChange:r,children:[e.jsx(mt,{editor:i}),e.jsx(ut,{onClick:s=>{i.insertInlineContent([s," "])}}),e.jsx(xt,{onClick:s=>{i.insertInlineContent([s," "])}})]})}),_={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 ht({isOpen:t,onClose:a,onSave:r,reminder:o,mode:l}){const[i,s]=n.useState(new Date),[c,m]=n.useState("medium"),[w,g]=n.useState("");n.useEffect(()=>{t&&l==="edit"&&o?(s(new Date(Number(o.reminderDate))),m(o.priority||"medium"),g(o.content||"")):t&&l==="create"&&(s(new Date),m("medium"),g(""))},[t,l,o]);const v=()=>{r(i,c,w||void 0),a()},h=x=>c===x?_[x].active:_[x].inactive;return e.jsxs(j,{isOpen:t,onClose:a,children:[e.jsx(j.Header,{title:l==="create"?"Create Reminder":"Edit Reminder",onClose:a}),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(O,{children:"Date & Time"}),e.jsx(ke,{type:"datetime-local",size:"sm",value:N(i).format("YYYY-MM-DDTHH:mm"),onChange:x=>s(new Date(x.target.value))})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(O,{children:"Content"}),e.jsx(Se,{size:"sm",placeholder:"Enter reminder content (optional)",value:w,onChange:x=>g(x.target.value)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(O,{children:"Priority"}),e.jsxs(Re,{type:"single",value:c,onValueChange:x=>x&&m(x),className:"gap-1.5 border-none rounded-[14px] bg-muted/70 p-1 sm:gap-2",children:[e.jsx($,{value:"low",className:`flex-1 rounded-[10px] border text-sm font-medium ${h("low")}`,children:"Low"}),e.jsx($,{value:"medium",className:`flex-1 rounded-[10px] border text-sm font-medium ${h("medium")}`,children:"Medium"}),e.jsx($,{value:"high",className:`flex-1 rounded-[10px] border text-sm font-medium ${h("high")}`,children:"High"})]})]})]})}),e.jsx(j.Footer,{children:e.jsxs(se,{children:[e.jsx(M,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(M,{variant:"primary",size:"sm",onClick:v,children:l==="create"?"Create":"Save"})]})})]})}function gt({noteId:t}){const[a,r]=n.useState(!1),[o,l]=n.useState(!1),[i,s]=n.useState("create"),[c,m]=n.useState(void 0),{onCreate:w,onUpdate:g,onDelete:v}=Ue(),h=()=>{s("create"),m(void 0),l(!0)},x=f=>{s("edit"),m(f),l(!0)},T=(f,p,d)=>{i==="create"?w(t,f,p,()=>{l(!1)},d):i==="edit"&&c&&g(c.id,t,{reminderDate:f,priority:p,content:d},()=>{l(!1)})},A=f=>{g(f.id,t,{completed:!f.completed})},R=f=>{const p=N(Number(f)),d=N();return p.isSame(d,"day")?`Today at ${p.format("HH:mm")}`:p.isSame(d.add(1,"day"),"day")?`Tomorrow at ${p.format("HH:mm")}`:p.format("YYYY-MM-DD HH:mm")},D=f=>{const p=N(Number(f)),d=N(),b=p.diff(d,"hour");return b<=6?"high":b<=24?"medium":"low"},L=f=>{const p=N(Number(f)),d=N(),b=p.diff(d,"hour"),k=p.diff(d,"minute")%60;return b<0||k<0?"Overdue":b===0?`${k}m remaining`:`${b}h ${k}m remaining`};return e.jsxs("div",{className:"surface-base mb-5 p-4",children:[e.jsxs("div",{className:S("flex items-center justify-between",!a&&"mb-3"),children:[e.jsxs("button",{type:"button",onClick:()=>r(!a),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",children:[a?e.jsx(Me,{size:12}):e.jsx(Te,{size:12}),e.jsx("span",{className:"text-label font-semibold uppercase tracking-[0.12em]",children:"Reminders"})]}),!a&&e.jsxs(M,{size:"sm",variant:"ghost",onClick:h,children:[e.jsx(ze,{className:"w-3 h-3"}),e.jsx("span",{className:"text-label hidden sm:inline",children:"Add"})]})]}),!a&&e.jsx(Be,{noteId:t,searchParams:{offset:0,limit:9999},render:({reminders:f,totalCount:p})=>e.jsx("div",{className:"flex flex-col gap-2",children:f.length===0?e.jsx("p",{className:"text-meta py-3 text-center text-fg-tertiary",children:p===0?"No reminders yet":"All reminders complete"}):e.jsx("div",{className:"flex flex-col",children:f.map(d=>{const b=d.priority||D(d.reminderDate),k=L(d.reminderDate),H=k==="Overdue";return e.jsxs("div",{className:S("flex items-center gap-2.5 px-2 py-1.5"),children:[e.jsx(Ae,{checked:d.completed,onChange:()=>A(d),size:"sm"}),e.jsx("div",{className:S("text-meta font-medium text-fg-default truncate flex-1 min-w-0",d.completed&&"line-through opacity-40"),children:d.content||R(d.reminderDate)}),e.jsxs("div",{className:S("shrink-0 flex items-center gap-1 text-label text-fg-tertiary",d.completed&&"opacity-40"),children:[d.content&&e.jsx("span",{children:R(d.reminderDate)}),!d.completed&&e.jsx("span",{className:S("font-medium",d.content&&'before:content-["·"] before:mr-1',H||b==="high"?"text-fg-error":"text-fg-placeholder"),children:k})]}),e.jsx(ee,{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(te,{size:16,className:"text-current"}),e.jsx("span",{className:"sr-only",children:"Reminder actions"})]}),items:[{name:"Edit",onClick:()=>x(d)},{name:"Delete",onClick:()=>v(d.id,t)}]})]},d.id)})})})}),e.jsx(ht,{isOpen:o,onClose:()=>l(!1),onSave:T,reminder:c,mode:i})]})}const ne=Ee(z),Q=t=>N(Number(t)).format("YYYY-MM-DD HH:mm:ss"),I=()=>typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`,yt={narrow:"max-w-[640px]",wide:"max-w-[896px]",full:"max-w-full px-4"},bt=e.jsx(U,{title:"Loading note",variant:"none",children:e.jsxs("main",{className:"mx-auto max-w-[896px]",children:[e.jsx(E,{className:"mb-8",height:"66px"}),e.jsx(E,{className:"ml-12 mb-8",height:"150px"}),e.jsx(E,{className:"mb-5",height:"80px"}),e.jsx(E,{height:"80px"})]})}),K="text-label font-medium uppercase tracking-[0.12em] text-fg-tertiary";function jt({id:t}){const a=W(),r=ne.useNavigate(),o=n.useRef(null),l=n.useRef(null),i=n.useRef(I()),{data:s}=G({queryKey:C.notes.detail(t),queryFn:async()=>{const u=await Le(t);if(u.type==="error")throw u;return u.note},gcTime:0}),[c,m]=n.useState(s.title),[w,g]=n.useState(()=>Q(s.updatedAt)),[v,h]=n.useState(s.pinned),[x,T]=n.useState(s.layout||"wide"),[A,R]=n.useState(!1),[D,L]=n.useState(!1),[f,p]=De(1e3);n.useEffect(()=>{m(s.title),h(s.pinned),T(s.layout||"wide"),g(Q(s.updatedAt))},[s.layout,s.pinned,s.title,s.updatedAt]),n.useEffect(()=>{i.current=I()},[t]);const d=async({title:u="",content:y=""})=>{p(async()=>{const B=await q({id:t,title:u,content:y,editSessionId:i.current});if(B.type==="error"){a(B.errors[0].message);return}m(u),g(N().format("YYYY-MM-DD HH:mm:ss"))})},b=()=>{d({title:c,content:o.current?.getContent()})},k=u=>{m(u),d({title:u,content:o.current?.getContent()})},H=async u=>{const y=await q({id:t,layout:u,editSessionId:i.current});if(y.type==="error"){a(y.errors[0].message);return}T(u),a("Layout has been updated.")},{onCreate:re,onDelete:oe,onPinned:le}=He();return e.jsx(U,{title:c,variant:"none",children:e.jsxs("main",{className:S("mx-auto",yt[x]),children:[e.jsxs("div",{className:"surface-floating sticky top-20 z-[1001] mb-8 px-5 py-4",children:[e.jsxs("div",{className:"mb-3 flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"mb-1 text-micro font-semibold uppercase tracking-[0.16em] text-fg-tertiary",children:"Thought in progress"}),e.jsx("input",{ref:l,placeholder:"Title",className:"text-display w-full bg-transparent font-semibold tracking-[-0.02em] outline-none",type:"text",value:c,onChange:u=>k(u.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{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(te,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Note actions"})]}),items:[{name:v?"Unpin":"Pin",onClick:()=>le(t,v,()=>{h(u=>!u)})},{name:"Change layout",onClick:()=>R(!0)},{type:"separator"},{name:"Clone this note",onClick:()=>re(l.current?.value||"untitled",o.current?.getContent()||"",x)},{name:"Restore previous version",onClick:()=>L(!0)},{type:"separator"},{name:"Delete",onClick:()=>oe(t,()=>{r({to:Oe,search:{page:1}})})}]}),e.jsx(M,{size:"sm",variant:"subtle",isLoading:f,onClick:b,children:"Save"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[v&&e.jsxs("span",{className:S("inline-flex items-center gap-1.5",K),children:[e.jsx($e,{className:"h-3 w-3",weight:"fill"}),"Pinned"]}),v&&e.jsx("span",{className:"h-1 w-1 rounded-full bg-border-secondary"}),e.jsxs("span",{className:K,children:["Saved ",w]})]})]}),e.jsx(pt,{ref:o,content:s.content,onChange:b},`${t}:${s.updatedAt}`),e.jsx(F,{fallback:e.jsx(E,{className:"mb-5",height:"80px"}),errorTitle:"Failed to load reminders",errorDescription:"Retry loading reminder details for this note.",renderError:({error:u,retry:y})=>e.jsx(P,{title:"Failed to load reminders",description:"Retry loading reminder details for this note.",error:u,onRetry:y,showBackAction:!1,showHomeAction:!1}),children:e.jsx(gt,{noteId:t})}),e.jsx(F,{fallback:e.jsx(E,{height:"80px"}),errorTitle:"Failed to load back references",errorDescription:"Retry loading notes that link back here.",renderError:({error:u,retry:y})=>e.jsx(P,{title:"Failed to load back references",description:"Retry loading notes that link back here.",error:u,onRetry:y,showBackAction:!1,showHomeAction:!1}),children:e.jsx(Ve,{noteId:t,render:u=>u&&u.length>0&&e.jsxs("div",{className:"surface-base p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(Qe,{className:"h-3.5 w-3.5 text-fg-tertiary"}),e.jsx("span",{className:"text-label font-semibold uppercase tracking-[0.12em] text-fg-tertiary",children:"Back References"})]}),e.jsx("ul",{className:"flex flex-col",children:u.map(y=>e.jsx("li",{children:e.jsxs(Z,{to:z,params:{id:y.id},className:"flex items-center gap-2 rounded-[10px] px-2.5 py-1.5 text-meta text-fg-secondary transition-colors hover:bg-hover-subtle hover:text-fg-default",children:[e.jsx(qe,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),y.title]})},y.id))})]})})}),e.jsx(We,{isOpen:A,onClose:()=>R(!1),onSave:H,currentLayout:x}),e.jsx(Xe,{isOpen:D,noteId:t,onClose:()=>L(!1),onRestored:()=>{i.current=I()}})]})})}function Mt(){const{id:t}=ne.useParams();if(!t)throw new Error("Note id is required.");return e.jsx(F,{fallback:bt,errorTitle:"Failed to load note",errorDescription:"Retry loading the note editor.",resetKeys:[t],renderError:({error:a,retry:r})=>e.jsx(U,{title:"Note",variant:"none",children:e.jsx(P,{title:"Failed to load note",description:"Retry loading the note editor.",error:a,onRetry:r})}),children:e.jsx(jt,{id:t},t)})}export{Mt as default};
@@ -1 +0,0 @@
1
- ._Reference_6yru9_1{display:inline-flex;align-items:center;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_6yru9_1:hover{background:var(--elevated);border-color:var(--border-secondary);color:var(--fg-default)}html.dark ._Reference_6yru9_1{background:color-mix(in srgb,var(--elevated) 82%,var(--hover-subtle))}._Tag_16liq_1{display:inline-flex;align-items:center;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_16liq_1 a{color:inherit;text-decoration:none!important}._Tag_16liq_1:hover{background:var(--hover-subtle);border-color:var(--border-secondary);color:var(--fg-default)}html.dark ._Tag_16liq_1{background:var(--emphasis)}
@@ -1 +0,0 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{p as w,D as A,m as R,L as Z,N as M,B as H,n as D,d as m,P as T,Q as $,E as k,f as S,S as d,e as F,R as C}from"./index-DqFkOWbi.js";import{a as t}from"./graph-vendor-CUxe67Lr.js";import{s as O,u as V,R as I}from"./useReminderMutate-CzyOQ_VB.js";import"./note-core-BCgMq5QA.js";const L=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),t.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,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z"}))],["regular",t.createElement(t.Fragment,null,t.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,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z"}))]]),y=t.forwardRef((a,r)=>t.createElement(w,{ref:r,...a,weights:L}));y.displayName="ClockIcon";const U=y,z={high:"bg-accent-soft-danger",medium:"bg-accent-soft-primary dark:bg-emphasis/70",low:"bg-accent-soft-success"};function P({reminder:a,onUpdate:r,onDelete:u}){const x=g=>{const n=m(Number(g)),l=m();return n.isSame(l,"day")?`Today at ${n.format("HH:mm")}`:n.isSame(l.add(1,"day"),"day")?`Tomorrow at ${n.format("HH:mm")}`:n.format("YYYY-MM-DD HH:mm")},s=g=>{const n=m(Number(g)),l=m(),h=n.diff(l,"hour"),p=n.diff(l,"minute")%60;return h<0||p<0?"Overdue":h===0?`${p}m remaining`:`${h}h ${p}m remaining`},c=s(a.reminderDate)==="Overdue",i=a.priority||"low",o=i==="high"?"High":i==="medium"?"Medium":"Low",f=`${z[i]} text-fg-default`,j=a.noteId.toString(),N=c?"text-fg-error":"text-fg-tertiary",v=a.content?.trim()||a.note?.title||"Untitled reminder",E=a.note?.title||"Untitled note";return e.jsxs("div",{className:"surface-base flex flex-col gap-4 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-xs font-medium text-fg-tertiary",children:[e.jsx("span",{className:`h-2.5 w-2.5 rounded-full border border-border-subtle ${f}`}),o]}),e.jsx("p",{className:"min-w-0 line-clamp-2 text-base font-semibold leading-6 text-fg-default",children:v})]})}),e.jsx(A,{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(R,{className:"h-5 w-5 text-current"}),e.jsx("span",{className:"sr-only",children:"Reminder actions"})]}),items:[{name:"Delete",onClick:()=>u(a.id,j)}]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-fg-secondary",children:[e.jsx(O,{size:14}),e.jsx(Z,{to:M,params:{id:String(a.note?.id??a.noteId)},className:"truncate transition-colors hover:text-fg-default hover:underline",children:E})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-fg-secondary",children:[e.jsx(U,{size:14}),e.jsx("span",{className:"font-medium",children:x(a.reminderDate)}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-border-secondary"}),e.jsx("span",{className:`text-xs font-medium ${N}`,children:s(a.reminderDate)})]}),e.jsxs(H,{variant:"subtle",size:"sm",onClick:()=>r(a.id,j,{completed:!0}),children:[e.jsx(D,{size:14}),"Complete"]})]})]})}const b=F(C);function q(){const a=b.useNavigate(),{page:r}=b.useSearch(),{onUpdate:u,onDelete:x}=V(),s=25;return e.jsx(T,{title:"Reminders",description:"Manage all your note reminders in one place",children:e.jsx($,{fallback:e.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[e.jsx(d,{height:"60px"}),e.jsx(d,{height:"60px"}),e.jsx(d,{height:"60px"}),e.jsx(d,{height:"60px"})]}),errorTitle:"Failed to load reminders",errorDescription:"Retry loading the upcoming reminder list.",resetKeys:[r,s],children:e.jsx(I,{searchParams:{offset:(r-1)*s,limit:s},render:({reminders:c,totalCount:i})=>c.length===0?e.jsx(k,{title:"No upcoming reminders",description:"Add reminders to your notes to see them here"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:c.map(o=>e.jsx(P,{reminder:o,onUpdate:u,onDelete:x},o.id))}),i&&s<i&&e.jsx(S,{page:r,last:Math.ceil(i/s),onChange:o=>{a({search:f=>({...f,page:o})})}})]})})})})}export{q as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{P as m,Q as g,r as p,F as d,L as j,N as f,E as u,f as N,S as o,e as y,t as R}from"./index-DqFkOWbi.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const x=({children:c,match:a})=>{if(!a)return e.jsx("span",{children:c});const s=new RegExp(`(${a})`,"gi"),r=c.split(s);return e.jsx("span",{children:r.map((i,n)=>s.test(i)?e.jsx("mark",{children:i},n):i)})},h=y(R);function v(){const c=h.useNavigate(),{page:a,query:s}=h.useSearch(),r=10;return e.jsx(m,{title:`Search "${s}"`,variant:"none",children:e.jsx("main",{className:"mx-auto max-w-[896px]",children:e.jsx(g,{fallback:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(o,{height:"64px"}),e.jsx(o,{height:"120px"}),e.jsx(o,{height:"120px"})]}),errorTitle:"Failed to load search results",errorDescription:`Retry loading results for "${s}".`,resetKeys:[s,a],children:e.jsx(p,{searchParams:{query:s,limit:r,offset:(a-1)*r,fields:["content"]},render:({notes:i,totalCount:n})=>e.jsxs(e.Fragment,{children:[e.jsx(d,{fallback:e.jsx(u,{title:"No results found",description:"Try searching for something else."}),children:i.length>0&&i.map(t=>e.jsxs("div",{className:"mb-5",children:[e.jsx("div",{className:"text-heading mb-1 font-semibold",children:e.jsx(j,{to:f,params:{id:t.id},children:e.jsx(x,{match:s,children:t.title})})}),e.jsx("div",{className:"bg-muted p-3 rounded-lg",children:JSON.parse(t.content).filter(l=>JSON.stringify(l).includes(s)).map(l=>e.jsx(x,{match:s,children:JSON.stringify(l)}))})]},t.id))}),e.jsx(d,{fallback:null,children:n&&r<n&&e.jsx(N,{page:a,last:Math.ceil(n/r),onChange:t=>{c({search:l=>({...l,page:t})})}})})]})})})})})}export{v as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./note-vendor-BofYbzmZ.js";function f({children:r,className:e="",flush:s=!1}){const a=s?"overflow-hidden":"p-4";return o.jsx("div",{className:`surface-base ${a}${e?` ${e}`:""}`,children:r})}export{f as S};
@@ -1 +0,0 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{k as x,v as g,q as p,w as m,P as f,Q as u,F as c,L as y,x as j,f as T,E as b,S as r,e as w,y as v}from"./index-DqFkOWbi.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const R=s=>{const{data:t}=x({queryKey:p.tags.list(s.searchParams),async queryFn(){const i=await g({offset:s.searchParams.offset,limit:s.searchParams.limit});if(i.type==="error")throw i;return i.allTags}});return s.render(t)},k=100,P=8,A=12,h=w(v);function S(){const s=h.useNavigate(),{page:t}=h.useSearch(),{containerRef:i,limit:n}=m({minItemWidth:k,gap:P,rows:A});return e.jsx(f,{title:"Tags",description:"Organize and browse notes by tags",children:e.jsx("div",{ref:i,children:e.jsx(u,{fallback:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(r,{width:"90px",height:"36px"}),e.jsx(r,{width:"120px",height:"36px"}),e.jsx(r,{width:"80px",height:"36px"}),e.jsx(r,{width:"100px",height:"36px"}),e.jsx(r,{width:"110px",height:"36px"}),e.jsx(r,{width:"70px",height:"36px"})]}),errorTitle:"Failed to load tags",errorDescription:"Retry loading the tag catalog.",resetKeys:[t,n],children:e.jsx(R,{searchParams:{offset:(t-1)*n,limit:n},render:({tags:l,totalCount:o})=>e.jsx(c,{fallback:e.jsx(b,{title:"There are no tags",description:"Try to tag some notes using <@> key."}),children:l.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(a=>e.jsxs(y,{to:j,params:{id:a.id},search:{page:1},className:"inline-flex items-center rounded-full border border-border-subtle bg-hover-subtle px-3 py-1.5 text-sm font-medium text-fg-secondary transition-colors hover:border-border-secondary hover:bg-hover hover:text-fg-default",children:[a.name," ",e.jsxs("span",{className:"text-fg-tertiary text-xs",children:["(",a.referenceCount,")"]})]},a.id))}),e.jsx(c,{fallback:null,children:o&&n<o&&e.jsx(T,{page:t,last:Math.ceil(o/n),onChange:a=>{s({search:d=>({...d,page:a})})}})})]})})})})})})}export{S as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{k as m,a6 as x,q as y,a2 as f,P as j,Q as p,F as l,a7 as P,f as N,E as T,S as o,e as k,x as q}from"./index-DqFkOWbi.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-BCgMq5QA.js";const v=a=>{const{data:i}=m({queryKey:y.notes.tagList(a.searchParams),async queryFn(){const s=await x({query:a.searchParams.query,offset:a.searchParams.offset,limit:a.searchParams.limit});if(s.type==="error")throw s;return s.tagNotes}});return a.render(i)},c=k(q);function S(){const a=c.useNavigate(),{id:i}=c.useParams(),{page:s}=c.useSearch(),r=25,{onDelete:g,onPinned:h}=f();return e.jsx(j,{title:"Tag",variant:"subtle",children:e.jsx(p,{fallback:e.jsxs("div",{className:"grid-auto-cards grid gap-6 mt-3",children:[e.jsx(o,{height:"112px"}),e.jsx(o,{height:"112px"}),e.jsx(o,{height:"112px"})]}),errorTitle:"Failed to load tagged notes",errorDescription:"Retry loading notes for this tag.",resetKeys:[i,s,r],children:e.jsx(v,{searchParams:{query:i,offset:(s-1)*r,limit:r},render:({notes:d,totalCount:n})=>e.jsx(l,{fallback:e.jsx(T,{title:"Ocean is calm",description:"Capture anything and make waves in the ocean!"}),children:d.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid-auto-cards grid gap-6 mt-3",children:d.map(t=>e.jsx(P,{...t,onPinned:()=>h(t.id,t.pinned),onDelete:()=>g(t.id)},t.id))}),e.jsx(l,{fallback:null,children:n&&r<n&&e.jsx(N,{page:s,last:Math.ceil(n/r),onChange:t=>{a({search:u=>({...u,page:t})})}})})]})})})})})}export{S as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./note-vendor-BofYbzmZ.js";import{p as n,j as i,P as d,L as m,a8 as Z,a3 as A,a9 as h,aa as g,ab as x}from"./index-DqFkOWbi.js";import{a}from"./graph-vendor-CUxe67Lr.js";import{c as p,n as M}from"./Trash.es-DLiHgjNo.js";import{I as E}from"./Image.es-Dnn4SMzG.js";import"./note-core-BCgMq5QA.js";const f=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z",opacity:"0.2"}),a.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z"}))]]),u=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z",opacity:"0.2"}),a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z"}))]]),r=a.forwardRef((t,l)=>a.createElement(n,{ref:l,...t,weights:f}));r.displayName="MoonIcon";const N=r,c=a.forwardRef((t,l)=>a.createElement(n,{ref:l,...t,weights:u}));c.displayName="SunIcon";const j=c,F=()=>{const{theme:t,toggleTheme:l}=i(o=>o),s="surface-base flex flex-col items-center gap-3 p-6 text-center transition-colors hover:bg-hover-subtle";return e.jsx(d,{title:"Settings",description:"Customize your Ocean Brain experience",children:e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsxs("button",{type:"button",className:s,onClick:l,children:[e.jsx("span",{className:"text-3xl",children:t==="dark"?e.jsx(N,{className:"h-8 w-8 text-fg-secondary",weight:"fill"}):e.jsx(j,{className:"h-8 w-8 text-fg-secondary",weight:"fill"})}),e.jsx("span",{className:"font-semibold",children:"Theme"}),e.jsx("span",{className:"text-xs font-medium text-fg-tertiary",children:t==="dark"?"Dark mode":"Light mode"})]}),e.jsxs(m,{to:Z,className:s,children:[e.jsx(p,{className:"h-8 w-8 text-fg-secondary"}),e.jsx("span",{className:"font-semibold",children:"MCP"}),e.jsx("span",{className:"text-xs font-medium text-fg-tertiary",children:"Manage AI integration access"})]}),e.jsxs(m,{to:A,search:{page:1},className:s,children:[e.jsx(M,{className:"h-8 w-8 text-fg-secondary"}),e.jsx("span",{className:"font-semibold",children:"Trash"}),e.jsx("span",{className:"text-xs font-medium text-fg-tertiary",children:"Restore deleted notes"})]}),e.jsxs(m,{to:h,search:{page:1},className:s,children:[e.jsx(E,{className:"h-8 w-8 text-fg-secondary"}),e.jsx("span",{className:"font-semibold",children:"Manage Image"}),e.jsx("span",{className:"text-xs font-medium text-fg-tertiary",children:"Upload and organize images"})]}),e.jsxs(m,{to:g,search:{page:1},className:s,children:[e.jsx(x,{className:"h-8 w-8 text-fg-secondary"}),e.jsx("span",{className:"font-semibold",children:"Placeholder"}),e.jsx("span",{className:"text-xs font-medium text-fg-tertiary",children:"Manage template variables"})]})]})})};export{F as default};