voodoojs 0.4.6

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 (54) hide show
  1. package/README.md +77 -0
  2. package/dist/chunk-234ZLC6W.js +401 -0
  3. package/dist/chunk-4HQEOXTK.js +10271 -0
  4. package/dist/chunk-5777LJVW.js +64 -0
  5. package/dist/chunk-5CKGDARU.js +1845 -0
  6. package/dist/chunk-A2UOVQBP.js +82 -0
  7. package/dist/chunk-E27NRARW.js +16 -0
  8. package/dist/chunk-JZIYRIY6.js +1196 -0
  9. package/dist/chunk-NNU6WOOU.js +641 -0
  10. package/dist/chunk-PQZEVFVZ.js +448 -0
  11. package/dist/chunk-RJUNPXQF.js +946 -0
  12. package/dist/chunk-U76IRJKH.js +72 -0
  13. package/dist/essential.cjs +13889 -0
  14. package/dist/essential.d.cts +24 -0
  15. package/dist/essential.d.ts +24 -0
  16. package/dist/essential.js +51 -0
  17. package/dist/gpu.cjs +2008 -0
  18. package/dist/gpu.d.cts +68 -0
  19. package/dist/gpu.d.ts +68 -0
  20. package/dist/gpu.js +273 -0
  21. package/dist/http.cjs +467 -0
  22. package/dist/http.d.cts +148 -0
  23. package/dist/http.d.ts +148 -0
  24. package/dist/http.js +7 -0
  25. package/dist/index-CaLD-0oh.d.cts +608 -0
  26. package/dist/index-CaLD-0oh.d.ts +608 -0
  27. package/dist/index-DTllqUtj.d.cts +261 -0
  28. package/dist/index-DTllqUtj.d.ts +261 -0
  29. package/dist/index.cjs +23063 -0
  30. package/dist/index.d.cts +1603 -0
  31. package/dist/index.d.ts +1603 -0
  32. package/dist/index.js +6924 -0
  33. package/dist/query-CKJ4oSpG.d.cts +1595 -0
  34. package/dist/query-DQFRmu3u.d.ts +1595 -0
  35. package/dist/reactivity.cjs +676 -0
  36. package/dist/reactivity.d.cts +188 -0
  37. package/dist/reactivity.d.ts +188 -0
  38. package/dist/reactivity.js +4 -0
  39. package/dist/socket.cjs +2685 -0
  40. package/dist/socket.d.cts +167 -0
  41. package/dist/socket.d.ts +167 -0
  42. package/dist/socket.js +238 -0
  43. package/dist/style-XEUAGGJK.js +5 -0
  44. package/dist/utils.cjs +397 -0
  45. package/dist/utils.d.cts +111 -0
  46. package/dist/utils.d.ts +111 -0
  47. package/dist/utils.js +4 -0
  48. package/dist/voodoo.core.js +8213 -0
  49. package/dist/voodoo.core.min.js +146 -0
  50. package/dist/voodoo.full.js +21193 -0
  51. package/dist/voodoo.full.min.js +1784 -0
  52. package/dist/voodoo.js +14185 -0
  53. package/dist/voodoo.min.js +420 -0
  54. package/package.json +127 -0
