@aevantec/litevue 0.5.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 (74) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +73 -0
  3. package/dist/litevue-devtools.iife.js +1 -0
  4. package/dist/litevue-devtools.mjs +841 -0
  5. package/dist/litevue-devtools.umd.js +1 -0
  6. package/dist/litevue-plugins.iife.js +14 -0
  7. package/dist/litevue-plugins.mjs +1282 -0
  8. package/dist/litevue-plugins.umd.js +14 -0
  9. package/dist/litevue.iife.js +12 -0
  10. package/dist/litevue.mjs +1781 -0
  11. package/dist/litevue.umd.js +12 -0
  12. package/dist/types/app.d.mts +21 -0
  13. package/dist/types/app.d.ts +21 -0
  14. package/dist/types/block.d.mts +15 -0
  15. package/dist/types/block.d.ts +15 -0
  16. package/dist/types/context.d.mts +17 -0
  17. package/dist/types/context.d.ts +17 -0
  18. package/dist/types/devtools-panel.d.mts +1 -0
  19. package/dist/types/devtools-panel.d.ts +1 -0
  20. package/dist/types/devtools.d.mts +62 -0
  21. package/dist/types/devtools.d.ts +62 -0
  22. package/dist/types/directives/bind.d.mts +4 -0
  23. package/dist/types/directives/bind.d.ts +4 -0
  24. package/dist/types/directives/effect.d.mts +2 -0
  25. package/dist/types/directives/effect.d.ts +2 -0
  26. package/dist/types/directives/for.d.mts +2 -0
  27. package/dist/types/directives/for.d.ts +2 -0
  28. package/dist/types/directives/html.d.mts +2 -0
  29. package/dist/types/directives/html.d.ts +2 -0
  30. package/dist/types/directives/if.d.mts +2 -0
  31. package/dist/types/directives/if.d.ts +2 -0
  32. package/dist/types/directives/index.d.mts +15 -0
  33. package/dist/types/directives/index.d.ts +15 -0
  34. package/dist/types/directives/model.d.mts +2 -0
  35. package/dist/types/directives/model.d.ts +2 -0
  36. package/dist/types/directives/on.d.mts +2 -0
  37. package/dist/types/directives/on.d.ts +2 -0
  38. package/dist/types/directives/ref.d.mts +2 -0
  39. package/dist/types/directives/ref.d.ts +2 -0
  40. package/dist/types/directives/show.d.mts +2 -0
  41. package/dist/types/directives/show.d.ts +2 -0
  42. package/dist/types/directives/text.d.mts +3 -0
  43. package/dist/types/directives/text.d.ts +3 -0
  44. package/dist/types/effect.d.mts +15 -0
  45. package/dist/types/effect.d.ts +15 -0
  46. package/dist/types/eval.d.mts +2 -0
  47. package/dist/types/eval.d.ts +2 -0
  48. package/dist/types/index.d.mts +8 -0
  49. package/dist/types/index.d.ts +8 -0
  50. package/dist/types/magics.d.mts +13 -0
  51. package/dist/types/magics.d.ts +13 -0
  52. package/dist/types/plugins/collapse.d.mts +10 -0
  53. package/dist/types/plugins/collapse.d.ts +10 -0
  54. package/dist/types/plugins/focus.d.mts +15 -0
  55. package/dist/types/plugins/focus.d.ts +15 -0
  56. package/dist/types/plugins/index.d.mts +7 -0
  57. package/dist/types/plugins/index.d.ts +7 -0
  58. package/dist/types/plugins/intersect.d.mts +11 -0
  59. package/dist/types/plugins/intersect.d.ts +11 -0
  60. package/dist/types/plugins/mask.d.mts +8 -0
  61. package/dist/types/plugins/mask.d.ts +8 -0
  62. package/dist/types/plugins/persist.d.mts +59 -0
  63. package/dist/types/plugins/persist.d.ts +59 -0
  64. package/dist/types/plugins/transition.d.mts +17 -0
  65. package/dist/types/plugins/transition.d.ts +17 -0
  66. package/dist/types/scheduler.d.mts +2 -0
  67. package/dist/types/scheduler.d.ts +2 -0
  68. package/dist/types/store.d.mts +10 -0
  69. package/dist/types/store.d.ts +10 -0
  70. package/dist/types/utils.d.mts +2 -0
  71. package/dist/types/utils.d.ts +2 -0
  72. package/dist/types/walk.d.mts +3 -0
  73. package/dist/types/walk.d.ts +3 -0
  74. package/package.json +124 -0
