@brett_lamy/ui 5.1.0 → 5.2.0

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 (155) hide show
  1. package/dist/components/adaptive-pane.d.ts +12 -1
  2. package/dist/components/adaptive-pane.d.ts.map +1 -1
  3. package/dist/components/adaptive-pane.js +122 -19
  4. package/dist/components/avatar.d.ts +47 -5
  5. package/dist/components/avatar.d.ts.map +1 -1
  6. package/dist/components/avatar.js +101 -14
  7. package/dist/components/breadcrumb.d.ts +87 -0
  8. package/dist/components/breadcrumb.d.ts.map +1 -0
  9. package/dist/components/breadcrumb.js +312 -0
  10. package/dist/components/color-picker.js +15 -15
  11. package/dist/components/command-menu.js +13 -13
  12. package/dist/components/credenza.d.ts +5 -2
  13. package/dist/components/credenza.d.ts.map +1 -1
  14. package/dist/components/credenza.js +62 -60
  15. package/dist/components/date-picker.js +9 -9
  16. package/dist/components/edge-drawer.d.ts +7 -2
  17. package/dist/components/edge-drawer.d.ts.map +1 -1
  18. package/dist/components/edge-drawer.js +7 -4
  19. package/dist/components/filmstrip.d.ts +19 -0
  20. package/dist/components/filmstrip.d.ts.map +1 -0
  21. package/dist/components/filmstrip.js +59 -0
  22. package/dist/components/filter-input.js +4 -4
  23. package/dist/components/filter.js +62 -62
  24. package/dist/components/font-picker.d.ts +67 -0
  25. package/dist/components/font-picker.d.ts.map +1 -0
  26. package/dist/components/font-picker.js +373 -0
  27. package/dist/components/markdown-editor.d.ts +11 -0
  28. package/dist/components/markdown-editor.d.ts.map +1 -1
  29. package/dist/components/markdown-editor.js +72 -65
  30. package/dist/components/navigation-stack.d.ts.map +1 -1
  31. package/dist/components/navigation-stack.js +75 -65
  32. package/dist/components/number-morph.d.ts.map +1 -1
  33. package/dist/components/number-morph.js +5 -5
  34. package/dist/components/replay-preview.d.ts +2 -2
  35. package/dist/components/replay-preview.d.ts.map +1 -1
  36. package/dist/components/replay-preview.js +3 -3
  37. package/dist/components/result-table.js +10 -10
  38. package/dist/components/schema-tree.d.ts.map +1 -1
  39. package/dist/components/schema-tree.js +62 -131
  40. package/dist/components/segmented.d.ts +1 -1
  41. package/dist/components/segmented.d.ts.map +1 -1
  42. package/dist/components/segmented.js +1 -1
  43. package/dist/components/sidebar.d.ts.map +1 -1
  44. package/dist/components/sidebar.js +8 -4
  45. package/dist/components/split-view.d.ts +3 -1
  46. package/dist/components/split-view.d.ts.map +1 -1
  47. package/dist/components/split-view.js +211 -211
  48. package/dist/components/spreadsheet.d.ts +58 -0
  49. package/dist/components/spreadsheet.d.ts.map +1 -0
  50. package/dist/components/spreadsheet.js +804 -0
  51. package/dist/components/sql-console.d.ts.map +1 -1
  52. package/dist/components/sql-console.js +2 -1
  53. package/dist/components/sql-editor.js +8 -8
  54. package/dist/components/stl-viewer.d.ts +3 -0
  55. package/dist/components/stl-viewer.d.ts.map +1 -0
  56. package/dist/components/stl-viewer.js +2 -0
  57. package/dist/components/strudel-player.d.ts +3 -0
  58. package/dist/components/strudel-player.d.ts.map +1 -0
  59. package/dist/components/strudel-player.js +2 -0
  60. package/dist/components/strudel-rack.d.ts +3 -0
  61. package/dist/components/strudel-rack.d.ts.map +1 -0
  62. package/dist/components/strudel-rack.js +2 -0
  63. package/dist/components/strudel-syntax.d.ts +3 -0
  64. package/dist/components/strudel-syntax.d.ts.map +1 -0
  65. package/dist/components/strudel-syntax.js +2 -0
  66. package/dist/components/tabs.js +3 -3
  67. package/dist/components/tailscale-menu.d.ts +69 -0
  68. package/dist/components/tailscale-menu.d.ts.map +1 -0
  69. package/dist/components/tailscale-menu.js +202 -0
  70. package/dist/components/toggle-group.js +3 -3
  71. package/dist/components/tree.d.ts +82 -0
  72. package/dist/components/tree.d.ts.map +1 -0
  73. package/dist/components/tree.js +494 -0
  74. package/dist/components/video-preview.d.ts +46 -0
  75. package/dist/components/video-preview.d.ts.map +1 -0
  76. package/dist/components/video-preview.js +197 -0
  77. package/dist/components/video-timeline.d.ts +64 -0
  78. package/dist/components/video-timeline.d.ts.map +1 -0
  79. package/dist/components/video-timeline.js +479 -0
  80. package/dist/components/waveform.d.ts +23 -0
  81. package/dist/components/waveform.d.ts.map +1 -0
  82. package/dist/components/waveform.js +56 -0
  83. package/dist/ffmpeg-worker.js +118 -0
  84. package/dist/index.css +1 -1
  85. package/dist/index.d.ts +48 -4
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +145 -121
  88. package/dist/lib/csv.d.ts +28 -0
  89. package/dist/lib/csv.d.ts.map +1 -0
  90. package/dist/lib/csv.js +90 -0
  91. package/dist/lib/drawer-swipe.d.ts +31 -0
  92. package/dist/lib/drawer-swipe.d.ts.map +1 -0
  93. package/dist/lib/drawer-swipe.js +68 -0
  94. package/dist/lib/ffmpeg/index.d.ts +117 -0
  95. package/dist/lib/ffmpeg/index.d.ts.map +1 -0
  96. package/dist/lib/ffmpeg/index.js +204 -0
  97. package/dist/lib/ffmpeg/media.d.ts +39 -0
  98. package/dist/lib/ffmpeg/media.d.ts.map +1 -0
  99. package/dist/lib/ffmpeg/media.js +100 -0
  100. package/dist/lib/ffmpeg/react.d.ts +51 -0
  101. package/dist/lib/ffmpeg/react.d.ts.map +1 -0
  102. package/dist/lib/ffmpeg/react.js +113 -0
  103. package/dist/lib/google-fonts.d.ts +47 -0
  104. package/dist/lib/google-fonts.d.ts.map +1 -0
  105. package/dist/lib/google-fonts.generated.d.ts +2 -0
  106. package/dist/lib/google-fonts.generated.d.ts.map +1 -0
  107. package/dist/lib/google-fonts.generated.js +1925 -0
  108. package/dist/lib/google-fonts.js +112 -0
  109. package/dist/lib/icon.d.ts +6 -1
  110. package/dist/lib/icon.d.ts.map +1 -1
  111. package/dist/lib/icon.js +2 -0
  112. package/dist/lib/playback.d.ts +34 -0
  113. package/dist/lib/playback.d.ts.map +1 -0
  114. package/dist/lib/playback.js +79 -0
  115. package/dist/lib/spreadsheet-gpu.d.ts +9 -0
  116. package/dist/lib/spreadsheet-gpu.d.ts.map +1 -0
  117. package/dist/lib/spreadsheet-gpu.js +237 -0
  118. package/dist/lib/spreadsheet.d.ts +82 -0
  119. package/dist/lib/spreadsheet.d.ts.map +1 -0
  120. package/dist/lib/spreadsheet.js +162 -0
  121. package/dist/lib/syntax.d.ts +2 -6
  122. package/dist/lib/syntax.d.ts.map +1 -1
  123. package/dist/lib/syntax.js +53 -75
  124. package/dist/lib/tailscale-connect.d.ts +33 -0
  125. package/dist/lib/tailscale-connect.d.ts.map +1 -1
  126. package/dist/lib/tailscale-connect.js +221 -42
  127. package/dist/lib/tailscale-exit.d.ts +19 -0
  128. package/dist/lib/tailscale-exit.d.ts.map +1 -0
  129. package/dist/lib/tailscale-exit.js +14 -0
  130. package/dist/lib/tailscale-fake.d.ts +8 -0
  131. package/dist/lib/tailscale-fake.d.ts.map +1 -1
  132. package/dist/lib/tailscale-fake.js +51 -26
  133. package/dist/lib/tailscale-roots.d.ts +3 -0
  134. package/dist/lib/tailscale-roots.d.ts.map +1 -0
  135. package/dist/lib/tailscale-roots.js +4 -0
  136. package/dist/lib/tailscale.d.ts +23 -0
  137. package/dist/lib/tailscale.d.ts.map +1 -1
  138. package/dist/lib/tailscale.js +156 -94
  139. package/dist/lib/title-flight.d.ts +4 -0
  140. package/dist/lib/title-flight.d.ts.map +1 -1
  141. package/dist/lib/title-flight.js +15 -12
  142. package/dist/lib/tokens.generated.d.ts +2 -2
  143. package/dist/lib/tokens.generated.d.ts.map +1 -1
  144. package/dist/lib/tokens.generated.js +2 -2
  145. package/dist/lib/video-render.d.ts +38 -0
  146. package/dist/lib/video-render.d.ts.map +1 -0
  147. package/dist/lib/video-render.js +147 -0
  148. package/dist/lib/video-timeline.d.ts +154 -0
  149. package/dist/lib/video-timeline.d.ts.map +1 -0
  150. package/dist/lib/video-timeline.js +265 -0
  151. package/dist/lib/webgpu.d.ts +26 -0
  152. package/dist/lib/webgpu.d.ts.map +1 -0
  153. package/dist/lib/webgpu.js +28 -0
  154. package/dist/theme.css +3 -0
  155. package/package.json +8 -3
