@floegence/floe-webapp-core 0.35.41 → 0.35.42

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.
@@ -0,0 +1,1551 @@
1
+ import { createComponent as r, insert as i, effect as N, className as Q, setAttribute as G, setStyleProperty as H, memo as se, template as g, style as Ro, use as Vo, delegateEvents as Wo } from "solid-js/web";
2
+ import { createSignal as L, createMemo as y, createEffect as X, onCleanup as tt, Show as S, For as st, untrack as Xe } from "solid-js";
3
+ import { Motion as Z, Presence as $t } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
4
+ import { easing as pt, duration as j } from "../../utils/animations.js";
5
+ import { startHotInteraction as Ho } from "../../utils/hotInteraction.js";
6
+ import { X as _t, Plus as bt, Check as Ye, Pencil as ze, Trash as ee, Minus as Be, Layers as Fe, GripVertical as Zo, Paste as Re } from "../icons/index.js";
7
+ import { visibleWorldRect as jo, mergeBoardBounds as Ko, computeBoardBounds as Go, NOTES_SCALE_MAX as Uo, NOTES_SCALE_MIN as qo } from "./types.js";
8
+ import { useNotification as Jo } from "../../context/NotificationContext.js";
9
+ import { Input as Ve, Textarea as We } from "../ui/Input.js";
10
+ import { InfiniteCanvas as Qo } from "../ui/InfiniteCanvas.js";
11
+ import { Button as Ft } from "../ui/Button.js";
12
+ var tn = /* @__PURE__ */ g('<svg viewBox="0 0 32 32"fill=none stroke=currentColor stroke-width=1.7 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M10 8.5h12"></path><path d="M13 5.5h6"></path><path d="M11.5 8.5h9a1.2 1.2 0 0 1 1.2 1.3l-1 13.1a2.1 2.1 0 0 1-2.1 1.9h-5.2a2.1 2.1 0 0 1-2.1-1.9l-1-13.1a1.2 1.2 0 0 1 1.2-1.3Z"></path><path d="M14 12.5v7.2"></path><path d="M18 12.5v7.2"></path><path d="M8 8.5h16">'), en = /* @__PURE__ */ g('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.7 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M8.5 18.1c0-3.2 1.6-5.2 3.5-5.2s3.5 2 3.5 5.2"></path><path d="M9.5 12.2 8.3 5.3c-.2-1 .3-1.8 1.1-2 .8-.2 1.5.3 1.7 1.2l.8 4.9"></path><path d="m14.5 12.2 1.1-6.6c.2-.9.9-1.4 1.7-1.2.8.2 1.3 1 1.1 2l-1.1 5.8"></path><path d="M10 16.2h.01"></path><path d="M14 16.2h.01"></path><path d="M11.2 18.1c.3.4.7.6 1.2.6s.9-.2 1.2-.6">'), on = /* @__PURE__ */ g('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.7 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m8.3 8-2.2-3.7 4.1 1.9"></path><path d="m15.7 8 2.2-3.7-4.1 1.9"></path><path d="M12 19.3c-3.7 0-6-2.7-6-6.3 0-1.7.6-3.3 2.3-5L12 10.9 15.7 8c1.7 1.7 2.3 3.3 2.3 5 0 3.6-2.3 6.3-6 6.3Z"></path><path d="M10 14.6h.01"></path><path d="M14 14.6h.01"></path><path d="M10.8 17c.4.3.8.5 1.2.5s.8-.2 1.2-.5">'), nn = /* @__PURE__ */ g('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.7 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M7.4 18.4c0-3.9 2-6.3 4.6-6.3s4.6 2.4 4.6 6.3"></path><path d="M9 11.2 7.7 8.4l2.7.7"></path><path d="m15 11.2 1.3-2.8-2.7.7"></path><path d="M10 15.1h.01"></path><path d="M14 15.1h.01"></path><path d="M12 16.2c.7 0 1.2-.4 1.2-1s-.5-1-1.2-1-1.2.4-1.2 1 .5 1 1.2 1Z"></path><path d="M7.3 15.7 5 15.1"></path><path d="m16.7 15.7 2.3-.6">'), rn = /* @__PURE__ */ g('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.7 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M5.5 12c2.2-3.2 5-4.8 8.3-4.8 3.2 0 4.7 2.1 4.7 4.8s-1.5 4.8-4.7 4.8c-3.3 0-6.1-1.6-8.3-4.8Z"></path><path d="m5.5 12-2.8-2.7v5.4Z"></path><path d="M15.9 10.1h.01"></path><path d="M11.7 12c1.1 0 2 .9 2 2"></path><path d="M11.7 12c1.1 0 2-.9 2-2">'), an = /* @__PURE__ */ g('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.7 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M4 12.8c2.7-3.6 5.6-5.4 8.5-5.4 1.8 0 3.4.6 4.9 1.8"></path><path d="M20 11.2c-2.7 3.6-5.6 5.4-8.5 5.4-1.8 0-3.4-.6-4.9-1.8"></path><path d="m13.4 11.2 6.1-.8-3.7 3.8"></path><path d="m10.6 12.8-6.1.8 3.7-3.8">'), sn = /* @__PURE__ */ g('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.7 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M8.5 18.6c0-3.8 1.8-5.9 4.2-5.9 2.6 0 3.8 2.1 3.8 5.9"></path><path d="M12.6 12.7V8.6c0-2.2 1.5-4.2 4.1-4.2h2"></path><path d="m18.7 4.4 2.2-1.5"></path><path d="M9 12.7 7.1 10"></path><path d="M10.2 15.5h.01"></path><path d="M14.1 15.5h.01">'), ln = /* @__PURE__ */ g('<div class=notes-overview__controls><div class=notes-overview__zoom-group><button type=button class=notes-overview__zoom-button aria-label="Zoom out"></button><button type=button class=notes-overview__zoom-button aria-label="Zoom in"></button></div><button type=button class=notes-overview__close aria-label="Close overview">'), cn = /* @__PURE__ */ g("<div data-floe-canvas-interactive=true><div class=notes-overview__surface data-floe-canvas-interactive=true><div class=notes-overview__grid aria-hidden=true></div><div class=notes-overview__viewport></div><div class=notes-overview__hud aria-hidden=true><div class=notes-overview__scale>"), He = /* @__PURE__ */ g("<div>"), dn = /* @__PURE__ */ g('<header class=notes-overlay__header data-floe-canvas-interactive=true><div class=notes-overlay__header-brand><div class=notes-overlay__header-title>Notes</div><div class=notes-overlay__header-separator></div><div class=notes-overlay__header-stat> topics</div><div class=notes-overlay__header-stat> live note</div><div class=notes-overlay__header-stat> trash</div></div><div class=notes-overlay__header-actions><button type=button class=notes-overlay__close aria-label="Close notes overlay">'), un = /* @__PURE__ */ g('<button type=button class=notes-overlay__hud-button aria-label="Open overview map">'), hn = /* @__PURE__ */ g("<div class=notes-page__mobile-toolbar><div class=notes-page__mobile-topics>"), vn = /* @__PURE__ */ g("<div class=notes-canvas__field>"), pn = /* @__PURE__ */ g('<div class=notes-mobile-dock data-floe-canvas-interactive=true><button type=button class=notes-mobile-dock__action aria-label="Create note at canvas center"><span>New</span></button><button type=button class=notes-mobile-dock__action aria-label="Paste note at canvas center"><span>Paste</span></button><button type=button class="notes-mobile-dock__action is-emphasis"aria-label="Open overview map"><span>Map'), _n = /* @__PURE__ */ g("<button type=button class=notes-trash__toggle><div class=notes-trash__toggle-mark>"), fn = /* @__PURE__ */ g('<div class=notes-overlay__body><aside class=notes-overlay__rail data-floe-canvas-interactive=true><section class=notes-overlay__rail-header><div class=notes-overlay__rail-heading>Topics</div><div class=notes-overlay__rail-total></div></section><form class="notes-topic-composer notes-overlay__topic-composer"data-floe-canvas-interactive=true><button type=submit class=notes-topic-composer__button aria-label="Add topic"></button></form><div class=notes-topic-list data-floe-canvas-interactive=true></div></aside><section class="notes-page notes-overlay__board"><div class=notes-overlay__board-head data-floe-canvas-interactive=true><div class=notes-overlay__board-topic></div><div class=notes-overlay__board-actions><button type=button class=notes-overlay__hud-button aria-label="Zoom out"></button><div class=notes-overlay__hud-scale></div><button type=button class=notes-overlay__hud-button aria-label="Zoom in"></button></div></div><div class=notes-page__canvas></div><div class=notes-trash data-floe-canvas-interactive=true>'), gn = /* @__PURE__ */ g("<div class=notes-trash__sections>"), wn = /* @__PURE__ */ g('<div class=notes-trash__panel><div class=notes-trash__panel-header><div class=notes-trash__panel-title-group><div class=notes-trash__panel-title-row><div class=notes-trash__panel-title>Trash Dock</div><div class=notes-trash__panel-header-actions><div class=notes-trash__panel-count> items</div><button type=button class=notes-trash__panel-close aria-label="Close trash dock"></button></div></div><div class=notes-trash__panel-body>Grouped by topic, sorted by latest deletion, and recoverable for 72 hours.'), mn = /* @__PURE__ */ g("<button type=button class=notes-menu__item><span>Paste here"), $n = /* @__PURE__ */ g("<button type=button class=notes-menu__item><span>New note"), bn = /* @__PURE__ */ g('<button type=button class="notes-menu__item is-danger"><span>Delete'), yn = /* @__PURE__ */ g('<div class=notes-flyout__header><div><div class=notes-editor__label>Edit note</div><div class=notes-flyout__title></div></div><button type=button class=notes-flyout__close aria-label="Close editor">'), xn = /* @__PURE__ */ g("<div class=notes-editor><div class=notes-editor__palette><div class=notes-editor__label>Color</div><div class=notes-editor__swatches></div></div><div class=notes-editor__field><div class=notes-editor__label>Text"), Ze = /* @__PURE__ */ g("<div class=notes-flyout__footer>"), Cn = /* @__PURE__ */ g('<div class=notes-flyout__header><div><div class=notes-editor__label>Manual paste</div><div class=notes-flyout__title>Clipboard access was unavailable</div></div><button type=button class=notes-flyout__close aria-label="Close paste panel">'), Tn = /* @__PURE__ */ g("<div class=notes-flyout__body>"), kn = /* @__PURE__ */ g('<form class=notes-topic-row__editor><button type=submit class=notes-topic-row__edit-button aria-label="Save topic name"></button><button type=button class=notes-topic-row__edit-button aria-label="Cancel topic edit">'), In = /* @__PURE__ */ g('<div role=button tabindex=0><div></div><div class=notes-topic-row__copy><div class=notes-topic-row__meta> live note</div></div><div class=notes-topic-row__tail><div class=notes-topic-row__count></div><button type=button class=notes-topic-row__edit></button><button type=button class="notes-topic-row__edit notes-topic-row__delete">'), Sn = /* @__PURE__ */ g("<div class=notes-topic-row__title-line><div class=notes-topic-row__title>"), Nn = /* @__PURE__ */ g("<div class=notes-overlay__board-topic-copy><div class=notes-page__eyebrow>Active Topic</div><div class=notes-overlay__board-title></div><div class=notes-overlay__board-meta> live note"), Mn = /* @__PURE__ */ g("<button type=button class=notes-page__mobile-topic>"), En = /* @__PURE__ */ g("<div class=notes-note__copied-state aria-hidden=true><div class=notes-note__copied-pill><span class=notes-note__copied-icon></span><span class=notes-note__copied-copy>Copied"), Ln = /* @__PURE__ */ g('<article><div class=notes-note__surface><header class=notes-note__header><button type=button class=notes-note__drag aria-label="Drag note"data-floe-canvas-interactive=true></button><div class=notes-note__actions><button type=button class=notes-note__icon-button data-floe-canvas-interactive=true aria-label="Edit note"></button><button type=button class="notes-note__icon-button is-danger"data-floe-canvas-interactive=true aria-label="Move note to trash"></button></div></header><button type=button class=notes-note__body data-floe-canvas-interactive=true data-floe-canvas-pan-surface=true><span>'), An = /* @__PURE__ */ g("<div class=notes-trash__empty><div><strong>Trash is empty</strong><span>Deleted notes from any topic will appear here."), Pn = /* @__PURE__ */ g("<section class=notes-trash-section><div class=notes-trash-section__header><div class=notes-trash-section__title-group><div class=notes-trash-section__title-line><div></div><div class=notes-trash-section__title></div></div><div class=notes-trash-section__meta> deleted note</div></div><button type=button class=notes-trash-section__clear>Clear topic trash</button></div><div class=notes-trash-section__grid>"), On = /* @__PURE__ */ g("<button type=button class=is-danger>Delete now"), Dn = /* @__PURE__ */ g("<article><div class=notes-note__surface><div class=notes-trash-note__meta><span></span><strong></strong></div><div class=notes-trash-note__body><span></span></div><div class=notes-trash-note__actions><button type=button>Restore"), Xn = /* @__PURE__ */ g("<button type=button><span>");
13
+ const Yn = [{
14
+ id: "butter",
15
+ name: "Butter",
16
+ token: "amber"
17
+ }, {
18
+ id: "blush",
19
+ name: "Blush",
20
+ token: "rose"
21
+ }, {
22
+ id: "moss",
23
+ name: "Moss",
24
+ token: "sage"
25
+ }, {
26
+ id: "mist",
27
+ name: "Mist",
28
+ token: "azure"
29
+ }, {
30
+ id: "sand",
31
+ name: "Sand",
32
+ token: "graphite"
33
+ }, {
34
+ id: "coral",
35
+ name: "Coral",
36
+ token: "coral"
37
+ }], oe = {
38
+ 0: {
39
+ width: 196,
40
+ height: 134,
41
+ previewLimit: 68
42
+ },
43
+ 1: {
44
+ width: 214,
45
+ height: 148,
46
+ previewLimit: 90
47
+ },
48
+ 2: {
49
+ width: 232,
50
+ height: 164,
51
+ previewLimit: 112
52
+ },
53
+ 3: {
54
+ width: 248,
55
+ height: 182,
56
+ previewLimit: 138
57
+ },
58
+ 4: {
59
+ width: 266,
60
+ height: 202,
61
+ previewLimit: 164
62
+ }
63
+ }, zn = 4320 * 60 * 1e3, Bn = qo, Fn = Uo, je = 1.18, ne = 1280, ie = 880, Rn = 960;
64
+ function Vn(n) {
65
+ return String(n ?? "").replace(/\r\n/g, `
66
+ `).trim();
67
+ }
68
+ function Ke(n, _ = 90) {
69
+ const p = Vn(n).replace(/\n{3,}/g, `
70
+
71
+ `);
72
+ return p ? p.length <= _ ? p : `${p.slice(0, Math.max(0, _ - 1)).trimEnd()}…` : "Empty note";
73
+ }
74
+ function Qe(n) {
75
+ switch (n) {
76
+ case "amber":
77
+ return "butter";
78
+ case "rose":
79
+ return "blush";
80
+ case "sage":
81
+ return "moss";
82
+ case "azure":
83
+ return "mist";
84
+ case "coral":
85
+ return "coral";
86
+ default:
87
+ return "sand";
88
+ }
89
+ }
90
+ function Ge(n) {
91
+ switch (n) {
92
+ case "butter":
93
+ return "amber";
94
+ case "blush":
95
+ return "rose";
96
+ case "moss":
97
+ return "sage";
98
+ case "mist":
99
+ return "azure";
100
+ case "coral":
101
+ return "coral";
102
+ default:
103
+ return "graphite";
104
+ }
105
+ }
106
+ function to(n) {
107
+ switch (n) {
108
+ case "hare":
109
+ return "hare";
110
+ case "fox":
111
+ return "fox";
112
+ case "otter":
113
+ return "otter";
114
+ case "crane":
115
+ return "crane";
116
+ case "whale":
117
+ return "koi";
118
+ default:
119
+ return "swallow";
120
+ }
121
+ }
122
+ function eo(n) {
123
+ switch (n) {
124
+ case "gold":
125
+ return "amber";
126
+ case "ember":
127
+ return "coral";
128
+ case "moss":
129
+ return "mint";
130
+ case "sea":
131
+ return "sky";
132
+ case "ink":
133
+ return "plum";
134
+ default:
135
+ return "rose";
136
+ }
137
+ }
138
+ function oo(n) {
139
+ const _ = Math.round(Number(n) || 1);
140
+ return _ <= 1 ? 0 : _ >= 5 ? 4 : _ - 1;
141
+ }
142
+ function re(n) {
143
+ return {
144
+ id: n.topic_id,
145
+ title: n.name,
146
+ iconId: to(n.icon_key),
147
+ toneId: eo(n.icon_accent),
148
+ deletedAt: n.deleted_at_unix_ms > 0 ? n.deleted_at_unix_ms : null,
149
+ createdAt: n.created_at_unix_ms
150
+ };
151
+ }
152
+ function yt(n) {
153
+ return {
154
+ id: n.note_id,
155
+ topicId: n.topic_id,
156
+ text: n.body,
157
+ colorId: Qe(n.color_token),
158
+ x: n.x,
159
+ y: n.y,
160
+ layer: n.z_index,
161
+ createdAt: n.created_at_unix_ms,
162
+ updatedAt: n.updated_at_unix_ms,
163
+ deletedAt: null,
164
+ sizeBucket: oo(n.size_bucket)
165
+ };
166
+ }
167
+ function Wn(n) {
168
+ return {
169
+ id: n.note_id,
170
+ topicId: n.topic_id,
171
+ text: n.body,
172
+ colorId: Qe(n.color_token),
173
+ x: n.x,
174
+ y: n.y,
175
+ layer: n.z_index,
176
+ createdAt: n.created_at_unix_ms,
177
+ updatedAt: n.updated_at_unix_ms,
178
+ deletedAt: n.deleted_at_unix_ms,
179
+ sizeBucket: oo(n.size_bucket),
180
+ topicName: n.topic_name,
181
+ topicIconId: to(n.topic_icon_key),
182
+ topicToneId: eo(n.topic_icon_accent),
183
+ topicSortOrder: n.topic_sort_order
184
+ };
185
+ }
186
+ function K(n, _, p) {
187
+ return Math.max(_, Math.min(p, n));
188
+ }
189
+ function Ue(n, _, p, Y) {
190
+ const B = Y - p;
191
+ return !Number.isFinite(B) || B <= 0 ? n : _ >= B ? p + B / 2 : K(n, p + _ / 2, Y - _ / 2);
192
+ }
193
+ function qe(n, _, p) {
194
+ return {
195
+ x: K((n - p.left) / p.width, 0, 1),
196
+ y: K((_ - p.top) / p.height, 0, 1)
197
+ };
198
+ }
199
+ function Je(n) {
200
+ return (() => {
201
+ var _ = tn();
202
+ return N(() => G(_, "class", n.class)), _;
203
+ })();
204
+ }
205
+ function Hn(n, _ = Date.now()) {
206
+ if (n === null) return "Restored";
207
+ const p = Math.max(0, zn - (_ - n)), Y = Math.ceil(p / (3600 * 1e3));
208
+ if (Y >= 24) {
209
+ const B = Math.floor(Y / 24), ft = Y % 24;
210
+ return ft === 0 ? `${B}d left` : `${B}d ${ft}h left`;
211
+ }
212
+ return `${Math.max(1, Y)}h left`;
213
+ }
214
+ function Zn(n) {
215
+ return n === null ? "Restored" : new Intl.DateTimeFormat(void 0, {
216
+ month: "short",
217
+ day: "numeric",
218
+ hour: "numeric",
219
+ minute: "2-digit"
220
+ }).format(n);
221
+ }
222
+ function ae(n) {
223
+ const _ = y(() => {
224
+ switch (n.iconId) {
225
+ case "hare":
226
+ return (() => {
227
+ var p = en();
228
+ return N(() => G(p, "class", n.class)), p;
229
+ })();
230
+ case "fox":
231
+ return (() => {
232
+ var p = on();
233
+ return N(() => G(p, "class", n.class)), p;
234
+ })();
235
+ case "otter":
236
+ return (() => {
237
+ var p = nn();
238
+ return N(() => G(p, "class", n.class)), p;
239
+ })();
240
+ case "koi":
241
+ return (() => {
242
+ var p = rn();
243
+ return N(() => G(p, "class", n.class)), p;
244
+ })();
245
+ case "swallow":
246
+ return (() => {
247
+ var p = an();
248
+ return N(() => G(p, "class", n.class)), p;
249
+ })();
250
+ default:
251
+ return (() => {
252
+ var p = sn();
253
+ return N(() => G(p, "class", n.class)), p;
254
+ })();
255
+ }
256
+ });
257
+ return se(_);
258
+ }
259
+ function ii(n) {
260
+ const _ = Jo(), [p, Y] = L(null), [B, ft] = L(""), [Rt, Vt] = L(null), [le, xt] = L(""), [ce, Ct] = L(null), [de, ue] = L(""), [he, ve] = L("butter"), [gt, Tt] = L(!1), [kt, F] = L(!1), [no, pe] = L(null), [_e, lt] = L(null), [It, ct] = L(""), [io, Wt] = L(null), [St, Nt] = L(null), [Mt, ro] = L({
261
+ width: 0,
262
+ height: 0
263
+ }), [ao, so] = L(Date.now());
264
+ let wt, et, Ht, Zt = null, Et;
265
+ const [dt, lo] = L(!1), Lt = y(() => n.controller.snapshot()), At = y(() => Lt().topics.map(re)), jt = y(() => Lt().items.map(yt)), Kt = y(() => Lt().trash_items.map(Wn)), fe = y(() => n.controller.activeTopicID()), ge = (t) => At().find((e) => e.id === t), co = (t) => jt().find((e) => e.id === t), uo = (t, e) => {
266
+ const o = jt().filter((a) => a.topicId === t);
267
+ return e?.includeDeleted ? [...o, ...Kt().filter((a) => a.topicId === t)] : o;
268
+ }, ho = (t) => jt().reduce((e, o) => e + (o.topicId === t ? 1 : 0), 0), mt = y(() => {
269
+ const t = fe();
270
+ return At().some((e) => e.id === t) ? t : At()[0]?.id ?? "";
271
+ }), c = {
272
+ topics: At,
273
+ activeTopicId: mt,
274
+ activeTopic: () => ge(mt()),
275
+ activeViewport: () => n.controller.viewport(),
276
+ trashedNotes: Kt,
277
+ trashCount: () => Kt().length,
278
+ colorOptions: Yn,
279
+ getTopic: ge,
280
+ getViewport: (t) => n.controller.viewport(),
281
+ getNotesForTopic: uo,
282
+ getNoteById: co,
283
+ getLiveNoteCount: ho,
284
+ createTopic: async (t) => {
285
+ const e = await n.controller.createTopic({
286
+ name: t.trim()
287
+ });
288
+ return re(e);
289
+ },
290
+ updateTopic: async (t, e) => {
291
+ const o = await n.controller.updateTopic(t, {
292
+ name: String(e.title ?? "").trim()
293
+ });
294
+ return re(o);
295
+ },
296
+ deleteTopic: (t) => n.controller.deleteTopic(t),
297
+ setActiveTopic: (t) => n.controller.setActiveTopicID(t),
298
+ setViewport: (t, e) => n.controller.setViewport(e),
299
+ createNote: async (t) => {
300
+ const e = t.topicId ?? mt();
301
+ if (!e) return;
302
+ const o = await n.controller.createNote({
303
+ topic_id: e,
304
+ x: t.x,
305
+ y: t.y,
306
+ body: t.text ?? "",
307
+ color_token: t.colorId ? Ge(t.colorId) : void 0
308
+ });
309
+ return yt(o);
310
+ },
311
+ updateNote: async (t, e) => {
312
+ const o = await n.controller.updateNote(t, {
313
+ body: e.text,
314
+ color_token: e.colorId ? Ge(e.colorId) : void 0
315
+ });
316
+ return yt(o);
317
+ },
318
+ moveNote: async (t, e) => {
319
+ const o = await n.controller.updateNote(t, {
320
+ x: e.x,
321
+ y: e.y
322
+ });
323
+ return yt(o);
324
+ },
325
+ bringNoteToFront: (t) => n.controller.bringNoteToFront(t),
326
+ trashNote: (t) => n.controller.deleteNote(t),
327
+ restoreNote: async (t) => {
328
+ const e = await n.controller.restoreNote(t);
329
+ return yt(e);
330
+ },
331
+ deleteNotePermanently: (t) => n.controller.deleteTrashedNotePermanently?.(t),
332
+ clearTrashForTopic: (t) => n.controller.clearTrashTopic(t)
333
+ }, U = y(() => c.activeTopic()), we = y(() => c.activeTopicId()), Pt = y(() => {
334
+ const t = U();
335
+ return t ? c.getNotesForTopic(t.id).slice().sort((e, o) => e.layer - o.layer || e.createdAt - o.createdAt) : [];
336
+ }), vo = y(() => c.trashedNotes()), Gt = y(() => {
337
+ const t = ce();
338
+ return t ? c.getNoteById(t) : void 0;
339
+ }), me = y(() => c.topics().reduce((t, e) => t + c.getLiveNoteCount(e.id), 0)), po = y(() => U()?.title ?? "No topic"), $e = y(() => `${Math.round(c.activeViewport().scale * 100)}%`), _o = y(() => Pt().reduce((t, e) => Math.max(t, e.layer), 1)), fo = y(() => Lt().items.filter((t) => t.topic_id === mt()).slice().sort((t, e) => t.z_index - e.z_index || t.created_at_unix_ms - e.created_at_unix_ms || t.note_id.localeCompare(e.note_id))), Ut = y(() => {
340
+ const t = c.activeViewport(), e = Mt(), o = (e.width > 0 ? e.width : ne) / t.scale, a = (e.height > 0 ? e.height : ie) / t.scale;
341
+ return {
342
+ worldLeft: -t.x / t.scale,
343
+ worldTop: -t.y / t.scale,
344
+ worldWidth: o,
345
+ worldHeight: a
346
+ };
347
+ }), go = y(() => {
348
+ const t = U();
349
+ return t ? c.getNotesForTopic(t.id).map((e) => ({
350
+ id: e.id,
351
+ colorId: e.colorId,
352
+ x: e.x,
353
+ y: e.y,
354
+ sizeBucket: e.sizeBucket
355
+ })) : [];
356
+ }), Ot = y(() => {
357
+ const t = Mt(), e = jo(c.activeViewport(), t.width > 0 ? t.width : ne, t.height > 0 ? t.height : ie), o = Ko(Go(fo()), e);
358
+ return {
359
+ minX: o.minX,
360
+ minY: o.minY,
361
+ maxX: o.maxX,
362
+ maxY: o.maxY,
363
+ width: o.maxX - o.minX,
364
+ height: o.maxY - o.minY
365
+ };
366
+ }), wo = y(() => {
367
+ const t = Ot();
368
+ return go().map((o) => {
369
+ const a = oe[o.sizeBucket];
370
+ return {
371
+ id: o.id,
372
+ colorId: o.colorId,
373
+ x: (o.x - t.minX) / t.width * 100,
374
+ y: (o.y - t.minY) / t.height * 100,
375
+ width: a.width / t.width * 100,
376
+ height: a.height / t.height * 100
377
+ };
378
+ });
379
+ }), be = y(() => {
380
+ const t = Ot(), e = Ut(), o = K(e.worldLeft, t.minX, t.maxX), a = K(e.worldTop, t.minY, t.maxY), v = K(e.worldLeft + e.worldWidth, t.minX, t.maxX), f = K(e.worldTop + e.worldHeight, t.minY, t.maxY), w = Math.max((v - o) / t.width * 100, 6), d = Math.max((f - a) / t.height * 100, 8), s = (o - t.minX) / t.width * 100, l = (a - t.minY) / t.height * 100;
381
+ return {
382
+ left: s,
383
+ top: l,
384
+ width: w,
385
+ height: d,
386
+ centerX: s + w / 2,
387
+ centerY: l + d / 2
388
+ };
389
+ }), mo = y(() => {
390
+ const t = be();
391
+ return {
392
+ left: `${t.left}%`,
393
+ top: `${t.top}%`,
394
+ width: `${t.width}%`,
395
+ height: `${t.height}%`
396
+ };
397
+ }), ye = y(() => {
398
+ const t = /* @__PURE__ */ new Map();
399
+ for (const e of vo()) {
400
+ const o = c.getTopic(e.topicId) ?? {
401
+ id: e.topicId,
402
+ title: e.topicName,
403
+ iconId: e.topicIconId,
404
+ toneId: e.topicToneId,
405
+ deletedAt: e.deletedAt,
406
+ createdAt: e.createdAt
407
+ }, a = t.get(o.id);
408
+ if (a) {
409
+ a.notes.push(e), a.latestDeletedAt = Math.max(a.latestDeletedAt, e.deletedAt);
410
+ continue;
411
+ }
412
+ t.set(o.id, {
413
+ topic: o,
414
+ notes: [e],
415
+ latestDeletedAt: e.deletedAt
416
+ });
417
+ }
418
+ return Array.from(t.values()).map((e) => ({
419
+ ...e,
420
+ notes: e.notes.slice().sort((o, a) => (a.deletedAt ?? 0) - (o.deletedAt ?? 0))
421
+ })).sort((e, o) => o.latestDeletedAt - e.latestDeletedAt || ("topicSortOrder" in e.notes[0] ? e.notes[0].topicSortOrder : 0) - ("topicSortOrder" in o.notes[0] ? o.notes[0].topicSortOrder : 0));
422
+ }), $o = y(() => {
423
+ const t = p();
424
+ if (!t) return;
425
+ const e = 224, o = t.noteId ? 184 : 132, a = typeof window > "u" ? t.clientX : window.innerWidth - e, v = typeof window > "u" ? t.clientY : window.innerHeight - o;
426
+ return {
427
+ left: `${Math.max(16, Math.min(t.clientX, a))}px`,
428
+ top: `${Math.max(16, Math.min(t.clientY, v))}px`
429
+ };
430
+ }), z = () => Y(null), ut = () => Tt(!1), bo = () => {
431
+ z(), ut(), F(!1), Vt(null), xt(""), Ct(null), lt(null), ct(""), n.onClose();
432
+ }, Dt = () => {
433
+ Ht?.abort(), Ht = void 0, pe(null);
434
+ }, qt = () => {
435
+ wt !== void 0 && (window.clearTimeout(wt), wt = void 0);
436
+ };
437
+ X(() => {
438
+ if (typeof window > "u") return;
439
+ const t = () => {
440
+ lo(window.innerWidth < Rn);
441
+ };
442
+ t(), window.addEventListener("resize", t), tt(() => window.removeEventListener("resize", t));
443
+ }), X(() => {
444
+ const t = mt();
445
+ t && fe() !== t && n.controller.setActiveTopicID(t);
446
+ }), X(() => {
447
+ n.open || (z(), ut(), F(!1), Ct(null), lt(null));
448
+ }), X(() => {
449
+ const t = Gt();
450
+ if (!t) {
451
+ Zt = null;
452
+ return;
453
+ }
454
+ Zt !== t.id && (Zt = t.id, ue(t.text), ve(t.colorId));
455
+ }), X(() => {
456
+ we(), z();
457
+ }), X(() => {
458
+ gt() && z();
459
+ }), X(() => {
460
+ if (!p()) return;
461
+ const e = () => z();
462
+ window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), tt(() => {
463
+ window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
464
+ });
465
+ }), X(() => {
466
+ const t = Et;
467
+ if (!t) return;
468
+ const e = () => {
469
+ ro({
470
+ width: t.clientWidth,
471
+ height: t.clientHeight
472
+ });
473
+ };
474
+ if (e(), typeof ResizeObserver > "u") {
475
+ window.addEventListener("resize", e), tt(() => window.removeEventListener("resize", e));
476
+ return;
477
+ }
478
+ const o = new ResizeObserver(e);
479
+ o.observe(t), tt(() => o.disconnect());
480
+ }), X(() => {
481
+ if (typeof window > "u") return;
482
+ const t = window.setInterval(() => so(Date.now()), 60 * 1e3);
483
+ tt(() => window.clearInterval(t));
484
+ }), X(() => {
485
+ if (!gt()) return;
486
+ const t = (e) => {
487
+ e.key === "Escape" && ut();
488
+ };
489
+ window.addEventListener("keydown", t), tt(() => window.removeEventListener("keydown", t));
490
+ }), X(() => {
491
+ if (!dt()) {
492
+ F(!1);
493
+ return;
494
+ }
495
+ if (!kt()) return;
496
+ const t = (e) => {
497
+ e.key === "Escape" && F(!1);
498
+ };
499
+ window.addEventListener("keydown", t), tt(() => window.removeEventListener("keydown", t));
500
+ }), X(() => {
501
+ kt() || Dt();
502
+ }), tt(() => {
503
+ qt(), et?.(), Dt();
504
+ });
505
+ const yo = (t) => {
506
+ qt(), Wt(t), wt = window.setTimeout(() => {
507
+ wt = void 0, Wt((e) => e === t ? null : e);
508
+ }, 1100);
509
+ }, Xt = (t) => {
510
+ Promise.resolve(c.bringNoteToFront(t)).catch(() => {
511
+ });
512
+ }, xo = async (t) => {
513
+ t.preventDefault();
514
+ const e = B().trim();
515
+ if (e)
516
+ try {
517
+ const o = await c.createTopic(e);
518
+ ft(""), c.setActiveTopic(o.id);
519
+ } catch (o) {
520
+ _.error("Topic failed", o instanceof Error ? o.message : String(o));
521
+ }
522
+ }, Co = (t) => {
523
+ Vt(t.id), xt(t.title);
524
+ }, Yt = () => {
525
+ Vt(null), xt("");
526
+ }, To = async () => {
527
+ const t = Rt();
528
+ if (!t) return;
529
+ const e = le().trim();
530
+ if (Yt(), !!e)
531
+ try {
532
+ await c.updateTopic(t, {
533
+ title: e
534
+ });
535
+ } catch (o) {
536
+ _.error("Rename failed", o instanceof Error ? o.message : String(o));
537
+ }
538
+ }, ko = async (t) => {
539
+ const e = c.getNotesForTopic(t.id, {
540
+ includeDeleted: !0
541
+ }).length;
542
+ Rt() === t.id && Yt();
543
+ try {
544
+ if (await c.deleteTopic(t.id) === !1) {
545
+ _.info("Keep one topic", "At least one topic needs to remain available.");
546
+ return;
547
+ }
548
+ if (e > 0) {
549
+ Tt(!0), _.success("Topic deleted", "Live notes moved into trash for this topic.");
550
+ return;
551
+ }
552
+ _.success("Topic deleted", "The empty topic was removed.");
553
+ } catch (o) {
554
+ _.error("Delete failed", o instanceof Error ? o.message : String(o));
555
+ }
556
+ }, Jt = (t) => {
557
+ z(), Ct(t);
558
+ }, Qt = () => {
559
+ Ct(null);
560
+ }, Io = async () => {
561
+ const t = ce();
562
+ if (t)
563
+ try {
564
+ await c.updateNote(t, {
565
+ text: de(),
566
+ colorId: he()
567
+ }), _.success("Saved", "Note updated."), Qt();
568
+ } catch (e) {
569
+ _.error("Save failed", e instanceof Error ? e.message : String(e));
570
+ }
571
+ }, xe = async (t) => {
572
+ try {
573
+ const e = await c.createNote({
574
+ topicId: t.topicId,
575
+ x: t.worldX,
576
+ y: t.worldY
577
+ });
578
+ if (!e) return;
579
+ Jt(e.id);
580
+ } catch (e) {
581
+ _.error("Create failed", e instanceof Error ? e.message : String(e));
582
+ }
583
+ }, Ce = async (t, e) => {
584
+ try {
585
+ if (!await c.createNote({
586
+ topicId: t.topicId,
587
+ x: t.worldX,
588
+ y: t.worldY,
589
+ text: e
590
+ })) return;
591
+ _.success("Pasted", "Created a new note from clipboard text.");
592
+ } catch (o) {
593
+ _.error("Paste failed", o instanceof Error ? o.message : String(o));
594
+ }
595
+ }, So = (t, e, o = U()?.id) => {
596
+ if (!o) return null;
597
+ const a = c.getTopic(o);
598
+ if (!a || a.deletedAt !== null) return null;
599
+ const v = Et;
600
+ if (!v) return te();
601
+ const f = v.getBoundingClientRect();
602
+ if (f.width <= 0 || f.height <= 0 || t < f.left || t > f.right || e < f.top || e > f.bottom)
603
+ return null;
604
+ const w = c.getViewport(a.id);
605
+ return {
606
+ topicId: a.id,
607
+ worldX: (t - f.left - w.x) / w.scale,
608
+ worldY: (e - f.top - w.y) / w.scale
609
+ };
610
+ }, Te = (t, e, o) => {
611
+ const a = So(t, e, o?.topicId);
612
+ return a ? (Y({
613
+ clientX: t,
614
+ clientY: e,
615
+ worldX: a.worldX,
616
+ worldY: a.worldY,
617
+ topicId: a.topicId,
618
+ noteId: o?.noteId ?? null
619
+ }), !0) : !1;
620
+ }, te = () => {
621
+ const t = U();
622
+ if (!t) return null;
623
+ const e = Mt();
624
+ if (e.width <= 0 || e.height <= 0) {
625
+ const a = Ut();
626
+ return {
627
+ topicId: t.id,
628
+ worldX: a.worldLeft + a.worldWidth / 2,
629
+ worldY: a.worldTop + a.worldHeight / 2
630
+ };
631
+ }
632
+ const o = c.activeViewport();
633
+ return {
634
+ topicId: t.id,
635
+ worldX: (e.width / 2 - o.x) / o.scale,
636
+ worldY: (e.height / 2 - o.y) / o.scale
637
+ };
638
+ }, ke = (t, e, o = c.activeViewport().scale) => {
639
+ const a = U();
640
+ if (!a) return;
641
+ const v = Mt(), f = v.width || (typeof window > "u" ? ne : window.innerWidth), w = v.height || (typeof window > "u" ? ie : window.innerHeight), d = f / o, s = w / o, l = Ot(), $ = Ue(t, d, l.minX, l.maxX), k = Ue(e, s, l.minY, l.maxY);
642
+ c.setViewport(a.id, {
643
+ x: f / 2 - $ * o,
644
+ y: w / 2 - k * o,
645
+ scale: o
646
+ });
647
+ }, zt = (t) => {
648
+ const e = c.activeViewport(), o = K(e.scale * (t === "in" ? je : 1 / je), Bn, Fn);
649
+ if (Math.abs(o - e.scale) < 1e-3) return;
650
+ const a = Ut(), v = a.worldLeft + a.worldWidth / 2, f = a.worldTop + a.worldHeight / 2;
651
+ ke(v, f, o);
652
+ }, Ie = async (t) => {
653
+ try {
654
+ const e = await navigator.clipboard.readText();
655
+ if (!e.trim()) {
656
+ _.info("Clipboard empty", "Paste text into the dialog to create a note."), Se(t);
657
+ return;
658
+ }
659
+ await Ce(t, e);
660
+ } catch (e) {
661
+ console.error(e), _.info("Clipboard blocked", "Manual paste is available as a fallback."), Se(t);
662
+ }
663
+ }, No = async () => {
664
+ const t = p();
665
+ t && (z(), await xe(t));
666
+ }, Se = (t) => {
667
+ ct(""), lt(t);
668
+ }, Mo = async () => {
669
+ const t = p();
670
+ t && (z(), await Ie(t));
671
+ }, Ne = async (t) => {
672
+ try {
673
+ await c.trashNote(t), qt(), Wt((e) => e === t ? null : e), Tt(!0);
674
+ } catch (e) {
675
+ _.error("Delete failed", e instanceof Error ? e.message : String(e));
676
+ }
677
+ }, Eo = async (t) => {
678
+ try {
679
+ await c.restoreNote(t);
680
+ } catch (e) {
681
+ _.error("Restore failed", e instanceof Error ? e.message : String(e));
682
+ }
683
+ }, Lo = async (t) => {
684
+ if (n.controller.deleteTrashedNotePermanently)
685
+ try {
686
+ await c.deleteNotePermanently(t);
687
+ } catch (e) {
688
+ _.error("Delete failed", e instanceof Error ? e.message : String(e));
689
+ }
690
+ }, Ao = async (t) => {
691
+ try {
692
+ await c.clearTrashForTopic(t);
693
+ } catch (e) {
694
+ _.error("Trash failed", e instanceof Error ? e.message : String(e));
695
+ }
696
+ }, Po = async () => {
697
+ const t = p();
698
+ t?.noteId && (z(), await Ne(t.noteId));
699
+ }, Oo = async () => {
700
+ const t = te();
701
+ t && (F(!1), await xe(t));
702
+ }, Do = async () => {
703
+ const t = te();
704
+ t && (F(!1), await Ie(t));
705
+ }, Xo = (t, e, o) => {
706
+ const a = o.surfaceRect;
707
+ if (a.width <= 0 || a.height <= 0) return;
708
+ const v = qe(t, e, a), f = K(v.x - o.centerOffsetX, 0, 1), w = K(v.y - o.centerOffsetY, 0, 1), d = o.bounds;
709
+ ke(d.minX + f * d.width, d.minY + w * d.height);
710
+ }, Yo = (t) => {
711
+ if (t.button !== 0 && t.pointerType !== "touch" && t.pointerType !== "pen") return;
712
+ const e = t.currentTarget, o = e.getBoundingClientRect();
713
+ if (o.width <= 0 || o.height <= 0) return;
714
+ const a = qe(t.clientX, t.clientY, o), v = be(), f = a.x * 100, w = a.y * 100, d = f >= v.left && f <= v.left + v.width && w >= v.top && w <= v.top + v.height, s = {
715
+ pointerId: t.pointerId,
716
+ bounds: Ot(),
717
+ surfaceRect: o,
718
+ centerOffsetX: d ? a.x - v.centerX / 100 : 0,
719
+ centerOffsetY: d ? a.y - v.centerY / 100 : 0
720
+ }, l = (A, R) => Xo(A, R, s);
721
+ Dt(), t.preventDefault(), t.stopPropagation(), pe(s), l(t.clientX, t.clientY), e.setPointerCapture?.(t.pointerId);
722
+ const $ = new AbortController();
723
+ Ht = $;
724
+ const k = (A) => {
725
+ A.pointerId === t.pointerId && l(A.clientX, A.clientY);
726
+ }, D = (A) => {
727
+ A.pointerId === t.pointerId && (e.hasPointerCapture?.(t.pointerId) && e.releasePointerCapture(t.pointerId), Dt());
728
+ };
729
+ e.addEventListener("pointermove", k, {
730
+ signal: $.signal
731
+ }), e.addEventListener("pointerup", D, {
732
+ once: !0,
733
+ signal: $.signal
734
+ }), e.addEventListener("pointercancel", D, {
735
+ once: !0,
736
+ signal: $.signal
737
+ });
738
+ }, zo = async () => {
739
+ const t = _e();
740
+ !t || !It().trim() || (await Ce(t, It()), lt(null), ct(""));
741
+ }, Bo = async (t) => {
742
+ if (!t.text.trim()) {
743
+ Jt(t.id);
744
+ return;
745
+ }
746
+ try {
747
+ Xt(t.id), await navigator.clipboard.writeText(t.text), yo(t.id);
748
+ } catch (e) {
749
+ console.error(e), _.error("Copy failed", "Clipboard write was not available.");
750
+ }
751
+ }, Fo = (t, e) => {
752
+ if (e.button !== 0) return;
753
+ z(), e.preventDefault(), e.stopPropagation(), et?.(), Xt(t.id);
754
+ const o = Ho({
755
+ kind: "drag",
756
+ cursor: "grabbing"
757
+ }), a = Math.max(c.activeViewport().scale, 1e-3);
758
+ Nt({
759
+ noteId: t.id,
760
+ startClientX: e.clientX,
761
+ startClientY: e.clientY,
762
+ startX: t.x,
763
+ startY: t.y,
764
+ currentX: t.x,
765
+ currentY: t.y,
766
+ moved: !1,
767
+ scale: a,
768
+ stopInteraction: o
769
+ });
770
+ const v = (d) => {
771
+ Nt((s) => {
772
+ if (!s || s.noteId !== t.id) return s;
773
+ const l = s.startX + (d.clientX - s.startClientX) / s.scale, $ = s.startY + (d.clientY - s.startClientY) / s.scale, k = s.moved || Math.abs(l - s.startX) > 2 || Math.abs($ - s.startY) > 2;
774
+ return {
775
+ ...s,
776
+ currentX: l,
777
+ currentY: $,
778
+ moved: k
779
+ };
780
+ });
781
+ }, f = () => {
782
+ const d = Xe(St);
783
+ d && d.noteId === t.id && (c.moveNote(t.id, {
784
+ x: d.currentX,
785
+ y: d.currentY
786
+ }).catch((s) => {
787
+ _.error("Move failed", s instanceof Error ? s.message : String(s));
788
+ }), d.stopInteraction()), Nt(null), et?.(), et = void 0;
789
+ }, w = () => {
790
+ const d = Xe(St);
791
+ d && d.noteId === t.id && d.stopInteraction(), Nt(null), et?.(), et = void 0;
792
+ };
793
+ window.addEventListener("pointermove", v), window.addEventListener("pointerup", f, {
794
+ once: !0
795
+ }), window.addEventListener("pointercancel", w, {
796
+ once: !0
797
+ }), et = () => {
798
+ window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", f), window.removeEventListener("pointercancel", w);
799
+ };
800
+ }, Me = (t) => (() => {
801
+ var e = cn(), o = e.firstChild, a = o.firstChild, v = a.nextSibling, f = v.nextSibling, w = f.firstChild;
802
+ return e.$$pointerdown = (d) => d.stopPropagation(), Q(e, `notes-overview notes-overview--${t}`), o.$$pointerdown = Yo, i(o, r(st, {
803
+ get each() {
804
+ return wo();
805
+ },
806
+ children: (d) => (() => {
807
+ var s = He();
808
+ return N((l) => {
809
+ var $ = `notes-overview__note notes-note--${d.colorId}`, k = `${d.x}%`, D = `${d.y}%`, A = `${d.width}%`, R = `${d.height}%`;
810
+ return $ !== l.e && Q(s, l.e = $), k !== l.t && H(s, "left", l.t = k), D !== l.a && H(s, "top", l.a = D), A !== l.o && H(s, "width", l.o = A), R !== l.i && H(s, "height", l.i = R), l;
811
+ }, {
812
+ e: void 0,
813
+ t: void 0,
814
+ a: void 0,
815
+ o: void 0,
816
+ i: void 0
817
+ }), s;
818
+ })()
819
+ }), v), i(w, $e), i(o, r(S, {
820
+ when: t === "mobile",
821
+ get children() {
822
+ var d = ln(), s = d.firstChild, l = s.firstChild, $ = l.nextSibling, k = s.nextSibling;
823
+ return l.$$click = () => zt("out"), i(l, r(Be, {
824
+ class: "w-3.5 h-3.5"
825
+ })), $.$$click = () => zt("in"), i($, r(bt, {
826
+ class: "w-3.5 h-3.5"
827
+ })), k.$$click = () => F(!1), i(k, r(_t, {
828
+ class: "w-4 h-4"
829
+ })), d;
830
+ }
831
+ }), null), N((d) => {
832
+ var s = no() !== null, l = mo();
833
+ return s !== d.e && o.classList.toggle("is-navigating", d.e = s), d.t = Ro(v, l, d.t), d;
834
+ }, {
835
+ e: void 0,
836
+ t: void 0
837
+ }), e;
838
+ })();
839
+ return r(S, {
840
+ get when() {
841
+ return n.open;
842
+ },
843
+ get children() {
844
+ return [r(Z.section, {
845
+ class: "notes-overlay",
846
+ role: "region",
847
+ "aria-label": "Notes overlay",
848
+ initial: {
849
+ opacity: 0
850
+ },
851
+ animate: {
852
+ opacity: 1
853
+ },
854
+ get transition() {
855
+ return {
856
+ duration: j.fast
857
+ };
858
+ },
859
+ get children() {
860
+ return r(Z.div, {
861
+ class: "notes-overlay__frame",
862
+ initial: {
863
+ opacity: 0,
864
+ y: 18,
865
+ scale: 0.986
866
+ },
867
+ animate: {
868
+ opacity: 1,
869
+ y: 0,
870
+ scale: 1
871
+ },
872
+ get transition() {
873
+ return {
874
+ duration: j.normal,
875
+ easing: pt.easeOut
876
+ };
877
+ },
878
+ get children() {
879
+ return [(() => {
880
+ var t = dn(), e = t.firstChild, o = e.firstChild, a = o.nextSibling, v = a.nextSibling, f = v.firstChild, w = v.nextSibling, d = w.firstChild, s = w.nextSibling, l = s.firstChild, $ = e.nextSibling, k = $.firstChild;
881
+ return i(v, () => c.topics().length, f), i(w, me, d), i(w, () => me() === 1 ? "" : "s", null), i(s, () => c.trashCount(), l), k.$$click = bo, i(k, r(_t, {
882
+ class: "w-4 h-4"
883
+ })), t;
884
+ })(), (() => {
885
+ var t = fn(), e = t.firstChild, o = e.firstChild, a = o.firstChild, v = a.nextSibling, f = o.nextSibling, w = f.firstChild, d = f.nextSibling, s = e.nextSibling, l = s.firstChild, $ = l.firstChild, k = $.nextSibling, D = k.firstChild, A = D.nextSibling, R = A.nextSibling, q = l.nextSibling, ht = q.nextSibling;
886
+ i(v, () => c.topics().length), f.addEventListener("submit", xo), i(f, r(Ve, {
887
+ size: "sm",
888
+ get value() {
889
+ return B();
890
+ },
891
+ onInput: (u) => ft(u.currentTarget.value),
892
+ placeholder: "Add topic"
893
+ }), w), i(w, r(bt, {
894
+ class: "w-3.5 h-3.5"
895
+ })), i(d, r(st, {
896
+ get each() {
897
+ return c.topics();
898
+ },
899
+ children: (u) => {
900
+ const h = () => c.getLiveNoteCount(u.id);
901
+ return (() => {
902
+ var I = In(), x = I.firstChild, O = x.nextSibling, M = O.firstChild, ot = M.firstChild, V = O.nextSibling, nt = V.firstChild, C = nt.nextSibling, W = C.nextSibling;
903
+ return I.$$keydown = (m) => {
904
+ m.key !== "Enter" && m.key !== " " || (m.preventDefault(), c.setActiveTopic(u.id));
905
+ }, I.$$click = () => c.setActiveTopic(u.id), i(x, r(ae, {
906
+ get iconId() {
907
+ return u.iconId;
908
+ },
909
+ class: "notes-topic-mark__icon"
910
+ })), i(O, r(S, {
911
+ get when() {
912
+ return Rt() === u.id;
913
+ },
914
+ get fallback() {
915
+ return (() => {
916
+ var m = Sn(), P = m.firstChild;
917
+ return i(P, () => u.title), m;
918
+ })();
919
+ },
920
+ get children() {
921
+ var m = kn(), P = m.firstChild, J = P.nextSibling;
922
+ return m.$$click = (T) => T.stopPropagation(), m.addEventListener("submit", (T) => {
923
+ T.preventDefault(), T.stopPropagation(), To();
924
+ }), i(m, r(Ve, {
925
+ size: "sm",
926
+ get value() {
927
+ return le();
928
+ },
929
+ onInput: (T) => xt(T.currentTarget.value),
930
+ onKeyDown: (T) => {
931
+ T.key === "Escape" && (T.preventDefault(), T.stopPropagation(), Yt());
932
+ },
933
+ placeholder: "Topic name"
934
+ }), P), i(P, r(Ye, {
935
+ class: "w-3.5 h-3.5"
936
+ })), J.$$click = (T) => {
937
+ T.stopPropagation(), Yt();
938
+ }, i(J, r(_t, {
939
+ class: "w-3.5 h-3.5"
940
+ })), m;
941
+ }
942
+ }), M), i(M, h, ot), i(M, () => h() === 1 ? "" : "s", null), i(nt, h), C.$$click = (m) => {
943
+ m.stopPropagation(), Co(u);
944
+ }, i(C, r(ze, {
945
+ class: "w-3.5 h-3.5"
946
+ })), W.$$click = (m) => {
947
+ m.stopPropagation(), ko(u);
948
+ }, i(W, r(ee, {
949
+ class: "w-3.5 h-3.5"
950
+ })), N((m) => {
951
+ var P = `notes-topic-row notes-topic-tone--${u.toneId}`, J = u.id === c.activeTopicId(), T = `notes-topic-mark notes-topic-tone--${u.toneId}`, it = `Edit topic ${u.title}`, E = `Delete topic ${u.title}`, rt = c.topics().length <= 1;
952
+ return P !== m.e && Q(I, m.e = P), J !== m.t && I.classList.toggle("is-active", m.t = J), T !== m.a && Q(x, m.a = T), it !== m.o && G(C, "aria-label", m.o = it), E !== m.i && G(W, "aria-label", m.i = E), rt !== m.n && (W.disabled = m.n = rt), m;
953
+ }, {
954
+ e: void 0,
955
+ t: void 0,
956
+ a: void 0,
957
+ o: void 0,
958
+ i: void 0,
959
+ n: void 0
960
+ }), I;
961
+ })();
962
+ }
963
+ })), i($, r(S, {
964
+ get when() {
965
+ return U();
966
+ },
967
+ children: (u) => [(() => {
968
+ var h = He();
969
+ return i(h, r(ae, {
970
+ get iconId() {
971
+ return u().iconId;
972
+ },
973
+ class: "notes-topic-mark__icon"
974
+ })), N(() => Q(h, `notes-topic-mark notes-topic-mark--board notes-topic-tone--${u().toneId}`)), h;
975
+ })(), (() => {
976
+ var h = Nn(), I = h.firstChild, x = I.nextSibling, O = x.nextSibling, M = O.firstChild;
977
+ return i(x, () => u().title), i(O, () => Pt().length, M), i(O, () => Pt().length === 1 ? "" : "s", null), h;
978
+ })()]
979
+ })), D.$$click = () => zt("out"), i(D, r(Be, {
980
+ class: "w-3.5 h-3.5"
981
+ })), i(A, $e), R.$$click = () => zt("in"), i(R, r(bt, {
982
+ class: "w-3.5 h-3.5"
983
+ })), i(k, r(S, {
984
+ get when() {
985
+ return dt();
986
+ },
987
+ get children() {
988
+ var u = un();
989
+ return u.$$click = () => F(!0), i(u, r(Fe, {
990
+ class: "w-3.5 h-3.5"
991
+ })), u;
992
+ }
993
+ }), null), i(s, r(S, {
994
+ get when() {
995
+ return dt();
996
+ },
997
+ get children() {
998
+ var u = hn(), h = u.firstChild;
999
+ return i(h, r(st, {
1000
+ get each() {
1001
+ return c.topics();
1002
+ },
1003
+ children: (I) => (() => {
1004
+ var x = Mn();
1005
+ return x.$$click = () => c.setActiveTopic(I.id), i(x, () => I.title), N(() => x.classList.toggle("is-active", I.id === we())), x;
1006
+ })()
1007
+ })), u;
1008
+ }
1009
+ }), q);
1010
+ var vt = Et;
1011
+ return typeof vt == "function" ? Vo(vt, q) : Et = q, i(q, r(Qo, {
1012
+ get ariaLabel() {
1013
+ return `Canvas for ${po()}`;
1014
+ },
1015
+ class: "notes-canvas",
1016
+ get viewport() {
1017
+ return c.activeViewport();
1018
+ },
1019
+ onViewportChange: (u) => {
1020
+ const h = U();
1021
+ h && c.setViewport(h.id, u);
1022
+ },
1023
+ onCanvasContextMenu: (u) => {
1024
+ const h = U();
1025
+ h && Y({
1026
+ clientX: u.clientX,
1027
+ clientY: u.clientY,
1028
+ worldX: u.worldX,
1029
+ worldY: u.worldY,
1030
+ topicId: h.id
1031
+ });
1032
+ },
1033
+ get children() {
1034
+ var u = vn();
1035
+ return i(u, r(st, {
1036
+ get each() {
1037
+ return Pt();
1038
+ },
1039
+ children: (h) => {
1040
+ const I = y(() => h.sizeBucket), x = y(() => oe[I()]), O = y(() => Ke(h.text, x().previewLimit)), M = () => io() === h.id, ot = y(() => !h.text.trim()), V = () => St()?.noteId === h.id, nt = () => {
1041
+ const C = St();
1042
+ return C?.noteId === h.id ? {
1043
+ x: C.currentX,
1044
+ y: C.currentY
1045
+ } : {
1046
+ x: h.x,
1047
+ y: h.y
1048
+ };
1049
+ };
1050
+ return (() => {
1051
+ var C = Ln(), W = C.firstChild, m = W.firstChild, P = m.firstChild, J = P.nextSibling, T = J.firstChild, it = T.nextSibling, E = m.nextSibling, rt = E.firstChild;
1052
+ return C.$$click = () => Xt(h.id), C.$$contextmenu = (b) => {
1053
+ b.preventDefault(), b.stopPropagation(), Xt(h.id), Te(b.clientX, b.clientY, {
1054
+ topicId: h.topicId,
1055
+ noteId: h.id
1056
+ });
1057
+ }, P.$$pointerdown = (b) => Fo(h, b), i(P, r(Zo, {
1058
+ class: "w-3.5 h-3.5"
1059
+ })), T.$$click = () => Jt(h.id), i(T, r(ze, {
1060
+ class: "w-3.5 h-3.5"
1061
+ })), it.$$click = () => {
1062
+ Ne(h.id);
1063
+ }, i(it, r(ee, {
1064
+ class: "w-3.5 h-3.5"
1065
+ })), E.$$click = () => {
1066
+ Bo(h);
1067
+ }, i(rt, O), i(W, r(S, {
1068
+ get when() {
1069
+ return M();
1070
+ },
1071
+ get children() {
1072
+ var b = En(), at = b.firstChild, Bt = at.firstChild;
1073
+ return i(Bt, r(Ye, {
1074
+ class: "w-3.5 h-3.5"
1075
+ })), b;
1076
+ }
1077
+ }), null), N((b) => {
1078
+ var at = `notes-note notes-note--${h.colorId} notes-note--size-${I()}`, Bt = !!M(), Ee = !!V(), Le = `translate(${nt().x}px, ${nt().y}px)`, Ae = `${x().width}px`, Pe = `${x().height}px`, Oe = V() ? `${_o() + 1}` : `${h.layer}`, De = !!ot();
1079
+ return at !== b.e && Q(C, b.e = at), Bt !== b.t && C.classList.toggle("is-copied", b.t = Bt), Ee !== b.a && C.classList.toggle("is-dragging", b.a = Ee), Le !== b.o && H(C, "transform", b.o = Le), Ae !== b.i && H(C, "--note-width", b.i = Ae), Pe !== b.n && H(C, "--note-height", b.n = Pe), Oe !== b.s && H(C, "z-index", b.s = Oe), De !== b.h && E.classList.toggle("is-empty", b.h = De), b;
1080
+ }, {
1081
+ e: void 0,
1082
+ t: void 0,
1083
+ a: void 0,
1084
+ o: void 0,
1085
+ i: void 0,
1086
+ n: void 0,
1087
+ s: void 0,
1088
+ h: void 0
1089
+ }), C;
1090
+ })();
1091
+ }
1092
+ })), u;
1093
+ }
1094
+ })), i(s, r(S, {
1095
+ get when() {
1096
+ return !dt();
1097
+ },
1098
+ get children() {
1099
+ return Me("desktop");
1100
+ }
1101
+ }), ht), i(s, r(S, {
1102
+ get when() {
1103
+ return se(() => !!dt())() && !kt();
1104
+ },
1105
+ get children() {
1106
+ var u = pn(), h = u.firstChild, I = h.firstChild, x = h.nextSibling, O = x.firstChild, M = x.nextSibling, ot = M.firstChild;
1107
+ return h.$$click = Oo, i(h, r(bt, {
1108
+ class: "w-4 h-4"
1109
+ }), I), x.$$click = () => {
1110
+ Do();
1111
+ }, i(x, r(Re, {
1112
+ class: "w-4 h-4"
1113
+ }), O), M.$$click = () => F(!0), i(M, r(Fe, {
1114
+ class: "w-4 h-4"
1115
+ }), ot), u;
1116
+ }
1117
+ }), ht), i(ht, r(S, {
1118
+ get when() {
1119
+ return !gt();
1120
+ },
1121
+ get children() {
1122
+ var u = _n(), h = u.firstChild;
1123
+ return u.$$click = () => Tt(!0), i(h, r(Je, {
1124
+ class: "notes-trash__toggle-icon"
1125
+ })), N(() => G(u, "aria-label", `Open trash dock${c.trashCount() > 0 ? `, ${c.trashCount()} items` : ""}`)), u;
1126
+ }
1127
+ })), N(() => ht.classList.toggle("is-open", !!gt())), t;
1128
+ })()];
1129
+ }
1130
+ });
1131
+ }
1132
+ }), r($t, {
1133
+ get children() {
1134
+ return r(S, {
1135
+ get when() {
1136
+ return se(() => !!dt())() && kt();
1137
+ },
1138
+ get children() {
1139
+ return [r(Z.div, {
1140
+ class: "notes-overview-backdrop",
1141
+ initial: {
1142
+ opacity: 0
1143
+ },
1144
+ animate: {
1145
+ opacity: 1
1146
+ },
1147
+ exit: {
1148
+ opacity: 0
1149
+ },
1150
+ get transition() {
1151
+ return {
1152
+ duration: j.fast
1153
+ };
1154
+ },
1155
+ onClick: () => F(!1)
1156
+ }), r(Z.div, {
1157
+ class: "notes-overview-flyout",
1158
+ initial: {
1159
+ opacity: 0,
1160
+ y: 18,
1161
+ scale: 0.98
1162
+ },
1163
+ animate: {
1164
+ opacity: 1,
1165
+ y: 0,
1166
+ scale: 1
1167
+ },
1168
+ exit: {
1169
+ opacity: 0,
1170
+ y: 18,
1171
+ scale: 0.98
1172
+ },
1173
+ get transition() {
1174
+ return {
1175
+ duration: j.normal,
1176
+ easing: pt.easeOut
1177
+ };
1178
+ },
1179
+ get children() {
1180
+ return Me("mobile");
1181
+ }
1182
+ })];
1183
+ }
1184
+ });
1185
+ }
1186
+ }), r($t, {
1187
+ get children() {
1188
+ return r(S, {
1189
+ get when() {
1190
+ return gt();
1191
+ },
1192
+ get children() {
1193
+ return [r(Z.div, {
1194
+ class: "notes-trash-backdrop",
1195
+ initial: {
1196
+ opacity: 0
1197
+ },
1198
+ animate: {
1199
+ opacity: 1
1200
+ },
1201
+ exit: {
1202
+ opacity: 0
1203
+ },
1204
+ get transition() {
1205
+ return {
1206
+ duration: j.fast
1207
+ };
1208
+ },
1209
+ onContextMenu: (t) => {
1210
+ t.preventDefault(), t.stopPropagation(), ut(), Te(t.clientX, t.clientY);
1211
+ },
1212
+ onClick: ut
1213
+ }), r(Z.div, {
1214
+ class: "notes-trash__flyout",
1215
+ initial: {
1216
+ opacity: 0,
1217
+ y: 18,
1218
+ scale: 0.98
1219
+ },
1220
+ animate: {
1221
+ opacity: 1,
1222
+ y: 0,
1223
+ scale: 1
1224
+ },
1225
+ exit: {
1226
+ opacity: 0,
1227
+ y: 20,
1228
+ scale: 0.98
1229
+ },
1230
+ get transition() {
1231
+ return {
1232
+ duration: j.normal,
1233
+ easing: pt.easeOut
1234
+ };
1235
+ },
1236
+ get children() {
1237
+ var t = wn(), e = t.firstChild, o = e.firstChild, a = o.firstChild, v = a.firstChild, f = v.nextSibling, w = f.firstChild, d = w.firstChild, s = w.nextSibling;
1238
+ return t.$$contextmenu = (l) => {
1239
+ l.preventDefault(), l.stopPropagation();
1240
+ }, t.$$pointerdown = (l) => l.stopPropagation(), i(w, () => c.trashCount(), d), s.$$click = ut, i(s, r(_t, {
1241
+ class: "w-4 h-4"
1242
+ })), i(t, r(S, {
1243
+ get when() {
1244
+ return ye().length > 0;
1245
+ },
1246
+ get fallback() {
1247
+ return (() => {
1248
+ var l = An(), $ = l.firstChild;
1249
+ return i(l, r(Je, {
1250
+ class: "notes-trash__empty-icon"
1251
+ }), $), l;
1252
+ })();
1253
+ },
1254
+ get children() {
1255
+ var l = gn();
1256
+ return i(l, r(st, {
1257
+ get each() {
1258
+ return ye();
1259
+ },
1260
+ children: ($) => (() => {
1261
+ var k = Pn(), D = k.firstChild, A = D.firstChild, R = A.firstChild, q = R.firstChild, ht = q.nextSibling, vt = R.nextSibling, u = vt.firstChild, h = A.nextSibling, I = D.nextSibling;
1262
+ return i(q, r(ae, {
1263
+ get iconId() {
1264
+ return $.topic.iconId;
1265
+ },
1266
+ class: "notes-topic-mark__icon"
1267
+ })), i(ht, () => $.topic.title), i(vt, () => $.notes.length, u), i(vt, () => $.notes.length === 1 ? "" : "s", null), h.$$click = () => {
1268
+ Ao($.topic.id);
1269
+ }, i(I, r(st, {
1270
+ get each() {
1271
+ return $.notes;
1272
+ },
1273
+ children: (x) => {
1274
+ const O = x.sizeBucket, M = oe[O], ot = Ke(x.text, M.previewLimit);
1275
+ return (() => {
1276
+ var V = Dn(), nt = V.firstChild, C = nt.firstChild, W = C.firstChild, m = W.nextSibling, P = C.nextSibling, J = P.firstChild, T = P.nextSibling, it = T.firstChild;
1277
+ return i(W, () => Zn(x.deletedAt)), i(m, () => Hn(x.deletedAt, ao())), i(J, ot), it.$$click = () => {
1278
+ Eo(x.id);
1279
+ }, i(T, r(S, {
1280
+ get when() {
1281
+ return !!n.controller.deleteTrashedNotePermanently;
1282
+ },
1283
+ get children() {
1284
+ var E = On();
1285
+ return E.$$click = () => {
1286
+ Lo(x.id);
1287
+ }, E;
1288
+ }
1289
+ }), null), N((E) => {
1290
+ var rt = `notes-note notes-trash-note notes-note--${x.colorId} notes-note--size-${O}`, b = `${M.width}px`, at = `${M.height}px`;
1291
+ return rt !== E.e && Q(V, E.e = rt), b !== E.t && H(V, "--note-width", E.t = b), at !== E.a && H(V, "--note-height", E.a = at), E;
1292
+ }, {
1293
+ e: void 0,
1294
+ t: void 0,
1295
+ a: void 0
1296
+ }), V;
1297
+ })();
1298
+ }
1299
+ })), N(() => Q(q, `notes-topic-mark notes-topic-mark--trash notes-topic-tone--${$.topic.toneId}`)), k;
1300
+ })()
1301
+ })), l;
1302
+ }
1303
+ }), null), t;
1304
+ }
1305
+ })];
1306
+ }
1307
+ });
1308
+ }
1309
+ }), r($t, {
1310
+ get children() {
1311
+ return r(S, {
1312
+ get when() {
1313
+ return p();
1314
+ },
1315
+ get children() {
1316
+ return [r(Z.div, {
1317
+ class: "notes-menu-backdrop",
1318
+ initial: {
1319
+ opacity: 0
1320
+ },
1321
+ animate: {
1322
+ opacity: 1
1323
+ },
1324
+ exit: {
1325
+ opacity: 0
1326
+ },
1327
+ get transition() {
1328
+ return {
1329
+ duration: j.fast
1330
+ };
1331
+ },
1332
+ onClick: z
1333
+ }), r(Z.div, {
1334
+ class: "notes-menu",
1335
+ get style() {
1336
+ return $o();
1337
+ },
1338
+ initial: {
1339
+ opacity: 0,
1340
+ y: 10,
1341
+ scale: 0.97
1342
+ },
1343
+ animate: {
1344
+ opacity: 1,
1345
+ y: 0,
1346
+ scale: 1
1347
+ },
1348
+ exit: {
1349
+ opacity: 0,
1350
+ y: 12,
1351
+ scale: 0.97
1352
+ },
1353
+ get transition() {
1354
+ return {
1355
+ duration: j.fast,
1356
+ easing: pt.easeOut
1357
+ };
1358
+ },
1359
+ onPointerDown: (t) => t.stopPropagation(),
1360
+ get children() {
1361
+ return [(() => {
1362
+ var t = mn(), e = t.firstChild;
1363
+ return t.$$click = () => {
1364
+ Mo();
1365
+ }, i(t, r(Re, {
1366
+ class: "w-4 h-4"
1367
+ }), e), t;
1368
+ })(), (() => {
1369
+ var t = $n(), e = t.firstChild;
1370
+ return t.$$click = No, i(t, r(bt, {
1371
+ class: "w-4 h-4"
1372
+ }), e), t;
1373
+ })(), r(S, {
1374
+ get when() {
1375
+ return !!p()?.noteId;
1376
+ },
1377
+ get children() {
1378
+ var t = bn(), e = t.firstChild;
1379
+ return t.$$click = () => {
1380
+ Po();
1381
+ }, i(t, r(ee, {
1382
+ class: "w-4 h-4"
1383
+ }), e), t;
1384
+ }
1385
+ })];
1386
+ }
1387
+ })];
1388
+ }
1389
+ });
1390
+ }
1391
+ }), r($t, {
1392
+ get children() {
1393
+ return r(S, {
1394
+ get when() {
1395
+ return !!Gt();
1396
+ },
1397
+ get children() {
1398
+ return r(Z.div, {
1399
+ class: "notes-flyout notes-flyout--editor",
1400
+ initial: {
1401
+ opacity: 0,
1402
+ x: 24,
1403
+ scale: 0.985
1404
+ },
1405
+ animate: {
1406
+ opacity: 1,
1407
+ x: 0,
1408
+ scale: 1
1409
+ },
1410
+ exit: {
1411
+ opacity: 0,
1412
+ x: 20,
1413
+ scale: 0.985
1414
+ },
1415
+ get transition() {
1416
+ return {
1417
+ duration: j.normal,
1418
+ easing: pt.easeOut
1419
+ };
1420
+ },
1421
+ onPointerDown: (t) => t.stopPropagation(),
1422
+ get children() {
1423
+ return [(() => {
1424
+ var t = yn(), e = t.firstChild, o = e.firstChild, a = o.nextSibling, v = e.nextSibling;
1425
+ return i(a, () => Gt()?.text.trim() ? "Refine note" : "Compose note"), v.$$click = Qt, i(v, r(_t, {
1426
+ class: "w-4 h-4"
1427
+ })), t;
1428
+ })(), (() => {
1429
+ var t = xn(), e = t.firstChild, o = e.firstChild, a = o.nextSibling, v = e.nextSibling;
1430
+ return v.firstChild, i(a, r(st, {
1431
+ get each() {
1432
+ return c.colorOptions;
1433
+ },
1434
+ children: (f) => (() => {
1435
+ var w = Xn(), d = w.firstChild;
1436
+ return w.$$click = () => ve(f.id), i(d, () => f.name), N((s) => {
1437
+ var l = `notes-editor__swatch notes-note--${f.id}`, $ = he() === f.id;
1438
+ return l !== s.e && Q(w, s.e = l), $ !== s.t && w.classList.toggle("is-active", s.t = $), s;
1439
+ }, {
1440
+ e: void 0,
1441
+ t: void 0
1442
+ }), w;
1443
+ })()
1444
+ })), i(v, r(We, {
1445
+ rows: 10,
1446
+ get value() {
1447
+ return de();
1448
+ },
1449
+ onInput: (f) => ue(f.currentTarget.value),
1450
+ placeholder: "Type or paste anything worth keeping..."
1451
+ }), null), t;
1452
+ })(), (() => {
1453
+ var t = Ze();
1454
+ return i(t, r(Ft, {
1455
+ variant: "ghost",
1456
+ onClick: Qt,
1457
+ children: "Cancel"
1458
+ }), null), i(t, r(Ft, {
1459
+ variant: "primary",
1460
+ onClick: () => {
1461
+ Io();
1462
+ },
1463
+ children: "Save"
1464
+ }), null), t;
1465
+ })()];
1466
+ }
1467
+ });
1468
+ }
1469
+ });
1470
+ }
1471
+ }), r($t, {
1472
+ get children() {
1473
+ return r(S, {
1474
+ get when() {
1475
+ return !!_e();
1476
+ },
1477
+ get children() {
1478
+ return r(Z.div, {
1479
+ class: "notes-flyout notes-flyout--paste",
1480
+ initial: {
1481
+ opacity: 0,
1482
+ x: 24,
1483
+ scale: 0.985
1484
+ },
1485
+ animate: {
1486
+ opacity: 1,
1487
+ x: 0,
1488
+ scale: 1
1489
+ },
1490
+ exit: {
1491
+ opacity: 0,
1492
+ x: 20,
1493
+ scale: 0.985
1494
+ },
1495
+ get transition() {
1496
+ return {
1497
+ duration: j.normal,
1498
+ easing: pt.easeOut
1499
+ };
1500
+ },
1501
+ onPointerDown: (t) => t.stopPropagation(),
1502
+ get children() {
1503
+ return [(() => {
1504
+ var t = Cn(), e = t.firstChild, o = e.nextSibling;
1505
+ return o.$$click = () => {
1506
+ lt(null), ct("");
1507
+ }, i(o, r(_t, {
1508
+ class: "w-4 h-4"
1509
+ })), t;
1510
+ })(), (() => {
1511
+ var t = Tn();
1512
+ return i(t, r(We, {
1513
+ rows: 12,
1514
+ get value() {
1515
+ return It();
1516
+ },
1517
+ onInput: (e) => ct(e.currentTarget.value),
1518
+ placeholder: "Paste clipboard text here..."
1519
+ })), t;
1520
+ })(), (() => {
1521
+ var t = Ze();
1522
+ return i(t, r(Ft, {
1523
+ variant: "ghost",
1524
+ onClick: () => {
1525
+ lt(null), ct("");
1526
+ },
1527
+ children: "Cancel"
1528
+ }), null), i(t, r(Ft, {
1529
+ variant: "primary",
1530
+ get disabled() {
1531
+ return !It().trim();
1532
+ },
1533
+ onClick: () => {
1534
+ zo();
1535
+ },
1536
+ children: "Create note"
1537
+ }), null), t;
1538
+ })()];
1539
+ }
1540
+ });
1541
+ }
1542
+ });
1543
+ }
1544
+ })];
1545
+ }
1546
+ });
1547
+ }
1548
+ Wo(["pointerdown", "click", "contextmenu", "keydown"]);
1549
+ export {
1550
+ ii as NotesOverlay
1551
+ };