← Notes results

Notes

GPT 5.6 terra · typescript

Initial view of Notes

Reviews & generation details

Reviews

No human review yet. Unreviewed does not mean unsuccessful.

Generation context

Imported historical artifact. Its exact original instructions and lineage are not known.

Generation prompt · exact text unavailable

See the current prompt for reference. It may differ from the instructions used to generate this artifact.

Inspect original source 25,161 bytes · SHA-256 06bf7ae10d88
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Lumen Notes</title>
<style>
/* ── css: app ── */
*{box-sizing:border-box} :root{--bg:#f7f5f0;--panel:#fbfaf7;--paper:#fffefb;--ink:#292622;--muted:#8b857d;--line:#e7e2d9;--accent:#7567d9;--accent-soft:#ece9ff;--danger:#c95c59;--shadow:0 14px 40px rgba(53,45,34,.08)} body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px}.app{height:100vh;display:flex;overflow:hidden}.sidebar{width:255px;min-width:176px;background:#f0eee8;border-right:1px solid var(--line);padding:20px 12px;display:flex;flex-direction:column;transition:width .24s ease,padding .24s ease;overflow:hidden}.sidebar.collapsed{width:0;min-width:0;padding-left:0;padding-right:0;border:0}.resize-handle{width:5px;cursor:col-resize;position:relative;z-index:4;background:transparent}.resize-handle:hover,.resize-handle.dragging{background:var(--accent)}.note-pane{width:315px;min-width:220px;background:var(--panel);border-right:1px solid var(--line);display:flex;flex-direction:column}.editor-pane{flex:1;min-width:340px;background:var(--paper);display:flex;flex-direction:column;overflow:hidden}.brand{display:flex;align-items:center;gap:9px;font-family:Georgia,serif;font-size:21px;font-weight:700;letter-spacing:-.5px;margin:2px 8px 22px}.brand-mark{width:25px;height:25px;border-radius:8px;background:linear-gradient(135deg,#8d7de9,#5e51bd);box-shadow:0 5px 10px #bdb6ed;position:relative}.brand-mark:after{content:"";position:absolute;inset:7px;border-radius:4px;border:2px solid white}.icon-btn,.small-btn{border:0;background:transparent;color:var(--muted);cursor:pointer;border-radius:8px;font:inherit}.icon-btn{width:32px;height:32px;font-size:18px}.icon-btn:hover,.small-btn:hover{background:#e5e1d9;color:var(--ink)}.side-top{display:flex;align-items:center;justify-content:space-between}.nav-item,.notebook-item{display:flex;align-items:center;gap:9px;padding:9px 10px;border-radius:8px;cursor:pointer;color:#514c46;transition:.15s}.nav-item:hover,.notebook-item:hover{background:#e7e3dc}.nav-item.active,.notebook-item.active{background:var(--accent-soft);color:#51439c;font-weight:650}.nav-count{margin-left:auto;font-size:12px;color:var(--muted)}.section-label{font-size:11px;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);font-weight:750;margin:24px 10px 7px}.notebook-row{display:flex;align-items:center}.notebook-row .notebook-item{flex:1;min-width:0}.notebook-actions{opacity:0}.notebook-row:hover .notebook-actions{opacity:1}.sidebar-foot{margin-top:auto;border-top:1px solid var(--line);padding-top:12px;display:flex;gap:4px}.pane-header{padding:18px 18px 12px;border-bottom:1px solid var(--line)}.pane-title-row{display:flex;align-items:center;justify-content:space-between}.pane-title{font-family:Georgia,serif;font-size:21px;font-weight:700;letter-spacing:-.4px}.toolbar-row{display:flex;align-items:center;gap:4px;margin-top:14px}.search{width:100%;border:1px solid var(--line);background:#f5f3ee;border-radius:8px;padding:9px 10px;color:var(--ink);outline:0;font:inherit}.search:focus{border-color:#b4aaea;background:#fff;box-shadow:0 0 0 3px #eeebff}.select{border:0;background:transparent;color:var(--muted);font:inherit;outline:0;cursor:pointer}.notes-list{overflow:auto;padding:8px}.note-card{border-radius:10px;padding:12px;margin:2px 0;cursor:pointer;transition:.15s;border:1px solid transparent}.note-card:hover{background:#f1efe9}.note-card.selected{background:var(--accent-soft);border-color:#ded9ff}.note-card-title{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.note-card-snippet{font-size:12.5px;color:var(--muted);line-height:1.35;margin-top:4px;height:34px;overflow:hidden}.note-meta{display:flex;gap:7px;margin-top:8px;font-size:11px;color:var(--muted);align-items:center}.pin{color:#7668d5}.tag{display:inline-flex;align-items:center;background:#eeeae3;color:#6f6962;padding:2px 7px;border-radius:999px;font-size:10.5px;cursor:pointer}.editor-top{height:62px;padding:13px 28px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}.editor-title{font-family:Georgia,serif;font-size:21px;font-weight:700;letter-spacing:-.3px;border:0;outline:0;background:transparent;color:var(--ink);width:100%;min-width:0}.save-status{font-size:12px;color:var(--muted);white-space:nowrap}.editor-actions{display:flex;gap:2px}.format-bar{padding:8px 28px;border-bottom:1px solid var(--line);display:flex;gap:3px;align-items:center;flex-wrap:wrap}.format-btn{border:0;background:transparent;border-radius:6px;min-width:29px;height:29px;padding:0 7px;color:#625c55;font:600 13px Georgia,serif;cursor:pointer}.format-btn:hover,.format-btn.active{background:var(--accent-soft);color:#55459f}.divider{height:20px;width:1px;background:var(--line);margin:0 4px}.editor{flex:1;overflow:auto;padding:50px max(8vw,48px);outline:0;font-family:Georgia,"Times New Roman",serif;font-size:18px;line-height:1.72;color:#302c27}.editor:empty:before{content:attr(data-placeholder);color:#b1aaa1}.editor h1{font-size:2.05em;line-height:1.2;margin:0 0 .55em}.editor h2{font-size:1.55em;line-height:1.3;margin:.8em 0 .4em}.editor h3{font-size:1.2em;margin:.8em 0 .4em}.editor blockquote{border-left:3px solid #aa9fe9;margin:1em 0;padding:.15em 1em;color:#6e6860;background:#faf9f5}.editor code{font:13px ui-monospace,SFMono-Regular,Menlo,monospace;background:#f0eee9;border-radius:4px;padding:2px 5px;color:#8a4e51}.editor hr{border:0;border-top:1px solid var(--line);margin:1.8em 0}.editor ul,.editor ol{padding-left:1.5em}.check-item{list-style:none;margin-left:-1.45em}.check-item input{accent-color:var(--accent);margin-right:9px;transform:translateY(1px)}.check-item.checked{color:#9a948c;text-decoration:line-through}.empty-editor{margin:auto;text-align:center;color:var(--muted)}.empty-editor .empty-icon{font-size:34px;margin-bottom:10px}.empty-note{padding:40px 20px;text-align:center;color:var(--muted)}.toast{position:fixed;bottom:22px;left:50%;transform:translate(-50%,15px);background:#312d29;color:#fff;padding:9px 14px;border-radius:8px;box-shadow:var(--shadow);opacity:0;pointer-events:none;transition:.2s;font-size:13px}.toast.show{opacity:1;transform:translate(-50%,0)}mark{background:#fff0a8;border-radius:2px;padding:0 1px}[data-theme=dark]{--bg:#1c1b1a;--panel:#22211f;--paper:#282623;--ink:#f1ece5;--muted:#aaa39a;--line:#3c3934;--accent-soft:#37315d;--shadow:0 14px 40px #0005}[data-theme=dark] .sidebar{background:#211f1d}[data-theme=dark] .search{background:#302e2a;color:var(--ink)}[data-theme=dark] .note-card:hover{background:#302e2a}[data-theme=dark] .tag{background:#3a3732;color:#c9c2b8}@media(max-width:760px){.sidebar{position:absolute;z-index:6;height:100%;box-shadow:var(--shadow)}.sidebar.collapsed{transform:translateX(-100%)}#side-resize{display:none}.note-pane{width:280px}.editor{padding:32px 26px}.format-bar,.editor-top{padding-left:16px;padding-right:16px}}
</style>
</head>
<body>
<div id="app" class="app"><aside id="sidebar" class="sidebar"></aside><div id="side-resize" class="resize-handle"></div><section id="note-pane" class="note-pane"></section><div id="list-resize" class="resize-handle"></div><main id="editor-pane" class="editor-pane"></main><div id="toast" class="toast"></div></div>
<script>
(function () {
'use strict';
var __mods = {};
var __cache = {};
var __map = {};
function __require(id) {
  if (__cache[id]) return __cache[id].exports;
  var module = __cache[id] = { exports: {} };
  var factory = __mods[id];
  if (!factory) throw new Error("Module not found: " + id);
  factory(module.exports, function (spec) {
    var target = (__map[id] && __map[id][spec]) || spec;
    return __require(target);
  }, module);
  return module.exports;
}

// ── module: src/main.ts ──
__mods["src/main.ts"] = function (exports, require, module) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Lumen Notes — local-first notes workspace
const CONFIG = { storage: 'lumen-notes-v1', debounce: 450, snippet: 110 };
const $ = (s) => document.querySelector(s);
const id = () => Math.random().toString(36).slice(2, 10);
const now = () => Date.now();
const starter = () => { const t = now(); return { notebooks: [{ id: 'personal', name: 'Personal' }, { id: 'work', name: 'Work' }], notes: [{ id: id(), notebookId: 'personal', title: 'Welcome to Lumen', html: '<h1>Make space for your ideas</h1><p>Lumen is a calm, local-first place for notes. Select text to format it, or type <code># </code> at the start of a line for a heading.</p><ul><li>Everything saves automatically</li><li>Use <strong>⌘/Ctrl B</strong> for bold</li></ul>', tags: ['getting started'], pinned: true, created: t, updated: t, deleted: false }, { id: id(), notebookId: 'work', title: 'Weekly planning', html: '<h2>This week</h2><ul><li class="check-item"><input type="checkbox"> Review priorities</li><li class="check-item"><input type="checkbox"> Make room for deep work</li></ul>', tags: ['planning'], pinned: false, created: t - 86400000, updated: t - 86400000, deleted: false }], selected: null, view: 'all', sort: 'updated', query: '', tag: null, sidebar: 255, list: 315, theme: 'light' }; };
let state;
try {
    state = JSON.parse(localStorage.getItem(CONFIG.storage) || '');
    if (!state?.notes)
        throw 0;
}
catch {
    state = starter();
}
if (!state.selected)
    state.selected = state.notes.find(n => !n.deleted)?.id || null;
let timer;
function save(instant = false) { clearTimeout(timer); const st = document.querySelector('#save-status'); if (st)
    st.textContent = 'Saving…'; timer = window.setTimeout(() => { localStorage.setItem(CONFIG.storage, JSON.stringify(state)); const el = document.querySelector('#save-status'); if (el)
    el.textContent = 'Saved'; }, instant ? 0 : CONFIG.debounce); }
function text(html) { const x = document.createElement('div'); x.innerHTML = html; return (x.textContent || '').replace(/\s+/g, ' ').trim(); }
function esc(s) { return s.replace(/[&<>"']/g, c => c === '&' ? '&amp;' : c === '<' ? '&lt;' : c === '>' ? '&gt;' : c === '"' ? '&quot;' : '&#39;'); }
function sanitize(html) { const host = document.createElement('div'); host.innerHTML = html; const allowed = new Set(['P', 'BR', 'B', 'STRONG', 'I', 'EM', 'U', 'S', 'STRIKE', 'CODE', 'H1', 'H2', 'H3', 'UL', 'OL', 'LI', 'BLOCKQUOTE', 'HR', 'DIV']); const walk = (n) => { [...n.childNodes].forEach(walk); if (n.nodeType !== 1)
    return; const e = n; if (e.tagName === 'INPUT' && e.getAttribute('type') === 'checkbox') {
    e.checked = e.hasAttribute('checked');
    e.removeAttribute('style');
    return;
} if (!allowed.has(e.tagName)) {
    e.replaceWith(...[...e.childNodes]);
    return;
} [...e.attributes].forEach(a => e.removeAttribute(a.name)); if (e.tagName === 'LI' && e.querySelector('input[type=checkbox]'))
    e.className = 'check-item' + (e.querySelector('input').checked ? ' checked' : ''); }; walk(host); return host.innerHTML; }
function note() { return state.notes.find(n => n.id === state.selected) || null; }
function visible() { let a = state.notes.filter(n => state.view === 'trash' ? n.deleted : !n.deleted); if (state.view !== 'all' && state.view !== 'trash')
    a = a.filter(n => n.notebookId === state.view); if (state.tag)
    a = a.filter(n => n.tags.includes(state.tag)); if (state.query) {
    const q = state.query.toLowerCase();
    a = a.filter(n => (n.title + ' ' + text(n.html)).toLowerCase().includes(q));
} return a.sort((a, b) => Number(b.pinned) - Number(a.pinned) || (state.sort === 'alpha' ? a.title.localeCompare(b.title) : state.sort === 'created' ? b.created - a.created : b.updated - a.updated)); }
function tm(t) { const d = now() - t; return d < 60000 ? 'now' : d < 86400000 ? Math.floor(d / 3600000) + 'h' : new Date(t).toLocaleDateString(undefined, { month: 'short', day: 'numeric' }); }
function hi(s) { if (!state.query)
    return esc(s); const q = state.query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); return esc(s).replace(new RegExp('(' + q + ')', 'ig'), '<mark>$1</mark>'); }
function renderSidebar() { const act = (x) => state.view === x ? ' active' : ''; $('#sidebar').innerHTML = `<div class="side-top"><div class="brand"><i class="brand-mark"></i>Lumen</div><button class="icon-btn" id="collapse">‹</button></div><div class="nav-item${act('all')}" data-view="all">◈ <span>All Notes</span><span class="nav-count">${state.notes.filter(n => !n.deleted).length}</span></div><div class="nav-item${act('trash')}" data-view="trash">♲ <span>Trash</span><span class="nav-count">${state.notes.filter(n => n.deleted).length}</span></div><div class="section-label">Notebooks <button class="icon-btn" id="new-book" style="float:right;margin-top:-8px">+</button></div><div>${state.notebooks.map(b => `<div class="notebook-row"><div class="notebook-item${act(b.id)}" data-view="${b.id}" data-drop="${b.id}">▣ <span>${esc(b.name)}</span><span class="nav-count">${state.notes.filter(n => n.notebookId === b.id && !n.deleted).length}</span></div><div class="notebook-actions"><button class="small-btn" data-rename="${b.id}">•••</button></div></div>`).join('')}</div><div class="sidebar-foot"><button class="icon-btn" id="theme">${state.theme === 'light' ? '☾' : '☀'}</button><button class="small-btn" id="add-book">New notebook</button></div>`; }
function renderList() { const v = visible(), title = state.tag ? '# ' + state.tag : state.view === 'all' ? 'All Notes' : state.view === 'trash' ? 'Trash' : state.notebooks.find(b => b.id === state.view)?.name || 'Notes'; $('#note-pane').innerHTML = `<header class="pane-header"><div class="pane-title-row"><div class="pane-title">${esc(title)}</div><button class="icon-btn" id="new-note">+</button></div><div class="toolbar-row"><input id="search" class="search" placeholder="Search notes" value="${esc(state.query)}"><select id="sort" class="select"><option value="updated">Last modified</option><option value="created">Date created</option><option value="alpha">Alphabetical</option></select></div></header><div class="notes-list">${v.length ? v.map(n => `<article class="note-card${n.id === state.selected ? ' selected' : ''}" draggable="true" data-note="${n.id}"><div class="note-card-title">${n.pinned ? '<span class="pin">●</span> ' : ''}${hi(n.title || 'Untitled')}</div><div class="note-card-snippet">${hi(text(n.html) || 'No additional text')}</div><div class="note-meta"><span>${tm(n.updated)}</span>${n.tags.slice(0, 2).map(t => `<span class="tag" data-tag="${esc(t)}">#${esc(t)}</span>`).join('')}</div></article>`).join('') : '<div class="empty-note">No notes here yet.</div>'}</div>`; $('#sort').value = state.sort; }
function editorHTML(n) { if (!n)
    return '<div class="empty-editor"><div class="empty-icon">✦</div><strong>Select or create a note</strong><div>Capture a thought, make a plan, or write freely.</div></div>'; if (n.deleted)
    return '<div class="empty-editor"><div class="empty-icon">♲</div><strong>This note is in Trash</strong><div style="margin-top:12px"><button class="small-btn" id="restore">Restore note</button> <button class="small-btn" id="destroy" style="color:var(--danger)">Delete permanently</button></div></div>'; return `<div class="editor-top"><input id="note-title" class="editor-title" value="${esc(n.title)}" placeholder="Untitled"><span id="save-status" class="save-status">Saved</span><div class="editor-actions"><button class="icon-btn" id="pin">${n.pinned ? '●' : '○'}</button><button class="icon-btn" id="move">↪</button><button class="icon-btn" id="delete">⌫</button></div></div><div class="format-bar"><button class="format-btn" data-cmd="bold"><b>B</b></button><button class="format-btn" data-cmd="italic"><i>I</i></button><button class="format-btn" data-cmd="underline"><u>U</u></button><button class="format-btn" data-cmd="strikeThrough"><s>S</s></button><button class="format-btn" data-cmd="code">&lt;/&gt;</button><i class="divider"></i><button class="format-btn" data-block="H1">H1</button><button class="format-btn" data-block="H2">H2</button><button class="format-btn" data-block="H3">H3</button><i class="divider"></i><button class="format-btn" data-cmd="insertUnorderedList">• List</button><button class="format-btn" data-cmd="insertOrderedList">1. List</button><button class="format-btn" data-cmd="quote">❝</button><button class="format-btn" data-cmd="rule">—</button></div><div id="editor" class="editor" contenteditable="true" spellcheck="true" data-placeholder="Start writing…">${n.html}</div><div style="padding:0 28px 15px;color:var(--muted);font-size:12px">${n.tags.map(t => `<span class="tag" data-tag="${esc(t)}">#${esc(t)}</span>`).join(' ')} <button class="small-btn" id="tags">+ tag</button></div>`; }
function renderEditor() { $('#editor-pane').innerHTML = editorHTML(note()); }
function render() { document.documentElement.dataset.theme = state.theme; $('#sidebar').style.width = state.sidebar + 'px'; $('#note-pane').style.width = state.list + 'px'; renderSidebar(); renderList(); renderEditor(); bind(); }
function commit() { const n = note(), e = document.querySelector('#editor'); if (!n || !e)
    return; n.html = sanitize(e.innerHTML); n.updated = now(); save(); renderList(); bindList(); }
function exec(c, v) { document.execCommand(c, false, v); commit(); toolbar(); }
function toolbar() { document.querySelectorAll('[data-cmd]').forEach(x => x.classList.toggle('active', document.queryCommandState(x.dataset.cmd))); }
function say(s) { const t = $('#toast'); t.textContent = s; t.classList.add('show'); setTimeout(() => t.classList.remove('show'), 1600); }
function makeNote() { const b = state.view === 'all' || state.view === 'trash' ? state.notebooks[0]?.id : state.view; if (!b) {
    say('Create a notebook first');
    return;
} const t = now(), n = { id: id(), notebookId: b, title: '', html: '', tags: [], pinned: false, created: t, updated: t, deleted: false }; state.notes.unshift(n); state.selected = n.id; state.view = b; state.tag = null; save(true); render(); setTimeout(() => $('#note-title')?.focus()); }
function addBook() { const name = prompt('Notebook name'); if (name?.trim()) {
    state.notebooks.push({ id: id(), name: name.trim() });
    save(true);
    render();
} }
function markdown(ed) { const sel = getSelection(); if (!sel?.anchorNode)
    return; let el = sel.anchorNode.nodeType === 3 ? sel.anchorNode.parentElement : sel.anchorNode; while (el && el !== ed && !/^(P|DIV|H1|H2|H3|LI|BLOCKQUOTE)$/.test(el.tagName))
    el = el.parentElement; if (!el || el === ed)
    return; const s = el.textContent || ''; let tag = ''; if (s === '# ')
    tag = 'H1';
else if (s === '## ')
    tag = 'H2';
else if (s === '### ')
    tag = 'H3';
else if (s === '> ')
    tag = 'BLOCKQUOTE'; if (tag) {
    el.textContent = '';
    document.execCommand('formatBlock', false, tag);
    return;
} if (s === '- ') {
    el.textContent = '';
    document.execCommand('insertUnorderedList');
    return;
} if (s === '[] ') {
    el.innerHTML = '<input type="checkbox"> ';
    el.className = 'check-item';
    commit();
} }
function bindList() { document.querySelectorAll('[data-note]').forEach(e => { e.addEventListener('click', () => { state.selected = e.dataset.note; save(true); renderEditor(); bind(); }); e.addEventListener('dragstart', ev => ev.dataTransfer?.setData('note', e.dataset.note)); }); document.querySelectorAll('[data-tag]').forEach(e => e.addEventListener('click', ev => { ev.stopPropagation(); state.tag = e.dataset.tag; renderList(); bindList(); })); document.querySelectorAll('[data-drop]').forEach(e => { e.addEventListener('dragover', ev => ev.preventDefault()); e.addEventListener('drop', ev => { ev.preventDefault(); const n = state.notes.find(x => x.id === ev.dataTransfer?.getData('note')); if (n) {
    n.notebookId = e.dataset.drop;
    save(true);
    render();
} }); }); }
function bind() { document.querySelectorAll('[data-view]').forEach(e => e.addEventListener('click', () => { state.view = e.dataset.view; state.tag = null; save(true); render(); })); $('#collapse')?.addEventListener('click', () => $('#sidebar').classList.add('collapsed')); $('#new-book')?.addEventListener('click', addBook); $('#add-book')?.addEventListener('click', addBook); document.querySelectorAll('[data-rename]').forEach(b => b.addEventListener('click', () => { const book = state.notebooks.find(x => x.id === b.dataset.rename); if (!book)
    return; const name = prompt('Rename notebook (leave blank to delete)', book.name); if (name === null)
    return; if (!name.trim()) {
    if (state.notes.some(n => n.notebookId === book.id && !n.deleted)) {
        say('Move its notes before deleting');
        return;
    }
    state.notebooks = state.notebooks.filter(x => x !== book);
    if (state.view === book.id)
        state.view = 'all';
}
else
    book.name = name.trim(); save(true); render(); })); $('#theme')?.addEventListener('click', () => { state.theme = state.theme === 'light' ? 'dark' : 'light'; save(true); render(); }); $('#new-note')?.addEventListener('click', makeNote); $('#search')?.addEventListener('input', e => { state.query = e.target.value; renderList(); bindList(); }); $('#sort')?.addEventListener('change', e => { state.sort = e.target.value; save(true); renderList(); bindList(); }); bindList(); const n = note(); if (!n || n.deleted) {
    $('#restore')?.addEventListener('click', () => { if (n) {
        n.deleted = false;
        n.notebookId = n.originalNotebookId || n.notebookId;
        delete n.originalNotebookId;
        save(true);
        render();
    } });
    $('#destroy')?.addEventListener('click', () => { if (n) {
        state.notes = state.notes.filter(x => x.id !== n.id);
        state.selected = null;
        save(true);
        render();
    } });
    return;
} const ed = $('#editor'); ed.addEventListener('input', () => { commit(); markdown(ed); }); ed.addEventListener('paste', e => { e.preventDefault(); const raw = e.clipboardData?.getData('text/html') || esc(e.clipboardData?.getData('text/plain') || ''); document.execCommand('insertHTML', false, sanitize(raw)); commit(); }); ed.addEventListener('click', e => { const x = e.target; if (x?.type === 'checkbox') {
    x.toggleAttribute('checked', x.checked);
    x.parentElement?.classList.toggle('checked', x.checked);
    commit();
} }); ed.addEventListener('keyup', toolbar); ed.addEventListener('mouseup', toolbar); ed.addEventListener('keydown', e => { if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'z')
    setTimeout(commit); }); $('#note-title')?.addEventListener('input', e => { n.title = e.target.value; n.updated = now(); save(); renderList(); bindList(); }); $('#pin')?.addEventListener('click', () => { n.pinned = !n.pinned; save(true); render(); }); $('#delete')?.addEventListener('click', () => { n.originalNotebookId = n.notebookId; n.deleted = true; state.selected = null; save(true); render(); }); $('#move')?.addEventListener('click', () => { const r = prompt('Move to notebook:\n' + state.notebooks.map((b, i) => (i + 1) + '. ' + b.name).join('\n')); const i = Number(r) - 1; if (state.notebooks[i]) {
    n.notebookId = state.notebooks[i].id;
    save(true);
    render();
} }); $('#tags')?.addEventListener('click', () => { const t = prompt('Add tag'); if (t?.trim() && !n.tags.includes(t.trim())) {
    n.tags.push(t.trim());
    save(true);
    render();
} }); document.querySelectorAll('[data-cmd]').forEach(b => b.addEventListener('mousedown', e => { e.preventDefault(); const c = b.dataset.cmd; if (c === 'code')
    exec('formatBlock', 'pre');
else if (c === 'quote')
    exec('formatBlock', 'blockquote');
else if (c === 'rule')
    exec('insertHorizontalRule');
else
    exec(c); })); document.querySelectorAll('[data-block]').forEach(b => b.addEventListener('mousedown', e => { e.preventDefault(); exec('formatBlock', b.dataset.block); })); }
let drag = '';
document.querySelectorAll('.resize-handle').forEach((h, i) => h.addEventListener('mousedown', () => { drag = i ? 'list' : 'side'; h.classList.add('dragging'); }));
window.addEventListener('mousemove', e => { if (drag === 'side') {
    $('#sidebar').classList.remove('collapsed');
    state.sidebar = Math.max(176, Math.min(420, e.clientX));
    $('#sidebar').style.width = state.sidebar + 'px';
} if (drag === 'list') {
    state.list = Math.max(220, Math.min(500, e.clientX - state.sidebar));
    $('#note-pane').style.width = state.list + 'px';
} });
window.addEventListener('mouseup', () => { if (drag) {
    save(true);
    document.querySelectorAll('.resize-handle').forEach(h => h.classList.remove('dragging'));
    drag = '';
} });
render();
};

// ── entry ──
__require("src/main.ts");
})();
</script>
</body>
</html>
<!-- agent-meta {"model":"openai/gpt-5.6-terra","provider":"openrouter","persona":"typescript","sessionId":"19be5b89-6f68-4ae5-986a-8f7f6405fb38","tokensIn":271015,"tokensOut":12872,"tokensTotal":283887,"turns":20,"toolCalls":19,"failedToolCalls":2,"timestamp":"2026-07-31T17:50:43.061Z"} -->