@@ -0,0 +1,1781 @@
1
+ /**
2
+ * @vue/shared v3.4.38
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/
6
+ /*! #__NO_SIDE_EFFECTS__ */
7
+ // @__NO_SIDE_EFFECTS__
8
+ function makeMap(str, expectsLowerCase) {
9
+ const set = new Set(str.split(","));
10
+ return (val) => set.has(val);
11
+ }
12
+ const NOOP = () => {
13
+ };
14
+ const extend = Object.assign;
15
+ const remove = (arr, el) => {
16
+ const i = arr.indexOf(el);
17
+ if (i > -1) {
18
+ arr.splice(i, 1);
19
+ }
20
+ };
21
+ const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
22
+ const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
23
+ const isArray = Array.isArray;
24
+ const isMap = (val) => toTypeString(val) === "[object Map]";
25
+ const isDate = (val) => toTypeString(val) === "[object Date]";
26
+ const isString = (val) => typeof val === "string";
27
+ const isSymbol = (val) => typeof val === "symbol";
28
+ const isObject = (val) => val !== null && typeof val === "object";
29
+ const objectToString = Object.prototype.toString;
30
+ const toTypeString = (value) => objectToString.call(value);
31
+ const toRawType = (value) => {
32
+ return toTypeString(value).slice(8, -1);
33
+ };
34
+ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
35
+ const cacheStringFunction = (fn) => {
36
+ const cache = /* @__PURE__ */ Object.create(null);
37
+ return (str) => {
38
+ const hit = cache[str];
39
+ return hit || (cache[str] = fn(str));
40
+ };
41
+ };
42
+ const camelizeRE = /-(\w)/g;
43
+ const camelize = cacheStringFunction((str) => {
44
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
45
+ });
46
+ const hyphenateRE = /\B([A-Z])/g;
47
+ const hyphenate = cacheStringFunction(
48
+ (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
49
+ );
50
+ const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
51
+ const toNumber = (val) => {
52
+ const n = isString(val) ? Number(val) : NaN;
53
+ return isNaN(n) ? val : n;
54
+ };
55
+ function normalizeStyle(value) {
56
+ if (isArray(value)) {
57
+ const res = {};
58
+ for (let i = 0; i < value.length; i++) {
59
+ const item = value[i];
60
+ const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
61
+ if (normalized) {
62
+ for (const key in normalized) {
63
+ res[key] = normalized[key];
64
+ }
65
+ }
66
+ }
67
+ return res;
68
+ } else if (isString(value) || isObject(value)) {
69
+ return value;
70
+ }
71
+ }
72
+ const listDelimiterRE = /;(?![^(]*\))/g;
73
+ const propertyDelimiterRE = /:([^]+)/;
74
+ const styleCommentRE = /\/\*[^]*?\*\//g;
75
+ function parseStringStyle(cssText) {
76
+ const ret = {};
77
+ cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
78
+ if (item) {
79
+ const tmp = item.split(propertyDelimiterRE);
80
+ tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
81
+ }
82
+ });
83
+ return ret;
84
+ }
85
+ function normalizeClass(value) {
86
+ let res = "";
87
+ if (isString(value)) {
88
+ res = value;
89
+ } else if (isArray(value)) {
90
+ for (let i = 0; i < value.length; i++) {
91
+ const normalized = normalizeClass(value[i]);
92
+ if (normalized) {
93
+ res += normalized + " ";
94
+ }
95
+ }
96
+ } else if (isObject(value)) {
97
+ for (const name in value) {
98
+ if (value[name]) {
99
+ res += name + " ";
100
+ }
101
+ }
102
+ }
103
+ return res.trim();
104
+ }
105
+ function looseCompareArrays(a, b) {
106
+ if (a.length !== b.length) return false;
107
+ let equal = true;
108
+ for (let i = 0; equal && i < a.length; i++) {
109
+ equal = looseEqual(a[i], b[i]);
110
+ }
111
+ return equal;
112
+ }
113
+ function looseEqual(a, b) {
114
+ if (a === b) return true;
115
+ let aValidType = isDate(a);
116
+ let bValidType = isDate(b);
117
+ if (aValidType || bValidType) {
118
+ return aValidType && bValidType ? a.getTime() === b.getTime() : false;
119
+ }
120
+ aValidType = isSymbol(a);
121
+ bValidType = isSymbol(b);
122
+ if (aValidType || bValidType) {
123
+ return a === b;
124
+ }
125
+ aValidType = isArray(a);
126
+ bValidType = isArray(b);
127
+ if (aValidType || bValidType) {
128
+ return aValidType && bValidType ? looseCompareArrays(a, b) : false;
129
+ }
130
+ aValidType = isObject(a);
131
+ bValidType = isObject(b);
132
+ if (aValidType || bValidType) {
133
+ if (!aValidType || !bValidType) {
134
+ return false;
135
+ }
136
+ const aKeysCount = Object.keys(a).length;
137
+ const bKeysCount = Object.keys(b).length;
138
+ if (aKeysCount !== bKeysCount) {
139
+ return false;
140
+ }
141
+ for (const key in a) {
142
+ const aHasKey = a.hasOwnProperty(key);
143
+ const bHasKey = b.hasOwnProperty(key);
144
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
145
+ return false;
146
+ }
147
+ }
148
+ }
149
+ return String(a) === String(b);
150
+ }
151
+ function looseIndexOf(arr, val) {
152
+ return arr.findIndex((item) => looseEqual(item, val));
153
+ }
154
+
155
+ /**
156
+ * @vue/reactivity v3.4.38
157
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
158
+ * @license MIT
159
+ **/
160
+ let activeEffectScope;
161
+ function recordEffectScope(effect2, scope = activeEffectScope) {
162
+ if (scope && scope.active) {
163
+ scope.effects.push(effect2);
164
+ }
165
+ }
166
+ let activeEffect;
167
+ class ReactiveEffect {
168
+ constructor(fn, trigger2, scheduler, scope) {
169
+ this.fn = fn;
170
+ this.trigger = trigger2;
171
+ this.scheduler = scheduler;
172
+ this.active = true;
173
+ this.deps = [];
174
+ this._dirtyLevel = 4;
175
+ this._trackId = 0;
176
+ this._runnings = 0;
177
+ this._shouldSchedule = false;
178
+ this._depsLength = 0;
179
+ recordEffectScope(this, scope);
180
+ }
181
+ get dirty() {
182
+ if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
183
+ this._dirtyLevel = 1;
184
+ pauseTracking();
185
+ for (let i = 0; i < this._depsLength; i++) {
186
+ const dep = this.deps[i];
187
+ if (dep.computed) {
188
+ triggerComputed(dep.computed);
189
+ if (this._dirtyLevel >= 4) {
190
+ break;
191
+ }
192
+ }
193
+ }
194
+ if (this._dirtyLevel === 1) {
195
+ this._dirtyLevel = 0;
196
+ }
197
+ resetTracking();
198
+ }
199
+ return this._dirtyLevel >= 4;
200
+ }
201
+ set dirty(v) {
202
+ this._dirtyLevel = v ? 4 : 0;
203
+ }
204
+ run() {
205
+ this._dirtyLevel = 0;
206
+ if (!this.active) {
207
+ return this.fn();
208
+ }
209
+ let lastShouldTrack = shouldTrack;
210
+ let lastEffect = activeEffect;
211
+ try {
212
+ shouldTrack = true;
213
+ activeEffect = this;
214
+ this._runnings++;
215
+ preCleanupEffect(this);
216
+ return this.fn();
217
+ } finally {
218
+ postCleanupEffect(this);
219
+ this._runnings--;
220
+ activeEffect = lastEffect;
221
+ shouldTrack = lastShouldTrack;
222
+ }
223
+ }
224
+ stop() {
225
+ if (this.active) {
226
+ preCleanupEffect(this);
227
+ postCleanupEffect(this);
228
+ this.onStop && this.onStop();
229
+ this.active = false;
230
+ }
231
+ }
232
+ }
233
+ function triggerComputed(computed2) {
234
+ return computed2.value;
235
+ }
236
+ function preCleanupEffect(effect2) {
237
+ effect2._trackId++;
238
+ effect2._depsLength = 0;
239
+ }
240
+ function postCleanupEffect(effect2) {
241
+ if (effect2.deps.length > effect2._depsLength) {
242
+ for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
243
+ cleanupDepEffect(effect2.deps[i], effect2);
244
+ }
245
+ effect2.deps.length = effect2._depsLength;
246
+ }
247
+ }
248
+ function cleanupDepEffect(dep, effect2) {
249
+ const trackId = dep.get(effect2);
250
+ if (trackId !== void 0 && effect2._trackId !== trackId) {
251
+ dep.delete(effect2);
252
+ if (dep.size === 0) {
253
+ dep.cleanup();
254
+ }
255
+ }
256
+ }
257
+ function effect$1(fn, options) {
258
+ if (fn.effect instanceof ReactiveEffect) {
259
+ fn = fn.effect.fn;
260
+ }
261
+ const _effect = new ReactiveEffect(fn, NOOP, () => {
262
+ if (_effect.dirty) {
263
+ _effect.run();
264
+ }
265
+ });
266
+ if (options) {
267
+ extend(_effect, options);
268
+ if (options.scope) recordEffectScope(_effect, options.scope);
269
+ }
270
+ if (!options || !options.lazy) {
271
+ _effect.run();
272
+ }
273
+ const runner = _effect.run.bind(_effect);
274
+ runner.effect = _effect;
275
+ return runner;
276
+ }
277
+ function stop(runner) {
278
+ runner.effect.stop();
279
+ }
280
+ let shouldTrack = true;
281
+ let pauseScheduleStack = 0;
282
+ const trackStack = [];
283
+ function pauseTracking() {
284
+ trackStack.push(shouldTrack);
285
+ shouldTrack = false;
286
+ }
287
+ function resetTracking() {
288
+ const last = trackStack.pop();
289
+ shouldTrack = last === void 0 ? true : last;
290
+ }
291
+ function pauseScheduling() {
292
+ pauseScheduleStack++;
293
+ }
294
+ function resetScheduling() {
295
+ pauseScheduleStack--;
296
+ while (!pauseScheduleStack && queueEffectSchedulers.length) {
297
+ queueEffectSchedulers.shift()();
298
+ }
299
+ }
300
+ function trackEffect(effect2, dep, debuggerEventExtraInfo) {
301
+ if (dep.get(effect2) !== effect2._trackId) {
302
+ dep.set(effect2, effect2._trackId);
303
+ const oldDep = effect2.deps[effect2._depsLength];
304
+ if (oldDep !== dep) {
305
+ if (oldDep) {
306
+ cleanupDepEffect(oldDep, effect2);
307
+ }
308
+ effect2.deps[effect2._depsLength++] = dep;
309
+ } else {
310
+ effect2._depsLength++;
311
+ }
312
+ }
313
+ }
314
+ const queueEffectSchedulers = [];
315
+ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
316
+ pauseScheduling();
317
+ for (const effect2 of dep.keys()) {
318
+ let tracking;
319
+ if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
320
+ effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
321
+ effect2._dirtyLevel = dirtyLevel;
322
+ }
323
+ if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
324
+ effect2.trigger();
325
+ if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
326
+ effect2._shouldSchedule = false;
327
+ if (effect2.scheduler) {
328
+ queueEffectSchedulers.push(effect2.scheduler);
329
+ }
330
+ }
331
+ }
332
+ }
333
+ resetScheduling();
334
+ }
335
+ const createDep = (cleanup, computed2) => {
336
+ const dep = /* @__PURE__ */ new Map();
337
+ dep.cleanup = cleanup;
338
+ dep.computed = computed2;
339
+ return dep;
340
+ };
341
+ const targetMap = /* @__PURE__ */ new WeakMap();
342
+ const ITERATE_KEY = Symbol("");
343
+ const MAP_KEY_ITERATE_KEY = Symbol("");
344
+ function track(target, type, key) {
345
+ if (shouldTrack && activeEffect) {
346
+ let depsMap = targetMap.get(target);
347
+ if (!depsMap) {
348
+ targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
349
+ }
350
+ let dep = depsMap.get(key);
351
+ if (!dep) {
352
+ depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
353
+ }
354
+ trackEffect(
355
+ activeEffect,
356
+ dep);
357
+ }
358
+ }
359
+ function trigger$1(target, type, key, newValue, oldValue, oldTarget) {
360
+ const depsMap = targetMap.get(target);
361
+ if (!depsMap) {
362
+ return;
363
+ }
364
+ let deps = [];
365
+ if (type === "clear") {
366
+ deps = [...depsMap.values()];
367
+ } else if (key === "length" && isArray(target)) {
368
+ const newLength = Number(newValue);
369
+ depsMap.forEach((dep, key2) => {
370
+ if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
371
+ deps.push(dep);
372
+ }
373
+ });
374
+ } else {
375
+ if (key !== void 0) {
376
+ deps.push(depsMap.get(key));
377
+ }
378
+ switch (type) {
379
+ case "add":
380
+ if (!isArray(target)) {
381
+ deps.push(depsMap.get(ITERATE_KEY));
382
+ if (isMap(target)) {
383
+ deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
384
+ }
385
+ } else if (isIntegerKey(key)) {
386
+ deps.push(depsMap.get("length"));
387
+ }
388
+ break;
389
+ case "delete":
390
+ if (!isArray(target)) {
391
+ deps.push(depsMap.get(ITERATE_KEY));
392
+ if (isMap(target)) {
393
+ deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
394
+ }
395
+ }
396
+ break;
397
+ case "set":
398
+ if (isMap(target)) {
399
+ deps.push(depsMap.get(ITERATE_KEY));
400
+ }
401
+ break;
402
+ }
403
+ }
404
+ pauseScheduling();
405
+ for (const dep of deps) {
406
+ if (dep) {
407
+ triggerEffects(
408
+ dep,
409
+ 4);
410
+ }
411
+ }
412
+ resetScheduling();
413
+ }
414
+ const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
415
+ const builtInSymbols = new Set(
416
+ /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
417
+ );
418
+ const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
419
+ function createArrayInstrumentations() {
420
+ const instrumentations = {};
421
+ ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
422
+ instrumentations[key] = function(...args) {
423
+ const arr = toRaw(this);
424
+ for (let i = 0, l = this.length; i < l; i++) {
425
+ track(arr, "get", i + "");
426
+ }
427
+ const res = arr[key](...args);
428
+ if (res === -1 || res === false) {
429
+ return arr[key](...args.map(toRaw));
430
+ } else {
431
+ return res;
432
+ }
433
+ };
434
+ });
435
+ ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
436
+ instrumentations[key] = function(...args) {
437
+ pauseTracking();
438
+ pauseScheduling();
439
+ const res = toRaw(this)[key].apply(this, args);
440
+ resetScheduling();
441
+ resetTracking();
442
+ return res;
443
+ };
444
+ });
445
+ return instrumentations;
446
+ }
447
+ function hasOwnProperty(key) {
448
+ if (!isSymbol(key)) key = String(key);
449
+ const obj = toRaw(this);
450
+ track(obj, "has", key);
451
+ return obj.hasOwnProperty(key);
452
+ }
453
+ class BaseReactiveHandler {
454
+ constructor(_isReadonly = false, _isShallow = false) {
455
+ this._isReadonly = _isReadonly;
456
+ this._isShallow = _isShallow;
457
+ }
458
+ get(target, key, receiver) {
459
+ const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
460
+ if (key === "__v_isReactive") {
461
+ return !isReadonly2;
462
+ } else if (key === "__v_isReadonly") {
463
+ return isReadonly2;
464
+ } else if (key === "__v_isShallow") {
465
+ return isShallow2;
466
+ } else if (key === "__v_raw") {
467
+ if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
468
+ // this means the receiver is a user proxy of the reactive proxy
469
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
470
+ return target;
471
+ }
472
+ return;
473
+ }
474
+ const targetIsArray = isArray(target);
475
+ if (!isReadonly2) {
476
+ if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
477
+ return Reflect.get(arrayInstrumentations, key, receiver);
478
+ }
479
+ if (key === "hasOwnProperty") {
480
+ return hasOwnProperty;
481
+ }
482
+ }
483
+ const res = Reflect.get(target, key, receiver);
484
+ if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
485
+ return res;
486
+ }
487
+ if (!isReadonly2) {
488
+ track(target, "get", key);
489
+ }
490
+ if (isShallow2) {
491
+ return res;
492
+ }
493
+ if (isRef(res)) {
494
+ return targetIsArray && isIntegerKey(key) ? res : res.value;
495
+ }
496
+ if (isObject(res)) {
497
+ return isReadonly2 ? readonly(res) : reactive(res);
498
+ }
499
+ return res;
500
+ }
501
+ }
502
+ class MutableReactiveHandler extends BaseReactiveHandler {
503
+ constructor(isShallow2 = false) {
504
+ super(false, isShallow2);
505
+ }
506
+ set(target, key, value, receiver) {
507
+ let oldValue = target[key];
508
+ if (!this._isShallow) {
509
+ const isOldValueReadonly = isReadonly(oldValue);
510
+ if (!isShallow(value) && !isReadonly(value)) {
511
+ oldValue = toRaw(oldValue);
512
+ value = toRaw(value);
513
+ }
514
+ if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
515
+ if (isOldValueReadonly) {
516
+ return false;
517
+ } else {
518
+ oldValue.value = value;
519
+ return true;
520
+ }
521
+ }
522
+ }
523
+ const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
524
+ const result = Reflect.set(target, key, value, receiver);
525
+ if (target === toRaw(receiver)) {
526
+ if (!hadKey) {
527
+ trigger$1(target, "add", key, value);
528
+ } else if (hasChanged(value, oldValue)) {
529
+ trigger$1(target, "set", key, value);
530
+ }
531
+ }
532
+ return result;
533
+ }
534
+ deleteProperty(target, key) {
535
+ const hadKey = hasOwn(target, key);
536
+ target[key];
537
+ const result = Reflect.deleteProperty(target, key);
538
+ if (result && hadKey) {
539
+ trigger$1(target, "delete", key, void 0);
540
+ }
541
+ return result;
542
+ }
543
+ has(target, key) {
544
+ const result = Reflect.has(target, key);
545
+ if (!isSymbol(key) || !builtInSymbols.has(key)) {
546
+ track(target, "has", key);
547
+ }
548
+ return result;
549
+ }
550
+ ownKeys(target) {
551
+ track(
552
+ target,
553
+ "iterate",
554
+ isArray(target) ? "length" : ITERATE_KEY
555
+ );
556
+ return Reflect.ownKeys(target);
557
+ }
558
+ }
559
+ class ReadonlyReactiveHandler extends BaseReactiveHandler {
560
+ constructor(isShallow2 = false) {
561
+ super(true, isShallow2);
562
+ }
563
+ set(target, key) {
564
+ return true;
565
+ }
566
+ deleteProperty(target, key) {
567
+ return true;
568
+ }
569
+ }
570
+ const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
571
+ const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
572
+ const reactiveMap = /* @__PURE__ */ new WeakMap();
573
+ const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
574
+ const readonlyMap = /* @__PURE__ */ new WeakMap();
575
+ const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
576
+ function targetTypeMap(rawType) {
577
+ switch (rawType) {
578
+ case "Object":
579
+ case "Array":
580
+ return 1;
581
+ case "Map":
582
+ case "Set":
583
+ case "WeakMap":
584
+ case "WeakSet":
585
+ return 2;
586
+ default:
587
+ return 0;
588
+ }
589
+ }
590
+ function getTargetType(value) {
591
+ return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
592
+ }
593
+ function reactive(target) {
594
+ if (isReadonly(target)) {
595
+ return target;
596
+ }
597
+ return createReactiveObject(
598
+ target,
599
+ false,
600
+ mutableHandlers,
601
+ null,
602
+ reactiveMap
603
+ );
604
+ }
605
+ function readonly(target) {
606
+ return createReactiveObject(
607
+ target,
608
+ true,
609
+ readonlyHandlers,
610
+ null,
611
+ readonlyMap
612
+ );
613
+ }
614
+ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
615
+ if (!isObject(target)) {
616
+ return target;
617
+ }
618
+ if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
619
+ return target;
620
+ }
621
+ const existingProxy = proxyMap.get(target);
622
+ if (existingProxy) {
623
+ return existingProxy;
624
+ }
625
+ const targetType = getTargetType(target);
626
+ if (targetType === 0) {
627
+ return target;
628
+ }
629
+ const proxy = new Proxy(
630
+ target,
631
+ targetType === 2 ? collectionHandlers : baseHandlers
632
+ );
633
+ proxyMap.set(target, proxy);
634
+ return proxy;
635
+ }
636
+ function isReadonly(value) {
637
+ return !!(value && value["__v_isReadonly"]);
638
+ }
639
+ function isShallow(value) {
640
+ return !!(value && value["__v_isShallow"]);
641
+ }
642
+ function toRaw(observed) {
643
+ const raw = observed && observed["__v_raw"];
644
+ return raw ? toRaw(raw) : observed;
645
+ }
646
+ function isRef(r) {
647
+ return !!(r && r.__v_isRef === true);
648
+ }
649
+
650
+ let uid = 0;
651
+ const createId = () => {
652
+ const memo = /* @__PURE__ */ Object.create(null);
653
+ return (name = "id") => memo[name] || (memo[name] = `${name}-${++uid}`);
654
+ };
655
+ const createWatch = (ctx) => (source, cb) => {
656
+ const getter = typeof source === "function" ? source : () => source.split(".").reduce((o, k) => o == null ? o : o[k], ctx.scope);
657
+ let oldValue;
658
+ let init = false;
659
+ ctx.effect(() => {
660
+ const value = getter();
661
+ if (init && value !== oldValue) {
662
+ pauseTracking();
663
+ cb(value, oldValue);
664
+ resetTracking();
665
+ }
666
+ init = true;
667
+ oldValue = value;
668
+ });
669
+ };
670
+
671
+ const scopes = /* @__PURE__ */ new Map();
672
+ const exps = /* @__PURE__ */ new Map();
673
+ const names = /* @__PURE__ */ new Map();
674
+ const storeMap = /* @__PURE__ */ new Map();
675
+ let disabled = false;
676
+ const isDisabled = () => disabled || typeof window !== "undefined" && window.__LITE_VUE_DEVTOOLS__ === false;
677
+ const listeners = {
678
+ "scope:mount": /* @__PURE__ */ new Set(),
679
+ "scope:unmount": /* @__PURE__ */ new Set(),
680
+ "store:register": /* @__PURE__ */ new Set(),
681
+ flush: /* @__PURE__ */ new Set()
682
+ };
683
+ const emit = (event, ...args) => {
684
+ listeners[event].forEach((fn) => fn(...args));
685
+ };
686
+ const noop = () => {
687
+ };
688
+ const registerScope = (el, scope, exp, name) => {
689
+ if (isDisabled()) return noop;
690
+ scopes.set(el, scope);
691
+ if (exp) exps.set(el, exp);
692
+ if (name) names.set(el, name);
693
+ emit("scope:mount", el, scope);
694
+ return () => {
695
+ if (scopes.delete(el)) {
696
+ exps.delete(el);
697
+ names.delete(el);
698
+ emit("scope:unmount", el);
699
+ }
700
+ };
701
+ };
702
+ const registerStore = (name, store) => {
703
+ if (isDisabled()) return;
704
+ storeMap.set(name, store);
705
+ emit("store:register", name, store);
706
+ };
707
+ const emitFlush = () => {
708
+ if (listeners.flush.size) {
709
+ emit("flush");
710
+ }
711
+ };
712
+ const devtools = {
713
+ scopes,
714
+ exps,
715
+ names,
716
+ stores: storeMap,
717
+ getScopeByName(name) {
718
+ for (const [el, n] of names) {
719
+ if (n === name) return scopes.get(el);
720
+ }
721
+ },
722
+ getScope(node) {
723
+ let el = node.nodeType === 1 ? node : node.parentElement;
724
+ while (el) {
725
+ const scope = scopes.get(el);
726
+ if (scope) return scope;
727
+ el = el.parentElement;
728
+ }
729
+ },
730
+ on(event, fn) {
731
+ listeners[event].add(fn);
732
+ return () => listeners[event].delete(fn);
733
+ },
734
+ off(event, fn) {
735
+ listeners[event].delete(fn);
736
+ }
737
+ };
738
+ const disableDevtools = () => {
739
+ disabled = true;
740
+ scopes.clear();
741
+ exps.clear();
742
+ names.clear();
743
+ storeMap.clear();
744
+ for (const event in listeners) {
745
+ listeners[event].clear();
746
+ }
747
+ if (typeof window !== "undefined" && window.__LITE_VUE__ === devtools) {
748
+ delete window.__LITE_VUE__;
749
+ }
750
+ };
751
+ if (typeof window !== "undefined" && !isDisabled()) {
752
+ window.__LITE_VUE__ = devtools;
753
+ }
754
+
755
+ let queued = false;
756
+ const queue = [];
757
+ const p = Promise.resolve();
758
+ const nextTick = (fn) => p.then(fn);
759
+ const queueJob = (job) => {
760
+ if (!queue.includes(job)) queue.push(job);
761
+ if (!queued) {
762
+ queued = true;
763
+ nextTick(flushJobs);
764
+ }
765
+ };
766
+ const flushJobs = () => {
767
+ for (const job of queue) {
768
+ job();
769
+ }
770
+ queue.length = 0;
771
+ queued = false;
772
+ emitFlush();
773
+ };
774
+
775
+ const forceAttrRE = /^(spellcheck|draggable|form|list|type)$/;
776
+ const bind = ({
777
+ el,
778
+ get,
779
+ effect,
780
+ arg,
781
+ modifiers
782
+ }) => {
783
+ let prevValue;
784
+ if (arg === "class") {
785
+ el._class = el.className;
786
+ }
787
+ effect(() => {
788
+ let value = get();
789
+ if (arg) {
790
+ if (modifiers?.camel) {
791
+ arg = camelize(arg);
792
+ }
793
+ setProp(el, arg, value, prevValue);
794
+ } else {
795
+ for (const key in value) {
796
+ setProp(el, key, value[key], prevValue && prevValue[key]);
797
+ }
798
+ for (const key in prevValue) {
799
+ if (!value || !(key in value)) {
800
+ setProp(el, key, null);
801
+ }
802
+ }
803
+ }
804
+ prevValue = value;
805
+ });
806
+ };
807
+ const setProp = (el, key, value, prevValue) => {
808
+ if (key === "class") {
809
+ el.setAttribute(
810
+ "class",
811
+ normalizeClass(el._class ? [el._class, value] : value) || ""
812
+ );
813
+ } else if (key === "style") {
814
+ value = normalizeStyle(value);
815
+ const { style } = el;
816
+ if (!value) {
817
+ el.removeAttribute("style");
818
+ } else if (isString(value)) {
819
+ if (value !== prevValue) style.cssText = value;
820
+ } else {
821
+ for (const key2 in value) {
822
+ setStyle(style, key2, value[key2]);
823
+ }
824
+ if (prevValue && !isString(prevValue)) {
825
+ for (const key2 in prevValue) {
826
+ if (value[key2] == null) {
827
+ setStyle(style, key2, "");
828
+ }
829
+ }
830
+ }
831
+ }
832
+ } else if (!(el instanceof SVGElement) && key in el && !forceAttrRE.test(key)) {
833
+ el[key] = value;
834
+ if (key === "value") {
835
+ el._value = value;
836
+ }
837
+ } else {
838
+ if (key === "true-value") {
839
+ el._trueValue = value;
840
+ } else if (key === "false-value") {
841
+ el._falseValue = value;
842
+ } else if (value != null) {
843
+ el.setAttribute(key, value);
844
+ } else {
845
+ el.removeAttribute(key);
846
+ }
847
+ }
848
+ };
849
+ const importantRE = /\s*!important$/;
850
+ const setStyle = (style, name, val) => {
851
+ if (isArray(val)) {
852
+ val.forEach((v) => setStyle(style, name, v));
853
+ } else {
854
+ if (name.startsWith("--")) {
855
+ style.setProperty(name, val);
856
+ } else {
857
+ if (importantRE.test(val)) {
858
+ style.setProperty(
859
+ hyphenate(name),
860
+ val.replace(importantRE, ""),
861
+ "important"
862
+ );
863
+ } else {
864
+ style[name] = val;
865
+ }
866
+ }
867
+ }
868
+ };
869
+
870
+ const simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
871
+ const systemModifiers = ["ctrl", "shift", "alt", "meta"];
872
+ const modifierGuards = {
873
+ stop: (e) => e.stopPropagation(),
874
+ prevent: (e) => e.preventDefault(),
875
+ self: (e) => e.target !== e.currentTarget,
876
+ ctrl: (e) => !e.ctrlKey,
877
+ shift: (e) => !e.shiftKey,
878
+ alt: (e) => !e.altKey,
879
+ meta: (e) => !e.metaKey,
880
+ left: (e) => "button" in e && e.button !== 0,
881
+ middle: (e) => "button" in e && e.button !== 1,
882
+ right: (e) => "button" in e && e.button !== 2,
883
+ exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers[m])
884
+ };
885
+ const nonKeyModifierRE = /^(stop|prevent|self|ctrl|shift|alt|meta|left|middle|right|exact|once|capture|passive|window|document|outside|debounce(-\d+)?|throttle(-\d+)?|prop-.+|name-.+)$/;
886
+ const on = ({ el, get, exp, arg, modifiers }) => {
887
+ if (!arg) {
888
+ return;
889
+ }
890
+ let handler = simplePathRE.test(exp) ? get(`(e => ${exp}(e))`) : get(`($event => { ${exp} })`);
891
+ if (arg === "mounted" || arg === "vue:mounted") {
892
+ nextTick(handler);
893
+ return;
894
+ } else if (arg === "unmounted" || arg === "vue:unmounted") {
895
+ return () => handler();
896
+ }
897
+ if (modifiers) {
898
+ if (arg === "click") {
899
+ if (modifiers.right) arg = "contextmenu";
900
+ if (modifiers.middle) arg = "mouseup";
901
+ }
902
+ let invoke = handler;
903
+ for (const key in modifiers) {
904
+ let m = /^debounce(?:-(\d+))?$/.exec(key);
905
+ if (m) {
906
+ const fn = invoke;
907
+ const ms = m[1] ? +m[1] : 250;
908
+ let t;
909
+ invoke = (e) => {
910
+ clearTimeout(t);
911
+ t = setTimeout(fn, ms, e);
912
+ };
913
+ continue;
914
+ }
915
+ m = /^throttle(?:-(\d+))?$/.exec(key);
916
+ if (m) {
917
+ const fn = invoke;
918
+ const ms = m[1] ? +m[1] : 250;
919
+ let last = 0;
920
+ invoke = (e) => {
921
+ const now = Date.now();
922
+ if (now - last >= ms) {
923
+ last = now;
924
+ fn(e);
925
+ }
926
+ };
927
+ }
928
+ }
929
+ const keyFilter = Object.keys(modifiers).filter(
930
+ (k) => !nonKeyModifierRE.test(k)
931
+ );
932
+ handler = (e) => {
933
+ if (modifiers.outside && el.contains(e.target)) {
934
+ return;
935
+ }
936
+ if ("key" in e && keyFilter.length && !(hyphenate(e.key) in modifiers)) {
937
+ return;
938
+ }
939
+ for (const key in modifiers) {
940
+ const guard = modifierGuards[key];
941
+ if (guard && guard(e, modifiers)) {
942
+ return;
943
+ }
944
+ if (key.startsWith("prop-") && "propertyName" in e && e.propertyName !== key.slice(5)) {
945
+ return;
946
+ }
947
+ if (key.startsWith("name-") && "animationName" in e && e.animationName !== key.slice(5)) {
948
+ return;
949
+ }
950
+ }
951
+ return invoke(e);
952
+ };
953
+ }
954
+ const target = modifiers?.window ? window : modifiers?.document || modifiers?.outside ? document : el;
955
+ const event = arg;
956
+ target.addEventListener(event, handler, modifiers);
957
+ if (target !== el) {
958
+ return () => target.removeEventListener(event, handler, modifiers);
959
+ }
960
+ };
961
+
962
+ const show = ({ el, get, effect }) => {
963
+ const initialDisplay = el.style.display;
964
+ effect(() => {
965
+ el.style.display = get() ? initialDisplay : "none";
966
+ });
967
+ };
968
+
969
+ const text = ({ el, get, effect }) => {
970
+ effect(() => {
971
+ el.textContent = toDisplayString(get());
972
+ });
973
+ };
974
+ const toDisplayString = (value) => value == null ? "" : isObject(value) ? JSON.stringify(value, null, 2) : String(value);
975
+
976
+ const html = ({ el, get, effect }) => {
977
+ effect(() => {
978
+ el.innerHTML = get();
979
+ });
980
+ };
981
+
982
+ const checkAttr = (el, name) => {
983
+ const val = el.getAttribute(name);
984
+ if (val != null) el.removeAttribute(name);
985
+ return val;
986
+ };
987
+ const listen = (el, event, handler, options) => {
988
+ el.addEventListener(event, handler, options);
989
+ };
990
+
991
+ const model = ({ el, exp, get, effect, modifiers }) => {
992
+ const type = el.type;
993
+ const assign = get(`(val) => { ${exp} = val }`);
994
+ const { trim, number = type === "number", lazy, fill } = modifiers || {};
995
+ if (el.tagName === "SELECT") {
996
+ const sel = el;
997
+ listen(el, "change", () => {
998
+ const selectedVal = Array.prototype.filter.call(sel.options, (o) => o.selected).map(
999
+ (o) => number ? toNumber(getValue(o)) : getValue(o)
1000
+ );
1001
+ assign(sel.multiple ? selectedVal : selectedVal[0]);
1002
+ });
1003
+ effect(() => {
1004
+ const value = get();
1005
+ const isMultiple = sel.multiple;
1006
+ for (let i = 0, l = sel.options.length; i < l; i++) {
1007
+ const option = sel.options[i];
1008
+ const optionValue = getValue(option);
1009
+ if (isMultiple) {
1010
+ if (isArray(value)) {
1011
+ option.selected = looseIndexOf(value, optionValue) > -1;
1012
+ } else {
1013
+ option.selected = value.has(optionValue);
1014
+ }
1015
+ } else {
1016
+ if (looseEqual(getValue(option), value)) {
1017
+ if (sel.selectedIndex !== i) sel.selectedIndex = i;
1018
+ return;
1019
+ }
1020
+ }
1021
+ }
1022
+ if (!isMultiple && sel.selectedIndex !== -1) {
1023
+ sel.selectedIndex = -1;
1024
+ }
1025
+ });
1026
+ } else if (type === "checkbox") {
1027
+ listen(el, "change", () => {
1028
+ const modelValue = get();
1029
+ const checked = el.checked;
1030
+ if (isArray(modelValue)) {
1031
+ const elementValue = getValue(el);
1032
+ const index = looseIndexOf(modelValue, elementValue);
1033
+ const found = index !== -1;
1034
+ if (checked && !found) {
1035
+ assign(modelValue.concat(elementValue));
1036
+ } else if (!checked && found) {
1037
+ const filtered = [...modelValue];
1038
+ filtered.splice(index, 1);
1039
+ assign(filtered);
1040
+ }
1041
+ } else {
1042
+ assign(getCheckboxValue(el, checked));
1043
+ }
1044
+ });
1045
+ let oldValue;
1046
+ effect(() => {
1047
+ const value = get();
1048
+ if (isArray(value)) {
1049
+ el.checked = looseIndexOf(value, getValue(el)) > -1;
1050
+ } else if (value !== oldValue) {
1051
+ el.checked = looseEqual(
1052
+ value,
1053
+ getCheckboxValue(el, true)
1054
+ );
1055
+ }
1056
+ oldValue = value;
1057
+ });
1058
+ } else if (type === "radio") {
1059
+ listen(el, "change", () => {
1060
+ assign(getValue(el));
1061
+ });
1062
+ let oldValue;
1063
+ effect(() => {
1064
+ const value = get();
1065
+ if (value !== oldValue) {
1066
+ el.checked = looseEqual(value, getValue(el));
1067
+ }
1068
+ });
1069
+ } else {
1070
+ const resolveValue = (val) => {
1071
+ if (trim) return val.trim();
1072
+ if (number) return toNumber(val);
1073
+ return val;
1074
+ };
1075
+ let write = assign;
1076
+ for (const key in modifiers || {}) {
1077
+ const m = /^debounce(?:-(\d+))?$/.exec(key);
1078
+ if (m) {
1079
+ const ms = m[1] ? +m[1] : 250;
1080
+ let t;
1081
+ write = (val) => {
1082
+ clearTimeout(t);
1083
+ t = setTimeout(assign, ms, val);
1084
+ };
1085
+ }
1086
+ }
1087
+ listen(el, "compositionstart", onCompositionStart);
1088
+ listen(el, "compositionend", onCompositionEnd);
1089
+ listen(el, lazy ? "change" : "input", () => {
1090
+ if (el.composing) return;
1091
+ write(resolveValue(el.value));
1092
+ });
1093
+ if (trim) {
1094
+ listen(el, "change", () => {
1095
+ el.value = el.value.trim();
1096
+ });
1097
+ }
1098
+ if (fill) {
1099
+ const cur = get();
1100
+ if ((cur == null || cur === "") && el.value) {
1101
+ assign(resolveValue(el.value));
1102
+ }
1103
+ }
1104
+ effect(() => {
1105
+ if (el.composing) {
1106
+ return;
1107
+ }
1108
+ const curVal = el.value;
1109
+ const newVal = get();
1110
+ if (document.activeElement === el && resolveValue(curVal) === newVal) {
1111
+ return;
1112
+ }
1113
+ if (curVal !== newVal) {
1114
+ el.value = newVal;
1115
+ }
1116
+ });
1117
+ }
1118
+ };
1119
+ const getValue = (el) => "_value" in el ? el._value : el.value;
1120
+ const getCheckboxValue = (el, checked) => {
1121
+ const key = checked ? "_trueValue" : "_falseValue";
1122
+ return key in el ? el[key] : checked;
1123
+ };
1124
+ const onCompositionStart = (e) => {
1125
+ e.target.composing = true;
1126
+ };
1127
+ const onCompositionEnd = (e) => {
1128
+ const target = e.target;
1129
+ if (target.composing) {
1130
+ target.composing = false;
1131
+ trigger(target, "input");
1132
+ }
1133
+ };
1134
+ const trigger = (el, type) => {
1135
+ const e = document.createEvent("HTMLEvents");
1136
+ e.initEvent(type, true, true);
1137
+ el.dispatchEvent(e);
1138
+ };
1139
+
1140
+ const evalCache = /* @__PURE__ */ Object.create(null);
1141
+ const mkDispatch = (el) => (event, detail) => el.dispatchEvent(new CustomEvent(event, { detail, bubbles: true }));
1142
+ const evaluate = (scope, exp, el) => execute(scope, `return(${exp})`, el);
1143
+ const execute = (scope, exp, el) => {
1144
+ const fn = evalCache[exp] || (evalCache[exp] = toFunction(exp));
1145
+ try {
1146
+ return fn(scope, el, el && mkDispatch(el));
1147
+ } catch (e) {
1148
+ console.error(e);
1149
+ }
1150
+ };
1151
+ const toFunction = (exp) => {
1152
+ try {
1153
+ return new Function(`$data`, `$el`, `$dispatch`, `with($data){${exp}}`);
1154
+ } catch (e) {
1155
+ console.error(`${e.message} in expression: ${exp}`);
1156
+ return () => {
1157
+ };
1158
+ }
1159
+ };
1160
+
1161
+ const effect = ({ el, ctx, exp, effect: effect2 }) => {
1162
+ nextTick(() => effect2(() => execute(ctx.scope, exp, el)));
1163
+ };
1164
+
1165
+ const builtInDirectives = {
1166
+ bind,
1167
+ on,
1168
+ show,
1169
+ text,
1170
+ html,
1171
+ model,
1172
+ effect
1173
+ };
1174
+
1175
+ const _if = (el, exp, ctx) => {
1176
+ const parent = el.parentElement;
1177
+ const anchor = new Comment("v-if");
1178
+ parent.insertBefore(anchor, el);
1179
+ const branches = [
1180
+ {
1181
+ exp,
1182
+ el
1183
+ }
1184
+ ];
1185
+ let elseEl;
1186
+ let elseExp;
1187
+ while (elseEl = el.nextElementSibling) {
1188
+ elseExp = null;
1189
+ if (checkAttr(elseEl, "v-else") === "" || (elseExp = checkAttr(elseEl, "v-else-if"))) {
1190
+ parent.removeChild(elseEl);
1191
+ branches.push({ exp: elseExp, el: elseEl });
1192
+ } else {
1193
+ break;
1194
+ }
1195
+ }
1196
+ const nextNode = el.nextSibling;
1197
+ parent.removeChild(el);
1198
+ let block;
1199
+ let activeBranchIndex = -1;
1200
+ const removeActiveBlock = () => {
1201
+ if (block) {
1202
+ if (block.el.parentNode === parent) {
1203
+ parent.insertBefore(anchor, block.el);
1204
+ }
1205
+ block.remove();
1206
+ block = void 0;
1207
+ }
1208
+ };
1209
+ ctx.effect(() => {
1210
+ for (let i = 0; i < branches.length; i++) {
1211
+ const { exp: exp2, el: el2 } = branches[i];
1212
+ if (!exp2 || evaluate(ctx.scope, exp2)) {
1213
+ if (i !== activeBranchIndex) {
1214
+ removeActiveBlock();
1215
+ block = new Block(el2, ctx);
1216
+ block.insert(parent, anchor);
1217
+ if (block.el.parentNode === parent) {
1218
+ parent.removeChild(anchor);
1219
+ }
1220
+ activeBranchIndex = i;
1221
+ }
1222
+ return;
1223
+ }
1224
+ }
1225
+ activeBranchIndex = -1;
1226
+ removeActiveBlock();
1227
+ });
1228
+ return nextNode;
1229
+ };
1230
+
1231
+ const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
1232
+ const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
1233
+ const stripParensRE = /^\(|\)$/g;
1234
+ const destructureRE = /^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/;
1235
+ const _for = (el, exp, ctx) => {
1236
+ const inMatch = exp.match(forAliasRE);
1237
+ if (!inMatch) {
1238
+ return;
1239
+ }
1240
+ const nextNode = el.nextSibling;
1241
+ const parent = el.parentElement;
1242
+ const anchor = new Text("");
1243
+ parent.insertBefore(anchor, el);
1244
+ parent.removeChild(el);
1245
+ const sourceExp = inMatch[2].trim();
1246
+ let valueExp = inMatch[1].trim().replace(stripParensRE, "").trim();
1247
+ let destructureBindings;
1248
+ let isArrayDestructure = false;
1249
+ let indexExp;
1250
+ let objIndexExp;
1251
+ let keyAttr = "key";
1252
+ let keyExp = el.getAttribute(keyAttr) || el.getAttribute(keyAttr = ":key") || el.getAttribute(keyAttr = "v-bind:key");
1253
+ if (keyExp) {
1254
+ el.removeAttribute(keyAttr);
1255
+ if (keyAttr === "key") keyExp = JSON.stringify(keyExp);
1256
+ }
1257
+ let match;
1258
+ if (match = valueExp.match(forIteratorRE)) {
1259
+ valueExp = valueExp.replace(forIteratorRE, "").trim();
1260
+ indexExp = match[1].trim();
1261
+ if (match[2]) {
1262
+ objIndexExp = match[2].trim();
1263
+ }
1264
+ }
1265
+ if (match = valueExp.match(destructureRE)) {
1266
+ destructureBindings = match[1].split(",").map((s) => s.trim());
1267
+ isArrayDestructure = valueExp[0] === "[";
1268
+ }
1269
+ let mounted = false;
1270
+ let blocks;
1271
+ let childCtxs;
1272
+ let keyToIndexMap;
1273
+ const createChildContexts = (source) => {
1274
+ const map = /* @__PURE__ */ new Map();
1275
+ const ctxs = [];
1276
+ if (isArray(source)) {
1277
+ for (let i = 0; i < source.length; i++) {
1278
+ ctxs.push(createChildContext(map, source[i], i));
1279
+ }
1280
+ } else if (typeof source === "number") {
1281
+ for (let i = 0; i < source; i++) {
1282
+ ctxs.push(createChildContext(map, i + 1, i));
1283
+ }
1284
+ } else if (isObject(source)) {
1285
+ let i = 0;
1286
+ for (const key in source) {
1287
+ ctxs.push(createChildContext(map, source[key], i++, key));
1288
+ }
1289
+ }
1290
+ return [ctxs, map];
1291
+ };
1292
+ const createChildContext = (map, value, index, objKey) => {
1293
+ const data = {};
1294
+ if (destructureBindings) {
1295
+ destructureBindings.forEach(
1296
+ (b, i) => data[b] = value[isArrayDestructure ? i : b]
1297
+ );
1298
+ } else {
1299
+ data[valueExp] = value;
1300
+ }
1301
+ if (objKey) {
1302
+ indexExp && (data[indexExp] = objKey);
1303
+ objIndexExp && (data[objIndexExp] = index);
1304
+ } else {
1305
+ indexExp && (data[indexExp] = index);
1306
+ }
1307
+ const childCtx = createScopedContext(ctx, data);
1308
+ const key = keyExp ? evaluate(childCtx.scope, keyExp) : index;
1309
+ map.set(key, index);
1310
+ childCtx.key = key;
1311
+ return childCtx;
1312
+ };
1313
+ const mountBlock = (ctx2, ref) => {
1314
+ const block = new Block(el, ctx2);
1315
+ block.key = ctx2.key;
1316
+ block.insert(parent, ref);
1317
+ return block;
1318
+ };
1319
+ ctx.effect(() => {
1320
+ const source = evaluate(ctx.scope, sourceExp);
1321
+ const prevKeyToIndexMap = keyToIndexMap;
1322
+ [childCtxs, keyToIndexMap] = createChildContexts(source);
1323
+ if (!mounted) {
1324
+ blocks = childCtxs.map((s) => mountBlock(s, anchor));
1325
+ mounted = true;
1326
+ } else {
1327
+ for (let i2 = 0; i2 < blocks.length; i2++) {
1328
+ if (!keyToIndexMap.has(blocks[i2].key)) {
1329
+ blocks[i2].remove();
1330
+ }
1331
+ }
1332
+ const nextBlocks = [];
1333
+ let i = childCtxs.length;
1334
+ let nextBlock;
1335
+ let prevMovedBlock;
1336
+ while (i--) {
1337
+ const childCtx = childCtxs[i];
1338
+ const oldIndex = prevKeyToIndexMap.get(childCtx.key);
1339
+ let block;
1340
+ if (oldIndex == null) {
1341
+ block = mountBlock(childCtx, nextBlock ? nextBlock.el : anchor);
1342
+ } else {
1343
+ block = blocks[oldIndex];
1344
+ Object.assign(block.ctx.scope, childCtx.scope);
1345
+ if (oldIndex !== i) {
1346
+ if (blocks[oldIndex + 1] !== nextBlock || // If the next has moved, it must move too
1347
+ prevMovedBlock === nextBlock) {
1348
+ prevMovedBlock = block;
1349
+ block.insert(parent, nextBlock ? nextBlock.el : anchor);
1350
+ }
1351
+ }
1352
+ }
1353
+ nextBlocks.unshift(nextBlock = block);
1354
+ }
1355
+ blocks = nextBlocks;
1356
+ }
1357
+ });
1358
+ return nextNode;
1359
+ };
1360
+
1361
+ const ref = ({
1362
+ el,
1363
+ ctx: {
1364
+ scope: { $refs }
1365
+ },
1366
+ get,
1367
+ effect
1368
+ }) => {
1369
+ let prevRef;
1370
+ effect(() => {
1371
+ const ref2 = get();
1372
+ $refs[ref2] = el;
1373
+ if (prevRef && ref2 !== prevRef) {
1374
+ delete $refs[prevRef];
1375
+ }
1376
+ prevRef = ref2;
1377
+ });
1378
+ return () => {
1379
+ prevRef && delete $refs[prevRef];
1380
+ };
1381
+ };
1382
+
1383
+ const dirRE = /^(?:v-|:|@)/;
1384
+ const modifierRE = /\.([\w-]+)/g;
1385
+ let inOnce = false;
1386
+ const walk = (node, ctx) => {
1387
+ const type = node.nodeType;
1388
+ if (type === 1) {
1389
+ const el = node;
1390
+ if (el.hasAttribute("v-pre")) {
1391
+ return;
1392
+ }
1393
+ checkAttr(el, "v-cloak");
1394
+ let exp;
1395
+ if (exp = checkAttr(el, "v-if")) {
1396
+ return _if(el, exp, ctx);
1397
+ }
1398
+ if (exp = checkAttr(el, "v-for")) {
1399
+ return _for(el, exp, ctx);
1400
+ }
1401
+ const name = checkAttr(el, "v-name");
1402
+ let teleportNext;
1403
+ if (exp = checkAttr(el, "v-teleport")) {
1404
+ const target = document.querySelector(exp);
1405
+ if (target) {
1406
+ teleportNext = el.nextSibling;
1407
+ el.__teleported = true;
1408
+ target.appendChild(el);
1409
+ ctx.cleanups.push(() => el.remove());
1410
+ }
1411
+ }
1412
+ if ((exp = checkAttr(el, "v-scope")) || exp === "") {
1413
+ const scope = exp ? evaluate(ctx.scope, exp) : {};
1414
+ ctx = createScopedContext(ctx, scope);
1415
+ ctx.cleanups.push(
1416
+ registerScope(el, ctx.scope, exp || void 0, name || void 0)
1417
+ );
1418
+ if (scope.$template) {
1419
+ resolveTemplate(el, scope.$template);
1420
+ }
1421
+ }
1422
+ const hasVOnce = checkAttr(el, "v-once") != null;
1423
+ if (hasVOnce) {
1424
+ inOnce = true;
1425
+ }
1426
+ if (exp = checkAttr(el, "ref")) {
1427
+ applyDirective(el, ref, `"${exp}"`, ctx);
1428
+ }
1429
+ walkChildren(el, ctx);
1430
+ const deferred = [];
1431
+ for (const { name: name2, value } of [...el.attributes]) {
1432
+ if (dirRE.test(name2) && name2 !== "v-cloak") {
1433
+ if (name2 === "v-model") {
1434
+ deferred.unshift([name2, value]);
1435
+ } else if (name2[0] === "@" || /^v-on\b/.test(name2)) {
1436
+ deferred.push([name2, value]);
1437
+ } else {
1438
+ processDirective(el, name2, value, ctx);
1439
+ }
1440
+ }
1441
+ }
1442
+ for (const [name2, value] of deferred) {
1443
+ processDirective(el, name2, value, ctx);
1444
+ }
1445
+ if (hasVOnce) {
1446
+ inOnce = false;
1447
+ }
1448
+ return teleportNext;
1449
+ } else if (type === 3) {
1450
+ const data = node.data;
1451
+ if (data.includes(ctx.delimiters[0])) {
1452
+ let segments = [];
1453
+ let lastIndex = 0;
1454
+ let match;
1455
+ while (match = ctx.delimitersRE.exec(data)) {
1456
+ const leading = data.slice(lastIndex, match.index);
1457
+ if (leading) segments.push(JSON.stringify(leading));
1458
+ segments.push(`$s(${match[1]})`);
1459
+ lastIndex = match.index + match[0].length;
1460
+ }
1461
+ if (lastIndex < data.length) {
1462
+ segments.push(JSON.stringify(data.slice(lastIndex)));
1463
+ }
1464
+ applyDirective(node, text, segments.join("+"), ctx);
1465
+ }
1466
+ } else if (type === 11) {
1467
+ walkChildren(node, ctx);
1468
+ }
1469
+ };
1470
+ const walkChildren = (node, ctx) => {
1471
+ let child = node.firstChild;
1472
+ while (child) {
1473
+ child = walk(child, ctx) || child.nextSibling;
1474
+ }
1475
+ };
1476
+ const processDirective = (el, raw, exp, ctx) => {
1477
+ let dir;
1478
+ let arg;
1479
+ let modifiers;
1480
+ raw = raw.replace(modifierRE, (_, m) => {
1481
+ (modifiers || (modifiers = {}))[m] = true;
1482
+ return "";
1483
+ });
1484
+ if (raw[0] === ":") {
1485
+ dir = bind;
1486
+ arg = raw.slice(1);
1487
+ } else if (raw[0] === "@") {
1488
+ dir = on;
1489
+ arg = raw.slice(1);
1490
+ } else {
1491
+ const argIndex = raw.indexOf(":");
1492
+ const dirName = argIndex > 0 ? raw.slice(2, argIndex) : raw.slice(2);
1493
+ dir = builtInDirectives[dirName] || ctx.dirs[dirName];
1494
+ arg = argIndex > 0 ? raw.slice(argIndex + 1) : void 0;
1495
+ }
1496
+ if (dir) {
1497
+ if (dir === bind && arg === "ref") dir = ref;
1498
+ applyDirective(el, dir, exp, ctx, arg, modifiers);
1499
+ el.removeAttribute(raw);
1500
+ }
1501
+ };
1502
+ const applyDirective = (el, dir, exp, ctx, arg, modifiers) => {
1503
+ const get = (e = exp) => evaluate(ctx.scope, e, el);
1504
+ const cleanup = dir({
1505
+ el,
1506
+ get,
1507
+ effect: ctx.effect,
1508
+ ctx,
1509
+ exp,
1510
+ arg,
1511
+ modifiers
1512
+ });
1513
+ if (cleanup) {
1514
+ ctx.cleanups.push(cleanup);
1515
+ }
1516
+ };
1517
+ const resolveTemplate = (el, template) => {
1518
+ if (template[0] === "#") {
1519
+ const templateEl = document.querySelector(template);
1520
+ el.appendChild(templateEl.content.cloneNode(true));
1521
+ return;
1522
+ }
1523
+ el.innerHTML = template;
1524
+ };
1525
+
1526
+ const createContext = (parent) => {
1527
+ const ctx = {
1528
+ delimiters: ["{{", "}}"],
1529
+ delimitersRE: /\{\{([^]+?)\}\}/g,
1530
+ ...parent,
1531
+ scope: parent ? parent.scope : reactive({}),
1532
+ dirs: parent ? parent.dirs : {},
1533
+ effects: [],
1534
+ blocks: [],
1535
+ cleanups: [],
1536
+ effect: (fn) => {
1537
+ if (inOnce) {
1538
+ queueJob(fn);
1539
+ return fn;
1540
+ }
1541
+ const e = effect$1(fn, {
1542
+ scheduler: () => queueJob(e)
1543
+ });
1544
+ ctx.effects.push(e);
1545
+ return e;
1546
+ }
1547
+ };
1548
+ return ctx;
1549
+ };
1550
+ const createScopedContext = (ctx, data = {}) => {
1551
+ const parentScope = ctx.scope;
1552
+ const mergedScope = Object.create(parentScope);
1553
+ Object.defineProperties(mergedScope, Object.getOwnPropertyDescriptors(data));
1554
+ mergedScope.$refs = Object.create(parentScope.$refs);
1555
+ const reactiveProxy = reactive(
1556
+ new Proxy(mergedScope, {
1557
+ set(target, key, val, receiver) {
1558
+ if (receiver === reactiveProxy && !hasOwn(target, key)) {
1559
+ return Reflect.set(parentScope, key, val);
1560
+ }
1561
+ return Reflect.set(target, key, val, receiver);
1562
+ }
1563
+ })
1564
+ );
1565
+ const scopedCtx = {
1566
+ ...ctx,
1567
+ scope: reactiveProxy
1568
+ };
1569
+ mergedScope.$watch = createWatch(scopedCtx);
1570
+ mergedScope.$id = createId();
1571
+ bindContextMethods(reactiveProxy);
1572
+ return scopedCtx;
1573
+ };
1574
+ const bindContextMethods = (scope) => {
1575
+ for (const key of Object.keys(scope)) {
1576
+ if (typeof scope[key] === "function") {
1577
+ scope[key] = scope[key].bind(scope);
1578
+ }
1579
+ }
1580
+ };
1581
+
1582
+ class Block {
1583
+ template;
1584
+ ctx;
1585
+ key;
1586
+ parentCtx;
1587
+ isFragment;
1588
+ start;
1589
+ end;
1590
+ get el() {
1591
+ return this.start || this.template;
1592
+ }
1593
+ constructor(template, parentCtx, isRoot = false) {
1594
+ this.isFragment = template instanceof HTMLTemplateElement;
1595
+ if (isRoot) {
1596
+ this.template = template;
1597
+ } else if (this.isFragment) {
1598
+ this.template = template.content.cloneNode(
1599
+ true
1600
+ );
1601
+ } else {
1602
+ this.template = template.cloneNode(true);
1603
+ }
1604
+ if (isRoot) {
1605
+ this.ctx = parentCtx;
1606
+ } else {
1607
+ this.parentCtx = parentCtx;
1608
+ parentCtx.blocks.push(this);
1609
+ this.ctx = createContext(parentCtx);
1610
+ }
1611
+ walk(this.template, this.ctx);
1612
+ }
1613
+ insert(parent, anchor = null) {
1614
+ if (this.isFragment) {
1615
+ if (this.start) {
1616
+ let node = this.start;
1617
+ let next;
1618
+ while (node) {
1619
+ next = node.nextSibling;
1620
+ parent.insertBefore(node, anchor);
1621
+ if (node === this.end) break;
1622
+ node = next;
1623
+ }
1624
+ } else {
1625
+ this.start = new Text("");
1626
+ this.end = new Text("");
1627
+ parent.insertBefore(this.end, anchor);
1628
+ parent.insertBefore(this.start, this.end);
1629
+ parent.insertBefore(this.template, this.end);
1630
+ }
1631
+ } else if (!this.template.__teleported) {
1632
+ parent.insertBefore(this.template, anchor);
1633
+ }
1634
+ }
1635
+ remove() {
1636
+ if (this.parentCtx) {
1637
+ remove(this.parentCtx.blocks, this);
1638
+ }
1639
+ const removeNow = () => {
1640
+ if (this.start) {
1641
+ const parent = this.start.parentNode;
1642
+ let node = this.start;
1643
+ let next;
1644
+ while (node) {
1645
+ next = node.nextSibling;
1646
+ parent.removeChild(node);
1647
+ if (node === this.end) break;
1648
+ node = next;
1649
+ }
1650
+ } else {
1651
+ this.template.parentNode.removeChild(this.template);
1652
+ }
1653
+ this.teardown();
1654
+ };
1655
+ const leave = this.isFragment ? void 0 : this.template.__leave;
1656
+ if (leave) {
1657
+ leave().then(removeNow);
1658
+ } else {
1659
+ removeNow();
1660
+ }
1661
+ }
1662
+ teardown() {
1663
+ this.ctx.blocks.forEach((child) => {
1664
+ child.teardown();
1665
+ });
1666
+ this.ctx.effects.forEach(stop);
1667
+ this.ctx.cleanups.forEach((fn) => fn());
1668
+ }
1669
+ }
1670
+
1671
+ const stores = reactive(/* @__PURE__ */ Object.create(null));
1672
+ const store = (name, value) => {
1673
+ if (value !== void 0) {
1674
+ stores[name] = value;
1675
+ if (typeof stores[name].init === "function") {
1676
+ stores[name].init();
1677
+ }
1678
+ registerStore(name, stores[name]);
1679
+ }
1680
+ return stores[name];
1681
+ };
1682
+
1683
+ const escapeRegex = (str) => str.replace(/[-.*+?^${}()|[\]\/\\]/g, "\\$&");
1684
+ const createApp = (initialData) => {
1685
+ const ctx = createContext();
1686
+ if (typeof initialData === "function") {
1687
+ initialData = initialData();
1688
+ }
1689
+ if (initialData) {
1690
+ ctx.scope = reactive(initialData);
1691
+ bindContextMethods(ctx.scope);
1692
+ if (initialData.$delimiters) {
1693
+ const [open, close] = ctx.delimiters = initialData.$delimiters;
1694
+ ctx.delimitersRE = new RegExp(
1695
+ escapeRegex(open) + "([^]+?)" + escapeRegex(close),
1696
+ "g"
1697
+ );
1698
+ }
1699
+ }
1700
+ ctx.scope.$s = toDisplayString;
1701
+ ctx.scope.$nextTick = nextTick;
1702
+ ctx.scope.$refs = /* @__PURE__ */ Object.create(null);
1703
+ ctx.scope.$store = stores;
1704
+ ctx.scope.$watch = createWatch(ctx);
1705
+ ctx.scope.$id = createId();
1706
+ Object.defineProperty(ctx.scope, "$root", {
1707
+ value: ctx.scope,
1708
+ enumerable: false
1709
+ });
1710
+ let rootBlocks = [];
1711
+ const installedPlugins = /* @__PURE__ */ new Set();
1712
+ const app = {
1713
+ get scope() {
1714
+ return ctx.scope;
1715
+ },
1716
+ directive(name, def) {
1717
+ if (def) {
1718
+ ctx.dirs[name] = def;
1719
+ return this;
1720
+ } else {
1721
+ return ctx.dirs[name];
1722
+ }
1723
+ },
1724
+ use(plugin, options) {
1725
+ if (!installedPlugins.has(plugin)) {
1726
+ installedPlugins.add(plugin);
1727
+ (typeof plugin === "function" ? plugin : plugin.install)(app, options);
1728
+ }
1729
+ return app;
1730
+ },
1731
+ mount(el) {
1732
+ if (typeof el === "string") {
1733
+ el = document.querySelector(el);
1734
+ if (!el) {
1735
+ return;
1736
+ }
1737
+ }
1738
+ el = el || document.documentElement;
1739
+ let roots;
1740
+ if (el.hasAttribute("v-scope")) {
1741
+ roots = [el];
1742
+ } else {
1743
+ roots = [...el.querySelectorAll(`[v-scope]`)].filter(
1744
+ (root) => !root.matches(`[v-scope] [v-scope]`)
1745
+ );
1746
+ }
1747
+ if (!roots.length) {
1748
+ roots = [el];
1749
+ }
1750
+ for (const el2 of roots) {
1751
+ const name = el2.getAttribute("v-name");
1752
+ const block = new Block(el2, ctx, true);
1753
+ if (!devtools.scopes.has(el2)) {
1754
+ ctx.cleanups.push(
1755
+ registerScope(el2, ctx.scope, void 0, name || void 0)
1756
+ );
1757
+ }
1758
+ rootBlocks.push(block);
1759
+ }
1760
+ return this;
1761
+ },
1762
+ unmount() {
1763
+ rootBlocks.forEach((block) => block.teardown());
1764
+ rootBlocks = [];
1765
+ }
1766
+ };
1767
+ return app;
1768
+ };
1769
+
1770
+ const watchEffect = (fn) => {
1771
+ let runner;
1772
+ runner = effect$1(fn, { scheduler: () => queueJob(runner) });
1773
+ return () => stop(runner);
1774
+ };
1775
+
1776
+ const s = document.currentScript;
1777
+ if (s && s.hasAttribute("init")) {
1778
+ createApp().mount();
1779
+ }
1780
+
1781
+ export { createApp, devtools, disableDevtools, nextTick, reactive, store, watchEffect };