page-agent-sdk 2.38.0 → 2.38.1
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/README.md +1 -1
- package/README.zh-CN.md +3 -3
- package/dist/page-agent-sdk.headless.js +101 -86
- package/dist/page-agent-sdk.iife.js +7 -7
- package/dist/page-agent-sdk.js +532 -517
- package/dist/page-agent-sdk.umd.cjs +15 -15
- package/package.json +2 -1
- package/types/headless.d.ts +8 -2
- package/types/index.d.ts +8 -2
package/dist/page-agent-sdk.js
CHANGED
|
@@ -280,7 +280,7 @@ var We, Ge = class {
|
|
|
280
280
|
function Ke() {
|
|
281
281
|
return We;
|
|
282
282
|
}
|
|
283
|
-
var
|
|
283
|
+
var qe, Je = /* @__PURE__ */ new WeakSet(), Ye = class {
|
|
284
284
|
constructor(e) {
|
|
285
285
|
this.fn = e, this.deps = void 0, this.depsTail = void 0, this.flags = 5, this.next = void 0, this.cleanup = void 0, this.scheduler = void 0, We && (We.active ? We.effects.push(this) : this.flags &= -2);
|
|
286
286
|
}
|
|
@@ -288,61 +288,61 @@ var W, qe = /* @__PURE__ */ new WeakSet(), Je = class {
|
|
|
288
288
|
this.flags |= 64;
|
|
289
289
|
}
|
|
290
290
|
resume() {
|
|
291
|
-
this.flags & 64 && (this.flags &= -65,
|
|
291
|
+
this.flags & 64 && (this.flags &= -65, Je.has(this) && (Je.delete(this), this.trigger()));
|
|
292
292
|
}
|
|
293
293
|
notify() {
|
|
294
|
-
this.flags & 2 && !(this.flags & 32) || this.flags & 8 ||
|
|
294
|
+
this.flags & 2 && !(this.flags & 32) || this.flags & 8 || $e(this);
|
|
295
295
|
}
|
|
296
296
|
run() {
|
|
297
297
|
if (!(this.flags & 1)) return this.fn();
|
|
298
|
-
this.flags |= 2,
|
|
299
|
-
let e =
|
|
300
|
-
|
|
298
|
+
this.flags |= 2, dt(this), nt(this);
|
|
299
|
+
let e = qe, t = st;
|
|
300
|
+
qe = this, st = !0;
|
|
301
301
|
try {
|
|
302
302
|
return this.fn();
|
|
303
303
|
} finally {
|
|
304
|
-
process.env.NODE_ENV !== "production" &&
|
|
304
|
+
process.env.NODE_ENV !== "production" && qe !== this && Ue("Active effect was not restored correctly - this is likely a Vue internal bug."), W(this), qe = e, st = t, this.flags &= -3;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
stop() {
|
|
308
308
|
if (this.flags & 1) {
|
|
309
|
-
for (let e = this.deps; e; e = e.nextDep)
|
|
310
|
-
this.deps = this.depsTail = void 0,
|
|
309
|
+
for (let e = this.deps; e; e = e.nextDep) at(e);
|
|
310
|
+
this.deps = this.depsTail = void 0, dt(this), this.onStop && this.onStop(), this.flags &= -2;
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
trigger() {
|
|
314
|
-
this.flags & 64 ?
|
|
314
|
+
this.flags & 64 ? Je.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty();
|
|
315
315
|
}
|
|
316
316
|
runIfDirty() {
|
|
317
|
-
|
|
317
|
+
rt(this) && this.run();
|
|
318
318
|
}
|
|
319
319
|
get dirty() {
|
|
320
|
-
return
|
|
320
|
+
return rt(this);
|
|
321
321
|
}
|
|
322
|
-
},
|
|
323
|
-
function
|
|
322
|
+
}, Xe = 0, Ze, Qe;
|
|
323
|
+
function $e(e, t = !1) {
|
|
324
324
|
if (e.flags |= 8, t) {
|
|
325
|
-
e.next =
|
|
325
|
+
e.next = Qe, Qe = e;
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
|
-
e.next =
|
|
329
|
-
}
|
|
330
|
-
function $e() {
|
|
331
|
-
Ye++;
|
|
328
|
+
e.next = Ze, Ze = e;
|
|
332
329
|
}
|
|
333
330
|
function et() {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
331
|
+
Xe++;
|
|
332
|
+
}
|
|
333
|
+
function tt() {
|
|
334
|
+
if (--Xe > 0) return;
|
|
335
|
+
if (Qe) {
|
|
336
|
+
let e = Qe;
|
|
337
|
+
for (Qe = void 0; e;) {
|
|
338
338
|
let t = e.next;
|
|
339
339
|
e.next = void 0, e.flags &= -9, e = t;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
let e;
|
|
343
|
-
for (;
|
|
344
|
-
let t =
|
|
345
|
-
for (
|
|
343
|
+
for (; Ze;) {
|
|
344
|
+
let t = Ze;
|
|
345
|
+
for (Ze = void 0; t;) {
|
|
346
346
|
let n = t.next;
|
|
347
347
|
if (t.next = void 0, t.flags &= -9, t.flags & 1) try {
|
|
348
348
|
t.trigger();
|
|
@@ -354,127 +354,127 @@ function et() {
|
|
|
354
354
|
}
|
|
355
355
|
if (e) throw e;
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function nt(e) {
|
|
358
358
|
for (let t = e.deps; t; t = t.nextDep) t.version = -1, t.prevActiveLink = t.dep.activeLink, t.dep.activeLink = t;
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function W(e) {
|
|
361
361
|
let t, n = e.depsTail, r = n;
|
|
362
362
|
for (; r;) {
|
|
363
363
|
let e = r.prevDep;
|
|
364
|
-
r.version === -1 ? (r === n && (n = e),
|
|
364
|
+
r.version === -1 ? (r === n && (n = e), at(r), ot(r)) : t = r, r.dep.activeLink = r.prevActiveLink, r.prevActiveLink = void 0, r = e;
|
|
365
365
|
}
|
|
366
366
|
e.deps = t, e.depsTail = n;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
for (let t = e.deps; t; t = t.nextDep) if (t.dep.version !== t.version || t.dep.computed && (
|
|
368
|
+
function rt(e) {
|
|
369
|
+
for (let t = e.deps; t; t = t.nextDep) if (t.dep.version !== t.version || t.dep.computed && (it(t.dep.computed) || t.dep.version !== t.version)) return !0;
|
|
370
370
|
return !!e._dirty;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion ===
|
|
372
|
+
function it(e) {
|
|
373
|
+
if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion === ft) || (e.globalVersion = ft, !e.isSSR && e.flags & 128 && (!e.deps && !e._dirty || !rt(e)))) return;
|
|
374
374
|
e.flags |= 2;
|
|
375
|
-
let t = e.dep, n =
|
|
376
|
-
|
|
375
|
+
let t = e.dep, n = qe, r = st;
|
|
376
|
+
qe = e, st = !0;
|
|
377
377
|
try {
|
|
378
|
-
|
|
378
|
+
nt(e);
|
|
379
379
|
let n = e.fn(e._value);
|
|
380
380
|
(t.version === 0 || _e(n, e._value)) && (e.flags |= 128, e._value = n, t.version++);
|
|
381
381
|
} catch (e) {
|
|
382
382
|
throw t.version++, e;
|
|
383
383
|
} finally {
|
|
384
|
-
|
|
384
|
+
qe = n, st = r, W(e), e.flags &= -3;
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function at(e, t = !1) {
|
|
388
388
|
let { dep: n, prevSub: r, nextSub: i } = e;
|
|
389
389
|
if (r && (r.nextSub = i, e.prevSub = void 0), i && (i.prevSub = r, e.nextSub = void 0), process.env.NODE_ENV !== "production" && n.subsHead === e && (n.subsHead = i), n.subs === e && (n.subs = r, !r && n.computed)) {
|
|
390
390
|
n.computed.flags &= -5;
|
|
391
|
-
for (let e = n.computed.deps; e; e = e.nextDep)
|
|
391
|
+
for (let e = n.computed.deps; e; e = e.nextDep) at(e, !0);
|
|
392
392
|
}
|
|
393
393
|
!t && !--n.sc && n.map && n.map.delete(n.key);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function ot(e) {
|
|
396
396
|
let { prevDep: t, nextDep: n } = e;
|
|
397
397
|
t && (t.nextDep = n, e.prevDep = void 0), n && (n.prevDep = t, e.nextDep = void 0);
|
|
398
398
|
}
|
|
399
|
-
var
|
|
400
|
-
function ct() {
|
|
401
|
-
st.push(ot), ot = !1;
|
|
402
|
-
}
|
|
399
|
+
var st = !0, ct = [];
|
|
403
400
|
function lt() {
|
|
404
|
-
|
|
405
|
-
|
|
401
|
+
ct.push(st), st = !1;
|
|
402
|
+
}
|
|
403
|
+
function ut() {
|
|
404
|
+
let e = ct.pop();
|
|
405
|
+
st = e === void 0 || e;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function dt(e) {
|
|
408
408
|
let { cleanup: t } = e;
|
|
409
409
|
if (e.cleanup = void 0, t) {
|
|
410
|
-
let e =
|
|
411
|
-
|
|
410
|
+
let e = qe;
|
|
411
|
+
qe = void 0;
|
|
412
412
|
try {
|
|
413
413
|
t();
|
|
414
414
|
} finally {
|
|
415
|
-
|
|
415
|
+
qe = e;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
var
|
|
419
|
+
var ft = 0, pt = class {
|
|
420
420
|
constructor(e, t) {
|
|
421
421
|
this.sub = e, this.dep = t, this.version = t.version, this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
|
|
422
422
|
}
|
|
423
|
-
},
|
|
423
|
+
}, mt = class {
|
|
424
424
|
constructor(e) {
|
|
425
425
|
this.computed = e, this.version = 0, this.activeLink = void 0, this.subs = void 0, this.map = void 0, this.key = void 0, this.sc = 0, this.__v_skip = !0, process.env.NODE_ENV !== "production" && (this.subsHead = void 0);
|
|
426
426
|
}
|
|
427
427
|
track(e) {
|
|
428
|
-
if (!
|
|
428
|
+
if (!qe || !st || qe === this.computed) return;
|
|
429
429
|
let t = this.activeLink;
|
|
430
|
-
if (t === void 0 || t.sub !==
|
|
430
|
+
if (t === void 0 || t.sub !== qe) t = this.activeLink = new pt(qe, this), qe.deps ? (t.prevDep = qe.depsTail, qe.depsTail.nextDep = t, qe.depsTail = t) : qe.deps = qe.depsTail = t, ht(t);
|
|
431
431
|
else if (t.version === -1 && (t.version = this.version, t.nextDep)) {
|
|
432
432
|
let e = t.nextDep;
|
|
433
|
-
e.prevDep = t.prevDep, t.prevDep && (t.prevDep.nextDep = e), t.prevDep =
|
|
433
|
+
e.prevDep = t.prevDep, t.prevDep && (t.prevDep.nextDep = e), t.prevDep = qe.depsTail, t.nextDep = void 0, qe.depsTail.nextDep = t, qe.depsTail = t, qe.deps === t && (qe.deps = e);
|
|
434
434
|
}
|
|
435
|
-
return process.env.NODE_ENV !== "production" &&
|
|
435
|
+
return process.env.NODE_ENV !== "production" && qe.onTrack && qe.onTrack(M({ effect: qe }, e)), t;
|
|
436
436
|
}
|
|
437
437
|
trigger(e) {
|
|
438
|
-
this.version++,
|
|
438
|
+
this.version++, ft++, this.notify(e);
|
|
439
439
|
}
|
|
440
440
|
notify(e) {
|
|
441
|
-
|
|
441
|
+
et();
|
|
442
442
|
try {
|
|
443
443
|
if (process.env.NODE_ENV !== "production") for (let t = this.subsHead; t; t = t.nextSub) t.sub.onTrigger && !(t.sub.flags & 8) && t.sub.onTrigger(M({ effect: t.sub }, e));
|
|
444
444
|
for (let e = this.subs; e; e = e.prevSub) e.sub.notify() && e.sub.dep.notify();
|
|
445
445
|
} finally {
|
|
446
|
-
|
|
446
|
+
tt();
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
};
|
|
450
|
-
function
|
|
450
|
+
function ht(e) {
|
|
451
451
|
if (e.dep.sc++, e.sub.flags & 4) {
|
|
452
452
|
let t = e.dep.computed;
|
|
453
453
|
if (t && !e.dep.subs) {
|
|
454
454
|
t.flags |= 20;
|
|
455
|
-
for (let e = t.deps; e; e = e.nextDep)
|
|
455
|
+
for (let e = t.deps; e; e = e.nextDep) ht(e);
|
|
456
456
|
}
|
|
457
457
|
let n = e.dep.subs;
|
|
458
458
|
n !== e && (e.prevSub = n, n && (n.nextSub = e)), process.env.NODE_ENV !== "production" && e.dep.subsHead === void 0 && (e.dep.subsHead = e), e.dep.subs = e;
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var
|
|
462
|
-
function
|
|
463
|
-
if (
|
|
464
|
-
let r =
|
|
465
|
-
r ||
|
|
461
|
+
var gt = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Object iterate"), vt = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Map keys iterate"), yt = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Array iterate");
|
|
462
|
+
function bt(e, t, n) {
|
|
463
|
+
if (st && qe) {
|
|
464
|
+
let r = gt.get(e);
|
|
465
|
+
r || gt.set(e, r = /* @__PURE__ */ new Map());
|
|
466
466
|
let i = r.get(n);
|
|
467
|
-
i || (r.set(n, i = new
|
|
467
|
+
i || (r.set(n, i = new mt()), i.map = r, i.key = n), process.env.NODE_ENV === "production" ? i.track() : i.track({
|
|
468
468
|
target: e,
|
|
469
469
|
type: t,
|
|
470
470
|
key: n
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
let o =
|
|
474
|
+
function xt(e, t, n, r, i, a) {
|
|
475
|
+
let o = gt.get(e);
|
|
476
476
|
if (!o) {
|
|
477
|
-
|
|
477
|
+
ft++;
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
480
|
let s = (o) => {
|
|
@@ -487,173 +487,173 @@ function bt(e, t, n, r, i, a) {
|
|
|
487
487
|
oldTarget: a
|
|
488
488
|
}));
|
|
489
489
|
};
|
|
490
|
-
if (
|
|
490
|
+
if (et(), t === "clear") o.forEach(s);
|
|
491
491
|
else {
|
|
492
492
|
let i = I(e), a = i && se(n);
|
|
493
493
|
if (i && n === "length") {
|
|
494
494
|
let e = Number(r);
|
|
495
495
|
o.forEach((t, n) => {
|
|
496
|
-
(n === "length" || n ===
|
|
496
|
+
(n === "length" || n === yt || !ne(n) && n >= e) && s(t);
|
|
497
497
|
});
|
|
498
|
-
} else switch ((n !== void 0 || o.has(void 0)) && s(o.get(n)), a && s(o.get(
|
|
498
|
+
} else switch ((n !== void 0 || o.has(void 0)) && s(o.get(n)), a && s(o.get(yt)), t) {
|
|
499
499
|
case "add":
|
|
500
|
-
i ? a && s(o.get("length")) : (s(o.get(
|
|
500
|
+
i ? a && s(o.get("length")) : (s(o.get(_t)), L(e) && s(o.get(vt)));
|
|
501
501
|
break;
|
|
502
502
|
case "delete":
|
|
503
|
-
i || (s(o.get(
|
|
503
|
+
i || (s(o.get(_t)), L(e) && s(o.get(vt)));
|
|
504
504
|
break;
|
|
505
505
|
case "set":
|
|
506
|
-
L(e) && s(o.get(
|
|
506
|
+
L(e) && s(o.get(_t));
|
|
507
507
|
break;
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
|
|
511
|
-
}
|
|
512
|
-
function xt(e) {
|
|
513
|
-
let t = /* @__PURE__ */ pn(e);
|
|
514
|
-
return t === e ? t : (yt(t, "iterate", vt), /* @__PURE__ */ dn(e) ? t : t.map(hn));
|
|
510
|
+
tt();
|
|
515
511
|
}
|
|
516
512
|
function St(e) {
|
|
517
|
-
|
|
513
|
+
let t = /* @__PURE__ */ G(e);
|
|
514
|
+
return t === e ? t : (bt(t, "iterate", yt), /* @__PURE__ */ fn(e) ? t : t.map(hn));
|
|
515
|
+
}
|
|
516
|
+
function Ct(e) {
|
|
517
|
+
return bt(e = /* @__PURE__ */ G(e), "iterate", yt), e;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return /* @__PURE__ */
|
|
519
|
+
function wt(e, t) {
|
|
520
|
+
return /* @__PURE__ */ dn(e) ? gn(/* @__PURE__ */ un(e) ? hn(t) : t) : hn(t);
|
|
521
521
|
}
|
|
522
|
-
var
|
|
522
|
+
var Tt = {
|
|
523
523
|
__proto__: null,
|
|
524
524
|
[Symbol.iterator]() {
|
|
525
|
-
return
|
|
525
|
+
return Et(this, Symbol.iterator, (e) => wt(this, e));
|
|
526
526
|
},
|
|
527
527
|
concat(...e) {
|
|
528
|
-
return
|
|
528
|
+
return St(this).concat(...e.map((e) => I(e) ? St(e) : e));
|
|
529
529
|
},
|
|
530
530
|
entries() {
|
|
531
|
-
return
|
|
531
|
+
return Et(this, "entries", (e) => (e[1] = wt(this, e[1]), e));
|
|
532
532
|
},
|
|
533
533
|
every(e, t) {
|
|
534
|
-
return
|
|
534
|
+
return Ot(this, "every", e, t, void 0, arguments);
|
|
535
535
|
},
|
|
536
536
|
filter(e, t) {
|
|
537
|
-
return
|
|
537
|
+
return Ot(this, "filter", e, t, (e) => e.map((e) => wt(this, e)), arguments);
|
|
538
538
|
},
|
|
539
539
|
find(e, t) {
|
|
540
|
-
return
|
|
540
|
+
return Ot(this, "find", e, t, (e) => wt(this, e), arguments);
|
|
541
541
|
},
|
|
542
542
|
findIndex(e, t) {
|
|
543
|
-
return
|
|
543
|
+
return Ot(this, "findIndex", e, t, void 0, arguments);
|
|
544
544
|
},
|
|
545
545
|
findLast(e, t) {
|
|
546
|
-
return
|
|
546
|
+
return Ot(this, "findLast", e, t, (e) => wt(this, e), arguments);
|
|
547
547
|
},
|
|
548
548
|
findLastIndex(e, t) {
|
|
549
|
-
return
|
|
549
|
+
return Ot(this, "findLastIndex", e, t, void 0, arguments);
|
|
550
550
|
},
|
|
551
551
|
forEach(e, t) {
|
|
552
|
-
return
|
|
552
|
+
return Ot(this, "forEach", e, t, void 0, arguments);
|
|
553
553
|
},
|
|
554
554
|
includes(...e) {
|
|
555
|
-
return
|
|
555
|
+
return At(this, "includes", e);
|
|
556
556
|
},
|
|
557
557
|
indexOf(...e) {
|
|
558
|
-
return
|
|
558
|
+
return At(this, "indexOf", e);
|
|
559
559
|
},
|
|
560
560
|
join(e) {
|
|
561
|
-
return
|
|
561
|
+
return St(this).join(e);
|
|
562
562
|
},
|
|
563
563
|
lastIndexOf(...e) {
|
|
564
|
-
return
|
|
564
|
+
return At(this, "lastIndexOf", e);
|
|
565
565
|
},
|
|
566
566
|
map(e, t) {
|
|
567
|
-
return
|
|
567
|
+
return Ot(this, "map", e, t, void 0, arguments);
|
|
568
568
|
},
|
|
569
569
|
pop() {
|
|
570
|
-
return
|
|
570
|
+
return jt(this, "pop");
|
|
571
571
|
},
|
|
572
572
|
push(...e) {
|
|
573
|
-
return
|
|
573
|
+
return jt(this, "push", e);
|
|
574
574
|
},
|
|
575
575
|
reduce(e, ...t) {
|
|
576
|
-
return
|
|
576
|
+
return kt(this, "reduce", e, t);
|
|
577
577
|
},
|
|
578
578
|
reduceRight(e, ...t) {
|
|
579
|
-
return
|
|
579
|
+
return kt(this, "reduceRight", e, t);
|
|
580
580
|
},
|
|
581
581
|
shift() {
|
|
582
|
-
return
|
|
582
|
+
return jt(this, "shift");
|
|
583
583
|
},
|
|
584
584
|
some(e, t) {
|
|
585
|
-
return
|
|
585
|
+
return Ot(this, "some", e, t, void 0, arguments);
|
|
586
586
|
},
|
|
587
587
|
splice(...e) {
|
|
588
|
-
return
|
|
588
|
+
return jt(this, "splice", e);
|
|
589
589
|
},
|
|
590
590
|
toReversed() {
|
|
591
|
-
return
|
|
591
|
+
return St(this).toReversed();
|
|
592
592
|
},
|
|
593
593
|
toSorted(e) {
|
|
594
|
-
return
|
|
594
|
+
return St(this).toSorted(e);
|
|
595
595
|
},
|
|
596
596
|
toSpliced(...e) {
|
|
597
|
-
return
|
|
597
|
+
return St(this).toSpliced(...e);
|
|
598
598
|
},
|
|
599
599
|
unshift(...e) {
|
|
600
|
-
return
|
|
600
|
+
return jt(this, "unshift", e);
|
|
601
601
|
},
|
|
602
602
|
values() {
|
|
603
|
-
return
|
|
603
|
+
return Et(this, "values", (e) => wt(this, e));
|
|
604
604
|
}
|
|
605
605
|
};
|
|
606
|
-
function
|
|
607
|
-
let r =
|
|
608
|
-
return r !== e && !/* @__PURE__ */
|
|
606
|
+
function Et(e, t, n) {
|
|
607
|
+
let r = Ct(e), i = r[t]();
|
|
608
|
+
return r !== e && !/* @__PURE__ */ fn(e) && (i._next = i.next, i.next = () => {
|
|
609
609
|
let e = i._next();
|
|
610
610
|
return e.done || (e.value = n(e.value)), e;
|
|
611
611
|
}), i;
|
|
612
612
|
}
|
|
613
|
-
var
|
|
614
|
-
function
|
|
615
|
-
let o =
|
|
616
|
-
if (c !==
|
|
613
|
+
var Dt = Array.prototype;
|
|
614
|
+
function Ot(e, t, n, r, i, a) {
|
|
615
|
+
let o = Ct(e), s = o !== e && !/* @__PURE__ */ fn(e), c = o[t];
|
|
616
|
+
if (c !== Dt[t]) {
|
|
617
617
|
let t = c.apply(e, a);
|
|
618
618
|
return s ? hn(t) : t;
|
|
619
619
|
}
|
|
620
620
|
let l = n;
|
|
621
621
|
o !== e && (s ? l = function(t, r) {
|
|
622
|
-
return n.call(this,
|
|
622
|
+
return n.call(this, wt(e, t), r, e);
|
|
623
623
|
} : n.length > 2 && (l = function(t, r) {
|
|
624
624
|
return n.call(this, t, r, e);
|
|
625
625
|
}));
|
|
626
626
|
let u = c.call(o, l, r);
|
|
627
627
|
return s && i ? i(u) : u;
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
let i =
|
|
629
|
+
function kt(e, t, n, r) {
|
|
630
|
+
let i = Ct(e), a = i !== e && !/* @__PURE__ */ fn(e), o = n, s = !1;
|
|
631
631
|
i !== e && (a ? (s = r.length === 0, o = function(t, r, i) {
|
|
632
|
-
return s && (s = !1, t =
|
|
632
|
+
return s && (s = !1, t = wt(e, t)), n.call(this, t, wt(e, r), i, e);
|
|
633
633
|
}) : n.length > 3 && (o = function(t, r, i) {
|
|
634
634
|
return n.call(this, t, r, i, e);
|
|
635
635
|
}));
|
|
636
636
|
let c = i[t](o, ...r);
|
|
637
|
-
return s ?
|
|
637
|
+
return s ? wt(e, c) : c;
|
|
638
638
|
}
|
|
639
|
-
function
|
|
640
|
-
let r = /* @__PURE__ */
|
|
641
|
-
|
|
639
|
+
function At(e, t, n) {
|
|
640
|
+
let r = /* @__PURE__ */ G(e);
|
|
641
|
+
bt(r, "iterate", yt);
|
|
642
642
|
let i = r[t](...n);
|
|
643
|
-
return (i === -1 || i === !1) && /* @__PURE__ */
|
|
643
|
+
return (i === -1 || i === !1) && /* @__PURE__ */ pn(n[0]) ? (n[0] = /* @__PURE__ */ G(n[0]), r[t](...n)) : i;
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
|
|
647
|
-
let r = (/* @__PURE__ */
|
|
648
|
-
return
|
|
645
|
+
function jt(e, t, n = []) {
|
|
646
|
+
lt(), et();
|
|
647
|
+
let r = (/* @__PURE__ */ G(e))[t].apply(e, n);
|
|
648
|
+
return tt(), ut(), r;
|
|
649
649
|
}
|
|
650
|
-
var
|
|
651
|
-
function
|
|
650
|
+
var Mt = /* @__PURE__ */ T("__proto__,__v_isRef,__isVue"), Nt = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(ne));
|
|
651
|
+
function Pt(e) {
|
|
652
652
|
ne(e) || (e = String(e));
|
|
653
|
-
let t = /* @__PURE__ */
|
|
654
|
-
return
|
|
653
|
+
let t = /* @__PURE__ */ G(this);
|
|
654
|
+
return bt(t, "has", e), t.hasOwnProperty(e);
|
|
655
655
|
}
|
|
656
|
-
var
|
|
656
|
+
var Ft = class {
|
|
657
657
|
constructor(e = !1, t = !1) {
|
|
658
658
|
this._isReadonly = e, this._isShallow = t;
|
|
659
659
|
}
|
|
@@ -663,46 +663,46 @@ var Pt = class {
|
|
|
663
663
|
if (t === "__v_isReactive") return !r;
|
|
664
664
|
if (t === "__v_isReadonly") return r;
|
|
665
665
|
if (t === "__v_isShallow") return i;
|
|
666
|
-
if (t === "__v_raw") return n === (r ? i ?
|
|
666
|
+
if (t === "__v_raw") return n === (r ? i ? nn : tn : i ? en : $t).get(e) || Object.getPrototypeOf(e) === Object.getPrototypeOf(n) ? e : void 0;
|
|
667
667
|
let a = I(e);
|
|
668
668
|
if (!r) {
|
|
669
669
|
let e;
|
|
670
|
-
if (a && (e =
|
|
671
|
-
if (t === "hasOwnProperty") return
|
|
670
|
+
if (a && (e = Tt[t])) return e;
|
|
671
|
+
if (t === "hasOwnProperty") return Pt;
|
|
672
672
|
}
|
|
673
673
|
let o = Reflect.get(e, t, /* @__PURE__ */ _n(e) ? e : n);
|
|
674
|
-
if ((ne(t) ?
|
|
674
|
+
if ((ne(t) ? Nt.has(t) : Mt(t)) || (r || bt(e, "get", t), i)) return o;
|
|
675
675
|
if (/* @__PURE__ */ _n(o)) {
|
|
676
676
|
let e = a && se(t) ? o : o.value;
|
|
677
|
-
return r && B(e) ? /* @__PURE__ */
|
|
677
|
+
return r && B(e) ? /* @__PURE__ */ sn(e) : e;
|
|
678
678
|
}
|
|
679
|
-
return B(o) ? r ? /* @__PURE__ */
|
|
679
|
+
return B(o) ? r ? /* @__PURE__ */ sn(o) : /* @__PURE__ */ an(o) : o;
|
|
680
680
|
}
|
|
681
|
-
},
|
|
681
|
+
}, It = class extends Ft {
|
|
682
682
|
constructor(e = !1) {
|
|
683
683
|
super(!1, e);
|
|
684
684
|
}
|
|
685
685
|
set(e, t, n, r) {
|
|
686
686
|
let i = e[t], a = I(e) && se(t);
|
|
687
687
|
if (!this._isShallow) {
|
|
688
|
-
let r = /* @__PURE__ */
|
|
689
|
-
if (!/* @__PURE__ */
|
|
688
|
+
let r = /* @__PURE__ */ dn(i);
|
|
689
|
+
if (!/* @__PURE__ */ fn(n) && !/* @__PURE__ */ dn(n) && (i = /* @__PURE__ */ G(i), n = /* @__PURE__ */ G(n)), !a && /* @__PURE__ */ _n(i) && !/* @__PURE__ */ _n(n)) return r ? (process.env.NODE_ENV !== "production" && Ue(`Set operation on key "${String(t)}" failed: target is readonly.`, e[t]), !0) : (i.value = n, !0);
|
|
690
690
|
}
|
|
691
691
|
let o = a ? Number(t) < e.length : F(e, t), s = Reflect.set(e, t, n, /* @__PURE__ */ _n(e) ? e : r);
|
|
692
|
-
return e === /* @__PURE__ */
|
|
692
|
+
return e === /* @__PURE__ */ G(r) && s && (o ? _e(n, i) && xt(e, "set", t, n, i) : xt(e, "add", t, n)), s;
|
|
693
693
|
}
|
|
694
694
|
deleteProperty(e, t) {
|
|
695
695
|
let n = F(e, t), r = e[t], i = Reflect.deleteProperty(e, t);
|
|
696
|
-
return i && n &&
|
|
696
|
+
return i && n && xt(e, "delete", t, void 0, r), i;
|
|
697
697
|
}
|
|
698
698
|
has(e, t) {
|
|
699
699
|
let n = Reflect.has(e, t);
|
|
700
|
-
return (!ne(t) || !
|
|
700
|
+
return (!ne(t) || !Nt.has(t)) && bt(e, "has", t), n;
|
|
701
701
|
}
|
|
702
702
|
ownKeys(e) {
|
|
703
|
-
return
|
|
703
|
+
return bt(e, "iterate", I(e) ? "length" : _t), Reflect.ownKeys(e);
|
|
704
704
|
}
|
|
705
|
-
},
|
|
705
|
+
}, Lt = class extends Ft {
|
|
706
706
|
constructor(e = !1) {
|
|
707
707
|
super(!0, e);
|
|
708
708
|
}
|
|
@@ -712,11 +712,11 @@ var Pt = class {
|
|
|
712
712
|
deleteProperty(e, t) {
|
|
713
713
|
return process.env.NODE_ENV !== "production" && Ue(`Delete operation on key "${String(t)}" failed: target is readonly.`, e), !0;
|
|
714
714
|
}
|
|
715
|
-
},
|
|
716
|
-
function
|
|
715
|
+
}, Rt = /* @__PURE__ */ new It(), zt = /* @__PURE__ */ new Lt(), Bt = /* @__PURE__ */ new It(!0), Vt = /* @__PURE__ */ new Lt(!0), Ht = (e) => e, Ut = (e) => Reflect.getPrototypeOf(e);
|
|
716
|
+
function Wt(e, t, n) {
|
|
717
717
|
return function(...r) {
|
|
718
|
-
let i = this.__v_raw, a = /* @__PURE__ */
|
|
719
|
-
return !t &&
|
|
718
|
+
let i = this.__v_raw, a = /* @__PURE__ */ G(i), o = L(a), s = e === "entries" || e === Symbol.iterator && o, c = e === "keys" && o, l = i[e](...r), u = n ? Ht : t ? gn : hn;
|
|
719
|
+
return !t && bt(a, "iterate", c ? vt : _t), M(Object.create(l), { next() {
|
|
720
720
|
let { value: e, done: t } = l.next();
|
|
721
721
|
return t ? {
|
|
722
722
|
value: e,
|
|
@@ -728,64 +728,64 @@ function Ut(e, t, n) {
|
|
|
728
728
|
} });
|
|
729
729
|
};
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function Gt(e) {
|
|
732
732
|
return function(...t) {
|
|
733
733
|
if (process.env.NODE_ENV !== "production") {
|
|
734
734
|
let n = t[0] ? `on key "${t[0]}" ` : "";
|
|
735
|
-
Ue(`${he(e)} operation ${n}failed: target is readonly.`, /* @__PURE__ */
|
|
735
|
+
Ue(`${he(e)} operation ${n}failed: target is readonly.`, /* @__PURE__ */ G(this));
|
|
736
736
|
}
|
|
737
737
|
return e === "delete" ? !1 : e === "clear" ? void 0 : this;
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function Kt(e, t) {
|
|
741
741
|
let n = {
|
|
742
742
|
get(n) {
|
|
743
|
-
let r = this.__v_raw, i = /* @__PURE__ */
|
|
744
|
-
e || (_e(n, a) &&
|
|
745
|
-
let { has: o } =
|
|
743
|
+
let r = this.__v_raw, i = /* @__PURE__ */ G(r), a = /* @__PURE__ */ G(n);
|
|
744
|
+
e || (_e(n, a) && bt(i, "get", n), bt(i, "get", a));
|
|
745
|
+
let { has: o } = Ut(i), s = t ? Ht : e ? gn : hn;
|
|
746
746
|
if (o.call(i, n)) return s(r.get(n));
|
|
747
747
|
if (o.call(i, a)) return s(r.get(a));
|
|
748
748
|
r !== i && r.get(n);
|
|
749
749
|
},
|
|
750
750
|
get size() {
|
|
751
751
|
let t = this.__v_raw;
|
|
752
|
-
return !e &&
|
|
752
|
+
return !e && bt(/* @__PURE__ */ G(t), "iterate", _t), t.size;
|
|
753
753
|
},
|
|
754
754
|
has(t) {
|
|
755
|
-
let n = this.__v_raw, r = /* @__PURE__ */
|
|
756
|
-
return e || (_e(t, i) &&
|
|
755
|
+
let n = this.__v_raw, r = /* @__PURE__ */ G(n), i = /* @__PURE__ */ G(t);
|
|
756
|
+
return e || (_e(t, i) && bt(r, "has", t), bt(r, "has", i)), t === i ? n.has(t) : n.has(t) || n.has(i);
|
|
757
757
|
},
|
|
758
758
|
forEach(n, r) {
|
|
759
|
-
let i = this, a = i.__v_raw, o = /* @__PURE__ */
|
|
760
|
-
return !e &&
|
|
759
|
+
let i = this, a = i.__v_raw, o = /* @__PURE__ */ G(a), s = t ? Ht : e ? gn : hn;
|
|
760
|
+
return !e && bt(o, "iterate", _t), a.forEach((e, t) => n.call(r, s(e), s(t), i));
|
|
761
761
|
}
|
|
762
762
|
};
|
|
763
763
|
return M(n, e ? {
|
|
764
|
-
add:
|
|
765
|
-
set:
|
|
766
|
-
delete:
|
|
767
|
-
clear:
|
|
764
|
+
add: Gt("add"),
|
|
765
|
+
set: Gt("set"),
|
|
766
|
+
delete: Gt("delete"),
|
|
767
|
+
clear: Gt("clear")
|
|
768
768
|
} : {
|
|
769
769
|
add(e) {
|
|
770
|
-
let n = /* @__PURE__ */
|
|
771
|
-
return r.has.call(n, a) || _e(e, a) && r.has.call(n, e) || _e(i, a) && r.has.call(n, i) || (n.add(a),
|
|
770
|
+
let n = /* @__PURE__ */ G(this), r = Ut(n), i = /* @__PURE__ */ G(e), a = !t && !/* @__PURE__ */ fn(e) && !/* @__PURE__ */ dn(e) ? i : e;
|
|
771
|
+
return r.has.call(n, a) || _e(e, a) && r.has.call(n, e) || _e(i, a) && r.has.call(n, i) || (n.add(a), xt(n, "add", a, a)), this;
|
|
772
772
|
},
|
|
773
773
|
set(e, n) {
|
|
774
|
-
!t && !/* @__PURE__ */
|
|
775
|
-
let r = /* @__PURE__ */
|
|
776
|
-
o ? process.env.NODE_ENV !== "production" &&
|
|
774
|
+
!t && !/* @__PURE__ */ fn(n) && !/* @__PURE__ */ dn(n) && (n = /* @__PURE__ */ G(n));
|
|
775
|
+
let r = /* @__PURE__ */ G(this), { has: i, get: a } = Ut(r), o = i.call(r, e);
|
|
776
|
+
o ? process.env.NODE_ENV !== "production" && Qt(r, i, e) : (e = /* @__PURE__ */ G(e), o = i.call(r, e));
|
|
777
777
|
let s = a.call(r, e);
|
|
778
|
-
return r.set(e, n), o ? _e(n, s) &&
|
|
778
|
+
return r.set(e, n), o ? _e(n, s) && xt(r, "set", e, n, s) : xt(r, "add", e, n), this;
|
|
779
779
|
},
|
|
780
780
|
delete(e) {
|
|
781
|
-
let t = /* @__PURE__ */
|
|
782
|
-
i ? process.env.NODE_ENV !== "production" &&
|
|
781
|
+
let t = /* @__PURE__ */ G(this), { has: n, get: r } = Ut(t), i = n.call(t, e);
|
|
782
|
+
i ? process.env.NODE_ENV !== "production" && Qt(t, n, e) : (e = /* @__PURE__ */ G(e), i = n.call(t, e));
|
|
783
783
|
let a = r ? r.call(t, e) : void 0, o = t.delete(e);
|
|
784
|
-
return i &&
|
|
784
|
+
return i && xt(t, "delete", e, void 0, a), o;
|
|
785
785
|
},
|
|
786
786
|
clear() {
|
|
787
|
-
let e = /* @__PURE__ */
|
|
788
|
-
return t &&
|
|
787
|
+
let e = /* @__PURE__ */ G(this), t = e.size !== 0, n = process.env.NODE_ENV === "production" ? void 0 : L(e) ? new Map(e) : new Set(e), r = e.clear();
|
|
788
|
+
return t && xt(e, "clear", void 0, void 0, n), r;
|
|
789
789
|
}
|
|
790
790
|
}), [
|
|
791
791
|
"keys",
|
|
@@ -793,23 +793,23 @@ function Gt(e, t) {
|
|
|
793
793
|
"entries",
|
|
794
794
|
Symbol.iterator
|
|
795
795
|
].forEach((r) => {
|
|
796
|
-
n[r] =
|
|
796
|
+
n[r] = Wt(r, e, t);
|
|
797
797
|
}), n;
|
|
798
798
|
}
|
|
799
|
-
function
|
|
800
|
-
let n =
|
|
799
|
+
function qt(e, t) {
|
|
800
|
+
let n = Kt(e, t);
|
|
801
801
|
return (t, r, i) => r === "__v_isReactive" ? !e : r === "__v_isReadonly" ? e : r === "__v_raw" ? t : Reflect.get(F(n, r) && r in t ? n : t, r, i);
|
|
802
802
|
}
|
|
803
|
-
var
|
|
804
|
-
function
|
|
805
|
-
let r = /* @__PURE__ */
|
|
803
|
+
var Jt = { get: /* @__PURE__ */ qt(!1, !1) }, Yt = { get: /* @__PURE__ */ qt(!1, !0) }, Xt = { get: /* @__PURE__ */ qt(!0, !1) }, Zt = { get: /* @__PURE__ */ qt(!0, !0) };
|
|
804
|
+
function Qt(e, t, n) {
|
|
805
|
+
let r = /* @__PURE__ */ G(n);
|
|
806
806
|
if (r !== n && t.call(e, r)) {
|
|
807
807
|
let t = V(e);
|
|
808
808
|
Ue(`Reactive ${t} contains both the raw and reactive versions of the same object${t === "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.`);
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
|
-
var
|
|
812
|
-
function
|
|
811
|
+
var $t = /* @__PURE__ */ new WeakMap(), en = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), nn = /* @__PURE__ */ new WeakMap();
|
|
812
|
+
function rn(e) {
|
|
813
813
|
switch (e) {
|
|
814
814
|
case "Object":
|
|
815
815
|
case "Array": return 1;
|
|
@@ -821,56 +821,56 @@ function nn(e) {
|
|
|
821
821
|
}
|
|
822
822
|
}
|
|
823
823
|
// @__NO_SIDE_EFFECTS__
|
|
824
|
-
function rn(e) {
|
|
825
|
-
return /* @__PURE__ */ un(e) ? e : cn(e, !1, Lt, qt, Qt);
|
|
826
|
-
}
|
|
827
|
-
// @__NO_SIDE_EFFECTS__
|
|
828
824
|
function an(e) {
|
|
829
|
-
return
|
|
825
|
+
return /* @__PURE__ */ dn(e) ? e : ln(e, !1, Rt, Jt, $t);
|
|
830
826
|
}
|
|
831
827
|
// @__NO_SIDE_EFFECTS__
|
|
832
828
|
function on(e) {
|
|
833
|
-
return
|
|
829
|
+
return ln(e, !1, Bt, Yt, en);
|
|
834
830
|
}
|
|
835
831
|
// @__NO_SIDE_EFFECTS__
|
|
836
832
|
function sn(e) {
|
|
837
|
-
return
|
|
833
|
+
return ln(e, !0, zt, Xt, tn);
|
|
838
834
|
}
|
|
839
|
-
|
|
835
|
+
// @__NO_SIDE_EFFECTS__
|
|
836
|
+
function cn(e) {
|
|
837
|
+
return ln(e, !0, Vt, Zt, nn);
|
|
838
|
+
}
|
|
839
|
+
function ln(e, t, n, r, i) {
|
|
840
840
|
if (!B(e)) return process.env.NODE_ENV !== "production" && Ue(`value cannot be made ${t ? "readonly" : "reactive"}: ${String(e)}`), e;
|
|
841
841
|
if (e.__v_raw && !(t && e.__v_isReactive) || e.__v_skip || !Object.isExtensible(e)) return e;
|
|
842
842
|
let a = i.get(e);
|
|
843
843
|
if (a) return a;
|
|
844
|
-
let o =
|
|
844
|
+
let o = rn(V(e));
|
|
845
845
|
if (o === 0) return e;
|
|
846
846
|
let s = new Proxy(e, o === 2 ? r : n);
|
|
847
847
|
return i.set(e, s), s;
|
|
848
848
|
}
|
|
849
849
|
// @__NO_SIDE_EFFECTS__
|
|
850
|
-
function
|
|
851
|
-
return /* @__PURE__ */
|
|
850
|
+
function un(e) {
|
|
851
|
+
return /* @__PURE__ */ dn(e) ? /* @__PURE__ */ un(e.__v_raw) : !!(e && e.__v_isReactive);
|
|
852
852
|
}
|
|
853
853
|
// @__NO_SIDE_EFFECTS__
|
|
854
|
-
function
|
|
854
|
+
function dn(e) {
|
|
855
855
|
return !!(e && e.__v_isReadonly);
|
|
856
856
|
}
|
|
857
857
|
// @__NO_SIDE_EFFECTS__
|
|
858
|
-
function
|
|
858
|
+
function fn(e) {
|
|
859
859
|
return !!(e && e.__v_isShallow);
|
|
860
860
|
}
|
|
861
861
|
// @__NO_SIDE_EFFECTS__
|
|
862
|
-
function
|
|
862
|
+
function pn(e) {
|
|
863
863
|
return e ? !!e.__v_raw : !1;
|
|
864
864
|
}
|
|
865
865
|
// @__NO_SIDE_EFFECTS__
|
|
866
|
-
function
|
|
866
|
+
function G(e) {
|
|
867
867
|
let t = e && e.__v_raw;
|
|
868
|
-
return t ? /* @__PURE__ */
|
|
868
|
+
return t ? /* @__PURE__ */ G(t) : e;
|
|
869
869
|
}
|
|
870
870
|
function mn(e) {
|
|
871
871
|
return !F(e, "__v_skip") && Object.isExtensible(e) && ye(e, "__v_skip", !0), e;
|
|
872
872
|
}
|
|
873
|
-
var hn = (e) => B(e) ? /* @__PURE__ */
|
|
873
|
+
var hn = (e) => B(e) ? /* @__PURE__ */ an(e) : e, gn = (e) => B(e) ? /* @__PURE__ */ sn(e) : e;
|
|
874
874
|
// @__NO_SIDE_EFFECTS__
|
|
875
875
|
function _n(e) {
|
|
876
876
|
return e ? e.__v_isRef === !0 : !1;
|
|
@@ -888,7 +888,7 @@ function bn(e, t) {
|
|
|
888
888
|
}
|
|
889
889
|
var xn = class {
|
|
890
890
|
constructor(e, t) {
|
|
891
|
-
this.dep = new
|
|
891
|
+
this.dep = new mt(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = t ? e : /* @__PURE__ */ G(e), this._value = t ? e : hn(e), this.__v_isShallow = t;
|
|
892
892
|
}
|
|
893
893
|
get value() {
|
|
894
894
|
return process.env.NODE_ENV === "production" ? this.dep.track() : this.dep.track({
|
|
@@ -898,8 +898,8 @@ var xn = class {
|
|
|
898
898
|
}), this._value;
|
|
899
899
|
}
|
|
900
900
|
set value(e) {
|
|
901
|
-
let t = this._rawValue, n = this.__v_isShallow || /* @__PURE__ */
|
|
902
|
-
e = n ? e : /* @__PURE__ */
|
|
901
|
+
let t = this._rawValue, n = this.__v_isShallow || /* @__PURE__ */ fn(e) || /* @__PURE__ */ dn(e);
|
|
902
|
+
e = n ? e : /* @__PURE__ */ G(e), _e(e, t) && (this._rawValue = e, this._value = n ? e : hn(e), process.env.NODE_ENV === "production" ? this.dep.trigger() : this.dep.trigger({
|
|
903
903
|
target: this,
|
|
904
904
|
type: "set",
|
|
905
905
|
key: "value",
|
|
@@ -927,14 +927,14 @@ var Cn = {
|
|
|
927
927
|
}
|
|
928
928
|
};
|
|
929
929
|
function wn(e) {
|
|
930
|
-
return /* @__PURE__ */
|
|
930
|
+
return /* @__PURE__ */ un(e) ? e : new Proxy(e, Cn);
|
|
931
931
|
}
|
|
932
932
|
var Tn = class {
|
|
933
933
|
constructor(e, t, n) {
|
|
934
|
-
this.fn = e, this.setter = t, this._value = void 0, this.dep = new
|
|
934
|
+
this.fn = e, this.setter = t, this._value = void 0, this.dep = new mt(this), this.__v_isRef = !0, this.deps = void 0, this.depsTail = void 0, this.flags = 16, this.globalVersion = ft - 1, this.next = void 0, this.effect = this, this.__v_isReadonly = !t, this.isSSR = n;
|
|
935
935
|
}
|
|
936
936
|
notify() {
|
|
937
|
-
if (this.flags |= 16, !(this.flags & 8) &&
|
|
937
|
+
if (this.flags |= 16, !(this.flags & 8) && qe !== this) return $e(this, !0), !0;
|
|
938
938
|
process.env.NODE_ENV;
|
|
939
939
|
}
|
|
940
940
|
get value() {
|
|
@@ -943,7 +943,7 @@ var Tn = class {
|
|
|
943
943
|
type: "get",
|
|
944
944
|
key: "value"
|
|
945
945
|
});
|
|
946
|
-
return
|
|
946
|
+
return it(this), e && (e.version = this.dep.version), this._value;
|
|
947
947
|
}
|
|
948
948
|
set value(e) {
|
|
949
949
|
this.setter ? this.setter(e) : process.env.NODE_ENV !== "production" && Ue("Write operation failed: computed value is readonly");
|
|
@@ -966,19 +966,19 @@ function An(e, t = !1, n = kn) {
|
|
|
966
966
|
function jn(e, t, n = E) {
|
|
967
967
|
let { immediate: r, deep: i, once: a, scheduler: o, augmentJob: s, call: c } = n, l = (e) => {
|
|
968
968
|
(n.onWarn || Ue)("Invalid watch source: ", e, "A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.");
|
|
969
|
-
}, u = (e) => i ? e : /* @__PURE__ */
|
|
970
|
-
if (/* @__PURE__ */ _n(e) ? (f = () => e.value, h = /* @__PURE__ */
|
|
969
|
+
}, u = (e) => i ? e : /* @__PURE__ */ fn(e) || i === !1 || i === 0 ? Mn(e, 1) : Mn(e), d, f, p, m, h = !1, g = !1;
|
|
970
|
+
if (/* @__PURE__ */ _n(e) ? (f = () => e.value, h = /* @__PURE__ */ fn(e)) : /* @__PURE__ */ un(e) ? (f = () => u(e), h = !0) : I(e) ? (g = !0, h = e.some((e) => /* @__PURE__ */ un(e) || /* @__PURE__ */ fn(e)), f = () => e.map((e) => {
|
|
971
971
|
if (/* @__PURE__ */ _n(e)) return e.value;
|
|
972
|
-
if (/* @__PURE__ */
|
|
972
|
+
if (/* @__PURE__ */ un(e)) return u(e);
|
|
973
973
|
if (R(e)) return c ? c(e, 2) : e();
|
|
974
974
|
process.env.NODE_ENV !== "production" && l(e);
|
|
975
975
|
})) : R(e) ? f = t ? c ? () => c(e, 2) : e : () => {
|
|
976
976
|
if (p) {
|
|
977
|
-
|
|
977
|
+
lt();
|
|
978
978
|
try {
|
|
979
979
|
p();
|
|
980
980
|
} finally {
|
|
981
|
-
|
|
981
|
+
ut();
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
let t = kn;
|
|
@@ -1022,7 +1022,7 @@ function jn(e, t, n = E) {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
} else d.run();
|
|
1024
1024
|
};
|
|
1025
|
-
return s && s(b), d = new
|
|
1025
|
+
return s && s(b), d = new Ye(f), d.scheduler = o ? () => o(b, !1) : b, m = (e) => An(e, !1, d), p = d.onStop = () => {
|
|
1026
1026
|
let e = On.get(d);
|
|
1027
1027
|
if (e) {
|
|
1028
1028
|
if (c) c(e, 4);
|
|
@@ -1056,7 +1056,7 @@ function Fn() {
|
|
|
1056
1056
|
var In = !1;
|
|
1057
1057
|
function q(e, ...t) {
|
|
1058
1058
|
if (In) return;
|
|
1059
|
-
In = !0,
|
|
1059
|
+
In = !0, lt();
|
|
1060
1060
|
let n = Nn.length ? Nn[Nn.length - 1].component : null, r = n && n.appContext.config.warnHandler, i = Ln();
|
|
1061
1061
|
if (r) Wn(r, n, 11, [
|
|
1062
1062
|
e + t.map((e) => e.toString?.call(e) ?? JSON.stringify(e)).join(""),
|
|
@@ -1068,7 +1068,7 @@ function q(e, ...t) {
|
|
|
1068
1068
|
let n = [`[Vue warn]: ${e}`, ...t];
|
|
1069
1069
|
i.length && n.push("\n", ...Rn(i)), console.warn(...n);
|
|
1070
1070
|
}
|
|
1071
|
-
|
|
1071
|
+
ut(), In = !1;
|
|
1072
1072
|
}
|
|
1073
1073
|
function Ln() {
|
|
1074
1074
|
let e = Nn[Nn.length - 1];
|
|
@@ -1106,11 +1106,11 @@ function Bn(e) {
|
|
|
1106
1106
|
}), n.length > 3 && t.push(" ..."), t;
|
|
1107
1107
|
}
|
|
1108
1108
|
function Vn(e, t, n) {
|
|
1109
|
-
return z(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */ _n(t) ? (t = Vn(e, /* @__PURE__ */
|
|
1109
|
+
return z(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */ _n(t) ? (t = Vn(e, /* @__PURE__ */ G(t.value), !0), n ? t : [
|
|
1110
1110
|
`${e}=Ref<`,
|
|
1111
1111
|
t,
|
|
1112
1112
|
">"
|
|
1113
|
-
]) : R(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */
|
|
1113
|
+
]) : R(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */ G(t), n ? t : [`${e}=`, t]);
|
|
1114
1114
|
}
|
|
1115
1115
|
function Hn(e, t) {
|
|
1116
1116
|
process.env.NODE_ENV !== "production" && e !== void 0 && (typeof e == "number" ? isNaN(e) && q(`${t} is NaN - the duration expression might be incorrect.`) : q(`${t} is not a valid number - got ${JSON.stringify(e)}.`));
|
|
@@ -1180,11 +1180,11 @@ function Kn(e, t, n, r = !0) {
|
|
|
1180
1180
|
r = r.parent;
|
|
1181
1181
|
}
|
|
1182
1182
|
if (a) {
|
|
1183
|
-
|
|
1183
|
+
lt(), Wn(a, null, 10, [
|
|
1184
1184
|
e,
|
|
1185
1185
|
i,
|
|
1186
1186
|
o
|
|
1187
|
-
]),
|
|
1187
|
+
]), ut();
|
|
1188
1188
|
return;
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
@@ -1427,12 +1427,12 @@ function Kr(e, t, n, r) {
|
|
|
1427
1427
|
let s = i[o];
|
|
1428
1428
|
a && (s.oldValue = a[o].value);
|
|
1429
1429
|
let c = s.dir[r];
|
|
1430
|
-
c && (
|
|
1430
|
+
c && (lt(), Gn(c, n, 8, [
|
|
1431
1431
|
e.el,
|
|
1432
1432
|
s,
|
|
1433
1433
|
e,
|
|
1434
1434
|
t
|
|
1435
|
-
]),
|
|
1435
|
+
]), ut());
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
function qr(e, t) {
|
|
@@ -1649,7 +1649,7 @@ var vi = [Function, Array], yi = {
|
|
|
1649
1649
|
return () => {
|
|
1650
1650
|
let i = t.default && ki(t.default(), !0), a = i && i.length ? Si(i) : n.subTree ? Q() : void 0;
|
|
1651
1651
|
if (!a) return;
|
|
1652
|
-
let o = /* @__PURE__ */
|
|
1652
|
+
let o = /* @__PURE__ */ G(e), { mode: s } = o;
|
|
1653
1653
|
if (process.env.NODE_ENV !== "production" && s && s !== "in-out" && s !== "out-in" && s !== "default" && q(`invalid <transition> mode: ${s}`), r.isLeaving) return Ei(a);
|
|
1654
1654
|
let c = Di(a);
|
|
1655
1655
|
if (!c) return Ei(a);
|
|
@@ -1795,7 +1795,7 @@ function Fi(e, t, n, r, i = !1) {
|
|
|
1795
1795
|
q("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");
|
|
1796
1796
|
return;
|
|
1797
1797
|
}
|
|
1798
|
-
let l = t && t.r, u = s.refs === E ? s.refs = {} : s.refs, d = s.setupState, f = /* @__PURE__ */
|
|
1798
|
+
let l = t && t.r, u = s.refs === E ? s.refs = {} : s.refs, d = s.setupState, f = /* @__PURE__ */ G(d), p = d === E ? k : (e) => process.env.NODE_ENV !== "production" && (F(f, e) && !/* @__PURE__ */ _n(f[e]) && q(`Template ref "${e}" used on a non-ref value. It will not work in the production build.`), Mi.has(f[e])) || Ni(u, e) ? !1 : F(f, e), m = (e, t) => !(process.env.NODE_ENV !== "production" && Mi.has(e) || t && Ni(u, t));
|
|
1799
1799
|
if (l != null && l !== c) {
|
|
1800
1800
|
if (Ii(t), z(l)) u[l] = null, p(l) && (d[l] = null);
|
|
1801
1801
|
else if (/* @__PURE__ */ _n(l)) {
|
|
@@ -1804,11 +1804,11 @@ function Fi(e, t, n, r, i = !1) {
|
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
1806
1806
|
if (R(c)) {
|
|
1807
|
-
|
|
1807
|
+
lt();
|
|
1808
1808
|
try {
|
|
1809
1809
|
Wn(c, s, 12, [o, u]);
|
|
1810
1810
|
} finally {
|
|
1811
|
-
|
|
1811
|
+
ut();
|
|
1812
1812
|
}
|
|
1813
1813
|
} else {
|
|
1814
1814
|
let t = z(c), r = /* @__PURE__ */ _n(c);
|
|
@@ -1869,9 +1869,9 @@ function Hi(e, t, n, r) {
|
|
|
1869
1869
|
function Ui(e, t, n = xs, r = !1) {
|
|
1870
1870
|
if (n) {
|
|
1871
1871
|
let i = n[e] || (n[e] = []), a = t.__weh ||= (...r) => {
|
|
1872
|
-
|
|
1872
|
+
lt();
|
|
1873
1873
|
let i = Ts(n), a = Gn(t, n, e, r);
|
|
1874
|
-
return i(),
|
|
1874
|
+
return i(), ut(), a;
|
|
1875
1875
|
};
|
|
1876
1876
|
return r ? i.unshift(a) : i.push(a), a;
|
|
1877
1877
|
} else process.env.NODE_ENV !== "production" && q(`${ge(Un[e].replace(/ hook$/, ""))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`);
|
|
@@ -1886,8 +1886,8 @@ var ta = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
|
1886
1886
|
function na(e, t, n, r) {
|
|
1887
1887
|
let i, a = n && n[r], o = I(e);
|
|
1888
1888
|
if (o || z(e)) {
|
|
1889
|
-
let n = o && /* @__PURE__ */
|
|
1890
|
-
n && (r = !/* @__PURE__ */
|
|
1889
|
+
let n = o && /* @__PURE__ */ un(e), r = !1, s = !1;
|
|
1890
|
+
n && (r = !/* @__PURE__ */ fn(e), s = /* @__PURE__ */ dn(e), e = Ct(e)), i = Array(e.length);
|
|
1891
1891
|
for (let n = 0, o = e.length; n < o; n++) i[n] = t(r ? s ? gn(hn(e[n])) : hn(e[n]) : e[n], n, void 0, a && a[n]);
|
|
1892
1892
|
} else if (typeof e == "number") if (process.env.NODE_ENV !== "production" && (!Number.isInteger(e) || e < 0)) q(`The v-for range expects a positive integer value but got ${e}.`), i = [];
|
|
1893
1893
|
else {
|
|
@@ -1923,10 +1923,10 @@ var aa = (e) => e ? ks(e) ? Vs(e) : aa(e.parent) : null, oa = /* @__PURE__ */ M(
|
|
|
1923
1923
|
$: (e) => e,
|
|
1924
1924
|
$el: (e) => e.vnode.el,
|
|
1925
1925
|
$data: (e) => e.data,
|
|
1926
|
-
$props: (e) => process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */
|
|
1927
|
-
$attrs: (e) => process.env.NODE_ENV === "production" ? e.attrs : /* @__PURE__ */
|
|
1928
|
-
$slots: (e) => process.env.NODE_ENV === "production" ? e.slots : /* @__PURE__ */
|
|
1929
|
-
$refs: (e) => process.env.NODE_ENV === "production" ? e.refs : /* @__PURE__ */
|
|
1926
|
+
$props: (e) => process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */ cn(e.props),
|
|
1927
|
+
$attrs: (e) => process.env.NODE_ENV === "production" ? e.attrs : /* @__PURE__ */ cn(e.attrs),
|
|
1928
|
+
$slots: (e) => process.env.NODE_ENV === "production" ? e.slots : /* @__PURE__ */ cn(e.slots),
|
|
1929
|
+
$refs: (e) => process.env.NODE_ENV === "production" ? e.refs : /* @__PURE__ */ cn(e.refs),
|
|
1930
1930
|
$parent: (e) => aa(e.parent),
|
|
1931
1931
|
$root: (e) => aa(e.root),
|
|
1932
1932
|
$host: (e) => e.ce,
|
|
@@ -1957,7 +1957,7 @@ var aa = (e) => e ? ks(e) ? Vs(e) : aa(e.parent) : null, oa = /* @__PURE__ */ M(
|
|
|
1957
1957
|
else ha && (o[t] = 0);
|
|
1958
1958
|
}
|
|
1959
1959
|
let l = oa[t], u, d;
|
|
1960
|
-
if (l) return t === "$attrs" ? (
|
|
1960
|
+
if (l) return t === "$attrs" ? (bt(e.attrs, "get", ""), process.env.NODE_ENV !== "production" && Ba()) : process.env.NODE_ENV !== "production" && t === "$slots" && bt(e, "get", t), l(e);
|
|
1961
1961
|
if ((u = s.__cssModules) && (u = u[t])) return u;
|
|
1962
1962
|
if (n !== E && F(n, t)) return o[t] = 4, n[t];
|
|
1963
1963
|
if (d = c.config.globalProperties, F(d, t)) return d[t];
|
|
@@ -2008,7 +2008,7 @@ function da(e) {
|
|
|
2008
2008
|
}
|
|
2009
2009
|
function fa(e) {
|
|
2010
2010
|
let { ctx: t, setupState: n } = e;
|
|
2011
|
-
Object.keys(/* @__PURE__ */
|
|
2011
|
+
Object.keys(/* @__PURE__ */ G(n)).forEach((e) => {
|
|
2012
2012
|
if (!n.__isScriptSetup) {
|
|
2013
2013
|
if (sa(e[0])) {
|
|
2014
2014
|
q(`setup() return property ${JSON.stringify(e)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);
|
|
@@ -2054,7 +2054,7 @@ function ga(e) {
|
|
|
2054
2054
|
process.env.NODE_ENV !== "production" && !R(i) && q("The data option must be a function. Plain object usage is no longer supported.");
|
|
2055
2055
|
let t = i.call(n, n);
|
|
2056
2056
|
if (process.env.NODE_ENV !== "production" && re(t) && q("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."), !B(t)) process.env.NODE_ENV !== "production" && q("data() should return an object.");
|
|
2057
|
-
else if (e.data = /* @__PURE__ */
|
|
2057
|
+
else if (e.data = /* @__PURE__ */ an(t), process.env.NODE_ENV !== "production") for (let e in t) M("Data", e), sa(e[0]) || Object.defineProperty(r, e, {
|
|
2058
2058
|
configurable: !0,
|
|
2059
2059
|
enumerable: !0,
|
|
2060
2060
|
get: () => t[e],
|
|
@@ -2339,20 +2339,20 @@ function Va(e) {
|
|
|
2339
2339
|
let e = i || r, t = process.env.NODE_ENV !== "production" && p.__isScriptSetup ? new Proxy(e, { get(e, t, n) {
|
|
2340
2340
|
return q(`Property '${String(t)}' was accessed via 'this'. Avoid using 'this' in templates.`), Reflect.get(e, t, n);
|
|
2341
2341
|
} }) : e;
|
|
2342
|
-
_ = ps(l.call(t, e, u, process.env.NODE_ENV === "production" ? d : /* @__PURE__ */
|
|
2342
|
+
_ = ps(l.call(t, e, u, process.env.NODE_ENV === "production" ? d : /* @__PURE__ */ cn(d), p, f, m)), v = s;
|
|
2343
2343
|
} else {
|
|
2344
2344
|
let e = t;
|
|
2345
|
-
process.env.NODE_ENV !== "production" && s === d && Ba(), _ = ps(e.length > 1 ? e(process.env.NODE_ENV === "production" ? d : /* @__PURE__ */
|
|
2345
|
+
process.env.NODE_ENV !== "production" && s === d && Ba(), _ = ps(e.length > 1 ? e(process.env.NODE_ENV === "production" ? d : /* @__PURE__ */ cn(d), process.env.NODE_ENV === "production" ? {
|
|
2346
2346
|
attrs: s,
|
|
2347
2347
|
slots: o,
|
|
2348
2348
|
emit: c
|
|
2349
2349
|
} : {
|
|
2350
2350
|
get attrs() {
|
|
2351
|
-
return Ba(), /* @__PURE__ */
|
|
2351
|
+
return Ba(), /* @__PURE__ */ cn(s);
|
|
2352
2352
|
},
|
|
2353
2353
|
slots: o,
|
|
2354
2354
|
emit: c
|
|
2355
|
-
}) : e(process.env.NODE_ENV === "production" ? d : /* @__PURE__ */
|
|
2355
|
+
}) : e(process.env.NODE_ENV === "production" ? d : /* @__PURE__ */ cn(d), null)), v = t.props ? s : Wa(s);
|
|
2356
2356
|
}
|
|
2357
2357
|
} catch (t) {
|
|
2358
2358
|
Jo.length = 0, Kn(t, e, 1), _ = ss(Ko);
|
|
@@ -2447,7 +2447,7 @@ function eo(e, t, n, r = !1) {
|
|
|
2447
2447
|
let i = {}, a = Qa();
|
|
2448
2448
|
e.propsDefaults = /* @__PURE__ */ Object.create(null), ro(e, t, i, a);
|
|
2449
2449
|
for (let t in e.propsOptions[0]) t in i || (i[t] = void 0);
|
|
2450
|
-
process.env.NODE_ENV !== "production" && lo(t || {}, i, e), n ? e.props = r ? i : /* @__PURE__ */
|
|
2450
|
+
process.env.NODE_ENV !== "production" && lo(t || {}, i, e), n ? e.props = r ? i : /* @__PURE__ */ on(i) : e.type.props ? e.props = i : e.props = a, e.attrs = a;
|
|
2451
2451
|
}
|
|
2452
2452
|
function to(e) {
|
|
2453
2453
|
for (; e;) {
|
|
@@ -2456,7 +2456,7 @@ function to(e) {
|
|
|
2456
2456
|
}
|
|
2457
2457
|
}
|
|
2458
2458
|
function no(e, t, n, r) {
|
|
2459
|
-
let { props: i, attrs: a, vnode: { patchFlag: o } } = e, s = /* @__PURE__ */
|
|
2459
|
+
let { props: i, attrs: a, vnode: { patchFlag: o } } = e, s = /* @__PURE__ */ G(i), [c] = e.propsOptions, l = !1;
|
|
2460
2460
|
if (!(process.env.NODE_ENV !== "production" && to(e)) && (r || o > 0) && !(o & 16)) {
|
|
2461
2461
|
if (o & 8) {
|
|
2462
2462
|
let n = e.vnode.dynamicProps;
|
|
@@ -2478,7 +2478,7 @@ function no(e, t, n, r) {
|
|
|
2478
2478
|
for (let a in s) (!t || !F(t, a) && ((r = me(a)) === a || !F(t, r))) && (c ? n && (n[a] !== void 0 || n[r] !== void 0) && (i[a] = io(c, s, a, void 0, e, !0)) : delete i[a]);
|
|
2479
2479
|
if (a !== s) for (let e in a) (!t || !F(t, e)) && (delete a[e], l = !0);
|
|
2480
2480
|
}
|
|
2481
|
-
l &&
|
|
2481
|
+
l && xt(e.attrs, "set", ""), process.env.NODE_ENV !== "production" && lo(t || {}, i, e);
|
|
2482
2482
|
}
|
|
2483
2483
|
function ro(e, t, n, r) {
|
|
2484
2484
|
let [i, a] = e.propsOptions, o = !1, s;
|
|
@@ -2488,7 +2488,7 @@ function ro(e, t, n, r) {
|
|
|
2488
2488
|
i && F(i, u = fe(c)) ? !a || !a.includes(u) ? n[u] = l : (s ||= {})[u] = l : Ra(e.emitsOptions, c) || (!(c in r) || l !== r[c]) && (r[c] = l, o = !0);
|
|
2489
2489
|
}
|
|
2490
2490
|
if (a) {
|
|
2491
|
-
let t = /* @__PURE__ */
|
|
2491
|
+
let t = /* @__PURE__ */ G(n), r = s || E;
|
|
2492
2492
|
for (let o = 0; o < a.length; o++) {
|
|
2493
2493
|
let s = a[o];
|
|
2494
2494
|
n[s] = io(i, t, s, r[s], e, !F(r, s));
|
|
@@ -2563,10 +2563,10 @@ function co(e) {
|
|
|
2563
2563
|
return e === null ? "null" : typeof e == "function" ? e.name || "" : typeof e == "object" && e.constructor && e.constructor.name || "";
|
|
2564
2564
|
}
|
|
2565
2565
|
function lo(e, t, n) {
|
|
2566
|
-
let r = /* @__PURE__ */
|
|
2566
|
+
let r = /* @__PURE__ */ G(t), i = n.propsOptions[0], a = Object.keys(e).map((e) => fe(e));
|
|
2567
2567
|
for (let e in i) {
|
|
2568
2568
|
let t = i[e];
|
|
2569
|
-
t != null && uo(e, r[e], t, process.env.NODE_ENV === "production" ? r : /* @__PURE__ */
|
|
2569
|
+
t != null && uo(e, r[e], t, process.env.NODE_ENV === "production" ? r : /* @__PURE__ */ cn(r), !a.includes(e));
|
|
2570
2570
|
}
|
|
2571
2571
|
}
|
|
2572
2572
|
function uo(e, t, n, r, i) {
|
|
@@ -2656,7 +2656,7 @@ var vo = (e) => e === "_" || e === "_ctx" || e === "$stable", yo = (e) => I(e) ?
|
|
|
2656
2656
|
let { vnode: r, slots: i } = e, a = !0, o = E;
|
|
2657
2657
|
if (r.shapeFlag & 32) {
|
|
2658
2658
|
let r = t._;
|
|
2659
|
-
r ? process.env.NODE_ENV !== "production" && fr ? (Co(i, t, n),
|
|
2659
|
+
r ? process.env.NODE_ENV !== "production" && fr ? (Co(i, t, n), xt(e, "set", "$slots")) : n && r === 1 ? a = !1 : Co(i, t, n) : (a = !t.$stable, xo(t, i)), o = t;
|
|
2660
2660
|
} else t && (So(e, t), o = { default: 1 });
|
|
2661
2661
|
if (a) for (let e in i) !vo(e) && o[e] == null && delete i[e];
|
|
2662
2662
|
}, Eo, Do;
|
|
@@ -2874,14 +2874,14 @@ function Po(e, t) {
|
|
|
2874
2874
|
}
|
|
2875
2875
|
};
|
|
2876
2876
|
e.scope.on();
|
|
2877
|
-
let c = e.effect = new
|
|
2877
|
+
let c = e.effect = new Ye(s);
|
|
2878
2878
|
e.scope.off();
|
|
2879
2879
|
let l = e.update = c.run.bind(c), u = e.job = c.runIfDirty.bind(c);
|
|
2880
2880
|
u.i = e, u.id = e.uid, c.scheduler = () => ir(u), Io(e, !0), process.env.NODE_ENV !== "production" && (c.onTrack = e.rtc ? (t) => ve(e.rtc, t) : void 0, c.onTrigger = e.rtg ? (t) => ve(e.rtg, t) : void 0), l();
|
|
2881
2881
|
}, L = (e, t, n) => {
|
|
2882
2882
|
t.component = e;
|
|
2883
2883
|
let r = e.vnode.props;
|
|
2884
|
-
e.vnode = t, e.next = null, no(e, t.props, r, n), To(e, t.children, n),
|
|
2884
|
+
e.vnode = t, e.next = null, no(e, t.props, r, n), To(e, t.children, n), lt(), sr(e), ut();
|
|
2885
2885
|
}, ee = (e, t, n, r, i, a, o, s, c = !1) => {
|
|
2886
2886
|
let l = e && e.children, d = e ? e.shapeFlag : 0, f = t.children, { patchFlag: p, shapeFlag: m } = t;
|
|
2887
2887
|
if (p > 0) {
|
|
@@ -2989,7 +2989,7 @@ function Po(e, t) {
|
|
|
2989
2989
|
else r(s, t, n);
|
|
2990
2990
|
}, ne = (e, t, n, r = !1, i = !1) => {
|
|
2991
2991
|
let { type: a, props: o, ref: s, children: c, dynamicChildren: l, shapeFlag: u, patchFlag: d, dirs: f, cacheIndex: p, memo: m } = e;
|
|
2992
|
-
if (d === -2 && (i = !1), s != null && (
|
|
2992
|
+
if (d === -2 && (i = !1), s != null && (lt(), Fi(s, null, n, e, !0), ut()), p != null && (t.renderCache[p] = void 0), u & 256) {
|
|
2993
2993
|
t.ctx.deactivate(e);
|
|
2994
2994
|
return;
|
|
2995
2995
|
}
|
|
@@ -3188,13 +3188,13 @@ function cs(e, t = null, n = null, r = 0, i = null, a = !1) {
|
|
|
3188
3188
|
if (Ks(e) && (e = e.__vccOpts), t) {
|
|
3189
3189
|
t = ls(t);
|
|
3190
3190
|
let { class: e, style: n } = t;
|
|
3191
|
-
e && !z(e) && (t.class = H(e)), B(n) && (/* @__PURE__ */
|
|
3191
|
+
e && !z(e) && (t.class = H(e)), B(n) && (/* @__PURE__ */ pn(n) && !I(n) && (n = M({}, n)), t.style = we(n));
|
|
3192
3192
|
}
|
|
3193
3193
|
let o = z(e) ? 1 : Uo(e) ? 128 : ri(e) ? 64 : B(e) ? 4 : R(e) ? 2 : 0;
|
|
3194
|
-
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */
|
|
3194
|
+
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ pn(e) && (e = /* @__PURE__ */ G(e), q("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.", "\nComponent that was made reactive: ", e)), Z(e, t, n, r, i, o, a, !0);
|
|
3195
3195
|
}
|
|
3196
3196
|
function ls(e) {
|
|
3197
|
-
return e ? /* @__PURE__ */
|
|
3197
|
+
return e ? /* @__PURE__ */ pn(e) || $a(e) ? M({}, e) : e : null;
|
|
3198
3198
|
}
|
|
3199
3199
|
function us(e, t, n = !1, r = !1) {
|
|
3200
3200
|
let { props: i, ref: a, patchFlag: o, children: s, transition: c } = e, l = t ? gs(i || {}, t) : i, u = {
|
|
@@ -3403,9 +3403,9 @@ function Ms(e, t) {
|
|
|
3403
3403
|
e.accessCache = /* @__PURE__ */ Object.create(null), e.proxy = new Proxy(e.ctx, la), process.env.NODE_ENV !== "production" && da(e);
|
|
3404
3404
|
let { setup: r } = n;
|
|
3405
3405
|
if (r) {
|
|
3406
|
-
|
|
3407
|
-
let i = e.setupContext = r.length > 1 ? Bs(e) : null, a = Ts(e), o = Wn(r, e, 0, [process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */
|
|
3408
|
-
if (
|
|
3406
|
+
lt();
|
|
3407
|
+
let i = e.setupContext = r.length > 1 ? Bs(e) : null, a = Ts(e), o = Wn(r, e, 0, [process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */ cn(e.props), i]), s = re(o);
|
|
3408
|
+
if (ut(), a(), (s || e.sp) && !Li(e) && ji(e), s) {
|
|
3409
3409
|
if (o.then(Es, Es), t) return o.then((n) => {
|
|
3410
3410
|
Ns(e, n, t);
|
|
3411
3411
|
}).catch((t) => {
|
|
@@ -3437,20 +3437,20 @@ function Ls(e, t, n) {
|
|
|
3437
3437
|
}
|
|
3438
3438
|
{
|
|
3439
3439
|
let t = Ts(e);
|
|
3440
|
-
|
|
3440
|
+
lt();
|
|
3441
3441
|
try {
|
|
3442
3442
|
ga(e);
|
|
3443
3443
|
} finally {
|
|
3444
|
-
|
|
3444
|
+
ut(), t();
|
|
3445
3445
|
}
|
|
3446
3446
|
}
|
|
3447
3447
|
process.env.NODE_ENV !== "production" && !r.render && e.render === O && !t && (!Ps && r.template ? q("Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias \"vue\" to \"vue/dist/vue.esm-bundler.js\".") : q("Component is missing template or render function: ", r));
|
|
3448
3448
|
}
|
|
3449
3449
|
var Rs = process.env.NODE_ENV === "production" ? { get(e, t) {
|
|
3450
|
-
return
|
|
3450
|
+
return bt(e, "get", ""), e[t];
|
|
3451
3451
|
} } : {
|
|
3452
3452
|
get(e, t) {
|
|
3453
|
-
return Ba(),
|
|
3453
|
+
return Ba(), bt(e, "get", ""), e[t];
|
|
3454
3454
|
},
|
|
3455
3455
|
set() {
|
|
3456
3456
|
return q("setupContext.attrs is readonly."), !1;
|
|
@@ -3461,7 +3461,7 @@ var Rs = process.env.NODE_ENV === "production" ? { get(e, t) {
|
|
|
3461
3461
|
};
|
|
3462
3462
|
function zs(e) {
|
|
3463
3463
|
return new Proxy(e.slots, { get(t, n) {
|
|
3464
|
-
return
|
|
3464
|
+
return bt(e, "get", "$slots"), t[n];
|
|
3465
3465
|
} });
|
|
3466
3466
|
}
|
|
3467
3467
|
function Bs(e) {
|
|
@@ -3554,9 +3554,9 @@ function Ys() {
|
|
|
3554
3554
|
"VueInstance"
|
|
3555
3555
|
];
|
|
3556
3556
|
if (/* @__PURE__ */ _n(t)) {
|
|
3557
|
-
|
|
3557
|
+
lt();
|
|
3558
3558
|
let n = t.value;
|
|
3559
|
-
return
|
|
3559
|
+
return ut(), [
|
|
3560
3560
|
"div",
|
|
3561
3561
|
{},
|
|
3562
3562
|
[
|
|
@@ -3568,25 +3568,25 @@ function Ys() {
|
|
|
3568
3568
|
s(n),
|
|
3569
3569
|
">"
|
|
3570
3570
|
];
|
|
3571
|
-
} else if (/* @__PURE__ */
|
|
3571
|
+
} else if (/* @__PURE__ */ un(t)) return [
|
|
3572
3572
|
"div",
|
|
3573
3573
|
{},
|
|
3574
3574
|
[
|
|
3575
3575
|
"span",
|
|
3576
3576
|
e,
|
|
3577
|
-
/* @__PURE__ */
|
|
3577
|
+
/* @__PURE__ */ fn(t) ? "ShallowReactive" : "Reactive"
|
|
3578
3578
|
],
|
|
3579
3579
|
"<",
|
|
3580
3580
|
s(t),
|
|
3581
|
-
`>${/* @__PURE__ */
|
|
3581
|
+
`>${/* @__PURE__ */ dn(t) ? " (readonly)" : ""}`
|
|
3582
3582
|
];
|
|
3583
|
-
else if (/* @__PURE__ */
|
|
3583
|
+
else if (/* @__PURE__ */ dn(t)) return [
|
|
3584
3584
|
"div",
|
|
3585
3585
|
{},
|
|
3586
3586
|
[
|
|
3587
3587
|
"span",
|
|
3588
3588
|
e,
|
|
3589
|
-
/* @__PURE__ */
|
|
3589
|
+
/* @__PURE__ */ fn(t) ? "ShallowReadonly" : "Readonly"
|
|
3590
3590
|
],
|
|
3591
3591
|
"<",
|
|
3592
3592
|
s(t),
|
|
@@ -3607,7 +3607,7 @@ function Ys() {
|
|
|
3607
3607
|
};
|
|
3608
3608
|
function a(e) {
|
|
3609
3609
|
let t = [];
|
|
3610
|
-
e.type.props && e.props && t.push(o("props", /* @__PURE__ */
|
|
3610
|
+
e.type.props && e.props && t.push(o("props", /* @__PURE__ */ G(e.props))), e.setupState !== E && t.push(o("setup", e.setupState)), e.data !== E && t.push(o("data", /* @__PURE__ */ G(e.data)));
|
|
3611
3611
|
let n = c(e, "computed");
|
|
3612
3612
|
n && t.push(o("computed", n));
|
|
3613
3613
|
let i = c(e, "inject");
|
|
@@ -3660,7 +3660,7 @@ function Ys() {
|
|
|
3660
3660
|
"span",
|
|
3661
3661
|
r,
|
|
3662
3662
|
e
|
|
3663
|
-
] : B(e) ? ["object", { object: i ? /* @__PURE__ */
|
|
3663
|
+
] : B(e) ? ["object", { object: i ? /* @__PURE__ */ G(e) : e }] : [
|
|
3664
3664
|
"span",
|
|
3665
3665
|
n,
|
|
3666
3666
|
String(e)
|
|
@@ -3678,7 +3678,7 @@ function Ys() {
|
|
|
3678
3678
|
if (I(r) && r.includes(t) || B(r) && t in r || e.extends && l(e.extends, t, n) || e.mixins && e.mixins.some((e) => l(e, t, n))) return !0;
|
|
3679
3679
|
}
|
|
3680
3680
|
function u(e) {
|
|
3681
|
-
return /* @__PURE__ */
|
|
3681
|
+
return /* @__PURE__ */ fn(e) ? "ShallowRef" : e.effect ? "ComputedRef" : "Ref";
|
|
3682
3682
|
}
|
|
3683
3683
|
window.devtoolsFormatters ? window.devtoolsFormatters.push(i) : window.devtoolsFormatters = [i];
|
|
3684
3684
|
}
|
|
@@ -5187,8 +5187,10 @@ function _u(e, t, n) {
|
|
|
5187
5187
|
let e = typeof r.shape == "function" ? r.shape() : r.shape;
|
|
5188
5188
|
if (!(t in e)) return !1;
|
|
5189
5189
|
r = e[t];
|
|
5190
|
-
} else if (r && (r._def?.type === "array" || r.constructor?.name === "ZodArray"))
|
|
5191
|
-
|
|
5190
|
+
} else if (r && (r._def?.type === "array" || r.constructor?.name === "ZodArray")) {
|
|
5191
|
+
if (!/^\d+$/.test(t)) return !1;
|
|
5192
|
+
r = r.element;
|
|
5193
|
+
} else if (r && (r._def?.type === "union" || r._def?.type === "discriminatedUnion" || Array.isArray(r.options))) return !0;
|
|
5192
5194
|
else return !1;
|
|
5193
5195
|
}
|
|
5194
5196
|
return !0;
|
|
@@ -5218,8 +5220,10 @@ function yu(e, t) {
|
|
|
5218
5220
|
for (let e of r) {
|
|
5219
5221
|
if (!n) return null;
|
|
5220
5222
|
if (n = vu(n), n && n.shape && typeof n.shape == "object") n = (typeof n.shape == "function" ? n.shape() : n.shape)[e];
|
|
5221
|
-
else if (n && (n._def?.type === "array" || n.constructor?.name === "ZodArray"))
|
|
5222
|
-
|
|
5223
|
+
else if (n && (n._def?.type === "array" || n.constructor?.name === "ZodArray")) {
|
|
5224
|
+
if (!/^\d+$/.test(e)) return null;
|
|
5225
|
+
n = n.element;
|
|
5226
|
+
} else if (n && (n._def?.type === "union" || n._def?.type === "discriminatedUnion" || Array.isArray(n.options))) return null;
|
|
5223
5227
|
else return null;
|
|
5224
5228
|
}
|
|
5225
5229
|
return n ?? null;
|
|
@@ -7714,7 +7718,11 @@ function Mp(e) {
|
|
|
7714
7718
|
return {
|
|
7715
7719
|
async get(t) {
|
|
7716
7720
|
let n = e.getItem(t);
|
|
7717
|
-
|
|
7721
|
+
if (n != null) try {
|
|
7722
|
+
return JSON.parse(n);
|
|
7723
|
+
} catch {
|
|
7724
|
+
return;
|
|
7725
|
+
}
|
|
7718
7726
|
},
|
|
7719
7727
|
async set(t, n) {
|
|
7720
7728
|
e.setItem(t, JSON.stringify(n));
|
|
@@ -7731,7 +7739,14 @@ function Mp(e) {
|
|
|
7731
7739
|
r.sort();
|
|
7732
7740
|
for (let t of r) {
|
|
7733
7741
|
let r = e.getItem(t);
|
|
7734
|
-
if (r
|
|
7742
|
+
if (r == null) continue;
|
|
7743
|
+
let i;
|
|
7744
|
+
try {
|
|
7745
|
+
i = JSON.parse(r);
|
|
7746
|
+
} catch {
|
|
7747
|
+
continue;
|
|
7748
|
+
}
|
|
7749
|
+
if (n(t, i) === !1) return;
|
|
7735
7750
|
}
|
|
7736
7751
|
},
|
|
7737
7752
|
async clearPrefix(t) {
|
|
@@ -10922,15 +10937,15 @@ function qh(e, n) {
|
|
|
10922
10937
|
prompt_tokens: 0,
|
|
10923
10938
|
completion_tokens: 0,
|
|
10924
10939
|
total_tokens: 0
|
|
10925
|
-
}, a = lp(() =>
|
|
10940
|
+
}, a = lp(() => We), o = /* @__PURE__ */ vn(0), s = Fp(e.storage);
|
|
10926
10941
|
e.debug && s && s.onEvent((e) => console.log("[page-agent-sdk][storage]", e));
|
|
10927
10942
|
let { modelCaps: c, summaryLlmInvoke: l, titleLlmInvoke: u, compressDecisionInvoke: d } = cp(e), f = c;
|
|
10928
10943
|
if (e.debug && console.log("[page-agent-sdk][modelCaps]", f), f.contextWindow < 2e5) throw Error(`[page-agent-sdk] 模型上下文窗口 ${f.contextWindow} 小于最小支持 ${Rl}(需 ≥200K 窗口模型,如 GLM-5.2/Claude/Kimi/Qwen-1M/DeepSeek-v4)`);
|
|
10929
10944
|
let p = Hp(e, f.contextWindow), m = p.enableLLMSummary !== !1, h = (e.contextOptions && e.contextOptions.preserveLastToolResults) ?? Vp[e.contextPreset ?? "auto"], g = new Set(h), _ = e.llm;
|
|
10930
10945
|
e.debug && !l && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
|
|
10931
|
-
let v = /* @__PURE__ */
|
|
10946
|
+
let v = /* @__PURE__ */ an([]), y = fm(e.vfs?.initialFiles, {
|
|
10932
10947
|
persist: s ? { save: (e) => {
|
|
10933
|
-
|
|
10948
|
+
W.sessionId && s && s.save(n, W.sessionId, { vfs: e });
|
|
10934
10949
|
} } : void 0,
|
|
10935
10950
|
maxBytes: e.vfs?.maxBytes,
|
|
10936
10951
|
poolBytes: e.vfs?.poolBytes
|
|
@@ -11136,7 +11151,7 @@ function qh(e, n) {
|
|
|
11136
11151
|
return;
|
|
11137
11152
|
}
|
|
11138
11153
|
}
|
|
11139
|
-
} : null, Ue =
|
|
11154
|
+
} : null, Ue = zp(e.onEvent), We = Ue.emit, Ge, Ke = [], qe = (e) => ({
|
|
11140
11155
|
name: e.name,
|
|
11141
11156
|
description: e.description,
|
|
11142
11157
|
content: typeof e.getContent == "function" ? e.getContent() : ""
|
|
@@ -11148,23 +11163,23 @@ function qh(e, n) {
|
|
|
11148
11163
|
...typeof e.skillStorage == "object" ? e.skillStorage : {},
|
|
11149
11164
|
id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${n}`
|
|
11150
11165
|
}), Xe = () => {
|
|
11151
|
-
let t =
|
|
11166
|
+
let t = Ge ? Ge.controller : null;
|
|
11152
11167
|
if (t) {
|
|
11153
|
-
let n = (e.skills || []).filter((e) => !
|
|
11154
|
-
t.set([...n, ...
|
|
11168
|
+
let n = (e.skills || []).filter((e) => !Ke.some((t) => t.name === e.name));
|
|
11169
|
+
t.set([...n, ...Ke]);
|
|
11155
11170
|
}
|
|
11156
|
-
|
|
11171
|
+
W.infoTick.value++;
|
|
11157
11172
|
}, Ze = async () => {
|
|
11158
11173
|
if (Ye) try {
|
|
11159
11174
|
let t = await Ye.list();
|
|
11160
11175
|
if (t.length) {
|
|
11161
|
-
|
|
11162
|
-
let n =
|
|
11176
|
+
Ke = t.map(Je);
|
|
11177
|
+
let n = Ge ? Ge.controller : null;
|
|
11163
11178
|
if (n) {
|
|
11164
|
-
let t = (e.skills || []).filter((e) => !
|
|
11165
|
-
n.set([...t, ...
|
|
11179
|
+
let t = (e.skills || []).filter((e) => !Ke.some((t) => t.name === e.name));
|
|
11180
|
+
n.set([...t, ...Ke]);
|
|
11166
11181
|
}
|
|
11167
|
-
|
|
11182
|
+
W.infoTick.value++;
|
|
11168
11183
|
}
|
|
11169
11184
|
} catch {}
|
|
11170
11185
|
}, Qe = Te ? nf({
|
|
@@ -11181,7 +11196,7 @@ function qh(e, n) {
|
|
|
11181
11196
|
U,
|
|
11182
11197
|
...xe ? [C] : [],
|
|
11183
11198
|
...be ? [S] : [],
|
|
11184
|
-
...Ce ? [
|
|
11199
|
+
...Ce ? [Ge = _d(e.skills || [], {
|
|
11185
11200
|
readVfs: we ? (e) => y.files[e]?.content : void 0,
|
|
11186
11201
|
hostScriptEnabled: N.skillHostScript,
|
|
11187
11202
|
onToolsReady: (e, t) => {
|
|
@@ -11189,7 +11204,7 @@ function qh(e, n) {
|
|
|
11189
11204
|
let t = ge.findIndex((e) => e.name === n.name);
|
|
11190
11205
|
t >= 0 && ge.splice(t, 1), ge.push(n), _e.set(n.name, e), re.set(n.name, `skill:${e}`);
|
|
11191
11206
|
}
|
|
11192
|
-
ve = ye(),
|
|
11207
|
+
ve = ye(), W.agent && W.agent.setTools(ve), W.infoTick.value++;
|
|
11193
11208
|
}
|
|
11194
11209
|
})] : [],
|
|
11195
11210
|
...we ? [xm(y)] : [],
|
|
@@ -11211,18 +11226,18 @@ function qh(e, n) {
|
|
|
11211
11226
|
...L ? [xh(i, {
|
|
11212
11227
|
tokenBudget: e.tokenBudget,
|
|
11213
11228
|
timeBudgetMs: e.timeBudgetMs
|
|
11214
|
-
},
|
|
11215
|
-
Gh(
|
|
11229
|
+
}, We)] : [],
|
|
11230
|
+
Gh(We, v, B, i)
|
|
11216
11231
|
]), et = e.maxMemoryRounds ?? Hh, tt = /* @__PURE__ */ vn([]);
|
|
11217
11232
|
async function nt() {
|
|
11218
11233
|
s && (tt.value = (await s.listSessions(n)).sort((e, t) => t.lastAccessed - e.lastAccessed));
|
|
11219
11234
|
}
|
|
11220
|
-
let
|
|
11235
|
+
let W = {
|
|
11221
11236
|
agentId: n,
|
|
11222
11237
|
store: s,
|
|
11223
11238
|
messages: v,
|
|
11224
11239
|
vfsStore: y,
|
|
11225
|
-
listeners:
|
|
11240
|
+
listeners: Ue.listeners,
|
|
11226
11241
|
todosMw: S,
|
|
11227
11242
|
memoryMw: E,
|
|
11228
11243
|
missionMw: C,
|
|
@@ -11236,14 +11251,14 @@ function qh(e, n) {
|
|
|
11236
11251
|
mcpServers: [],
|
|
11237
11252
|
checkpoint: j,
|
|
11238
11253
|
dataOpsController: z,
|
|
11239
|
-
skillsController:
|
|
11254
|
+
skillsController: Ge ? Ge.controller : null,
|
|
11240
11255
|
infoTick: o,
|
|
11241
11256
|
pendingConflict: a.pendingConflict,
|
|
11242
11257
|
sessions: tt,
|
|
11243
11258
|
refreshSessions: nt,
|
|
11244
11259
|
liveData: B,
|
|
11245
11260
|
usage: i,
|
|
11246
|
-
emit:
|
|
11261
|
+
emit: We,
|
|
11247
11262
|
unloadSkillTools(e) {
|
|
11248
11263
|
if (e) {
|
|
11249
11264
|
let t = ge.length;
|
|
@@ -11253,7 +11268,7 @@ function qh(e, n) {
|
|
|
11253
11268
|
for (let e of ge) re.delete(e.name), _e.delete(e.name);
|
|
11254
11269
|
ge = [];
|
|
11255
11270
|
}
|
|
11256
|
-
ve = ye(),
|
|
11271
|
+
ve = ye(), W.agent && W.agent.setTools(ve);
|
|
11257
11272
|
},
|
|
11258
11273
|
applySnapshot(t) {
|
|
11259
11274
|
if (t.messages?.length && v.push(...t.messages), t.vfs && y.hydrate && y.hydrate(t.vfs), t.todos?.length && S.reset(t.todos), t.memory && !e.memory && E.reset(t.memory), t.checkpoints?.length && j && j.importStack(t.checkpoints), t.usage && Object.assign(i, t.usage), t.mission && xe && C.setMission(t.mission), t.workingMemory && Se && T.restore(t.workingMemory), ue) {
|
|
@@ -11269,18 +11284,18 @@ function qh(e, n) {
|
|
|
11269
11284
|
ot();
|
|
11270
11285
|
},
|
|
11271
11286
|
addSkill(e) {
|
|
11272
|
-
let t =
|
|
11273
|
-
t >= 0 ?
|
|
11287
|
+
let t = Ke.findIndex((t) => t.name === e.name);
|
|
11288
|
+
t >= 0 ? Ke[t] = e : Ke.push(e), Xe(), Ye && Ye.put(qe(e));
|
|
11274
11289
|
},
|
|
11275
11290
|
removeSkill(e) {
|
|
11276
|
-
let t =
|
|
11277
|
-
return t < 0 ? !1 : (
|
|
11291
|
+
let t = Ke.findIndex((t) => t.name === e);
|
|
11292
|
+
return t < 0 ? !1 : (Ke.splice(t, 1), Xe(), Ye && Ye.remove(e), !0);
|
|
11278
11293
|
},
|
|
11279
11294
|
listUserSkills() {
|
|
11280
|
-
return
|
|
11295
|
+
return Ke.map((e) => e.name);
|
|
11281
11296
|
},
|
|
11282
11297
|
getUserSkill(e) {
|
|
11283
|
-
let t =
|
|
11298
|
+
let t = Ke.find((t) => t.name === e);
|
|
11284
11299
|
if (t) return {
|
|
11285
11300
|
name: t.name,
|
|
11286
11301
|
description: t.description,
|
|
@@ -11291,7 +11306,7 @@ function qh(e, n) {
|
|
|
11291
11306
|
st(), ut();
|
|
11292
11307
|
},
|
|
11293
11308
|
async send(e, t) {
|
|
11294
|
-
await
|
|
11309
|
+
await W.initDone, t ??= {}, t?.mission && xe && C.setMission(t.mission);
|
|
11295
11310
|
let n = e;
|
|
11296
11311
|
if (t.interceptors?.input) try {
|
|
11297
11312
|
let r = t.interceptors.input(e);
|
|
@@ -11305,7 +11320,7 @@ function qh(e, n) {
|
|
|
11305
11320
|
timestamp: Date.now()
|
|
11306
11321
|
}), !0);
|
|
11307
11322
|
try {
|
|
11308
|
-
let e = await
|
|
11323
|
+
let e = await W.agent.invoke(v);
|
|
11309
11324
|
if (t.interceptors?.output) try {
|
|
11310
11325
|
let n = t.interceptors.output(e);
|
|
11311
11326
|
typeof n == "string" && (e = n);
|
|
@@ -11314,11 +11329,11 @@ function qh(e, n) {
|
|
|
11314
11329
|
role: "assistant",
|
|
11315
11330
|
content: e,
|
|
11316
11331
|
timestamp: Date.now()
|
|
11317
|
-
}),
|
|
11332
|
+
}), W.afterRound(), s && await s.flush(), e;
|
|
11318
11333
|
} catch (e) {
|
|
11319
11334
|
let t = Al(e, "fatal");
|
|
11320
11335
|
if (i < r && j?.canRestore()) {
|
|
11321
|
-
i += 1, j.restore(), a = !0,
|
|
11336
|
+
i += 1, j.restore(), a = !0, We({
|
|
11322
11337
|
type: "error",
|
|
11323
11338
|
message: `致命错误自动恢复(${i}/${r}):${t.message},已回退 checkpoint 重试`,
|
|
11324
11339
|
severity: "observable",
|
|
@@ -11330,7 +11345,7 @@ function qh(e, n) {
|
|
|
11330
11345
|
});
|
|
11331
11346
|
continue;
|
|
11332
11347
|
}
|
|
11333
|
-
throw
|
|
11348
|
+
throw We({
|
|
11334
11349
|
type: "error",
|
|
11335
11350
|
message: t.message,
|
|
11336
11351
|
severity: t.severity,
|
|
@@ -11341,7 +11356,7 @@ function qh(e, n) {
|
|
|
11341
11356
|
}
|
|
11342
11357
|
},
|
|
11343
11358
|
async batch(e, t) {
|
|
11344
|
-
if (await
|
|
11359
|
+
if (await W.initDone, !e.length) return [];
|
|
11345
11360
|
let n = [];
|
|
11346
11361
|
for (let r = 0; r < e.length; r++) {
|
|
11347
11362
|
let i = e[r];
|
|
@@ -11353,12 +11368,12 @@ function qh(e, n) {
|
|
|
11353
11368
|
content: i,
|
|
11354
11369
|
timestamp: Date.now()
|
|
11355
11370
|
});
|
|
11356
|
-
let a = await
|
|
11371
|
+
let a = await W.agent.invoke(v);
|
|
11357
11372
|
v.push({
|
|
11358
11373
|
role: "assistant",
|
|
11359
11374
|
content: a,
|
|
11360
11375
|
timestamp: Date.now()
|
|
11361
|
-
}),
|
|
11376
|
+
}), W.afterRound(), s && await s.flush(), n.push({
|
|
11362
11377
|
index: r,
|
|
11363
11378
|
task: i,
|
|
11364
11379
|
reply: a,
|
|
@@ -11372,7 +11387,7 @@ function qh(e, n) {
|
|
|
11372
11387
|
} catch (o) {
|
|
11373
11388
|
v.length > a && v.splice(a);
|
|
11374
11389
|
let s = Al(o, "fatal");
|
|
11375
|
-
|
|
11390
|
+
We({
|
|
11376
11391
|
type: "error",
|
|
11377
11392
|
message: `批量任务 ${r + 1}/${e.length} 失败:${s.message}`,
|
|
11378
11393
|
severity: "observable",
|
|
@@ -11397,52 +11412,52 @@ function qh(e, n) {
|
|
|
11397
11412
|
return n;
|
|
11398
11413
|
},
|
|
11399
11414
|
async switchSession(t) {
|
|
11400
|
-
if (await
|
|
11401
|
-
if (a.resolve("keep_external"),
|
|
11415
|
+
if (await W.initDone, !s) throw Error("page-agent-sdk: storage 未开启,无法切换会话(请传 storage 选项)");
|
|
11416
|
+
if (a.resolve("keep_external"), W.sessionId && s) {
|
|
11402
11417
|
if (xe) {
|
|
11403
11418
|
let e = C.getMission();
|
|
11404
|
-
e && s.save(n,
|
|
11419
|
+
e && s.save(n, W.sessionId, { mission: e });
|
|
11405
11420
|
}
|
|
11406
11421
|
if (Se) {
|
|
11407
11422
|
let e = T.getWorkingMemory();
|
|
11408
|
-
e && s.save(n,
|
|
11423
|
+
e && s.save(n, W.sessionId, { workingMemory: e });
|
|
11409
11424
|
}
|
|
11410
11425
|
if (ue) {
|
|
11411
11426
|
let e = w.getFocuses();
|
|
11412
|
-
s.save(n,
|
|
11427
|
+
s.save(n, W.sessionId, { focus: e.length ? e : null });
|
|
11413
11428
|
}
|
|
11414
11429
|
}
|
|
11415
11430
|
y.flush?.(), await s.flush();
|
|
11416
11431
|
let r = t ?? "", i;
|
|
11417
|
-
return r ? (i = await s.load(n, r), i || await s.createSession(n, e.session?.title, r)) : r = await s.createSession(n, e.session?.title),
|
|
11432
|
+
return r ? (i = await s.load(n, r), i || await s.createSession(n, e.session?.title, r)) : r = await s.createSession(n, e.session?.title), W.sessionId = r, v.splice(0, v.length), y.clear?.(), S.reset([]), e.memory || E.reset(""), C.reset(), T.reset(), w.reset(), j && j.importStack([]), W.agent.debugLogs.value = [], i ||= await s.load(n, r), i && (W.applySnapshot(i), We({
|
|
11418
11433
|
type: "session_restored",
|
|
11419
11434
|
sessionId: r,
|
|
11420
11435
|
rounds: i.messages?.length ?? 0
|
|
11421
|
-
})), e.memory && s.save(n,
|
|
11436
|
+
})), e.memory && s.save(n, W.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), nt(), ct = void 0, lt = !1, r;
|
|
11422
11437
|
},
|
|
11423
11438
|
resetSession: () => {
|
|
11424
|
-
s && (
|
|
11439
|
+
s && (W.sessionId = up(), y.clear?.(), S.reset([]), e.memory || E.reset(""), C.reset(), T.reset(), w.reset(), j && j.importStack([]), W.agent && (W.agent.debugLogs.value = []), s.createSession(W.agentId, e.session?.title, W.sessionId), We({
|
|
11425
11440
|
type: "session_restored",
|
|
11426
|
-
sessionId:
|
|
11441
|
+
sessionId: W.sessionId,
|
|
11427
11442
|
rounds: 0
|
|
11428
11443
|
}), nt(), ct = void 0, lt = !1);
|
|
11429
11444
|
},
|
|
11430
11445
|
stream: (e, t, n) => {
|
|
11431
|
-
if (!
|
|
11446
|
+
if (!W.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
|
|
11432
11447
|
y?.setProtectedRefs?.(zh(e));
|
|
11433
|
-
let r =
|
|
11434
|
-
t?.(e),
|
|
11435
|
-
}
|
|
11448
|
+
let r = (e) => {
|
|
11449
|
+
t?.(e), We(e);
|
|
11450
|
+
};
|
|
11436
11451
|
if (n) {
|
|
11437
11452
|
let e = () => a.resolve("keep_external");
|
|
11438
11453
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
11439
11454
|
}
|
|
11440
|
-
return
|
|
11455
|
+
return W.agent.stream(e, r, n);
|
|
11441
11456
|
},
|
|
11442
11457
|
release() {
|
|
11443
|
-
if (
|
|
11458
|
+
if (W.refCount--, W.refCount <= 0) {
|
|
11444
11459
|
s && (y.flush?.(), s.flush(), s.dispose()), Ye && Ye.dispose();
|
|
11445
|
-
let e =
|
|
11460
|
+
let e = W.mcpClosers.splice(0);
|
|
11446
11461
|
e.length && Promise.allSettled(e.map((e) => e())), Uh.delete(n);
|
|
11447
11462
|
}
|
|
11448
11463
|
},
|
|
@@ -11450,16 +11465,16 @@ function qh(e, n) {
|
|
|
11450
11465
|
setTools(e) {
|
|
11451
11466
|
ae.length = 0, e.forEach((e) => {
|
|
11452
11467
|
ae.push(e), re.set(e.name, "user");
|
|
11453
|
-
}), ve = ye(),
|
|
11468
|
+
}), ve = ye(), W.agent && W.agent.setTools(ve), W.infoTick.value++;
|
|
11454
11469
|
},
|
|
11455
11470
|
addTool(e) {
|
|
11456
11471
|
ve.some((t) => t.name === e.name) && console.warn(`[page-agent-sdk] 工具 "${e.name}" 已存在,新工具覆盖(后注册覆盖先注册)`);
|
|
11457
11472
|
for (let t = ae.length - 1; t >= 0; t--) ae[t].name === e.name && ae.splice(t, 1);
|
|
11458
|
-
ae.push(e), re.set(e.name, "user"), ve = ye(),
|
|
11473
|
+
ae.push(e), re.set(e.name, "user"), ve = ye(), W.agent && W.agent.setTools(ve), W.infoTick.value++;
|
|
11459
11474
|
},
|
|
11460
11475
|
removeTool(e) {
|
|
11461
11476
|
let t = ae.findIndex((t) => t.name === e);
|
|
11462
|
-
return t < 0 ? !1 : (ae.splice(t, 1), re.delete(e), ve = ye(),
|
|
11477
|
+
return t < 0 ? !1 : (ae.splice(t, 1), re.delete(e), ve = ye(), W.agent && W.agent.setTools(ve), W.infoTick.value++, !0);
|
|
11463
11478
|
},
|
|
11464
11479
|
setLlm(t) {
|
|
11465
11480
|
let n;
|
|
@@ -11476,10 +11491,10 @@ function qh(e, n) {
|
|
|
11476
11491
|
contextWindow: e.contextWindow ?? r?.contextWindow,
|
|
11477
11492
|
maxOutputTokens: e.maxOutputTokens ?? r?.maxOutputTokens
|
|
11478
11493
|
}), f.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${f.contextWindow} 小于最小支持 ${Rl}(需 ≥200K 窗口模型)`);
|
|
11479
|
-
|
|
11494
|
+
W.agent && (W.agent.setLlm(n), W.agent.setModelCaps?.(f)), Qe?.setContextWindow?.(f.contextWindow), Be?.setContextWindow?.(f.contextWindow), W.infoTick.value++, e.debug && console.log("[page-agent-sdk][setLlm] 重解析 modelCaps + 回灌:", f);
|
|
11480
11495
|
},
|
|
11481
11496
|
setMemory(e) {
|
|
11482
|
-
E.reset(e), typeof e == "function" && E.refresh(),
|
|
11497
|
+
E.reset(e), typeof e == "function" && E.refresh(), W.infoTick.value++;
|
|
11483
11498
|
},
|
|
11484
11499
|
refreshMemory() {
|
|
11485
11500
|
return E.refresh();
|
|
@@ -11489,19 +11504,19 @@ function qh(e, n) {
|
|
|
11489
11504
|
e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
11490
11505
|
return;
|
|
11491
11506
|
}
|
|
11492
|
-
Ie.set(t),
|
|
11507
|
+
Ie.set(t), W.infoTick.value++;
|
|
11493
11508
|
},
|
|
11494
11509
|
addSubagent(t) {
|
|
11495
11510
|
if (!Ie) {
|
|
11496
11511
|
e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
11497
11512
|
return;
|
|
11498
11513
|
}
|
|
11499
|
-
Ie.add(t),
|
|
11514
|
+
Ie.add(t), W.infoTick.value++;
|
|
11500
11515
|
},
|
|
11501
11516
|
removeSubagent(t) {
|
|
11502
11517
|
if (!Ie) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
|
|
11503
11518
|
let n = Ie.remove(t);
|
|
11504
|
-
return n &&
|
|
11519
|
+
return n && W.infoTick.value++, n;
|
|
11505
11520
|
},
|
|
11506
11521
|
getActiveSubagents() {
|
|
11507
11522
|
return H?.getActive() ?? [];
|
|
@@ -11512,16 +11527,16 @@ function qh(e, n) {
|
|
|
11512
11527
|
getInfo() {
|
|
11513
11528
|
return {
|
|
11514
11529
|
id: n,
|
|
11515
|
-
sessionId:
|
|
11530
|
+
sessionId: W.sessionId,
|
|
11516
11531
|
model: $f(_) ? _.model ?? _.modelName : _.model,
|
|
11517
|
-
systemPrompt:
|
|
11518
|
-
tools: (
|
|
11532
|
+
systemPrompt: W.agent?.getEffectiveSystemPrompt?.() ?? ee + Kf(B(), e.schemaHint),
|
|
11533
|
+
tools: (W.agent?.allTools ?? ve).map((e) => ({
|
|
11519
11534
|
name: e.name,
|
|
11520
11535
|
description: e.description,
|
|
11521
11536
|
schema: e.schema,
|
|
11522
11537
|
source: re.get(e.name) || "user"
|
|
11523
11538
|
})),
|
|
11524
|
-
skills: (
|
|
11539
|
+
skills: (Ge ? Ge.controller.get() : e.skills ?? []).map((e) => ({
|
|
11525
11540
|
name: e.name,
|
|
11526
11541
|
description: e.description
|
|
11527
11542
|
})),
|
|
@@ -11532,7 +11547,7 @@ function qh(e, n) {
|
|
|
11532
11547
|
contextPreset: e.contextPreset ?? "auto",
|
|
11533
11548
|
memory: E.get(),
|
|
11534
11549
|
middleware: $e.map((e) => e.name),
|
|
11535
|
-
todos: (
|
|
11550
|
+
todos: (W.agent?.getState?.()?.todos ?? []).map((e) => ({
|
|
11536
11551
|
id: e.id,
|
|
11537
11552
|
content: e.content,
|
|
11538
11553
|
status: e.status,
|
|
@@ -11546,9 +11561,9 @@ function qh(e, n) {
|
|
|
11546
11561
|
workingMemory: Se ? T.getWorkingMemory() : void 0,
|
|
11547
11562
|
focus: ue ? w.getFocus() : void 0,
|
|
11548
11563
|
focuses: ue ? w.getFocuses() : [],
|
|
11549
|
-
trace: I &&
|
|
11550
|
-
spans:
|
|
11551
|
-
metrics: Ul(
|
|
11564
|
+
trace: I && W.agent?.spans ? {
|
|
11565
|
+
spans: W.agent.spans.value,
|
|
11566
|
+
metrics: Ul(W.agent.spans.value)
|
|
11552
11567
|
} : void 0,
|
|
11553
11568
|
actions: wh(e.actions ?? {}),
|
|
11554
11569
|
subagent: {
|
|
@@ -11568,13 +11583,13 @@ function qh(e, n) {
|
|
|
11568
11583
|
context: (() => {
|
|
11569
11584
|
let e = Be?.getSnapshot();
|
|
11570
11585
|
if (e) {
|
|
11571
|
-
let t =
|
|
11586
|
+
let t = W.agent?.getState?.()?.lastCompression;
|
|
11572
11587
|
t && (e.compression = t);
|
|
11573
11588
|
}
|
|
11574
11589
|
return e;
|
|
11575
11590
|
})(),
|
|
11576
|
-
mcp: { servers:
|
|
11577
|
-
lastCompression:
|
|
11591
|
+
mcp: { servers: W.mcpServers },
|
|
11592
|
+
lastCompression: W.agent?.getState?.()?.lastCompression,
|
|
11578
11593
|
checkpoints: j ? {
|
|
11579
11594
|
enabled: !0,
|
|
11580
11595
|
auto: M,
|
|
@@ -11590,7 +11605,7 @@ function qh(e, n) {
|
|
|
11590
11605
|
e.debug && console.warn("[page-agent-sdk][mission] capabilities.missionAnchor 关闭,setMission 忽略");
|
|
11591
11606
|
return;
|
|
11592
11607
|
}
|
|
11593
|
-
C.setMission(t),
|
|
11608
|
+
C.setMission(t), W.infoTick.value++;
|
|
11594
11609
|
},
|
|
11595
11610
|
getFocus() {
|
|
11596
11611
|
return ue ? w.getFocus() : void 0;
|
|
@@ -11600,20 +11615,20 @@ function qh(e, n) {
|
|
|
11600
11615
|
},
|
|
11601
11616
|
setFocus(t) {
|
|
11602
11617
|
let n = Kh(t, "setFocus", ue, () => B()?.schema, e.debug);
|
|
11603
|
-
return n.ok ? (w.setFocus(t),
|
|
11618
|
+
return n.ok ? (w.setFocus(t), W.infoTick.value++, { ok: !0 }) : n;
|
|
11604
11619
|
},
|
|
11605
11620
|
addFocus(t) {
|
|
11606
11621
|
let n = Kh(t, "addFocus", ue, () => B()?.schema, e.debug);
|
|
11607
11622
|
return n.ok ? w.getFocuses().length >= 8 ? (e.debug && console.warn("[page-agent-sdk][focus] addFocus 拒绝:焦点数已达上限 8(augmentPrompt 注入每焦点子树 schema,过多致 system prompt 超预算)"), {
|
|
11608
11623
|
ok: !1,
|
|
11609
11624
|
error: "焦点数上限 8(避免 system prompt 撑爆)"
|
|
11610
|
-
}) : (w.addFocus(t),
|
|
11625
|
+
}) : (w.addFocus(t), W.infoTick.value++, { ok: !0 }) : n;
|
|
11611
11626
|
},
|
|
11612
11627
|
removeFocus(e) {
|
|
11613
|
-
ue && (w.removeFocus(e),
|
|
11628
|
+
ue && (w.removeFocus(e), W.infoTick.value++);
|
|
11614
11629
|
},
|
|
11615
11630
|
clearFocus() {
|
|
11616
|
-
ue && (w.clearFocus(),
|
|
11631
|
+
ue && (w.clearFocus(), W.infoTick.value++);
|
|
11617
11632
|
}
|
|
11618
11633
|
};
|
|
11619
11634
|
async function rt() {
|
|
@@ -11621,26 +11636,26 @@ function qh(e, n) {
|
|
|
11621
11636
|
await s.ready;
|
|
11622
11637
|
let t = e.session || {};
|
|
11623
11638
|
if (t.id) {
|
|
11624
|
-
|
|
11625
|
-
let e = await s.load(n,
|
|
11626
|
-
e ? (
|
|
11639
|
+
W.sessionId = t.id;
|
|
11640
|
+
let e = await s.load(n, W.sessionId);
|
|
11641
|
+
e ? (W.applySnapshot(e), We({
|
|
11627
11642
|
type: "session_restored",
|
|
11628
|
-
sessionId:
|
|
11643
|
+
sessionId: W.sessionId,
|
|
11629
11644
|
rounds: e.messages?.length ?? 0
|
|
11630
|
-
})) : await s.createSession(n, t.title,
|
|
11645
|
+
})) : await s.createSession(n, t.title, W.sessionId);
|
|
11631
11646
|
} else if (t.autoResume !== !1) {
|
|
11632
11647
|
let r = await s.listSessions(n);
|
|
11633
11648
|
if (e.debug && console.log("[page-agent-sdk][restore] listSessions", n, r.length, r.map((e) => e.sessionId)), r.length) {
|
|
11634
|
-
|
|
11635
|
-
let t = await s.load(n,
|
|
11636
|
-
t ? (
|
|
11649
|
+
W.sessionId = r[0].sessionId;
|
|
11650
|
+
let t = await s.load(n, W.sessionId);
|
|
11651
|
+
t ? (W.applySnapshot(t), We({
|
|
11637
11652
|
type: "session_restored",
|
|
11638
|
-
sessionId:
|
|
11653
|
+
sessionId: W.sessionId,
|
|
11639
11654
|
rounds: t.messages?.length ?? 0
|
|
11640
|
-
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话",
|
|
11641
|
-
} else
|
|
11642
|
-
} else
|
|
11643
|
-
e.memory && s.save(n,
|
|
11655
|
+
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话", W.sessionId, `${t.messages?.length ?? 0} msgs`)) : e.debug && console.log("[page-agent-sdk][restore] 会话 meta 存在但快照为空", W.sessionId);
|
|
11656
|
+
} else W.sessionId = await s.createSession(n, t.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", W.sessionId);
|
|
11657
|
+
} else W.sessionId = await s.createSession(n, t.title);
|
|
11658
|
+
e.memory && s.save(n, W.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), nt();
|
|
11644
11659
|
}
|
|
11645
11660
|
async function it() {
|
|
11646
11661
|
await Ze();
|
|
@@ -11661,7 +11676,7 @@ function qh(e, n) {
|
|
|
11661
11676
|
let e = Kd(v, et);
|
|
11662
11677
|
if (!e.trimmed) return;
|
|
11663
11678
|
let { older: t, summary: n } = e;
|
|
11664
|
-
if (
|
|
11679
|
+
if (We({
|
|
11665
11680
|
type: "context_trimmed",
|
|
11666
11681
|
dropped: t.map((e) => ({
|
|
11667
11682
|
round: e.round,
|
|
@@ -11685,43 +11700,43 @@ function qh(e, n) {
|
|
|
11685
11700
|
}
|
|
11686
11701
|
let ct, lt = !1;
|
|
11687
11702
|
function ut() {
|
|
11688
|
-
if (!
|
|
11703
|
+
if (!W.sessionId || !s) return;
|
|
11689
11704
|
let t = JSON.parse(JSON.stringify(v));
|
|
11690
|
-
s.save(n,
|
|
11691
|
-
let r =
|
|
11692
|
-
if (s.save(n,
|
|
11705
|
+
s.save(n, W.sessionId, { messages: t });
|
|
11706
|
+
let r = W.agent?.getState?.()?.todos ?? [];
|
|
11707
|
+
if (s.save(n, W.sessionId, { todos: r }), xe) {
|
|
11693
11708
|
let e = C.getMission();
|
|
11694
|
-
e && s.save(n,
|
|
11709
|
+
e && s.save(n, W.sessionId, { mission: e });
|
|
11695
11710
|
}
|
|
11696
11711
|
if (Se) {
|
|
11697
11712
|
let e = T.getWorkingMemory();
|
|
11698
|
-
e && s.save(n,
|
|
11713
|
+
e && s.save(n, W.sessionId, { workingMemory: e });
|
|
11699
11714
|
}
|
|
11700
11715
|
if (ue) {
|
|
11701
11716
|
let e = w.getFocuses();
|
|
11702
|
-
s.save(n,
|
|
11717
|
+
s.save(n, W.sessionId, { focus: e.length ? e : null });
|
|
11703
11718
|
}
|
|
11704
|
-
L && j && (s.save(n,
|
|
11719
|
+
L && j && (s.save(n, W.sessionId, { checkpoints: j.exportStack() }), s.save(n, W.sessionId, { usage: i }));
|
|
11705
11720
|
let a = Qf(v);
|
|
11706
|
-
a && a !== ct && (ct = a, s.updateTitle(n,
|
|
11721
|
+
a && a !== ct && (ct = a, s.updateTitle(n, W.sessionId, a)), e.autoTitle !== !1 && u && !lt && v.some((e) => e.role === "user") && v.some((e) => e.role === "assistant") && (lt = !0, (async () => {
|
|
11707
11722
|
let e = await u(v);
|
|
11708
|
-
e && (await s.updateTitle(n,
|
|
11709
|
-
})()), e.debug && console.log("[page-agent-sdk][persist] save",
|
|
11723
|
+
e && (await s.updateTitle(n, W.sessionId, e), await nt());
|
|
11724
|
+
})()), e.debug && console.log("[page-agent-sdk][persist] save", W.sessionId, `${v.length} msgs`);
|
|
11710
11725
|
}
|
|
11711
|
-
return
|
|
11726
|
+
return W.initDone = (async () => {
|
|
11712
11727
|
if (await rt(), await it(), e.mcp?.length) {
|
|
11713
11728
|
let t = await Promise.allSettled(e.mcp.map((e) => Wf(e)));
|
|
11714
|
-
|
|
11729
|
+
W.mcpClosers = t.flatMap((e) => e.status === "fulfilled" ? [e.value.close] : []), W.mcpServers = [], t.forEach((t, n) => {
|
|
11715
11730
|
let r = e.mcp[n], i = r.name ?? r.url;
|
|
11716
|
-
t.status === "fulfilled" ? (
|
|
11731
|
+
t.status === "fulfilled" ? (W.mcpServers.push({
|
|
11717
11732
|
name: i,
|
|
11718
11733
|
url: r.url,
|
|
11719
11734
|
toolCount: t.value.tools.length
|
|
11720
11735
|
}), t.value.tools.forEach((e) => re.set(e.name, `mcp:${i}`)), oe.push(...t.value.tools)) : console.warn(`[page-agent-sdk][mcp] server ${i} 连接失败:`, t.reason);
|
|
11721
|
-
}), ve = ye(), e.debug && console.log(`[page-agent-sdk][mcp] 注入 ${oe.length} 个工具,${
|
|
11736
|
+
}), ve = ye(), e.debug && console.log(`[page-agent-sdk][mcp] 注入 ${oe.length} 个工具,${W.mcpServers.length} 个 server`);
|
|
11722
11737
|
}
|
|
11723
11738
|
let t = $f(e.llm) ? e.llm : await x(e.llm);
|
|
11724
|
-
|
|
11739
|
+
W.agent = hu({
|
|
11725
11740
|
llm: t,
|
|
11726
11741
|
systemPrompt: ee,
|
|
11727
11742
|
tools: ve,
|
|
@@ -11737,7 +11752,7 @@ function qh(e, n) {
|
|
|
11737
11752
|
},
|
|
11738
11753
|
onTrace: I ? (e, t) => {
|
|
11739
11754
|
try {
|
|
11740
|
-
|
|
11755
|
+
We({
|
|
11741
11756
|
type: "trace",
|
|
11742
11757
|
spans: e,
|
|
11743
11758
|
metrics: t
|
|
@@ -11745,10 +11760,10 @@ function qh(e, n) {
|
|
|
11745
11760
|
} catch {}
|
|
11746
11761
|
} : void 0,
|
|
11747
11762
|
debug: e.debug
|
|
11748
|
-
}), D.current =
|
|
11749
|
-
|
|
11763
|
+
}), D.current = W.agent, Fe && Fe.setReconfigureHook && Fe.setReconfigureHook(() => {
|
|
11764
|
+
W.agent && W.agent.setTools(ye());
|
|
11750
11765
|
});
|
|
11751
|
-
})(),
|
|
11766
|
+
})(), W;
|
|
11752
11767
|
}
|
|
11753
11768
|
function Jh(e, t) {
|
|
11754
11769
|
let n = e.id ?? up();
|
|
@@ -11954,7 +11969,7 @@ function Jh(e, t) {
|
|
|
11954
11969
|
//#endregion
|
|
11955
11970
|
//#region src/core/composables/useChat.ts
|
|
11956
11971
|
function Yh(e = {}) {
|
|
11957
|
-
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i } = e, a = /* @__PURE__ */
|
|
11972
|
+
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i } = e, a = /* @__PURE__ */ an({
|
|
11958
11973
|
messages: e.messages ?? [],
|
|
11959
11974
|
loading: !1,
|
|
11960
11975
|
error: null
|
|
@@ -11980,7 +11995,7 @@ function Yh(e = {}) {
|
|
|
11980
11995
|
}
|
|
11981
11996
|
async function h(e) {
|
|
11982
11997
|
if (s.value = !0, n) {
|
|
11983
|
-
let t = /* @__PURE__ */
|
|
11998
|
+
let t = /* @__PURE__ */ an({
|
|
11984
11999
|
role: "assistant",
|
|
11985
12000
|
content: "",
|
|
11986
12001
|
timestamp: Date.now(),
|
|
@@ -21158,26 +21173,26 @@ function _b() {
|
|
|
21158
21173
|
"mn",
|
|
21159
21174
|
"ms",
|
|
21160
21175
|
"mtext"
|
|
21161
|
-
]), Ge = Fy({}, We), Ke = sy(["annotation-xml"]),
|
|
21176
|
+
]), Ge = Fy({}, We), Ke = sy(["annotation-xml"]), qe = Fy({}, Ke), Je = Fy({}, [
|
|
21162
21177
|
"title",
|
|
21163
21178
|
"style",
|
|
21164
21179
|
"font",
|
|
21165
21180
|
"a",
|
|
21166
21181
|
"script"
|
|
21167
|
-
]),
|
|
21182
|
+
]), Ye = null, Xe = ["application/xhtml+xml", "text/html"], Ze = null, Qe = null, $e = n.createElement("form"), et = function(e) {
|
|
21168
21183
|
return e instanceof RegExp || e instanceof Function;
|
|
21169
|
-
},
|
|
21184
|
+
}, tt = function() {
|
|
21170
21185
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
21171
|
-
if (
|
|
21172
|
-
(!e || typeof e != "object") && (e = {}), e = Ly(e),
|
|
21173
|
-
transform:
|
|
21186
|
+
if (Qe && Qe === e) return;
|
|
21187
|
+
(!e || typeof e != "object") && (e = {}), e = Ly(e), Ye = Xe.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Ze = Ye === "application/xhtml+xml" ? by : yy, V = gb(e, "ALLOWED_TAGS", oe, { transform: Ze }), se = gb(e, "ALLOWED_ATTR", ce, { transform: Ze }), He = gb(e, "ALLOWED_NAMESPACES", Ue, { transform: by }), Ie = gb(e, "ADD_URI_SAFE_ATTR", Le, {
|
|
21188
|
+
transform: Ze,
|
|
21174
21189
|
base: Le
|
|
21175
21190
|
}), Pe = gb(e, "ADD_DATA_URI_TAGS", Fe, {
|
|
21176
|
-
transform:
|
|
21191
|
+
transform: Ze,
|
|
21177
21192
|
base: Fe
|
|
21178
|
-
}), Me = gb(e, "FORBID_CONTENTS", Ne, { transform:
|
|
21193
|
+
}), Me = gb(e, "FORBID_CONTENTS", Ne, { transform: Ze }), ue = gb(e, "FORBID_TAGS", Ly({}), { transform: Ze }), de = gb(e, "FORBID_ATTR", Ly({}), { transform: Ze }), je = ky(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Ly(e.USE_PROFILES) : e.USE_PROFILES : !1, pe = e.ALLOW_ARIA_ATTR !== !1, me = e.ALLOW_DATA_ATTR !== !1, he = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ge = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, _e = e.SAFE_FOR_TEMPLATES || !1, ve = e.SAFE_FOR_XML !== !1, ye = e.WHOLE_DOCUMENT || !1, we = e.RETURN_DOM || !1, Te = e.RETURN_DOM_FRAGMENT || !1, Ee = e.RETURN_TRUSTED_TYPE || !1, Ce = e.FORCE_BODY || !1, De = e.SANITIZE_DOM !== !1, Oe = e.SANITIZE_NAMED_PROPS || !1, ke = e.KEEP_CONTENT !== !1, Ae = e.IN_PLACE || !1, ae = By(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : rb, U = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Be, Ge = ky(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Ly(e.MATHML_TEXT_INTEGRATION_POINTS) : Fy({}, We), qe = ky(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Ly(e.HTML_INTEGRATION_POINTS) : Fy({}, Ke);
|
|
21179
21194
|
let t = ky(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Ly(e.CUSTOM_ELEMENT_HANDLING) : ly(null);
|
|
21180
|
-
if (le = ly(null), ky(t, "tagNameCheck") &&
|
|
21195
|
+
if (le = ly(null), ky(t, "tagNameCheck") && et(t.tagNameCheck) && (le.tagNameCheck = t.tagNameCheck), ky(t, "attributeNameCheck") && et(t.attributeNameCheck) && (le.attributeNameCheck = t.attributeNameCheck), ky(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (le.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), cy(le), _e && (me = !1), Te && (we = !0), je && (V = Fy({}, qy), se = ly(null), je.html === !0 && (Fy(V, Vy), Fy(se, Jy)), je.svg === !0 && (Fy(V, Hy), Fy(se, Yy), Fy(se, Zy)), je.svgFilters === !0 && (Fy(V, Uy), Fy(se, Yy), Fy(se, Zy)), je.mathMl === !0 && (Fy(V, Gy), Fy(se, Xy), Fy(se, Zy))), fe.tagCheck = null, fe.attributeCheck = null, ky(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? fe.tagCheck = e.ADD_TAGS : vy(e.ADD_TAGS) && (V === oe && (V = Ly(V)), Fy(V, e.ADD_TAGS, Ze))), ky(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? fe.attributeCheck = e.ADD_ATTR : vy(e.ADD_ATTR) && (se === ce && (se = Ly(se)), Fy(se, e.ADD_ATTR, Ze))), ky(e, "ADD_URI_SAFE_ATTR") && vy(e.ADD_URI_SAFE_ATTR) && Fy(Ie, e.ADD_URI_SAFE_ATTR, Ze), ky(e, "FORBID_CONTENTS") && vy(e.FORBID_CONTENTS) && (Me === Ne && (Me = Ly(Me)), Fy(Me, e.FORBID_CONTENTS, Ze)), ky(e, "ADD_FORBID_CONTENTS") && vy(e.ADD_FORBID_CONTENTS) && (Me === Ne && (Me = Ly(Me)), Fy(Me, e.ADD_FORBID_CONTENTS, Ze)), ke && (V["#text"] = !0), ye && Fy(V, [
|
|
21181
21196
|
"html",
|
|
21182
21197
|
"head",
|
|
21183
21198
|
"body"
|
|
@@ -21192,34 +21207,34 @@ function _b() {
|
|
|
21192
21207
|
throw S = t, e;
|
|
21193
21208
|
}
|
|
21194
21209
|
} else e.TRUSTED_TYPES_POLICY === null ? (S = void 0, C = "") : (S === void 0 && (S = A()), S && typeof C == "string" && (C = O("")));
|
|
21195
|
-
sy && sy(e),
|
|
21196
|
-
},
|
|
21210
|
+
sy && sy(e), Qe = e;
|
|
21211
|
+
}, nt = Fy({}, [
|
|
21197
21212
|
...Hy,
|
|
21198
21213
|
...Uy,
|
|
21199
21214
|
...Wy
|
|
21200
|
-
]),
|
|
21201
|
-
return t.namespaceURI === Be ? e === "svg" : t.namespaceURI === Re ? e === "svg" && (n === "annotation-xml" || Ge[n]) : !!
|
|
21202
|
-
}, rt = function(e, t, n) {
|
|
21203
|
-
return t.namespaceURI === Be ? e === "math" : t.namespaceURI === ze ? e === "math" && W[n] : !!nt[e];
|
|
21215
|
+
]), W = Fy({}, [...Gy, ...Ky]), rt = function(e, t, n) {
|
|
21216
|
+
return t.namespaceURI === Be ? e === "svg" : t.namespaceURI === Re ? e === "svg" && (n === "annotation-xml" || Ge[n]) : !!nt[e];
|
|
21204
21217
|
}, it = function(e, t, n) {
|
|
21205
|
-
return t.namespaceURI ===
|
|
21206
|
-
}, at = function(e) {
|
|
21218
|
+
return t.namespaceURI === Be ? e === "math" : t.namespaceURI === ze ? e === "math" && qe[n] : !!W[e];
|
|
21219
|
+
}, at = function(e, t, n) {
|
|
21220
|
+
return t.namespaceURI === ze && !qe[n] || t.namespaceURI === Re && !Ge[n] ? !1 : !W[e] && (Je[e] || !nt[e]);
|
|
21221
|
+
}, ot = function(e) {
|
|
21207
21222
|
let t = g(e);
|
|
21208
21223
|
(!t || !t.tagName) && (t = {
|
|
21209
21224
|
namespaceURI: U,
|
|
21210
21225
|
tagName: "template"
|
|
21211
21226
|
});
|
|
21212
21227
|
let n = yy(e.tagName), r = yy(t.tagName);
|
|
21213
|
-
return He[e.namespaceURI] ? e.namespaceURI === ze ?
|
|
21214
|
-
},
|
|
21228
|
+
return He[e.namespaceURI] ? e.namespaceURI === ze ? rt(n, t, r) : e.namespaceURI === Re ? it(n, t, r) : e.namespaceURI === Be ? at(n, t, r) : !!(Ye === "application/xhtml+xml" && He[e.namespaceURI]) : !1;
|
|
21229
|
+
}, st = function(e) {
|
|
21215
21230
|
gy(t.removed, { element: e });
|
|
21216
21231
|
try {
|
|
21217
21232
|
g(e).removeChild(e);
|
|
21218
21233
|
} catch {
|
|
21219
21234
|
if (p(e), !g(e)) throw My("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
21220
21235
|
}
|
|
21221
|
-
},
|
|
21222
|
-
|
|
21236
|
+
}, ct = function(e) {
|
|
21237
|
+
dt(e);
|
|
21223
21238
|
let t = h(e);
|
|
21224
21239
|
if (t) {
|
|
21225
21240
|
let e = [];
|
|
@@ -21238,7 +21253,7 @@ function _b() {
|
|
|
21238
21253
|
e.removeAttribute(i);
|
|
21239
21254
|
} catch {}
|
|
21240
21255
|
}
|
|
21241
|
-
},
|
|
21256
|
+
}, lt = function(e, n) {
|
|
21242
21257
|
try {
|
|
21243
21258
|
gy(t.removed, {
|
|
21244
21259
|
attribute: n.getAttributeNode(e),
|
|
@@ -21251,28 +21266,28 @@ function _b() {
|
|
|
21251
21266
|
});
|
|
21252
21267
|
}
|
|
21253
21268
|
if (n.removeAttribute(e), e === "is") if (we || Te) try {
|
|
21254
|
-
|
|
21269
|
+
st(n);
|
|
21255
21270
|
} catch {}
|
|
21256
21271
|
else try {
|
|
21257
21272
|
n.setAttribute(e, "");
|
|
21258
21273
|
} catch {}
|
|
21259
|
-
},
|
|
21274
|
+
}, ut = function(e) {
|
|
21260
21275
|
let t = v(e);
|
|
21261
21276
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
21262
21277
|
let r = t[n], i = r && r.name;
|
|
21263
|
-
if (!(typeof i != "string" || se[
|
|
21278
|
+
if (!(typeof i != "string" || se[Ze(i)])) try {
|
|
21264
21279
|
e.removeAttribute(i);
|
|
21265
21280
|
} catch {}
|
|
21266
21281
|
}
|
|
21267
|
-
},
|
|
21282
|
+
}, dt = function(e) {
|
|
21268
21283
|
let t = [e];
|
|
21269
21284
|
for (; t.length > 0;) {
|
|
21270
21285
|
let e = t.pop();
|
|
21271
|
-
(y ? y(e) : e.nodeType) === fb.element &&
|
|
21286
|
+
(y ? y(e) : e.nodeType) === fb.element && ut(e);
|
|
21272
21287
|
let n = h(e);
|
|
21273
21288
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
21274
21289
|
}
|
|
21275
|
-
},
|
|
21290
|
+
}, ft = function(e) {
|
|
21276
21291
|
if (!ve) return;
|
|
21277
21292
|
let t = [e];
|
|
21278
21293
|
for (; t.length > 0;) {
|
|
@@ -21284,7 +21299,7 @@ function _b() {
|
|
|
21284
21299
|
continue;
|
|
21285
21300
|
}
|
|
21286
21301
|
if (n === fb.element) {
|
|
21287
|
-
let t = e, n =
|
|
21302
|
+
let t = e, n = Ze(b ? b(e) : e.nodeName);
|
|
21288
21303
|
try {
|
|
21289
21304
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
|
|
21290
21305
|
} catch {}
|
|
@@ -21292,17 +21307,17 @@ function _b() {
|
|
|
21292
21307
|
let r = h(e);
|
|
21293
21308
|
if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
|
|
21294
21309
|
}
|
|
21295
|
-
},
|
|
21310
|
+
}, pt = function(e) {
|
|
21296
21311
|
let t = null, r = null;
|
|
21297
21312
|
if (Ce) e = "<remove></remove>" + e;
|
|
21298
21313
|
else {
|
|
21299
21314
|
let t = xy(e, /^[\r\n\t ]+/);
|
|
21300
21315
|
r = t && t[0];
|
|
21301
21316
|
}
|
|
21302
|
-
|
|
21317
|
+
Ye === "application/xhtml+xml" && U === Be && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
21303
21318
|
let i = S ? O(e) : e;
|
|
21304
21319
|
if (U === Be) try {
|
|
21305
|
-
t = new l().parseFromString(i,
|
|
21320
|
+
t = new l().parseFromString(i, Ye);
|
|
21306
21321
|
} catch {}
|
|
21307
21322
|
if (!t || !t.documentElement) {
|
|
21308
21323
|
t = M.createDocument(U, "template", null);
|
|
@@ -21312,30 +21327,30 @@ function _b() {
|
|
|
21312
21327
|
}
|
|
21313
21328
|
let a = t.body || t.documentElement;
|
|
21314
21329
|
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), U === Be ? F.call(t, ye ? "html" : "body")[0] : ye ? t.documentElement : a;
|
|
21315
|
-
},
|
|
21330
|
+
}, mt = function(e) {
|
|
21316
21331
|
let t = x ? x(e) : e.ownerDocument;
|
|
21317
21332
|
return N.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
21318
|
-
}, mt = function(e) {
|
|
21319
|
-
return e = Sy(e, ee, " "), e = Sy(e, te, " "), e = Sy(e, R, " "), e;
|
|
21320
21333
|
}, ht = function(e) {
|
|
21334
|
+
return e = Sy(e, ee, " "), e = Sy(e, te, " "), e = Sy(e, R, " "), e;
|
|
21335
|
+
}, gt = function(e) {
|
|
21321
21336
|
e.normalize();
|
|
21322
21337
|
let t = x ? x(e) : e.ownerDocument, n = N.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
21323
|
-
for (; r;) r.data =
|
|
21338
|
+
for (; r;) r.data = ht(r.data), r = n.nextNode();
|
|
21324
21339
|
let i = e.querySelectorAll?.call(e, "template");
|
|
21325
21340
|
i && py(i, (e) => {
|
|
21326
|
-
|
|
21341
|
+
vt(e.content) && gt(e.content);
|
|
21327
21342
|
});
|
|
21328
|
-
}, gt = function(e) {
|
|
21329
|
-
let t = b ? b(e) : null;
|
|
21330
|
-
return typeof t != "string" || Xe(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== v(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== y(e) || e.childNodes !== h(e);
|
|
21331
21343
|
}, _t = function(e) {
|
|
21344
|
+
let t = b ? b(e) : null;
|
|
21345
|
+
return typeof t != "string" || Ze(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== v(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== y(e) || e.childNodes !== h(e);
|
|
21346
|
+
}, vt = function(e) {
|
|
21332
21347
|
if (!y || typeof e != "object" || !e) return !1;
|
|
21333
21348
|
try {
|
|
21334
21349
|
return y(e) === fb.documentFragment;
|
|
21335
21350
|
} catch {
|
|
21336
21351
|
return !1;
|
|
21337
21352
|
}
|
|
21338
|
-
},
|
|
21353
|
+
}, yt = function(e) {
|
|
21339
21354
|
if (!y || typeof e != "object" || !e) return !1;
|
|
21340
21355
|
try {
|
|
21341
21356
|
return typeof y(e) == "number";
|
|
@@ -21343,15 +21358,15 @@ function _b() {
|
|
|
21343
21358
|
return !1;
|
|
21344
21359
|
}
|
|
21345
21360
|
};
|
|
21346
|
-
function
|
|
21361
|
+
function bt(e, n, r) {
|
|
21347
21362
|
e.length !== 0 && py(e, (e) => {
|
|
21348
|
-
e.call(t, n, r,
|
|
21363
|
+
e.call(t, n, r, Qe);
|
|
21349
21364
|
});
|
|
21350
21365
|
}
|
|
21351
|
-
let
|
|
21352
|
-
return !!(ve && e.hasChildNodes() && !
|
|
21353
|
-
},
|
|
21354
|
-
if (!ue[t] &&
|
|
21366
|
+
let xt = function(e, t) {
|
|
21367
|
+
return !!(ve && e.hasChildNodes() && !yt(e.firstElementChild) && jy(cb, e.textContent) && jy(cb, e.innerHTML) || ve && e.namespaceURI === Be && t === "style" && yt(e.firstElementChild) || e.nodeType === fb.processingInstruction || ve && e.nodeType === fb.comment && jy(lb, e.data));
|
|
21368
|
+
}, St = function(e, t, n) {
|
|
21369
|
+
if (!ue[t] && Dt(t) && (le.tagNameCheck instanceof RegExp && jy(le.tagNameCheck, t) || le.tagNameCheck instanceof Function && le.tagNameCheck(t))) return !1;
|
|
21355
21370
|
if (ke && !Me[t]) {
|
|
21356
21371
|
let t = g(e), r = h(e);
|
|
21357
21372
|
if (r && t) {
|
|
@@ -21362,38 +21377,38 @@ function _b() {
|
|
|
21362
21377
|
}
|
|
21363
21378
|
}
|
|
21364
21379
|
}
|
|
21365
|
-
return
|
|
21366
|
-
},
|
|
21380
|
+
return st(e), !0;
|
|
21381
|
+
}, Ct = function(e, t, n, r) {
|
|
21367
21382
|
return e.length === 0 ? t : t === n || t === r ? Ly(t) : t;
|
|
21368
|
-
},
|
|
21369
|
-
if (
|
|
21370
|
-
if (
|
|
21371
|
-
let r =
|
|
21372
|
-
if (V =
|
|
21383
|
+
}, wt = function(e, n) {
|
|
21384
|
+
if (bt(L.beforeSanitizeElements, e, null), e !== n && g(e) === null) return Ae && dt(e), !0;
|
|
21385
|
+
if (_t(e)) return st(e), !0;
|
|
21386
|
+
let r = Ze(b ? b(e) : e.nodeName);
|
|
21387
|
+
if (V = Ct(L.uponSanitizeElement, V, oe, xe), bt(L.uponSanitizeElement, e, {
|
|
21373
21388
|
tagName: r,
|
|
21374
21389
|
allowedTags: V
|
|
21375
|
-
}), e !== n && g(e) === null) return Ae &&
|
|
21376
|
-
if (
|
|
21390
|
+
}), e !== n && g(e) === null) return Ae && dt(e), !0;
|
|
21391
|
+
if (xt(e, r)) return st(e), !0;
|
|
21377
21392
|
if (ue[r] || !(fe.tagCheck instanceof Function && fe.tagCheck(r)) && !V[r]) {
|
|
21378
|
-
let t =
|
|
21379
|
-
return t === !1 &&
|
|
21393
|
+
let t = St(e, r, n);
|
|
21394
|
+
return t === !1 && bt(L.afterSanitizeElements, e, null), t;
|
|
21380
21395
|
}
|
|
21381
|
-
if ((y ? y(e) : e.nodeType) === fb.element && !
|
|
21396
|
+
if ((y ? y(e) : e.nodeType) === fb.element && !ot(e) || (r === "noscript" || r === "noembed" || r === "noframes") && jy(ub, e.innerHTML)) return st(e), !0;
|
|
21382
21397
|
if (_e && e.nodeType === fb.text) {
|
|
21383
|
-
let n =
|
|
21398
|
+
let n = ht(e.textContent);
|
|
21384
21399
|
e.textContent !== n && (gy(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
21385
21400
|
}
|
|
21386
|
-
return
|
|
21387
|
-
},
|
|
21388
|
-
if (de[t] || ve && t === "patchsrc" || ve && t === "for" && e !== "label" && e !== "output" || De && (t === "id" || t === "name") && (r in n || r in
|
|
21401
|
+
return bt(L.afterSanitizeElements, e, null), !1;
|
|
21402
|
+
}, Tt = function(e, t, r) {
|
|
21403
|
+
if (de[t] || ve && t === "patchsrc" || ve && t === "for" && e !== "label" && e !== "output" || De && (t === "id" || t === "name") && (r in n || r in $e)) return !1;
|
|
21389
21404
|
let i = se[t] || fe.attributeCheck instanceof Function && fe.attributeCheck(t, e);
|
|
21390
21405
|
if (!(me && jy(z, t)) && !(pe && jy(ne, t))) {
|
|
21391
21406
|
if (!i) {
|
|
21392
|
-
if (!(
|
|
21407
|
+
if (!(Dt(e) && (le.tagNameCheck instanceof RegExp && jy(le.tagNameCheck, e) || le.tagNameCheck instanceof Function && le.tagNameCheck(e)) && (le.attributeNameCheck instanceof RegExp && jy(le.attributeNameCheck, t) || le.attributeNameCheck instanceof Function && le.attributeNameCheck(t, e)) || t === "is" && le.allowCustomizedBuiltInElements && (le.tagNameCheck instanceof RegExp && jy(le.tagNameCheck, r) || le.tagNameCheck instanceof Function && le.tagNameCheck(r)))) return !1;
|
|
21393
21408
|
} else if (!Ie[t] && !jy(ae, Sy(r, re, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Cy(r, "data:") === 0 && Pe[e]) && !(he && !jy(B, Sy(r, re, ""))) && r) return !1;
|
|
21394
21409
|
}
|
|
21395
21410
|
return !0;
|
|
21396
|
-
},
|
|
21411
|
+
}, Et = Fy({}, [
|
|
21397
21412
|
"annotation-xml",
|
|
21398
21413
|
"color-profile",
|
|
21399
21414
|
"font-face",
|
|
@@ -21402,67 +21417,67 @@ function _b() {
|
|
|
21402
21417
|
"font-face-src",
|
|
21403
21418
|
"font-face-uri",
|
|
21404
21419
|
"missing-glyph"
|
|
21405
|
-
]),
|
|
21406
|
-
return !
|
|
21407
|
-
},
|
|
21420
|
+
]), Dt = function(e) {
|
|
21421
|
+
return !Et[yy(e)] && jy(ie, e);
|
|
21422
|
+
}, Ot = function(e, t, n, r) {
|
|
21408
21423
|
if (S && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
21409
21424
|
case "TrustedHTML": return O(r);
|
|
21410
21425
|
case "TrustedScriptURL": return k(r);
|
|
21411
21426
|
}
|
|
21412
21427
|
return r;
|
|
21413
|
-
},
|
|
21428
|
+
}, kt = function(e, n, r, i) {
|
|
21414
21429
|
try {
|
|
21415
|
-
r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i),
|
|
21430
|
+
r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i), _t(e) ? st(e) : hy(t.removed);
|
|
21416
21431
|
} catch {
|
|
21417
|
-
|
|
21432
|
+
lt(n, e);
|
|
21418
21433
|
}
|
|
21419
|
-
},
|
|
21420
|
-
|
|
21434
|
+
}, At = function(e) {
|
|
21435
|
+
bt(L.beforeSanitizeAttributes, e, null);
|
|
21421
21436
|
let t = e.attributes;
|
|
21422
|
-
if (!t ||
|
|
21423
|
-
se =
|
|
21437
|
+
if (!t || _t(e)) return;
|
|
21438
|
+
se = Ct(L.uponSanitizeAttribute, se, ce, Se);
|
|
21424
21439
|
let n = {
|
|
21425
21440
|
attrName: "",
|
|
21426
21441
|
attrValue: "",
|
|
21427
21442
|
keepAttr: !0,
|
|
21428
21443
|
allowedAttributes: se,
|
|
21429
21444
|
forceKeepAttr: void 0
|
|
21430
|
-
}, r = t.length, i =
|
|
21445
|
+
}, r = t.length, i = Ze(e.nodeName);
|
|
21431
21446
|
for (; r--;) {
|
|
21432
|
-
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l =
|
|
21433
|
-
if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0,
|
|
21434
|
-
|
|
21447
|
+
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l = Ze(o), u = c, d = o === "value" ? u : wy(u);
|
|
21448
|
+
if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0, bt(L.uponSanitizeAttribute, e, n), d = n.attrValue, Oe && (l === "id" || l === "name") && Cy(d, H) !== 0 && (lt(o, e), d = H + d), ve && jy(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
|
|
21449
|
+
lt(o, e);
|
|
21435
21450
|
continue;
|
|
21436
21451
|
}
|
|
21437
21452
|
if (l === "attributename" && xy(d, "href")) {
|
|
21438
|
-
|
|
21453
|
+
lt(o, e);
|
|
21439
21454
|
continue;
|
|
21440
21455
|
}
|
|
21441
21456
|
if (!n.forceKeepAttr) {
|
|
21442
21457
|
if (!n.keepAttr) {
|
|
21443
|
-
|
|
21458
|
+
lt(o, e);
|
|
21444
21459
|
continue;
|
|
21445
21460
|
}
|
|
21446
21461
|
if (!ge && jy(db, d)) {
|
|
21447
|
-
|
|
21462
|
+
lt(o, e);
|
|
21448
21463
|
continue;
|
|
21449
21464
|
}
|
|
21450
|
-
if (_e && (d =
|
|
21451
|
-
|
|
21465
|
+
if (_e && (d = ht(d)), !Tt(i, l, d)) {
|
|
21466
|
+
lt(o, e);
|
|
21452
21467
|
continue;
|
|
21453
21468
|
}
|
|
21454
|
-
d =
|
|
21469
|
+
d = Ot(i, l, s, d), d !== u && kt(e, o, s, d);
|
|
21455
21470
|
}
|
|
21456
21471
|
}
|
|
21457
|
-
|
|
21458
|
-
},
|
|
21459
|
-
let t = null, n =
|
|
21460
|
-
for (
|
|
21472
|
+
bt(L.afterSanitizeAttributes, e, null);
|
|
21473
|
+
}, jt = function(e) {
|
|
21474
|
+
let t = null, n = mt(e);
|
|
21475
|
+
for (bt(L.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (bt(L.uponSanitizeShadowNode, t, null), wt(t, e), At(t), vt(t.content) && jt(t.content), (y ? y(t) : t.nodeType) === fb.element) {
|
|
21461
21476
|
let e = _(t);
|
|
21462
|
-
|
|
21477
|
+
vt(e) && (Mt(e), jt(e));
|
|
21463
21478
|
}
|
|
21464
|
-
|
|
21465
|
-
},
|
|
21479
|
+
bt(L.afterSanitizeShadowDOM, e, null);
|
|
21480
|
+
}, Mt = function(e) {
|
|
21466
21481
|
let t = [{
|
|
21467
21482
|
node: e,
|
|
21468
21483
|
shadow: null
|
|
@@ -21470,7 +21485,7 @@ function _b() {
|
|
|
21470
21485
|
for (; t.length > 0;) {
|
|
21471
21486
|
let e = t.pop();
|
|
21472
21487
|
if (e.shadow) {
|
|
21473
|
-
|
|
21488
|
+
jt(e.shadow);
|
|
21474
21489
|
continue;
|
|
21475
21490
|
}
|
|
21476
21491
|
let n = e.node, r = (y ? y(n) : n.nodeType) === fb.element, i = h(n);
|
|
@@ -21480,9 +21495,9 @@ function _b() {
|
|
|
21480
21495
|
});
|
|
21481
21496
|
if (r) {
|
|
21482
21497
|
let e = b ? b(n) : null;
|
|
21483
|
-
if (typeof e == "string" &&
|
|
21498
|
+
if (typeof e == "string" && Ze(e) === "template") {
|
|
21484
21499
|
let e = n.content;
|
|
21485
|
-
|
|
21500
|
+
vt(e) && t.push({
|
|
21486
21501
|
node: e,
|
|
21487
21502
|
shadow: null
|
|
21488
21503
|
});
|
|
@@ -21490,7 +21505,7 @@ function _b() {
|
|
|
21490
21505
|
}
|
|
21491
21506
|
if (r) {
|
|
21492
21507
|
let e = _(n);
|
|
21493
|
-
|
|
21508
|
+
vt(e) && t.push({
|
|
21494
21509
|
node: null,
|
|
21495
21510
|
shadow: e
|
|
21496
21511
|
}, {
|
|
@@ -21502,57 +21517,57 @@ function _b() {
|
|
|
21502
21517
|
};
|
|
21503
21518
|
return t.sanitize = function(e) {
|
|
21504
21519
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
21505
|
-
if (Ve = !e, Ve && (e = "<!-->"), typeof e != "string" && !
|
|
21520
|
+
if (Ve = !e, Ve && (e = "<!-->"), typeof e != "string" && !yt(e) && (e = Ry(e), typeof e != "string")) throw My("dirty is not a string, aborting");
|
|
21506
21521
|
if (!t.isSupported) return e;
|
|
21507
|
-
be ? (V = xe, se = Se) :
|
|
21508
|
-
let c = Ae && typeof e != "string" &&
|
|
21522
|
+
be ? (V = xe, se = Se) : tt(n), (L.uponSanitizeElement.length > 0 || L.uponSanitizeAttribute.length > 0) && (V = Ly(V)), L.uponSanitizeAttribute.length > 0 && (se = Ly(se)), t.removed = [];
|
|
21523
|
+
let c = Ae && typeof e != "string" && yt(e);
|
|
21509
21524
|
if (c) {
|
|
21510
|
-
|
|
21525
|
+
ft(e);
|
|
21511
21526
|
let t = b ? b(e) : e.nodeName;
|
|
21512
21527
|
if (typeof t == "string") {
|
|
21513
|
-
let n =
|
|
21514
|
-
if (!V[n] || ue[n]) throw
|
|
21528
|
+
let n = Ze(t);
|
|
21529
|
+
if (!V[n] || ue[n]) throw ct(e), My("root node is forbidden and cannot be sanitized in-place");
|
|
21515
21530
|
}
|
|
21516
|
-
if (
|
|
21531
|
+
if (_t(e)) throw ct(e), My("root node is clobbered and cannot be sanitized in-place");
|
|
21517
21532
|
try {
|
|
21518
|
-
|
|
21533
|
+
Mt(e);
|
|
21519
21534
|
} catch (t) {
|
|
21520
|
-
throw
|
|
21535
|
+
throw ct(e), t;
|
|
21521
21536
|
}
|
|
21522
|
-
} else if (
|
|
21537
|
+
} else if (yt(e)) i = pt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === fb.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Mt(a);
|
|
21523
21538
|
else {
|
|
21524
21539
|
if (!we && !_e && !ye && e.indexOf("<") === -1) return S && Ee ? O(e) : e;
|
|
21525
|
-
if (i =
|
|
21540
|
+
if (i = pt(e), !i) return we ? null : Ee ? C : "";
|
|
21526
21541
|
}
|
|
21527
|
-
i && Ce &&
|
|
21542
|
+
i && Ce && st(i.firstChild);
|
|
21528
21543
|
let l = c ? e : i;
|
|
21529
21544
|
try {
|
|
21530
|
-
let e =
|
|
21531
|
-
for (; o = e.nextNode();)
|
|
21545
|
+
let e = mt(l);
|
|
21546
|
+
for (; o = e.nextNode();) wt(o, l), At(o), vt(o.content) && jt(o.content);
|
|
21532
21547
|
} catch (n) {
|
|
21533
|
-
throw c && (
|
|
21534
|
-
e.element &&
|
|
21548
|
+
throw c && (ct(e), py(t.removed, (e) => {
|
|
21549
|
+
e.element && dt(e.element);
|
|
21535
21550
|
})), n;
|
|
21536
21551
|
}
|
|
21537
21552
|
if (c) return py(t.removed, (e) => {
|
|
21538
|
-
e.element &&
|
|
21539
|
-
}), _e &&
|
|
21553
|
+
e.element && dt(e.element);
|
|
21554
|
+
}), _e && gt(e), e;
|
|
21540
21555
|
if (we) {
|
|
21541
|
-
if (_e &&
|
|
21556
|
+
if (_e && gt(i), Te) for (s = P.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
21542
21557
|
else s = i;
|
|
21543
21558
|
return (se.shadowroot || se.shadowrootmode) && (s = I.call(r, s, !0)), s;
|
|
21544
21559
|
}
|
|
21545
21560
|
let u = ye ? i.outerHTML : i.innerHTML;
|
|
21546
|
-
return ye && V["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && jy(ob, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), _e && (u =
|
|
21561
|
+
return ye && V["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && jy(ob, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), _e && (u = ht(u)), S && Ee ? O(u) : u;
|
|
21547
21562
|
}, t.setConfig = function() {
|
|
21548
21563
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
21549
|
-
|
|
21564
|
+
tt(e), be = !0, xe = V, Se = se;
|
|
21550
21565
|
}, t.clearConfig = function() {
|
|
21551
|
-
|
|
21566
|
+
Qe = null, be = !1, xe = null, Se = null, S = w, C = "";
|
|
21552
21567
|
}, t.isValidAttribute = function(e, t, n) {
|
|
21553
|
-
|
|
21554
|
-
let r =
|
|
21555
|
-
return
|
|
21568
|
+
Qe || tt({});
|
|
21569
|
+
let r = Ze(e), i = Ze(t);
|
|
21570
|
+
return Tt(r, i, n);
|
|
21556
21571
|
}, t.addHook = function(e, t) {
|
|
21557
21572
|
typeof t == "function" && ky(L, e) && gy(L[e], t);
|
|
21558
21573
|
}, t.removeHook = function(e, t) {
|