@@ -12,7 +12,8 @@ function n(e) {
12
12
  return {
13
13
  v: 1,
14
14
  hostname: t.hostname,
15
- state: n
15
+ state: n,
16
+ ...typeof t.exitNodeId == "string" ? { exitNodeId: t.exitNodeId } : {}
16
17
  };
17
18
  }
18
19
  function r() {
@@ -79,6 +80,7 @@ var c = Object.freeze({
79
80
  tailnet: null,
80
81
  addresses: [],
81
82
  peers: [],
83
+ exitNodeId: null,
82
84
  hasSession: !1
83
85
  });
84
86
  function l(e) {
@@ -99,56 +101,57 @@ function d(e) {
99
101
  return t.length > 2 ? t.slice(1).join(".") : null;
100
102
  }
101
103
  function f(n = {}) {
102
- let i = t(n.policy), a = n.auth ?? { mode: "interactive" }, s = n.persistence ?? r(), f = n.lockName === !1 ? null : `bl-tailscale:${n.lockName ?? "default"}`, p = /* @__PURE__ */ new Set(), m = c, h = null, g = null, _ = 0, v = "NoState", y = !1, b = null, x = null, S = null, C = null, w = null, T = null, E = null, D = null, O = 0, k = null, A = () => ({
104
+ let i = t(n.policy), a = n.auth ?? { mode: "interactive" }, s = n.persistence ?? r(), f = n.lockName === !1 ? null : `bl-tailscale:${n.lockName ?? "default"}`, p = /* @__PURE__ */ new Set(), m = c, h = null, g = null, _ = 0, v = "NoState", y = !1, b = null, x = !1, S = [], C = 0, w = null, T = null, E = null, D = null, O = null, k = null, A = null, j = null, M = 0, N = null, P = () => ({
103
105
  open: n.env?.open === void 0 ? typeof window < "u" ? (e, t, n) => window.open(e, t, n) : null : n.env.open,
104
106
  locks: n.env?.locks === void 0 ? typeof navigator < "u" && navigator.locks ? navigator.locks : null : n.env.locks
105
107
  });
106
- function j(e) {
108
+ function F(e) {
107
109
  let t = {
108
110
  ...m,
109
111
  ...e
110
112
  };
111
113
  Object.keys(e).every((e) => Object.is(t[e], m[e])) || (m = t, p.forEach((e) => e()));
112
114
  }
113
- function M(e) {
114
- L(), V(), y = !1, j({
115
+ function I(e) {
116
+ V(), q(), y = !1, F({
115
117
  status: "error",
116
118
  error: e,
117
119
  loginUrl: null
118
120
  });
119
121
  }
120
- function N() {
121
- return S ||= s.load().then((e) => {
122
- x = e, j({ hasSession: e !== null });
122
+ function L() {
123
+ return E ||= s.load().then((e) => {
124
+ T = e, F({ hasSession: e !== null });
123
125
  }, (e) => {
124
- throw S = null, new o("storage", "Could not read the saved Tailscale session.", { cause: e });
125
- }), S;
126
+ throw E = null, new o("storage", "Could not read the saved Tailscale session.", { cause: e });
127
+ }), E;
126
128
  }
127
- function P(e, t) {
128
- w = e, !C && (C = setTimeout(() => void F(t), 250));
129
+ function R(e, t) {
130
+ O = e, !D && (D = setTimeout(() => void z(t), 250));
129
131
  }
130
- async function F(e) {
131
- C && clearTimeout(C), C = null;
132
- let t = w;
133
- if (w = null, t) {
134
- x = {
132
+ async function z(e) {
133
+ D && clearTimeout(D), D = null;
134
+ let t = O;
135
+ if (O = null, t) {
136
+ T = {
135
137
  v: 1,
136
138
  hostname: e,
137
- state: t
139
+ state: t,
140
+ ...T?.exitNodeId ? { exitNodeId: T.exitNodeId } : {}
138
141
  };
139
142
  try {
140
- await s.save(x), j({
143
+ await s.save(T), F({
141
144
  hasSession: !0,
142
145
  warning: null
143
146
  });
144
147
  } catch {
145
- j({ warning: "The Tailscale session couldn't be saved; you will be asked to sign in again next time." });
148
+ F({ warning: "The Tailscale session couldn't be saved; you will be asked to sign in again next time." });
146
149
  }
147
150
  }
148
151
  }
149
- function I() {
152
+ function B() {
150
153
  if (n.popup === !1) return;
151
- let e = A().open;
154
+ let e = P().open;
152
155
  if (!(!e || b && !b.closed)) {
153
156
  try {
154
157
  b = e("", "bl-tailscale-login", "popup,width=520,height=720");
@@ -161,27 +164,27 @@ function f(n = {}) {
161
164
  } catch {}
162
165
  }
163
166
  }
164
- function L() {
165
- let e = b;
166
- b = null;
167
- try {
167
+ function V() {
168
+ let e = b, t = x;
169
+ if (b = null, x = !1, !t) try {
168
170
  e && !e.closed && e.close();
169
171
  } catch {}
170
172
  }
171
- function R(e) {
172
- if (e === null) return j({ loginUrl: null });
173
- if (!l(e)) return M(new o("login-url", `Refused to open the sign-in URL ${JSON.stringify(e.slice(0, 80))}.`));
174
- j({ loginUrl: e });
175
- let t = b;
176
- if (t && !t.closed) try {
177
- t.opener = null, t.location.replace(e);
173
+ function H(e) {
174
+ if (e === null) return F({ loginUrl: null });
175
+ if (!l(e)) return I(new o("login-url", `Refused to open the sign-in URL ${JSON.stringify(e.slice(0, 80))}.`));
176
+ let t = m.loginUrl === e;
177
+ F({ loginUrl: e });
178
+ let r = b;
179
+ if (r && !x && !r.closed) try {
180
+ r.opener = null, r.location.replace(e), x = !0;
178
181
  return;
179
182
  } catch {
180
183
  b = null;
181
184
  }
182
- n.onLoginUrl?.(e);
185
+ x && t || n.onLoginUrl?.(e);
183
186
  }
184
- function z() {
187
+ function U() {
185
188
  switch (v) {
186
189
  case "Running": return "connected";
187
190
  case "Starting": return y ? "signing-in" : "starting";
@@ -192,46 +195,82 @@ function f(n = {}) {
192
195
  default: return "error";
193
196
  }
194
197
  }
195
- function B(e, t) {
198
+ function W(e, t) {
196
199
  if (e === _) {
197
200
  if (t.error) {
198
- W(!1), M(new o("client", t.error));
201
+ let e = v === "Running";
202
+ X(!1).then(() => {
203
+ F({ exitNodeId: null }), e && T && Date.now() - C > 6e4 ? (C = Date.now(), F({
204
+ status: "loading",
205
+ warning: "Tailscale stopped unexpectedly and is reconnecting."
206
+ }), Y().catch((e) => I(e instanceof o ? e : new o("client", t.error)))) : I(new o("client", t.error));
207
+ });
199
208
  return;
200
209
  }
201
210
  if (t.netMap !== void 0) {
202
211
  let e = t.netMap;
203
212
  if (e?.lockedOut) {
204
- M(new o("locked-out", "Tailnet lock: this device is not signed."));
213
+ I(new o("locked-out", "Tailnet lock: this device is not signed."));
205
214
  return;
206
215
  }
207
216
  let n = e?.self.name.replace(/\.$/, "") || null;
208
- j({
217
+ F({
209
218
  selfName: n,
210
219
  tailnet: d(n),
211
220
  addresses: e?.self.addresses ?? [],
212
221
  peers: (e?.peers ?? []).map((e) => ({
213
222
  name: e.name.replace(/\.$/, ""),
214
223
  addresses: e.addresses,
215
- online: e.online === !0
216
- }))
224
+ online: e.online === !0,
225
+ id: e.id ?? null,
226
+ exitNode: e.exitNodeOption === !0
227
+ })),
228
+ ...e?.selectedExitNodeId === void 0 ? e === null ? { exitNodeId: null } : {} : { exitNodeId: e.selectedExitNodeId }
217
229
  });
218
230
  }
219
- if (t.loginUrl !== void 0 && R(t.loginUrl), t.state) {
220
- if (v = t.state, v === "InUseOtherUser") return M(new o("in-use", "The session belongs to a different user."));
221
- v === "Running" && (y = !1, V(), L(), j({ loginUrl: null }));
231
+ if (t.loginUrl !== void 0 && H(t.loginUrl), t.state) {
232
+ if (v = t.state, v !== "NoState" && v !== "Starting") {
233
+ let e = S;
234
+ S = [], e.forEach((e) => e(v));
235
+ }
236
+ if (v === "InUseOtherUser") return I(new o("in-use", "The session belongs to a different user."));
237
+ v === "Running" && (y = !1, q(), V(), F({ loginUrl: null }), G(e));
222
238
  }
223
- (m.status !== "error" || t.state === "Running") && j({
224
- status: z(),
239
+ (m.status !== "error" || t.state === "Running") && F({
240
+ status: U(),
225
241
  ...t.state === "Running" ? { error: null } : {}
226
242
  });
227
243
  }
228
244
  }
229
- function V() {
230
- D && clearTimeout(D), D = null;
245
+ function G(e) {
246
+ let t = T?.exitNodeId;
247
+ if (!t || m.exitNodeId === t || !h?.setExitNode) return;
248
+ let n = h;
249
+ setTimeout(() => {
250
+ e === _ && h === n && m.exitNodeId !== t && m.peers.some((e) => e.id === t && e.exitNode) && Promise.resolve(n.setExitNode(t)).then(() => {
251
+ e === _ && F({
252
+ exitNodeId: t,
253
+ warning: null
254
+ });
255
+ }, () => {});
256
+ }, 250);
257
+ }
258
+ function K(e) {
259
+ return v !== "NoState" && v !== "Starting" ? Promise.resolve(v) : new Promise((t) => {
260
+ let n = setTimeout(() => {
261
+ S = S.filter((e) => e !== r), t(null);
262
+ }, e), r = (e) => {
263
+ clearTimeout(n), t(e);
264
+ };
265
+ S.push(r);
266
+ });
231
267
  }
232
- async function H() {
233
- if (!f || T) return !0;
234
- let e = A().locks;
268
+ function q() {
269
+ j && clearTimeout(j), j = null;
270
+ }
271
+ async function J() {
272
+ if (!f || k) return !0;
273
+ let e = P().locks;
235
274
  return !e || new Promise((t) => {
236
275
  e.request(f, { ifAvailable: !0 }, (e) => {
237
276
  if (!e) {
@@ -239,21 +278,21 @@ function f(n = {}) {
239
278
  return;
240
279
  }
241
280
  return t(!0), new Promise((e) => {
242
- T = e;
281
+ k = e;
243
282
  });
244
283
  }).catch(() => t(!0));
245
284
  });
246
285
  }
247
- async function U(e) {
286
+ async function Y(e) {
248
287
  if (h) return h;
249
288
  if (g) return g;
250
289
  let t = ++_;
251
290
  g = (async () => {
252
- if (j({
291
+ if (F({
253
292
  status: "loading",
254
293
  error: null
255
- }), !await H()) throw new o("other-tab", "Tailscale is running in another tab.");
256
- await N();
294
+ }), !await J()) throw new o("other-tab", "Tailscale is running in another tab.");
295
+ await L();
257
296
  let r = n.client;
258
297
  if (!r) throw new o("no-client", "No Tailscale client: pass `client` to createTailscale (for example createTailscaleConnectClient).");
259
298
  let i;
@@ -263,46 +302,52 @@ function f(n = {}) {
263
302
  throw new o("client", `The Tailscale client failed to load: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
264
303
  }
265
304
  if (t !== _) throw i.dispose(), new o("client", "Stopped while starting.");
266
- let a = x?.hostname ?? n.hostname ?? u();
267
- v = "NoState";
305
+ let a = T?.hostname ?? n.hostname ?? u();
306
+ w = a, v = "NoState";
268
307
  try {
269
308
  await i.start({
270
309
  hostname: a,
271
310
  controlUrl: n.controlUrl,
272
311
  authKey: e,
273
- state: x?.state ?? null,
312
+ state: T?.state ?? null,
313
+ exitNodeId: T?.exitNodeId ?? null,
274
314
  onState: (e) => {
275
- t === _ && P(e, a);
315
+ t === _ && R(e, a);
276
316
  },
277
- onEvent: (e) => B(t, e)
317
+ onEvent: (e) => W(t, e)
278
318
  });
279
319
  } catch (e) {
280
320
  throw i.dispose(), new o("client", `The Tailscale client failed to start: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
281
321
  }
282
322
  if (t !== _) throw i.dispose(), new o("client", "Stopped while starting.");
283
- return h = i, j({ status: z() }), i;
323
+ return h = i, F({ status: U() }), i;
284
324
  })();
285
325
  try {
286
326
  return await g;
287
327
  } catch (e) {
288
- throw t === _ && (T?.(), T = null), e;
328
+ throw t === _ && (k?.(), k = null), e;
289
329
  } finally {
290
330
  t === _ && (g = null);
291
331
  }
292
332
  }
293
- async function W(e) {
294
- _++, V(), E?.abort(), E = null;
333
+ async function X(e) {
334
+ _++, q(), A?.abort(), A = null;
295
335
  let t = h;
296
- h = null, g = null, v = "NoState", y = !1, w && x && await F(x.hostname), e || (T?.(), T = null), t && await t.dispose();
336
+ h = null, g = null, v = "NoState", y = !1;
337
+ let n = S;
338
+ S = [], n.forEach((e) => e("Stopped"));
339
+ let r = T?.hostname ?? w;
340
+ O && r && await z(r), e || (k?.(), k = null), t && await t.dispose();
297
341
  }
298
- let G = () => j({
342
+ let Z = () => F({
299
343
  status: "idle",
300
344
  loginUrl: null,
301
345
  selfName: null,
302
346
  tailnet: null,
303
347
  addresses: [],
304
- peers: []
305
- }), K = {
348
+ peers: [],
349
+ exitNodeId: null
350
+ }), Q = {
306
351
  policy: i,
307
352
  getSnapshot: () => m,
308
353
  getServerSnapshot: () => c,
@@ -310,28 +355,28 @@ function f(n = {}) {
310
355
  return p.add(e), () => p.delete(e);
311
356
  },
312
357
  activate() {
313
- O++, k && clearTimeout(k), k = null, N().then(() => {
314
- O > 0 && x && n.autoConnect !== !1 && m.status === "idle" && K.connect();
315
- }, (e) => j({ warning: e instanceof Error ? e.message : String(e) }));
358
+ M++, N && clearTimeout(N), N = null, L().then(() => {
359
+ M > 0 && T && n.autoConnect !== !1 && m.status === "idle" && Q.connect();
360
+ }, (e) => F({ warning: e instanceof Error ? e.message : String(e) }));
316
361
  let e = !1;
317
362
  return () => {
318
- e || (e = !0, O--, O === 0 && (k = setTimeout(() => {
319
- k = null, O === 0 && K.dispose();
363
+ e || (e = !0, M--, M === 0 && (N = setTimeout(() => {
364
+ N = null, M === 0 && Q.dispose();
320
365
  }, 0)));
321
366
  };
322
367
  },
323
368
  async connect() {
324
369
  if (!(h || g)) try {
325
- if (await N(), !x) return;
326
- await U();
370
+ if (await L(), !T) return;
371
+ await Y();
327
372
  } catch (e) {
328
- M(e instanceof o ? e : new o("client", String(e)));
373
+ I(e instanceof o ? e : new o("client", String(e)));
329
374
  }
330
375
  },
331
376
  async signIn() {
332
377
  if (m.status === "connected") return;
333
378
  let e = a.mode === "interactive";
334
- e && I(), y = !0, j({
379
+ e && B(), y = !0, F({
335
380
  status: "signing-in",
336
381
  error: null,
337
382
  loginUrl: null
@@ -339,48 +384,51 @@ function f(n = {}) {
339
384
  try {
340
385
  let t;
341
386
  if (a.mode === "auth-key") {
342
- h && await W(!0), E = new AbortController();
387
+ h && await X(!0), A = new AbortController();
343
388
  try {
344
- t = typeof a.authKey == "function" ? await a.authKey(E.signal) : a.authKey;
389
+ t = typeof a.authKey == "function" ? await a.authKey(A.signal) : a.authKey;
345
390
  } catch (e) {
346
391
  throw new o("auth-key", `Could not get an auth key: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
347
392
  }
348
393
  if (!t) throw new o("auth-key", "The auth key is empty.");
349
394
  let e = _;
350
- V(), D = setTimeout(() => {
351
- e <= _ && m.status !== "connected" && y && (W(!1), M(new o("auth-key", "Signing in with the auth key did not finish in time.")));
395
+ q(), j = setTimeout(() => {
396
+ e <= _ && m.status !== "connected" && y && (X(!1), I(new o("auth-key", "Signing in with the auth key did not finish in time.")));
352
397
  }, n.authKeyTimeoutMs ?? 3e4);
353
398
  }
354
399
  y = !0;
355
- let r = await U(t);
356
- j({ status: z() }), e && v !== "Running" && await r.login();
400
+ try {
401
+ await L();
402
+ } catch {}
403
+ let r = !!T && !h && !g, i = await Y(t);
404
+ F({ status: U() }), e && r && await K(n.restoreTimeoutMs ?? 2e4), e && v !== "Running" && y && await i.login();
357
405
  } catch (e) {
358
406
  if (!y && !(e instanceof o)) return;
359
- M(e instanceof o ? e : new o("client", e instanceof Error ? e.message : String(e), { cause: e }));
407
+ I(e instanceof o ? e : new o("client", e instanceof Error ? e.message : String(e), { cause: e }));
360
408
  }
361
409
  },
362
410
  cancel() {
363
- (m.status === "signing-in" || m.status === "loading") && (y = !1, V(), E?.abort(), L(), j({
411
+ (m.status === "signing-in" || m.status === "loading") && (y = !1, q(), A?.abort(), V(), F({
364
412
  loginUrl: null,
365
- status: h ? z() : "idle"
413
+ status: h ? U() : "idle"
366
414
  }));
367
415
  },
368
416
  async disconnect() {
369
- L(), await W(!1), G(), j({ error: null });
417
+ V(), await X(!1), Z(), F({ error: null });
370
418
  },
371
419
  async signOut() {
372
- L();
420
+ V();
373
421
  let e = h;
374
422
  try {
375
423
  e && await e.logout();
376
424
  } catch {}
377
- w = null, await W(!1), x = null;
425
+ O = null, await X(!1), T = null;
378
426
  try {
379
427
  await s.clear();
380
428
  } catch {
381
- j({ warning: "The saved session couldn't be deleted." });
429
+ F({ warning: "The saved session couldn't be deleted." });
382
430
  }
383
- G(), j({
431
+ Z(), F({
384
432
  hasSession: !1,
385
433
  error: null
386
434
  });
@@ -389,14 +437,28 @@ function f(n = {}) {
389
437
  if (!h || v !== "Running") throw new o("not-connected", "Not connected to Tailscale.");
390
438
  return h.fetch(e);
391
439
  },
440
+ async setExitNode(e) {
441
+ if (!h || v !== "Running") throw new o("not-connected", "Not connected to Tailscale.");
442
+ if (!h.setExitNode) throw new o("client", "This Tailscale client cannot use an exit node.");
443
+ if (e !== null && !m.peers.some((t) => t.id === e && t.exitNode)) throw new o("client", "That device is not an exit node on this tailnet.");
444
+ if (await h.setExitNode(e), F({ exitNodeId: e }), O && w && await z(w), T) {
445
+ T = {
446
+ ...T,
447
+ exitNodeId: e
448
+ };
449
+ try {
450
+ await s.save(T);
451
+ } catch {}
452
+ }
453
+ },
392
454
  matches(t, n = "GET") {
393
455
  return e(t, n, i, typeof location < "u" ? location.origin : void 0).route;
394
456
  },
395
457
  async dispose() {
396
- L(), await W(!1), G();
458
+ V(), await X(!1), Z();
397
459
  }
398
460
  };
399
- return K;
461
+ return Q;
400
462
  }
401
463
  async function p(e, t) {
402
464
  let n = new Request(e, t), r = [];
@@ -19,6 +19,10 @@ export interface ActiveFlight {
19
19
  }
20
20
  /** The title a screen is showing right now: its large title until it scrolls under the bar, else the inline one. */
21
21
  export declare function shownTitle(r: TitleParts | undefined): HTMLElement | null;
22
+ /** The title that flies out on a push. A large title that has scrolled under the bar leaves nothing to fly from (its
23
+ * inline stand-in sits at the bar's centre, an odd place for the back label to appear from), so the new screen
24
+ * just slides in with its own back button. A screen without a large title flies its inline one as usual. */
25
+ export declare function pushedTitle(r: TitleParts | undefined): HTMLElement | null;
22
26
  /** A screen's back label, when it shows the previous title (not "Back", not nothing). */
23
27
  export declare function backLabel(r: TitleParts | undefined): HTMLElement | null;
24
28
  /** Owns the stack's one flight at a time: starting another (or unmounting) ends the one in progress, so a push or
@@ -1 +1 @@
1
- {"version":3,"file":"title-flight.d.ts","sourceRoot":"","sources":["../../src/lib/title-flight.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAW,KAAK,yBAAyB,EAAE,MAAM,eAAe,CAAC;AASxE,yDAAyD;AACzD,MAAM,WAAW,UAAU;IACzB,sFAAsF;IACtF,EAAE,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3B;AAED,UAAU,MAAM;IAAG,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE;AAE/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AAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE;AAE/D,+DAA+D;AAC/D,MAAM,WAAW,YAAY;IAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,yBAAyB,CAAA;CAAE;AAM5E,oHAAoH;AACpH,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAKxE;AAED;;6GAE6G;AAC7G,wBAAgB,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAGzE;AAED,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI,CAEvE;AAmED;uGACuG;AACvG,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;gBAa7C,MAAM,CAAC,WAAW,GAAG,IAAI,EAAE,WAAW,GAAG,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;kBAiB5E,WAAW,GAAG,IAAI,MAAM,WAAW,GAAG,IAAI,YAAY,WAAW,GAAG,IAAI,GAAG,SAAS;iBAQrF,YAAY,GAAG,IAAI,GAAG,SAAS,KAAK,MAAM,MAAM,CAAC,GAAG,CAAC;;mBA/BnD,YAAY,GAAG,IAAI,GAAG,SAAS,KAAG,CAAC,IAAI,YAAY;EAqC1E"}
@@ -8,24 +8,27 @@ function s(e) {
8
8
  return e ? e.large && !e.el?.hasAttribute("data-scrolled") ? e.large : e.inline && parseFloat(getComputedStyle(e.inline).opacity) > .5 ? e.inline : null : null;
9
9
  }
10
10
  function c(e) {
11
- return e?.back && e.back.dataset.mode === "title" ? e.back : null;
11
+ return e?.large && e.el?.hasAttribute("data-scrolled") ? null : s(e);
12
12
  }
13
13
  function l(e) {
14
+ return e?.back && e.back.dataset.mode === "title" ? e.back : null;
15
+ }
16
+ function u(e) {
14
17
  if (!e.dataset.mode) return null;
15
18
  let t = e.previousElementSibling;
16
19
  return t instanceof HTMLElement || t instanceof SVGElement ? t : null;
17
20
  }
18
- function u(e, t, n, r) {
21
+ function d(e, t, n, r) {
19
22
  let o = e.getBoundingClientRect(), s = t.getBoundingClientRect(), c = n.getBoundingClientRect();
20
23
  if (!s.width || !c.width) return null;
21
- let u = r ? r.getBoundingClientRect() : o, d = {
24
+ let l = r ? r.getBoundingClientRect() : o, d = {
22
25
  x: s.left - o.left,
23
26
  y: s.top - o.top,
24
27
  w: s.width,
25
28
  h: s.height
26
29
  }, f = {
27
- x: c.left - u.left,
28
- y: c.top - u.top,
30
+ x: c.left - l.left,
31
+ y: c.top - l.top,
29
32
  w: c.width,
30
33
  h: c.height
31
34
  }, p = getComputedStyle(t), m = getComputedStyle(n), h = (parseFloat(m.fontSize) || 17) / (parseFloat(p.fontSize) || 17), g = document.createElement("div");
@@ -58,13 +61,13 @@ function u(e, t, n, r) {
58
61
  }), g.appendChild(r), r;
59
62
  }, v = _(t, p, d), y = _(n, m, f);
60
63
  e.appendChild(g), t.style.visibility = "hidden", n.style.visibility = "hidden";
61
- let b = Math.abs(h - 1) < .05, x = l(n), S = null;
64
+ let b = Math.abs(h - 1) < .05, x = u(n), S = null;
62
65
  if (x) {
63
66
  let e = x.getBoundingClientRect();
64
67
  S = x.cloneNode(!0), Object.assign(S.style, {
65
68
  position: "absolute",
66
- left: e.left - u.left + "px",
67
- top: e.top - u.top + "px",
69
+ left: e.left - l.left + "px",
70
+ top: e.top - l.top + "px",
68
71
  margin: "0",
69
72
  opacity: "0",
70
73
  width: e.width + "px",
@@ -82,7 +85,7 @@ function u(e, t, n, r) {
82
85
  }
83
86
  };
84
87
  }
85
- function d(i) {
88
+ function f(i) {
86
89
  let a = r(null), s = () => {
87
90
  let e = a.current;
88
91
  a.current = null, e && (e.run?.stop(), e.f.done());
@@ -100,7 +103,7 @@ function d(i) {
100
103
  s(), !o() && requestAnimationFrame(() => {
101
104
  let [n, r, o] = t();
102
105
  if (!n || !r || !i.current) return;
103
- let s = u(i.current, n, r, o);
106
+ let s = d(i.current, n, r, o);
104
107
  if (!s) return;
105
108
  s.set(0);
106
109
  let c = { f: s };
@@ -109,7 +112,7 @@ function d(i) {
109
112
  },
110
113
  scrub: (e, t, n) => {
111
114
  s();
112
- let r = !o() && e && t && i.current ? u(i.current, e, t, n) : null;
115
+ let r = !o() && e && t && i.current ? d(i.current, e, t, n) : null;
113
116
  return r ? (r.set(0), a.current = { f: r }, a.current) : null;
114
117
  },
115
118
  release: (t, n, r) => {
@@ -120,4 +123,4 @@ function d(i) {
120
123
  };
121
124
  }
122
125
  //#endregion
123
- export { c as backLabel, s as shownTitle, d as useTitleFlight };
126
+ export { l as backLabel, c as pushedTitle, s as shownTitle, f as useTitleFlight };
@@ -1,5 +1,5 @@
1
1
  /** Color utilities (bg-*, text-*, border-*…) by name: `--color-<name>`. */
2
- export declare const COLOR_TOKENS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "success", "warning", "tertiary-foreground", "secondary-strong", "overlay", "bar", "sticky", "handle", "link", "code", "code-foreground"];
2
+ export declare const COLOR_TOKENS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "success", "warning", "tertiary-foreground", "secondary-strong", "segment", "overlay", "bar", "sticky", "handle", "link", "code", "code-foreground"];
3
3
  /** Font-size utilities (text-*): `--text-<name>`. Size only — no line-height. */
4
4
  export declare const TEXT_TOKENS: readonly ["caption2", "caption", "footnote", "detail", "subhead", "callout", "body", "title"];
5
5
  /** Radius utilities (rounded-*): `--radius-<name>`, all derived from the `--radius` variable. */
@@ -11,6 +11,6 @@ export declare const SPACING_TOKENS: readonly ["toolbar", "row"];
11
11
  /** Font-family utilities (font-*): `--font-<name>`. */
12
12
  export declare const FONT_TOKENS: readonly ["sans", "mono"];
13
13
  /** The CSS variables a theme (or a `ThemeScope`'s `vars`) sets, without the leading `--`. */
14
- export declare const THEME_VARS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "success", "warning", "tertiary-foreground", "secondary-strong", "overlay", "bar", "sticky", "handle", "link", "code", "code-foreground", "radius", "font-sans", "font-mono"];
14
+ export declare const THEME_VARS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "success", "warning", "tertiary-foreground", "secondary-strong", "segment", "overlay", "bar", "sticky", "handle", "link", "code", "code-foreground", "radius", "font-sans", "font-mono"];
15
15
  export type ThemeVar = (typeof THEME_VARS)[number];
16
16
  //# sourceMappingURL=tokens.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.generated.d.ts","sourceRoot":"","sources":["../../src/lib/tokens.generated.ts"],"names":[],"mappings":"AAGA,2EAA2E;AAC3E,eAAO,MAAM,YAAY,mnBA2Cf,CAAC;AAEX,iFAAiF;AACjF,eAAO,MAAM,WAAW,+FASd,CAAC;AAEX,iGAAiG;AACjG,eAAO,MAAM,aAAa,4CAKhB,CAAC;AAEX,sDAAsD;AACtD,eAAO,MAAM,aAAa,mDAIhB,CAAC;AAEX,oFAAoF;AACpF,eAAO,MAAM,cAAc,6BAGjB,CAAC;AAEX,uDAAuD;AACvD,eAAO,MAAM,WAAW,2BAGd,CAAC;AAEX,6FAA6F;AAC7F,eAAO,MAAM,UAAU,upBA8Cb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"tokens.generated.d.ts","sourceRoot":"","sources":["../../src/lib/tokens.generated.ts"],"names":[],"mappings":"AAGA,2EAA2E;AAC3E,eAAO,MAAM,YAAY,8nBA4Cf,CAAC;AAEX,iFAAiF;AACjF,eAAO,MAAM,WAAW,+FASd,CAAC;AAEX,iGAAiG;AACjG,eAAO,MAAM,aAAa,4CAKhB,CAAC;AAEX,sDAAsD;AACtD,eAAO,MAAM,aAAa,mDAIhB,CAAC;AAEX,oFAAoF;AACpF,eAAO,MAAM,cAAc,6BAGjB,CAAC;AAEX,uDAAuD;AACvD,eAAO,MAAM,WAAW,2BAGd,CAAC;AAEX,6FAA6F;AAC7F,eAAO,MAAM,UAAU,kqBA+Cb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  //#region src/lib/tokens.generated.ts
2
- var e = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring.success.warning.tertiary-foreground.secondary-strong.overlay.bar.sticky.handle.link.code.code-foreground".split("."), t = [
2
+ var e = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring.success.warning.tertiary-foreground.secondary-strong.segment.overlay.bar.sticky.handle.link.code.code-foreground".split("."), t = [
3
3
  "caption2",
4
4
  "caption",
5
5
  "footnote",
@@ -17,6 +17,6 @@ var e = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popo
17
17
  "hairline",
18
18
  "hairline-t",
19
19
  "hairline-b"
20
- ], i = ["toolbar", "row"], a = ["sans", "mono"], o = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring.success.warning.tertiary-foreground.secondary-strong.overlay.bar.sticky.handle.link.code.code-foreground.radius.font-sans.font-mono".split(".");
20
+ ], i = ["toolbar", "row"], a = ["sans", "mono"], o = /* @__PURE__ */ "background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring.success.warning.tertiary-foreground.secondary-strong.segment.overlay.bar.sticky.handle.link.code.code-foreground.radius.font-sans.font-mono".split(".");
21
21
  //#endregion
22
22
  export { e as COLOR_TOKENS, a as FONT_TOKENS, n as RADIUS_TOKENS, r as SHADOW_TOKENS, i as SPACING_TOKENS, t as TEXT_TOKENS, o as THEME_VARS };
@@ -0,0 +1,38 @@
1
+ import { Ffmpeg, FfmpegProgress } from './ffmpeg';
2
+ import { Timeline, TimelineFormat } from './video-timeline';
3
+ export interface RenderMedia {
4
+ file: Blob;
5
+ kind: 'video' | 'audio' | 'image';
6
+ /** It has an audio stream. */
7
+ hasAudio: boolean;
8
+ }
9
+ export type RenderContainer = 'mp4' | 'webm' | 'gif' | 'mp3' | 'wav';
10
+ export type RenderQuality = 'low' | 'medium' | 'high';
11
+ export interface RenderOptions {
12
+ /** Default `mp4`. */
13
+ container?: RenderContainer;
14
+ /** Default `medium`. */
15
+ quality?: RenderQuality;
16
+ /** What shows behind and between clips, as an FFmpeg colour (`black`, `#202020`). Default black. */
17
+ background?: string;
18
+ }
19
+ export interface RenderPlan {
20
+ args: string[];
21
+ inputs: Record<string, Blob>;
22
+ /** The file the command writes. */
23
+ output: string;
24
+ mime: string;
25
+ /** Seconds. */
26
+ duration: number;
27
+ }
28
+ export declare const renderMime: Record<RenderContainer, string>;
29
+ /** The FFmpeg command that renders `timeline` at `format`. Throws when there's nothing to render. */
30
+ export declare function buildRender(timeline: Timeline, media: Record<string, RenderMedia>, format: TimelineFormat, options?: RenderOptions): RenderPlan;
31
+ export interface RenderTimelineOptions extends RenderOptions {
32
+ onProgress?: (progress: FfmpegProgress) => void;
33
+ onLog?: (line: string) => void;
34
+ signal?: AbortSignal;
35
+ }
36
+ /** Renders a timeline to a file. */
37
+ export declare function renderTimeline(ffmpeg: Ffmpeg, timeline: Timeline, media: Record<string, RenderMedia>, format: TimelineFormat, options?: RenderTimelineOptions): Promise<Blob>;
38
+ //# sourceMappingURL=video-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-render.d.ts","sourceRoot":"","sources":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