@esposter/shared 2.25.0 → 2.27.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.
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import { z } from "zod";
2
+ import { isReactive, toRaw } from "vue";
3
+ import { isObject } from "@vueuse/core";
2
4
  //#region \0rolldown/runtime.js
3
5
  var __defProp = Object.defineProperty;
4
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -110,7 +112,15 @@ var NotInitializedError = class extends Error {
110
112
  }
111
113
  };
112
114
  //#endregion
115
+ //#region src/models/message/MentionType.ts
116
+ let MentionType = /* @__PURE__ */ function(MentionType) {
117
+ MentionType["Role"] = "role";
118
+ MentionType["User"] = "user";
119
+ return MentionType;
120
+ }({});
121
+ //#endregion
113
122
  //#region src/services/app/constants.ts
123
+ const MAX_READ_LIMIT = 1e3;
114
124
  const SITE_NAME = "Esposter";
115
125
  //#endregion
116
126
  //#region src/services/survey/constants.ts
@@ -185,2082 +195,8 @@ let Operation = /* @__PURE__ */ function(Operation) {
185
195
  return Operation;
186
196
  }({});
187
197
  //#endregion
188
- //#region ../../node_modules/.pnpm/@vue+shared@3.5.34/node_modules/@vue/shared/dist/shared.esm-bundler.js
189
- /**
190
- * @vue/shared v3.5.34
191
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
192
- * @license MIT
193
- **/
194
- /* @__NO_SIDE_EFFECTS__ */
195
- function makeMap(str) {
196
- const map = /* @__PURE__ */ Object.create(null);
197
- for (const key of str.split(",")) map[key] = 1;
198
- return (val) => val in map;
199
- }
200
- const EMPTY_OBJ = Object.freeze({});
201
- Object.freeze([]);
202
- const NOOP = () => {};
203
- const extend = Object.assign;
204
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
205
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
206
- const isArray = Array.isArray;
207
- const isMap = (val) => toTypeString(val) === "[object Map]";
208
- const isSet = (val) => toTypeString(val) === "[object Set]";
209
- const isFunction = (val) => typeof val === "function";
210
- const isString = (val) => typeof val === "string";
211
- const isSymbol = (val) => typeof val === "symbol";
212
- const isObject$1 = (val) => val !== null && typeof val === "object";
213
- const isPromise = (val) => {
214
- return (isObject$1(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
215
- };
216
- const objectToString = Object.prototype.toString;
217
- const toTypeString = (value) => objectToString.call(value);
218
- const toRawType = (value) => {
219
- return toTypeString(value).slice(8, -1);
220
- };
221
- const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]";
222
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
223
- const cacheStringFunction$1 = (fn) => {
224
- const cache = /* @__PURE__ */ Object.create(null);
225
- return ((str) => {
226
- return cache[str] || (cache[str] = fn(str));
227
- });
228
- };
229
- const capitalize$1 = cacheStringFunction$1((str) => {
230
- return str.charAt(0).toUpperCase() + str.slice(1);
231
- });
232
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
233
- const def = (obj, key, value, writable = false) => {
234
- Object.defineProperty(obj, key, {
235
- configurable: true,
236
- enumerable: false,
237
- writable,
238
- value
239
- });
240
- };
241
- let _globalThis;
242
- const getGlobalThis = () => {
243
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
244
- };
245
- //#endregion
246
- //#region ../../node_modules/.pnpm/@vue+reactivity@3.5.34/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
247
- /**
248
- * @vue/reactivity v3.5.34
249
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
250
- * @license MIT
251
- **/
252
- function warn(msg, ...args) {
253
- console.warn(`[Vue warn] ${msg}`, ...args);
254
- }
255
- let activeSub;
256
- const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
257
- var ReactiveEffect = class {
258
- constructor(fn) {
259
- this.fn = fn;
260
- /**
261
- * @internal
262
- */
263
- this.deps = void 0;
264
- /**
265
- * @internal
266
- */
267
- this.depsTail = void 0;
268
- /**
269
- * @internal
270
- */
271
- this.flags = 5;
272
- /**
273
- * @internal
274
- */
275
- this.next = void 0;
276
- /**
277
- * @internal
278
- */
279
- this.cleanup = void 0;
280
- this.scheduler = void 0;
281
- }
282
- pause() {
283
- this.flags |= 64;
284
- }
285
- resume() {
286
- if (this.flags & 64) {
287
- this.flags &= -65;
288
- if (pausedQueueEffects.has(this)) {
289
- pausedQueueEffects.delete(this);
290
- this.trigger();
291
- }
292
- }
293
- }
294
- /**
295
- * @internal
296
- */
297
- notify() {
298
- if (this.flags & 2 && !(this.flags & 32)) return;
299
- if (!(this.flags & 8)) batch(this);
300
- }
301
- run() {
302
- if (!(this.flags & 1)) return this.fn();
303
- this.flags |= 2;
304
- cleanupEffect(this);
305
- prepareDeps(this);
306
- const prevEffect = activeSub;
307
- const prevShouldTrack = shouldTrack;
308
- activeSub = this;
309
- shouldTrack = true;
310
- try {
311
- return this.fn();
312
- } finally {
313
- if (activeSub !== this) warn("Active effect was not restored correctly - this is likely a Vue internal bug.");
314
- cleanupDeps(this);
315
- activeSub = prevEffect;
316
- shouldTrack = prevShouldTrack;
317
- this.flags &= -3;
318
- }
319
- }
320
- stop() {
321
- if (this.flags & 1) {
322
- for (let link = this.deps; link; link = link.nextDep) removeSub(link);
323
- this.deps = this.depsTail = void 0;
324
- cleanupEffect(this);
325
- this.onStop && this.onStop();
326
- this.flags &= -2;
327
- }
328
- }
329
- trigger() {
330
- if (this.flags & 64) pausedQueueEffects.add(this);
331
- else if (this.scheduler) this.scheduler();
332
- else this.runIfDirty();
333
- }
334
- /**
335
- * @internal
336
- */
337
- runIfDirty() {
338
- if (isDirty(this)) this.run();
339
- }
340
- get dirty() {
341
- return isDirty(this);
342
- }
343
- };
344
- let batchDepth = 0;
345
- let batchedSub;
346
- let batchedComputed;
347
- function batch(sub, isComputed = false) {
348
- sub.flags |= 8;
349
- if (isComputed) {
350
- sub.next = batchedComputed;
351
- batchedComputed = sub;
352
- return;
353
- }
354
- sub.next = batchedSub;
355
- batchedSub = sub;
356
- }
357
- function startBatch() {
358
- batchDepth++;
359
- }
360
- function endBatch() {
361
- if (--batchDepth > 0) return;
362
- if (batchedComputed) {
363
- let e = batchedComputed;
364
- batchedComputed = void 0;
365
- while (e) {
366
- const next = e.next;
367
- e.next = void 0;
368
- e.flags &= -9;
369
- e = next;
370
- }
371
- }
372
- let error;
373
- while (batchedSub) {
374
- let e = batchedSub;
375
- batchedSub = void 0;
376
- while (e) {
377
- const next = e.next;
378
- e.next = void 0;
379
- e.flags &= -9;
380
- if (e.flags & 1) try {
381
- e.trigger();
382
- } catch (err) {
383
- if (!error) error = err;
384
- }
385
- e = next;
386
- }
387
- }
388
- if (error) throw error;
389
- }
390
- function prepareDeps(sub) {
391
- for (let link = sub.deps; link; link = link.nextDep) {
392
- link.version = -1;
393
- link.prevActiveLink = link.dep.activeLink;
394
- link.dep.activeLink = link;
395
- }
396
- }
397
- function cleanupDeps(sub) {
398
- let head;
399
- let tail = sub.depsTail;
400
- let link = tail;
401
- while (link) {
402
- const prev = link.prevDep;
403
- if (link.version === -1) {
404
- if (link === tail) tail = prev;
405
- removeSub(link);
406
- removeDep(link);
407
- } else head = link;
408
- link.dep.activeLink = link.prevActiveLink;
409
- link.prevActiveLink = void 0;
410
- link = prev;
411
- }
412
- sub.deps = head;
413
- sub.depsTail = tail;
414
- }
415
- function isDirty(sub) {
416
- for (let link = sub.deps; link; link = link.nextDep) if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) return true;
417
- if (sub._dirty) return true;
418
- return false;
419
- }
420
- function refreshComputed(computed) {
421
- if (computed.flags & 4 && !(computed.flags & 16)) return;
422
- computed.flags &= -17;
423
- if (computed.globalVersion === globalVersion) return;
424
- computed.globalVersion = globalVersion;
425
- if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) return;
426
- computed.flags |= 2;
427
- const dep = computed.dep;
428
- const prevSub = activeSub;
429
- const prevShouldTrack = shouldTrack;
430
- activeSub = computed;
431
- shouldTrack = true;
432
- try {
433
- prepareDeps(computed);
434
- const value = computed.fn(computed._value);
435
- if (dep.version === 0 || hasChanged(value, computed._value)) {
436
- computed.flags |= 128;
437
- computed._value = value;
438
- dep.version++;
439
- }
440
- } catch (err) {
441
- dep.version++;
442
- throw err;
443
- } finally {
444
- activeSub = prevSub;
445
- shouldTrack = prevShouldTrack;
446
- cleanupDeps(computed);
447
- computed.flags &= -3;
448
- }
449
- }
450
- function removeSub(link, soft = false) {
451
- const { dep, prevSub, nextSub } = link;
452
- if (prevSub) {
453
- prevSub.nextSub = nextSub;
454
- link.prevSub = void 0;
455
- }
456
- if (nextSub) {
457
- nextSub.prevSub = prevSub;
458
- link.nextSub = void 0;
459
- }
460
- if (dep.subsHead === link) dep.subsHead = nextSub;
461
- if (dep.subs === link) {
462
- dep.subs = prevSub;
463
- if (!prevSub && dep.computed) {
464
- dep.computed.flags &= -5;
465
- for (let l = dep.computed.deps; l; l = l.nextDep) removeSub(l, true);
466
- }
467
- }
468
- if (!soft && !--dep.sc && dep.map) dep.map.delete(dep.key);
469
- }
470
- function removeDep(link) {
471
- const { prevDep, nextDep } = link;
472
- if (prevDep) {
473
- prevDep.nextDep = nextDep;
474
- link.prevDep = void 0;
475
- }
476
- if (nextDep) {
477
- nextDep.prevDep = prevDep;
478
- link.nextDep = void 0;
479
- }
480
- }
481
- let shouldTrack = true;
482
- const trackStack = [];
483
- function pauseTracking() {
484
- trackStack.push(shouldTrack);
485
- shouldTrack = false;
486
- }
487
- function resetTracking() {
488
- const last = trackStack.pop();
489
- shouldTrack = last === void 0 ? true : last;
490
- }
491
- function cleanupEffect(e) {
492
- const { cleanup } = e;
493
- e.cleanup = void 0;
494
- if (cleanup) {
495
- const prevSub = activeSub;
496
- activeSub = void 0;
497
- try {
498
- cleanup();
499
- } finally {
500
- activeSub = prevSub;
501
- }
502
- }
503
- }
504
- let globalVersion = 0;
505
- var Link = class {
506
- constructor(sub, dep) {
507
- this.sub = sub;
508
- this.dep = dep;
509
- this.version = dep.version;
510
- this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
511
- }
512
- };
513
- var Dep = class {
514
- constructor(computed) {
515
- this.computed = computed;
516
- this.version = 0;
517
- /**
518
- * Link between this dep and the current active effect
519
- */
520
- this.activeLink = void 0;
521
- /**
522
- * Doubly linked list representing the subscribing effects (tail)
523
- */
524
- this.subs = void 0;
525
- /**
526
- * For object property deps cleanup
527
- */
528
- this.map = void 0;
529
- this.key = void 0;
530
- /**
531
- * Subscriber counter
532
- */
533
- this.sc = 0;
534
- /**
535
- * @internal
536
- */
537
- this.__v_skip = true;
538
- this.subsHead = void 0;
539
- }
540
- track(debugInfo) {
541
- if (!activeSub || !shouldTrack || activeSub === this.computed) return;
542
- let link = this.activeLink;
543
- if (link === void 0 || link.sub !== activeSub) {
544
- link = this.activeLink = new Link(activeSub, this);
545
- if (!activeSub.deps) activeSub.deps = activeSub.depsTail = link;
546
- else {
547
- link.prevDep = activeSub.depsTail;
548
- activeSub.depsTail.nextDep = link;
549
- activeSub.depsTail = link;
550
- }
551
- addSub(link);
552
- } else if (link.version === -1) {
553
- link.version = this.version;
554
- if (link.nextDep) {
555
- const next = link.nextDep;
556
- next.prevDep = link.prevDep;
557
- if (link.prevDep) link.prevDep.nextDep = next;
558
- link.prevDep = activeSub.depsTail;
559
- link.nextDep = void 0;
560
- activeSub.depsTail.nextDep = link;
561
- activeSub.depsTail = link;
562
- if (activeSub.deps === link) activeSub.deps = next;
563
- }
564
- }
565
- if (activeSub.onTrack) activeSub.onTrack(extend({ effect: activeSub }, debugInfo));
566
- return link;
567
- }
568
- trigger(debugInfo) {
569
- this.version++;
570
- globalVersion++;
571
- this.notify(debugInfo);
572
- }
573
- notify(debugInfo) {
574
- startBatch();
575
- try {
576
- for (let head = this.subsHead; head; head = head.nextSub) if (head.sub.onTrigger && !(head.sub.flags & 8)) head.sub.onTrigger(extend({ effect: head.sub }, debugInfo));
577
- for (let link = this.subs; link; link = link.prevSub) if (link.sub.notify()) link.sub.dep.notify();
578
- } finally {
579
- endBatch();
580
- }
581
- }
582
- };
583
- function addSub(link) {
584
- link.dep.sc++;
585
- if (link.sub.flags & 4) {
586
- const computed = link.dep.computed;
587
- if (computed && !link.dep.subs) {
588
- computed.flags |= 20;
589
- for (let l = computed.deps; l; l = l.nextDep) addSub(l);
590
- }
591
- const currentTail = link.dep.subs;
592
- if (currentTail !== link) {
593
- link.prevSub = currentTail;
594
- if (currentTail) currentTail.nextSub = link;
595
- }
596
- if (link.dep.subsHead === void 0) link.dep.subsHead = link;
597
- link.dep.subs = link;
598
- }
599
- }
600
- const targetMap = /* @__PURE__ */ new WeakMap();
601
- const ITERATE_KEY = /* @__PURE__ */ Symbol("Object iterate");
602
- const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol("Map keys iterate");
603
- const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol("Array iterate");
604
- function track(target, type, key) {
605
- if (shouldTrack && activeSub) {
606
- let depsMap = targetMap.get(target);
607
- if (!depsMap) targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
608
- let dep = depsMap.get(key);
609
- if (!dep) {
610
- depsMap.set(key, dep = new Dep());
611
- dep.map = depsMap;
612
- dep.key = key;
613
- }
614
- dep.track({
615
- target,
616
- type,
617
- key
618
- });
619
- }
620
- }
621
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
622
- const depsMap = targetMap.get(target);
623
- if (!depsMap) {
624
- globalVersion++;
625
- return;
626
- }
627
- const run = (dep) => {
628
- if (dep) dep.trigger({
629
- target,
630
- type,
631
- key,
632
- newValue,
633
- oldValue,
634
- oldTarget
635
- });
636
- };
637
- startBatch();
638
- if (type === "clear") depsMap.forEach(run);
639
- else {
640
- const targetIsArray = isArray(target);
641
- const isArrayIndex = targetIsArray && isIntegerKey(key);
642
- if (targetIsArray && key === "length") {
643
- const newLength = Number(newValue);
644
- depsMap.forEach((dep, key2) => {
645
- if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) run(dep);
646
- });
647
- } else {
648
- if (key !== void 0 || depsMap.has(void 0)) run(depsMap.get(key));
649
- if (isArrayIndex) run(depsMap.get(ARRAY_ITERATE_KEY));
650
- switch (type) {
651
- case "add":
652
- if (!targetIsArray) {
653
- run(depsMap.get(ITERATE_KEY));
654
- if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
655
- } else if (isArrayIndex) run(depsMap.get("length"));
656
- break;
657
- case "delete":
658
- if (!targetIsArray) {
659
- run(depsMap.get(ITERATE_KEY));
660
- if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
661
- }
662
- break;
663
- case "set":
664
- if (isMap(target)) run(depsMap.get(ITERATE_KEY));
665
- break;
666
- }
667
- }
668
- }
669
- endBatch();
670
- }
671
- function reactiveReadArray(array) {
672
- const raw = /* @__PURE__ */ toRaw(array);
673
- if (raw === array) return raw;
674
- track(raw, "iterate", ARRAY_ITERATE_KEY);
675
- return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
676
- }
677
- function shallowReadArray(arr) {
678
- track(arr = /* @__PURE__ */ toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
679
- return arr;
680
- }
681
- function toWrapped(target, item) {
682
- if (/* @__PURE__ */ isReadonly(target)) return /* @__PURE__ */ isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
683
- return toReactive(item);
684
- }
685
- const arrayInstrumentations = {
686
- __proto__: null,
687
- [Symbol.iterator]() {
688
- return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
689
- },
690
- concat(...args) {
691
- return reactiveReadArray(this).concat(...args.map((x) => isArray(x) ? reactiveReadArray(x) : x));
692
- },
693
- entries() {
694
- return iterator(this, "entries", (value) => {
695
- value[1] = toWrapped(this, value[1]);
696
- return value;
697
- });
698
- },
699
- every(fn, thisArg) {
700
- return apply(this, "every", fn, thisArg, void 0, arguments);
701
- },
702
- filter(fn, thisArg) {
703
- return apply(this, "filter", fn, thisArg, (v) => v.map((item) => toWrapped(this, item)), arguments);
704
- },
705
- find(fn, thisArg) {
706
- return apply(this, "find", fn, thisArg, (item) => toWrapped(this, item), arguments);
707
- },
708
- findIndex(fn, thisArg) {
709
- return apply(this, "findIndex", fn, thisArg, void 0, arguments);
710
- },
711
- findLast(fn, thisArg) {
712
- return apply(this, "findLast", fn, thisArg, (item) => toWrapped(this, item), arguments);
713
- },
714
- findLastIndex(fn, thisArg) {
715
- return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
716
- },
717
- forEach(fn, thisArg) {
718
- return apply(this, "forEach", fn, thisArg, void 0, arguments);
719
- },
720
- includes(...args) {
721
- return searchProxy(this, "includes", args);
722
- },
723
- indexOf(...args) {
724
- return searchProxy(this, "indexOf", args);
725
- },
726
- join(separator) {
727
- return reactiveReadArray(this).join(separator);
728
- },
729
- lastIndexOf(...args) {
730
- return searchProxy(this, "lastIndexOf", args);
731
- },
732
- map(fn, thisArg) {
733
- return apply(this, "map", fn, thisArg, void 0, arguments);
734
- },
735
- pop() {
736
- return noTracking(this, "pop");
737
- },
738
- push(...args) {
739
- return noTracking(this, "push", args);
740
- },
741
- reduce(fn, ...args) {
742
- return reduce(this, "reduce", fn, args);
743
- },
744
- reduceRight(fn, ...args) {
745
- return reduce(this, "reduceRight", fn, args);
746
- },
747
- shift() {
748
- return noTracking(this, "shift");
749
- },
750
- some(fn, thisArg) {
751
- return apply(this, "some", fn, thisArg, void 0, arguments);
752
- },
753
- splice(...args) {
754
- return noTracking(this, "splice", args);
755
- },
756
- toReversed() {
757
- return reactiveReadArray(this).toReversed();
758
- },
759
- toSorted(comparer) {
760
- return reactiveReadArray(this).toSorted(comparer);
761
- },
762
- toSpliced(...args) {
763
- return reactiveReadArray(this).toSpliced(...args);
764
- },
765
- unshift(...args) {
766
- return noTracking(this, "unshift", args);
767
- },
768
- values() {
769
- return iterator(this, "values", (item) => toWrapped(this, item));
770
- }
771
- };
772
- function iterator(self, method, wrapValue) {
773
- const arr = shallowReadArray(self);
774
- const iter = arr[method]();
775
- if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
776
- iter._next = iter.next;
777
- iter.next = () => {
778
- const result = iter._next();
779
- if (!result.done) result.value = wrapValue(result.value);
780
- return result;
781
- };
782
- }
783
- return iter;
784
- }
785
- const arrayProto = Array.prototype;
786
- function apply(self, method, fn, thisArg, wrappedRetFn, args) {
787
- const arr = shallowReadArray(self);
788
- const needsWrap = arr !== self && !/* @__PURE__ */ isShallow(self);
789
- const methodFn = arr[method];
790
- if (methodFn !== arrayProto[method]) {
791
- const result2 = methodFn.apply(self, args);
792
- return needsWrap ? toReactive(result2) : result2;
793
- }
794
- let wrappedFn = fn;
795
- if (arr !== self) {
796
- if (needsWrap) wrappedFn = function(item, index) {
797
- return fn.call(this, toWrapped(self, item), index, self);
798
- };
799
- else if (fn.length > 2) wrappedFn = function(item, index) {
800
- return fn.call(this, item, index, self);
801
- };
802
- }
803
- const result = methodFn.call(arr, wrappedFn, thisArg);
804
- return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
805
- }
806
- function reduce(self, method, fn, args) {
807
- const arr = shallowReadArray(self);
808
- const needsWrap = arr !== self && !/* @__PURE__ */ isShallow(self);
809
- let wrappedFn = fn;
810
- let wrapInitialAccumulator = false;
811
- if (arr !== self) {
812
- if (needsWrap) {
813
- wrapInitialAccumulator = args.length === 0;
814
- wrappedFn = function(acc, item, index) {
815
- if (wrapInitialAccumulator) {
816
- wrapInitialAccumulator = false;
817
- acc = toWrapped(self, acc);
818
- }
819
- return fn.call(this, acc, toWrapped(self, item), index, self);
820
- };
821
- } else if (fn.length > 3) wrappedFn = function(acc, item, index) {
822
- return fn.call(this, acc, item, index, self);
823
- };
824
- }
825
- const result = arr[method](wrappedFn, ...args);
826
- return wrapInitialAccumulator ? toWrapped(self, result) : result;
827
- }
828
- function searchProxy(self, method, args) {
829
- const arr = /* @__PURE__ */ toRaw(self);
830
- track(arr, "iterate", ARRAY_ITERATE_KEY);
831
- const res = arr[method](...args);
832
- if ((res === -1 || res === false) && /* @__PURE__ */ isProxy(args[0])) {
833
- args[0] = /* @__PURE__ */ toRaw(args[0]);
834
- return arr[method](...args);
835
- }
836
- return res;
837
- }
838
- function noTracking(self, method, args = []) {
839
- pauseTracking();
840
- startBatch();
841
- const res = (/* @__PURE__ */ toRaw(self))[method].apply(self, args);
842
- endBatch();
843
- resetTracking();
844
- return res;
845
- }
846
- const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
847
- const builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
848
- function hasOwnProperty(key) {
849
- if (!isSymbol(key)) key = String(key);
850
- const obj = /* @__PURE__ */ toRaw(this);
851
- track(obj, "has", key);
852
- return obj.hasOwnProperty(key);
853
- }
854
- var BaseReactiveHandler = class {
855
- constructor(_isReadonly = false, _isShallow = false) {
856
- this._isReadonly = _isReadonly;
857
- this._isShallow = _isShallow;
858
- }
859
- get(target, key, receiver) {
860
- if (key === "__v_skip") return target["__v_skip"];
861
- const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
862
- if (key === "__v_isReactive") return !isReadonly2;
863
- else if (key === "__v_isReadonly") return isReadonly2;
864
- else if (key === "__v_isShallow") return isShallow2;
865
- else if (key === "__v_raw") {
866
- if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) return target;
867
- return;
868
- }
869
- const targetIsArray = isArray(target);
870
- if (!isReadonly2) {
871
- let fn;
872
- if (targetIsArray && (fn = arrayInstrumentations[key])) return fn;
873
- if (key === "hasOwnProperty") return hasOwnProperty;
874
- }
875
- const res = Reflect.get(target, key, /* @__PURE__ */ isRef(target) ? target : receiver);
876
- if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) return res;
877
- if (!isReadonly2) track(target, "get", key);
878
- if (isShallow2) return res;
879
- if (/* @__PURE__ */ isRef(res)) {
880
- const value = targetIsArray && isIntegerKey(key) ? res : res.value;
881
- return isReadonly2 && isObject$1(value) ? /* @__PURE__ */ readonly(value) : value;
882
- }
883
- if (isObject$1(res)) return isReadonly2 ? /* @__PURE__ */ readonly(res) : /* @__PURE__ */ reactive(res);
884
- return res;
885
- }
886
- };
887
- var MutableReactiveHandler = class extends BaseReactiveHandler {
888
- constructor(isShallow2 = false) {
889
- super(false, isShallow2);
890
- }
891
- set(target, key, value, receiver) {
892
- let oldValue = target[key];
893
- const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key);
894
- if (!this._isShallow) {
895
- const isOldValueReadonly = /* @__PURE__ */ isReadonly(oldValue);
896
- if (!/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) {
897
- oldValue = /* @__PURE__ */ toRaw(oldValue);
898
- value = /* @__PURE__ */ toRaw(value);
899
- }
900
- if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) if (isOldValueReadonly) {
901
- warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
902
- return true;
903
- } else {
904
- oldValue.value = value;
905
- return true;
906
- }
907
- }
908
- const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
909
- const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
910
- if (target === /* @__PURE__ */ toRaw(receiver)) {
911
- if (!hadKey) trigger(target, "add", key, value);
912
- else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
913
- }
914
- return result;
915
- }
916
- deleteProperty(target, key) {
917
- const hadKey = hasOwn(target, key);
918
- const oldValue = target[key];
919
- const result = Reflect.deleteProperty(target, key);
920
- if (result && hadKey) trigger(target, "delete", key, void 0, oldValue);
921
- return result;
922
- }
923
- has(target, key) {
924
- const result = Reflect.has(target, key);
925
- if (!isSymbol(key) || !builtInSymbols.has(key)) track(target, "has", key);
926
- return result;
927
- }
928
- ownKeys(target) {
929
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
930
- return Reflect.ownKeys(target);
931
- }
932
- };
933
- var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
934
- constructor(isShallow2 = false) {
935
- super(true, isShallow2);
936
- }
937
- set(target, key) {
938
- warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
939
- return true;
940
- }
941
- deleteProperty(target, key) {
942
- warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
943
- return true;
944
- }
945
- };
946
- const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
947
- const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
948
- const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
949
- const toShallow = (value) => value;
950
- const getProto = (v) => Reflect.getPrototypeOf(v);
951
- function createIterableMethod(method, isReadonly2, isShallow2) {
952
- return function(...args) {
953
- const target = this["__v_raw"];
954
- const rawTarget = /* @__PURE__ */ toRaw(target);
955
- const targetIsMap = isMap(rawTarget);
956
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
957
- const isKeyOnly = method === "keys" && targetIsMap;
958
- const innerIterator = target[method](...args);
959
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
960
- !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
961
- return extend(Object.create(innerIterator), { next() {
962
- const { value, done } = innerIterator.next();
963
- return done ? {
964
- value,
965
- done
966
- } : {
967
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
968
- done
969
- };
970
- } });
971
- };
972
- }
973
- function createReadonlyMethod(type) {
974
- return function(...args) {
975
- {
976
- const key = args[0] ? `on key "${args[0]}" ` : ``;
977
- warn(`${capitalize$1(type)} operation ${key}failed: target is readonly.`, /* @__PURE__ */ toRaw(this));
978
- }
979
- return type === "delete" ? false : type === "clear" ? void 0 : this;
980
- };
981
- }
982
- function createInstrumentations(readonly, shallow) {
983
- const instrumentations = {
984
- get(key) {
985
- const target = this["__v_raw"];
986
- const rawTarget = /* @__PURE__ */ toRaw(target);
987
- const rawKey = /* @__PURE__ */ toRaw(key);
988
- if (!readonly) {
989
- if (hasChanged(key, rawKey)) track(rawTarget, "get", key);
990
- track(rawTarget, "get", rawKey);
991
- }
992
- const { has } = getProto(rawTarget);
993
- const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
994
- if (has.call(rawTarget, key)) return wrap(target.get(key));
995
- else if (has.call(rawTarget, rawKey)) return wrap(target.get(rawKey));
996
- else if (target !== rawTarget) target.get(key);
997
- },
998
- get size() {
999
- const target = this["__v_raw"];
1000
- !readonly && track(/* @__PURE__ */ toRaw(target), "iterate", ITERATE_KEY);
1001
- return target.size;
1002
- },
1003
- has(key) {
1004
- const target = this["__v_raw"];
1005
- const rawTarget = /* @__PURE__ */ toRaw(target);
1006
- const rawKey = /* @__PURE__ */ toRaw(key);
1007
- if (!readonly) {
1008
- if (hasChanged(key, rawKey)) track(rawTarget, "has", key);
1009
- track(rawTarget, "has", rawKey);
1010
- }
1011
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1012
- },
1013
- forEach(callback, thisArg) {
1014
- const observed = this;
1015
- const target = observed["__v_raw"];
1016
- const rawTarget = /* @__PURE__ */ toRaw(target);
1017
- const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1018
- !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1019
- return target.forEach((value, key) => {
1020
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1021
- });
1022
- }
1023
- };
1024
- extend(instrumentations, readonly ? {
1025
- add: createReadonlyMethod("add"),
1026
- set: createReadonlyMethod("set"),
1027
- delete: createReadonlyMethod("delete"),
1028
- clear: createReadonlyMethod("clear")
1029
- } : {
1030
- add(value) {
1031
- const target = /* @__PURE__ */ toRaw(this);
1032
- const proto = getProto(target);
1033
- const rawValue = /* @__PURE__ */ toRaw(value);
1034
- const valueToAdd = !shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value) ? rawValue : value;
1035
- if (!(proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue))) {
1036
- target.add(valueToAdd);
1037
- trigger(target, "add", valueToAdd, valueToAdd);
1038
- }
1039
- return this;
1040
- },
1041
- set(key, value) {
1042
- if (!shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) value = /* @__PURE__ */ toRaw(value);
1043
- const target = /* @__PURE__ */ toRaw(this);
1044
- const { has, get } = getProto(target);
1045
- let hadKey = has.call(target, key);
1046
- if (!hadKey) {
1047
- key = /* @__PURE__ */ toRaw(key);
1048
- hadKey = has.call(target, key);
1049
- } else checkIdentityKeys(target, has, key);
1050
- const oldValue = get.call(target, key);
1051
- target.set(key, value);
1052
- if (!hadKey) trigger(target, "add", key, value);
1053
- else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
1054
- return this;
1055
- },
1056
- delete(key) {
1057
- const target = /* @__PURE__ */ toRaw(this);
1058
- const { has, get } = getProto(target);
1059
- let hadKey = has.call(target, key);
1060
- if (!hadKey) {
1061
- key = /* @__PURE__ */ toRaw(key);
1062
- hadKey = has.call(target, key);
1063
- } else checkIdentityKeys(target, has, key);
1064
- const oldValue = get ? get.call(target, key) : void 0;
1065
- const result = target.delete(key);
1066
- if (hadKey) trigger(target, "delete", key, void 0, oldValue);
1067
- return result;
1068
- },
1069
- clear() {
1070
- const target = /* @__PURE__ */ toRaw(this);
1071
- const hadItems = target.size !== 0;
1072
- const oldTarget = isMap(target) ? new Map(target) : new Set(target);
1073
- const result = target.clear();
1074
- if (hadItems) trigger(target, "clear", void 0, void 0, oldTarget);
1075
- return result;
1076
- }
1077
- });
1078
- [
1079
- "keys",
1080
- "values",
1081
- "entries",
1082
- Symbol.iterator
1083
- ].forEach((method) => {
1084
- instrumentations[method] = createIterableMethod(method, readonly, shallow);
1085
- });
1086
- return instrumentations;
1087
- }
1088
- function createInstrumentationGetter(isReadonly2, shallow) {
1089
- const instrumentations = createInstrumentations(isReadonly2, shallow);
1090
- return (target, key, receiver) => {
1091
- if (key === "__v_isReactive") return !isReadonly2;
1092
- else if (key === "__v_isReadonly") return isReadonly2;
1093
- else if (key === "__v_raw") return target;
1094
- return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1095
- };
1096
- }
1097
- const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) };
1098
- const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) };
1099
- const shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) };
1100
- function checkIdentityKeys(target, has, key) {
1101
- const rawKey = /* @__PURE__ */ toRaw(key);
1102
- if (rawKey !== key && has.call(target, rawKey)) {
1103
- const type = toRawType(target);
1104
- warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
1105
- }
1106
- }
1107
- const reactiveMap = /* @__PURE__ */ new WeakMap();
1108
- const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
1109
- const readonlyMap = /* @__PURE__ */ new WeakMap();
1110
- const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
1111
- function targetTypeMap(rawType) {
1112
- switch (rawType) {
1113
- case "Object":
1114
- case "Array": return 1;
1115
- case "Map":
1116
- case "Set":
1117
- case "WeakMap":
1118
- case "WeakSet": return 2;
1119
- default: return 0;
1120
- }
1121
- }
1122
- function getTargetType(value) {
1123
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1124
- }
1125
- /* @__NO_SIDE_EFFECTS__ */
1126
- function reactive(target) {
1127
- if (/* @__PURE__ */ isReadonly(target)) return target;
1128
- return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
1129
- }
1130
- /* @__NO_SIDE_EFFECTS__ */
1131
- function readonly(target) {
1132
- return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
1133
- }
1134
- /* @__NO_SIDE_EFFECTS__ */
1135
- function shallowReadonly(target) {
1136
- return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
1137
- }
1138
- function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
1139
- if (!isObject$1(target)) {
1140
- warn(`value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(target)}`);
1141
- return target;
1142
- }
1143
- if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) return target;
1144
- const targetType = getTargetType(target);
1145
- if (targetType === 0) return target;
1146
- const existingProxy = proxyMap.get(target);
1147
- if (existingProxy) return existingProxy;
1148
- const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1149
- proxyMap.set(target, proxy);
1150
- return proxy;
1151
- }
1152
- /* @__NO_SIDE_EFFECTS__ */
1153
- function isReactive(value) {
1154
- if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
1155
- return !!(value && value["__v_isReactive"]);
1156
- }
1157
- /* @__NO_SIDE_EFFECTS__ */
1158
- function isReadonly(value) {
1159
- return !!(value && value["__v_isReadonly"]);
1160
- }
1161
- /* @__NO_SIDE_EFFECTS__ */
1162
- function isShallow(value) {
1163
- return !!(value && value["__v_isShallow"]);
1164
- }
1165
- /* @__NO_SIDE_EFFECTS__ */
1166
- function isProxy(value) {
1167
- return value ? !!value["__v_raw"] : false;
1168
- }
1169
- /* @__NO_SIDE_EFFECTS__ */
1170
- function toRaw(observed) {
1171
- const raw = observed && observed["__v_raw"];
1172
- return raw ? /* @__PURE__ */ toRaw(raw) : observed;
1173
- }
1174
- function markRaw(value) {
1175
- if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) def(value, "__v_skip", true);
1176
- return value;
1177
- }
1178
- const toReactive = (value) => isObject$1(value) ? /* @__PURE__ */ reactive(value) : value;
1179
- const toReadonly = (value) => isObject$1(value) ? /* @__PURE__ */ readonly(value) : value;
1180
- /* @__NO_SIDE_EFFECTS__ */
1181
- function isRef(r) {
1182
- return r ? r["__v_isRef"] === true : false;
1183
- }
1184
- function unref(ref2) {
1185
- return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
1186
- }
1187
- const shallowUnwrapHandlers = {
1188
- get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
1189
- set: (target, key, value, receiver) => {
1190
- const oldValue = target[key];
1191
- if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
1192
- oldValue.value = value;
1193
- return true;
1194
- } else return Reflect.set(target, key, value, receiver);
1195
- }
1196
- };
1197
- function proxyRefs(objectWithRefs) {
1198
- return /* @__PURE__ */ isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
1199
- }
1200
- const INITIAL_WATCHER_VALUE = {};
1201
- const cleanupMap = /* @__PURE__ */ new WeakMap();
1202
- let activeWatcher = void 0;
1203
- function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
1204
- if (owner) {
1205
- let cleanups = cleanupMap.get(owner);
1206
- if (!cleanups) cleanupMap.set(owner, cleanups = []);
1207
- cleanups.push(cleanupFn);
1208
- } else if (!failSilently) warn(`onWatcherCleanup() was called when there was no active watcher to associate with.`);
1209
- }
1210
- function watch(source, cb, options = EMPTY_OBJ) {
1211
- const { immediate, deep, once, scheduler, augmentJob, call } = options;
1212
- const warnInvalidSource = (s) => {
1213
- (options.onWarn || warn)(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`);
1214
- };
1215
- const reactiveGetter = (source2) => {
1216
- if (deep) return source2;
1217
- if (/* @__PURE__ */ isShallow(source2) || deep === false || deep === 0) return traverse(source2, 1);
1218
- return traverse(source2);
1219
- };
1220
- let effect;
1221
- let getter;
1222
- let cleanup;
1223
- let boundCleanup;
1224
- let forceTrigger = false;
1225
- let isMultiSource = false;
1226
- if (/* @__PURE__ */ isRef(source)) {
1227
- getter = () => source.value;
1228
- forceTrigger = /* @__PURE__ */ isShallow(source);
1229
- } else if (/* @__PURE__ */ isReactive(source)) {
1230
- getter = () => reactiveGetter(source);
1231
- forceTrigger = true;
1232
- } else if (isArray(source)) {
1233
- isMultiSource = true;
1234
- forceTrigger = source.some((s) => /* @__PURE__ */ isReactive(s) || /* @__PURE__ */ isShallow(s));
1235
- getter = () => source.map((s) => {
1236
- if (/* @__PURE__ */ isRef(s)) return s.value;
1237
- else if (/* @__PURE__ */ isReactive(s)) return reactiveGetter(s);
1238
- else if (isFunction(s)) return call ? call(s, 2) : s();
1239
- else warnInvalidSource(s);
1240
- });
1241
- } else if (isFunction(source)) if (cb) getter = call ? () => call(source, 2) : source;
1242
- else getter = () => {
1243
- if (cleanup) {
1244
- pauseTracking();
1245
- try {
1246
- cleanup();
1247
- } finally {
1248
- resetTracking();
1249
- }
1250
- }
1251
- const currentEffect = activeWatcher;
1252
- activeWatcher = effect;
1253
- try {
1254
- return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
1255
- } finally {
1256
- activeWatcher = currentEffect;
1257
- }
1258
- };
1259
- else {
1260
- getter = NOOP;
1261
- warnInvalidSource(source);
1262
- }
1263
- if (cb && deep) {
1264
- const baseGetter = getter;
1265
- const depth = deep === true ? Infinity : deep;
1266
- getter = () => traverse(baseGetter(), depth);
1267
- }
1268
- const watchHandle = () => {
1269
- effect.stop();
1270
- };
1271
- if (once && cb) {
1272
- const _cb = cb;
1273
- cb = (...args) => {
1274
- _cb(...args);
1275
- watchHandle();
1276
- };
1277
- }
1278
- let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
1279
- const job = (immediateFirstRun) => {
1280
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) return;
1281
- if (cb) {
1282
- const newValue = effect.run();
1283
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
1284
- if (cleanup) cleanup();
1285
- const currentWatcher = activeWatcher;
1286
- activeWatcher = effect;
1287
- try {
1288
- const args = [
1289
- newValue,
1290
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
1291
- boundCleanup
1292
- ];
1293
- oldValue = newValue;
1294
- call ? call(cb, 3, args) : cb(...args);
1295
- } finally {
1296
- activeWatcher = currentWatcher;
1297
- }
1298
- }
1299
- } else effect.run();
1300
- };
1301
- if (augmentJob) augmentJob(job);
1302
- effect = new ReactiveEffect(getter);
1303
- effect.scheduler = scheduler ? () => scheduler(job, false) : job;
1304
- boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
1305
- cleanup = effect.onStop = () => {
1306
- const cleanups = cleanupMap.get(effect);
1307
- if (cleanups) {
1308
- if (call) call(cleanups, 4);
1309
- else for (const cleanup2 of cleanups) cleanup2();
1310
- cleanupMap.delete(effect);
1311
- }
1312
- };
1313
- effect.onTrack = options.onTrack;
1314
- effect.onTrigger = options.onTrigger;
1315
- if (cb) if (immediate) job(true);
1316
- else oldValue = effect.run();
1317
- else if (scheduler) scheduler(job.bind(null, true), true);
1318
- else effect.run();
1319
- watchHandle.pause = effect.pause.bind(effect);
1320
- watchHandle.resume = effect.resume.bind(effect);
1321
- watchHandle.stop = watchHandle;
1322
- return watchHandle;
1323
- }
1324
- function traverse(value, depth = Infinity, seen) {
1325
- if (depth <= 0 || !isObject$1(value) || value["__v_skip"]) return value;
1326
- seen = seen || /* @__PURE__ */ new Map();
1327
- if ((seen.get(value) || 0) >= depth) return value;
1328
- seen.set(value, depth);
1329
- depth--;
1330
- if (/* @__PURE__ */ isRef(value)) traverse(value.value, depth, seen);
1331
- else if (isArray(value)) for (let i = 0; i < value.length; i++) traverse(value[i], depth, seen);
1332
- else if (isSet(value) || isMap(value)) value.forEach((v) => {
1333
- traverse(v, depth, seen);
1334
- });
1335
- else if (isPlainObject$1(value)) {
1336
- for (const key in value) traverse(value[key], depth, seen);
1337
- for (const key of Object.getOwnPropertySymbols(value)) if (Object.prototype.propertyIsEnumerable.call(value, key)) traverse(value[key], depth, seen);
1338
- }
1339
- return value;
1340
- }
1341
- //#endregion
1342
- //#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.34/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
1343
- /**
1344
- * @vue/runtime-core v3.5.34
1345
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
1346
- * @license MIT
1347
- **/
1348
- const stack = [];
1349
- function pushWarningContext(vnode) {
1350
- stack.push(vnode);
1351
- }
1352
- function popWarningContext() {
1353
- stack.pop();
1354
- }
1355
- let isWarning = false;
1356
- function warn$1(msg, ...args) {
1357
- if (isWarning) return;
1358
- isWarning = true;
1359
- pauseTracking();
1360
- const instance = stack.length ? stack[stack.length - 1].component : null;
1361
- const appWarnHandler = instance && instance.appContext.config.warnHandler;
1362
- const trace = getComponentTrace();
1363
- if (appWarnHandler) callWithErrorHandling(appWarnHandler, instance, 11, [
1364
- msg + args.map((a) => {
1365
- var _a, _b;
1366
- return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
1367
- }).join(""),
1368
- instance && instance.proxy,
1369
- trace.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`).join("\n"),
1370
- trace
1371
- ]);
1372
- else {
1373
- const warnArgs = [`[Vue warn]: ${msg}`, ...args];
1374
- if (trace.length && true) warnArgs.push(`
1375
- `, ...formatTrace(trace));
1376
- console.warn(...warnArgs);
1377
- }
1378
- resetTracking();
1379
- isWarning = false;
1380
- }
1381
- function getComponentTrace() {
1382
- let currentVNode = stack[stack.length - 1];
1383
- if (!currentVNode) return [];
1384
- const normalizedStack = [];
1385
- while (currentVNode) {
1386
- const last = normalizedStack[0];
1387
- if (last && last.vnode === currentVNode) last.recurseCount++;
1388
- else normalizedStack.push({
1389
- vnode: currentVNode,
1390
- recurseCount: 0
1391
- });
1392
- const parentInstance = currentVNode.component && currentVNode.component.parent;
1393
- currentVNode = parentInstance && parentInstance.vnode;
1394
- }
1395
- return normalizedStack;
1396
- }
1397
- function formatTrace(trace) {
1398
- const logs = [];
1399
- trace.forEach((entry, i) => {
1400
- logs.push(...i === 0 ? [] : [`
1401
- `], ...formatTraceEntry(entry));
1402
- });
1403
- return logs;
1404
- }
1405
- function formatTraceEntry({ vnode, recurseCount }) {
1406
- const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
1407
- const isRoot = vnode.component ? vnode.component.parent == null : false;
1408
- const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
1409
- const close = `>` + postfix;
1410
- return vnode.props ? [
1411
- open,
1412
- ...formatProps(vnode.props),
1413
- close
1414
- ] : [open + close];
1415
- }
1416
- function formatProps(props) {
1417
- const res = [];
1418
- const keys = Object.keys(props);
1419
- keys.slice(0, 3).forEach((key) => {
1420
- res.push(...formatProp(key, props[key]));
1421
- });
1422
- if (keys.length > 3) res.push(` ...`);
1423
- return res;
1424
- }
1425
- function formatProp(key, value, raw) {
1426
- if (isString(value)) {
1427
- value = JSON.stringify(value);
1428
- return raw ? value : [`${key}=${value}`];
1429
- } else if (typeof value === "number" || typeof value === "boolean" || value == null) return raw ? value : [`${key}=${value}`];
1430
- else if (/* @__PURE__ */ isRef(value)) {
1431
- value = formatProp(key, /* @__PURE__ */ toRaw(value.value), true);
1432
- return raw ? value : [
1433
- `${key}=Ref<`,
1434
- value,
1435
- `>`
1436
- ];
1437
- } else if (isFunction(value)) return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
1438
- else {
1439
- value = /* @__PURE__ */ toRaw(value);
1440
- return raw ? value : [`${key}=`, value];
1441
- }
1442
- }
1443
- const ErrorTypeStrings$1 = {
1444
- ["sp"]: "serverPrefetch hook",
1445
- ["bc"]: "beforeCreate hook",
1446
- ["c"]: "created hook",
1447
- ["bm"]: "beforeMount hook",
1448
- ["m"]: "mounted hook",
1449
- ["bu"]: "beforeUpdate hook",
1450
- ["u"]: "updated",
1451
- ["bum"]: "beforeUnmount hook",
1452
- ["um"]: "unmounted hook",
1453
- ["a"]: "activated hook",
1454
- ["da"]: "deactivated hook",
1455
- ["ec"]: "errorCaptured hook",
1456
- ["rtc"]: "renderTracked hook",
1457
- ["rtg"]: "renderTriggered hook",
1458
- [0]: "setup function",
1459
- [1]: "render function",
1460
- [2]: "watcher getter",
1461
- [3]: "watcher callback",
1462
- [4]: "watcher cleanup function",
1463
- [5]: "native event handler",
1464
- [6]: "component event handler",
1465
- [7]: "vnode hook",
1466
- [8]: "directive hook",
1467
- [9]: "transition hook",
1468
- [10]: "app errorHandler",
1469
- [11]: "app warnHandler",
1470
- [12]: "ref function",
1471
- [13]: "async component loader",
1472
- [14]: "scheduler flush",
1473
- [15]: "component update",
1474
- [16]: "app unmount cleanup function"
1475
- };
1476
- function callWithErrorHandling(fn, instance, type, args) {
1477
- try {
1478
- return args ? fn(...args) : fn();
1479
- } catch (err) {
1480
- handleError(err, instance, type);
1481
- }
1482
- }
1483
- function callWithAsyncErrorHandling(fn, instance, type, args) {
1484
- if (isFunction(fn)) {
1485
- const res = callWithErrorHandling(fn, instance, type, args);
1486
- if (res && isPromise(res)) res.catch((err) => {
1487
- handleError(err, instance, type);
1488
- });
1489
- return res;
1490
- }
1491
- if (isArray(fn)) {
1492
- const values = [];
1493
- for (let i = 0; i < fn.length; i++) values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1494
- return values;
1495
- } else warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
1496
- }
1497
- function handleError(err, instance, type, throwInDev = true) {
1498
- const contextVNode = instance ? instance.vnode : null;
1499
- const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
1500
- if (instance) {
1501
- let cur = instance.parent;
1502
- const exposedInstance = instance.proxy;
1503
- const errorInfo = ErrorTypeStrings$1[type];
1504
- while (cur) {
1505
- const errorCapturedHooks = cur.ec;
1506
- if (errorCapturedHooks) {
1507
- for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
1508
- }
1509
- cur = cur.parent;
1510
- }
1511
- if (errorHandler) {
1512
- pauseTracking();
1513
- callWithErrorHandling(errorHandler, null, 10, [
1514
- err,
1515
- exposedInstance,
1516
- errorInfo
1517
- ]);
1518
- resetTracking();
1519
- return;
1520
- }
1521
- }
1522
- logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
1523
- }
1524
- function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
1525
- {
1526
- const info = ErrorTypeStrings$1[type];
1527
- if (contextVNode) pushWarningContext(contextVNode);
1528
- warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
1529
- if (contextVNode) popWarningContext();
1530
- if (throwInDev) throw err;
1531
- else console.error(err);
1532
- }
1533
- }
1534
- const queue = [];
1535
- let flushIndex = -1;
1536
- const pendingPostFlushCbs = [];
1537
- let activePostFlushCbs = null;
1538
- let postFlushIndex = 0;
1539
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
1540
- let currentFlushPromise = null;
1541
- const RECURSION_LIMIT = 100;
1542
- function nextTick(fn) {
1543
- const p = currentFlushPromise || resolvedPromise;
1544
- return fn ? p.then(this ? fn.bind(this) : fn) : p;
1545
- }
1546
- function findInsertionIndex(id) {
1547
- let start = flushIndex + 1;
1548
- let end = queue.length;
1549
- while (start < end) {
1550
- const middle = start + end >>> 1;
1551
- const middleJob = queue[middle];
1552
- const middleJobId = getId(middleJob);
1553
- if (middleJobId < id || middleJobId === id && middleJob.flags & 2) start = middle + 1;
1554
- else end = middle;
1555
- }
1556
- return start;
1557
- }
1558
- function queueJob(job) {
1559
- if (!(job.flags & 1)) {
1560
- const jobId = getId(job);
1561
- const lastJob = queue[queue.length - 1];
1562
- if (!lastJob || !(job.flags & 2) && jobId >= getId(lastJob)) queue.push(job);
1563
- else queue.splice(findInsertionIndex(jobId), 0, job);
1564
- job.flags |= 1;
1565
- queueFlush();
1566
- }
1567
- }
1568
- function queueFlush() {
1569
- if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(flushJobs);
1570
- }
1571
- function queuePostFlushCb(cb) {
1572
- if (!isArray(cb)) {
1573
- if (activePostFlushCbs && cb.id === -1) activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
1574
- else if (!(cb.flags & 1)) {
1575
- pendingPostFlushCbs.push(cb);
1576
- cb.flags |= 1;
1577
- }
1578
- } else pendingPostFlushCbs.push(...cb);
1579
- queueFlush();
1580
- }
1581
- function flushPostFlushCbs(seen) {
1582
- if (pendingPostFlushCbs.length) {
1583
- const deduped = [...new Set(pendingPostFlushCbs)].sort((a, b) => getId(a) - getId(b));
1584
- pendingPostFlushCbs.length = 0;
1585
- if (activePostFlushCbs) {
1586
- activePostFlushCbs.push(...deduped);
1587
- return;
1588
- }
1589
- activePostFlushCbs = deduped;
1590
- seen = seen || /* @__PURE__ */ new Map();
1591
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
1592
- const cb = activePostFlushCbs[postFlushIndex];
1593
- if (checkRecursiveUpdates(seen, cb)) continue;
1594
- if (cb.flags & 4) cb.flags &= -2;
1595
- if (!(cb.flags & 8)) cb();
1596
- cb.flags &= -2;
1597
- }
1598
- activePostFlushCbs = null;
1599
- postFlushIndex = 0;
1600
- }
1601
- }
1602
- const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
1603
- function flushJobs(seen) {
1604
- seen = seen || /* @__PURE__ */ new Map();
1605
- const check = (job) => checkRecursiveUpdates(seen, job);
1606
- try {
1607
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
1608
- const job = queue[flushIndex];
1609
- if (job && !(job.flags & 8)) {
1610
- if (check(job)) continue;
1611
- if (job.flags & 4) job.flags &= -2;
1612
- callWithErrorHandling(job, job.i, job.i ? 15 : 14);
1613
- if (!(job.flags & 4)) job.flags &= -2;
1614
- }
1615
- }
1616
- } finally {
1617
- for (; flushIndex < queue.length; flushIndex++) {
1618
- const job = queue[flushIndex];
1619
- if (job) job.flags &= -2;
1620
- }
1621
- flushIndex = -1;
1622
- queue.length = 0;
1623
- flushPostFlushCbs(seen);
1624
- currentFlushPromise = null;
1625
- if (queue.length || pendingPostFlushCbs.length) flushJobs(seen);
1626
- }
1627
- }
1628
- function checkRecursiveUpdates(seen, fn) {
1629
- const count = seen.get(fn) || 0;
1630
- if (count > RECURSION_LIMIT) {
1631
- const instance = fn.i;
1632
- const componentName = instance && getComponentName(instance.type);
1633
- handleError(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, null, 10);
1634
- return true;
1635
- }
1636
- seen.set(fn, count + 1);
1637
- return false;
1638
- }
1639
- const hmrDirtyComponents = /* @__PURE__ */ new Map();
1640
- getGlobalThis().__VUE_HMR_RUNTIME__ = {
1641
- createRecord: tryWrap(createRecord),
1642
- rerender: tryWrap(rerender),
1643
- reload: tryWrap(reload)
1644
- };
1645
- const map = /* @__PURE__ */ new Map();
1646
- function createRecord(id, initialDef) {
1647
- if (map.has(id)) return false;
1648
- map.set(id, {
1649
- initialDef: normalizeClassComponent(initialDef),
1650
- instances: /* @__PURE__ */ new Set()
1651
- });
1652
- return true;
1653
- }
1654
- function normalizeClassComponent(component) {
1655
- return isClassComponent(component) ? component.__vccOpts : component;
1656
- }
1657
- function rerender(id, newRender) {
1658
- const record = map.get(id);
1659
- if (!record) return;
1660
- record.initialDef.render = newRender;
1661
- [...record.instances].forEach((instance) => {
1662
- if (newRender) {
1663
- instance.render = newRender;
1664
- normalizeClassComponent(instance.type).render = newRender;
1665
- }
1666
- instance.renderCache = [];
1667
- if (!(instance.job.flags & 8)) instance.update();
1668
- });
1669
- }
1670
- function reload(id, newComp) {
1671
- const record = map.get(id);
1672
- if (!record) return;
1673
- newComp = normalizeClassComponent(newComp);
1674
- updateComponentDef(record.initialDef, newComp);
1675
- const instances = [...record.instances];
1676
- for (let i = 0; i < instances.length; i++) {
1677
- const instance = instances[i];
1678
- const oldComp = normalizeClassComponent(instance.type);
1679
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
1680
- if (!dirtyInstances) {
1681
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
1682
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
1683
- }
1684
- dirtyInstances.add(instance);
1685
- instance.appContext.propsCache.delete(instance.type);
1686
- instance.appContext.emitsCache.delete(instance.type);
1687
- instance.appContext.optionsCache.delete(instance.type);
1688
- if (instance.ceReload) {
1689
- dirtyInstances.add(instance);
1690
- instance.ceReload(newComp.styles);
1691
- dirtyInstances.delete(instance);
1692
- } else if (instance.parent) queueJob(() => {
1693
- if (!(instance.job.flags & 8)) {
1694
- instance.parent.update();
1695
- dirtyInstances.delete(instance);
1696
- }
1697
- });
1698
- else if (instance.appContext.reload) instance.appContext.reload();
1699
- else if (typeof window !== "undefined") window.location.reload();
1700
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
1701
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
1702
- }
1703
- queuePostFlushCb(() => {
1704
- hmrDirtyComponents.clear();
1705
- });
1706
- }
1707
- function updateComponentDef(oldComp, newComp) {
1708
- extend(oldComp, newComp);
1709
- for (const key in oldComp) if (key !== "__file" && !(key in newComp)) delete oldComp[key];
1710
- }
1711
- function tryWrap(fn) {
1712
- return (id, arg) => {
1713
- try {
1714
- return fn(id, arg);
1715
- } catch (e) {
1716
- console.error(e);
1717
- console.warn(`[HMR] Something went wrong during Vue component hot-reload. Full reload required.`);
1718
- }
1719
- };
1720
- }
1721
- let currentRenderingInstance = null;
1722
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
1723
- const instance = getCurrentInstance();
1724
- if (instance || currentApp) {
1725
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
1726
- if (provides && key in provides) return provides[key];
1727
- else if (arguments.length > 1) return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
1728
- else warn$1(`injection "${String(key)}" not found.`);
1729
- } else warn$1(`inject() can only be used inside setup() or functional components.`);
1730
- }
1731
- const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
1732
- const useSSRContext = () => {
1733
- {
1734
- const ctx = inject(ssrContextKey);
1735
- if (!ctx) warn$1(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`);
1736
- return ctx;
1737
- }
1738
- };
1739
- function doWatch(source, cb, options = EMPTY_OBJ) {
1740
- const { immediate, deep, flush, once } = options;
1741
- if (!cb) {
1742
- if (immediate !== void 0) warn$1(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
1743
- if (deep !== void 0) warn$1(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
1744
- if (once !== void 0) warn$1(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`);
1745
- }
1746
- const baseWatchOptions = extend({}, options);
1747
- baseWatchOptions.onWarn = warn$1;
1748
- const runsImmediately = cb && immediate || !cb && flush !== "post";
1749
- let ssrCleanup;
1750
- if (isInSSRComponentSetup) {
1751
- if (flush === "sync") {
1752
- const ctx = useSSRContext();
1753
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
1754
- } else if (!runsImmediately) {
1755
- const watchStopHandle = () => {};
1756
- watchStopHandle.stop = NOOP;
1757
- watchStopHandle.resume = NOOP;
1758
- watchStopHandle.pause = NOOP;
1759
- return watchStopHandle;
1760
- }
1761
- }
1762
- const instance = currentInstance;
1763
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
1764
- let isPre = false;
1765
- if (flush === "post") baseWatchOptions.scheduler = (job) => {
1766
- queuePostRenderEffect(job, instance && instance.suspense);
1767
- };
1768
- else if (flush !== "sync") {
1769
- isPre = true;
1770
- baseWatchOptions.scheduler = (job, isFirstRun) => {
1771
- if (isFirstRun) job();
1772
- else queueJob(job);
1773
- };
1774
- }
1775
- baseWatchOptions.augmentJob = (job) => {
1776
- if (cb) job.flags |= 4;
1777
- if (isPre) {
1778
- job.flags |= 2;
1779
- if (instance) {
1780
- job.id = instance.uid;
1781
- job.i = instance;
1782
- }
1783
- }
1784
- };
1785
- const watchHandle = watch(source, cb, baseWatchOptions);
1786
- if (isInSSRComponentSetup) {
1787
- if (ssrCleanup) ssrCleanup.push(watchHandle);
1788
- else if (runsImmediately) watchHandle();
1789
- }
1790
- return watchHandle;
1791
- }
1792
- function instanceWatch(source, value, options) {
1793
- const publicThis = this.proxy;
1794
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
1795
- let cb;
1796
- if (isFunction(value)) cb = value;
1797
- else {
1798
- cb = value.handler;
1799
- options = value;
1800
- }
1801
- const reset = setCurrentInstance(this);
1802
- const res = doWatch(getter, cb.bind(publicThis), options);
1803
- reset();
1804
- return res;
1805
- }
1806
- function createPathGetter(ctx, path) {
1807
- const segments = path.split(".");
1808
- return () => {
1809
- let cur = ctx;
1810
- for (let i = 0; i < segments.length && cur; i++) cur = cur[segments[i]];
1811
- return cur;
1812
- };
1813
- }
1814
- getGlobalThis().requestIdleCallback;
1815
- getGlobalThis().cancelIdleCallback;
1816
- const getPublicInstance = (i) => {
1817
- if (!i) return null;
1818
- if (isStatefulComponent(i)) return getComponentPublicInstance(i);
1819
- return getPublicInstance(i.parent);
1820
- };
1821
- const publicPropertiesMap = /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
1822
- $: (i) => i,
1823
- $el: (i) => i.vnode.el,
1824
- $data: (i) => i.data,
1825
- $props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
1826
- $attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
1827
- $slots: (i) => /* @__PURE__ */ shallowReadonly(i.slots),
1828
- $refs: (i) => /* @__PURE__ */ shallowReadonly(i.refs),
1829
- $parent: (i) => getPublicInstance(i.parent),
1830
- $root: (i) => getPublicInstance(i.root),
1831
- $host: (i) => i.ce,
1832
- $emit: (i) => i.emit,
1833
- $options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type,
1834
- $forceUpdate: (i) => i.f || (i.f = () => {
1835
- queueJob(i.update);
1836
- }),
1837
- $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
1838
- $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP
1839
- });
1840
- const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
1841
- const PublicInstanceProxyHandlers = {
1842
- get({ _: instance }, key) {
1843
- if (key === "__v_skip") return true;
1844
- const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
1845
- if (key === "__isVue") return true;
1846
- if (key[0] !== "$") {
1847
- const n = accessCache[key];
1848
- if (n !== void 0) switch (n) {
1849
- case 1: return setupState[key];
1850
- case 2: return data[key];
1851
- case 4: return ctx[key];
1852
- case 3: return props[key];
1853
- }
1854
- else if (hasSetupBinding(setupState, key)) {
1855
- accessCache[key] = 1;
1856
- return setupState[key];
1857
- } else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
1858
- accessCache[key] = 2;
1859
- return data[key];
1860
- } else if (hasOwn(props, key)) {
1861
- accessCache[key] = 3;
1862
- return props[key];
1863
- } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
1864
- accessCache[key] = 4;
1865
- return ctx[key];
1866
- } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) accessCache[key] = 0;
1867
- }
1868
- const publicGetter = publicPropertiesMap[key];
1869
- let cssModule, globalProperties;
1870
- if (publicGetter) {
1871
- if (key === "$attrs") track(instance.attrs, "get", "");
1872
- else if (key === "$slots") track(instance, "get", key);
1873
- return publicGetter(instance);
1874
- } else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) return cssModule;
1875
- else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
1876
- accessCache[key] = 4;
1877
- return ctx[key];
1878
- } else if (globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) return globalProperties[key];
1879
- },
1880
- set({ _: instance }, key, value) {
1881
- const { data, setupState, ctx } = instance;
1882
- if (hasSetupBinding(setupState, key)) {
1883
- setupState[key] = value;
1884
- return true;
1885
- } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
1886
- warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
1887
- return false;
1888
- } else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
1889
- data[key] = value;
1890
- return true;
1891
- } else if (hasOwn(instance.props, key)) {
1892
- warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
1893
- return false;
1894
- }
1895
- if (key[0] === "$" && key.slice(1) in instance) {
1896
- warn$1(`Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`);
1897
- return false;
1898
- } else if (key in instance.appContext.config.globalProperties) Object.defineProperty(ctx, key, {
1899
- enumerable: true,
1900
- configurable: true,
1901
- value
1902
- });
1903
- else ctx[key] = value;
1904
- return true;
1905
- },
1906
- has({ _: { data, setupState, accessCache, ctx, appContext, props, type } }, key) {
1907
- let cssModules;
1908
- return !!(accessCache[key] || __VUE_OPTIONS_API__ && data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
1909
- },
1910
- defineProperty(target, key, descriptor) {
1911
- if (descriptor.get != null) target._.accessCache[key] = 0;
1912
- else if (hasOwn(descriptor, "value")) this.set(target, key, descriptor.value, null);
1913
- return Reflect.defineProperty(target, key, descriptor);
1914
- }
1915
- };
1916
- PublicInstanceProxyHandlers.ownKeys = (target) => {
1917
- warn$1(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`);
1918
- return Reflect.ownKeys(target);
1919
- };
1920
- function normalizePropsOrEmits(props) {
1921
- return isArray(props) ? props.reduce((normalized, p) => (normalized[p] = null, normalized), {}) : props;
1922
- }
1923
- let shouldCacheAccess = true;
1924
- function resolveMergedOptions(instance) {
1925
- const base = instance.type;
1926
- const { mixins, extends: extendsOptions } = base;
1927
- const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
1928
- const cached = cache.get(base);
1929
- let resolved;
1930
- if (cached) resolved = cached;
1931
- else if (!globalMixins.length && !mixins && !extendsOptions) resolved = base;
1932
- else {
1933
- resolved = {};
1934
- if (globalMixins.length) globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
1935
- mergeOptions(resolved, base, optionMergeStrategies);
1936
- }
1937
- if (isObject$1(base)) cache.set(base, resolved);
1938
- return resolved;
1939
- }
1940
- function mergeOptions(to, from, strats, asMixin = false) {
1941
- const { mixins, extends: extendsOptions } = from;
1942
- if (extendsOptions) mergeOptions(to, extendsOptions, strats, true);
1943
- if (mixins) mixins.forEach((m) => mergeOptions(to, m, strats, true));
1944
- for (const key in from) if (asMixin && key === "expose") warn$1(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);
1945
- else {
1946
- const strat = internalOptionMergeStrats[key] || strats && strats[key];
1947
- to[key] = strat ? strat(to[key], from[key]) : from[key];
1948
- }
1949
- return to;
1950
- }
1951
- const internalOptionMergeStrats = {
1952
- data: mergeDataFn,
1953
- props: mergeEmitsOrPropsOptions,
1954
- emits: mergeEmitsOrPropsOptions,
1955
- methods: mergeObjectOptions,
1956
- computed: mergeObjectOptions,
1957
- beforeCreate: mergeAsArray,
1958
- created: mergeAsArray,
1959
- beforeMount: mergeAsArray,
1960
- mounted: mergeAsArray,
1961
- beforeUpdate: mergeAsArray,
1962
- updated: mergeAsArray,
1963
- beforeDestroy: mergeAsArray,
1964
- beforeUnmount: mergeAsArray,
1965
- destroyed: mergeAsArray,
1966
- unmounted: mergeAsArray,
1967
- activated: mergeAsArray,
1968
- deactivated: mergeAsArray,
1969
- errorCaptured: mergeAsArray,
1970
- serverPrefetch: mergeAsArray,
1971
- components: mergeObjectOptions,
1972
- directives: mergeObjectOptions,
1973
- watch: mergeWatchOptions,
1974
- provide: mergeDataFn,
1975
- inject: mergeInject
1976
- };
1977
- function mergeDataFn(to, from) {
1978
- if (!from) return to;
1979
- if (!to) return from;
1980
- return function mergedDataFn() {
1981
- return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
1982
- };
1983
- }
1984
- function mergeInject(to, from) {
1985
- return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
1986
- }
1987
- function normalizeInject(raw) {
1988
- if (isArray(raw)) {
1989
- const res = {};
1990
- for (let i = 0; i < raw.length; i++) res[raw[i]] = raw[i];
1991
- return res;
1992
- }
1993
- return raw;
1994
- }
1995
- function mergeAsArray(to, from) {
1996
- return to ? [...new Set([].concat(to, from))] : from;
1997
- }
1998
- function mergeObjectOptions(to, from) {
1999
- return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
2000
- }
2001
- function mergeEmitsOrPropsOptions(to, from) {
2002
- if (to) {
2003
- if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
2004
- return extend(/* @__PURE__ */ Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from != null ? from : {}));
2005
- } else return from;
2006
- }
2007
- function mergeWatchOptions(to, from) {
2008
- if (!to) return from;
2009
- if (!from) return to;
2010
- const merged = extend(/* @__PURE__ */ Object.create(null), to);
2011
- for (const key in from) merged[key] = mergeAsArray(to[key], from[key]);
2012
- return merged;
2013
- }
2014
- let currentApp = null;
2015
- const queuePostRenderEffect = queueEffectWithSuspense;
2016
- function queueEffectWithSuspense(fn, suspense) {
2017
- if (suspense && suspense.pendingBranch) if (isArray(fn)) suspense.effects.push(...fn);
2018
- else suspense.effects.push(fn);
2019
- else queuePostFlushCb(fn);
2020
- }
2021
- let currentInstance = null;
2022
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
2023
- let internalSetCurrentInstance;
2024
- {
2025
- const g = getGlobalThis();
2026
- const registerGlobalSetter = (key, setter) => {
2027
- let setters;
2028
- if (!(setters = g[key])) setters = g[key] = [];
2029
- setters.push(setter);
2030
- return (v) => {
2031
- if (setters.length > 1) setters.forEach((set) => set(v));
2032
- else setters[0](v);
2033
- };
2034
- };
2035
- internalSetCurrentInstance = registerGlobalSetter(`__VUE_INSTANCE_SETTERS__`, (v) => currentInstance = v);
2036
- registerGlobalSetter(`__VUE_SSR_SETTERS__`, (v) => isInSSRComponentSetup = v);
2037
- }
2038
- const setCurrentInstance = (instance) => {
2039
- const prev = currentInstance;
2040
- internalSetCurrentInstance(instance);
2041
- instance.scope.on();
2042
- return () => {
2043
- instance.scope.off();
2044
- internalSetCurrentInstance(prev);
2045
- };
2046
- };
2047
- function isStatefulComponent(instance) {
2048
- return instance.vnode.shapeFlag & 4;
2049
- }
2050
- let isInSSRComponentSetup = false;
2051
- function getComponentPublicInstance(instance) {
2052
- if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
2053
- get(target, key) {
2054
- if (key in target) return target[key];
2055
- else if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
2056
- },
2057
- has(target, key) {
2058
- return key in target || key in publicPropertiesMap;
2059
- }
2060
- }));
2061
- else return instance.proxy;
2062
- }
2063
- const classifyRE = /(?:^|[-_])\w/g;
2064
- const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
2065
- function getComponentName(Component, includeInferred = true) {
2066
- return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
2067
- }
2068
- function formatComponentName(instance, Component, isRoot = false) {
2069
- let name = getComponentName(Component);
2070
- if (!name && Component.__file) {
2071
- const match = Component.__file.match(/([^/\\]+)\.\w+$/);
2072
- if (match) name = match[1];
2073
- }
2074
- if (!name && instance) {
2075
- const inferFromRegistry = (registry) => {
2076
- for (const key in registry) if (registry[key] === Component) return key;
2077
- };
2078
- name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
2079
- }
2080
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
2081
- }
2082
- function isClassComponent(value) {
2083
- return isFunction(value) && "__vccOpts" in value;
2084
- }
2085
- function initCustomFormatter() {
2086
- if (typeof window === "undefined") return;
2087
- const vueStyle = { style: "color:#3ba776" };
2088
- const numberStyle = { style: "color:#1677ff" };
2089
- const stringStyle = { style: "color:#f5222d" };
2090
- const keywordStyle = { style: "color:#eb2f96" };
2091
- const formatter = {
2092
- __vue_custom_formatter: true,
2093
- header(obj) {
2094
- if (!isObject$1(obj)) return null;
2095
- if (obj.__isVue) return [
2096
- "div",
2097
- vueStyle,
2098
- `VueInstance`
2099
- ];
2100
- else if (/* @__PURE__ */ isRef(obj)) {
2101
- pauseTracking();
2102
- const value = obj.value;
2103
- resetTracking();
2104
- return [
2105
- "div",
2106
- {},
2107
- [
2108
- "span",
2109
- vueStyle,
2110
- genRefFlag(obj)
2111
- ],
2112
- "<",
2113
- formatValue(value),
2114
- `>`
2115
- ];
2116
- } else if (/* @__PURE__ */ isReactive(obj)) return [
2117
- "div",
2118
- {},
2119
- [
2120
- "span",
2121
- vueStyle,
2122
- /* @__PURE__ */ isShallow(obj) ? "ShallowReactive" : "Reactive"
2123
- ],
2124
- "<",
2125
- formatValue(obj),
2126
- `>${/* @__PURE__ */ isReadonly(obj) ? ` (readonly)` : ``}`
2127
- ];
2128
- else if (/* @__PURE__ */ isReadonly(obj)) return [
2129
- "div",
2130
- {},
2131
- [
2132
- "span",
2133
- vueStyle,
2134
- /* @__PURE__ */ isShallow(obj) ? "ShallowReadonly" : "Readonly"
2135
- ],
2136
- "<",
2137
- formatValue(obj),
2138
- ">"
2139
- ];
2140
- return null;
2141
- },
2142
- hasBody(obj) {
2143
- return obj && obj.__isVue;
2144
- },
2145
- body(obj) {
2146
- if (obj && obj.__isVue) return [
2147
- "div",
2148
- {},
2149
- ...formatInstance(obj.$)
2150
- ];
2151
- }
2152
- };
2153
- function formatInstance(instance) {
2154
- const blocks = [];
2155
- if (instance.type.props && instance.props) blocks.push(createInstanceBlock("props", /* @__PURE__ */ toRaw(instance.props)));
2156
- if (instance.setupState !== EMPTY_OBJ) blocks.push(createInstanceBlock("setup", instance.setupState));
2157
- if (instance.data !== EMPTY_OBJ) blocks.push(createInstanceBlock("data", /* @__PURE__ */ toRaw(instance.data)));
2158
- const computed = extractKeys(instance, "computed");
2159
- if (computed) blocks.push(createInstanceBlock("computed", computed));
2160
- const injected = extractKeys(instance, "inject");
2161
- if (injected) blocks.push(createInstanceBlock("injected", injected));
2162
- blocks.push([
2163
- "div",
2164
- {},
2165
- [
2166
- "span",
2167
- { style: keywordStyle.style + ";opacity:0.66" },
2168
- "$ (internal): "
2169
- ],
2170
- ["object", { object: instance }]
2171
- ]);
2172
- return blocks;
2173
- }
2174
- function createInstanceBlock(type, target) {
2175
- target = extend({}, target);
2176
- if (!Object.keys(target).length) return ["span", {}];
2177
- return [
2178
- "div",
2179
- { style: "line-height:1.25em;margin-bottom:0.6em" },
2180
- [
2181
- "div",
2182
- { style: "color:#476582" },
2183
- type
2184
- ],
2185
- [
2186
- "div",
2187
- { style: "padding-left:1.25em" },
2188
- ...Object.keys(target).map((key) => {
2189
- return [
2190
- "div",
2191
- {},
2192
- [
2193
- "span",
2194
- keywordStyle,
2195
- key + ": "
2196
- ],
2197
- formatValue(target[key], false)
2198
- ];
2199
- })
2200
- ]
2201
- ];
2202
- }
2203
- function formatValue(v, asRaw = true) {
2204
- if (typeof v === "number") return [
2205
- "span",
2206
- numberStyle,
2207
- v
2208
- ];
2209
- else if (typeof v === "string") return [
2210
- "span",
2211
- stringStyle,
2212
- JSON.stringify(v)
2213
- ];
2214
- else if (typeof v === "boolean") return [
2215
- "span",
2216
- keywordStyle,
2217
- v
2218
- ];
2219
- else if (isObject$1(v)) return ["object", { object: asRaw ? /* @__PURE__ */ toRaw(v) : v }];
2220
- else return [
2221
- "span",
2222
- stringStyle,
2223
- String(v)
2224
- ];
2225
- }
2226
- function extractKeys(instance, type) {
2227
- const Comp = instance.type;
2228
- if (isFunction(Comp)) return;
2229
- const extracted = {};
2230
- for (const key in instance.ctx) if (isKeyOfType(Comp, key, type)) extracted[key] = instance.ctx[key];
2231
- return extracted;
2232
- }
2233
- function isKeyOfType(Comp, key, type) {
2234
- const opts = Comp[type];
2235
- if (isArray(opts) && opts.includes(key) || isObject$1(opts) && key in opts) return true;
2236
- if (Comp.extends && isKeyOfType(Comp.extends, key, type)) return true;
2237
- if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) return true;
2238
- }
2239
- function genRefFlag(v) {
2240
- if (/* @__PURE__ */ isShallow(v)) return `ShallowRef`;
2241
- if (v.effect) return `ComputedRef`;
2242
- return `Ref`;
2243
- }
2244
- if (window.devtoolsFormatters) window.devtoolsFormatters.push(formatter);
2245
- else window.devtoolsFormatters = [formatter];
2246
- }
2247
- //#endregion
2248
- //#region ../../node_modules/.pnpm/vue@3.5.34_typescript@5.9.3/node_modules/vue/dist/vue.runtime.esm-bundler.js
2249
- /**
2250
- * vue v3.5.34
2251
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
2252
- * @license MIT
2253
- **/
2254
- function initDev() {
2255
- initCustomFormatter();
2256
- }
2257
- initDev();
2258
- //#endregion
2259
198
  //#region src/util/reactivity/getRawData.ts
2260
- const getRawData = (data) => /* @__PURE__ */ isReactive(data) ? /* @__PURE__ */ toRaw(data) : data;
2261
- typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
2262
- const toString = Object.prototype.toString;
2263
- const isObject = (val) => toString.call(val) === "[object Object]";
199
+ const getRawData = (data) => isReactive(data) ? toRaw(data) : data;
2264
200
  //#endregion
2265
201
  //#region src/util/reactivity/toRawDeep.ts
2266
202
  const toRawDeep = (data) => {
@@ -2454,13 +390,13 @@ var ResultAsync = class ResultAsync {
2454
390
  }
2455
391
  static fromThrowable(fn, errorFn) {
2456
392
  return (...args) => {
2457
- return new ResultAsync(__awaiter(this, void 0, void 0, function* () {
393
+ return new ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
2458
394
  try {
2459
395
  return new Ok(yield fn(...args));
2460
396
  } catch (error) {
2461
397
  return new Err(errorFn ? errorFn(error) : error);
2462
398
  }
2463
- }));
399
+ }))());
2464
400
  };
2465
401
  }
2466
402
  static combine(asyncResultList) {
@@ -2783,6 +719,7 @@ const withFinalizerAsync = async (fn, finalizer) => {
2783
719
  //#endregion
2784
720
  //#region src/services/message/constants.ts
2785
721
  const MENTION_ID_ATTRIBUTE = "data-id";
722
+ const MENTION_ITEM_TYPE_ATTRIBUTE = "data-mention-type";
2786
723
  const MENTION_LABEL_ATTRIBUTE = "data-label";
2787
724
  const MENTION_TYPE_ATTRIBUTE = "data-type";
2788
725
  const MENTION_TYPE = "mention";
@@ -8188,7 +6125,7 @@ var require_encode_html = /* @__PURE__ */ __commonJSMin(((exports) => {
8188
6125
  for (var i = 1; i < arr.length; i++) arr[i][0] += arr[i - 1][0] + 1;
8189
6126
  return arr;
8190
6127
  }
8191
- exports.default = new Map(/* @__PURE__ */ restoreDiff([
6128
+ exports.default = new Map(/* #__PURE__ */ restoreDiff([
8192
6129
  [9, "&Tab;"],
8193
6130
  [0, "&NewLine;"],
8194
6131
  [22, "&excl;"],
@@ -8981,11 +6918,11 @@ var require_encode_html = /* @__PURE__ */ __commonJSMin(((exports) => {
8981
6918
  }],
8982
6919
  [0, {
8983
6920
  v: "&ll;",
8984
- n: new Map(/* @__PURE__ */ restoreDiff([[824, "&nLtv;"], [7577, "&nLt;"]]))
6921
+ n: new Map(/* #__PURE__ */ restoreDiff([[824, "&nLtv;"], [7577, "&nLt;"]]))
8985
6922
  }],
8986
6923
  [0, {
8987
6924
  v: "&gg;",
8988
- n: new Map(/* @__PURE__ */ restoreDiff([[824, "&nGtv;"], [7577, "&nGt;"]]))
6925
+ n: new Map(/* #__PURE__ */ restoreDiff([[824, "&nGtv;"], [7577, "&nGt;"]]))
8989
6926
  }],
8990
6927
  [0, "&between;"],
8991
6928
  [0, "&NotCupCap;"],
@@ -9747,7 +7684,7 @@ var require_encode_html = /* @__PURE__ */ __commonJSMin(((exports) => {
9747
7684
  n: 8421,
9748
7685
  o: "&nparsl;"
9749
7686
  }],
9750
- [44343, { n: new Map(/* @__PURE__ */ restoreDiff([
7687
+ [44343, { n: new Map(/* #__PURE__ */ restoreDiff([
9751
7688
  [56476, "&Ascr;"],
9752
7689
  [1, "&Cscr;"],
9753
7690
  [0, "&Dscr;"],
@@ -14775,6 +12712,20 @@ var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
14775
12712
  })))();
14776
12713
  const getMentions = (message) => (0, import_dist.parse)(message).querySelectorAll(`span[${MENTION_TYPE_ATTRIBUTE}='${MENTION_TYPE}']`);
14777
12714
  //#endregion
12715
+ //#region src/services/message/classifyMentions.ts
12716
+ const BROADCAST_MENTION_IDS = new Set([MENTION_EVERYONE_ID, MENTION_HERE_ID]);
12717
+ const classifyMentions = (message) => {
12718
+ const mentions = getMentions(message).map((m) => ({
12719
+ id: m.getAttribute(MENTION_ID_ATTRIBUTE),
12720
+ type: m.getAttribute(MENTION_ITEM_TYPE_ATTRIBUTE)
12721
+ })).filter((m) => Boolean(m.id));
12722
+ return {
12723
+ broadcastIds: mentions.filter(({ id }) => BROADCAST_MENTION_IDS.has(id)).map(({ id }) => id),
12724
+ regularUserIds: mentions.filter(({ id, type }) => !BROADCAST_MENTION_IDS.has(id) && type !== "role").map(({ id }) => id),
12725
+ roleIds: mentions.filter(({ type }) => type === "role").map(({ id }) => id)
12726
+ };
12727
+ };
12728
+ //#endregion
14778
12729
  //#region src/services/prettier/css.ts
14779
12730
  const css = String.raw;
14780
12731
  //#endregion
@@ -14799,16 +12750,16 @@ const getIsServer = () => typeof window === "undefined";
14799
12750
  //#region src/util/id/constants.ts
14800
12751
  const ID_SEPARATOR = "|";
14801
12752
  //#endregion
14802
- //#region src/util/object/isPlainObject.ts
14803
- const isPlainObject = (data) => {
12753
+ //#region src/util/object/checkIsPlainObject.ts
12754
+ const checkIsPlainObject = (data) => {
14804
12755
  if (typeof data !== "object" || data === null) return false;
14805
12756
  const prototype = Object.getPrototypeOf(data);
14806
12757
  return prototype === null || prototype === Object.prototype;
14807
12758
  };
14808
12759
  //#endregion
14809
12760
  //#region src/util/object/jsonDateParse.ts
14810
- const ISO_DATE_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.{0,1}\d*))(?:Z|(\+|-)([\d|:]*))?$/u;
14811
- const MS_AJAX_DATE_REGEX = /^\/Date\((-?\d+(?:[-+]\d+)?)\)[/\\]$/u;
12761
+ const ISO_DATE_REGEX = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2}(?:\.{0,1}\d*))(?:Z|(?<sign>\+|-)(?<offset>[\d|:]*))?$/u;
12762
+ const MS_AJAX_DATE_REGEX = /^\/Date\((?<timestamp>-?\d+(?:[-+]\d+)?)\)[/\\]$/u;
14812
12763
  const jsonDateParse = (text) => JSON.parse(text, (_key, value) => {
14813
12764
  let parsedValue = value;
14814
12765
  if (typeof value === "string") {
@@ -14828,14 +12779,12 @@ const jsonDateParse = (text) => JSON.parse(text, (_key, value) => {
14828
12779
  //#region src/util/object/mergeObjectsStrict.ts
14829
12780
  const mergeObjectsStrict = (...objects) => Object.assign({}, ...objects);
14830
12781
  //#endregion
14831
- //#region src/util/regex/escapeRegExp.ts
14832
- const escapeRegExp = (string) => string.replaceAll(/[.*+?^${}()|[\]\\]/gu, String.raw`\$&`);
14833
- //#endregion
14834
12782
  //#region src/util/text/capitalize.ts
14835
12783
  const capitalize = (string) => `${string.charAt(0).toUpperCase()}${string.slice(1)}`;
14836
12784
  //#endregion
14837
12785
  //#region src/util/text/normalizeString.ts
14838
12786
  const normalizeString = (value) => value?.trim() ?? "";
12787
+ const createNormalizedStringSchema = (maxLength, schema = z.string()) => schema.transform(normalizeString).pipe(z.string().max(maxLength));
14839
12788
  //#endregion
14840
12789
  //#region src/util/text/streamToText.ts
14841
12790
  const streamToText = async (readable) => {
@@ -14881,6 +12830,9 @@ const exhaustiveGuard = (value) => {
14881
12830
  throw new InvalidOperationError("Read", exhaustiveGuard.name, JSON.stringify(value));
14882
12831
  };
14883
12832
  //#endregion
12833
+ //#region src/util/zod/createUniqueArraySchema.ts
12834
+ const createUniqueArraySchema = (schema, key) => schema.array().refine((array) => new Set(key === void 0 ? array : array.map((item) => item[key])).size === array.length, "Array items must be unique");
12835
+ //#endregion
14884
12836
  //#region src/util/id/uuid/constants.ts
14885
12837
  const NIL = "00000000-0000-0000-0000-000000000000";
14886
12838
  const UUIDV4_REGEX = /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/iu;
@@ -14888,4 +12840,4 @@ const UUIDV4_REGEX = /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-
14888
12840
  //#region src/util/id/uuid/uuidValidateV4.ts
14889
12841
  const uuidValidateV4 = (uuid) => UUIDV4_REGEX.test(uuid);
14890
12842
  //#endregion
14891
- export { AllSpecialValues, ForbiddenError, ID_SEPARATOR, InvalidOperationError, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, NIL, NotFoundError, NotInitializedError, Operation, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, UUIDV4_REGEX, applyItemMetadataMixin, capitalize, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, getResult, getResultAsync, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4, withFinalizer, withFinalizerAsync };
12843
+ export { AllSpecialValues, ForbiddenError, ID_SEPARATOR, InvalidOperationError, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, MAX_READ_LIMIT, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MentionType, NIL, NotFoundError, NotInitializedError, Operation, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, UUIDV4_REGEX, applyItemMetadataMixin, capitalize, checkIsPlainObject, classifyMentions, createItemEntityTypeSchema, createNormalizedStringSchema, createUniqueArraySchema, css, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, getResult, getResultAsync, hrtime, html, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4, withFinalizer, withFinalizerAsync };