@pie-players/pie-tool-graph 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/tool-graph.js +848 -825
  2. package/package.json +4 -4
@@ -1,27 +1,27 @@
1
1
  var ko = Object.defineProperty;
2
- var xr = (t) => {
2
+ var jn = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
5
  var Ao = (t, e, i) => e in t ? ko(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
6
- var S = (t, e, i) => Ao(t, typeof e != "symbol" ? e + "" : e, i), Ji = (t, e, i) => e.has(t) || xr("Cannot " + i);
7
- var f = (t, e, i) => (Ji(t, e, "read from private field"), i ? i.call(t) : e.get(t)), k = (t, e, i) => e.has(t) ? xr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i, r) => (Ji(t, e, "write to private field"), r ? r.call(t, i) : e.set(t, i), i), te = (t, e, i) => (Ji(t, e, "access private method"), i);
8
- var on;
9
- typeof window < "u" && ((on = window.__svelte ?? (window.__svelte = {})).v ?? (on.v = /* @__PURE__ */ new Set())).add("5");
10
- const Lo = 1, Oo = 2, sn = 4, Ro = 8, Vo = 16, Mo = 2, br = "[", Pi = "[!", yr = "]", Ut = {}, X = /* @__PURE__ */ Symbol(), ln = "http://www.w3.org/1999/xhtml", rr = !1;
11
- var an = Array.isArray, Co = Array.prototype.indexOf, Yt = Array.prototype.includes, zi = Array.from, Li = Object.keys, Oi = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, No = Object.getOwnPropertyDescriptors, Po = Object.prototype, zo = Array.prototype, cn = Object.getPrototypeOf, jr = Object.isExtensible;
6
+ var S = (t, e, i) => Ao(t, typeof e != "symbol" ? e + "" : e, i), Ji = (t, e, i) => e.has(t) || jn("Cannot " + i);
7
+ var f = (t, e, i) => (Ji(t, e, "read from private field"), i ? i.call(t) : e.get(t)), k = (t, e, i) => e.has(t) ? jn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i, n) => (Ji(t, e, "write to private field"), n ? n.call(t, i) : e.set(t, i), i), te = (t, e, i) => (Ji(t, e, "access private method"), i);
8
+ var or;
9
+ typeof window < "u" && ((or = window.__svelte ?? (window.__svelte = {})).v ?? (or.v = /* @__PURE__ */ new Set())).add("5");
10
+ const Lo = 1, Oo = 2, sr = 4, Ro = 8, Vo = 16, Mo = 2, yn = "[", Pi = "[!", wn = "]", Ut = {}, X = /* @__PURE__ */ Symbol(), lr = "http://www.w3.org/1999/xhtml", rn = !1;
11
+ var ar = Array.isArray, Co = Array.prototype.indexOf, Yt = Array.prototype.includes, zi = Array.from, Li = Object.keys, Oi = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, No = Object.getOwnPropertyDescriptors, Po = Object.prototype, zo = Array.prototype, cr = Object.getPrototypeOf, Hn = Object.isExtensible;
12
12
  const Do = () => {
13
13
  };
14
14
  function xo(t) {
15
15
  for (var e = 0; e < t.length; e++)
16
16
  t[e]();
17
17
  }