@@ -0,0 +1,1845 @@
1
+ import { reactive, handleError, EffectScope, effect } from './chunk-NNU6WOOU.js';
2
+ import { inDevelopment, warnInvalidExpression, warnUnknownDirective } from './chunk-A2UOVQBP.js';
3
+ import { config, directives, components } from './chunk-5777LJVW.js';
4
+ import { __publicField } from './chunk-E27NRARW.js';
5
+
6
+ /**
7
+ * Voodoo.js v0.4.6
8
+ * JavaScript feels like magic.
9
+ * (c) 2026 Voodoo.js contributors. MIT License.
10
+ */
11
+
12
+ // src/parser/lexer.ts
13
+ var VoodooSyntaxError = class extends Error {
14
+ constructor(message, source, position) {
15
+ const pointer = `${source}
16
+ ${" ".repeat(Math.max(0, position))}^`;
17
+ super(`${message}
18
+
19
+ ${pointer}`);
20
+ __publicField(this, "source", source);
21
+ __publicField(this, "position", position);
22
+ this.name = "VoodooSyntaxError";
23
+ }
24
+ };
25
+ var PUNCTUATORS = [
26
+ ">>>=",
27
+ "===",
28
+ "!==",
29
+ "**=",
30
+ "...",
31
+ "<<=",
32
+ ">>=",
33
+ "&&=",
34
+ "||=",
35
+ "??=",
36
+ "?.",
37
+ "=>",
38
+ "==",
39
+ "!=",
40
+ "<=",
41
+ ">=",
42
+ "&&",
43
+ "||",
44
+ "??",
45
+ "**",
46
+ "++",
47
+ "--",
48
+ "+=",
49
+ "-=",
50
+ "*=",
51
+ "/=",
52
+ "%=",
53
+ "+",
54
+ "-",
55
+ "*",
56
+ "/",
57
+ "%",
58
+ "!",
59
+ "<",
60
+ ">",
61
+ "=",
62
+ "(",
63
+ ")",
64
+ "[",
65
+ "]",
66
+ "{",
67
+ "}",
68
+ ",",
69
+ ".",
70
+ "?",
71
+ ":",
72
+ ";"
73
+ ];
74
+ var IDENT_START = /[A-Za-z_$À-￿]/;
75
+ var IDENT_PART = /[A-Za-z0-9_$À-￿]/;
76
+ function isIdentStart(ch) {
77
+ return IDENT_START.test(ch);
78
+ }
79
+ function isIdentPart(ch) {
80
+ return IDENT_PART.test(ch);
81
+ }
82
+ function isDigit(ch) {
83
+ return ch >= "0" && ch <= "9";
84
+ }
85
+ var ESCAPES = {
86
+ n: "\n",
87
+ t: " ",
88
+ r: "\r",
89
+ b: "\b",
90
+ f: "\f",
91
+ v: "\v",
92
+ "0": "\0"
93
+ };
94
+ function tokenize(source) {
95
+ const tokens = [];
96
+ let i = 0;
97
+ const len = source.length;
98
+ while (i < len) {
99
+ const ch = source[i];
100
+ if (ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "\f" || ch === "\v") {
101
+ i++;
102
+ continue;
103
+ }
104
+ if (ch === "/" && source[i + 1] === "/") {
105
+ while (i < len && source[i] !== "\n") i++;
106
+ continue;
107
+ }
108
+ if (ch === "/" && source[i + 1] === "*") {
109
+ const end = source.indexOf("*/", i + 2);
110
+ if (end === -1) throw new VoodooSyntaxError("Unclosed block comment", source, i);
111
+ i = end + 2;
112
+ continue;
113
+ }
114
+ const start2 = i;
115
+ if (isDigit(ch) || ch === "." && isDigit(source[i + 1])) {
116
+ let raw = "";
117
+ if (ch === "0" && (source[i + 1] === "x" || source[i + 1] === "X")) {
118
+ raw = "0x";
119
+ i += 2;
120
+ while (i < len && /[0-9a-fA-F_]/.test(source[i])) raw += source[i++];
121
+ } else if (ch === "0" && (source[i + 1] === "b" || source[i + 1] === "B")) {
122
+ raw = "0b";
123
+ i += 2;
124
+ while (i < len && /[01_]/.test(source[i])) raw += source[i++];
125
+ } else {
126
+ while (i < len && /[0-9_]/.test(source[i])) raw += source[i++];
127
+ if (source[i] === ".") {
128
+ raw += source[i++];
129
+ while (i < len && /[0-9_]/.test(source[i])) raw += source[i++];
130
+ }
131
+ if (source[i] === "e" || source[i] === "E") {
132
+ raw += source[i++];
133
+ if (source[i] === "+" || source[i] === "-") raw += source[i++];
134
+ while (i < len && isDigit(source[i])) raw += source[i++];
135
+ }
136
+ }
137
+ const parsed = Number(raw.replace(/_/g, ""));
138
+ if (Number.isNaN(parsed)) throw new VoodooSyntaxError("Invalid number", source, start2);
139
+ tokens.push({ type: "num", value: raw, parsed, start: start2, end: i });
140
+ continue;
141
+ }
142
+ if (ch === '"' || ch === "'") {
143
+ i++;
144
+ let out = "";
145
+ while (i < len && source[i] !== ch) {
146
+ if (source[i] === "\\") {
147
+ i++;
148
+ const esc = source[i];
149
+ if (esc === "u") {
150
+ if (source[i + 1] === "{") {
151
+ const close = source.indexOf("}", i);
152
+ if (close === -1)
153
+ throw new VoodooSyntaxError("Unclosed Unicode escape", source, start2);
154
+ const digits = source.slice(i + 2, close);
155
+ if (!/^[0-9a-fA-F]+$/.test(digits) || parseInt(digits, 16) > 1114111)
156
+ throw new VoodooSyntaxError(
157
+ `Invalid Unicode escape "\\u{${digits}}"`,
158
+ source,
159
+ i - 1
160
+ );
161
+ out += String.fromCodePoint(parseInt(digits, 16));
162
+ i = close + 1;
163
+ } else {
164
+ const digits = source.slice(i + 1, i + 5);
165
+ if (!/^[0-9a-fA-F]{4}$/.test(digits))
166
+ throw new VoodooSyntaxError(
167
+ "Invalid Unicode escape: \\u needs 4 hexadecimal digits",
168
+ source,
169
+ i - 1
170
+ );
171
+ out += String.fromCharCode(parseInt(digits, 16));
172
+ i += 5;
173
+ }
174
+ } else if (esc === "x") {
175
+ const digits = source.slice(i + 1, i + 3);
176
+ if (!/^[0-9a-fA-F]{2}$/.test(digits))
177
+ throw new VoodooSyntaxError(
178
+ "Invalid hexadecimal escape: \\x needs 2 hexadecimal digits",
179
+ source,
180
+ i - 1
181
+ );
182
+ out += String.fromCharCode(parseInt(digits, 16));
183
+ i += 3;
184
+ } else {
185
+ out += ESCAPES[esc] ?? esc;
186
+ i++;
187
+ }
188
+ } else {
189
+ out += source[i++];
190
+ }
191
+ }
192
+ if (i >= len) throw new VoodooSyntaxError("Unclosed string", source, start2);
193
+ i++;
194
+ tokens.push({ type: "str", value: out, parsed: out, start: start2, end: i });
195
+ continue;
196
+ }
197
+ if (ch === "`") {
198
+ i++;
199
+ const quasis = [];
200
+ const exprs = [];
201
+ let current = "";
202
+ while (i < len && source[i] !== "`") {
203
+ if (source[i] === "\\") {
204
+ const esc = source[i + 1];
205
+ current += ESCAPES[esc] ?? esc;
206
+ i += 2;
207
+ continue;
208
+ }
209
+ if (source[i] === "$" && source[i + 1] === "{") {
210
+ quasis.push(current);
211
+ current = "";
212
+ i += 2;
213
+ let depth = 1;
214
+ let expr = "";
215
+ while (i < len) {
216
+ const c = source[i];
217
+ if (c === "{") depth++;
218
+ else if (c === "}") {
219
+ depth--;
220
+ if (depth === 0) break;
221
+ } else if (c === '"' || c === "'" || c === "`") {
222
+ const quote = c;
223
+ expr += source[i++];
224
+ while (i < len && source[i] !== quote) {
225
+ if (source[i] === "\\") expr += source[i++];
226
+ expr += source[i++];
227
+ }
228
+ }
229
+ expr += source[i++];
230
+ }
231
+ if (depth !== 0)
232
+ throw new VoodooSyntaxError("Unclosed template interpolation", source, start2);
233
+ i++;
234
+ exprs.push(expr);
235
+ continue;
236
+ }
237
+ current += source[i++];
238
+ }
239
+ if (i >= len) throw new VoodooSyntaxError("Unclosed template literal", source, start2);
240
+ i++;
241
+ quasis.push(current);
242
+ tokens.push({
243
+ type: "tpl",
244
+ value: source.slice(start2, i),
245
+ tpl: { quasis, exprs },
246
+ start: start2,
247
+ end: i
248
+ });
249
+ continue;
250
+ }
251
+ if (isIdentStart(ch)) {
252
+ let name = "";
253
+ while (i < len && isIdentPart(source[i])) name += source[i++];
254
+ tokens.push({ type: "ident", value: name, start: start2, end: i });
255
+ continue;
256
+ }
257
+ let matched;
258
+ for (const p of PUNCTUATORS) {
259
+ if (source.startsWith(p, i)) {
260
+ if (p === "?." && isDigit(source[i + 2])) continue;
261
+ matched = p;
262
+ break;
263
+ }
264
+ }
265
+ if (matched) {
266
+ i += matched.length;
267
+ tokens.push({ type: "punct", value: matched, start: start2, end: i });
268
+ continue;
269
+ }
270
+ throw new VoodooSyntaxError(`Unexpected character "${ch}"`, source, i);
271
+ }
272
+ tokens.push({ type: "eof", value: "", start: len, end: len });
273
+ return tokens;
274
+ }
275
+
276
+ // src/parser/parser.ts
277
+ var BINARY_PRECEDENCE = {
278
+ "??": 1,
279
+ "||": 2,
280
+ "&&": 3,
281
+ "==": 6,
282
+ "!=": 6,
283
+ "===": 6,
284
+ "!==": 6,
285
+ "<": 7,
286
+ ">": 7,
287
+ "<=": 7,
288
+ ">=": 7,
289
+ in: 7,
290
+ instanceof: 7,
291
+ "+": 9,
292
+ "-": 9,
293
+ "*": 10,
294
+ "/": 10,
295
+ "%": 10,
296
+ "**": 11
297
+ };
298
+ var ASSIGN_OPS = /* @__PURE__ */ new Set(["=", "+=", "-=", "*=", "/=", "%=", "**=", "&&=", "||=", "??="]);
299
+ var UNARY_OPS = /* @__PURE__ */ new Set(["!", "-", "+", "typeof", "void"]);
300
+ var LITERALS = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
301
+ true: true,
302
+ false: false,
303
+ null: null,
304
+ undefined: void 0
305
+ });
306
+ var MAX_DEPTH = 1200;
307
+ var MAX_TEMPLATE_DEPTH = 32;
308
+ var templateDepth = 0;
309
+ var Parser = class {
310
+ constructor(tokens, source) {
311
+ __publicField(this, "tokens", tokens);
312
+ __publicField(this, "source", source);
313
+ __publicField(this, "pos", 0);
314
+ __publicField(this, "depth", 0);
315
+ }
316
+ peek(offset = 0) {
317
+ return this.tokens[Math.min(this.pos + offset, this.tokens.length - 1)];
318
+ }
319
+ next() {
320
+ return this.tokens[this.pos++];
321
+ }
322
+ isPunct(value, offset = 0) {
323
+ const t = this.peek(offset);
324
+ return t.type === "punct" && t.value === value;
325
+ }
326
+ isIdent(value, offset = 0) {
327
+ const t = this.peek(offset);
328
+ return t.type === "ident" && t.value === value;
329
+ }
330
+ expect(value) {
331
+ if (!this.isPunct(value)) {
332
+ const t = this.peek();
333
+ throw new VoodooSyntaxError(
334
+ `Expected "${value}" but found "${t.value || "end of expression"}"`,
335
+ this.source,
336
+ t.start
337
+ );
338
+ }
339
+ return this.next();
340
+ }
341
+ /** Entry point: one or more expressions separated by `;` or `,` at the top. */
342
+ parseProgram() {
343
+ const body = [];
344
+ while (this.peek().type !== "eof") {
345
+ body.push(this.parseStatement());
346
+ while (this.isPunct(";") || this.isPunct(",")) this.next();
347
+ }
348
+ if (body.length === 0) return { t: "lit", v: void 0 };
349
+ if (body.length === 1) return body[0];
350
+ return { t: "seq", body };
351
+ }
352
+ /**
353
+ * Parses the body of an arrow function.
354
+ *
355
+ * A `{` right after `=>` opens a block, as in JavaScript, and the block's
356
+ * last value is what the arrow returns. Without this, the common
357
+ * `(() => { count = 42 })()` failed to parse, because `{` was read as the
358
+ * start of an object literal and `=` inside it made no sense.
359
+ *
360
+ * To return an object literal, wrap it in parentheses exactly as JavaScript
361
+ * requires: `() => ({ a: 1 })`.
362
+ */
363
+ parseArrowBody() {
364
+ if (!this.isPunct("{")) return this.parseAssignment();
365
+ this.next();
366
+ const body = [];
367
+ while (!this.isPunct("}") && this.peek().type !== "eof") {
368
+ body.push(this.parseStatement());
369
+ while (this.isPunct(";") || this.isPunct(",")) this.next();
370
+ }
371
+ this.expect("}");
372
+ if (body.length === 0) return { t: "lit", v: void 0 };
373
+ if (body.length === 1) return body[0];
374
+ return { t: "seq", body };
375
+ }
376
+ /**
377
+ * One statement. Only `if` needs its own form; everything else in this
378
+ * language is an expression.
379
+ */
380
+ parseStatement() {
381
+ if (this.peek().type === "ident" && this.peek().value === "if" && this.isPunct("(", 1)) {
382
+ this.next();
383
+ this.expect("(");
384
+ const test = this.parseExpression();
385
+ this.expect(")");
386
+ const cons = this.parseBlockOrStatement();
387
+ let alt = null;
388
+ if (this.peek().type === "ident" && this.peek().value === "else") {
389
+ this.next();
390
+ alt = this.parseBlockOrStatement();
391
+ }
392
+ return { t: "if", test, cons, alt };
393
+ }
394
+ return this.parseExpression();
395
+ }
396
+ /** The body of an `if` or `else`, with or without braces. */
397
+ parseBlockOrStatement() {
398
+ if (!this.isPunct("{")) return this.parseStatement();
399
+ this.next();
400
+ const body = [];
401
+ while (!this.isPunct("}") && this.peek().type !== "eof") {
402
+ body.push(this.parseStatement());
403
+ while (this.isPunct(";") || this.isPunct(",")) this.next();
404
+ }
405
+ this.expect("}");
406
+ if (body.length === 0) return { t: "lit", v: void 0 };
407
+ if (body.length === 1) return body[0];
408
+ return { t: "seq", body };
409
+ }
410
+ parseExpression() {
411
+ return this.parseAssignment();
412
+ }
413
+ /** Raises recursion level and rejects expression when exceeding limit. */
414
+ enterLevel() {
415
+ if (++this.depth > MAX_DEPTH) {
416
+ const t = this.peek();
417
+ throw new VoodooSyntaxError(
418
+ `Expression too deeply nested (limit of ${MAX_DEPTH} levels)`,
419
+ this.source,
420
+ t.start
421
+ );
422
+ }
423
+ }
424
+ parseAssignment() {
425
+ this.enterLevel();
426
+ const node = this.parseAssignmentInternal();
427
+ this.depth--;
428
+ return node;
429
+ }
430
+ parseAssignmentInternal() {
431
+ if (this.peek().type === "ident" && this.isPunct("=>", 1)) {
432
+ const param = this.next().value;
433
+ this.next();
434
+ return { t: "arrow", params: [param], body: this.parseArrowBody() };
435
+ }
436
+ if (this.isPunct("(")) {
437
+ const arrow = this.tryParseParenArrow();
438
+ if (arrow) return arrow;
439
+ }
440
+ const left = this.parseConditional();
441
+ const t = this.peek();
442
+ if (t.type === "punct" && ASSIGN_OPS.has(t.value)) {
443
+ if (left.t !== "id" && left.t !== "member") {
444
+ throw new VoodooSyntaxError("Invalid assignment target", this.source, t.start);
445
+ }
446
+ this.next();
447
+ const value = this.parseAssignment();
448
+ return { t: "assign", op: t.value, target: left, value };
449
+ }
450
+ return left;
451
+ }
452
+ /**
453
+ * Tries to read `( params ) =>`. If what comes after the closing parenthesis
454
+ * is not `=>`, returns to original position and lets normal parsing continue.
455
+ */
456
+ tryParseParenArrow() {
457
+ const start2 = this.pos;
458
+ let depth = 0;
459
+ let i = this.pos;
460
+ for (; i < this.tokens.length; i++) {
461
+ const t = this.tokens[i];
462
+ if (t.type === "punct" && t.value === "(") depth++;
463
+ else if (t.type === "punct" && t.value === ")") {
464
+ depth--;
465
+ if (depth === 0) break;
466
+ } else if (t.type === "eof") break;
467
+ }
468
+ const after = this.tokens[i + 1];
469
+ if (!after || after.type !== "punct" || after.value !== "=>") return null;
470
+ this.next();
471
+ const params = [];
472
+ while (!this.isPunct(")")) {
473
+ const t = this.next();
474
+ if (t.type !== "ident") {
475
+ this.pos = start2;
476
+ return null;
477
+ }
478
+ params.push(t.value);
479
+ if (this.isPunct(",")) this.next();
480
+ }
481
+ this.expect(")");
482
+ this.expect("=>");
483
+ return { t: "arrow", params, body: this.parseArrowBody() };
484
+ }
485
+ parseConditional() {
486
+ const test = this.parseBinary(0);
487
+ if (this.isPunct("?")) {
488
+ this.next();
489
+ const cons = this.parseAssignment();
490
+ this.expect(":");
491
+ const alt = this.parseAssignment();
492
+ return { t: "cond", test, cons, alt };
493
+ }
494
+ return test;
495
+ }
496
+ parseBinary(minPrec) {
497
+ this.enterLevel();
498
+ const node = this.parseBinaryInternal(minPrec);
499
+ this.depth--;
500
+ return node;
501
+ }
502
+ parseBinaryInternal(minPrec) {
503
+ let left = this.parseUnary();
504
+ for (; ; ) {
505
+ const t = this.peek();
506
+ const op = t.value;
507
+ const isOperator = t.type === "punct" && op in BINARY_PRECEDENCE || t.type === "ident" && (op === "in" || op === "instanceof");
508
+ if (!isOperator) break;
509
+ const prec = BINARY_PRECEDENCE[op];
510
+ if (prec === void 0 || prec <= minPrec) break;
511
+ this.next();
512
+ const right = this.parseBinary(op === "**" ? prec - 1 : prec);
513
+ const kind = op === "&&" || op === "||" || op === "??" ? "logic" : "bin";
514
+ left = { t: kind, op, l: left, r: right };
515
+ }
516
+ return left;
517
+ }
518
+ parseUnary() {
519
+ this.enterLevel();
520
+ const node = this.parseUnaryInternal();
521
+ this.depth--;
522
+ return node;
523
+ }
524
+ parseUnaryInternal() {
525
+ const t = this.peek();
526
+ if ((t.type === "punct" || t.type === "ident") && UNARY_OPS.has(t.value)) {
527
+ this.next();
528
+ return { t: "unary", op: t.value, a: this.parseUnary() };
529
+ }
530
+ if (t.type === "punct" && (t.value === "++" || t.value === "--")) {
531
+ this.next();
532
+ const arg = this.parseUnary();
533
+ return { t: "update", op: t.value, a: arg, prefix: true };
534
+ }
535
+ let expr = this.parseCallMember();
536
+ const post = this.peek();
537
+ if (post.type === "punct" && (post.value === "++" || post.value === "--")) {
538
+ this.next();
539
+ expr = { t: "update", op: post.value, a: expr, prefix: false };
540
+ }
541
+ return expr;
542
+ }
543
+ parseCallMember() {
544
+ let expr = this.parsePrimary();
545
+ for (; ; ) {
546
+ if (this.isPunct(".")) {
547
+ this.next();
548
+ const prop = this.next();
549
+ if (prop.type !== "ident") {
550
+ throw new VoodooSyntaxError("Invalid property name", this.source, prop.start);
551
+ }
552
+ expr = { t: "member", o: expr, p: { t: "lit", v: prop.value }, computed: false, opt: false };
553
+ } else if (this.isPunct("?.")) {
554
+ this.next();
555
+ if (this.isPunct("(")) {
556
+ expr = { t: "call", callee: expr, args: this.parseArguments(), opt: true };
557
+ } else if (this.isPunct("[")) {
558
+ this.next();
559
+ const p = this.parseExpression();
560
+ this.expect("]");
561
+ expr = { t: "member", o: expr, p, computed: true, opt: true };
562
+ } else {
563
+ const prop = this.next();
564
+ if (prop.type !== "ident") {
565
+ throw new VoodooSyntaxError("Invalid property name", this.source, prop.start);
566
+ }
567
+ expr = {
568
+ t: "member",
569
+ o: expr,
570
+ p: { t: "lit", v: prop.value },
571
+ computed: false,
572
+ opt: true
573
+ };
574
+ }
575
+ } else if (this.isPunct("[")) {
576
+ this.next();
577
+ const p = this.parseExpression();
578
+ this.expect("]");
579
+ expr = { t: "member", o: expr, p, computed: true, opt: false };
580
+ } else if (this.isPunct("(")) {
581
+ expr = { t: "call", callee: expr, args: this.parseArguments(), opt: false };
582
+ } else {
583
+ return expr;
584
+ }
585
+ }
586
+ }
587
+ parseArguments() {
588
+ this.expect("(");
589
+ const args = [];
590
+ while (!this.isPunct(")")) {
591
+ if (this.isPunct("...")) {
592
+ this.next();
593
+ args.push({ t: "unary", op: "...", a: this.parseAssignment() });
594
+ } else {
595
+ args.push(this.parseAssignment());
596
+ }
597
+ if (this.isPunct(",")) this.next();
598
+ else break;
599
+ }
600
+ this.expect(")");
601
+ return args;
602
+ }
603
+ parsePrimary() {
604
+ const t = this.peek();
605
+ if (t.type === "ident" && t.value === "function") {
606
+ this.next();
607
+ if (this.peek().type === "ident") this.next();
608
+ this.expect("(");
609
+ const params = [];
610
+ while (!this.isPunct(")")) {
611
+ const param = this.next();
612
+ if (param.type !== "ident") {
613
+ throw new VoodooSyntaxError("Expected a parameter name", this.source, param.start);
614
+ }
615
+ params.push(param.value);
616
+ if (this.isPunct(",")) this.next();
617
+ }
618
+ this.expect(")");
619
+ return { t: "arrow", params, body: this.parseArrowBody() };
620
+ }
621
+ if (t.type === "num" || t.type === "str") {
622
+ this.next();
623
+ return { t: "lit", v: t.parsed };
624
+ }
625
+ if (t.type === "tpl") {
626
+ this.next();
627
+ const part = t.tpl;
628
+ if (templateDepth >= MAX_TEMPLATE_DEPTH) {
629
+ throw new VoodooSyntaxError(
630
+ `Template literal too deeply nested (limit of ${MAX_TEMPLATE_DEPTH} levels)`,
631
+ this.source,
632
+ t.start
633
+ );
634
+ }
635
+ templateDepth++;
636
+ try {
637
+ return {
638
+ t: "tpl",
639
+ quasis: part.quasis,
640
+ exprs: part.exprs.map((src) => parse(src))
641
+ };
642
+ } finally {
643
+ templateDepth--;
644
+ }
645
+ }
646
+ if (t.type === "ident") {
647
+ if (t.value in LITERALS) {
648
+ this.next();
649
+ return { t: "lit", v: LITERALS[t.value] };
650
+ }
651
+ this.next();
652
+ return { t: "id", n: t.value };
653
+ }
654
+ if (t.type === "punct") {
655
+ if (t.value === "(") {
656
+ this.next();
657
+ const expr = this.parseExpression();
658
+ this.expect(")");
659
+ return expr;
660
+ }
661
+ if (t.value === "[") return this.parseArrayLiteral();
662
+ if (t.value === "{") return this.parseObjectLiteral();
663
+ }
664
+ throw new VoodooSyntaxError(
665
+ `Unexpected token "${t.value || "end of expression"}"`,
666
+ this.source,
667
+ t.start
668
+ );
669
+ }
670
+ parseArrayLiteral() {
671
+ this.expect("[");
672
+ const els = [];
673
+ while (!this.isPunct("]")) {
674
+ if (this.isPunct("...")) {
675
+ this.next();
676
+ els.push({ spread: this.parseAssignment() });
677
+ } else {
678
+ els.push(this.parseAssignment());
679
+ }
680
+ if (this.isPunct(",")) this.next();
681
+ else break;
682
+ }
683
+ this.expect("]");
684
+ return { t: "arr", els };
685
+ }
686
+ parseObjectLiteral() {
687
+ this.expect("{");
688
+ const props = [];
689
+ while (!this.isPunct("}")) {
690
+ if (this.isPunct("...")) {
691
+ this.next();
692
+ props.push({ key: null, spread: this.parseAssignment() });
693
+ } else if (this.isPunct("[")) {
694
+ this.next();
695
+ const keyExpr = this.parseAssignment();
696
+ this.expect("]");
697
+ this.expect(":");
698
+ props.push({ key: null, keyExpr, value: this.parseAssignment() });
699
+ } else {
700
+ if (this.peek().type === "ident" && this.peek().value === "get" && this.peek(1).type === "ident" && this.isPunct("(", 2)) {
701
+ this.next();
702
+ const nameToken = this.next();
703
+ this.expect("(");
704
+ this.expect(")");
705
+ props.push({
706
+ key: String(nameToken.value),
707
+ getter: true,
708
+ value: { t: "method", params: [], body: this.parseArrowBody() }
709
+ });
710
+ if (this.isPunct(",")) this.next();
711
+ continue;
712
+ }
713
+ const keyToken = this.next();
714
+ if (keyToken.type !== "ident" && keyToken.type !== "str" && keyToken.type !== "num") {
715
+ throw new VoodooSyntaxError("Invalid object key", this.source, keyToken.start);
716
+ }
717
+ const key = String(keyToken.parsed ?? keyToken.value);
718
+ if (this.isPunct(":")) {
719
+ this.next();
720
+ props.push({ key, value: this.parseAssignment() });
721
+ } else if (this.isPunct("(")) {
722
+ this.next();
723
+ const params = [];
724
+ while (!this.isPunct(")")) {
725
+ const param = this.next();
726
+ if (param.type !== "ident") {
727
+ throw new VoodooSyntaxError("Expected a parameter name", this.source, param.start);
728
+ }
729
+ params.push(param.value);
730
+ if (this.isPunct(",")) this.next();
731
+ }
732
+ this.expect(")");
733
+ props.push({ key, value: { t: "method", params, body: this.parseArrowBody() } });
734
+ } else {
735
+ props.push({ key, value: { t: "id", n: key } });
736
+ }
737
+ }
738
+ if (this.isPunct(",")) this.next();
739
+ else break;
740
+ }
741
+ this.expect("}");
742
+ return { t: "obj", props };
743
+ }
744
+ };
745
+ var cache = /* @__PURE__ */ new Map();
746
+ var MAX_CACHE = 2e3;
747
+ function parse(source) {
748
+ const cached = cache.get(source);
749
+ if (cached) return cached;
750
+ const node = new Parser(tokenize(source), source).parseProgram();
751
+ if (cache.size >= MAX_CACHE) evictOldest();
752
+ cache.set(source, node);
753
+ return node;
754
+ }
755
+ function evictOldest() {
756
+ const alvo = Math.floor(MAX_CACHE / 2);
757
+ let removidos = 0;
758
+ for (const chave of cache.keys()) {
759
+ cache.delete(chave);
760
+ if (++removidos >= alvo) break;
761
+ }
762
+ }
763
+ function clearParseCache() {
764
+ cache.clear();
765
+ }
766
+
767
+ // src/parser/interpreter.ts
768
+ var SafeObject = /* @__PURE__ */ Object.freeze({
769
+ keys: Object.keys,
770
+ values: Object.values,
771
+ entries: Object.entries,
772
+ fromEntries: Object.fromEntries,
773
+ assign: Object.assign,
774
+ is: Object.is,
775
+ hasOwn: Object.hasOwn ?? ((o, k) => Object.prototype.hasOwnProperty.call(o, k))
776
+ });
777
+ var DELIBERATELY_WITHHELD = /* @__PURE__ */ new Set([
778
+ "eval",
779
+ "Function",
780
+ "window",
781
+ "globalThis",
782
+ "self",
783
+ "top",
784
+ "parent",
785
+ "document",
786
+ "fetch",
787
+ "XMLHttpRequest",
788
+ "importScripts",
789
+ "require",
790
+ "process",
791
+ "Reflect",
792
+ "Proxy",
793
+ "WebAssembly",
794
+ "localStorage",
795
+ "sessionStorage",
796
+ "indexedDB",
797
+ "navigator",
798
+ "location",
799
+ "history",
800
+ "crypto",
801
+ "Worker",
802
+ "SharedWorker",
803
+ "ServiceWorker"
804
+ ]);
805
+ var allowedGlobals = {
806
+ Math,
807
+ JSON,
808
+ Date,
809
+ Number,
810
+ String,
811
+ Boolean,
812
+ Array,
813
+ Object: SafeObject,
814
+ Intl,
815
+ RegExp,
816
+ Promise,
817
+ parseInt,
818
+ parseFloat,
819
+ isNaN,
820
+ isFinite,
821
+ encodeURIComponent,
822
+ decodeURIComponent,
823
+ console
824
+ };
825
+ var VoodooRuntimeError = class extends Error {
826
+ constructor(message, expression) {
827
+ super(expression ? `${message}
828
+
829
+ Expression: ${expression}` : message);
830
+ __publicField(this, "expression", expression);
831
+ this.name = "VoodooRuntimeError";
832
+ }
833
+ };
834
+ var SPREAD = /* @__PURE__ */ Symbol("spread");
835
+ var BLOCKED_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
836
+ function chaveBloqueada(key) {
837
+ return typeof key === "string" && BLOCKED_KEYS.has(key);
838
+ }
839
+ function checkKey(key, expression) {
840
+ if (chaveBloqueada(key)) {
841
+ throw new VoodooRuntimeError(
842
+ `Access blocked to "${String(key)}": template expressions cannot reach the prototype chain. Expose a method in state instead.`,
843
+ expression
844
+ );
845
+ }
846
+ return key;
847
+ }
848
+ function evaluate(node, scope) {
849
+ switch (node.t) {
850
+ case "lit":
851
+ return node.v;
852
+ case "tpl": {
853
+ let out = node.quasis[0] ?? "";
854
+ for (let i = 0; i < node.exprs.length; i++) {
855
+ out += stringify(evaluate(node.exprs[i], scope));
856
+ out += node.quasis[i + 1] ?? "";
857
+ }
858
+ return out;
859
+ }
860
+ case "id": {
861
+ checkKey(node.n);
862
+ const owner = scope.lookup(node.n);
863
+ if (owner) return owner[node.n];
864
+ if (node.n in allowedGlobals) return allowedGlobals[node.n];
865
+ return void 0;
866
+ }
867
+ case "member": {
868
+ const obj = evaluate(node.o, scope);
869
+ if (obj == null) {
870
+ if (node.opt) return void 0;
871
+ throw new VoodooRuntimeError(
872
+ `Could not read "${describeKey(node, scope)}" from ${obj === null ? "null" : "undefined"}`
873
+ );
874
+ }
875
+ const key = checkKey(
876
+ node.computed ? evaluate(node.p, scope) : node.p.v
877
+ );
878
+ return obj[key];
879
+ }
880
+ case "call": {
881
+ let thisArg;
882
+ let fn;
883
+ if (node.callee.t === "member") {
884
+ const obj = evaluate(node.callee.o, scope);
885
+ if (obj == null) {
886
+ if (node.callee.opt || node.opt) return void 0;
887
+ throw new VoodooRuntimeError(
888
+ `Could not call "${describeKey(node.callee, scope)}" from ${obj === null ? "null" : "undefined"}`
889
+ );
890
+ }
891
+ const key = checkKey(
892
+ node.callee.computed ? evaluate(node.callee.p, scope) : node.callee.p.v
893
+ );
894
+ thisArg = obj;
895
+ fn = obj[key];
896
+ } else if (node.callee.t === "id") {
897
+ checkKey(node.callee.n);
898
+ const owner = scope.lookup(node.callee.n);
899
+ if (owner) {
900
+ thisArg = owner;
901
+ fn = owner[node.callee.n];
902
+ } else {
903
+ fn = allowedGlobals[node.callee.n];
904
+ }
905
+ } else {
906
+ fn = evaluate(node.callee, scope);
907
+ }
908
+ if (fn == null && node.opt) return void 0;
909
+ if (typeof fn !== "function") {
910
+ const name = node.callee.t === "id" ? node.callee.n : describeKey(node.callee, scope);
911
+ if (node.callee.t === "id" && !scope.lookup(name) && !(name in allowedGlobals)) {
912
+ if (DELIBERATELY_WITHHELD.has(name)) {
913
+ throw new VoodooRuntimeError(
914
+ `"${name}" is blocked. Expressions run in a sandbox without access to it.`
915
+ );
916
+ }
917
+ throw new VoodooRuntimeError(
918
+ `"${name}" was not found. Expressions cannot reach window: expose it with V.config.globals.${name} = ..., or put it in scope with V.data({ ${name} }).`
919
+ );
920
+ }
921
+ throw new VoodooRuntimeError(`"${name}" is not a function`);
922
+ }
923
+ return fn.apply(thisArg, evalArgs(node.args, scope));
924
+ }
925
+ case "unary": {
926
+ if (node.op === "...") return { [SPREAD]: evaluate(node.a, scope) };
927
+ if (node.op === "typeof") {
928
+ if (node.a.t === "id") {
929
+ if (chaveBloqueada(node.a.n)) return "undefined";
930
+ const owner = scope.lookup(node.a.n);
931
+ const value = owner ? owner[node.a.n] : allowedGlobals[node.a.n];
932
+ return typeof value;
933
+ }
934
+ return typeof evaluate(node.a, scope);
935
+ }
936
+ const v = evaluate(node.a, scope);
937
+ switch (node.op) {
938
+ case "!":
939
+ return !v;
940
+ case "-":
941
+ return -v;
942
+ case "+":
943
+ return +v;
944
+ case "void":
945
+ return void 0;
946
+ }
947
+ throw new VoodooRuntimeError(`Unsupported unary operator: ${node.op}`);
948
+ }
949
+ case "update": {
950
+ const old = Number(evaluate(node.a, scope));
951
+ const updated = node.op === "++" ? old + 1 : old - 1;
952
+ assign(node.a, updated, scope);
953
+ return node.prefix ? updated : old;
954
+ }
955
+ case "bin": {
956
+ const l = evaluate(node.l, scope);
957
+ const r = evaluate(node.r, scope);
958
+ switch (node.op) {
959
+ case "+":
960
+ return l + r;
961
+ case "-":
962
+ return l - r;
963
+ case "*":
964
+ return l * r;
965
+ case "/":
966
+ return l / r;
967
+ case "%":
968
+ return l % r;
969
+ case "**":
970
+ return l ** r;
971
+ case "==":
972
+ return l == r;
973
+ case "!=":
974
+ return l != r;
975
+ case "===":
976
+ return l === r;
977
+ case "!==":
978
+ return l !== r;
979
+ case "<":
980
+ return l < r;
981
+ case ">":
982
+ return l > r;
983
+ case "<=":
984
+ return l <= r;
985
+ case ">=":
986
+ return l >= r;
987
+ case "in":
988
+ return l in r;
989
+ case "instanceof":
990
+ return l instanceof r;
991
+ }
992
+ throw new VoodooRuntimeError(`Unsupported operator: ${node.op}`);
993
+ }
994
+ case "logic": {
995
+ const l = evaluate(node.l, scope);
996
+ if (node.op === "&&") return l ? evaluate(node.r, scope) : l;
997
+ if (node.op === "||") return l ? l : evaluate(node.r, scope);
998
+ return l ?? evaluate(node.r, scope);
999
+ }
1000
+ case "cond":
1001
+ return evaluate(node.test, scope) ? evaluate(node.cons, scope) : evaluate(node.alt, scope);
1002
+ case "assign": {
1003
+ let value;
1004
+ if (node.op === "=") {
1005
+ value = evaluate(node.value, scope);
1006
+ } else if (node.op === "&&=" || node.op === "||=" || node.op === "??=") {
1007
+ const current = evaluate(node.target, scope);
1008
+ const shouldAssign = node.op === "&&=" ? !!current : node.op === "||=" ? !current : current == null;
1009
+ if (!shouldAssign) return current;
1010
+ value = evaluate(node.value, scope);
1011
+ } else {
1012
+ const current = evaluate(node.target, scope);
1013
+ const operand = evaluate(node.value, scope);
1014
+ switch (node.op) {
1015
+ case "+=":
1016
+ value = current + operand;
1017
+ break;
1018
+ case "-=":
1019
+ value = current - operand;
1020
+ break;
1021
+ case "*=":
1022
+ value = current * operand;
1023
+ break;
1024
+ case "/=":
1025
+ value = current / operand;
1026
+ break;
1027
+ case "%=":
1028
+ value = current % operand;
1029
+ break;
1030
+ case "**=":
1031
+ value = current ** operand;
1032
+ break;
1033
+ default:
1034
+ throw new VoodooRuntimeError(`Unsupported assignment: ${node.op}`);
1035
+ }
1036
+ }
1037
+ assign(node.target, value, scope);
1038
+ return value;
1039
+ }
1040
+ case "if": {
1041
+ if (evaluate(node.test, scope)) return evaluate(node.cons, scope);
1042
+ return node.alt ? evaluate(node.alt, scope) : void 0;
1043
+ }
1044
+ case "method": {
1045
+ const methodParams = node.params;
1046
+ const methodBody = node.body;
1047
+ return function(...args) {
1048
+ const vars = {};
1049
+ for (let i = 0; i < methodParams.length; i++) vars[methodParams[i]] = args[i];
1050
+ const owner = this;
1051
+ const base = owner !== null && typeof owner === "object" ? scope.child(owner) : scope;
1052
+ return evaluate(methodBody, base.child(vars));
1053
+ };
1054
+ }
1055
+ case "arrow": {
1056
+ const params = node.params;
1057
+ const body = node.body;
1058
+ return (...args) => {
1059
+ const vars = {};
1060
+ for (let i = 0; i < params.length; i++) vars[params[i]] = args[i];
1061
+ return evaluate(body, scope.child(vars));
1062
+ };
1063
+ }
1064
+ case "obj": {
1065
+ const out = {};
1066
+ for (const prop of node.props) {
1067
+ if (prop.spread) {
1068
+ Object.assign(out, evaluate(prop.spread, scope));
1069
+ } else {
1070
+ const key = checkKey(
1071
+ prop.key !== null ? prop.key : String(evaluate(prop.keyExpr, scope))
1072
+ );
1073
+ if (prop.getter) {
1074
+ const compute = evaluate(prop.value, scope);
1075
+ Object.defineProperty(out, key, {
1076
+ enumerable: true,
1077
+ configurable: true,
1078
+ get() {
1079
+ return compute.call(this);
1080
+ }
1081
+ });
1082
+ continue;
1083
+ }
1084
+ out[key] = evaluate(prop.value, scope);
1085
+ }
1086
+ }
1087
+ return out;
1088
+ }
1089
+ case "arr": {
1090
+ const out = [];
1091
+ for (const el of node.els) {
1092
+ if (el && typeof el === "object" && "spread" in el) {
1093
+ out.push(...evaluate(el.spread, scope));
1094
+ } else {
1095
+ out.push(evaluate(el, scope));
1096
+ }
1097
+ }
1098
+ return out;
1099
+ }
1100
+ case "seq": {
1101
+ let last;
1102
+ for (const stmt of node.body) last = evaluate(stmt, scope);
1103
+ return last;
1104
+ }
1105
+ }
1106
+ throw new VoodooRuntimeError(`Unknown node: ${node.t}`);
1107
+ }
1108
+ function evalArgs(args, scope) {
1109
+ const out = [];
1110
+ for (const arg of args) {
1111
+ const value = evaluate(arg, scope);
1112
+ if (value && typeof value === "object" && SPREAD in value) {
1113
+ out.push(...value[SPREAD]);
1114
+ } else {
1115
+ out.push(value);
1116
+ }
1117
+ }
1118
+ return out;
1119
+ }
1120
+ function assign(target, value, scope) {
1121
+ if (target.t === "id") {
1122
+ checkKey(target.n);
1123
+ scope.set(target.n, value);
1124
+ return;
1125
+ }
1126
+ if (target.t === "member") {
1127
+ const obj = evaluate(target.o, scope);
1128
+ if (obj == null) {
1129
+ throw new VoodooRuntimeError("Could not write to null or undefined");
1130
+ }
1131
+ const key = checkKey(
1132
+ target.computed ? evaluate(target.p, scope) : target.p.v
1133
+ );
1134
+ obj[key] = value;
1135
+ return;
1136
+ }
1137
+ throw new VoodooRuntimeError("Invalid assignment target");
1138
+ }
1139
+ function describeKey(node, scope) {
1140
+ if (node.t === "member") {
1141
+ return node.computed ? String(evaluate(node.p, scope)) : String(node.p.v);
1142
+ }
1143
+ if (node.t === "id") return node.n;
1144
+ return "value";
1145
+ }
1146
+ function stringify(value) {
1147
+ if (value == null) return "";
1148
+ if (typeof value === "string") return value;
1149
+ if (typeof value === "number" || typeof value === "boolean") return String(value);
1150
+ if (value instanceof Date) return value.toLocaleString();
1151
+ if (typeof value === "object") {
1152
+ try {
1153
+ return JSON.stringify(value);
1154
+ } catch {
1155
+ return String(value);
1156
+ }
1157
+ }
1158
+ return String(value);
1159
+ }
1160
+
1161
+ // src/runtime/scope.ts
1162
+ var magics = /* @__PURE__ */ new Map();
1163
+ function magic(name, getter) {
1164
+ magics.set(name.startsWith("$") ? name : `$${name}`, getter);
1165
+ }
1166
+ var Scope = class _Scope {
1167
+ // Assignment order matches the order the fields were declared in before, so
1168
+ // the properties are created in the same sequence they always were.
1169
+ constructor(data = {}, parent = null, el = null) {
1170
+ this.refs = {};
1171
+ this.component = null;
1172
+ this.provides = null;
1173
+ this.magicCache = null;
1174
+ this.data = data;
1175
+ this.parent = parent;
1176
+ this.el = el;
1177
+ }
1178
+ /** Root scope of the chain. */
1179
+ get root() {
1180
+ let s = this;
1181
+ while (s.parent) s = s.parent;
1182
+ return s;
1183
+ }
1184
+ /** Look up a `provide` value by traveling up the scope chain. */
1185
+ inject(key, fallback) {
1186
+ let s = this;
1187
+ while (s) {
1188
+ if (s.provides && key in s.provides) return s.provides[key];
1189
+ s = s.parent;
1190
+ }
1191
+ return fallback;
1192
+ }
1193
+ /** Nearest component scope, traveling up the chain. */
1194
+ get owner() {
1195
+ let s = this;
1196
+ while (s) {
1197
+ if (s.component) return s;
1198
+ s = s.parent;
1199
+ }
1200
+ return null;
1201
+ }
1202
+ /** Set of visible refs, merging ancestor scopes. */
1203
+ get allRefs() {
1204
+ const chain = [];
1205
+ let s = this;
1206
+ while (s) {
1207
+ chain.unshift(s);
1208
+ s = s.parent;
1209
+ }
1210
+ const out = {};
1211
+ for (const scope of chain) Object.assign(out, scope.refs);
1212
+ return out;
1213
+ }
1214
+ lookup(name) {
1215
+ let s = this;
1216
+ while (s) {
1217
+ if (name in s.data) return s.data;
1218
+ s = s.parent;
1219
+ }
1220
+ if (name.charCodeAt(0) === 36 && magics.has(name)) {
1221
+ return this.magicContainer(name);
1222
+ }
1223
+ return void 0;
1224
+ }
1225
+ has(name) {
1226
+ return this.lookup(name) !== void 0;
1227
+ }
1228
+ get(name) {
1229
+ const owner = this.lookup(name);
1230
+ return owner ? owner[name] : void 0;
1231
+ }
1232
+ set(name, value) {
1233
+ let s = this;
1234
+ while (s) {
1235
+ if (name in s.data) {
1236
+ s.data[name] = value;
1237
+ return;
1238
+ }
1239
+ s = s.parent;
1240
+ }
1241
+ this.data[name] = value;
1242
+ }
1243
+ child(vars = {}, el = null) {
1244
+ return new _Scope(vars, this, el ?? this.el);
1245
+ }
1246
+ /** Create a reactive child scope, used by `v-data` and `v-for`. */
1247
+ reactiveChild(vars, el = null) {
1248
+ return new _Scope(reactive(vars), this, el ?? this.el);
1249
+ }
1250
+ magicContainer(name) {
1251
+ if (!this.magicCache) this.magicCache = /* @__PURE__ */ new Map();
1252
+ const cached = this.magicCache.get(name);
1253
+ if (cached) return cached;
1254
+ const getter = magics.get(name);
1255
+ const scope = this;
1256
+ const container = {};
1257
+ Object.defineProperty(container, name, {
1258
+ get: () => getter(scope),
1259
+ set: (value) => {
1260
+ const target = getter(scope);
1261
+ if (target && typeof target === "object" && "set" in target) {
1262
+ target.set(value);
1263
+ }
1264
+ },
1265
+ enumerable: true,
1266
+ configurable: true
1267
+ });
1268
+ this.magicCache.set(name, container);
1269
+ return container;
1270
+ }
1271
+ };
1272
+ var rootScope = new Scope(reactive({}));
1273
+
1274
+ // src/runtime/walker.ts
1275
+ var nodeScopes = /* @__PURE__ */ new WeakMap();
1276
+ var nodeCleanups = /* @__PURE__ */ new WeakMap();
1277
+ var initialized = /* @__PURE__ */ new WeakSet();
1278
+ var nodeEffectScopes = /* @__PURE__ */ new WeakMap();
1279
+ function isInitialized(node) {
1280
+ return initialized.has(node);
1281
+ }
1282
+ function markInitialized(node) {
1283
+ initialized.add(node);
1284
+ }
1285
+ function getScope(node) {
1286
+ return nodeScopes.get(node);
1287
+ }
1288
+ function findScope(node) {
1289
+ let current = node;
1290
+ while (current) {
1291
+ const scope = nodeScopes.get(current);
1292
+ if (scope) return scope;
1293
+ current = current.parentNode;
1294
+ }
1295
+ return rootScope;
1296
+ }
1297
+ function trackEffectScope(node, scope) {
1298
+ let list = nodeEffectScopes.get(node);
1299
+ if (!list) nodeEffectScopes.set(node, list = []);
1300
+ list.push(scope);
1301
+ }
1302
+ function getEffectScopes(node) {
1303
+ return nodeEffectScopes.get(node) ?? [];
1304
+ }
1305
+ var ignoredRemovals = /* @__PURE__ */ new WeakSet();
1306
+ function removeQuietly(node) {
1307
+ ignoredRemovals.add(node);
1308
+ node.remove();
1309
+ }
1310
+ function addCleanup(node, fn) {
1311
+ let list = nodeCleanups.get(node);
1312
+ if (!list) nodeCleanups.set(node, list = []);
1313
+ list.push(fn);
1314
+ }
1315
+ function destroy(node) {
1316
+ if (node.nodeType === 1) {
1317
+ const children = [];
1318
+ for (let child = node.firstChild; child; child = child.nextSibling) {
1319
+ if (child.nodeType === 1 || child.nodeType === 3) children.push(child);
1320
+ }
1321
+ for (let i = children.length - 1; i >= 0; i--) destroy(children[i]);
1322
+ }
1323
+ const list = nodeCleanups.get(node);
1324
+ if (list) {
1325
+ nodeCleanups.delete(node);
1326
+ for (let i = list.length - 1; i >= 0; i--) {
1327
+ try {
1328
+ list[i]();
1329
+ } catch (err) {
1330
+ handleError(err, "cleanup");
1331
+ }
1332
+ }
1333
+ }
1334
+ if (node.nodeType === 1) unindexElement(node);
1335
+ nodeScopes.delete(node);
1336
+ nodeEffectScopes.delete(node);
1337
+ initialized.delete(node);
1338
+ }
1339
+ var parsedAttributes = /* @__PURE__ */ new Map();
1340
+ var MAX_PARSED_ATTRIBUTES = 4e3;
1341
+ function parseAttribute(name, value) {
1342
+ const cacheKey = `${name}\0${value}`;
1343
+ const hit = parsedAttributes.get(cacheKey);
1344
+ if (hit !== void 0) return hit;
1345
+ const parsed = parseAttributeUncached(name, value);
1346
+ if (parsedAttributes.size >= MAX_PARSED_ATTRIBUTES) parsedAttributes.clear();
1347
+ parsedAttributes.set(cacheKey, parsed);
1348
+ return parsed;
1349
+ }
1350
+ function parseAttributeUncached(name, value) {
1351
+ const prefix = config.prefix;
1352
+ let body;
1353
+ if (name.startsWith("@")) {
1354
+ body = `on:${name.slice(1)}`;
1355
+ } else if (name.startsWith(":") && name.length > 1) {
1356
+ body = `bind:${name.slice(1)}`;
1357
+ } else if (name.startsWith(".") && name.length > 1) {
1358
+ body = `bind:${name.slice(1)}.prop`;
1359
+ } else if (name.startsWith(prefix)) {
1360
+ body = name.slice(prefix.length);
1361
+ } else if (name.startsWith("data-v-")) {
1362
+ body = name.slice("data-v-".length);
1363
+ } else {
1364
+ return null;
1365
+ }
1366
+ if (!body) return null;
1367
+ const parts = body.split(".");
1368
+ const head = parts.shift();
1369
+ const modifiers = {};
1370
+ for (const mod of parts) {
1371
+ const eq = mod.indexOf("=");
1372
+ if (eq > -1) modifiers[mod.slice(0, eq)] = mod.slice(eq + 1);
1373
+ else modifiers[mod] = true;
1374
+ }
1375
+ const colon = head.indexOf(":");
1376
+ const directiveName = colon > -1 ? head.slice(0, colon) : head;
1377
+ const arg = colon > -1 ? head.slice(colon + 1) : void 0;
1378
+ return { raw: name, name: directiveName, arg, modifiers, expression: value };
1379
+ }
1380
+ function collectDirectives(el) {
1381
+ const out = [];
1382
+ const cache2 = attributeCache.get(el);
1383
+ if (cache2 && cache2.size) {
1384
+ for (const [name, value] of cache2) {
1385
+ const parsed = parseAttribute(name, value);
1386
+ if (parsed) {
1387
+ out.push(parsed);
1388
+ indexDirective(el, parsed.name);
1389
+ }
1390
+ }
1391
+ } else {
1392
+ const names = attributeNames(el);
1393
+ for (let i = 0; i < names.length; i++) {
1394
+ const name = names[i];
1395
+ if (!looksLikeDirective(name)) continue;
1396
+ const parsed = parseAttribute(name, el.getAttribute(name));
1397
+ if (parsed) {
1398
+ out.push(parsed);
1399
+ indexDirective(el, parsed.name);
1400
+ }
1401
+ }
1402
+ }
1403
+ if (out.length < 2) return out;
1404
+ return out.sort((a, b) => priorityOf(b) - priorityOf(a));
1405
+ }
1406
+ var canListAttributeNames = typeof Element !== "undefined" && !!Element.prototype.getAttributeNames;
1407
+ function attributeNames(el) {
1408
+ if (canListAttributeNames) return el.getAttributeNames();
1409
+ return Array.from(el.attributes, (a) => a.name);
1410
+ }
1411
+ function looksLikeDirective(name) {
1412
+ return isVoodooAttribute(name) || name.charCodeAt(0) === 46 && name.length > 1;
1413
+ }
1414
+ function priorityOf(attr) {
1415
+ return directives.get(attr.name)?.priority ?? 0;
1416
+ }
1417
+ var directiveIndex = /* @__PURE__ */ new Map();
1418
+ var directiveNamesOf = /* @__PURE__ */ new WeakMap();
1419
+ function indexDirective(el, name) {
1420
+ let set = directiveIndex.get(name);
1421
+ if (!set) directiveIndex.set(name, set = /* @__PURE__ */ new Set());
1422
+ set.add(el);
1423
+ let names = directiveNamesOf.get(el);
1424
+ if (!names) directiveNamesOf.set(el, names = /* @__PURE__ */ new Set());
1425
+ names.add(name);
1426
+ }
1427
+ function unindexElement(el) {
1428
+ const names = directiveNamesOf.get(el);
1429
+ if (!names) return;
1430
+ for (const name of names) directiveIndex.get(name)?.delete(el);
1431
+ directiveNamesOf.delete(el);
1432
+ }
1433
+ function hasDirective(el, name) {
1434
+ if (directiveIndex.get(name)?.has(el)) return true;
1435
+ return el.hasAttribute(`${config.prefix}${name}`) || el.hasAttribute(`data-v-${name}`);
1436
+ }
1437
+ function queryDirective(root, name) {
1438
+ const out = [];
1439
+ const set = directiveIndex.get(name);
1440
+ const root_ = root;
1441
+ if (set) {
1442
+ for (const el of set) {
1443
+ if (!el.isConnected) continue;
1444
+ if (root_.contains && root_.contains(el) && el !== root_) out.push(el);
1445
+ }
1446
+ }
1447
+ const seen = new Set(out);
1448
+ for (const el of Array.from(
1449
+ root.querySelectorAll(`[${config.prefix}${name}],[data-v-${name}]`)
1450
+ )) {
1451
+ if (seen.has(el)) continue;
1452
+ seen.add(el);
1453
+ out.push(el);
1454
+ }
1455
+ out.sort(
1456
+ (a, b) => a.compareDocumentPosition(b) & window.Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1
1457
+ );
1458
+ return out;
1459
+ }
1460
+ function closestDirective(el, name) {
1461
+ let current = el;
1462
+ while (current) {
1463
+ if (hasDirective(current, name)) return current;
1464
+ current = current.parentElement;
1465
+ }
1466
+ return null;
1467
+ }
1468
+ var attributeCache = /* @__PURE__ */ new WeakMap();
1469
+ function isVoodooAttribute(name) {
1470
+ return name.startsWith(config.prefix) || name.startsWith("data-v-") || name.charCodeAt(0) === 64 || name.charCodeAt(0) === 58 && name.length > 1;
1471
+ }
1472
+ function readAttr(el, name) {
1473
+ const cached = attributeCache.get(el)?.get(name);
1474
+ if (cached !== void 0) return cached;
1475
+ return el.getAttribute(name);
1476
+ }
1477
+ function hasAttr(el, name) {
1478
+ const map = attributeCache.get(el);
1479
+ if (map?.has(name)) return true;
1480
+ return el.hasAttribute(name);
1481
+ }
1482
+ function originalAttributes(el) {
1483
+ const map = attributeCache.get(el);
1484
+ if (map) return new Map(map);
1485
+ const out = /* @__PURE__ */ new Map();
1486
+ for (let i = 0; i < el.attributes.length; i++) {
1487
+ const attr = el.attributes[i];
1488
+ if (isVoodooAttribute(attr.name)) out.set(attr.name, attr.value);
1489
+ }
1490
+ return out;
1491
+ }
1492
+ function stripAttributes(el) {
1493
+ if (!config.cleanAttributes) return;
1494
+ const names = attributeNames(el);
1495
+ let map = attributeCache.get(el);
1496
+ if (!map) attributeCache.set(el, map = /* @__PURE__ */ new Map());
1497
+ for (let i = 0; i < names.length; i++) {
1498
+ const name = names[i];
1499
+ if (!isVoodooAttribute(name)) continue;
1500
+ map.set(name, el.getAttribute(name));
1501
+ el.removeAttribute(name);
1502
+ }
1503
+ }
1504
+ function restoreAttributes(el) {
1505
+ const map = attributeCache.get(el);
1506
+ if (!map) return;
1507
+ for (const [name, value] of map) {
1508
+ if (el.hasAttribute(name)) continue;
1509
+ try {
1510
+ el.setAttribute(name, value);
1511
+ } catch {
1512
+ }
1513
+ }
1514
+ }
1515
+ function hadDirectives(el) {
1516
+ const cache2 = attributeCache.get(el);
1517
+ if (cache2 && cache2.size) return true;
1518
+ return hasDirectives(el);
1519
+ }
1520
+ function hasDirectives(el) {
1521
+ const attrs = el.attributes;
1522
+ for (let i = 0; i < attrs.length; i++) {
1523
+ const n = attrs[i].name;
1524
+ if (n.startsWith(config.prefix) || n.charCodeAt(0) === 64 || n.charCodeAt(0) === 58 || n.startsWith("data-v-")) {
1525
+ return true;
1526
+ }
1527
+ }
1528
+ return false;
1529
+ }
1530
+ function evaluateIn(expression, scope, context, el) {
1531
+ if (!expression) return void 0;
1532
+ try {
1533
+ return evaluate(parse(expression), scope);
1534
+ } catch (err) {
1535
+ if (inDevelopment()) {
1536
+ warnInvalidExpression(el ?? scope.el, context ?? "expression", expression, err);
1537
+ }
1538
+ handleError(err, context ? `${context} ("${expression}")` : `expression "${expression}"`);
1539
+ return void 0;
1540
+ }
1541
+ }
1542
+ var skipChildren = /* @__PURE__ */ new WeakSet();
1543
+ function markSkipChildren(el) {
1544
+ skipChildren.add(el);
1545
+ }
1546
+ function runDirective(el, attr, scope) {
1547
+ const def = directives.get(attr.name);
1548
+ if (!def) {
1549
+ if (inDevelopment() && attr.raw.startsWith(config.prefix)) {
1550
+ warnUnknownDirective(el, attr.raw, attr.name);
1551
+ }
1552
+ return;
1553
+ }
1554
+ let scopeOwner = null;
1555
+ const ownerScope = () => {
1556
+ if (!scopeOwner) {
1557
+ const created = scopeOwner = new EffectScope(true);
1558
+ addCleanup(el, () => created.stop());
1559
+ trackEffectScope(el, created);
1560
+ }
1561
+ return scopeOwner;
1562
+ };
1563
+ const ctx = {
1564
+ el,
1565
+ scope,
1566
+ expression: attr.expression,
1567
+ arg: attr.arg,
1568
+ modifiers: attr.modifiers,
1569
+ raw: attr.raw,
1570
+ evaluate(expression) {
1571
+ return evaluateIn(expression ?? attr.expression, scope, attr.raw, el);
1572
+ },
1573
+ effect(fn) {
1574
+ const owner = ownerScope();
1575
+ owner.run(() => effect(fn, { scope: owner }));
1576
+ },
1577
+ cleanup(fn) {
1578
+ addCleanup(el, fn);
1579
+ },
1580
+ walk(node, childScope) {
1581
+ walk(node, childScope);
1582
+ }
1583
+ };
1584
+ try {
1585
+ def.setup(ctx);
1586
+ } catch (err) {
1587
+ handleError(err, `directive ${attr.raw}`);
1588
+ }
1589
+ }
1590
+ var componentMounter = null;
1591
+ function setComponentMounter(fn) {
1592
+ componentMounter = fn;
1593
+ }
1594
+ var HTML_SKIP = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "NOSCRIPT"]);
1595
+ function walk(node, scope) {
1596
+ const activeScope = scope ?? findScope(node.parentNode);
1597
+ if (node.nodeType === 11) {
1598
+ const children = Array.from(node.childNodes);
1599
+ for (const child of children) walk(child, activeScope);
1600
+ return;
1601
+ }
1602
+ if (node.nodeType === 3) {
1603
+ bindTextNode(node, activeScope);
1604
+ return;
1605
+ }
1606
+ if (node.nodeType !== 1) return;
1607
+ const el = node;
1608
+ if (initialized.has(el)) return;
1609
+ const tag = el.tagName;
1610
+ if (HTML_SKIP.has(tag)) return;
1611
+ if (el.hasAttribute(`${config.prefix}ignore`) || el.hasAttribute(`${config.prefix}pre`)) {
1612
+ initialized.add(el);
1613
+ return;
1614
+ }
1615
+ let current = activeScope;
1616
+ const attrs = collectDirectives(el);
1617
+ const tagComponent = components.size === 0 && componentAliases.size === 0 ? null : el.hasAttribute(`${config.prefix}component`) ? null : resolveComponentTag(tag);
1618
+ if (attrs.length === 0 && !tagComponent) {
1619
+ walkChildren(el, current);
1620
+ return;
1621
+ }
1622
+ initialized.add(el);
1623
+ for (const attr of attrs) {
1624
+ const def = directives.get(attr.name);
1625
+ if (def?.terminal) {
1626
+ runDirective(el, attr, current);
1627
+ return;
1628
+ }
1629
+ }
1630
+ const dataAttr = attrs.find((a) => a.name === "data");
1631
+ const componentAttr = attrs.find((a) => a.name === "component");
1632
+ const componentName = componentAttr ? componentAttr.expression || "" : tagComponent || "";
1633
+ let mountedComponent = false;
1634
+ if (componentName && componentMounter) {
1635
+ const created = componentMounter(el, componentName, current);
1636
+ if (created) {
1637
+ current = created;
1638
+ mountedComponent = true;
1639
+ nodeScopes.set(el, current);
1640
+ }
1641
+ } else if (dataAttr || componentAttr) {
1642
+ const raw = dataAttr ? evaluateIn(dataAttr.expression || "{}", current, "v-data") : {};
1643
+ current = current.reactiveChild(raw && typeof raw === "object" ? raw : {}, el);
1644
+ nodeScopes.set(el, current);
1645
+ }
1646
+ const attributeScope = mountedComponent ? activeScope : current;
1647
+ for (const attr of attrs) {
1648
+ if (attr.name === "data" || attr.name === "component") continue;
1649
+ runDirective(el, attr, attributeScope);
1650
+ }
1651
+ stripAttributes(el);
1652
+ if (!skipChildren.has(el)) walkChildren(el, current);
1653
+ }
1654
+ function walkChildren(el, scope) {
1655
+ const list = [];
1656
+ for (let child = el.firstChild; child; child = child.nextSibling) {
1657
+ if (child.nodeType === 1) list.push(child);
1658
+ else if (child.nodeType === 3) bindTextNode(child, scope);
1659
+ }
1660
+ for (const child of list) walk(child, nodeScopes.get(child) ?? scope);
1661
+ }
1662
+ var EXPRESSION_LIMIT = 500;
1663
+ var validExpressions = /* @__PURE__ */ new Map();
1664
+ function looksLikeExpression(text) {
1665
+ const trimmed = text.trim();
1666
+ if (!trimmed) return false;
1667
+ const cached = validExpressions.get(trimmed);
1668
+ if (cached !== void 0) return cached;
1669
+ let valid = true;
1670
+ try {
1671
+ valid = parse(trimmed).t !== "seq";
1672
+ } catch {
1673
+ valid = false;
1674
+ }
1675
+ validExpressions.set(trimmed, valid);
1676
+ return valid;
1677
+ }
1678
+ function closeBrace(source, start2) {
1679
+ let level = 0;
1680
+ let quote = null;
1681
+ for (let i = start2; i < source.length; i++) {
1682
+ const c = source[i];
1683
+ if (quote) {
1684
+ if (c === "\\") i++;
1685
+ else if (c === quote) quote = null;
1686
+ continue;
1687
+ }
1688
+ if (c === '"' || c === "'" || c === "`") {
1689
+ quote = c;
1690
+ continue;
1691
+ }
1692
+ if (c === "{") level++;
1693
+ else if (c === "}") {
1694
+ level--;
1695
+ if (level === 0) return i;
1696
+ }
1697
+ }
1698
+ return -1;
1699
+ }
1700
+ function sliceText(raw) {
1701
+ const segments = [];
1702
+ let literal = "";
1703
+ let i = 0;
1704
+ const saveLiteral = () => {
1705
+ if (literal) segments.push({ text: literal });
1706
+ literal = "";
1707
+ };
1708
+ while (i < raw.length) {
1709
+ const open = raw.indexOf("{", i);
1710
+ if (open === -1) {
1711
+ literal += raw.slice(i);
1712
+ break;
1713
+ }
1714
+ literal += raw.slice(i, open);
1715
+ const double = raw[open + 1] === "{";
1716
+ const close = double ? raw.indexOf("}}", open + 2) : closeBrace(raw, open);
1717
+ if (close === -1) {
1718
+ literal += raw[open];
1719
+ i = open + 1;
1720
+ continue;
1721
+ }
1722
+ const expression = double ? raw.slice(open + 2, close) : raw.slice(open + 1, close);
1723
+ const end = double ? close + 2 : close + 1;
1724
+ const fits = double || expression.length <= EXPRESSION_LIMIT;
1725
+ if (fits && looksLikeExpression(expression)) {
1726
+ saveLiteral();
1727
+ segments.push({
1728
+ expression: expression.trim(),
1729
+ raw: raw.slice(open, end),
1730
+ explicit: double
1731
+ });
1732
+ i = end;
1733
+ continue;
1734
+ }
1735
+ literal += raw[open];
1736
+ i = open + 1;
1737
+ }
1738
+ saveLiteral();
1739
+ return segments;
1740
+ }
1741
+ var NO_INTERPOLATION = /* @__PURE__ */ new Set(["PRE", "CODE", "SCRIPT", "STYLE", "TEXTAREA"]);
1742
+ function keepsLiteral(segment, value, scope) {
1743
+ if (segment.explicit || segment.raw === void 0) return false;
1744
+ let node;
1745
+ try {
1746
+ node = parse(segment.expression);
1747
+ } catch {
1748
+ return true;
1749
+ }
1750
+ if (node.t === "lit") return true;
1751
+ if (value !== void 0) return false;
1752
+ if (node.t === "id") return scope.lookup(node.n) === void 0 && !(node.n in allowedGlobals);
1753
+ return false;
1754
+ }
1755
+ function bindTextNode(node, scope) {
1756
+ const raw = node.textContent;
1757
+ if (!raw || raw.indexOf("{") === -1) return;
1758
+ if (initialized.has(node)) return;
1759
+ let ancestor = node.parentElement;
1760
+ while (ancestor) {
1761
+ if (NO_INTERPOLATION.has(ancestor.tagName)) return;
1762
+ if (ancestor.hasAttribute(`${config.prefix}ignore`) || ancestor.hasAttribute(`${config.prefix}pre`) || ancestor.hasAttribute("data-v-ignore") || ancestor.hasAttribute("data-v-pre")) {
1763
+ return;
1764
+ }
1765
+ ancestor = ancestor.parentElement;
1766
+ }
1767
+ const segments = sliceText(raw);
1768
+ if (!segments.some((s) => s.expression)) return;
1769
+ initialized.add(node);
1770
+ const owner = new EffectScope(true);
1771
+ addCleanup(node, () => owner.stop());
1772
+ trackEffectScope(node, owner);
1773
+ owner.run(
1774
+ () => effect(() => {
1775
+ let out = "";
1776
+ for (const segment of segments) {
1777
+ if (segment.text !== void 0) {
1778
+ out += segment.text;
1779
+ continue;
1780
+ }
1781
+ const value = evaluateIn(segment.expression, scope, "interpolation");
1782
+ out += keepsLiteral(segment, value, scope) ? segment.raw : stringify(value);
1783
+ }
1784
+ if (node.textContent !== out) node.textContent = out;
1785
+ }, { scope: owner })
1786
+ );
1787
+ }
1788
+ function markNodeScope(node, scope) {
1789
+ nodeScopes.set(node, scope);
1790
+ }
1791
+ function resolveComponentTag(tagName) {
1792
+ const lower = tagName.toLowerCase();
1793
+ if (components.has(lower)) return lower;
1794
+ const alias = componentAliases.get(lower);
1795
+ return alias ?? null;
1796
+ }
1797
+ var componentAliases = /* @__PURE__ */ new Map();
1798
+ var started = false;
1799
+ var observer = null;
1800
+ function start(root) {
1801
+ if (typeof document === "undefined") return;
1802
+ const target = root ?? config.root ?? document.body;
1803
+ if (!target) return;
1804
+ Object.assign(allowedGlobals, config.globals);
1805
+ walk(target, rootScope);
1806
+ if (!started) {
1807
+ started = true;
1808
+ if (config.autoDiscover) observeDOM(target);
1809
+ document.dispatchEvent(new CustomEvent("voodoo:ready", { detail: { root: target } }));
1810
+ }
1811
+ }
1812
+ function observeDOM(target) {
1813
+ if (typeof MutationObserver === "undefined") return;
1814
+ observer = new MutationObserver((mutations) => {
1815
+ for (const mutation of mutations) {
1816
+ for (let i = 0; i < mutation.removedNodes.length; i++) {
1817
+ const removed = mutation.removedNodes[i];
1818
+ if (ignoredRemovals.has(removed)) {
1819
+ ignoredRemovals.delete(removed);
1820
+ continue;
1821
+ }
1822
+ if (removed.nodeType === 1 && !removed.isConnected) destroy(removed);
1823
+ }
1824
+ for (let i = 0; i < mutation.addedNodes.length; i++) {
1825
+ const added = mutation.addedNodes[i];
1826
+ if (added.nodeType !== 1) continue;
1827
+ if (initialized.has(added)) continue;
1828
+ walk(added, findScope(added.parentNode));
1829
+ }
1830
+ }
1831
+ });
1832
+ observer.observe(target, { childList: true, subtree: true });
1833
+ }
1834
+ function stopObserving() {
1835
+ observer?.disconnect();
1836
+ observer = null;
1837
+ started = false;
1838
+ }
1839
+ function refresh(root) {
1840
+ walk(root ?? document.body, root ? findScope(root.parentNode) : rootScope);
1841
+ }
1842
+
1843
+ export { Scope, VoodooRuntimeError, VoodooSyntaxError, addCleanup, allowedGlobals, clearParseCache, closestDirective, collectDirectives, componentAliases, destroy, evaluate, evaluateIn, findScope, getEffectScopes, getScope, hadDirectives, hasAttr, hasDirectives, isInitialized, magic, magics, markInitialized, markNodeScope, markSkipChildren, originalAttributes, parse, parseAttribute, queryDirective, readAttr, refresh, removeQuietly, restoreAttributes, rootScope, setComponentMounter, start, stopObserving, stringify, tokenize, walk };
1844
+ //# sourceMappingURL=chunk-5CKGDARU.js.map
1845
+ //# sourceMappingURL=chunk-5CKGDARU.js.map