18
- function un() {
19
- var t, e, i = new Promise((r, o) => {
20
- t = r, e = o;
18
+ function ur() {
19
+ var t, e, i = new Promise((n, o) => {
20
+ t = n, e = o;
21
21
  });
22
22
  return { promise: i, resolve: t, reject: e };
23
23
  }
24
- const J = 2, ui = 4, Di = 8, fn = 1 << 24, st = 16, Oe = 32, vt = 64, nr = 128, _e = 512, q = 1024, Q = 2048, Le = 4096, ce = 8192, nt = 16384, Zt = 32768, Wt = 65536, Hr = 1 << 17, dn = 1 << 18, Ct = 1 << 19, jo = 1 << 20, tt = 1 << 25, Rt = 65536, or = 1 << 21, wr = 1 << 22, ft = 1 << 23, Si = /* @__PURE__ */ Symbol("$state"), Ho = /* @__PURE__ */ Symbol("legacy props"), Fo = /* @__PURE__ */ Symbol(""), yt = new class extends Error {
24
+ const J = 2, ui = 4, Di = 8, fr = 1 << 24, st = 16, Oe = 32, vt = 64, on = 128, _e = 512, q = 1024, Q = 2048, Le = 4096, ce = 8192, rt = 16384, Zt = 32768, Wt = 65536, Fn = 1 << 17, dr = 1 << 18, Ct = 1 << 19, jo = 1 << 20, tt = 1 << 25, Rt = 65536, sn = 1 << 21, Tn = 1 << 22, ft = 1 << 23, Si = /* @__PURE__ */ Symbol("$state"), Ho = /* @__PURE__ */ Symbol("legacy props"), Fo = /* @__PURE__ */ Symbol(""), yt = new class extends Error {
25
25
  constructor() {
26
26
  super(...arguments);
27
27
  S(this, "name", "StaleReactionError");
@@ -93,7 +93,7 @@ function he(t) {
93
93
  V = t;
94
94
  }
95
95
  }
96
- function rs(t = 1) {
96
+ function ns(t = 1) {
97
97
  if (R) {
98
98
  for (var e = t, i = V; e--; )
99
99
  i = /** @type {TemplateNode} */
@@ -104,15 +104,15 @@ function rs(t = 1) {
104
104
  function Ri(t = !0) {
105
105
  for (var e = 0, i = V; ; ) {
106
106
  if (i.nodeType === _i) {
107
- var r = (
107
+ var n = (
108
108
  /** @type {Comment} */
109
109
  i.data
110
110
  );
111
- if (r === yr) {
111
+ if (n === wn) {
112
112
  if (e === 0) return i;
113
113
  e -= 1;
114
- } else (r === br || r === Pi || // "[1", "[2", etc. for if blocks
115
- r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1);
114
+ } else (n === yn || n === Pi || // "[1", "[2", etc. for if blocks
115
+ n[0] === "[" && !isNaN(Number(n.slice(1)))) && (e += 1);
116
116
  }
117
117
  var o = (
118
118
  /** @type {TemplateNode} */
@@ -121,7 +121,7 @@ function Ri(t = !0) {
121
121
  t && i.remove(), i = o;
122
122
  }
123
123
  }
124
- function hn(t) {
124
+ function hr(t) {
125
125
  if (!t || t.nodeType !== _i)
126
126
  throw ji(), Ut;
127
127
  return (
@@ -129,20 +129,20 @@ function hn(t) {
129
129
  t.data
130
130
  );
131
131
  }
132
- function pn(t) {
132
+ function pr(t) {
133
133
  return t === this.v;
134
134
  }
135
- function ns(t, e) {
135
+ function rs(t, e) {
136
136
  return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function";
137
137
  }
138
- function vn(t) {
139
- return !ns(t, this.v);
138
+ function vr(t) {
139
+ return !rs(t, this.v);
140
140
  }
141
141
  let os = !1, ue = null;
142
142
  function Kt(t) {
143
143
  ue = t;
144
144
  }
145
- function gn(t, e = !1, i) {
145
+ function gr(t, e = !1, i) {
146
146
  ue = {
147
147
  p: ue,
148
148
  i: !1,
@@ -153,24 +153,24 @@ function gn(t, e = !1, i) {
153
153
  l: null
154
154
  };
155
155
  }
156
- function _n(t) {
156
+ function _r(t) {
157
157
  var e = (
158
158
  /** @type {ComponentContext} */
159
159
  ue
160
160
  ), i = e.e;
161
161
  if (i !== null) {
162
162
  e.e = null;
163
- for (var r of i)
164
- Fn(r);
163
+ for (var n of i)
164
+ Fr(n);
165
165
  }
166
166
  return t !== void 0 && (e.x = t), e.i = !0, ue = e.p, t ?? /** @type {T} */
167
167
  {};
168
168
  }
169
- function mn() {
169
+ function mr() {
170
170
  return !0;
171
171
  }
172
172
  let wt = [];
173
- function bn() {
173
+ function br() {
174
174
  var t = wt;
175
175
  wt = [], xo(t);
176
176
  }
@@ -178,16 +178,16 @@ function xe(t) {
178
178
  if (wt.length === 0 && !ai) {
179
179
  var e = wt;
180
180
  queueMicrotask(() => {
181
- e === wt && bn();
181
+ e === wt && br();
182
182
  });
183
183
  }
184
184
  wt.push(t);
185
185
  }
186
186
  function ss() {
187
187
  for (; wt.length > 0; )
188
- bn();
188
+ br();
189
189
  }
190
- function yn(t) {
190
+ function yr(t) {
191
191
  var e = M;
192
192
  if (e === null)
193
193
  return O.f |= ft, t;
@@ -197,7 +197,7 @@ function yn(t) {
197
197
  }
198
198
  function Xt(t, e) {
199
199
  for (; e !== null; ) {
200
- if ((e.f & nr) !== 0) {
200
+ if ((e.f & on) !== 0) {
201
201
  if ((e.f & Zt) === 0)
202
202
  throw t;
203
203
  try {
@@ -215,24 +215,24 @@ const ls = -7169;
215
215
  function j(t, e) {
216
216
  t.f = t.f & ls | e;
217
217
  }
218
- function Tr(t) {
218
+ function In(t) {
219
219
  (t.f & _e) !== 0 || t.deps === null ? j(t, q) : j(t, Le);
220
220
  }
221
- function wn(t) {
221
+ function wr(t) {
222
222
  if (t !== null)
223
223
  for (const e of t)
224
- (e.f & J) === 0 || (e.f & Rt) === 0 || (e.f ^= Rt, wn(
224
+ (e.f & J) === 0 || (e.f & Rt) === 0 || (e.f ^= Rt, wr(
225
225
  /** @type {Derived} */
226
226
  e.deps
227
227
  ));
228
228
  }
229
- function Tn(t, e, i) {
230
- (t.f & Q) !== 0 ? e.add(t) : (t.f & Le) !== 0 && i.add(t), wn(t.deps), j(t, q);
229
+ function Tr(t, e, i) {
230
+ (t.f & Q) !== 0 ? e.add(t) : (t.f & Le) !== 0 && i.add(t), wr(t.deps), j(t, q);
231
231
  }
232
232
  const Ti = /* @__PURE__ */ new Set();
233
- let N = null, sr = null, $e = null, re = [], Fi = null, lr = !1, ai = !1;
234
- var xt, jt, Et, Ht, di, hi, St, Xe, Ft, He, ar, cr, In;
235
- const Rr = class Rr {
233
+ let N = null, ln = null, $e = null, ne = [], Fi = null, an = !1, ai = !1;
234
+ var xt, jt, Et, Ht, di, hi, St, Xe, Ft, He, cn, un, Ir;
235
+ const Vn = class Vn {
236
236
  constructor() {
237
237
  k(this, He);
238
238
  S(this, "committed", !1);
@@ -313,10 +313,10 @@ const Rr = class Rr {
313
313
  var i = f(this, Xe).get(e);
314
314
  if (i) {
315
315
  f(this, Xe).delete(e);
316
- for (var r of i.d)
317
- j(r, Q), ke(r);
318
- for (r of i.m)
319
- j(r, Le), ke(r);
316
+ for (var n of i.d)
317
+ j(n, Q), ke(n);
318
+ for (n of i.m)
319
+ j(n, Le), ke(n);
320
320
  }
321
321
  }
322
322
  /**
@@ -324,17 +324,17 @@ const Rr = class Rr {
324
324
  * @param {Effect[]} root_effects
325
325
  */
326
326
  process(e) {
327
- re = [], this.apply();
328
- var i = [], r = [];
327
+ ne = [], this.apply();
328
+ var i = [], n = [];
329
329
  for (const o of e)
330
- te(this, He, ar).call(this, o, i, r);
330
+ te(this, He, cn).call(this, o, i, n);
331
331
  if (this.is_deferred()) {
332
- te(this, He, cr).call(this, r), te(this, He, cr).call(this, i);
333
- for (const [o, n] of f(this, Xe))
334
- kn(o, n);
332
+ te(this, He, un).call(this, n), te(this, He, un).call(this, i);
333
+ for (const [o, r] of f(this, Xe))
334
+ kr(o, r);
335
335
  } else {
336
336
  for (const o of f(this, xt)) o();
337
- f(this, xt).clear(), f(this, Et) === 0 && te(this, He, In).call(this), sr = this, N = null, Fr(r), Fr(i), sr = null, f(this, di)?.resolve();
337
+ f(this, xt).clear(), f(this, Et) === 0 && te(this, He, Ir).call(this), ln = this, N = null, Gn(n), Gn(i), ln = null, f(this, di)?.resolve();
338
338
  }
339
339
  $e = null;
340
340
  }
@@ -354,8 +354,8 @@ const Rr = class Rr {
354
354
  N === this && (N = null, $e = null);
355
355
  }
356
356
  flush() {
357
- if (this.activate(), re.length > 0) {
358
- if (En(), N !== null && N !== this)
357
+ if (this.activate(), ne.length > 0) {
358
+ if (Er(), N !== null && N !== this)
359
359
  return;
360
360
  } else f(this, Et) === 0 && this.process([]);
361
361
  this.deactivate();
@@ -377,7 +377,7 @@ const Rr = class Rr {
377
377
  */
378
378
  decrement(e) {
379
379
  E(this, Et, f(this, Et) - 1), e && E(this, Ht, f(this, Ht) - 1), !f(this, Ft) && (E(this, Ft, !0), xe(() => {
380
- E(this, Ft, !1), this.is_deferred() ? re.length > 0 && this.flush() : this.revive();
380
+ E(this, Ft, !1), this.is_deferred() ? ne.length > 0 && this.flush() : this.revive();
381
381
  }));
382
382
  }
383
383
  revive() {
@@ -396,11 +396,11 @@ const Rr = class Rr {
396
396
  f(this, jt).add(e);
397
397
  }
398
398
  settled() {
399
- return (f(this, di) ?? E(this, di, un())).promise;
399
+ return (f(this, di) ?? E(this, di, ur())).promise;
400
400
  }
401
401
  static ensure() {
402
402
  if (N === null) {
403
- const e = N = new Rr();
403
+ const e = N = new Vn();
404
404
  Ti.add(N), ai || xe(() => {
405
405
  N === e && e.flush();
406
406
  });
@@ -417,12 +417,12 @@ xt = new WeakMap(), jt = new WeakMap(), Et = new WeakMap(), Ht = new WeakMap(),
417
417
  * @param {Effect[]} effects
418
418
  * @param {Effect[]} render_effects
419
419
  */
420
- ar = function(e, i, r) {
420
+ cn = function(e, i, n) {
421
421
  e.f ^= q;
422
- for (var o = e.first, n = null; o !== null; ) {
422
+ for (var o = e.first, r = null; o !== null; ) {
423
423
  var s = o.f, a = (s & (Oe | vt)) !== 0, l = a && (s & q) !== 0, u = l || (s & ce) !== 0 || f(this, Xe).has(o);
424
424
  if (!u && o.fn !== null) {
425
- a ? o.f ^= q : n !== null && (s & (ui | Di | fn)) !== 0 ? n.b.defer_effect(o) : (s & ui) !== 0 ? i.push(o) : mi(o) && ((s & st) !== 0 && f(this, St).add(o), Qt(o));
425
+ a ? o.f ^= q : r !== null && (s & (ui | Di | fr)) !== 0 ? r.b.defer_effect(o) : (s & ui) !== 0 ? i.push(o) : mi(o) && ((s & st) !== 0 && f(this, St).add(o), Qt(o));
426
426
  var d = o.first;
427
427
  if (d !== null) {
428
428
  o = d;
@@ -430,7 +430,7 @@ ar = function(e, i, r) {
430
430
  }
431
431
  }
432
432
  for (; o !== null; ) {
433
- o === n && (n = null);
433
+ o === r && (r = null);
434
434
  var _ = o.next;
435
435
  if (_ !== null) {
436
436
  o = _;
@@ -442,79 +442,79 @@ ar = function(e, i, r) {
442
442
  }, /**
443
443
  * @param {Effect[]} effects
444
444
  */
445
- cr = function(e) {
445
+ un = function(e) {
446
446
  for (var i = 0; i < e.length; i += 1)
447
- Tn(e[i], f(this, hi), f(this, St));
448
- }, In = function() {
447
+ Tr(e[i], f(this, hi), f(this, St));
448
+ }, Ir = function() {
449
449
  var o;
450
450
  if (Ti.size > 1) {
451
451
  this.previous.clear();
452
452
  var e = $e, i = !0;
453
- for (const n of Ti) {
454
- if (n === this) {
453
+ for (const r of Ti) {
454
+ if (r === this) {
455
455
  i = !1;
456
456
  continue;
457
457
  }
458
458
  const s = [];
459
459
  for (const [l, u] of this.current) {
460
- if (n.current.has(l))
461
- if (i && u !== n.current.get(l))
462
- n.current.set(l, u);
460
+ if (r.current.has(l))
461
+ if (i && u !== r.current.get(l))
462
+ r.current.set(l, u);
463
463
  else
464
464
  continue;
465
465
  s.push(l);
466
466
  }
467
467
  if (s.length === 0)
468
468
  continue;
469
- const a = [...n.current.keys()].filter((l) => !this.current.has(l));
469
+ const a = [...r.current.keys()].filter((l) => !this.current.has(l));
470
470
  if (a.length > 0) {
471
- var r = re;
472
- re = [];
471
+ var n = ne;
472
+ ne = [];
473
473
  const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
474
474
  for (const d of s)
475
- Sn(d, a, l, u);
476
- if (re.length > 0) {
477
- N = n, n.apply();
478
- for (const d of re)
479
- te(o = n, He, ar).call(o, d, [], []);
480
- n.deactivate();
475
+ Sr(d, a, l, u);
476
+ if (ne.length > 0) {
477
+ N = r, r.apply();
478
+ for (const d of ne)
479
+ te(o = r, He, cn).call(o, d, [], []);
480
+ r.deactivate();
481
481
  }
482
- re = r;
482
+ ne = n;
483
483
  }
484
484
  }
485
485
  N = null, $e = e;
486
486
  }
487
487
  this.committed = !0, Ti.delete(this);
488
488
  };
489
- let ot = Rr;
489
+ let ot = Vn;
490
490
  function Vi(t) {
491
491
  var e = ai;
492
492
  ai = !0;
493
493
  try {
494
494
  for (var i; ; ) {
495
- if (ss(), re.length === 0 && (N?.flush(), re.length === 0))
495
+ if (ss(), ne.length === 0 && (N?.flush(), ne.length === 0))
496
496
  return Fi = null, /** @type {T} */
497
497
  i;
498
- En();
498
+ Er();
499
499
  }
500
500
  } finally {
501
501
  ai = e;
502
502
  }
503
503
  }
504
- function En() {
505
- lr = !0;
504
+ function Er() {
505
+ an = !0;
506
506
  var t = null;
507
507
  try {
508
- for (var e = 0; re.length > 0; ) {
508
+ for (var e = 0; ne.length > 0; ) {
509
509
  var i = ot.ensure();
510
510
  if (e++ > 1e3) {
511
- var r, o;
511
+ var n, o;
512
512
  as();
513
513
  }
514
- i.process(re), dt.clear();
514
+ i.process(ne), dt.clear();
515
515
  }
516
516
  } finally {
517
- re = [], lr = !1, Fi = null;
517
+ ne = [], an = !1, Fi = null;
518
518
  }
519
519
  }
520
520
  function as() {
@@ -525,22 +525,22 @@ function as() {
525
525
  }
526
526
  }
527
527
  let Ke = null;
528
- function Fr(t) {
528
+ function Gn(t) {
529
529
  var e = t.length;
530
530
  if (e !== 0) {
531
531
  for (var i = 0; i < e; ) {
532
- var r = t[i++];
533
- if ((r.f & (nt | ce)) === 0 && mi(r) && (Ke = /* @__PURE__ */ new Set(), Qt(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && qn(r), Ke?.size > 0)) {
532
+ var n = t[i++];
533
+ if ((n.f & (rt | ce)) === 0 && mi(n) && (Ke = /* @__PURE__ */ new Set(), Qt(n), n.deps === null && n.first === null && n.nodes === null && n.teardown === null && n.ac === null && qr(n), Ke?.size > 0)) {
534
534
  dt.clear();
535
535
  for (const o of Ke) {
536
- if ((o.f & (nt | ce)) !== 0) continue;
537
- const n = [o];
536
+ if ((o.f & (rt | ce)) !== 0) continue;
537
+ const r = [o];
538
538
  let s = o.parent;
539
539
  for (; s !== null; )
540
- Ke.has(s) && (Ke.delete(s), n.push(s)), s = s.parent;
541
- for (let a = n.length - 1; a >= 0; a--) {
542
- const l = n[a];
543
- (l.f & (nt | ce)) === 0 && Qt(l);
540
+ Ke.has(s) && (Ke.delete(s), r.push(s)), s = s.parent;
541
+ for (let a = r.length - 1; a >= 0; a--) {
542
+ const l = r[a];
543
+ (l.f & (rt | ce)) === 0 && Qt(l);
544
544
  }
545
545
  }
546
546
  Ke.clear();
@@ -549,30 +549,30 @@ function Fr(t) {
549
549
  Ke = null;
550
550
  }
551
551
  }
552
- function Sn(t, e, i, r) {
552
+ function Sr(t, e, i, n) {
553
553
  if (!i.has(t) && (i.add(t), t.reactions !== null))
554
554
  for (const o of t.reactions) {
555
- const n = o.f;
556
- (n & J) !== 0 ? Sn(
555
+ const r = o.f;
556
+ (r & J) !== 0 ? Sr(
557
557
  /** @type {Derived} */
558
558
  o,
559
559
  e,
560
560
  i,
561
- r
562
- ) : (n & (wr | st)) !== 0 && (n & Q) === 0 && $n(o, e, r) && (j(o, Q), ke(
561
+ n
562
+ ) : (r & (Tn | st)) !== 0 && (r & Q) === 0 && $r(o, e, n) && (j(o, Q), ke(
563
563
  /** @type {Effect} */
564
564
  o
565
565
  ));
566
566
  }
567
567
  }
568
- function $n(t, e, i) {
569
- const r = i.get(t);
570
- if (r !== void 0) return r;
568
+ function $r(t, e, i) {
569
+ const n = i.get(t);
570
+ if (n !== void 0) return n;
571
571
  if (t.deps !== null)
572
572
  for (const o of t.deps) {
573
573
  if (Yt.call(e, o))
574
574
  return !0;
575
- if ((o.f & J) !== 0 && $n(
575
+ if ((o.f & J) !== 0 && $r(
576
576
  /** @type {Derived} */
577
577
  o,
578
578
  e,
@@ -590,28 +590,28 @@ function ke(t) {
590
590
  for (var e = Fi = t; e.parent !== null; ) {
591
591
  e = e.parent;
592
592
  var i = e.f;
593
- if (lr && e === M && (i & st) !== 0 && (i & dn) === 0)
593
+ if (an && e === M && (i & st) !== 0 && (i & dr) === 0)
594
594
  return;
595
595
  if ((i & (vt | Oe)) !== 0) {
596
596
  if ((i & q) === 0) return;
597
597
  e.f ^= q;
598
598
  }
599
599
  }
600
- re.push(e);
600
+ ne.push(e);
601
601
  }
602
- function kn(t, e) {
602
+ function kr(t, e) {
603
603
  if (!((t.f & Oe) !== 0 && (t.f & q) !== 0)) {
604
604
  (t.f & Q) !== 0 ? e.d.push(t) : (t.f & Le) !== 0 && e.m.push(t), j(t, q);
605
605
  for (var i = t.first; i !== null; )
606
- kn(i, e), i = i.next;
606
+ kr(i, e), i = i.next;
607
607
  }
608
608
  }
609
609
  function cs(t) {
610
- let e = 0, i = Vt(0), r;
610
+ let e = 0, i = Vt(0), n;
611
611
  return () => {
612
- $r() && (c(i), qi(() => (e === 0 && (r = Ui(() => t(() => ci(i)))), e += 1, () => {
612
+ kn() && (c(i), qi(() => (e === 0 && (n = Ui(() => t(() => ci(i)))), e += 1, () => {
613
613
  xe(() => {
614
- e -= 1, e === 0 && (r?.(), r = void 0, ci(i));
614
+ e -= 1, e === 0 && (n?.(), n = void 0, ci(i));
615
615
  });
616
616
  })));
617
617
  };
@@ -620,14 +620,14 @@ var us = Wt | Ct;
620
620
  function fs(t, e, i) {
621
621
  new ds(t, e, i);
622
622
  }
623
- var ve, pi, Je, $t, Ne, Pe, le, ze, Qe, kt, ut, Gt, Bt, qt, Ze, Ci, ee, An, Ln, ur, $i, fr;
623
+ var ve, pi, Je, $t, Ne, Pe, le, ze, Qe, kt, ut, Gt, Bt, qt, Ze, Ci, ee, Ar, Lr, fn, $i, dn;
624
624
  class ds {
625
625
  /**
626
626
  * @param {TemplateNode} node
627
627
  * @param {BoundaryProps} props
628
628
  * @param {((anchor: Node) => void)} children
629
629
  */
630
- constructor(e, i, r) {
630
+ constructor(e, i, n) {
631
631
  k(this, ee);
632
632
  /** @type {Boundary | null} */
633
633
  S(this, "parent");
@@ -669,21 +669,21 @@ class ds {
669
669
  E(this, Ze, null);
670
670
  })));
671
671
  E(this, ve, e), E(this, Je, i), E(this, $t, (o) => {
672
- var n = (
672
+ var r = (
673
673
  /** @type {Effect} */
674
674
  M
675
675
  );
676
- n.b = this, n.f |= nr, r(o);
676
+ r.b = this, r.f |= on, n(o);
677
677
  }), this.parent = /** @type {Effect} */
678
- M.b, E(this, Ne, kr(() => {
678
+ M.b, E(this, Ne, An(() => {
679
679
  if (R) {
680
680
  const o = (
681
681
  /** @type {Comment} */
682
682
  f(this, pi)
683
683
  );
684
- Hi(), o.data === Pi ? te(this, ee, Ln).call(this) : te(this, ee, An).call(this);
684
+ Hi(), o.data === Pi ? te(this, ee, Lr).call(this) : te(this, ee, Ar).call(this);
685
685
  } else
686
- te(this, ee, ur).call(this);
686
+ te(this, ee, fn).call(this);
687
687
  }, us)), R && E(this, ve, V);
688
688
  }
689
689
  /**
@@ -691,7 +691,7 @@ class ds {
691
691
  * @param {Effect} effect
692
692
  */
693
693
  defer_effect(e) {
694
- Tn(e, f(this, Bt), f(this, qt));
694
+ Tr(e, f(this, Bt), f(this, qt));
695
695
  }
696
696
  /**
697
697
  * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
@@ -710,7 +710,7 @@ class ds {
710
710
  * @param {1 | -1} d
711
711
  */
712
712
  update_pending_count(e) {
713
- te(this, ee, fr).call(this, e), E(this, kt, f(this, kt) + e), !(!f(this, Ze) || f(this, Gt)) && (E(this, Gt, !0), xe(() => {
713
+ te(this, ee, dn).call(this, e), E(this, kt, f(this, kt) + e), !(!f(this, Ze) || f(this, Gt)) && (E(this, Gt, !0), xe(() => {
714
714
  E(this, Gt, !1), f(this, Ze) && Jt(f(this, Ze), f(this, kt));
715
715
  }));
716
716
  }
@@ -723,32 +723,32 @@ class ds {
723
723
  /** @param {unknown} error */
724
724
  error(e) {
725
725
  var i = f(this, Je).onerror;
726
- let r = f(this, Je).failed;
727
- if (!i && !r)
726
+ let n = f(this, Je).failed;
727
+ if (!i && !n)
728
728
  throw e;
729
729
  f(this, Pe) && (ie(f(this, Pe)), E(this, Pe, null)), f(this, le) && (ie(f(this, le)), E(this, le, null)), f(this, ze) && (ie(f(this, ze)), E(this, ze, null)), R && (oe(
730
730
  /** @type {TemplateNode} */
731
731
  f(this, pi)
732
- ), rs(), oe(Ri()));
733
- var o = !1, n = !1;
732
+ ), ns(), oe(Ri()));
733
+ var o = !1, r = !1;
734
734
  const s = () => {
735
735
  if (o) {
736
736
  is();
737
737
  return;
738
738
  }
739
- o = !0, n && ts(), f(this, ze) !== null && Lt(f(this, ze), () => {
739
+ o = !0, r && ts(), f(this, ze) !== null && Lt(f(this, ze), () => {
740
740
  E(this, ze, null);
741
741
  }), te(this, ee, $i).call(this, () => {
742
- ot.ensure(), te(this, ee, ur).call(this);
742
+ ot.ensure(), te(this, ee, fn).call(this);
743
743
  });
744
744
  };
745
745
  xe(() => {
746
746
  try {
747
- n = !0, i?.(e, s), n = !1;
747
+ r = !0, i?.(e, s), r = !1;
748
748
  } catch (a) {
749
749
  Xt(a, f(this, Ne) && f(this, Ne).parent);
750
750
  }
751
- r && E(this, ze, te(this, ee, $i).call(this, () => {
751
+ n && E(this, ze, te(this, ee, $i).call(this, () => {
752
752
  ot.ensure();
753
753
  try {
754
754
  return Se(() => {
@@ -756,7 +756,7 @@ class ds {
756
756
  /** @type {Effect} */
757
757
  M
758
758
  );
759
- a.b = this, a.f |= nr, r(
759
+ a.b = this, a.f |= on, n(
760
760
  f(this, ve),
761
761
  () => e,
762
762
  () => s
@@ -773,17 +773,17 @@ class ds {
773
773
  });
774
774
  }
775
775
  }
776
- ve = new WeakMap(), pi = new WeakMap(), Je = new WeakMap(), $t = new WeakMap(), Ne = new WeakMap(), Pe = new WeakMap(), le = new WeakMap(), ze = new WeakMap(), Qe = new WeakMap(), kt = new WeakMap(), ut = new WeakMap(), Gt = new WeakMap(), Bt = new WeakMap(), qt = new WeakMap(), Ze = new WeakMap(), Ci = new WeakMap(), ee = new WeakSet(), An = function() {
776
+ ve = new WeakMap(), pi = new WeakMap(), Je = new WeakMap(), $t = new WeakMap(), Ne = new WeakMap(), Pe = new WeakMap(), le = new WeakMap(), ze = new WeakMap(), Qe = new WeakMap(), kt = new WeakMap(), ut = new WeakMap(), Gt = new WeakMap(), Bt = new WeakMap(), qt = new WeakMap(), Ze = new WeakMap(), Ci = new WeakMap(), ee = new WeakSet(), Ar = function() {
777
777
  try {
778
778
  E(this, Pe, Se(() => f(this, $t).call(this, f(this, ve))));
779
779
  } catch (e) {
780
780
  this.error(e);
781
781
  }
782
- }, Ln = function() {
782
+ }, Lr = function() {
783
783
  const e = f(this, Je).pending;
784
784
  e && (this.is_pending = !0, E(this, le, Se(() => e(f(this, ve)))), xe(() => {
785
- var i = E(this, Qe, document.createDocumentFragment()), r = me();
786
- i.append(r), E(this, Pe, te(this, ee, $i).call(this, () => (ot.ensure(), Se(() => f(this, $t).call(this, r))))), f(this, ut) === 0 && (f(this, ve).before(i), E(this, Qe, null), Lt(
785
+ var i = E(this, Qe, document.createDocumentFragment()), n = me();
786
+ i.append(n), E(this, Pe, te(this, ee, $i).call(this, () => (ot.ensure(), Se(() => f(this, $t).call(this, n))))), f(this, ut) === 0 && (f(this, ve).before(i), E(this, Qe, null), Lt(
787
787
  /** @type {Effect} */
788
788
  f(this, le),
789
789
  () => {
@@ -791,13 +791,13 @@ ve = new WeakMap(), pi = new WeakMap(), Je = new WeakMap(), $t = new WeakMap(),
791
791
  }
792
792
  ), this.is_pending = !1);
793
793
  }));
794
- }, ur = function() {
794
+ }, fn = function() {
795
795
  try {
796
796
  if (this.is_pending = this.has_pending_snippet(), E(this, ut, 0), E(this, kt, 0), E(this, Pe, Se(() => {
797
797
  f(this, $t).call(this, f(this, ve));
798
798
  })), f(this, ut) > 0) {
799
799
  var e = E(this, Qe, document.createDocumentFragment());
800
- Wn(f(this, Pe), e);
800
+ Wr(f(this, Pe), e);
801
801
  const i = (
802
802
  /** @type {(anchor: Node) => void} */
803
803
  f(this, Je).pending
@@ -813,56 +813,56 @@ ve = new WeakMap(), pi = new WeakMap(), Je = new WeakMap(), $t = new WeakMap(),
813
813
  * @param {() => T} fn
814
814
  */
815
815
  $i = function(e) {
816
- var i = M, r = O, o = ue;
816
+ var i = M, n = O, o = ue;
817
817
  je(f(this, Ne)), ye(f(this, Ne)), Kt(f(this, Ne).ctx);
818
818
  try {
819
819
  return e();
820
- } catch (n) {
821
- return yn(n), null;
820
+ } catch (r) {
821
+ return yr(r), null;
822
822
  } finally {
823
- je(i), ye(r), Kt(o);
823
+ je(i), ye(n), Kt(o);
824
824
  }
825
825
  }, /**
826
826
  * Updates the pending count associated with the currently visible pending snippet,
827
827
  * if any, such that we can replace the snippet with content once work is done
828
828
  * @param {1 | -1} d
829
829
  */
830
- fr = function(e) {
830
+ dn = function(e) {
831
831
  var i;
832
832
  if (!this.has_pending_snippet()) {
833
- this.parent && te(i = this.parent, ee, fr).call(i, e);
833
+ this.parent && te(i = this.parent, ee, dn).call(i, e);
834
834
  return;
835
835
  }
836
836
  if (E(this, ut, f(this, ut) + e), f(this, ut) === 0) {
837
837
  this.is_pending = !1;
838
- for (const r of f(this, Bt))
839
- j(r, Q), ke(r);
840
- for (const r of f(this, qt))
841
- j(r, Le), ke(r);
838
+ for (const n of f(this, Bt))
839
+ j(n, Q), ke(n);
840
+ for (const n of f(this, qt))
841
+ j(n, Le), ke(n);
842
842
  f(this, Bt).clear(), f(this, qt).clear(), f(this, le) && Lt(f(this, le), () => {
843
843
  E(this, le, null);
844
844
  }), f(this, Qe) && (f(this, ve).before(f(this, Qe)), E(this, Qe, null));
845
845
  }
846
846
  };
847
- function hs(t, e, i, r) {
847
+ function hs(t, e, i, n) {
848
848
  const o = Gi;
849
- var n = t.filter((p) => !p.settled);
850
- if (i.length === 0 && n.length === 0) {
851
- r(e.map(o));
849
+ var r = t.filter((p) => !p.settled);
850
+ if (i.length === 0 && r.length === 0) {
851
+ n(e.map(o));
852
852
  return;
853
853
  }
854
854
  var s = N, a = (
855
855
  /** @type {Effect} */
856
856
  M
857
- ), l = ps(), u = n.length === 1 ? n[0].promise : n.length > 1 ? Promise.all(n.map((p) => p.promise)) : null;
857
+ ), l = ps(), u = r.length === 1 ? r[0].promise : r.length > 1 ? Promise.all(r.map((p) => p.promise)) : null;
858
858
  function d(p) {
859
859
  l();
860
860
  try {
861
- r(p);
861
+ n(p);
862
862
  } catch (v) {
863
- (a.f & nt) === 0 && Xt(v, a);
863
+ (a.f & rt) === 0 && Xt(v, a);
864
864
  }
865
- s?.deactivate(), dr();
865
+ s?.deactivate(), hn();
866
866
  }
867
867
  if (i.length === 0) {
868
868
  u.then(() => d(e.map(o)));
@@ -874,12 +874,12 @@ function hs(t, e, i, r) {
874
874
  u ? u.then(_) : _();
875
875
  }
876
876
  function ps() {
877
- var t = M, e = O, i = ue, r = N;
878
- return function(n = !0) {
879
- je(t), ye(e), Kt(i), n && r?.activate();
877
+ var t = M, e = O, i = ue, n = N;
878
+ return function(r = !0) {
879
+ je(t), ye(e), Kt(i), r && n?.activate();
880
880
  };
881
881
  }
882
- function dr() {
882
+ function hn() {
883
883
  je(null), ye(null), Kt(null);
884
884
  }
885
885
  // @__NO_SIDE_EFFECTS__
@@ -892,7 +892,7 @@ function Gi(t) {
892
892
  ctx: ue,
893
893
  deps: null,
894
894
  effects: null,
895
- equals: pn,
895
+ equals: pr,
896
896
  f: e,
897
897
  fn: t,
898
898
  reactions: null,
@@ -908,15 +908,15 @@ function Gi(t) {
908
908
  }
909
909
  // @__NO_SIDE_EFFECTS__
910
910
  function vs(t, e, i) {
911
- let r = (
911
+ let n = (
912
912
  /** @type {Effect | null} */
913
913
  M
914
914
  );
915
- r === null && qo();
915
+ n === null && qo();
916
916
  var o = (
917
917
  /** @type {Boundary} */
918
- r.b
919
- ), n = (
918
+ n.b
919
+ ), r = (
920
920
  /** @type {Promise<V>} */
921
921
  /** @type {unknown} */
922
922
  void 0
@@ -925,14 +925,14 @@ function vs(t, e, i) {
925
925
  X
926
926
  ), a = !O, l = /* @__PURE__ */ new Map();
927
927
  return ks(() => {
928
- var u = un();
929
- n = u.promise;
928
+ var u = ur();
929
+ r = u.promise;
930
930
  try {
931
931
  Promise.resolve(t()).then(u.resolve, u.reject).then(() => {
932
- d === N && d.committed && d.deactivate(), dr();
932
+ d === N && d.committed && d.deactivate(), hn();
933
933
  });
934
934
  } catch (v) {
935
- u.reject(v), dr();
935
+ u.reject(v), hn();
936
936
  }
937
937
  var d = (
938
938
  /** @type {Batch} */
@@ -955,28 +955,28 @@ function vs(t, e, i) {
955
955
  a && (o.update_pending_count(-1), d.decrement(_));
956
956
  };
957
957
  u.promise.then(p, (v) => p(null, v || "unknown"));
958
- }), Hn(() => {
958
+ }), Hr(() => {
959
959
  for (const u of l.values())
960
960
  u.reject(yt);
961
961
  }), new Promise((u) => {
962
962
  function d(_) {
963
963
  function p() {
964
- _ === n ? u(s) : d(n);
964
+ _ === r ? u(s) : d(r);
965
965
  }
966
966
  _.then(p, p);
967
967
  }
968
- d(n);
968
+ d(r);
969
969
  });
970
970
  }
971
971
  // @__NO_SIDE_EFFECTS__
972
972
  function zt(t) {
973
973
  const e = /* @__PURE__ */ Gi(t);
974
- return Kn(e), e;
974
+ return Kr(e), e;
975
975
  }
976
976
  // @__NO_SIDE_EFFECTS__
977
977
  function gs(t) {
978
978
  const e = /* @__PURE__ */ Gi(t);
979
- return e.equals = vn, e;
979
+ return e.equals = vr, e;
980
980
  }
981
981
  function _s(t) {
982
982
  var e = t.effects;
@@ -992,7 +992,7 @@ function _s(t) {
992
992
  function ms(t) {
993
993
  for (var e = t.parent; e !== null; ) {
994
994
  if ((e.f & J) === 0)
995
- return (e.f & nt) === 0 ? (
995
+ return (e.f & rt) === 0 ? (
996
996
  /** @type {Effect} */
997
997
  e
998
998
  ) : null;
@@ -1000,44 +1000,44 @@ function ms(t) {
1000
1000
  }
1001
1001
  return null;
1002
1002
  }
1003
- function Ir(t) {
1003
+ function En(t) {
1004
1004
  var e, i = M;
1005
1005
  je(ms(t));
1006
1006
  try {
1007
- t.f &= ~Rt, _s(t), e = Zn(t);
1007
+ t.f &= ~Rt, _s(t), e = Zr(t);
1008
1008
  } finally {
1009
1009
  je(i);
1010
1010
  }
1011
1011
  return e;
1012
1012
  }
1013
- function On(t) {
1014
- var e = Ir(t);
1015
- if (!t.equals(e) && (t.wv = Jn(), (!N?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
1013
+ function Or(t) {
1014
+ var e = En(t);
1015
+ if (!t.equals(e) && (t.wv = Jr(), (!N?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
1016
1016
  j(t, q);
1017
1017
  return;
1018
1018
  }
1019
- pt || ($e !== null ? ($r() || N?.is_fork) && $e.set(t, e) : Tr(t));
1019
+ pt || ($e !== null ? (kn() || N?.is_fork) && $e.set(t, e) : In(t));
1020
1020
  }
1021
1021
  function bs(t) {
1022
1022
  if (t.effects !== null)
1023
1023
  for (const e of t.effects)
1024
- (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(yt), e.teardown = Do, e.ac = null, fi(e, 0), Ar(e));
1024
+ (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(yt), e.teardown = Do, e.ac = null, fi(e, 0), Ln(e));
1025
1025
  }
1026
- function Rn(t) {
1026
+ function Rr(t) {
1027
1027
  if (t.effects !== null)
1028
1028
  for (const e of t.effects)
1029
1029
  e.teardown && Qt(e);
1030
1030
  }
1031
- let hr = /* @__PURE__ */ new Set();
1031
+ let pn = /* @__PURE__ */ new Set();
1032
1032
  const dt = /* @__PURE__ */ new Map();
1033
- let Vn = !1;
1033
+ let Vr = !1;
1034
1034
  function Vt(t, e) {
1035
1035
  var i = {
1036
1036
  f: 0,
1037
1037
  // TODO ideally we could skip this altogether, but it causes type errors
1038
1038
  v: t,
1039
1039
  reactions: null,
1040
- equals: pn,
1040
+ equals: pr,
1041
1041
  rv: 0,
1042
1042
  wv: 0
1043
1043
  };
@@ -1046,84 +1046,84 @@ function Vt(t, e) {
1046
1046
  // @__NO_SIDE_EFFECTS__
1047
1047
  function D(t, e) {
1048
1048
  const i = Vt(t);
1049
- return Kn(i), i;
1049
+ return Kr(i), i;
1050
1050
  }
1051
1051
  // @__NO_SIDE_EFFECTS__
1052
- function Mn(t, e = !1, i = !0) {
1053
- const r = Vt(t);
1054
- return e || (r.equals = vn), r;
1052
+ function Mr(t, e = !1, i = !0) {
1053
+ const n = Vt(t);
1054
+ return e || (n.equals = vr), n;
1055
1055
  }
1056
1056
  function T(t, e, i = !1) {
1057
1057
  O !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1058
1058
  // to ensure we error if state is set inside an inspect effect
1059
- (!Ae || (O.f & Hr) !== 0) && mn() && (O.f & (J | st | wr | Hr)) !== 0 && (be === null || !Yt.call(be, t)) && es();
1060
- let r = i ? rt(e) : e;
1061
- return Jt(t, r);
1059
+ (!Ae || (O.f & Fn) !== 0) && mr() && (O.f & (J | st | Tn | Fn)) !== 0 && (be === null || !Yt.call(be, t)) && es();
1060
+ let n = i ? nt(e) : e;
1061
+ return Jt(t, n);
1062
1062
  }
1063
1063
  function Jt(t, e) {
1064
1064
  if (!t.equals(e)) {
1065
1065
  var i = t.v;
1066
1066
  pt ? dt.set(t, e) : dt.set(t, i), t.v = e;
1067
- var r = ot.ensure();
1068
- if (r.capture(t, i), (t.f & J) !== 0) {
1067
+ var n = ot.ensure();
1068
+ if (n.capture(t, i), (t.f & J) !== 0) {
1069
1069
  const o = (
1070
1070
  /** @type {Derived} */
1071
1071
  t
1072
1072
  );
1073
- (t.f & Q) !== 0 && Ir(o), Tr(o);
1073
+ (t.f & Q) !== 0 && En(o), In(o);
1074
1074
  }
1075
- t.wv = Jn(), Cn(t, Q), M !== null && (M.f & q) !== 0 && (M.f & (Oe | vt)) === 0 && (pe === null ? Os([t]) : pe.push(t)), !r.is_fork && hr.size > 0 && !Vn && ys();
1075
+ t.wv = Jr(), Cr(t, Q), M !== null && (M.f & q) !== 0 && (M.f & (Oe | vt)) === 0 && (pe === null ? Os([t]) : pe.push(t)), !n.is_fork && pn.size > 0 && !Vr && ys();
1076
1076
  }
1077
1077
  return e;
1078
1078
  }
1079
1079
  function ys() {
1080
- Vn = !1;
1081
- for (const t of hr)
1080
+ Vr = !1;
1081
+ for (const t of pn)
1082
1082
  (t.f & q) !== 0 && j(t, Le), mi(t) && Qt(t);
1083
- hr.clear();
1083
+ pn.clear();
1084
1084
  }
1085
1085
  function ws(t, e = 1) {
1086
- var i = c(t), r = e === 1 ? i++ : i--;
1087
- return T(t, i), r;
1086
+ var i = c(t), n = e === 1 ? i++ : i--;
1087
+ return T(t, i), n;
1088
1088
  }
1089
1089
  function ci(t) {
1090
1090
  T(t, t.v + 1);
1091
1091
  }
1092
- function Cn(t, e) {
1092
+ function Cr(t, e) {
1093
1093
  var i = t.reactions;
1094
1094
  if (i !== null)
1095
- for (var r = i.length, o = 0; o < r; o++) {
1096
- var n = i[o], s = n.f, a = (s & Q) === 0;
1097
- if (a && j(n, e), (s & J) !== 0) {
1095
+ for (var n = i.length, o = 0; o < n; o++) {
1096
+ var r = i[o], s = r.f, a = (s & Q) === 0;
1097
+ if (a && j(r, e), (s & J) !== 0) {
1098
1098
  var l = (
1099
1099
  /** @type {Derived} */
1100
- n
1100
+ r
1101
1101
  );
1102
- $e?.delete(l), (s & Rt) === 0 && (s & _e && (n.f |= Rt), Cn(l, Le));
1102
+ $e?.delete(l), (s & Rt) === 0 && (s & _e && (r.f |= Rt), Cr(l, Le));
1103
1103
  } else a && ((s & st) !== 0 && Ke !== null && Ke.add(
1104
1104
  /** @type {Effect} */
1105
- n
1105
+ r
1106
1106
  ), ke(
1107
1107
  /** @type {Effect} */
1108
- n
1108
+ r
1109
1109
  ));
1110
1110
  }
1111
1111
  }
1112
- function rt(t) {
1112
+ function nt(t) {
1113
1113
  if (typeof t != "object" || t === null || Si in t)
1114
1114
  return t;
1115
- const e = cn(t);
1115
+ const e = cr(t);
1116
1116
  if (e !== Po && e !== zo)
1117
1117
  return t;
1118
- var i = /* @__PURE__ */ new Map(), r = an(t), o = /* @__PURE__ */ D(0), n = Ot, s = (a) => {
1119
- if (Ot === n)
1118
+ var i = /* @__PURE__ */ new Map(), n = ar(t), o = /* @__PURE__ */ D(0), r = Ot, s = (a) => {
1119
+ if (Ot === r)
1120
1120
  return a();
1121
1121
  var l = O, u = Ot;
1122
- ye(null), Ur(n);
1122
+ ye(null), Yn(r);
1123
1123
  var d = a();
1124
- return ye(l), Ur(u), d;
1124
+ return ye(l), Yn(u), d;
1125
1125
  };
1126
- return r && i.set("length", /* @__PURE__ */ D(
1126
+ return n && i.set("length", /* @__PURE__ */ D(
1127
1127
  /** @type {any[]} */
1128
1128
  t.length
1129
1129
  )), new Proxy(
@@ -1154,7 +1154,7 @@ function rt(t) {
1154
1154
  return t;
1155
1155
  var d = i.get(l), _ = l in a;
1156
1156
  if (d === void 0 && (!_ || Dt(a, l)?.writable) && (d = s(() => {
1157
- var v = rt(_ ? a[l] : X), g = /* @__PURE__ */ D(v);
1157
+ var v = nt(_ ? a[l] : X), g = /* @__PURE__ */ D(v);
1158
1158
  return g;
1159
1159
  }), i.set(l, d)), d !== void 0) {
1160
1160
  var p = c(d);
@@ -1185,7 +1185,7 @@ function rt(t) {
1185
1185
  var u = i.get(l), d = u !== void 0 && u.v !== X || Reflect.has(a, l);
1186
1186
  if (u !== void 0 || M !== null && (!d || Dt(a, l)?.writable)) {
1187
1187
  u === void 0 && (u = s(() => {
1188
- var p = d ? rt(a[l]) : X, v = /* @__PURE__ */ D(p);
1188
+ var p = d ? nt(a[l]) : X, v = /* @__PURE__ */ D(p);
1189
1189
  return v;
1190
1190
  }), i.set(l, u));
1191
1191
  var _ = c(u);
@@ -1196,22 +1196,22 @@ function rt(t) {
1196
1196
  },
1197
1197
  set(a, l, u, d) {
1198
1198
  var _ = i.get(l), p = l in a;
1199
- if (r && l === "length")
1199
+ if (n && l === "length")
1200
1200
  for (var v = u; v < /** @type {Source<number>} */
1201
1201
  _.v; v += 1) {
1202
1202
  var g = i.get(v + "");
1203
1203
  g !== void 0 ? T(g, X) : v in a && (g = s(() => /* @__PURE__ */ D(X)), i.set(v + "", g));
1204
1204
  }
1205
1205
  if (_ === void 0)
1206
- (!p || Dt(a, l)?.writable) && (_ = s(() => /* @__PURE__ */ D(void 0)), T(_, rt(u)), i.set(l, _));
1206
+ (!p || Dt(a, l)?.writable) && (_ = s(() => /* @__PURE__ */ D(void 0)), T(_, nt(u)), i.set(l, _));
1207
1207
  else {
1208
1208
  p = _.v !== X;
1209
- var b = s(() => rt(u));
1209
+ var b = s(() => nt(u));
1210
1210
  T(_, b);
1211
1211
  }
1212
1212
  var h = Reflect.getOwnPropertyDescriptor(a, l);
1213
1213
  if (h?.set && h.set.call(d, u), !p) {
1214
- if (r && typeof l == "string") {
1214
+ if (n && typeof l == "string") {
1215
1215
  var y = (
1216
1216
  /** @type {Source<number>} */
1217
1217
  i.get("length")
@@ -1238,12 +1238,12 @@ function rt(t) {
1238
1238
  }
1239
1239
  );
1240
1240
  }
1241
- var Gr, Nn, Pn, zn;
1242
- function pr() {
1243
- if (Gr === void 0) {
1244
- Gr = window, Nn = /Firefox/.test(navigator.userAgent);
1241
+ var Bn, Nr, Pr, zr;
1242
+ function vn() {
1243
+ if (Bn === void 0) {
1244
+ Bn = window, Nr = /Firefox/.test(navigator.userAgent);
1245
1245
  var t = Element.prototype, e = Node.prototype, i = Text.prototype;
1246
- Pn = Dt(e, "firstChild").get, zn = Dt(e, "nextSibling").get, jr(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), jr(i) && (i.__t = void 0);
1246
+ Pr = Dt(e, "firstChild").get, zr = Dt(e, "nextSibling").get, Hn(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Hn(i) && (i.__t = void 0);
1247
1247
  }
1248
1248
  }
1249
1249
  function me(t = "") {
@@ -1253,14 +1253,14 @@ function me(t = "") {
1253
1253
  function ht(t) {
1254
1254
  return (
1255
1255
  /** @type {TemplateNode | null} */
1256
- Pn.call(t)
1256
+ Pr.call(t)
1257
1257
  );
1258
1258
  }
1259
1259
  // @__NO_SIDE_EFFECTS__
1260
1260
  function Fe(t) {
1261
1261
  return (
1262
1262
  /** @type {TemplateNode | null} */
1263
- zn.call(t)
1263
+ zr.call(t)
1264
1264
  );
1265
1265
  }
1266
1266
  function Ye(t, e) {
@@ -1270,10 +1270,10 @@ function Ye(t, e) {
1270
1270
  if (i === null)
1271
1271
  i = V.appendChild(me());
1272
1272
  else if (e && i.nodeType !== xi) {
1273
- var r = me();
1274
- return i?.before(r), oe(r), r;
1273
+ var n = me();
1274
+ return i?.before(n), oe(n), n;
1275
1275
  }
1276
- return e && Sr(
1276
+ return e && $n(
1277
1277
  /** @type {Text} */
1278
1278
  i
1279
1279
  ), oe(i), i;
@@ -1285,10 +1285,10 @@ function Qi(t, e = !1) {
1285
1285
  }
1286
1286
  if (e) {
1287
1287
  if (V?.nodeType !== xi) {
1288
- var r = me();
1289
- return V?.before(r), oe(r), r;
1288
+ var n = me();
1289
+ return V?.before(n), oe(n), n;
1290
1290
  }
1291
- Sr(
1291
+ $n(
1292
1292
  /** @type {Text} */
1293
1293
  V
1294
1294
  );
@@ -1296,37 +1296,37 @@ function Qi(t, e = !1) {
1296
1296
  return V;
1297
1297
  }
1298
1298
  function Ie(t, e = 1, i = !1) {
1299
- let r = R ? V : t;
1299
+ let n = R ? V : t;
1300
1300
  for (var o; e--; )
1301
- o = r, r = /** @type {TemplateNode} */
1302
- /* @__PURE__ */ Fe(r);
1301
+ o = n, n = /** @type {TemplateNode} */
1302
+ /* @__PURE__ */ Fe(n);
1303
1303
  if (!R)
1304
- return r;
1304
+ return n;
1305
1305
  if (i) {
1306
- if (r?.nodeType !== xi) {
1307
- var n = me();
1308
- return r === null ? o?.after(n) : r.before(n), oe(n), n;
1306
+ if (n?.nodeType !== xi) {
1307
+ var r = me();
1308
+ return n === null ? o?.after(r) : n.before(r), oe(r), r;
1309
1309
  }
1310
- Sr(
1310
+ $n(
1311
1311
  /** @type {Text} */
1312
- r
1312
+ n
1313
1313
  );
1314
1314
  }
1315
- return oe(r), r;
1315
+ return oe(n), n;
1316
1316
  }
1317
- function Dn(t) {
1317
+ function Dr(t) {
1318
1318
  t.textContent = "";
1319
1319
  }
1320
- function xn() {
1320
+ function xr() {
1321
1321
  return !1;
1322
1322
  }
1323
- function Er(t, e, i) {
1323
+ function Sn(t, e, i) {
1324
1324
  return (
1325
1325
  /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
1326
- document.createElementNS(ln, t, void 0)
1326
+ document.createElementNS(lr, t, void 0)
1327
1327
  );
1328
1328
  }
1329
- function Sr(t) {
1329
+ function $n(t) {
1330
1330
  if (
1331
1331
  /** @type {string} */
1332
1332
  t.nodeValue.length < 65536
@@ -1337,9 +1337,9 @@ function Sr(t) {
1337
1337
  e.remove(), t.nodeValue += /** @type {string} */
1338
1338
  e.nodeValue, e = t.nextSibling;
1339
1339
  }
1340
- let Br = !1;
1341
- function jn() {
1342
- Br || (Br = !0, document.addEventListener(
1340
+ let qn = !1;
1341
+ function jr() {
1342
+ qn || (qn = !0, document.addEventListener(
1343
1343
  "reset",
1344
1344
  (t) => {
1345
1345
  Promise.resolve().then(() => {
@@ -1365,12 +1365,12 @@ function Bi(t) {
1365
1365
  ye(e), je(i);
1366
1366
  }
1367
1367
  }
1368
- function Ts(t, e, i, r = i) {
1368
+ function Ts(t, e, i, n = i) {
1369
1369
  t.addEventListener(e, () => Bi(i));
1370
1370
  const o = t.__on_r;
1371
1371
  o ? t.__on_r = () => {
1372
- o(), r(!0);
1373
- } : t.__on_r = () => r(!0), jn();
1372
+ o(), n(!0);
1373
+ } : t.__on_r = () => n(!0), jr();
1374
1374
  }
1375
1375
  function Is(t) {
1376
1376
  M === null && (O === null && Ko(), Wo()), pt && Yo();
@@ -1380,8 +1380,8 @@ function Es(t, e) {
1380
1380
  i === null ? e.last = e.first = t : (i.next = t, t.prev = i, e.last = t);
1381
1381
  }
1382
1382
  function Ge(t, e, i) {
1383
- var r = M;
1384
- r !== null && (r.f & ce) !== 0 && (t |= ce);
1383
+ var n = M;
1384
+ n !== null && (n.f & ce) !== 0 && (t |= ce);
1385
1385
  var o = {
1386
1386
  ctx: ue,
1387
1387
  deps: null,
@@ -1391,8 +1391,8 @@ function Ge(t, e, i) {
1391
1391
  fn: e,
1392
1392
  last: null,
1393
1393
  next: null,
1394
- parent: r,
1395
- b: r && r.b,
1394
+ parent: n,
1395
+ b: n && n.b,
1396
1396
  prev: null,
1397
1397
  teardown: null,
1398
1398
  wv: 0,
@@ -1405,21 +1405,21 @@ function Ge(t, e, i) {
1405
1405
  throw ie(o), a;
1406
1406
  }
1407
1407
  else e !== null && ke(o);
1408
- var n = o;
1409
- if (i && n.deps === null && n.teardown === null && n.nodes === null && n.first === n.last && // either `null`, or a singular child
1410
- (n.f & Ct) === 0 && (n = n.first, (t & st) !== 0 && (t & Wt) !== 0 && n !== null && (n.f |= Wt)), n !== null && (n.parent = r, r !== null && Es(n, r), O !== null && (O.f & J) !== 0 && (t & vt) === 0)) {
1408
+ var r = o;
1409
+ if (i && r.deps === null && r.teardown === null && r.nodes === null && r.first === r.last && // either `null`, or a singular child
1410
+ (r.f & Ct) === 0 && (r = r.first, (t & st) !== 0 && (t & Wt) !== 0 && r !== null && (r.f |= Wt)), r !== null && (r.parent = n, n !== null && Es(r, n), O !== null && (O.f & J) !== 0 && (t & vt) === 0)) {
1411
1411
  var s = (
1412
1412
  /** @type {Derived} */
1413
1413
  O
1414
1414
  );
1415
- (s.effects ?? (s.effects = [])).push(n);
1415
+ (s.effects ?? (s.effects = [])).push(r);
1416
1416
  }
1417
1417
  return o;
1418
1418
  }
1419
- function $r() {
1419
+ function kn() {
1420
1420
  return O !== null && !Ae;
1421
1421
  }
1422
- function Hn(t) {
1422
+ function Hr(t) {
1423
1423
  const e = Ge(Di, null, !1);
1424
1424
  return j(e, q), e.teardown = t, e;
1425
1425
  }
@@ -1430,15 +1430,15 @@ function si(t) {
1430
1430
  M.f
1431
1431
  ), i = !O && (e & Oe) !== 0 && (e & Zt) === 0;
1432
1432
  if (i) {
1433
- var r = (
1433
+ var n = (
1434
1434
  /** @type {ComponentContext} */
1435
1435
  ue
1436
1436
  );
1437
- (r.e ?? (r.e = [])).push(t);
1437
+ (n.e ?? (n.e = [])).push(t);
1438
1438
  } else
1439
- return Fn(t);
1439
+ return Fr(t);
1440
1440
  }
1441
- function Fn(t) {
1441
+ function Fr(t) {
1442
1442
  return Ge(ui | jo, t, !1);
1443
1443
  }
1444
1444
  function Ss(t) {
@@ -1451,54 +1451,54 @@ function Ss(t) {
1451
1451
  function $s(t) {
1452
1452
  ot.ensure();
1453
1453
  const e = Ge(vt | Ct, t, !0);
1454
- return (i = {}) => new Promise((r) => {
1454
+ return (i = {}) => new Promise((n) => {
1455
1455
  i.outro ? Lt(e, () => {
1456
- ie(e), r(void 0);
1457
- }) : (ie(e), r(void 0));
1456
+ ie(e), n(void 0);
1457
+ }) : (ie(e), n(void 0));
1458
1458
  });
1459
1459
  }
1460
- function Gn(t) {
1460
+ function Gr(t) {
1461
1461
  return Ge(ui, t, !1);
1462
1462
  }
1463
1463
  function ks(t) {
1464
- return Ge(wr | Ct, t, !0);
1464
+ return Ge(Tn | Ct, t, !0);
1465
1465
  }
1466
1466
  function qi(t, e = 0) {
1467
1467
  return Ge(Di | e, t, !0);
1468
1468
  }
1469
- function We(t, e = [], i = [], r = []) {
1470
- hs(r, e, i, (o) => {
1469
+ function We(t, e = [], i = [], n = []) {
1470
+ hs(n, e, i, (o) => {
1471
1471
  Ge(Di, () => t(...o.map(c)), !0);
1472
1472
  });
1473
1473
  }
1474
- function kr(t, e = 0) {
1474
+ function An(t, e = 0) {
1475
1475
  var i = Ge(st | e, t, !0);
1476
1476
  return i;
1477
1477
  }
1478
1478
  function Se(t) {
1479
1479
  return Ge(Oe | Ct, t, !0);
1480
1480
  }
1481
- function Bn(t) {
1481
+ function Br(t) {
1482
1482
  var e = t.teardown;
1483
1483
  if (e !== null) {
1484
- const i = pt, r = O;
1485
- qr(!0), ye(null);
1484
+ const i = pt, n = O;
1485
+ Un(!0), ye(null);
1486
1486
  try {
1487
1487
  e.call(null);
1488
1488
  } finally {
1489
- qr(i), ye(r);
1489
+ Un(i), ye(n);
1490
1490
  }
1491
1491
  }
1492
1492
  }
1493
- function Ar(t, e = !1) {
1493
+ function Ln(t, e = !1) {
1494
1494
  var i = t.first;
1495
1495
  for (t.first = t.last = null; i !== null; ) {
1496
1496
  const o = i.ac;
1497
1497
  o !== null && Bi(() => {
1498
1498
  o.abort(yt);
1499
1499
  });
1500
- var r = i.next;
1501
- (i.f & vt) !== 0 ? i.parent = null : ie(i, e), i = r;
1500
+ var n = i.next;
1501
+ (i.f & vt) !== 0 ? i.parent = null : ie(i, e), i = n;
1502
1502
  }
1503
1503
  }
1504
1504
  function As(t) {
@@ -1509,18 +1509,18 @@ function As(t) {
1509
1509
  }
1510
1510
  function ie(t, e = !0) {
1511
1511
  var i = !1;
1512
- (e || (t.f & dn) !== 0) && t.nodes !== null && t.nodes.end !== null && (Ls(
1512
+ (e || (t.f & dr) !== 0) && t.nodes !== null && t.nodes.end !== null && (Ls(
1513
1513
  t.nodes.start,
1514
1514
  /** @type {TemplateNode} */
1515
1515
  t.nodes.end
1516
- ), i = !0), Ar(t, e && !i), fi(t, 0), j(t, nt);
1517
- var r = t.nodes && t.nodes.t;
1518
- if (r !== null)
1519
- for (const n of r)
1520
- n.stop();
1521
- Bn(t);
1516
+ ), i = !0), Ln(t, e && !i), fi(t, 0), j(t, rt);
1517
+ var n = t.nodes && t.nodes.t;
1518
+ if (n !== null)
1519
+ for (const r of n)
1520
+ r.stop();
1521
+ Br(t);
1522
1522
  var o = t.parent;
1523
- o !== null && o.first !== null && qn(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1523
+ o !== null && o.first !== null && qr(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1524
1524
  }
1525
1525
  function Ls(t, e) {
1526
1526
  for (; t !== null; ) {
@@ -1528,64 +1528,64 @@ function Ls(t, e) {
1528
1528
  t.remove(), t = i;
1529
1529
  }
1530
1530
  }
1531
- function qn(t) {
1532
- var e = t.parent, i = t.prev, r = t.next;
1533
- i !== null && (i.next = r), r !== null && (r.prev = i), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = i));
1531
+ function qr(t) {
1532
+ var e = t.parent, i = t.prev, n = t.next;
1533
+ i !== null && (i.next = n), n !== null && (n.prev = i), e !== null && (e.first === t && (e.first = n), e.last === t && (e.last = i));
1534
1534
  }
1535
1535
  function Lt(t, e, i = !0) {
1536
- var r = [];
1537
- Un(t, r, !0);
1536
+ var n = [];
1537
+ Ur(t, n, !0);
1538
1538
  var o = () => {
1539
1539
  i && ie(t), e && e();
1540
- }, n = r.length;
1541
- if (n > 0) {
1542
- var s = () => --n || o();
1543
- for (var a of r)
1540
+ }, r = n.length;
1541
+ if (r > 0) {
1542
+ var s = () => --r || o();
1543
+ for (var a of n)
1544
1544
  a.out(s);
1545
1545
  } else
1546
1546
  o();
1547
1547
  }
1548
- function Un(t, e, i) {
1548
+ function Ur(t, e, i) {
1549
1549
  if ((t.f & ce) === 0) {
1550
1550
  t.f ^= ce;
1551
- var r = t.nodes && t.nodes.t;
1552
- if (r !== null)
1553
- for (const a of r)
1551
+ var n = t.nodes && t.nodes.t;
1552
+ if (n !== null)
1553
+ for (const a of n)
1554
1554
  (a.is_global || i) && e.push(a);
1555
1555
  for (var o = t.first; o !== null; ) {
1556
- var n = o.next, s = (o.f & Wt) !== 0 || // If this is a branch effect without a block effect parent,
1556
+ var r = o.next, s = (o.f & Wt) !== 0 || // If this is a branch effect without a block effect parent,
1557
1557
  // it means the parent block effect was pruned. In that case,
1558
1558
  // transparency information was transferred to the branch effect.
1559
1559
  (o.f & Oe) !== 0 && (t.f & st) !== 0;
1560
- Un(o, e, s ? i : !1), o = n;
1560
+ Ur(o, e, s ? i : !1), o = r;
1561
1561
  }
1562
1562
  }
1563
1563
  }
1564
- function Lr(t) {
1565
- Yn(t, !0);
1564
+ function On(t) {
1565
+ Yr(t, !0);
1566
1566
  }
1567
- function Yn(t, e) {
1567
+ function Yr(t, e) {
1568
1568
  if ((t.f & ce) !== 0) {
1569
1569
  t.f ^= ce, (t.f & q) === 0 && (j(t, Q), ke(t));
1570
1570
  for (var i = t.first; i !== null; ) {
1571
- var r = i.next, o = (i.f & Wt) !== 0 || (i.f & Oe) !== 0;
1572
- Yn(i, o ? e : !1), i = r;
1571
+ var n = i.next, o = (i.f & Wt) !== 0 || (i.f & Oe) !== 0;
1572
+ Yr(i, o ? e : !1), i = n;
1573
1573
  }
1574
- var n = t.nodes && t.nodes.t;
1575
- if (n !== null)
1576
- for (const s of n)
1574
+ var r = t.nodes && t.nodes.t;
1575
+ if (r !== null)
1576
+ for (const s of r)
1577
1577
  (s.is_global || e) && s.in();
1578
1578
  }
1579
1579
  }
1580
- function Wn(t, e) {
1580
+ function Wr(t, e) {
1581
1581
  if (t.nodes)
1582
- for (var i = t.nodes.start, r = t.nodes.end; i !== null; ) {
1583
- var o = i === r ? null : /* @__PURE__ */ Fe(i);
1582
+ for (var i = t.nodes.start, n = t.nodes.end; i !== null; ) {
1583
+ var o = i === n ? null : /* @__PURE__ */ Fe(i);
1584
1584
  e.append(i), i = o;
1585
1585
  }
1586
1586
  }
1587
1587
  let ki = !1, pt = !1;
1588
- function qr(t) {
1588
+ function Un(t) {
1589
1589
  pt = t;
1590
1590
  }
1591
1591
  let O = null, Ae = !1;
@@ -1597,19 +1597,19 @@ function je(t) {
1597
1597
  M = t;
1598
1598
  }
1599
1599
  let be = null;
1600
- function Kn(t) {
1600
+ function Kr(t) {
1601
1601
  O !== null && (be === null ? be = [t] : be.push(t));
1602
1602
  }
1603
- let ne = null, se = 0, pe = null;
1603
+ let re = null, se = 0, pe = null;
1604
1604
  function Os(t) {
1605
1605
  pe = t;
1606
1606
  }
1607
- let Xn = 1, Tt = 0, Ot = Tt;
1608
- function Ur(t) {
1607
+ let Xr = 1, Tt = 0, Ot = Tt;
1608
+ function Yn(t) {
1609
1609
  Ot = t;
1610
1610
  }
1611
- function Jn() {
1612
- return ++Xn;
1611
+ function Jr() {
1612
+ return ++Xr;
1613
1613
  }
1614
1614
  function mi(t) {
1615
1615
  var e = t.f;
@@ -1619,15 +1619,15 @@ function mi(t) {
1619
1619
  for (var i = (
1620
1620
  /** @type {Value[]} */
1621
1621
  t.deps
1622
- ), r = i.length, o = 0; o < r; o++) {
1623
- var n = i[o];
1622
+ ), n = i.length, o = 0; o < n; o++) {
1623
+ var r = i[o];
1624
1624
  if (mi(
1625
1625
  /** @type {Derived} */
1626
- n
1627
- ) && On(
1626
+ r
1627
+ ) && Or(
1628
1628
  /** @type {Derived} */
1629
- n
1630
- ), n.wv > t.wv)
1629
+ r
1630
+ ), r.wv > t.wv)
1631
1631
  return !0;
1632
1632
  }
1633
1633
  (e & _e) !== 0 && // During time traveling we don't want to reset the status so that
@@ -1636,52 +1636,52 @@ function mi(t) {
1636
1636
  }
1637
1637
  return !1;
1638
1638
  }
1639
- function Qn(t, e, i = !0) {
1640
- var r = t.reactions;
1641
- if (r !== null && !(be !== null && Yt.call(be, t)))
1642
- for (var o = 0; o < r.length; o++) {
1643
- var n = r[o];
1644
- (n.f & J) !== 0 ? Qn(
1639
+ function Qr(t, e, i = !0) {
1640
+ var n = t.reactions;
1641
+ if (n !== null && !(be !== null && Yt.call(be, t)))
1642
+ for (var o = 0; o < n.length; o++) {
1643
+ var r = n[o];
1644
+ (r.f & J) !== 0 ? Qr(
1645
1645
  /** @type {Derived} */
1646
- n,
1646
+ r,
1647
1647
  e,
1648
1648
  !1
1649
- ) : e === n && (i ? j(n, Q) : (n.f & q) !== 0 && j(n, Le), ke(
1649
+ ) : e === r && (i ? j(r, Q) : (r.f & q) !== 0 && j(r, Le), ke(
1650
1650
  /** @type {Effect} */
1651
- n
1651
+ r
1652
1652
  ));
1653
1653
  }
1654
1654
  }
1655
- function Zn(t) {
1655
+ function Zr(t) {
1656
1656
  var b;
1657
- var e = ne, i = se, r = pe, o = O, n = be, s = ue, a = Ae, l = Ot, u = t.f;
1658
- ne = /** @type {null | Value[]} */
1657
+ var e = re, i = se, n = pe, o = O, r = be, s = ue, a = Ae, l = Ot, u = t.f;
1658
+ re = /** @type {null | Value[]} */
1659
1659
  null, se = 0, pe = null, O = (u & (Oe | vt)) === 0 ? t : null, be = null, Kt(t.ctx), Ae = !1, Ot = ++Tt, t.ac !== null && (Bi(() => {
1660
1660
  t.ac.abort(yt);
1661
1661
  }), t.ac = null);
1662
1662
  try {
1663
- t.f |= or;
1663
+ t.f |= sn;
1664
1664
  var d = (
1665
1665
  /** @type {Function} */
1666
1666
  t.fn
1667
1667
  ), _ = d();
1668
1668
  t.f |= Zt;
1669
1669
  var p = t.deps, v = N?.is_fork;
1670
- if (ne !== null) {
1670
+ if (re !== null) {
1671
1671
  var g;
1672
1672
  if (v || fi(t, se), p !== null && se > 0)
1673
- for (p.length = se + ne.length, g = 0; g < ne.length; g++)
1674
- p[se + g] = ne[g];
1673
+ for (p.length = se + re.length, g = 0; g < re.length; g++)
1674
+ p[se + g] = re[g];
1675
1675
  else
1676
- t.deps = p = ne;
1677
- if ($r() && (t.f & _e) !== 0)
1676
+ t.deps = p = re;
1677
+ if (kn() && (t.f & _e) !== 0)
1678
1678
  for (g = se; g < p.length; g++)
1679
1679
  ((b = p[g]).reactions ?? (b.reactions = [])).push(t);
1680
1680
  } else !v && p !== null && se < p.length && (fi(t, se), p.length = se);
1681
- if (mn() && pe !== null && !Ae && p !== null && (t.f & (J | Le | Q)) === 0)
1681
+ if (mr() && pe !== null && !Ae && p !== null && (t.f & (J | Le | Q)) === 0)
1682
1682
  for (g = 0; g < /** @type {Source[]} */
1683
1683
  pe.length; g++)
1684
- Qn(
1684
+ Qr(
1685
1685
  pe[g],
1686
1686
  /** @type {Effect} */
1687
1687
  t
@@ -1693,56 +1693,56 @@ function Zn(t) {
1693
1693
  if (e !== null)
1694
1694
  for (const h of e)
1695
1695
  h.rv = Tt;
1696
- pe !== null && (r === null ? r = pe : r.push(.../** @type {Source[]} */
1696
+ pe !== null && (n === null ? n = pe : n.push(.../** @type {Source[]} */
1697
1697
  pe));
1698
1698
  }
1699
1699
  return (t.f & ft) !== 0 && (t.f ^= ft), _;
1700
1700
  } catch (h) {
1701
- return yn(h);
1701
+ return yr(h);
1702
1702
  } finally {
1703
- t.f ^= or, ne = e, se = i, pe = r, O = o, be = n, Kt(s), Ae = a, Ot = l;
1703
+ t.f ^= sn, re = e, se = i, pe = n, O = o, be = r, Kt(s), Ae = a, Ot = l;
1704
1704
  }
1705
1705
  }
1706
1706
  function Rs(t, e) {
1707
1707
  let i = e.reactions;
1708
1708
  if (i !== null) {
1709
- var r = Co.call(i, t);
1710
- if (r !== -1) {
1709
+ var n = Co.call(i, t);
1710
+ if (n !== -1) {
1711
1711
  var o = i.length - 1;
1712
- o === 0 ? i = e.reactions = null : (i[r] = i[o], i.pop());
1712
+ o === 0 ? i = e.reactions = null : (i[n] = i[o], i.pop());
1713
1713
  }
1714
1714
  }
1715
1715
  if (i === null && (e.f & J) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1716
1716
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1717
1717
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1718
- (ne === null || !Yt.call(ne, e))) {
1719
- var n = (
1718
+ (re === null || !Yt.call(re, e))) {
1719
+ var r = (
1720
1720
  /** @type {Derived} */
1721
1721
  e
1722
1722
  );
1723
- (n.f & _e) !== 0 && (n.f ^= _e, n.f &= ~Rt), Tr(n), bs(n), fi(n, 0);
1723
+ (r.f & _e) !== 0 && (r.f ^= _e, r.f &= ~Rt), In(r), bs(r), fi(r, 0);
1724
1724
  }
1725
1725
  }
1726
1726
  function fi(t, e) {
1727
1727
  var i = t.deps;
1728
1728
  if (i !== null)
1729
- for (var r = e; r < i.length; r++)
1730
- Rs(t, i[r]);
1729
+ for (var n = e; n < i.length; n++)
1730
+ Rs(t, i[n]);
1731
1731
  }
1732
1732
  function Qt(t) {
1733
1733
  var e = t.f;
1734
- if ((e & nt) === 0) {
1734
+ if ((e & rt) === 0) {
1735
1735
  j(t, q);
1736
- var i = M, r = ki;
1736
+ var i = M, n = ki;
1737
1737
  M = t, ki = !0;
1738
1738
  try {
1739
- (e & (st | fn)) !== 0 ? As(t) : Ar(t), Bn(t);
1740
- var o = Zn(t);
1741
- t.teardown = typeof o == "function" ? o : null, t.wv = Xn;
1742
- var n;
1743
- rr && os && (t.f & Q) !== 0 && t.deps;
1739
+ (e & (st | fr)) !== 0 ? As(t) : Ln(t), Br(t);
1740
+ var o = Zr(t);
1741
+ t.teardown = typeof o == "function" ? o : null, t.wv = Xr;
1742
+ var r;
1743
+ rn && os && (t.f & Q) !== 0 && t.deps;
1744
1744
  } finally {
1745
- ki = r, M = i;
1745
+ ki = n, M = i;
1746
1746
  }
1747
1747
  }
1748
1748
  }
@@ -1752,15 +1752,15 @@ async function Vs() {
1752
1752
  function c(t) {
1753
1753
  var e = t.f, i = (e & J) !== 0;
1754
1754
  if (O !== null && !Ae) {
1755
- var r = M !== null && (M.f & nt) !== 0;
1756
- if (!r && (be === null || !Yt.call(be, t))) {
1755
+ var n = M !== null && (M.f & rt) !== 0;
1756
+ if (!n && (be === null || !Yt.call(be, t))) {
1757
1757
  var o = O.deps;
1758
- if ((O.f & or) !== 0)
1759
- t.rv < Tt && (t.rv = Tt, ne === null && o !== null && o[se] === t ? se++ : ne === null ? ne = [t] : ne.push(t));
1758
+ if ((O.f & sn) !== 0)
1759
+ t.rv < Tt && (t.rv = Tt, re === null && o !== null && o[se] === t ? se++ : re === null ? re = [t] : re.push(t));
1760
1760
  else {
1761
1761
  (O.deps ?? (O.deps = [])).push(t);
1762
- var n = t.reactions;
1763
- n === null ? t.reactions = [O] : Yt.call(n, O) || n.push(O);
1762
+ var r = t.reactions;
1763
+ r === null ? t.reactions = [O] : Yt.call(r, O) || r.push(O);
1764
1764
  }
1765
1765
  }
1766
1766
  }
@@ -1773,10 +1773,10 @@ function c(t) {
1773
1773
  );
1774
1774
  if (pt) {
1775
1775
  var a = s.v;
1776
- return ((s.f & q) === 0 && s.reactions !== null || to(s)) && (a = Ir(s)), dt.set(s, a), a;
1776
+ return ((s.f & q) === 0 && s.reactions !== null || to(s)) && (a = En(s)), dt.set(s, a), a;
1777
1777
  }
1778
1778
  var l = (s.f & _e) === 0 && !Ae && O !== null && (ki || (O.f & _e) !== 0), u = (s.f & Zt) === 0;
1779
- mi(s) && (l && (s.f |= _e), On(s)), l && !u && (Rn(s), eo(s));
1779
+ mi(s) && (l && (s.f |= _e), Or(s)), l && !u && (Rr(s), eo(s));
1780
1780
  }
1781
1781
  if ($e?.has(t))
1782
1782
  return $e.get(t);
@@ -1787,7 +1787,7 @@ function c(t) {
1787
1787
  function eo(t) {
1788
1788
  if (t.f |= _e, t.deps !== null)
1789
1789
  for (const e of t.deps)
1790
- (e.reactions ?? (e.reactions = [])).push(t), (e.f & J) !== 0 && (e.f & _e) === 0 && (Rn(
1790
+ (e.reactions ?? (e.reactions = [])).push(t), (e.f & J) !== 0 && (e.f & _e) === 0 && (Rr(
1791
1791
  /** @type {Derived} */
1792
1792
  e
1793
1793
  ), eo(
@@ -1814,23 +1814,23 @@ function Ui(t) {
1814
1814
  Ae = e;
1815
1815
  }
1816
1816
  }
1817
- const It = /* @__PURE__ */ Symbol("events"), io = /* @__PURE__ */ new Set(), vr = /* @__PURE__ */ new Set();
1818
- function Ms(t, e, i, r = {}) {
1819
- function o(n) {
1820
- if (r.capture || gr.call(e, n), !n.cancelBubble)
1821
- return Bi(() => i?.call(this, n));
1817
+ const It = /* @__PURE__ */ Symbol("events"), io = /* @__PURE__ */ new Set(), gn = /* @__PURE__ */ new Set();
1818
+ function Ms(t, e, i, n = {}) {
1819
+ function o(r) {
1820
+ if (n.capture || _n.call(e, r), !r.cancelBubble)
1821
+ return Bi(() => i?.call(this, r));
1822
1822
  }
1823
1823
  return t.startsWith("pointer") || t.startsWith("touch") || t === "wheel" ? xe(() => {
1824
- e.addEventListener(t, o, r);
1825
- }) : e.addEventListener(t, o, r), o;
1824
+ e.addEventListener(t, o, n);
1825
+ }) : e.addEventListener(t, o, n), o;
1826
1826
  }
1827
- function Cs(t, e, i, r, o) {
1828
- var n = { capture: r, passive: o }, s = Ms(t, e, i, n);
1827
+ function Cs(t, e, i, n, o) {
1828
+ var r = { capture: n, passive: o }, s = Ms(t, e, i, r);
1829
1829
  (e === document.body || // @ts-ignore
1830
1830
  e === window || // @ts-ignore
1831
1831
  e === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
1832
- e instanceof HTMLMediaElement) && Hn(() => {
1833
- e.removeEventListener(t, s, n);
1832
+ e instanceof HTMLMediaElement) && Hr(() => {
1833
+ e.removeEventListener(t, s, r);
1834
1834
  });
1835
1835
  }
1836
1836
  function at(t, e, i) {
@@ -1839,20 +1839,20 @@ function at(t, e, i) {
1839
1839
  function Ns(t) {
1840
1840
  for (var e = 0; e < t.length; e++)
1841
1841
  io.add(t[e]);
1842
- for (var i of vr)
1842
+ for (var i of gn)
1843
1843
  i(t);
1844
1844
  }
1845
- let Yr = null;
1846
- function gr(t) {
1845
+ let Wn = null;
1846
+ function _n(t) {
1847
1847
  var e = this, i = (
1848
1848
  /** @type {Node} */
1849
1849
  e.ownerDocument
1850
- ), r = t.type, o = t.composedPath?.() || [], n = (
1850
+ ), n = t.type, o = t.composedPath?.() || [], r = (
1851
1851
  /** @type {null | Element} */
1852
1852
  o[0] || t.target
1853
1853
  );
1854
- Yr = t;
1855
- var s = 0, a = Yr === t && t[It];
1854
+ Wn = t;
1855
+ var s = 0, a = Wn === t && t[It];
1856
1856
  if (a) {
1857
1857
  var l = o.indexOf(a);
1858
1858
  if (l !== -1 && (e === document || e === /** @type {any} */
@@ -1865,32 +1865,32 @@ function gr(t) {
1865
1865
  return;
1866
1866
  l <= u && (s = l);
1867
1867
  }
1868
- if (n = /** @type {Element} */
1869
- o[s] || t.target, n !== e) {
1868
+ if (r = /** @type {Element} */
1869
+ o[s] || t.target, r !== e) {
1870
1870
  Oi(t, "currentTarget", {
1871
1871
  configurable: !0,
1872
1872
  get() {
1873
- return n || i;
1873
+ return r || i;
1874
1874
  }
1875
1875
  });
1876
1876
  var d = O, _ = M;
1877
1877
  ye(null), je(null);
1878
1878
  try {
1879
- for (var p, v = []; n !== null; ) {
1880
- var g = n.assignedSlot || n.parentNode || /** @type {any} */
1881
- n.host || null;
1879
+ for (var p, v = []; r !== null; ) {
1880
+ var g = r.assignedSlot || r.parentNode || /** @type {any} */
1881
+ r.host || null;
1882
1882
  try {
1883
- var b = n[It]?.[r];
1883
+ var b = r[It]?.[n];
1884
1884
  b != null && (!/** @type {any} */
1885
- n.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1885
+ r.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1886
1886
  // -> the target could not have been disabled because it emits the event in the first place
1887
- t.target === n) && b.call(n, t);
1887
+ t.target === r) && b.call(r, t);
1888
1888
  } catch (h) {
1889
1889
  p ? v.push(h) : p = h;
1890
1890
  }
1891
1891
  if (t.cancelBubble || g === e || g === null)
1892
1892
  break;
1893
- n = g;
1893
+ r = g;
1894
1894
  }
1895
1895
  if (p) {
1896
1896
  for (let h of v)
@@ -1917,8 +1917,8 @@ function zs(t) {
1917
1917
  Ps?.createHTML(t) ?? t
1918
1918
  );
1919
1919
  }
1920
- function ro(t, e = !1) {
1921
- var i = Er("template");
1920
+ function no(t, e = !1) {
1921
+ var i = Sn("template");
1922
1922
  return t = t.replaceAll("<!>", "<!---->"), i.innerHTML = e ? zs(t) : t, i.content;
1923
1923
  }
1924
1924
  function Mt(t, e) {
@@ -1929,40 +1929,40 @@ function Mt(t, e) {
1929
1929
  i.nodes === null && (i.nodes = { start: t, end: e, a: null, t: null });
1930
1930
  }
1931
1931
  // @__NO_SIDE_EFFECTS__
1932
- function no(t, e) {
1933
- var i = (e & Mo) !== 0, r, o = !t.startsWith("<!>");
1932
+ function ro(t, e) {
1933
+ var i = (e & Mo) !== 0, n, o = !t.startsWith("<!>");
1934
1934
  return () => {
1935
1935
  if (R)
1936
1936
  return Mt(V, null), V;
1937
- r === void 0 && (r = ro(o ? t : "<!>" + t, !0), r = /** @type {TemplateNode} */
1938
- /* @__PURE__ */ ht(r));
1939
- var n = (
1937
+ n === void 0 && (n = no(o ? t : "<!>" + t, !0), n = /** @type {TemplateNode} */
1938
+ /* @__PURE__ */ ht(n));
1939
+ var r = (
1940
1940
  /** @type {TemplateNode} */
1941
- i || Nn ? document.importNode(r, !0) : r.cloneNode(!0)
1941
+ i || Nr ? document.importNode(n, !0) : n.cloneNode(!0)
1942
1942
  );
1943
- return Mt(n, n), n;
1943
+ return Mt(r, r), r;
1944
1944
  };
1945
1945
  }
1946
1946
  // @__NO_SIDE_EFFECTS__
1947
1947
  function Ds(t, e, i = "svg") {
1948
- var r = !t.startsWith("<!>"), o = `<${i}>${r ? t : "<!>" + t}</${i}>`, n;
1948
+ var n = !t.startsWith("<!>"), o = `<${i}>${n ? t : "<!>" + t}</${i}>`, r;
1949
1949
  return () => {
1950
1950
  if (R)
1951
1951
  return Mt(V, null), V;
1952
- if (!n) {
1952
+ if (!r) {
1953
1953
  var s = (
1954
1954
  /** @type {DocumentFragment} */
1955
- ro(o, !0)
1955
+ no(o, !0)
1956
1956
  ), a = (
1957
1957
  /** @type {Element} */
1958
1958
  /* @__PURE__ */ ht(s)
1959
1959
  );
1960
- n = /** @type {Element} */
1960
+ r = /** @type {Element} */
1961
1961
  /* @__PURE__ */ ht(a);
1962
1962
  }
1963
1963
  var l = (
1964
1964
  /** @type {TemplateNode} */
1965
- n.cloneNode(!0)
1965
+ r.cloneNode(!0)
1966
1966
  );
1967
1967
  return Mt(l, l), l;
1968
1968
  };
@@ -2003,33 +2003,33 @@ function oo(t, e) {
2003
2003
  return so(t, e);
2004
2004
  }
2005
2005
  function Fs(t, e) {
2006
- pr(), e.intro = e.intro ?? !1;
2007
- const i = e.target, r = R, o = V;
2006
+ vn(), e.intro = e.intro ?? !1;
2007
+ const i = e.target, n = R, o = V;
2008
2008
  try {
2009
- for (var n = /* @__PURE__ */ ht(i); n && (n.nodeType !== _i || /** @type {Comment} */
2010
- n.data !== br); )
2011
- n = /* @__PURE__ */ Fe(n);
2012
- if (!n)
2009
+ for (var r = /* @__PURE__ */ ht(i); r && (r.nodeType !== _i || /** @type {Comment} */
2010
+ r.data !== yn); )
2011
+ r = /* @__PURE__ */ Fe(r);
2012
+ if (!r)
2013
2013
  throw Ut;
2014
2014
  it(!0), oe(
2015
2015
  /** @type {Comment} */
2016
- n
2016
+ r
2017
2017
  );
2018
- const s = so(t, { ...e, anchor: n });
2018
+ const s = so(t, { ...e, anchor: r });
2019
2019
  return it(!1), /** @type {Exports} */
2020
2020
  s;
2021
2021
  } catch (s) {
2022
2022
  if (s instanceof Error && s.message.split(`
2023
2023
  `).some((a) => a.startsWith("https://svelte.dev/e/")))
2024
2024
  throw s;
2025
- return s !== Ut && console.warn("Failed to hydrate: ", s), e.recover === !1 && Jo(), pr(), Dn(i), it(!1), oo(t, e);
2025
+ return s !== Ut && console.warn("Failed to hydrate: ", s), e.recover === !1 && Jo(), vn(), Dr(i), it(!1), oo(t, e);
2026
2026
  } finally {
2027
- it(r), oe(o);
2027
+ it(n), oe(o);
2028
2028
  }
2029
2029
  }
2030
2030
  const Ii = /* @__PURE__ */ new Map();
2031
- function so(t, { target: e, anchor: i, props: r = {}, events: o, context: n, intro: s = !0 }) {
2032
- pr();
2031
+ function so(t, { target: e, anchor: i, props: n = {}, events: o, context: r, intro: s = !0 }) {
2032
+ vn();
2033
2033
  var a = void 0, l = $s(() => {
2034
2034
  var u = i ?? e.appendChild(me());
2035
2035
  fs(
@@ -2040,19 +2040,19 @@ function so(t, { target: e, anchor: i, props: r = {}, events: o, context: n, int
2040
2040
  }
2041
2041
  },
2042
2042
  (p) => {
2043
- gn({});
2043
+ gr({});
2044
2044
  var v = (
2045
2045
  /** @type {ComponentContext} */
2046
2046
  ue
2047
2047
  );
2048
- if (n && (v.c = n), o && (r.$$events = o), R && Mt(
2048
+ if (r && (v.c = r), o && (n.$$events = o), R && Mt(
2049
2049
  /** @type {TemplateNode} */
2050
2050
  p,
2051
2051
  null
2052
- ), a = t(p, r) || {}, R && (M.nodes.end = V, V === null || V.nodeType !== _i || /** @type {Comment} */
2053
- V.data !== yr))
2052
+ ), a = t(p, n) || {}, R && (M.nodes.end = V, V === null || V.nodeType !== _i || /** @type {Comment} */
2053
+ V.data !== wn))
2054
2054
  throw ji(), Ut;
2055
- _n();
2055
+ _r();
2056
2056
  }
2057
2057
  );
2058
2058
  var d = /* @__PURE__ */ new Set(), _ = (p) => {
@@ -2065,12 +2065,12 @@ function so(t, { target: e, anchor: i, props: r = {}, events: o, context: n, int
2065
2065
  var h = Ii.get(x);
2066
2066
  h === void 0 && (h = /* @__PURE__ */ new Map(), Ii.set(x, h));
2067
2067
  var y = h.get(g);
2068
- y === void 0 ? (x.addEventListener(g, gr, { passive: b }), h.set(g, 1)) : h.set(g, y + 1);
2068
+ y === void 0 ? (x.addEventListener(g, _n, { passive: b }), h.set(g, 1)) : h.set(g, y + 1);
2069
2069
  }
2070
2070
  }
2071
2071
  }
2072
2072
  };
2073
- return _(zi(io)), vr.add(_), () => {
2073
+ return _(zi(io)), gn.add(_), () => {
2074
2074
  for (var p of d)
2075
2075
  for (const b of [e, document]) {
2076
2076
  var v = (
@@ -2080,17 +2080,17 @@ function so(t, { target: e, anchor: i, props: r = {}, events: o, context: n, int
2080
2080
  /** @type {number} */
2081
2081
  v.get(p)
2082
2082
  );
2083
- --g == 0 ? (b.removeEventListener(p, gr), v.delete(p), v.size === 0 && Ii.delete(b)) : v.set(p, g);
2083
+ --g == 0 ? (b.removeEventListener(p, _n), v.delete(p), v.size === 0 && Ii.delete(b)) : v.set(p, g);
2084
2084
  }
2085
- vr.delete(_), u !== i && u.parentNode?.removeChild(u);
2085
+ gn.delete(_), u !== i && u.parentNode?.removeChild(u);
2086
2086
  };
2087
2087
  });
2088
- return _r.set(a, l), a;
2088
+ return mn.set(a, l), a;
2089
2089
  }
2090
- let _r = /* @__PURE__ */ new WeakMap();
2090
+ let mn = /* @__PURE__ */ new WeakMap();
2091
2091
  function Gs(t, e) {
2092
- const i = _r.get(t);
2093
- return i ? (_r.delete(t), i(e)) : Promise.resolve();
2092
+ const i = mn.get(t);
2093
+ return i ? (mn.delete(t), i(e)) : Promise.resolve();
2094
2094
  }
2095
2095
  var Ee, De, ae, At, vi, gi, Ni;
2096
2096
  class Bs {
@@ -2143,30 +2143,30 @@ class Bs {
2143
2143
  var i = (
2144
2144
  /** @type {Key} */
2145
2145
  f(this, Ee).get(e)
2146
- ), r = f(this, De).get(i);
2147
- if (r)
2148
- Lr(r), f(this, At).delete(i);
2146
+ ), n = f(this, De).get(i);
2147
+ if (n)
2148
+ On(n), f(this, At).delete(i);
2149
2149
  else {
2150
2150
  var o = f(this, ae).get(i);
2151
- o && (f(this, De).set(i, o.effect), f(this, ae).delete(i), o.fragment.lastChild.remove(), this.anchor.before(o.fragment), r = o.effect);
2151
+ o && (f(this, De).set(i, o.effect), f(this, ae).delete(i), o.fragment.lastChild.remove(), this.anchor.before(o.fragment), n = o.effect);
2152
2152
  }
2153
- for (const [n, s] of f(this, Ee)) {
2154
- if (f(this, Ee).delete(n), n === e)
2153
+ for (const [r, s] of f(this, Ee)) {
2154
+ if (f(this, Ee).delete(r), r === e)
2155
2155
  break;
2156
2156
  const a = f(this, ae).get(s);
2157
2157
  a && (ie(a.effect), f(this, ae).delete(s));
2158
2158
  }
2159
- for (const [n, s] of f(this, De)) {
2160
- if (n === i || f(this, At).has(n)) continue;
2159
+ for (const [r, s] of f(this, De)) {
2160
+ if (r === i || f(this, At).has(r)) continue;
2161
2161
  const a = () => {
2162
- if (Array.from(f(this, Ee).values()).includes(n)) {
2162
+ if (Array.from(f(this, Ee).values()).includes(r)) {
2163
2163
  var u = document.createDocumentFragment();
2164
- Wn(s, u), u.append(me()), f(this, ae).set(n, { effect: s, fragment: u });
2164
+ Wr(s, u), u.append(me()), f(this, ae).set(r, { effect: s, fragment: u });
2165
2165
  } else
2166
2166
  ie(s);
2167
- f(this, At).delete(n), f(this, De).delete(n);
2167
+ f(this, At).delete(r), f(this, De).delete(r);
2168
2168
  };
2169
- f(this, vi) || !r ? (f(this, At).add(n), Lt(s, a, !1)) : a();
2169
+ f(this, vi) || !n ? (f(this, At).add(r), Lt(s, a, !1)) : a();
2170
2170
  }
2171
2171
  }
2172
2172
  });
@@ -2176,8 +2176,8 @@ class Bs {
2176
2176
  k(this, Ni, (e) => {
2177
2177
  f(this, Ee).delete(e);
2178
2178
  const i = Array.from(f(this, Ee).values());
2179
- for (const [r, o] of f(this, ae))
2180
- i.includes(r) || (ie(o.effect), f(this, ae).delete(r));
2179
+ for (const [n, o] of f(this, ae))
2180
+ i.includes(n) || (ie(o.effect), f(this, ae).delete(n));
2181
2181
  });
2182
2182
  this.anchor = e, E(this, vi, i);
2183
2183
  }
@@ -2187,28 +2187,28 @@ class Bs {
2187
2187
  * @param {null | ((target: TemplateNode) => void)} fn
2188
2188
  */
2189
2189
  ensure(e, i) {
2190
- var r = (
2190
+ var n = (
2191
2191
  /** @type {Batch} */
2192
2192
  N
2193
- ), o = xn();
2193
+ ), o = xr();
2194
2194
  if (i && !f(this, De).has(e) && !f(this, ae).has(e))
2195
2195
  if (o) {
2196
- var n = document.createDocumentFragment(), s = me();
2197
- n.append(s), f(this, ae).set(e, {
2196
+ var r = document.createDocumentFragment(), s = me();
2197
+ r.append(s), f(this, ae).set(e, {
2198
2198
  effect: Se(() => i(s)),
2199
- fragment: n
2199
+ fragment: r
2200
2200
  });
2201
2201
  } else
2202
2202
  f(this, De).set(
2203
2203
  e,
2204
2204
  Se(() => i(this.anchor))
2205
2205
  );
2206
- if (f(this, Ee).set(r, e), o) {
2206
+ if (f(this, Ee).set(n, e), o) {
2207
2207
  for (const [a, l] of f(this, De))
2208
- a === e ? r.unskip_effect(l) : r.skip_effect(l);
2208
+ a === e ? n.unskip_effect(l) : n.skip_effect(l);
2209
2209
  for (const [a, l] of f(this, ae))
2210
- a === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect);
2211
- r.oncommit(f(this, gi)), r.ondiscard(f(this, Ni));
2210
+ a === e ? n.unskip_effect(l.effect) : n.skip_effect(l.effect);
2211
+ n.oncommit(f(this, gi)), n.ondiscard(f(this, Ni));
2212
2212
  } else
2213
2213
  R && (this.anchor = V), f(this, gi).call(this);
2214
2214
  }
@@ -2223,44 +2223,44 @@ function qs(t) {
2223
2223
  );
2224
2224
  });
2225
2225
  }
2226
- function ni(t, e, i = !1) {
2226
+ function ri(t, e, i = !1) {
2227
2227
  R && Hi();
2228
- var r = new Bs(t), o = i ? Wt : 0;
2229
- function n(s, a) {
2228
+ var n = new Bs(t), o = i ? Wt : 0;
2229
+ function r(s, a) {
2230
2230
  if (R) {
2231
- const d = hn(t);
2231
+ const d = hr(t);
2232
2232
  var l;
2233
- if (d === br ? l = 0 : d === Pi ? l = !1 : l = parseInt(d.substring(1)), s !== l) {
2233
+ if (d === yn ? l = 0 : d === Pi ? l = !1 : l = parseInt(d.substring(1)), s !== l) {
2234
2234
  var u = Ri();
2235
- oe(u), r.anchor = u, it(!1), r.ensure(s, a), it(!0);
2235
+ oe(u), n.anchor = u, it(!1), n.ensure(s, a), it(!0);
2236
2236
  return;
2237
2237
  }
2238
2238
  }
2239
- r.ensure(s, a);
2239
+ n.ensure(s, a);
2240
2240
  }
2241
- kr(() => {
2241
+ An(() => {
2242
2242
  var s = !1;
2243
2243
  e((a, l = 0) => {
2244
- s = !0, n(l, a);
2245
- }), s || n(!1, null);
2244
+ s = !0, r(l, a);
2245
+ }), s || r(!1, null);
2246
2246
  }, o);
2247
2247
  }
2248
2248
  function Ei(t, e) {
2249
2249
  return e;
2250
2250
  }
2251
2251
  function Us(t, e, i) {
2252
- for (var r = [], o = e.length, n, s = e.length, a = 0; a < o; a++) {
2252
+ for (var n = [], o = e.length, r, s = e.length, a = 0; a < o; a++) {
2253
2253
  let _ = e[a];
2254
2254
  Lt(
2255
2255
  _,
2256
2256
  () => {
2257
- if (n) {
2258
- if (n.pending.delete(_), n.done.add(_), n.pending.size === 0) {
2257
+ if (r) {
2258
+ if (r.pending.delete(_), r.done.add(_), r.pending.size === 0) {
2259
2259
  var p = (
2260
2260
  /** @type {Set<EachOutroGroup>} */
2261
2261
  t.outrogroups
2262
2262
  );
2263
- mr(zi(n.done)), p.delete(n), p.size === 0 && (t.outrogroups = null);
2263
+ bn(zi(r.done)), p.delete(r), p.size === 0 && (t.outrogroups = null);
2264
2264
  }
2265
2265
  } else
2266
2266
  s -= 1;
@@ -2269,7 +2269,7 @@ function Us(t, e, i) {
2269
2269
  );
2270
2270
  }
2271
2271
  if (s === 0) {
2272
- var l = r.length === 0 && i !== null;
2272
+ var l = n.length === 0 && i !== null;
2273
2273
  if (l) {
2274
2274
  var u = (
2275
2275
  /** @type {Element} */
@@ -2278,22 +2278,22 @@ function Us(t, e, i) {
2278
2278
  /** @type {Element} */
2279
2279
  u.parentNode
2280
2280
  );
2281
- Dn(d), d.append(u), t.items.clear();
2281
+ Dr(d), d.append(u), t.items.clear();
2282
2282
  }
2283
- mr(e, !l);
2283
+ bn(e, !l);
2284
2284
  } else
2285
- n = {
2285
+ r = {
2286
2286
  pending: new Set(e),
2287
2287
  done: /* @__PURE__ */ new Set()
2288
- }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(n);
2288
+ }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(r);
2289
2289
  }
2290
- function mr(t, e = !0) {
2290
+ function bn(t, e = !0) {
2291
2291
  for (var i = 0; i < t.length; i++)
2292
2292
  ie(t[i], e);
2293
2293
  }
2294
- var Wr;
2295
- function bt(t, e, i, r, o, n = null) {
2296
- var s = t, a = /* @__PURE__ */ new Map(), l = (e & sn) !== 0;
2294
+ var Kn;
2295
+ function bt(t, e, i, n, o, r = null) {
2296
+ var s = t, a = /* @__PURE__ */ new Map(), l = (e & sr) !== 0;
2297
2297
  if (l) {
2298
2298
  var u = (
2299
2299
  /** @type {Element} */
@@ -2304,33 +2304,33 @@ function bt(t, e, i, r, o, n = null) {
2304
2304
  R && Hi();
2305
2305
  var d = null, _ = /* @__PURE__ */ gs(() => {
2306
2306
  var y = i();
2307
- return an(y) ? y : y == null ? [] : zi(y);
2307
+ return ar(y) ? y : y == null ? [] : zi(y);
2308
2308
  }), p, v = !0;
2309
2309
  function g() {
2310
- h.fallback = d, Ys(h, p, s, e, r), d !== null && (p.length === 0 ? (d.f & tt) === 0 ? Lr(d) : (d.f ^= tt, li(d, null, s)) : Lt(d, () => {
2310
+ h.fallback = d, Ys(h, p, s, e, n), d !== null && (p.length === 0 ? (d.f & tt) === 0 ? On(d) : (d.f ^= tt, li(d, null, s)) : Lt(d, () => {
2311
2311
  d = null;
2312
2312
  }));
2313
2313
  }
2314
- var b = kr(() => {
2314
+ var b = An(() => {
2315
2315
  p = /** @type {V[]} */
2316
2316
  c(_);
2317
2317
  var y = p.length;
2318
2318
  let x = !1;
2319
2319
  if (R) {
2320
- var z = hn(s) === Pi;
2320
+ var z = hr(s) === Pi;
2321
2321
  z !== (y === 0) && (s = Ri(), oe(s), it(!1), x = !0);
2322
2322
  }
2323
2323
  for (var H = /* @__PURE__ */ new Set(), U = (
2324
2324
  /** @type {Batch} */
2325
2325
  N
2326
- ), qe = xn(), Y = 0; Y < y; Y += 1) {
2326
+ ), qe = xr(), Y = 0; Y < y; Y += 1) {
2327
2327
  R && V.nodeType === _i && /** @type {Comment} */
2328
- V.data === yr && (s = /** @type {Comment} */
2328
+ V.data === wn && (s = /** @type {Comment} */
2329
2329
  V, x = !0, it(!1));
2330
- var we = p[Y], Me = r(we, Y), F = v ? null : a.get(Me);
2330
+ var we = p[Y], Me = n(we, Y), F = v ? null : a.get(Me);
2331
2331
  F ? (F.v && Jt(F.v, we), F.i && Jt(F.i, Y), qe && U.unskip_effect(F.e)) : (F = Ws(
2332
2332
  a,
2333
- v ? s : Wr ?? (Wr = me()),
2333
+ v ? s : Kn ?? (Kn = me()),
2334
2334
  we,
2335
2335
  Me,
2336
2336
  Y,
@@ -2339,7 +2339,7 @@ function bt(t, e, i, r, o, n = null) {
2339
2339
  i
2340
2340
  ), v || (F.e.f |= tt), a.set(Me, F)), H.add(Me);
2341
2341
  }
2342
- if (y === 0 && n && !d && (v ? d = Se(() => n(s)) : (d = Se(() => n(Wr ?? (Wr = me()))), d.f |= tt)), y > H.size && Uo(), R && y > 0 && oe(Ri()), !v)
2342
+ if (y === 0 && r && !d && (v ? d = Se(() => r(s)) : (d = Se(() => r(Kn ?? (Kn = me()))), d.f |= tt)), y > H.size && Uo(), R && y > 0 && oe(Ri()), !v)
2343
2343
  if (qe) {
2344
2344
  for (const [Nt, Pt] of a)
2345
2345
  H.has(Nt) || U.skip_effect(Pt.e);
@@ -2356,9 +2356,9 @@ function oi(t) {
2356
2356
  t = t.next;
2357
2357
  return t;
2358
2358
  }
2359
- function Ys(t, e, i, r, o) {
2360
- var n = (r & Ro) !== 0, s = e.length, a = t.items, l = oi(t.effect.first), u, d = null, _, p = [], v = [], g, b, h, y;
2361
- if (n)
2359
+ function Ys(t, e, i, n, o) {
2360
+ var r = (n & Ro) !== 0, s = e.length, a = t.items, l = oi(t.effect.first), u, d = null, _, p = [], v = [], g, b, h, y;
2361
+ if (r)
2362
2362
  for (y = 0; y < s; y += 1)
2363
2363
  g = e[y], b = o(g, y), h = /** @type {EachItem} */
2364
2364
  a.get(b).e, (h.f & tt) === 0 && (h.nodes?.a?.measure(), (_ ?? (_ = /* @__PURE__ */ new Set())).add(h));
@@ -2375,7 +2375,7 @@ function Ys(t, e, i, r, o) {
2375
2375
  h === t.effect.last && (t.effect.last = h.prev), h.prev && (h.prev.next = h.next), h.next && (h.next.prev = h.prev), ct(t, d, h), ct(t, h, x), li(h, x, i), d = h, p = [], v = [], l = oi(d.next);
2376
2376
  continue;
2377
2377
  }
2378
- if ((h.f & ce) !== 0 && (Lr(h), n && (h.nodes?.a?.unfix(), (_ ?? (_ = /* @__PURE__ */ new Set())).delete(h))), h !== l) {
2378
+ if ((h.f & ce) !== 0 && (On(h), r && (h.nodes?.a?.unfix(), (_ ?? (_ = /* @__PURE__ */ new Set())).delete(h))), h !== l) {
2379
2379
  if (u !== void 0 && u.has(h)) {
2380
2380
  if (p.length < v.length) {
2381
2381
  var z = v[0], H;
@@ -2399,7 +2399,7 @@ function Ys(t, e, i, r, o) {
2399
2399
  }
2400
2400
  if (t.outrogroups !== null) {
2401
2401
  for (const F of t.outrogroups)
2402
- F.pending.size === 0 && (mr(zi(F.done)), t.outrogroups?.delete(F));
2402
+ F.pending.size === 0 && (bn(zi(F.done)), t.outrogroups?.delete(F));
2403
2403
  t.outrogroups.size === 0 && (t.outrogroups = null);
2404
2404
  }
2405
2405
  if (l !== null || u !== void 0) {
@@ -2411,8 +2411,8 @@ function Ys(t, e, i, r, o) {
2411
2411
  (l.f & ce) === 0 && l !== t.fallback && Y.push(l), l = oi(l.next);
2412
2412
  var we = Y.length;
2413
2413
  if (we > 0) {
2414
- var Me = (r & sn) !== 0 && s === 0 ? i : null;
2415
- if (n) {
2414
+ var Me = (n & sr) !== 0 && s === 0 ? i : null;
2415
+ if (r) {
2416
2416
  for (y = 0; y < we; y += 1)
2417
2417
  Y[y].nodes?.a?.measure();
2418
2418
  for (y = 0; y < we; y += 1)
@@ -2421,43 +2421,43 @@ function Ys(t, e, i, r, o) {
2421
2421
  Us(t, Y, Me);
2422
2422
  }
2423
2423
  }
2424
- n && xe(() => {
2424
+ r && xe(() => {
2425
2425
  if (_ !== void 0)
2426
2426
  for (h of _)
2427
2427
  h.nodes?.a?.apply();
2428
2428
  });
2429
2429
  }
2430
- function Ws(t, e, i, r, o, n, s, a) {
2431
- var l = (s & Lo) !== 0 ? (s & Vo) === 0 ? /* @__PURE__ */ Mn(i, !1, !1) : Vt(i) : null, u = (s & Oo) !== 0 ? Vt(o) : null;
2430
+ function Ws(t, e, i, n, o, r, s, a) {
2431
+ var l = (s & Lo) !== 0 ? (s & Vo) === 0 ? /* @__PURE__ */ Mr(i, !1, !1) : Vt(i) : null, u = (s & Oo) !== 0 ? Vt(o) : null;
2432
2432
  return {
2433
2433
  v: l,
2434
2434
  i: u,
2435
- e: Se(() => (n(e, l ?? i, u ?? o, a), () => {
2436
- t.delete(r);
2435
+ e: Se(() => (r(e, l ?? i, u ?? o, a), () => {
2436
+ t.delete(n);
2437
2437
  }))
2438
2438
  };
2439
2439
  }
2440
2440
  function li(t, e, i) {
2441
2441
  if (t.nodes)
2442
- for (var r = t.nodes.start, o = t.nodes.end, n = e && (e.f & tt) === 0 ? (
2442
+ for (var n = t.nodes.start, o = t.nodes.end, r = e && (e.f & tt) === 0 ? (
2443
2443
  /** @type {EffectNodes} */
2444
2444
  e.nodes.start
2445
- ) : i; r !== null; ) {
2445
+ ) : i; n !== null; ) {
2446
2446
  var s = (
2447
2447
  /** @type {TemplateNode} */
2448
- /* @__PURE__ */ Fe(r)
2448
+ /* @__PURE__ */ Fe(n)
2449
2449
  );
2450
- if (n.before(r), r === o)
2450
+ if (r.before(n), n === o)
2451
2451
  return;
2452
- r = s;
2452
+ n = s;
2453
2453
  }
2454
2454
  }
2455
2455
  function ct(t, e, i) {
2456
2456
  e === null ? t.effect.first = i : e.next = i, i === null ? t.effect.last = e : i.prev = e;
2457
2457
  }
2458
2458
  function Ks(t, e) {
2459
- Gn(() => {
2460
- var i = t.getRootNode(), r = (
2459
+ Gr(() => {
2460
+ var i = t.getRootNode(), n = (
2461
2461
  /** @type {ShadowRoot} */
2462
2462
  i.host ? (
2463
2463
  /** @type {ShadowRoot} */
@@ -2468,50 +2468,50 @@ function Ks(t, e) {
2468
2468
  i.ownerDocument.head
2469
2469
  )
2470
2470
  );
2471
- if (!r.querySelector("#" + e.hash)) {
2472
- const o = Er("style");
2473
- o.id = e.hash, o.textContent = e.code, r.appendChild(o);
2471
+ if (!n.querySelector("#" + e.hash)) {
2472
+ const o = Sn("style");
2473
+ o.id = e.hash, o.textContent = e.code, n.appendChild(o);
2474
2474
  }
2475
2475
  });
2476
2476
  }
2477
- const Kr = [...`
2477
+ const Xn = [...`
2478
2478
  \r\f \v\uFEFF`];
2479
2479
  function Xs(t, e, i) {
2480
- var r = t == null ? "" : "" + t;
2480
+ var n = t == null ? "" : "" + t;
2481
2481
  if (i) {
2482
2482
  for (var o in i)
2483
2483
  if (i[o])
2484
- r = r ? r + " " + o : o;
2485
- else if (r.length)
2486
- for (var n = o.length, s = 0; (s = r.indexOf(o, s)) >= 0; ) {
2487
- var a = s + n;
2488
- (s === 0 || Kr.includes(r[s - 1])) && (a === r.length || Kr.includes(r[a])) ? r = (s === 0 ? "" : r.substring(0, s)) + r.substring(a + 1) : s = a;
2484
+ n = n ? n + " " + o : o;
2485
+ else if (n.length)
2486
+ for (var r = o.length, s = 0; (s = n.indexOf(o, s)) >= 0; ) {
2487
+ var a = s + r;
2488
+ (s === 0 || Xn.includes(n[s - 1])) && (a === n.length || Xn.includes(n[a])) ? n = (s === 0 ? "" : n.substring(0, s)) + n.substring(a + 1) : s = a;
2489
2489
  }
2490
2490
  }
2491
- return r === "" ? null : r;
2491
+ return n === "" ? null : n;
2492
2492
  }
2493
2493
  function Js(t, e) {
2494
2494
  return t == null ? null : String(t);
2495
2495
  }
2496
- function Xr(t, e, i, r, o, n) {
2496
+ function Jn(t, e, i, n, o, r) {
2497
2497
  var s = t.__className;
2498
2498
  if (R || s !== i || s === void 0) {
2499
- var a = Xs(i, r, n);
2499
+ var a = Xs(i, n, r);
2500
2500
  (!R || a !== t.getAttribute("class")) && (a == null ? t.removeAttribute("class") : e ? t.className = a : t.setAttribute("class", a)), t.__className = i;
2501
- } else if (n && o !== n)
2502
- for (var l in n) {
2503
- var u = !!n[l];
2501
+ } else if (r && o !== r)
2502
+ for (var l in r) {
2503
+ var u = !!r[l];
2504
2504
  (o == null || u !== !!o[l]) && t.classList.toggle(l, u);
2505
2505
  }
2506
- return n;
2506
+ return r;
2507
2507
  }
2508
- function Jr(t, e, i, r) {
2508
+ function Qn(t, e, i, n) {
2509
2509
  var o = t.__style;
2510
2510
  if (R || o !== e) {
2511
- var n = Js(e);
2512
- (!R || n !== t.getAttribute("style")) && (n == null ? t.removeAttribute("style") : t.style.cssText = n), t.__style = e;
2511
+ var r = Js(e);
2512
+ (!R || r !== t.getAttribute("style")) && (r == null ? t.removeAttribute("style") : t.style.cssText = r), t.__style = e;
2513
2513
  }
2514
- return r;
2514
+ return n;
2515
2515
  }
2516
2516
  const Qs = /* @__PURE__ */ Symbol("is custom element"), Zs = /* @__PURE__ */ Symbol("is html"), el = Go ? "link" : "LINK";
2517
2517
  function tl(t) {
@@ -2519,8 +2519,8 @@ function tl(t) {
2519
2519
  var e = !1, i = () => {
2520
2520
  if (!e) {
2521
2521
  if (e = !0, t.hasAttribute("value")) {
2522
- var r = t.value;
2523
- P(t, "value", null), t.value = r;
2522
+ var n = t.value;
2523
+ P(t, "value", null), t.value = n;
2524
2524
  }
2525
2525
  if (t.hasAttribute("checked")) {
2526
2526
  var o = t.checked;
@@ -2528,12 +2528,12 @@ function tl(t) {
2528
2528
  }
2529
2529
  }
2530
2530
  };
2531
- t.__on_r = i, xe(i), jn();
2531
+ t.__on_r = i, xe(i), jr();
2532
2532
  }
2533
2533
  }
2534
- function P(t, e, i, r) {
2534
+ function P(t, e, i, n) {
2535
2535
  var o = il(t);
2536
- R && (o[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === el) || o[e] !== (o[e] = i) && (e === "loading" && (t[Fo] = i), i == null ? t.removeAttribute(e) : typeof i != "string" && rl(t).includes(e) ? t[e] = i : t.setAttribute(e, i));
2536
+ R && (o[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === el) || o[e] !== (o[e] = i) && (e === "loading" && (t[Fo] = i), i == null ? t.removeAttribute(e) : typeof i != "string" && nl(t).includes(e) ? t[e] = i : t.setAttribute(e, i));
2537
2537
  }
2538
2538
  function il(t) {
2539
2539
  return (
@@ -2541,30 +2541,30 @@ function il(t) {
2541
2541
  // @ts-expect-error
2542
2542
  t.__attributes ?? (t.__attributes = {
2543
2543
  [Qs]: t.nodeName.includes("-"),
2544
- [Zs]: t.namespaceURI === ln
2544
+ [Zs]: t.namespaceURI === lr
2545
2545
  })
2546
2546
  );
2547
2547
  }
2548
- var Qr = /* @__PURE__ */ new Map();
2549
- function rl(t) {
2550
- var e = t.getAttribute("is") || t.nodeName, i = Qr.get(e);
2548
+ var Zn = /* @__PURE__ */ new Map();
2549
+ function nl(t) {
2550
+ var e = t.getAttribute("is") || t.nodeName, i = Zn.get(e);
2551
2551
  if (i) return i;
2552
- Qr.set(e, i = []);
2553
- for (var r, o = t, n = Element.prototype; n !== o; ) {
2554
- r = No(o);
2555
- for (var s in r)
2556
- r[s].set && i.push(s);
2557
- o = cn(o);
2552
+ Zn.set(e, i = []);
2553
+ for (var n, o = t, r = Element.prototype; r !== o; ) {
2554
+ n = No(o);
2555
+ for (var s in n)
2556
+ n[s].set && i.push(s);
2557
+ o = cr(o);
2558
2558
  }
2559
2559
  return i;
2560
2560
  }
2561
- function nl(t, e, i = e) {
2562
- var r = /* @__PURE__ */ new WeakSet();
2561
+ function rl(t, e, i = e) {
2562
+ var n = /* @__PURE__ */ new WeakSet();
2563
2563
  Ts(t, "input", async (o) => {
2564
- var n = o ? t.defaultValue : t.value;
2565
- if (n = er(t) ? tr(n) : n, i(n), N !== null && r.add(N), await Vs(), n !== (n = e())) {
2564
+ var r = o ? t.defaultValue : t.value;
2565
+ if (r = en(t) ? tn(r) : r, i(r), N !== null && n.add(N), await Vs(), r !== (r = e())) {
2566
2566
  var s = t.selectionStart, a = t.selectionEnd, l = t.value.length;
2567
- if (t.value = n ?? "", a !== null) {
2567
+ if (t.value = r ?? "", a !== null) {
2568
2568
  var u = t.value.length;
2569
2569
  s === a && a === l && u > l ? (t.selectionStart = u, t.selectionEnd = u) : (t.selectionStart = s, t.selectionEnd = Math.min(a, u));
2570
2570
  }
@@ -2573,58 +2573,58 @@ function nl(t, e, i = e) {
2573
2573
  // then use the updated value from the input instead.
2574
2574
  (R && t.defaultValue !== t.value || // If defaultValue is set, then value == defaultValue
2575
2575
  // TODO Svelte 6: remove input.value check and set to empty string?
2576
- Ui(e) == null && t.value) && (i(er(t) ? tr(t.value) : t.value), N !== null && r.add(N)), qi(() => {
2576
+ Ui(e) == null && t.value) && (i(en(t) ? tn(t.value) : t.value), N !== null && n.add(N)), qi(() => {
2577
2577
  var o = e();
2578
2578
  if (t === document.activeElement) {
2579
- var n = (
2579
+ var r = (
2580
2580
  /** @type {Batch} */
2581
- sr ?? N
2581
+ ln ?? N
2582
2582
  );
2583
- if (r.has(n))
2583
+ if (n.has(r))
2584
2584
  return;
2585
2585
  }
2586
- er(t) && o === tr(t.value) || t.type === "date" && !o && !t.value || o !== t.value && (t.value = o ?? "");
2586
+ en(t) && o === tn(t.value) || t.type === "date" && !o && !t.value || o !== t.value && (t.value = o ?? "");
2587
2587
  });
2588
2588
  }
2589
- function er(t) {
2589
+ function en(t) {
2590
2590
  var e = t.type;
2591
2591
  return e === "number" || e === "range";
2592
2592
  }
2593
- function tr(t) {
2593
+ function tn(t) {
2594
2594
  return t === "" ? null : +t;
2595
2595
  }
2596
- function Zr(t, e) {
2596
+ function er(t, e) {
2597
2597
  return t === e || t?.[Si] === e;
2598
2598
  }
2599
- function ir(t = {}, e, i, r) {
2600
- return Gn(() => {
2601
- var o, n;
2599
+ function nn(t = {}, e, i, n) {
2600
+ return Gr(() => {
2601
+ var o, r;
2602
2602
  return qi(() => {
2603
- o = n, n = [], Ui(() => {
2604
- t !== i(...n) && (e(t, ...n), o && Zr(i(...o), t) && e(null, ...o));
2603
+ o = r, r = [], Ui(() => {
2604
+ t !== i(...r) && (e(t, ...r), o && er(i(...o), t) && e(null, ...o));
2605
2605
  });
2606
2606
  }), () => {
2607
2607
  xe(() => {
2608
- n && Zr(i(...n), t) && e(null, ...n);
2608
+ r && er(i(...r), t) && e(null, ...r);
2609
2609
  });
2610
2610
  };
2611
2611
  }), t;
2612
2612
  }
2613
- function en(t, e, i, r) {
2613
+ function tr(t, e, i, n) {
2614
2614
  var o = (
2615
2615
  /** @type {V} */
2616
- r
2617
- ), n = !0, s = () => (n && (n = !1, o = /** @type {V} */
2618
- r), o), a;
2616
+ n
2617
+ ), r = !0, s = () => (r && (r = !1, o = /** @type {V} */
2618
+ n), o), a;
2619
2619
  a = /** @type {V} */
2620
- t[e], a === void 0 && r !== void 0 && (a = s());
2620
+ t[e], a === void 0 && n !== void 0 && (a = s());
2621
2621
  var l;
2622
2622
  l = () => {
2623
2623
  var p = (
2624
2624
  /** @type {V} */
2625
2625
  t[e]
2626
2626
  );
2627
- return p === void 0 ? s() : (n = !0, p);
2627
+ return p === void 0 ? s() : (r = !0, p);
2628
2628
  };
2629
2629
  var u = !1, d = /* @__PURE__ */ Gi(() => (u = !1, l())), _ = (
2630
2630
  /** @type {Effect} */
@@ -2637,7 +2637,7 @@ function en(t, e, i, r) {
2637
2637
  const g = v ? c(d) : p;
2638
2638
  return T(d, g), u = !0, o !== void 0 && (o = g), p;
2639
2639
  }
2640
- return pt && u || (_.f & nt) !== 0 ? d.v : c(d);
2640
+ return pt && u || (_.f & rt) !== 0 ? d.v : c(d);
2641
2641
  })
2642
2642
  );
2643
2643
  }
@@ -2656,21 +2656,21 @@ class sl {
2656
2656
  k(this, et);
2657
2657
  /** @type {Record<string, any>} */
2658
2658
  k(this, ge);
2659
- var i = /* @__PURE__ */ new Map(), r = (n, s) => {
2660
- var a = /* @__PURE__ */ Mn(s, !1, !1);
2661
- return i.set(n, a), a;
2659
+ var i = /* @__PURE__ */ new Map(), n = (r, s) => {
2660
+ var a = /* @__PURE__ */ Mr(s, !1, !1);
2661
+ return i.set(r, a), a;
2662
2662
  };
2663
2663
  const o = new Proxy(
2664
2664
  { ...e.props || {}, $$events: {} },
2665
2665
  {
2666
- get(n, s) {
2667
- return c(i.get(s) ?? r(s, Reflect.get(n, s)));
2666
+ get(r, s) {
2667
+ return c(i.get(s) ?? n(s, Reflect.get(r, s)));
2668
2668
  },
2669
- has(n, s) {
2670
- return s === Ho ? !0 : (c(i.get(s) ?? r(s, Reflect.get(n, s))), Reflect.has(n, s));
2669
+ has(r, s) {
2670
+ return s === Ho ? !0 : (c(i.get(s) ?? n(s, Reflect.get(r, s))), Reflect.has(r, s));
2671
2671
  },
2672
- set(n, s, a) {
2673
- return T(i.get(s) ?? r(s, a), a), Reflect.set(n, s, a);
2672
+ set(r, s, a) {
2673
+ return T(i.get(s) ?? n(s, a), a), Reflect.set(r, s, a);
2674
2674
  }
2675
2675
  }
2676
2676
  );
@@ -2682,20 +2682,20 @@ class sl {
2682
2682
  intro: e.intro ?? !1,
2683
2683
  recover: e.recover
2684
2684
  })), (!e?.props?.$$host || e.sync === !1) && Vi(), E(this, et, o.$$events);
2685
- for (const n of Object.keys(f(this, ge)))
2686
- n === "$set" || n === "$destroy" || n === "$on" || Oi(this, n, {
2685
+ for (const r of Object.keys(f(this, ge)))
2686
+ r === "$set" || r === "$destroy" || r === "$on" || Oi(this, r, {
2687
2687
  get() {
2688
- return f(this, ge)[n];
2688
+ return f(this, ge)[r];
2689
2689
  },
2690
2690
  /** @param {any} value */
2691
2691
  set(s) {
2692
- f(this, ge)[n] = s;
2692
+ f(this, ge)[r] = s;
2693
2693
  },
2694
2694
  enumerable: !0
2695
2695
  });
2696
2696
  f(this, ge).$set = /** @param {Record<string, any>} next */
2697
- (n) => {
2698
- Object.assign(o, n);
2697
+ (r) => {
2698
+ Object.assign(o, r);
2699
2699
  }, f(this, ge).$destroy = () => {
2700
2700
  Gs(f(this, ge));
2701
2701
  };
@@ -2711,11 +2711,11 @@ class sl {
2711
2711
  */
2712
2712
  $on(e, i) {
2713
2713
  f(this, et)[e] = f(this, et)[e] || [];
2714
- const r = (...o) => i.call(this, ...o);
2715
- return f(this, et)[e].push(r), () => {
2714
+ const n = (...o) => i.call(this, ...o);
2715
+ return f(this, et)[e].push(n), () => {
2716
2716
  f(this, et)[e] = f(this, et)[e].filter(
2717
2717
  /** @param {any} fn */
2718
- (o) => o !== r
2718
+ (o) => o !== n
2719
2719
  );
2720
2720
  };
2721
2721
  }
@@ -2731,7 +2731,7 @@ typeof HTMLElement == "function" && (lo = class extends HTMLElement {
2731
2731
  * @param {*} $$slots
2732
2732
  * @param {ShadowRootInit | undefined} shadow_root_init
2733
2733
  */
2734
- constructor(e, i, r) {
2734
+ constructor(e, i, n) {
2735
2735
  super();
2736
2736
  /** The Svelte component constructor */
2737
2737
  S(this, "$$ctor");
@@ -2755,27 +2755,27 @@ typeof HTMLElement == "function" && (lo = class extends HTMLElement {
2755
2755
  S(this, "$$me");
2756
2756
  /** @type {ShadowRoot | null} The ShadowRoot of the custom element */
2757
2757
  S(this, "$$shadowRoot", null);
2758
- this.$$ctor = e, this.$$s = i, r && (this.$$shadowRoot = this.attachShadow(r));
2758
+ this.$$ctor = e, this.$$s = i, n && (this.$$shadowRoot = this.attachShadow(n));
2759
2759
  }
2760
2760
  /**
2761
2761
  * @param {string} type
2762
2762
  * @param {EventListenerOrEventListenerObject} listener
2763
2763
  * @param {boolean | AddEventListenerOptions} [options]
2764
2764
  */
2765
- addEventListener(e, i, r) {
2765
+ addEventListener(e, i, n) {
2766
2766
  if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(i), this.$$c) {
2767
2767
  const o = this.$$c.$on(e, i);
2768
2768
  this.$$l_u.set(i, o);
2769
2769
  }
2770
- super.addEventListener(e, i, r);
2770
+ super.addEventListener(e, i, n);
2771
2771
  }
2772
2772
  /**
2773
2773
  * @param {string} type
2774
2774
  * @param {EventListenerOrEventListenerObject} listener
2775
2775
  * @param {boolean | AddEventListenerOptions} [options]
2776
2776
  */
2777
- removeEventListener(e, i, r) {
2778
- if (super.removeEventListener(e, i, r), this.$$c) {
2777
+ removeEventListener(e, i, n) {
2778
+ if (super.removeEventListener(e, i, n), this.$$c) {
2779
2779
  const o = this.$$l_u.get(i);
2780
2780
  o && (o(), this.$$l_u.delete(i));
2781
2781
  }
@@ -2783,19 +2783,19 @@ typeof HTMLElement == "function" && (lo = class extends HTMLElement {
2783
2783
  async connectedCallback() {
2784
2784
  if (this.$$cn = !0, !this.$$c) {
2785
2785
  let e = function(o) {
2786
- return (n) => {
2787
- const s = Er("slot");
2788
- o !== "default" && (s.name = o), K(n, s);
2786
+ return (r) => {
2787
+ const s = Sn("slot");
2788
+ o !== "default" && (s.name = o), K(r, s);
2789
2789
  };
2790
2790
  };
2791
2791
  if (await Promise.resolve(), !this.$$cn || this.$$c)
2792
2792
  return;
2793
- const i = {}, r = ll(this);
2793
+ const i = {}, n = ll(this);
2794
2794
  for (const o of this.$$s)
2795
- o in r && (o === "default" && !this.$$d.children ? (this.$$d.children = e(o), i.default = !0) : i[o] = e(o));
2795
+ o in n && (o === "default" && !this.$$d.children ? (this.$$d.children = e(o), i.default = !0) : i[o] = e(o));
2796
2796
  for (const o of this.attributes) {
2797
- const n = this.$$g_p(o.name);
2798
- n in this.$$d || (this.$$d[n] = Ai(n, o.value, this.$$p_d, "toProp"));
2797
+ const r = this.$$g_p(o.name);
2798
+ r in this.$$d || (this.$$d[r] = Ai(r, o.value, this.$$p_d, "toProp"));
2799
2799
  }
2800
2800
  for (const o in this.$$p_d)
2801
2801
  !(o in this.$$d) && this[o] !== void 0 && (this.$$d[o] = this[o], delete this[o]);
@@ -2813,21 +2813,21 @@ typeof HTMLElement == "function" && (lo = class extends HTMLElement {
2813
2813
  for (const o of Li(this.$$c)) {
2814
2814
  if (!this.$$p_d[o]?.reflect) continue;
2815
2815
  this.$$d[o] = this.$$c[o];
2816
- const n = Ai(
2816
+ const r = Ai(
2817
2817
  o,
2818
2818
  this.$$d[o],
2819
2819
  this.$$p_d,
2820
2820
  "toAttribute"
2821
2821
  );
2822
- n == null ? this.removeAttribute(this.$$p_d[o].attribute || o) : this.setAttribute(this.$$p_d[o].attribute || o, n);
2822
+ r == null ? this.removeAttribute(this.$$p_d[o].attribute || o) : this.setAttribute(this.$$p_d[o].attribute || o, r);
2823
2823
  }
2824
2824
  this.$$r = !1;
2825
2825
  });
2826
2826
  });
2827
2827
  for (const o in this.$$l)
2828
- for (const n of this.$$l[o]) {
2829
- const s = this.$$c.$on(o, n);
2830
- this.$$l_u.set(n, s);
2828
+ for (const r of this.$$l[o]) {
2829
+ const s = this.$$c.$on(o, r);
2830
+ this.$$l_u.set(r, s);
2831
2831
  }
2832
2832
  this.$$l = {};
2833
2833
  }
@@ -2839,8 +2839,8 @@ typeof HTMLElement == "function" && (lo = class extends HTMLElement {
2839
2839
  * @param {string} _oldValue
2840
2840
  * @param {string} newValue
2841
2841
  */
2842
- attributeChangedCallback(e, i, r) {
2843
- this.$$r || (e = this.$$g_p(e), this.$$d[e] = Ai(e, r, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
2842
+ attributeChangedCallback(e, i, n) {
2843
+ this.$$r || (e = this.$$g_p(e), this.$$d[e] = Ai(e, n, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
2844
2844
  }
2845
2845
  disconnectedCallback() {
2846
2846
  this.$$cn = !1, Promise.resolve().then(() => {
@@ -2856,11 +2856,11 @@ typeof HTMLElement == "function" && (lo = class extends HTMLElement {
2856
2856
  ) || e;
2857
2857
  }
2858
2858
  });
2859
- function Ai(t, e, i, r) {
2859
+ function Ai(t, e, i, n) {
2860
2860
  const o = i[t]?.type;
2861
- if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !i[t])
2861
+ if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !n || !i[t])
2862
2862
  return e;
2863
- if (r === "toAttribute")
2863
+ if (n === "toAttribute")
2864
2864
  switch (o) {
2865
2865
  case "Object":
2866
2866
  case "Array":
@@ -2895,7 +2895,7 @@ function ll(t) {
2895
2895
  ] = !0;
2896
2896
  }), e;
2897
2897
  }
2898
- function al(t, e, i, r, o, n) {
2898
+ function al(t, e, i, n, o, r) {
2899
2899
  let s = class extends lo {
2900
2900
  constructor() {
2901
2901
  super(t, i, o), this.$$p_d = e;
@@ -2920,7 +2920,7 @@ function al(t, e, i, r, o, n) {
2920
2920
  }
2921
2921
  }
2922
2922
  });
2923
- }), r.forEach((a) => {
2923
+ }), n.forEach((a) => {
2924
2924
  Oi(s.prototype, a, {
2925
2925
  get() {
2926
2926
  return this.$$c?.[a];
@@ -2930,13 +2930,13 @@ function al(t, e, i, r, o, n) {
2930
2930
  s, s;
2931
2931
  }
2932
2932
  class cl extends Event {
2933
- constructor(i, r, o, n) {
2933
+ constructor(i, n, o, r) {
2934
2934
  super("context-request", { bubbles: !0, composed: !0 });
2935
2935
  S(this, "context");
2936
2936
  S(this, "contextTarget");
2937
2937
  S(this, "callback");
2938
2938
  S(this, "subscribe");
2939
- this.context = i, this.contextTarget = r, this.callback = o, this.subscribe = n ?? !1;
2939
+ this.context = i, this.contextTarget = n, this.callback = o, this.subscribe = r ?? !1;
2940
2940
  }
2941
2941
  }
2942
2942
  class ul {
@@ -2968,29 +2968,29 @@ class ul {
2968
2968
  }
2969
2969
  const fl = (t) => t, dl = fl(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext"));
2970
2970
  function hl(t, e, i) {
2971
- let r = !1;
2971
+ let n = !1;
2972
2972
  const o = new ul(t, {
2973
2973
  context: e,
2974
2974
  subscribe: !0,
2975
2975
  onValue: (u) => {
2976
- r = !0, i(u);
2976
+ n = !0, i(u);
2977
2977
  }
2978
2978
  });
2979
2979
  o.connect();
2980
- const n = (u) => {
2980
+ const r = (u) => {
2981
2981
  u.context === e && o.requestValue();
2982
2982
  };
2983
- t.addEventListener("context-provider", n);
2983
+ t.addEventListener("context-provider", r);
2984
2984
  let s = 0;
2985
2985
  const a = 200, l = globalThis.setInterval(() => {
2986
- if (r || s >= a) {
2986
+ if (n || s >= a) {
2987
2987
  globalThis.clearInterval(l);
2988
2988
  return;
2989
2989
  }
2990
2990
  s += 1, o.requestValue();
2991
2991
  }, 50);
2992
2992
  return () => {
2993
- globalThis.clearInterval(l), t.removeEventListener("context-provider", n), o.disconnect();
2993
+ globalThis.clearInterval(l), t.removeEventListener("context-provider", r), o.disconnect();
2994
2994
  };
2995
2995
  }
2996
2996
  function pl(t, e) {
@@ -2999,14 +2999,14 @@ function pl(t, e) {
2999
2999
  function vl(t, e) {
3000
3000
  return pl(t, e);
3001
3001
  }
3002
- var tn;
3002
+ var ir;
3003
3003
  (function(t) {
3004
3004
  t.TTS_WORD = "tts-word", t.TTS_SENTENCE = "tts-sentence", t.ANNOTATION = "annotation";
3005
- })(tn || (tn = {}));
3006
- var rn;
3005
+ })(ir || (ir = {}));
3006
+ var nr;
3007
3007
  (function(t) {
3008
3008
  t.YELLOW = "yellow", t.GREEN = "green", t.BLUE = "blue", t.PINK = "pink", t.ORANGE = "orange", t.UNDERLINE = "underline";
3009
- })(rn || (rn = {}));
3009
+ })(nr || (nr = {}));
3010
3010
  const gl = {
3011
3011
  tts: "textToSpeech",
3012
3012
  colorScheme: "theme"
@@ -3060,11 +3060,11 @@ class ml {
3060
3060
  throw new Error(`Cannot override non-existent tool '${e.toolId}'`);
3061
3061
  const i = this.tools.get(e.toolId);
3062
3062
  if (i.pnpSupportIds)
3063
- for (const r of i.pnpSupportIds)
3064
- this.pnpIndex.get(r)?.delete(e.toolId);
3063
+ for (const n of i.pnpSupportIds)
3064
+ this.pnpIndex.get(n)?.delete(e.toolId);
3065
3065
  if (this.tools.set(e.toolId, e), e.pnpSupportIds)
3066
- for (const r of e.pnpSupportIds)
3067
- this.pnpIndex.has(r) || this.pnpIndex.set(r, /* @__PURE__ */ new Set()), this.pnpIndex.get(r).add(e.toolId);
3066
+ for (const n of e.pnpSupportIds)
3067
+ this.pnpIndex.has(n) || this.pnpIndex.set(n, /* @__PURE__ */ new Set()), this.pnpIndex.get(n).add(e.toolId);
3068
3068
  }
3069
3069
  /**
3070
3070
  * Unregister a tool
@@ -3075,8 +3075,8 @@ class ml {
3075
3075
  const i = this.tools.get(e);
3076
3076
  if (i) {
3077
3077
  if (i.pnpSupportIds)
3078
- for (const r of i.pnpSupportIds)
3079
- this.pnpIndex.get(r)?.delete(e);
3078
+ for (const n of i.pnpSupportIds)
3079
+ this.pnpIndex.get(n)?.delete(e);
3080
3080
  this.tools.delete(e);
3081
3081
  }
3082
3082
  }
@@ -3132,6 +3132,24 @@ class ml {
3132
3132
  getToolsByLevel(e) {
3133
3133
  return this.getAllTools().filter((i) => i.supportedLevels.includes(e));
3134
3134
  }
3135
+ /**
3136
+ * Resolve tool activation with backward-compatible defaults.
3137
+ */
3138
+ getToolActivation(e) {
3139
+ return this.get(e)?.activation || "toolbar-toggle";
3140
+ }
3141
+ /**
3142
+ * Resolve singleton scope for a tool when present.
3143
+ */
3144
+ getToolSingletonScope(e) {
3145
+ return this.get(e)?.singletonScope || null;
3146
+ }
3147
+ /**
3148
+ * Filter tool IDs by activation type.
3149
+ */
3150
+ filterToolIdsByActivation(e, i) {
3151
+ return e.filter((n) => this.getToolActivation(n) === i);
3152
+ }
3135
3153
  /**
3136
3154
  * Filter tools by visibility in a given context
3137
3155
  *
@@ -3143,21 +3161,21 @@ class ml {
3143
3161
  * @returns Array of visible tool registrations
3144
3162
  */
3145
3163
  filterVisibleInContext(e, i) {
3146
- const r = [];
3164
+ const n = [];
3147
3165
  for (const o of e) {
3148
- const n = this.get(o);
3149
- if (!n) {
3166
+ const r = this.get(o);
3167
+ if (!r) {
3150
3168
  console.warn(`Tool '${o}' is allowed but not registered`);
3151
3169
  continue;
3152
3170
  }
3153
- if (n.supportedLevels.includes(i.level))
3171
+ if (r.supportedLevels.includes(i.level))
3154
3172
  try {
3155
- n.isVisibleInContext(i) && r.push(n);
3173
+ r.isVisibleInContext(i) && n.push(r);
3156
3174
  } catch (s) {
3157
3175
  console.error(`Error evaluating visibility for tool '${o}':`, s);
3158
3176
  }
3159
3177
  }
3160
- return r;
3178
+ return n;
3161
3179
  }
3162
3180
  /**
3163
3181
  * Get tool metadata for building UIs
@@ -3171,7 +3189,9 @@ class ml {
3171
3189
  name: e.name,
3172
3190
  description: e.description,
3173
3191
  pnpSupportIds: e.pnpSupportIds || [],
3174
- supportedLevels: e.supportedLevels
3192
+ supportedLevels: e.supportedLevels,
3193
+ activation: e.activation || "toolbar-toggle",
3194
+ singletonScope: e.singletonScope || null
3175
3195
  }));
3176
3196
  }
3177
3197
  /**
@@ -3183,11 +3203,11 @@ class ml {
3183
3203
  */
3184
3204
  generatePNPSupportsFromTools(e) {
3185
3205
  const i = /* @__PURE__ */ new Set();
3186
- for (const r of e) {
3187
- const o = this.get(r);
3206
+ for (const n of e) {
3207
+ const o = this.get(n);
3188
3208
  if (o?.pnpSupportIds)
3189
- for (const n of o.pnpSupportIds)
3190
- i.add(n);
3209
+ for (const r of o.pnpSupportIds)
3210
+ i.add(r);
3191
3211
  }
3192
3212
  return Array.from(i);
3193
3213
  }
@@ -3208,8 +3228,8 @@ class ml {
3208
3228
  * Toolbars call ensureToolModuleLoaded(toolId) before instance creation.
3209
3229
  */
3210
3230
  setToolModuleLoaders(e) {
3211
- for (const [i, r] of Object.entries(e))
3212
- r && this.moduleLoaders.set(i, r);
3231
+ for (const [i, n] of Object.entries(e))
3232
+ n && this.moduleLoaders.set(i, n);
3213
3233
  }
3214
3234
  /**
3215
3235
  * Ensure tool module side-effects are loaded exactly once.
@@ -3223,11 +3243,11 @@ class ml {
3223
3243
  await i;
3224
3244
  return;
3225
3245
  }
3226
- const r = this.moduleLoaders.get(e);
3227
- if (!r)
3246
+ const n = this.moduleLoaders.get(e);
3247
+ if (!n)
3228
3248
  return;
3229
3249
  const o = (async () => {
3230
- await r(), this.loadedToolModules.add(e);
3250
+ await n(), this.loadedToolModules.add(e);
3231
3251
  })();
3232
3252
  this.moduleLoadPromises.set(e, o);
3233
3253
  try {
@@ -3251,18 +3271,18 @@ class ml {
3251
3271
  /**
3252
3272
  * Render a tool for toolbar use with component overrides attached.
3253
3273
  */
3254
- renderForToolbar(e, i, r) {
3274
+ renderForToolbar(e, i, n) {
3255
3275
  const o = this.get(e);
3256
3276
  if (!o)
3257
3277
  throw new Error(`Tool '${e}' is not registered`);
3258
- const n = {
3259
- ...r,
3278
+ const r = {
3279
+ ...n,
3260
3280
  componentOverrides: {
3261
3281
  ...this.componentOverrides || {},
3262
- ...r.componentOverrides || {}
3282
+ ...n.componentOverrides || {}
3263
3283
  }
3264
3284
  };
3265
- return o.renderToolbar(i, n);
3285
+ return o.renderToolbar(i, r);
3266
3286
  }
3267
3287
  }
3268
3288
  function ao(t) {
@@ -3277,21 +3297,21 @@ function yl(t) {
3277
3297
  function co(t) {
3278
3298
  return t.level === "element";
3279
3299
  }
3280
- function Or(t) {
3300
+ function Rn(t) {
3281
3301
  if (co(t)) {
3282
3302
  const e = t.item.config;
3283
3303
  if (!e)
3284
3304
  return "";
3285
- const i = [], r = (l) => l.replace(/<[^>]*>/g, " ").trim(), o = e.elements?.[t.elementId];
3286
- o && typeof o == "string" && i.push(r(o));
3287
- const n = e.models, a = (Array.isArray(n) ? n : n && typeof n == "object" ? Object.values(n) : []).find((l) => l && typeof l == "object" && l.id === t.elementId);
3305
+ const i = [], n = (l) => l.replace(/<[^>]*>/g, " ").trim(), o = e.elements?.[t.elementId];
3306
+ o && typeof o == "string" && i.push(n(o));
3307
+ const r = e.models, a = (Array.isArray(r) ? r : r && typeof r == "object" ? Object.values(r) : []).find((l) => l && typeof l == "object" && l.id === t.elementId);
3288
3308
  if (a) {
3289
3309
  for (const l of Object.values(a))
3290
- if (typeof l == "string" && i.push(r(l)), Array.isArray(l)) {
3310
+ if (typeof l == "string" && i.push(n(l)), Array.isArray(l)) {
3291
3311
  for (const u of l)
3292
3312
  if (u && typeof u == "object")
3293
3313
  for (const d of Object.values(u))
3294
- typeof d == "string" && i.push(r(d));
3314
+ typeof d == "string" && i.push(n(d));
3295
3315
  }
3296
3316
  }
3297
3317
  return i.filter(Boolean).join(" ").trim();
@@ -3300,47 +3320,47 @@ function Or(t) {
3300
3320
  const e = t.item;
3301
3321
  if (!e?.config)
3302
3322
  return "";
3303
- const i = e.config, r = [], o = (l) => l.replace(/<[^>]*>/g, " ").trim();
3304
- typeof i.markup == "string" && r.push(o(i.markup));
3305
- const n = i.elements;
3306
- if (n && typeof n == "object")
3307
- for (const l of Object.values(n))
3308
- typeof l == "string" && r.push(o(l));
3323
+ const i = e.config, n = [], o = (l) => l.replace(/<[^>]*>/g, " ").trim();
3324
+ typeof i.markup == "string" && n.push(o(i.markup));
3325
+ const r = i.elements;
3326
+ if (r && typeof r == "object")
3327
+ for (const l of Object.values(r))
3328
+ typeof l == "string" && n.push(o(l));
3309
3329
  const s = i.models, a = Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : [];
3310
3330
  for (const l of a)
3311
3331
  if (!(!l || typeof l != "object")) {
3312
3332
  for (const u of Object.values(l))
3313
- if (typeof u == "string" && r.push(o(u)), Array.isArray(u)) {
3333
+ if (typeof u == "string" && n.push(o(u)), Array.isArray(u)) {
3314
3334
  for (const d of u)
3315
3335
  if (d && typeof d == "object")
3316
3336
  for (const _ of Object.values(d))
3317
- typeof _ == "string" && r.push(o(_));
3337
+ typeof _ == "string" && n.push(o(_));
3318
3338
  }
3319
3339
  }
3320
- return r.filter(Boolean).join(" ").trim();
3340
+ return n.filter(Boolean).join(" ").trim();
3321
3341
  }
3322
3342
  if (bl(t)) {
3323
3343
  const e = t.passage;
3324
3344
  if (!e?.config)
3325
3345
  return "";
3326
- const i = e.config, r = [], o = (l) => l.replace(/<[^>]*>/g, " ").trim();
3327
- typeof i.markup == "string" && r.push(o(i.markup)), typeof i.content == "string" && r.push(o(i.content)), typeof i.prompt == "string" && r.push(o(i.prompt));
3328
- const n = i.elements;
3329
- if (n && typeof n == "object")
3330
- for (const l of Object.values(n))
3331
- typeof l == "string" && r.push(o(l));
3346
+ const i = e.config, n = [], o = (l) => l.replace(/<[^>]*>/g, " ").trim();
3347
+ typeof i.markup == "string" && n.push(o(i.markup)), typeof i.content == "string" && n.push(o(i.content)), typeof i.prompt == "string" && n.push(o(i.prompt));
3348
+ const r = i.elements;
3349
+ if (r && typeof r == "object")
3350
+ for (const l of Object.values(r))
3351
+ typeof l == "string" && n.push(o(l));
3332
3352
  const s = i.models, a = Array.isArray(s) ? s : s && typeof s == "object" ? Object.values(s) : [];
3333
3353
  for (const l of a)
3334
3354
  if (!(!l || typeof l != "object")) {
3335
3355
  for (const u of Object.values(l))
3336
- if (typeof u == "string" && r.push(o(u)), Array.isArray(u)) {
3356
+ if (typeof u == "string" && n.push(o(u)), Array.isArray(u)) {
3337
3357
  for (const d of u)
3338
3358
  if (d && typeof d == "object")
3339
3359
  for (const _ of Object.values(d))
3340
- typeof _ == "string" && r.push(o(_));
3360
+ typeof _ == "string" && n.push(o(_));
3341
3361
  }
3342
3362
  }
3343
- return r.filter(Boolean).join(" ").trim();
3363
+ return n.filter(Boolean).join(" ").trim();
3344
3364
  }
3345
3365
  if (yl(t)) {
3346
3366
  const e = t.rubricBlock;
@@ -3349,7 +3369,7 @@ function Or(t) {
3349
3369
  return "";
3350
3370
  }
3351
3371
  function Yi(t) {
3352
- const e = Or(t);
3372
+ const e = Rn(t);
3353
3373
  return [
3354
3374
  /<math[>\s]/i,
3355
3375
  // MathML
@@ -3363,7 +3383,7 @@ function Yi(t) {
3363
3383
  // Math symbols
3364
3384
  /\d+\s*[+\-*/=]\s*\d+/
3365
3385
  // Simple arithmetic
3366
- ].some((r) => r.test(e));
3386
+ ].some((n) => n.test(e));
3367
3387
  }
3368
3388
  function wl(t) {
3369
3389
  const e = [
@@ -3381,25 +3401,25 @@ function wl(t) {
3381
3401
  const o = (Array.isArray(i.models) ? i.models : Object.values(i.models)).find((s) => s && typeof s == "object" && s.id === t.elementId);
3382
3402
  if (!o)
3383
3403
  return !1;
3384
- const n = o.element || "";
3385
- return e.includes(n);
3404
+ const r = o.element || "";
3405
+ return e.includes(r);
3386
3406
  }
3387
3407
  if (ao(t)) {
3388
3408
  const i = t.item.config?.models;
3389
3409
  return (Array.isArray(i) ? i : i && typeof i == "object" ? Object.values(i) : []).some((o) => {
3390
3410
  if (!o || typeof o != "object")
3391
3411
  return !1;
3392
- const n = o.element || "";
3393
- return e.includes(n) ? !0 : Array.isArray(o.choices) && o.choices.length > 0;
3412
+ const r = o.element || "";
3413
+ return e.includes(r) ? !0 : Array.isArray(o.choices) && o.choices.length > 0;
3394
3414
  });
3395
3415
  }
3396
3416
  return !1;
3397
3417
  }
3398
3418
  function Wi(t) {
3399
- return Or(t).trim().length >= 10;
3419
+ return Rn(t).trim().length >= 10;
3400
3420
  }
3401
3421
  function Tl(t) {
3402
- const e = Or(t);
3422
+ const e = Rn(t);
3403
3423
  return [
3404
3424
  /chemistry|chemical|element|atom|molecule|compound/i,
3405
3425
  /periodic\s+table/i,
@@ -3409,7 +3429,7 @@ function Tl(t) {
3409
3429
  // Element symbols (H, He, Li, etc.)
3410
3430
  /biology|organism|cell|DNA|RNA|protein/i,
3411
3431
  /physics|force|energy|velocity|acceleration/i
3412
- ].some((r) => r.test(e));
3432
+ ].some((n) => n.test(e));
3413
3433
  }
3414
3434
  const Il = [
3415
3435
  "assessment",
@@ -3422,12 +3442,12 @@ function Sl(t) {
3422
3442
  return El.has(t);
3423
3443
  }
3424
3444
  function Ve(t, e, i) {
3425
- const r = t.trim(), o = i.trim();
3426
- if (!r || !o)
3445
+ const n = t.trim(), o = i.trim();
3446
+ if (!n || !o)
3427
3447
  throw new Error("Tool instance ids require non-empty tool and scope ids");
3428
3448
  if (!Sl(e))
3429
3449
  throw new Error(`Unknown tool scope level '${e}'. Register custom levels with registerToolScopeLevel().`);
3430
- return `${r}:${e}:${o}`;
3450
+ return `${n}:${e}:${o}`;
3431
3451
  }
3432
3452
  const $l = /* @__PURE__ */ new Set([
3433
3453
  "annotation-xml",
@@ -3469,8 +3489,8 @@ const $l = /* @__PURE__ */ new Set([
3469
3489
  }, Ll = (t, e) => {
3470
3490
  const i = e?.toolTagMap?.[t] ?? uo[t] ?? t;
3471
3491
  return Al(i, `tool component tag for "${t}"`);
3472
- }, Ol = (t) => document.createElement(t), Be = (t, e, i, r) => {
3473
- const o = Ll(t, r), s = r?.toolComponentFactories?.[t] ?? r?.toolComponentFactory;
3492
+ }, Ol = (t) => document.createElement(t), Be = (t, e, i, n) => {
3493
+ const o = Ll(t, n), s = n?.toolComponentFactories?.[t] ?? n?.toolComponentFactory;
3474
3494
  return s ? s({ toolId: t, tagName: o, context: e, toolbarContext: i }) : Ol(o);
3475
3495
  }, Rl = {
3476
3496
  toolId: "calculator",
@@ -3501,9 +3521,9 @@ const $l = /* @__PURE__ */ new Set([
3501
3521
  return Yi(t);
3502
3522
  },
3503
3523
  renderToolbar(t, e) {
3504
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = e.componentOverrides, o = Be(this.toolId, t, e, r);
3524
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = e.componentOverrides, o = Be(this.toolId, t, e, n);
3505
3525
  o.setAttribute("tool-id", i);
3506
- const n = {
3526
+ const r = {
3507
3527
  toolId: this.toolId,
3508
3528
  label: this.name,
3509
3529
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3516,10 +3536,10 @@ const $l = /* @__PURE__ */ new Set([
3516
3536
  return {
3517
3537
  toolId: this.toolId,
3518
3538
  elements: [{ element: o, mount: "after-buttons" }],
3519
- button: n,
3539
+ button: r,
3520
3540
  sync: () => {
3521
3541
  const s = e.isToolVisible(i);
3522
- n.active = s, n.ariaLabel = s ? "Close scientific calculator" : "Open scientific calculator", n.tooltip = s ? "Close calculator" : "Calculator", o.visible = s;
3542
+ r.active = s, r.ariaLabel = s ? "Close scientific calculator" : "Open scientific calculator", r.tooltip = s ? "Close calculator" : "Calculator", o.visible = s;
3523
3543
  },
3524
3544
  subscribeActive: (s) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3525
3545
  s(e.isToolVisible(i));
@@ -3557,7 +3577,7 @@ const $l = /* @__PURE__ */ new Set([
3557
3577
  },
3558
3578
  renderToolbar(t, e) {
3559
3579
  let i = null;
3560
- const r = e.ttsService, o = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = () => e.isToolVisible(o), s = {
3580
+ const n = e.ttsService, o = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = () => e.isToolVisible(o), s = {
3561
3581
  toolId: this.toolId,
3562
3582
  label: "Read aloud",
3563
3583
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3569,16 +3589,16 @@ const $l = /* @__PURE__ */ new Set([
3569
3589
  disabled: !1,
3570
3590
  active: !1
3571
3591
  }, a = () => {
3572
- const v = n() ? "Stop reading" : "Read aloud";
3573
- s.label = v, s.ariaLabel = v, s.tooltip = v, s.active = n(), s.disabled = !e.ttsService;
3592
+ const v = r() ? "Stop reading" : "Read aloud";
3593
+ s.label = v, s.ariaLabel = v, s.tooltip = v, s.active = r(), s.disabled = !e.ttsService;
3574
3594
  }, l = (v) => {
3575
- (v === "idle" || v === "error") && n() && (e.toggleTool(this.toolId), a());
3595
+ (v === "idle" || v === "error") && r() && (e.toggleTool(this.toolId), a());
3576
3596
  }, u = async () => {
3577
3597
  e.ensureTTSReady && (i || (i = (async () => {
3578
- await e.ensureTTSReady?.(), e.toolkitCoordinator?.highlightCoordinator && r?.setHighlightCoordinator?.(e.toolkitCoordinator.highlightCoordinator);
3598
+ await e.ensureTTSReady?.(), e.toolkitCoordinator?.highlightCoordinator && n?.setHighlightCoordinator?.(e.toolkitCoordinator.highlightCoordinator);
3579
3599
  })()), await i);
3580
3600
  }, d = () => {
3581
- r?.stop?.(), n() && e.toggleTool(this.toolId), a();
3601
+ n?.stop?.(), r() && e.toggleTool(this.toolId), a();
3582
3602
  }, _ = () => {
3583
3603
  const v = e.getScopeElement?.();
3584
3604
  if (v)
@@ -3600,9 +3620,9 @@ const $l = /* @__PURE__ */ new Set([
3600
3620
  }
3601
3621
  return null;
3602
3622
  }, p = async () => {
3603
- if (!r?.speak || !e.ttsService)
3623
+ if (!n?.speak || !e.ttsService)
3604
3624
  return;
3605
- if (n()) {
3625
+ if (r()) {
3606
3626
  d();
3607
3627
  return;
3608
3628
  }
@@ -3612,7 +3632,7 @@ const $l = /* @__PURE__ */ new Set([
3612
3632
  const g = v.textContent || "";
3613
3633
  if (g.trim())
3614
3634
  try {
3615
- n() || e.toggleTool(this.toolId), a(), await u(), r.setRootElement?.(v), r.speak(g, {
3635
+ r() || e.toggleTool(this.toolId), a(), await u(), n.setRootElement?.(v), n.speak(g, {
3616
3636
  // For passage-level TTS, use rendered DOM text as the source of truth.
3617
3637
  // Catalog/SSML content can diverge from rendered text and break
3618
3638
  // word-boundary-to-DOM mapping for progressive yellow highlighting.
@@ -3638,7 +3658,7 @@ const $l = /* @__PURE__ */ new Set([
3638
3658
  const g = [];
3639
3659
  if (e.subscribeVisibility) {
3640
3660
  const b = e.subscribeVisibility(() => {
3641
- const h = n();
3661
+ const h = r();
3642
3662
  a(), v(h);
3643
3663
  });
3644
3664
  g.push(b);
@@ -3646,7 +3666,7 @@ const $l = /* @__PURE__ */ new Set([
3646
3666
  if (e.ttsService) {
3647
3667
  const b = `tts-toolbar:${o}`, h = (y) => {
3648
3668
  l(String(y || ""));
3649
- const x = n();
3669
+ const x = r();
3650
3670
  a(), v(x);
3651
3671
  };
3652
3672
  e.ttsService.onStateChange(b, h), g.push(() => {
@@ -3683,7 +3703,7 @@ const $l = /* @__PURE__ */ new Set([
3683
3703
  return Yi(t);
3684
3704
  },
3685
3705
  renderToolbar(t, e) {
3686
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = {
3706
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = {
3687
3707
  toolId: this.toolId,
3688
3708
  label: this.name,
3689
3709
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3692,14 +3712,14 @@ const $l = /* @__PURE__ */ new Set([
3692
3712
  tooltip: "Ruler",
3693
3713
  onClick: () => e.toggleTool(this.toolId),
3694
3714
  active: e.isToolVisible(i)
3695
- }, o = e.componentOverrides ?? {}, n = Be(this.toolId, t, e, o);
3696
- return n.setAttribute("tool-id", i), {
3715
+ }, o = e.componentOverrides ?? {}, r = Be(this.toolId, t, e, o);
3716
+ return r.setAttribute("tool-id", i), {
3697
3717
  toolId: this.toolId,
3698
- button: r,
3699
- elements: [{ element: n, mount: "after-buttons" }],
3718
+ button: n,
3719
+ elements: [{ element: r, mount: "after-buttons" }],
3700
3720
  sync: () => {
3701
3721
  const s = e.isToolVisible(i);
3702
- r.active = s, n.visible = s, e.toolkitCoordinator && (n.toolkitCoordinator = e.toolkitCoordinator);
3722
+ n.active = s, r.visible = s, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
3703
3723
  },
3704
3724
  subscribeActive: (s) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3705
3725
  s(e.isToolVisible(i));
@@ -3729,7 +3749,7 @@ const $l = /* @__PURE__ */ new Set([
3729
3749
  return Yi(t);
3730
3750
  },
3731
3751
  renderToolbar(t, e) {
3732
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = {
3752
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = {
3733
3753
  toolId: this.toolId,
3734
3754
  label: this.name,
3735
3755
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3738,14 +3758,14 @@ const $l = /* @__PURE__ */ new Set([
3738
3758
  tooltip: "Protractor",
3739
3759
  onClick: () => e.toggleTool(this.toolId),
3740
3760
  active: e.isToolVisible(i)
3741
- }, o = e.componentOverrides ?? {}, n = Be(this.toolId, t, e, o);
3742
- return n.setAttribute("tool-id", i), {
3761
+ }, o = e.componentOverrides ?? {}, r = Be(this.toolId, t, e, o);
3762
+ return r.setAttribute("tool-id", i), {
3743
3763
  toolId: this.toolId,
3744
- button: r,
3745
- elements: [{ element: n, mount: "after-buttons" }],
3764
+ button: n,
3765
+ elements: [{ element: r, mount: "after-buttons" }],
3746
3766
  sync: () => {
3747
3767
  const s = e.isToolVisible(i);
3748
- r.active = s, n.visible = s, e.toolkitCoordinator && (n.toolkitCoordinator = e.toolkitCoordinator);
3768
+ n.active = s, r.visible = s, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
3749
3769
  },
3750
3770
  subscribeActive: (s) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3751
3771
  s(e.isToolVisible(i));
@@ -3779,9 +3799,9 @@ const $l = /* @__PURE__ */ new Set([
3779
3799
  return wl(t);
3780
3800
  },
3781
3801
  renderToolbar(t, e) {
3782
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = e.componentOverrides ?? {}, o = Be(this.toolId, t, e, r);
3802
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = e.componentOverrides ?? {}, o = Be(this.toolId, t, e, n);
3783
3803
  o.setAttribute("tool-id", i), o.setAttribute("strategy", "strikethrough"), o.setAttribute("button-alignment", "inline");
3784
- const n = {
3804
+ const r = {
3785
3805
  toolId: this.toolId,
3786
3806
  label: this.name,
3787
3807
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true"><path d="M19,3H16.3H7.7H5A2,2 0 0,0 3,5V7.7V16.4V19A2,2 0 0,0 5,21H7.7H16.4H19A2,2 0 0,0 21,19V16.3V7.7V5A2,2 0 0,0 19,3M15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4L13.4,12L17,15.6L15.6,17Z"/></svg>',
@@ -3793,11 +3813,11 @@ const $l = /* @__PURE__ */ new Set([
3793
3813
  };
3794
3814
  return {
3795
3815
  toolId: this.toolId,
3796
- button: n,
3816
+ button: r,
3797
3817
  elements: [{ element: o, mount: "after-buttons" }],
3798
3818
  sync: () => {
3799
3819
  const s = e.isToolVisible(i);
3800
- n.active = s, o.visible = s, e.toolCoordinator && (o.coordinator = e.toolCoordinator), o.scopeElement = e.getScopeElement?.() || null, e.elementToolStateStore && (o.elementToolStateStore = e.elementToolStateStore);
3820
+ r.active = s, o.visible = s, e.toolCoordinator && (o.coordinator = e.toolCoordinator), o.scopeElement = e.getScopeElement?.() || null, e.elementToolStateStore && (o.elementToolStateStore = e.elementToolStateStore);
3801
3821
  const a = e.getGlobalElementId?.();
3802
3822
  a && (o.globalElementId = a);
3803
3823
  },
@@ -3812,6 +3832,7 @@ const $l = /* @__PURE__ */ new Set([
3812
3832
  name: "Highlighter",
3813
3833
  description: "Highlight text",
3814
3834
  icon: "highlighter",
3835
+ activation: "toolbar-toggle",
3815
3836
  // Highlighter appears at passage, rubric, item, and element levels
3816
3837
  supportedLevels: ["passage", "rubric", "item", "element"],
3817
3838
  // PNP support IDs
@@ -3823,7 +3844,7 @@ const $l = /* @__PURE__ */ new Set([
3823
3844
  return Wi(t);
3824
3845
  },
3825
3846
  renderToolbar(t, e) {
3826
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = {
3847
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = {
3827
3848
  toolId: this.toolId,
3828
3849
  label: this.name,
3829
3850
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3832,14 +3853,14 @@ const $l = /* @__PURE__ */ new Set([
3832
3853
  tooltip: "Highlight",
3833
3854
  onClick: () => e.toggleTool(this.toolId),
3834
3855
  active: e.isToolVisible(i)
3835
- }, o = e.componentOverrides ?? {}, n = Be(this.toolId, t, e, o);
3836
- return n.setAttribute("tool-id", i), {
3856
+ }, o = e.componentOverrides ?? {}, r = Be(this.toolId, t, e, o);
3857
+ return r.setAttribute("tool-id", i), {
3837
3858
  toolId: this.toolId,
3838
- button: r,
3839
- elements: [{ element: n, mount: "after-buttons" }],
3859
+ button: n,
3860
+ elements: [{ element: r, mount: "after-buttons" }],
3840
3861
  sync: () => {
3841
3862
  const s = e.isToolVisible(i);
3842
- r.active = s, n.enabled = s, n.visible = s, e.ttsService && (n.ttsService = e.ttsService);
3863
+ n.active = s, r.enabled = s, r.visible = s, e.ttsService && (r.ttsService = e.ttsService);
3843
3864
  },
3844
3865
  subscribeActive: (s) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3845
3866
  s(e.isToolVisible(i));
@@ -3875,7 +3896,7 @@ const $l = /* @__PURE__ */ new Set([
3875
3896
  return Wi(t);
3876
3897
  },
3877
3898
  renderToolbar(t, e) {
3878
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = {
3899
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = {
3879
3900
  toolId: this.toolId,
3880
3901
  label: this.name,
3881
3902
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3884,14 +3905,14 @@ const $l = /* @__PURE__ */ new Set([
3884
3905
  tooltip: "Line Reader",
3885
3906
  onClick: () => e.toggleTool(this.toolId),
3886
3907
  active: e.isToolVisible(i)
3887
- }, o = e.componentOverrides ?? {}, n = Be(this.toolId, t, e, o);
3888
- return n.setAttribute("tool-id", i), {
3908
+ }, o = e.componentOverrides ?? {}, r = Be(this.toolId, t, e, o);
3909
+ return r.setAttribute("tool-id", i), {
3889
3910
  toolId: this.toolId,
3890
- button: r,
3891
- elements: [{ element: n, mount: "after-buttons" }],
3911
+ button: n,
3912
+ elements: [{ element: r, mount: "after-buttons" }],
3892
3913
  sync: () => {
3893
3914
  const s = e.isToolVisible(i);
3894
- r.active = s, n.visible = s, e.toolkitCoordinator && (n.toolkitCoordinator = e.toolkitCoordinator);
3915
+ n.active = s, r.visible = s, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
3895
3916
  },
3896
3917
  subscribeActive: (s) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3897
3918
  s(e.isToolVisible(i));
@@ -3931,7 +3952,7 @@ const $l = /* @__PURE__ */ new Set([
3931
3952
  return !0;
3932
3953
  },
3933
3954
  renderToolbar(t, e) {
3934
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = {
3955
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = {
3935
3956
  toolId: this.toolId,
3936
3957
  label: this.name,
3937
3958
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3940,14 +3961,14 @@ const $l = /* @__PURE__ */ new Set([
3940
3961
  tooltip: "Theme",
3941
3962
  onClick: () => e.toggleTool(this.toolId),
3942
3963
  active: e.isToolVisible(i)
3943
- }, o = e.componentOverrides ?? {}, n = Be(this.toolId, t, e, o);
3944
- return n.setAttribute("tool-id", i), {
3964
+ }, o = e.componentOverrides ?? {}, r = Be(this.toolId, t, e, o);
3965
+ return r.setAttribute("tool-id", i), {
3945
3966
  toolId: this.toolId,
3946
- button: r,
3947
- elements: [{ element: n, mount: "after-buttons" }],
3967
+ button: n,
3968
+ elements: [{ element: r, mount: "after-buttons" }],
3948
3969
  sync: () => {
3949
3970
  const s = e.isToolVisible(i);
3950
- r.active = s, n.visible = s, e.toolkitCoordinator && (n.toolkitCoordinator = e.toolkitCoordinator);
3971
+ n.active = s, r.visible = s, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
3951
3972
  },
3952
3973
  subscribeActive: (s) => e.subscribeVisibility ? e.subscribeVisibility(() => {
3953
3974
  s(e.isToolVisible(i));
@@ -3960,6 +3981,8 @@ const $l = /* @__PURE__ */ new Set([
3960
3981
  name: "Highlighter",
3961
3982
  description: "Highlight and annotate text",
3962
3983
  icon: "highlighter",
3984
+ activation: "selection-gateway",
3985
+ singletonScope: "section",
3963
3986
  // Annotation appears where there's text content
3964
3987
  supportedLevels: ["passage", "rubric", "item", "element"],
3965
3988
  // PNP support IDs
@@ -3983,7 +4006,7 @@ const $l = /* @__PURE__ */ new Set([
3983
4006
  return Wi(t);
3984
4007
  },
3985
4008
  renderToolbar(t, e) {
3986
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = {
4009
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = {
3987
4010
  toolId: this.toolId,
3988
4011
  label: this.name,
3989
4012
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -3992,14 +4015,14 @@ const $l = /* @__PURE__ */ new Set([
3992
4015
  tooltip: "Highlight",
3993
4016
  onClick: () => e.toggleTool(this.toolId),
3994
4017
  active: e.isToolVisible(i)
3995
- }, o = e.componentOverrides ?? {}, n = Be(this.toolId, t, e, o);
3996
- return n.setAttribute("tool-id", i), {
4018
+ }, o = e.componentOverrides ?? {}, r = Be(this.toolId, t, e, o);
4019
+ return r.setAttribute("tool-id", i), {
3997
4020
  toolId: this.toolId,
3998
- button: r,
3999
- elements: [{ element: n, mount: "after-buttons" }],
4021
+ button: n,
4022
+ elements: [{ element: r, mount: "after-buttons" }],
4000
4023
  sync: () => {
4001
4024
  const s = e.isToolVisible(i);
4002
- r.active = s, n.visible = s, e.toolkitCoordinator && (n.toolkitCoordinator = e.toolkitCoordinator);
4025
+ n.active = s, r.visible = s, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
4003
4026
  },
4004
4027
  subscribeActive: (s) => e.subscribeVisibility ? e.subscribeVisibility(() => {
4005
4028
  s(e.isToolVisible(i));
@@ -4033,7 +4056,7 @@ const $l = /* @__PURE__ */ new Set([
4033
4056
  return Yi(t);
4034
4057
  },
4035
4058
  renderToolbar(t, e) {
4036
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = {
4059
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = {
4037
4060
  toolId: this.toolId,
4038
4061
  label: this.name,
4039
4062
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -4042,14 +4065,14 @@ const $l = /* @__PURE__ */ new Set([
4042
4065
  tooltip: "Graph",
4043
4066
  onClick: () => e.toggleTool(this.toolId),
4044
4067
  active: e.isToolVisible(i)
4045
- }, o = e.componentOverrides ?? {}, n = Be(this.toolId, t, e, o);
4046
- return n.setAttribute("tool-id", i), {
4068
+ }, o = e.componentOverrides ?? {}, r = Be(this.toolId, t, e, o);
4069
+ return r.setAttribute("tool-id", i), {
4047
4070
  toolId: this.toolId,
4048
- button: r,
4049
- elements: [{ element: n, mount: "after-buttons" }],
4071
+ button: n,
4072
+ elements: [{ element: r, mount: "after-buttons" }],
4050
4073
  sync: () => {
4051
4074
  const s = e.isToolVisible(i);
4052
- r.active = s, n.visible = s, e.toolkitCoordinator && (n.toolkitCoordinator = e.toolkitCoordinator);
4075
+ n.active = s, r.visible = s, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
4053
4076
  },
4054
4077
  subscribeActive: (s) => e.subscribeVisibility ? e.subscribeVisibility(() => {
4055
4078
  s(e.isToolVisible(i));
@@ -4081,7 +4104,7 @@ const $l = /* @__PURE__ */ new Set([
4081
4104
  return Tl(t);
4082
4105
  },
4083
4106
  renderToolbar(t, e) {
4084
- const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), r = {
4107
+ const i = Ve(this.toolId, e.scope.level, e.scope.scopeId), n = {
4085
4108
  toolId: this.toolId,
4086
4109
  label: this.name,
4087
4110
  icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
@@ -4090,14 +4113,14 @@ const $l = /* @__PURE__ */ new Set([
4090
4113
  tooltip: "Periodic Table",
4091
4114
  onClick: () => e.toggleTool(this.toolId),
4092
4115
  active: e.isToolVisible(i)
4093
- }, o = e.componentOverrides ?? {}, n = Be(this.toolId, t, e, o);
4094
- return n.setAttribute("tool-id", i), {
4116
+ }, o = e.componentOverrides ?? {}, r = Be(this.toolId, t, e, o);
4117
+ return r.setAttribute("tool-id", i), {
4095
4118
  toolId: this.toolId,
4096
- button: r,
4097
- elements: [{ element: n, mount: "after-buttons" }],
4119
+ button: n,
4120
+ elements: [{ element: r, mount: "after-buttons" }],
4098
4121
  sync: () => {
4099
4122
  const s = e.isToolVisible(i);
4100
- r.active = s, n.visible = s, e.toolkitCoordinator && (n.toolkitCoordinator = e.toolkitCoordinator);
4123
+ n.active = s, r.visible = s, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
4101
4124
  },
4102
4125
  subscribeActive: (s) => e.subscribeVisibility ? e.subscribeVisibility(() => {
4103
4126
  s(e.isToolVisible(i));
@@ -4114,14 +4137,14 @@ function Gl(t = {}) {
4114
4137
  },
4115
4138
  toolComponentFactory: t.toolComponentFactory,
4116
4139
  toolComponentFactories: t.toolComponentFactories
4117
- }, r = (o) => t.overrides?.[o.toolId] || o;
4118
- return e.register(r(Rl)), e.register(r(Vl)), e.register(r(Ml)), e.register(r(Cl)), e.register(r(Nl)), e.register(r(Pl)), e.register(r(zl)), e.register(r(xl)), e.register(r(jl)), e.register(r(Hl)), e.register(r(Fl)), t.toolModuleLoaders && Object.keys(t.toolModuleLoaders).length > 0 && e.setToolModuleLoaders(t.toolModuleLoaders), e.setComponentOverrides(i), e;
4140
+ }, n = (o) => t.overrides?.[o.toolId] || o;
4141
+ return e.register(n(Rl)), e.register(n(Vl)), e.register(n(Ml)), e.register(n(Cl)), e.register(n(Nl)), e.register(n(Pl)), e.register(n(zl)), e.register(n(xl)), e.register(n(jl)), e.register(n(Hl)), e.register(n(Fl)), t.toolModuleLoaders && Object.keys(t.toolModuleLoaders).length > 0 && e.setToolModuleLoaders(t.toolModuleLoaders), e.setComponentOverrides(i), e;
4119
4142
  }
4120
4143
  function Bl() {
4121
4144
  const t = Gl(), e = /* @__PURE__ */ new Set();
4122
4145
  for (const i of t.getAllTools())
4123
- for (const r of i.pnpSupportIds || [])
4124
- e.add(r);
4146
+ for (const n of i.pnpSupportIds || [])
4147
+ e.add(n);
4125
4148
  return [...e].sort();
4126
4149
  }
4127
4150
  Bl();
@@ -4301,11 +4324,11 @@ var Mi;
4301
4324
  (function(t) {
4302
4325
  t[t.BASE = 0] = "BASE", t[t.TOOL = 1e3] = "TOOL", t[t.MODAL = 2e3] = "MODAL", t[t.CONTROL = 3e3] = "CONTROL", t[t.HIGHLIGHT = 4e3] = "HIGHLIGHT";
4303
4326
  })(Mi || (Mi = {}));
4304
- var nn;
4327
+ var rr;
4305
4328
  (function(t) {
4306
4329
  t.IDLE = "idle", t.LOADING = "loading", t.PLAYING = "playing", t.PAUSED = "paused", t.ERROR = "error";
4307
- })(nn || (nn = {}));
4308
- var Ul = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path></svg>'), Yl = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'), Wl = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>'), Kl = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>'), Xl = /* @__PURE__ */ no('<button type="button"><span class="pie-tool-graph__tool-icon svelte-7afz7f" aria-hidden="true"><!></span> <span class="pie-tool-graph__tool-label svelte-7afz7f"> </span></button>'), Jl = /* @__PURE__ */ Re('<line x1="0" class="pie-tool-graph__grid-line pie-tool-graph__grid-line--minor svelte-7afz7f"></line>'), Ql = /* @__PURE__ */ Re('<line x1="0" class="pie-tool-graph__grid-line pie-tool-graph__grid-line--major svelte-7afz7f"></line>'), Zl = /* @__PURE__ */ Re('<line y1="0" y2="100" class="pie-tool-graph__grid-line pie-tool-graph__grid-line--minor svelte-7afz7f"></line>'), ea = /* @__PURE__ */ Re('<line y1="0" y2="100" class="pie-tool-graph__grid-line pie-tool-graph__grid-line--major svelte-7afz7f"></line>'), ta = /* @__PURE__ */ Re('<line class="pie-tool-graph__user-line svelte-7afz7f"></line>'), ia = /* @__PURE__ */ Re('<circle r="2" role="button" tabindex="0"></circle>'), ra = /* @__PURE__ */ Re('<line class="pie-tool-graph__temp-line svelte-7afz7f"></line>'), na = /* @__PURE__ */ no('<div class="pie-tool-graph svelte-7afz7f" role="dialog" tabindex="-1" aria-label="Graph Tool - Draw points and lines on a coordinate grid"><div class="pie-tool-graph__header svelte-7afz7f"><h3 id="graph-tool-title" class="pie-tool-graph__title svelte-7afz7f">Graph Tool</h3></div> <div class="pie-tool-graph__toolbar svelte-7afz7f"><div class="pie-tool-graph__tool-buttons svelte-7afz7f"></div> <div class="pie-tool-graph__transparency-control svelte-7afz7f"><label for="grid-opacity" class="svelte-7afz7f">Grid:</label> <input type="range" id="grid-opacity" min="0" max="1" step="0.1" aria-label="Grid opacity" class="svelte-7afz7f"/></div></div> <div class="pie-tool-graph__canvas-wrapper svelte-7afz7f" role="img" tabindex="0" aria-label="Graph canvas - Use tools to add points and draw lines"><svg class="pie-tool-graph__canvas svelte-7afz7f" preserveAspectRatio="xMinYMin meet" aria-hidden="true"><g class="pie-tool-graph__grid-lines" aria-hidden="true"><!><!><!><!></g><g class="pie-tool-graph__lines"></g><g class="pie-tool-graph__points"></g><!></svg></div></div>');
4330
+ })(rr || (rr = {}));
4331
+ var Ul = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path></svg>'), Yl = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'), Wl = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>'), Kl = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>'), Xl = /* @__PURE__ */ ro('<button type="button"><span class="pie-tool-graph__tool-icon svelte-7afz7f" aria-hidden="true"><!></span> <span class="pie-tool-graph__tool-label svelte-7afz7f"> </span></button>'), Jl = /* @__PURE__ */ Re('<line x1="0" class="pie-tool-graph__grid-line pie-tool-graph__grid-line--minor svelte-7afz7f"></line>'), Ql = /* @__PURE__ */ Re('<line x1="0" class="pie-tool-graph__grid-line pie-tool-graph__grid-line--major svelte-7afz7f"></line>'), Zl = /* @__PURE__ */ Re('<line y1="0" y2="100" class="pie-tool-graph__grid-line pie-tool-graph__grid-line--minor svelte-7afz7f"></line>'), ea = /* @__PURE__ */ Re('<line y1="0" y2="100" class="pie-tool-graph__grid-line pie-tool-graph__grid-line--major svelte-7afz7f"></line>'), ta = /* @__PURE__ */ Re('<line class="pie-tool-graph__user-line svelte-7afz7f"></line>'), ia = /* @__PURE__ */ Re('<circle r="2" role="button" tabindex="0"></circle>'), na = /* @__PURE__ */ Re('<line class="pie-tool-graph__temp-line svelte-7afz7f"></line>'), ra = /* @__PURE__ */ ro('<div class="pie-tool-graph svelte-7afz7f" role="dialog" tabindex="-1" aria-label="Graph Tool - Draw points and lines on a coordinate grid"><div class="pie-tool-graph__header svelte-7afz7f"><h3 id="graph-tool-title" class="pie-tool-graph__title svelte-7afz7f">Graph Tool</h3></div> <div class="pie-tool-graph__toolbar svelte-7afz7f"><div class="pie-tool-graph__tool-buttons svelte-7afz7f"></div> <div class="pie-tool-graph__transparency-control svelte-7afz7f"><label for="grid-opacity" class="svelte-7afz7f">Grid:</label> <input type="range" id="grid-opacity" min="0" max="1" step="0.1" aria-label="Grid opacity" class="svelte-7afz7f"/></div></div> <div class="pie-tool-graph__canvas-wrapper svelte-7afz7f" role="img" tabindex="0" aria-label="Graph canvas - Use tools to add points and draw lines"><svg class="pie-tool-graph__canvas svelte-7afz7f" preserveAspectRatio="xMinYMin meet" aria-hidden="true"><g class="pie-tool-graph__grid-lines" aria-hidden="true"><!><!><!><!></g><g class="pie-tool-graph__lines"></g><g class="pie-tool-graph__points"></g><!></svg></div></div>');
4309
4332
  const oa = {
4310
4333
  hash: "svelte-7afz7f",
4311
4334
  code: `.pie-tool-graph.svelte-7afz7f {position:fixed;background:var(--pie-background, #fff);color:var(--pie-text, #111827);border:1px solid var(--pie-border-light, #d1d5db);box-shadow:0 10px 40px rgb(0 0 0 / 0.3);user-select:none;touch-action:none;border-radius:12px;overflow:hidden;z-index:2000; /* ZIndexLayer.MODAL */min-width:500px;display:flex;flex-direction:column;}
@@ -4321,20 +4344,20 @@ const oa = {
4321
4344
  /* User drawing styles */.pie-tool-graph__user-point.svelte-7afz7f {cursor:pointer;fill:var(--pie-primary, #3f51b5);stroke:var(--pie-primary-dark, #2c3e50);stroke-width:0.5;vector-effect:non-scaling-stroke;}.pie-tool-graph__user-point.pie-tool-graph__user-point--highlight.svelte-7afz7f {fill:var(--pie-missing, #ffc107);stroke:var(--pie-missing-icon, #ff9800);}.pie-tool-graph__user-line.svelte-7afz7f {stroke:var(--pie-text, #333);stroke-linecap:round;stroke-width:1;vector-effect:non-scaling-stroke;}.pie-tool-graph__temp-line.svelte-7afz7f {pointer-events:none;stroke:var(--pie-correct, #4caf50);stroke-dasharray:2, 2;stroke-width:0.75;vector-effect:non-scaling-stroke;}`
4322
4345
  };
4323
4346
  function sa(t, e) {
4324
- gn(e, !0), Ks(t, oa);
4325
- let i = en(e, "visible", 7, !1), r = en(e, "toolId", 7, "graph");
4347
+ gr(e, !0), Ks(t, oa);
4348
+ let i = tr(e, "visible", 7, !1), n = tr(e, "toolId", 7, "graph");
4326
4349
  const o = typeof window < "u";
4327
- let n = /* @__PURE__ */ D(void 0), s = /* @__PURE__ */ D(null);
4350
+ let r = /* @__PURE__ */ D(void 0), s = /* @__PURE__ */ D(null);
4328
4351
  const a = /* @__PURE__ */ zt(() => c(s)?.toolCoordinator);
4329
- let l = /* @__PURE__ */ D(void 0), u = /* @__PURE__ */ D(void 0), d = /* @__PURE__ */ D(rt(o ? window.innerWidth / 2 : 400)), _ = /* @__PURE__ */ D(rt(o ? window.innerHeight / 2 : 300)), p = /* @__PURE__ */ D(700), v = /* @__PURE__ */ D(
4352
+ let l = /* @__PURE__ */ D(void 0), u = /* @__PURE__ */ D(void 0), d = /* @__PURE__ */ D(nt(o ? window.innerWidth / 2 : 400)), _ = /* @__PURE__ */ D(nt(o ? window.innerHeight / 2 : 300)), p = /* @__PURE__ */ D(700), v = /* @__PURE__ */ D(
4330
4353
  550
4331
4354
  // Production implementation uses 550px height
4332
- ), g = /* @__PURE__ */ D("selector"), b = /* @__PURE__ */ D(rt([])), h = /* @__PURE__ */ D(rt([])), y = /* @__PURE__ */ D(1), x = /* @__PURE__ */ D(1), z = /* @__PURE__ */ D(null), H = /* @__PURE__ */ D(null), U = /* @__PURE__ */ D(null), qe = /* @__PURE__ */ D(!1);
4355
+ ), g = /* @__PURE__ */ D("selector"), b = /* @__PURE__ */ D(nt([])), h = /* @__PURE__ */ D(nt([])), y = /* @__PURE__ */ D(1), x = /* @__PURE__ */ D(1), z = /* @__PURE__ */ D(null), H = /* @__PURE__ */ D(null), U = /* @__PURE__ */ D(null), qe = /* @__PURE__ */ D(!1);
4333
4356
  const Y = 5, we = 5, Me = 100 / Y, F = Me / we;
4334
4357
  let Nt = /* @__PURE__ */ D(0), Pt = /* @__PURE__ */ D(0);
4335
4358
  si(() => {
4336
- if (c(n))
4337
- return vl(c(n), (m) => {
4359
+ if (c(r))
4360
+ return vl(c(r), (m) => {
4338
4361
  T(s, m, !0);
4339
4362
  });
4340
4363
  });
@@ -4380,7 +4403,7 @@ function sa(t, e) {
4380
4403
  if (m !== null)
4381
4404
  return c(b).find((w) => w.id === m);
4382
4405
  }
4383
- function Vr(m) {
4406
+ function Mn(m) {
4384
4407
  if (!c(u)) return null;
4385
4408
  const w = c(u).createSVGPoint();
4386
4409
  w.x = m.clientX, w.y = m.clientY;
@@ -4393,7 +4416,7 @@ function sa(t, e) {
4393
4416
  return console.error("Error transforming point:", A), null;
4394
4417
  }
4395
4418
  }
4396
- function Mr(m, w = 5) {
4419
+ function Cn(m, w = 5) {
4397
4420
  const C = w * w;
4398
4421
  let A = null, G = 1 / 0;
4399
4422
  for (const B of c(b)) {
@@ -4459,10 +4482,10 @@ function sa(t, e) {
4459
4482
  function vo(m) {
4460
4483
  T(g, m, !0), T(z, null), T(H, null), T(U, null);
4461
4484
  }
4462
- function Cr(m) {
4463
- const w = Vr(m);
4485
+ function Nn(m) {
4486
+ const w = Mn(m);
4464
4487
  if (!w) return;
4465
- const C = Mr(w, F);
4488
+ const C = Cn(w, F);
4466
4489
  switch (c(g)) {
4467
4490
  case "point":
4468
4491
  T(
@@ -4493,7 +4516,7 @@ function sa(t, e) {
4493
4516
  )), T(z, null), T(U, null));
4494
4517
  break;
4495
4518
  case "delete":
4496
- const G = Mr(w, 2);
4519
+ const G = Cn(w, 2);
4497
4520
  G && (T(b, c(b).filter((B) => B.id !== G.id), !0), T(h, c(h).filter((B) => B.p1Id !== G.id && B.p2Id !== G.id), !0));
4498
4521
  break;
4499
4522
  case "selector":
@@ -4509,7 +4532,7 @@ function sa(t, e) {
4509
4532
  c(g) === "selector" && (T(H, m, !0), w.target.setPointerCapture(w.pointerId));
4510
4533
  }
4511
4534
  function _o(m) {
4512
- const w = Vr(m);
4535
+ const w = Mn(m);
4513
4536
  if (w && (T(
4514
4537
  U,
4515
4538
  w,
@@ -4525,21 +4548,21 @@ function sa(t, e) {
4525
4548
  ));
4526
4549
  }
4527
4550
  }
4528
- function Nr(m) {
4551
+ function Pn(m) {
4529
4552
  c(H) !== null && (m.target?.hasPointerCapture(m.pointerId) && m.target.releasePointerCapture(m.pointerId), T(H, null)), (c(g) !== "line" || c(z) === null) && T(U, null);
4530
4553
  }
4531
4554
  function mo(m) {
4532
- if (m.target.closest(".pie-tool-graph__header") && c(n)) {
4555
+ if (m.target.closest(".pie-tool-graph__header") && c(r)) {
4533
4556
  let G = function(Z) {
4534
4557
  let fe = Z.clientX - C, Ce = Z.clientY - A;
4535
- const ti = (c(n)?.offsetWidth || c(p)) / 2, ii = (c(n)?.offsetHeight || c(v)) / 2;
4558
+ const ti = (c(r)?.offsetWidth || c(p)) / 2, ii = (c(r)?.offsetHeight || c(v)) / 2;
4536
4559
  T(d, Math.max(ti, Math.min(fe, window.innerWidth - ti)), !0), T(_, Math.max(ii, Math.min(Ce, window.innerHeight - ii)), !0);
4537
4560
  }, B = function() {
4538
- c(n) && c(n).releasePointerCapture(m.pointerId), c(n)?.removeEventListener("pointermove", G), c(n)?.removeEventListener("pointerup", B);
4561
+ c(r) && c(r).releasePointerCapture(m.pointerId), c(r)?.removeEventListener("pointermove", G), c(r)?.removeEventListener("pointerup", B);
4539
4562
  };
4540
- c(n).setPointerCapture(m.pointerId);
4563
+ c(r).setPointerCapture(m.pointerId);
4541
4564
  const C = m.clientX - c(d), A = m.clientY - c(_);
4542
- c(n).addEventListener("pointermove", G), c(n).addEventListener("pointerup", B), c(a)?.bringToFront(c(n));
4565
+ c(r).addEventListener("pointermove", G), c(r).addEventListener("pointerup", B), c(a)?.bringToFront(c(r));
4543
4566
  }
4544
4567
  }
4545
4568
  let lt = null;
@@ -4552,11 +4575,11 @@ function sa(t, e) {
4552
4575
  lt && lt.disconnect();
4553
4576
  };
4554
4577
  }), si(() => {
4555
- c(a) && r() && !c(qe) && (c(n) ? c(a).registerTool(r(), "Graph Tool", c(n), Mi.MODAL) : c(a).registerTool(r(), "Graph Tool", void 0, Mi.MODAL), T(qe, !0));
4578
+ c(a) && n() && !c(qe) && (c(r) ? c(a).registerTool(n(), "Graph Tool", c(r), Mi.MODAL) : c(a).registerTool(n(), "Graph Tool", void 0, Mi.MODAL), T(qe, !0));
4556
4579
  }), si(() => {
4557
- c(a) && c(n) && r() && (c(a).updateToolElement(r(), c(n)), c(a).bringToFront(c(n)));
4580
+ c(a) && c(r) && n() && (c(a).updateToolElement(n(), c(r)), c(a).bringToFront(c(r)));
4558
4581
  }), qs(() => () => {
4559
- lt && (lt.disconnect(), lt = null), c(a) && r() && c(a).unregisterTool(r());
4582
+ lt && (lt.disconnect(), lt = null), c(a) && n() && c(a).unregisterTool(n());
4560
4583
  });
4561
4584
  var bo = {
4562
4585
  get visible() {
@@ -4566,15 +4589,15 @@ function sa(t, e) {
4566
4589
  i(m), Vi();
4567
4590
  },
4568
4591
  get toolId() {
4569
- return r();
4592
+ return n();
4570
4593
  },
4571
4594
  set toolId(m = "graph") {
4572
- r(m), Vi();
4595
+ n(m), Vi();
4573
4596
  }
4574
- }, Pr = Zi(), yo = Qi(Pr);
4597
+ }, zn = Zi(), yo = Qi(zn);
4575
4598
  {
4576
4599
  var wo = (m) => {
4577
- var w = na(), C = Ie(Ye(w), 2), A = Ye(C);
4600
+ var w = ra(), C = Ie(Ye(w), 2), A = Ye(C);
4578
4601
  bt(A, 21, () => fo, (L) => L.name, (L, $) => {
4579
4602
  var I = Xl();
4580
4603
  let Te;
@@ -4583,7 +4606,7 @@ function sa(t, e) {
4583
4606
  var Ue = (de) => {
4584
4607
  var mt = Ul();
4585
4608
  K(de, mt);
4586
- }, ri = (de) => {
4609
+ }, ni = (de) => {
4587
4610
  var mt = Yl();
4588
4611
  K(de, mt);
4589
4612
  }, _t = (de) => {
@@ -4593,14 +4616,14 @@ function sa(t, e) {
4593
4616
  var mt = Kl();
4594
4617
  K(de, mt);
4595
4618
  };
4596
- ni(gt, (de) => {
4597
- c($).name === "selector" ? de(Ue) : c($).name === "point" ? de(ri, 1) : c($).name === "line" ? de(_t, 2) : c($).name === "delete" && de(So, 3);
4619
+ ri(gt, (de) => {
4620
+ c($).name === "selector" ? de(Ue) : c($).name === "point" ? de(ni, 1) : c($).name === "line" ? de(_t, 2) : c($).name === "delete" && de(So, 3);
4598
4621
  });
4599
4622
  }
4600
4623
  he(W);
4601
- var Dr = Ie(W, 2), $o = Ye(Dr, !0);
4602
- he(Dr), he(I), We(() => {
4603
- Te = Xr(I, 1, "pie-tool-graph__tool-button svelte-7afz7f", null, Te, {
4624
+ var xn = Ie(W, 2), $o = Ye(xn, !0);
4625
+ he(xn), he(I), We(() => {
4626
+ Te = Jn(I, 1, "pie-tool-graph__tool-button svelte-7afz7f", null, Te, {
4604
4627
  "pie-tool-graph__tool-button--active": c(g) === c($).name
4605
4628
  }), P(I, "title", c($).title), P(I, "aria-label", c($).title), P(I, "aria-pressed", c(g) === c($).name), Hs($o, c($).label);
4606
4629
  }), at("click", I, () => vo(c($).name)), K(L, I);
@@ -4621,14 +4644,14 @@ function sa(t, e) {
4621
4644
  P(I, "y1", c($)), P(I, "x2", c(ei)), P(I, "y2", c($));
4622
4645
  }), K(L, I);
4623
4646
  });
4624
- var zr = Ie(ii);
4625
- bt(zr, 17, () => c(wi).minorVertical, Ei, (L, $) => {
4647
+ var Dn = Ie(ii);
4648
+ bt(Dn, 17, () => c(wi).minorVertical, Ei, (L, $) => {
4626
4649
  var I = Zl();
4627
4650
  We(() => {
4628
4651
  P(I, "x1", c($)), P(I, "x2", c($));
4629
4652
  }), K(L, I);
4630
4653
  });
4631
- var To = Ie(zr);
4654
+ var To = Ie(Dn);
4632
4655
  bt(To, 17, () => c(wi).majorVertical, Ei, (L, $) => {
4633
4656
  var I = ea();
4634
4657
  We(() => {
@@ -4640,14 +4663,14 @@ function sa(t, e) {
4640
4663
  const I = /* @__PURE__ */ zt(() => yi(c($).p1Id)), Te = /* @__PURE__ */ zt(() => yi(c($).p2Id));
4641
4664
  var W = Zi(), gt = Qi(W);
4642
4665
  {
4643
- var Ue = (ri) => {
4666
+ var Ue = (ni) => {
4644
4667
  var _t = ta();
4645
4668
  We(() => {
4646
4669
  P(_t, "x1", c(I).x), P(_t, "y1", c(I).y), P(_t, "x2", c(Te).x), P(_t, "y2", c(Te).y);
4647
- }), K(ri, _t);
4670
+ }), K(ni, _t);
4648
4671
  };
4649
- ni(gt, (ri) => {
4650
- c(I) && c(Te) && ri(Ue);
4672
+ ri(gt, (ni) => {
4673
+ c(I) && c(Te) && ni(Ue);
4651
4674
  });
4652
4675
  }
4653
4676
  K(L, W);
@@ -4658,7 +4681,7 @@ function sa(t, e) {
4658
4681
  let Te;
4659
4682
  We(
4660
4683
  (W) => {
4661
- P(I, "cx", c($).x), P(I, "cy", c($).y), Te = Xr(I, 0, "pie-tool-graph__user-point svelte-7afz7f", null, Te, W), P(I, "data-id", c($).id), P(I, "aria-label", `Graph point ${c($).id ?? ""}`);
4684
+ P(I, "cx", c($).x), P(I, "cy", c($).y), Te = Jn(I, 0, "pie-tool-graph__user-point svelte-7afz7f", null, Te, W), P(I, "data-id", c($).id), P(I, "aria-label", `Graph point ${c($).id ?? ""}`);
4662
4685
  },
4663
4686
  [
4664
4687
  () => ({
@@ -4678,32 +4701,32 @@ function sa(t, e) {
4678
4701
  var I = Zi(), Te = Qi(I);
4679
4702
  {
4680
4703
  var W = (gt) => {
4681
- var Ue = ra();
4704
+ var Ue = na();
4682
4705
  We(() => {
4683
4706
  P(Ue, "x1", c($).x), P(Ue, "y1", c($).y), P(Ue, "x2", c(U).x), P(Ue, "y2", c(U).y);
4684
4707
  }), K(gt, Ue);
4685
4708
  };
4686
- ni(Te, (gt) => {
4709
+ ri(Te, (gt) => {
4687
4710
  c($) && gt(W);
4688
4711
  });
4689
4712
  }
4690
4713
  K(L, I);
4691
4714
  };
4692
- ni(Io, (L) => {
4715
+ ri(Io, (L) => {
4693
4716
  c(z) && c(U) && L(Eo);
4694
4717
  });
4695
4718
  }
4696
- he(fe), ir(fe, (L) => T(u, L), () => c(u)), he(Z), ir(Z, (L) => T(l, L), () => c(l)), he(w), ir(w, (L) => T(n, L), () => c(n)), We(() => {
4697
- Jr(w, `left: ${c(d) ?? ""}px; top: ${c(_) ?? ""}px; width: ${c(p) ?? ""}px; height: ${c(v) ?? ""}px; transform: translate(-50%, -50%);`), P(fe, "viewBox", `0 0 ${c(ei) ?? ""} 100`), Jr(Ce, `opacity: ${c(x) ?? ""}`);
4698
- }), at("pointerdown", w, mo), nl(B, () => c(x), (L) => T(x, L)), at("click", Z, Cr), at("keydown", Z, (L) => {
4699
- (L.key === "Enter" || L.key === " ") && (L.preventDefault(), Cr(L));
4700
- }), at("pointermove", fe, _o), at("pointerup", fe, Nr), Cs("pointerleave", fe, Nr), K(m, w);
4719
+ he(fe), nn(fe, (L) => T(u, L), () => c(u)), he(Z), nn(Z, (L) => T(l, L), () => c(l)), he(w), nn(w, (L) => T(r, L), () => c(r)), We(() => {
4720
+ Qn(w, `left: ${c(d) ?? ""}px; top: ${c(_) ?? ""}px; width: ${c(p) ?? ""}px; height: ${c(v) ?? ""}px; transform: translate(-50%, -50%);`), P(fe, "viewBox", `0 0 ${c(ei) ?? ""} 100`), Qn(Ce, `opacity: ${c(x) ?? ""}`);
4721
+ }), at("pointerdown", w, mo), rl(B, () => c(x), (L) => T(x, L)), at("click", Z, Nn), at("keydown", Z, (L) => {
4722
+ (L.key === "Enter" || L.key === " ") && (L.preventDefault(), Nn(L));
4723
+ }), at("pointermove", fe, _o), at("pointerup", fe, Pn), Cs("pointerleave", fe, Pn), K(m, w);
4701
4724
  };
4702
- ni(yo, (m) => {
4725
+ ri(yo, (m) => {
4703
4726
  i() && m(wo);
4704
4727
  });
4705
4728
  }
4706
- return K(t, Pr), _n(bo);
4729
+ return K(t, zn), _r(bo);
4707
4730
  }
4708
4731
  Ns([
4709
4732
  "pointerdown",