@sakuzu/maplibre-gl-draw-ui 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ var x = () => {};
10
10
  function S(e) {
11
11
  for (var t = 0; t < e.length; t++) e[t]();
12
12
  }
13
- function ee() {
13
+ function C() {
14
14
  var e, t;
15
15
  return {
16
16
  promise: new Promise((n, r) => {
@@ -20,10 +20,10 @@ function ee() {
20
20
  reject: t
21
21
  };
22
22
  }
23
- function C(e, t, n = !1) {
23
+ function w(e, t, n = !1) {
24
24
  return e === void 0 ? n ? t() : t : e;
25
25
  }
26
- function w(e, t) {
26
+ function ee(e, t) {
27
27
  if (Array.isArray(e)) return e;
28
28
  if (t === void 0 || !(Symbol.iterator in e)) return Array.from(e);
29
29
  let n = [];
@@ -333,7 +333,7 @@ function jt(e, t, n) {
333
333
  r === null && Ke();
334
334
  var i = void 0, a = sn(Oe), o = !lr, s = /* @__PURE__ */ new Set();
335
335
  return Un(() => {
336
- var t = fr, n = ee();
336
+ var t = fr, n = C();
337
337
  i = n.promise;
338
338
  try {
339
339
  Promise.resolve(e()).then(n.resolve, (e) => {
@@ -630,7 +630,7 @@ var Rt = null, zt = null, Bt = null, Vt = null, Ht = null, Ut = !1, Wt = !1, Gt
630
630
  this.#i.add(e);
631
631
  }
632
632
  settled() {
633
- return (this.#s ??= ee()).promise;
633
+ return (this.#s ??= C()).promise;
634
634
  }
635
635
  static ensure() {
636
636
  if (zt === null) {
@@ -2047,10 +2047,10 @@ function Di(e, t, n, r, i) {
2047
2047
  if (p.length < m.length) {
2048
2048
  var b = m[0], x;
2049
2049
  u = b.prev;
2050
- var S = p[0], ee = p[p.length - 1];
2050
+ var S = p[0], C = p[p.length - 1];
2051
2051
  for (x = 0; x < p.length; x += 1) ki(p[x], b, n);
2052
2052
  for (x = 0; x < m.length; x += 1) l.delete(m[x]);
2053
- Ai(e, S.prev, ee.next), Ai(e, u, S), Ai(e, ee, b), c = b, u = ee, --v, p = [], m = [];
2053
+ Ai(e, S.prev, C.next), Ai(e, u, S), Ai(e, C, b), c = b, u = C, --v, p = [], m = [];
2054
2054
  } else l.delete(_), ki(_, c, n), Ai(e, _.prev, _.next), Ai(e, _, u === null ? e.effect.first : u.next), Ai(e, u, _), u = _;
2055
2055
  continue;
2056
2056
  }
@@ -2064,17 +2064,17 @@ function Di(e, t, n, r, i) {
2064
2064
  e.outrogroups.size === 0 && (e.outrogroups = null);
2065
2065
  }
2066
2066
  if (c !== null || l !== void 0) {
2067
- var C = [];
2068
- if (l !== void 0) for (_ of l) _.f & 8192 || C.push(_);
2069
- for (; c !== null;) !(c.f & 8192) && c !== e.fallback && C.push(c), c = Ei(c.next);
2070
- var w = C.length;
2071
- if (w > 0) {
2067
+ var w = [];
2068
+ if (l !== void 0) for (_ of l) _.f & 8192 || w.push(_);
2069
+ for (; c !== null;) !(c.f & 8192) && c !== e.fallback && w.push(c), c = Ei(c.next);
2070
+ var ee = w.length;
2071
+ if (ee > 0) {
2072
2072
  var te = r & 4 && o === 0 ? n : null;
2073
2073
  if (a) {
2074
- for (v = 0; v < w; v += 1) C[v].nodes?.a?.measure();
2075
- for (v = 0; v < w; v += 1) C[v].nodes?.a?.fix();
2074
+ for (v = 0; v < ee; v += 1) w[v].nodes?.a?.measure();
2075
+ for (v = 0; v < ee; v += 1) w[v].nodes?.a?.fix();
2076
2076
  }
2077
- Si(e, C, te);
2077
+ Si(e, w, te);
2078
2078
  }
2079
2079
  }
2080
2080
  a && pt(() => {
@@ -2973,7 +2973,7 @@ function Va(e, t) {
2973
2973
  className: Na("lucide-icon", n.class),
2974
2974
  hasA11yProp: L(p),
2975
2975
  attributes: f
2976
- })), h = /* @__PURE__ */ A(() => w(L(m), 3)), g = /* @__PURE__ */ A(() => L(h)[1]), _ = /* @__PURE__ */ A(() => C(L(h)[2], () => [], !0)), v = /* @__PURE__ */ A(() => ({
2976
+ })), h = /* @__PURE__ */ A(() => ee(L(m), 3)), g = /* @__PURE__ */ A(() => L(h)[1]), _ = /* @__PURE__ */ A(() => w(L(h)[2], () => [], !0)), v = /* @__PURE__ */ A(() => ({
2977
2977
  ...L(g),
2978
2978
  class: [...L(g).class.split(" "), t.class]
2979
2979
  }));
@@ -2981,7 +2981,7 @@ function Va(e, t) {
2981
2981
  fa(y, () => ({ ...L(v) }));
2982
2982
  var b = N(y);
2983
2983
  Ti(b, 17, () => L(_), xi, (e, t) => {
2984
- var n = /* @__PURE__ */ A(() => w(L(t), 2));
2984
+ var n = /* @__PURE__ */ A(() => ee(L(t), 2));
2985
2985
  let r = () => L(n)[0], i = () => L(n)[1];
2986
2986
  var a = B();
2987
2987
  Ni(P(a), r, !0, (e, t) => {
@@ -4352,40 +4352,48 @@ function Qs(e, t) {
4352
4352
  zn(() => {
4353
4353
  t.onOpenChange?.(L(l));
4354
4354
  });
4355
- let u = /* @__PURE__ */ j(void 0), d = /* @__PURE__ */ j(void 0), f = /* @__PURE__ */ j(!1), p = /* @__PURE__ */ j(hn({
4355
+ let u = /* @__PURE__ */ j(void 0), d = !1;
4356
+ zn(() => {
4357
+ let e = L(u), t = L(l);
4358
+ !e || t === d || (d = t, e.dispatchEvent(new CustomEvent("kata-menu-toggle", {
4359
+ bubbles: !0,
4360
+ detail: { open: t }
4361
+ })));
4362
+ });
4363
+ let f = /* @__PURE__ */ j(void 0), p = /* @__PURE__ */ j(!1), m = /* @__PURE__ */ j(hn({
4356
4364
  top: 0,
4357
4365
  left: 0,
4358
4366
  maxHeight: 0
4359
- })), m = !1, h = null;
4360
- function g() {
4361
- if (!L(u) || !L(d)) return;
4362
- let e = L(u).getBoundingClientRect(), t = L(u).closest("[role=\"toolbar\"], [data-role=\"toolbar\"]"), i = t ? t.getBoundingClientRect() : e, a = window.innerWidth, o = window.innerHeight, s = L(d).offsetWidth, c = L(d).style.maxHeight;
4363
- L(d).style.maxHeight = "";
4364
- let l = L(d).scrollHeight;
4365
- if (L(d).style.maxHeight = c, t?.getAttribute("aria-orientation") === "vertical") {
4367
+ })), h = !1, g = null;
4368
+ function _() {
4369
+ if (!L(u) || !L(f)) return;
4370
+ let e = L(u).getBoundingClientRect(), t = L(u).closest("[role=\"toolbar\"], [data-role=\"toolbar\"]"), i = t ? t.getBoundingClientRect() : e, a = window.innerWidth, o = window.innerHeight, s = L(f).offsetWidth, c = L(f).style.maxHeight;
4371
+ L(f).style.maxHeight = "";
4372
+ let l = L(f).scrollHeight;
4373
+ if (L(f).style.maxHeight = c, t?.getAttribute("aria-orientation") === "vertical") {
4366
4374
  let t = Math.max(120, o - 16), n = Math.min(l, t), r = Math.max(8, Math.min(e.top, o - n - 8)), c = i.left - 4 - s;
4367
- c < 8 && (c = Math.min(i.right + 4, a - s - 8)), M(p, {
4375
+ c < 8 && (c = Math.min(i.right + 4, a - s - 8)), M(m, {
4368
4376
  top: Math.round(r),
4369
4377
  left: Math.round(c),
4370
4378
  maxHeight: Math.round(t)
4371
4379
  }, !0);
4372
4380
  return;
4373
4381
  }
4374
- let f = o - i.bottom - 4 - 8, m = i.top - 4 - 8, h = r() ? !(m < Math.min(l, 120) && f > m) : f < Math.min(l, 120) && m > f, g = Math.max(120, h ? m : f), _ = Math.min(l, g), v = h ? i.top - 4 - _ : i.bottom + 4, y = n() === "end" ? e.right - s : e.left;
4375
- y = Math.max(8, Math.min(y, a - s - 8)), M(p, {
4382
+ let d = o - i.bottom - 4 - 8, p = i.top - 4 - 8, h = r() ? !(p < Math.min(l, 120) && d > p) : d < Math.min(l, 120) && p > d, g = Math.max(120, h ? p : d), _ = Math.min(l, g), v = h ? i.top - 4 - _ : i.bottom + 4, y = n() === "end" ? e.right - s : e.left;
4383
+ y = Math.max(8, Math.min(y, a - s - 8)), M(m, {
4376
4384
  top: Math.round(v),
4377
4385
  left: Math.round(y),
4378
4386
  maxHeight: Math.round(g)
4379
4387
  }, !0);
4380
4388
  }
4381
- function _() {
4382
- M(l, !L(l)), L(l) && (h = a() ? document.activeElement : null, m = a(), M(f, !1));
4383
- }
4384
4389
  function v() {
4390
+ M(l, !L(l)), L(l) && (g = a() ? document.activeElement : null, h = a(), M(p, !1));
4391
+ }
4392
+ function y() {
4385
4393
  M(l, !1);
4386
4394
  }
4387
- let y = typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function";
4388
- function b(e) {
4395
+ let b = typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function";
4396
+ function x(e) {
4389
4397
  try {
4390
4398
  return e.matches(":popover-open");
4391
4399
  } catch {
@@ -4393,67 +4401,67 @@ function Qs(e, t) {
4393
4401
  }
4394
4402
  }
4395
4403
  zn(() => {
4396
- if (!L(l) || !L(d)) return;
4397
- let e = L(d);
4398
- if (y && !b(e)) try {
4404
+ if (!L(l) || !L(f)) return;
4405
+ let e = L(f);
4406
+ if (b && !x(e)) try {
4399
4407
  e.showPopover();
4400
4408
  } catch {}
4401
4409
  (async () => {
4402
- await Mr(), g(), M(f, !0), m && (m = !1, await Mr(), S(0));
4410
+ await Mr(), _(), M(p, !0), h && (h = !1, await Mr(), C(0));
4403
4411
  })();
4404
4412
  });
4405
- function x() {
4406
- return L(d) ? [...L(d).querySelectorAll("[role=\"menuitem\"]")] : [];
4413
+ function S() {
4414
+ return L(f) ? [...L(f).querySelectorAll("[role=\"menuitem\"]")] : [];
4407
4415
  }
4408
- function S(e) {
4409
- let t = x();
4416
+ function C(e) {
4417
+ let t = S();
4410
4418
  t.length !== 0 && t[(e % t.length + t.length) % t.length]?.focus();
4411
4419
  }
4412
- function ee() {
4413
- M(l, !1), h?.focus?.();
4420
+ function w() {
4421
+ M(l, !1), g?.focus?.();
4414
4422
  }
4415
- function C(e) {
4423
+ function ee(e) {
4416
4424
  if (!a()) return;
4417
- let t = x();
4425
+ let t = S();
4418
4426
  if (t.length === 0) return;
4419
4427
  let n = t.indexOf(document.activeElement);
4420
- e.key === "ArrowDown" ? (e.preventDefault(), S(n < 0 ? 0 : n + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), S(n < 0 ? t.length - 1 : n - 1)) : e.key === "Home" ? (e.preventDefault(), S(0)) : e.key === "End" ? (e.preventDefault(), S(t.length - 1)) : e.key === "Tab" && ee();
4428
+ e.key === "ArrowDown" ? (e.preventDefault(), C(n < 0 ? 0 : n + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), C(n < 0 ? t.length - 1 : n - 1)) : e.key === "Home" ? (e.preventDefault(), C(0)) : e.key === "End" ? (e.preventDefault(), C(t.length - 1)) : e.key === "Tab" && w();
4421
4429
  }
4422
- function w(e) {
4430
+ function te(e) {
4423
4431
  if (!L(l)) return;
4424
4432
  let t = e.target;
4425
- L(u)?.contains(t) || L(d)?.contains(t) || M(l, !1);
4433
+ L(u)?.contains(t) || L(f)?.contains(t) || M(l, !1);
4426
4434
  }
4427
- function te(e) {
4428
- e.key !== "Escape" || !L(l) || (e.stopPropagation(), a() ? ee() : M(l, !1));
4435
+ function ne(e) {
4436
+ e.key !== "Escape" || !L(l) || (e.stopPropagation(), a() ? w() : M(l, !1));
4429
4437
  }
4430
- var ne = Zs();
4431
- Qr("keydown", vn, te, !0), Qr("pointerdown", vn, w, !0), Qr("resize", vn, () => L(l) && g()), Qr("scroll", vn, () => L(l) && g());
4432
- var re = P(ne);
4433
- let ie;
4434
- W(N(re), () => t.trigger, () => _, () => L(l)), E(re), Ca(re, (e) => M(u, e), () => L(u));
4435
- var ae = F(re, 2), oe = (e) => {
4438
+ var re = Zs();
4439
+ Qr("keydown", vn, ne, !0), Qr("pointerdown", vn, te, !0), Qr("resize", vn, () => L(l) && _()), Qr("scroll", vn, () => L(l) && _());
4440
+ var ie = P(re);
4441
+ let ae;
4442
+ W(N(ie), () => t.trigger, () => v, () => L(l)), E(ie), Ca(ie, (e) => M(u, e), () => L(u));
4443
+ var oe = F(ie, 2), se = (e) => {
4436
4444
  var n = Xs();
4437
4445
  let r, i;
4438
- W(N(n), () => t.panel, () => v), E(n), Ca(n, (e) => M(d, e), () => L(d)), I(() => {
4446
+ W(N(n), () => t.panel, () => y), E(n), Ca(n, (e) => M(f, e), () => L(f)), I(() => {
4439
4447
  r = G(n, 1, "seat svelte-k2w6bw", null, r, {
4440
4448
  menu: !o(),
4441
- placed: L(f)
4442
- }), K(n, "popover", y ? "manual" : void 0), K(n, "role", a() ? "menu" : void 0), K(n, "aria-orientation", a() ? "vertical" : void 0), i = Gi(n, "", i, {
4443
- top: `${L(p).top}px`,
4444
- left: `${L(p).left}px`,
4445
- "max-height": `${L(p).maxHeight}px`,
4449
+ placed: L(p)
4450
+ }), K(n, "popover", b ? "manual" : void 0), K(n, "role", a() ? "menu" : void 0), K(n, "aria-orientation", a() ? "vertical" : void 0), i = Gi(n, "", i, {
4451
+ top: `${L(m).top}px`,
4452
+ left: `${L(m).left}px`,
4453
+ "max-height": `${L(m).maxHeight}px`,
4446
4454
  "max-width": t.menuMaxWidth
4447
4455
  });
4448
4456
  }), R("keydown", n, function(...e) {
4449
- (a() ? C : void 0)?.apply(this, e);
4457
+ (a() ? ee : void 0)?.apply(this, e);
4450
4458
  }), V(e, n);
4451
4459
  };
4452
- U(ae, (e) => {
4453
- L(l) && e(oe);
4460
+ U(oe, (e) => {
4461
+ L(l) && e(se);
4454
4462
  }), I(() => {
4455
- ie = G(re, 1, "anchor svelte-k2w6bw", null, ie, { block: s() }), K(re, "data-role", c());
4456
- }), V(e, ne), k();
4463
+ ae = G(ie, 1, "anchor svelte-k2w6bw", null, ae, { block: s() }), K(ie, "data-role", c());
4464
+ }), V(e, re), k();
4457
4465
  }
4458
4466
  $r(["keydown"]);
4459
4467
  //#endregion
@@ -4811,7 +4819,7 @@ function Ac(e, t) {
4811
4819
  e.disabled || (e.href || t.onselect?.(e.id), t.onclose?.());
4812
4820
  }
4813
4821
  let x = /* @__PURE__ */ A(() => L(c) === null ? null : t.items[L(c)]), S = /* @__PURE__ */ A(() => L(l) === null ? null : t.items[L(l)]);
4814
- var ee = kc(), C = P(ee), w = N(C), te = (e) => {
4822
+ var C = kc(), w = P(C), ee = N(w), te = (e) => {
4815
4823
  {
4816
4824
  let n = /* @__PURE__ */ A(() => L(S).items ?? []);
4817
4825
  Ac(e, {
@@ -4837,10 +4845,10 @@ function Ac(e, t) {
4837
4845
  }, ne = (e) => {
4838
4846
  n(e);
4839
4847
  };
4840
- U(w, (e) => {
4848
+ U(ee, (e) => {
4841
4849
  L(S) && !("divider" in L(S)) && !("heading" in L(S)) ? e(te) : e(ne, -1);
4842
- }), E(C), Ca(C, (e) => M(d, e), () => L(d));
4843
- var re = F(C, 2), ie = (e) => {
4850
+ }), E(w), Ca(w, (e) => M(d, e), () => L(d));
4851
+ var re = F(w, 2), ie = (e) => {
4844
4852
  var n = Oc();
4845
4853
  let r;
4846
4854
  mc(N(n), {
@@ -4871,8 +4879,8 @@ function Ac(e, t) {
4871
4879
  U(re, (e) => {
4872
4880
  L(x) && !("divider" in L(x)) && !("heading" in L(x)) && e(ie);
4873
4881
  }), I(() => {
4874
- K(C, "role", i() === "floating" ? "menu" : "group"), K(C, "aria-label", i() === "in-place" ? t.backLabel : void 0);
4875
- }), R("keydown", C, y), V(e, ee), k();
4882
+ K(w, "role", i() === "floating" ? "menu" : "group"), K(w, "aria-label", i() === "in-place" ? t.backLabel : void 0);
4883
+ }), R("keydown", w, y), V(e, C), k();
4876
4884
  }
4877
4885
  $r(["keydown"]);
4878
4886
  //#endregion
@@ -5718,11 +5726,11 @@ function Vl(e, t) {
5718
5726
  let t = e.target;
5719
5727
  L(u)?.contains(t) || L(d)?.contains(t) || v(!1);
5720
5728
  }
5721
- var ee = Bl();
5729
+ var C = Bl();
5722
5730
  Qr("pointerdown", vn, S, !0), Qr("resize", vn, () => L(c) && m()), Qr("scroll", vn, () => L(c) && m());
5723
- var C = P(ee);
5724
- let w;
5725
- var te = N(C), ne = (e) => {
5731
+ var w = P(C);
5732
+ let ee;
5733
+ var te = N(w), ne = (e) => {
5726
5734
  var t = Pl(), n = Dn(t, !0);
5727
5735
  I(() => H(n, L(s).label)), V(e, t);
5728
5736
  }, re = (e) => {
@@ -5731,8 +5739,8 @@ function Vl(e, t) {
5731
5739
  };
5732
5740
  U(te, (e) => {
5733
5741
  L(s) ? e(ne) : e(re, -1);
5734
- }), X(F(te, 2), { name: "chevron-down" }), E(C), Ca(C, (e) => M(u, e), () => L(u));
5735
- var ie = F(C, 2), ae = (e) => {
5742
+ }), X(F(te, 2), { name: "chevron-down" }), E(w), Ca(w, (e) => M(u, e), () => L(u));
5743
+ var ie = F(w, 2), ae = (e) => {
5736
5744
  var i = zl();
5737
5745
  let a, o;
5738
5746
  Ti(i, 21, () => t.options, (e) => e.value, (e, t) => {
@@ -5770,11 +5778,11 @@ function Vl(e, t) {
5770
5778
  U(ie, (e) => {
5771
5779
  L(c) && e(ae);
5772
5780
  }), I(() => {
5773
- w = G(C, 1, "trigger svelte-gho7xv", null, w, {
5781
+ ee = G(w, 1, "trigger svelte-gho7xv", null, ee, {
5774
5782
  err: o(),
5775
5783
  disabled: a()
5776
- }), K(C, "id", t.id), C.disabled = a(), K(C, "aria-label", t.ariaLabel), K(C, "aria-expanded", L(c)), K(C, "aria-controls", L(c) ? n : void 0);
5777
- }), R("click", C, () => L(c) ? v(!1) : _()), R("keydown", C, b), V(e, ee), k();
5784
+ }), K(w, "id", t.id), w.disabled = a(), K(w, "aria-label", t.ariaLabel), K(w, "aria-expanded", L(c)), K(w, "aria-controls", L(c) ? n : void 0);
5785
+ }), R("click", w, () => L(c) ? v(!1) : _()), R("keydown", w, b), V(e, C), k();
5778
5786
  }
5779
5787
  $r(["click", "keydown"]);
5780
5788
  //#endregion
@@ -5843,7 +5851,7 @@ function Jl(e, t) {
5843
5851
  let u;
5844
5852
  var d = N(c);
5845
5853
  let f;
5846
- E(c), Ca(c, (e) => M(w, e), () => L(w));
5854
+ E(c), Ca(c, (e) => M(ee, e), () => L(ee));
5847
5855
  var p = F(c, 2);
5848
5856
  Nl(p, {
5849
5857
  gap: "sm",
@@ -5890,7 +5898,7 @@ function Jl(e, t) {
5890
5898
  ], (e) => e, (e, t, n) => {
5891
5899
  jl(e, {
5892
5900
  get value() {
5893
- return L(ee)[L(n)];
5901
+ return L(C)[L(n)];
5894
5902
  },
5895
5903
  get unit() {
5896
5904
  return t;
@@ -5909,7 +5917,7 @@ function Jl(e, t) {
5909
5917
  let e = /* @__PURE__ */ A(() => Y().hue);
5910
5918
  jl(n, {
5911
5919
  get value() {
5912
- return L(C).h;
5920
+ return L(w).h;
5913
5921
  },
5914
5922
  unit: "H",
5915
5923
  min: 0,
@@ -5925,7 +5933,7 @@ function Jl(e, t) {
5925
5933
  let e = /* @__PURE__ */ A(() => Y().saturation);
5926
5934
  jl(r, {
5927
5935
  get value() {
5928
- return L(C).s;
5936
+ return L(w).s;
5929
5937
  },
5930
5938
  unit: "S",
5931
5939
  min: 0,
@@ -5941,7 +5949,7 @@ function Jl(e, t) {
5941
5949
  let e = /* @__PURE__ */ A(() => Y().lightness);
5942
5950
  jl(i, {
5943
5951
  get value() {
5944
- return L(C).l;
5952
+ return L(w).l;
5945
5953
  },
5946
5954
  unit: "L",
5947
5955
  min: 0,
@@ -6112,11 +6120,11 @@ function Jl(e, t) {
6112
6120
  M(y, e.h, !0), M(b, e.s, !0), M(x, e.v, !0);
6113
6121
  })(f(...e));
6114
6122
  });
6115
- let S = /* @__PURE__ */ A(() => p(L(y), 1, 1)), ee = /* @__PURE__ */ A(() => d(L(_)) ?? [
6123
+ let S = /* @__PURE__ */ A(() => p(L(y), 1, 1)), C = /* @__PURE__ */ A(() => d(L(_)) ?? [
6116
6124
  0,
6117
6125
  0,
6118
6126
  0
6119
- ]), C = /* @__PURE__ */ A(() => h(...L(ee))), w = /* @__PURE__ */ j(void 0), te = /* @__PURE__ */ j(void 0), ne = /* @__PURE__ */ j(!1), re = /* @__PURE__ */ j(!1);
6127
+ ]), w = /* @__PURE__ */ A(() => h(...L(C))), ee = /* @__PURE__ */ j(void 0), te = /* @__PURE__ */ j(void 0), ne = /* @__PURE__ */ j(!1), re = /* @__PURE__ */ j(!1);
6120
6128
  function ie(e, t, n) {
6121
6129
  let r = Math.round(Number(e));
6122
6130
  return Number.isNaN(r) ? t : Math.min(n, Math.max(t, r));
@@ -6141,27 +6149,27 @@ function Jl(e, t) {
6141
6149
  n ? se(m(...n)) : t.value = L(_);
6142
6150
  }
6143
6151
  function ue(e, t) {
6144
- let n = [...L(ee)];
6152
+ let n = [...L(C)];
6145
6153
  n[e] = ie(t, 0, 255), se(m(...n));
6146
6154
  }
6147
6155
  function de(e, t) {
6148
- let { h: n, s: r, l: i } = L(C);
6156
+ let { h: n, s: r, l: i } = L(w);
6149
6157
  e === "h" ? n = ie(t, 0, 360) % 360 : e === "s" ? r = ie(t, 0, 100) : i = ie(t, 0, 100), se(m(...g(n, r, i)));
6150
6158
  }
6151
6159
  function fe(e, t) {
6152
- let n = L(w);
6160
+ let n = L(ee);
6153
6161
  if (!n) return;
6154
6162
  let r = n.getBoundingClientRect();
6155
6163
  M(b, u((e - r.left) / r.width), !0), M(x, 1 - u((t - r.top) / r.height)), ae();
6156
6164
  }
6157
6165
  function pe(e) {
6158
- M(ne, !0), L(w)?.setPointerCapture(e.pointerId), fe(e.clientX, e.clientY);
6166
+ M(ne, !0), L(ee)?.setPointerCapture(e.pointerId), fe(e.clientX, e.clientY);
6159
6167
  }
6160
6168
  function me(e) {
6161
6169
  L(ne) && fe(e.clientX, e.clientY);
6162
6170
  }
6163
6171
  function he(e) {
6164
- M(ne, !1), L(w)?.releasePointerCapture(e.pointerId);
6172
+ M(ne, !1), L(ee)?.releasePointerCapture(e.pointerId);
6165
6173
  }
6166
6174
  function ge(e) {
6167
6175
  let t = .02;
@@ -6579,10 +6587,10 @@ function Cu(e, t) {
6579
6587
  });
6580
6588
  var g = F(m, 2);
6581
6589
  let x;
6582
- var S = N(g), ee = (e) => {
6590
+ var S = N(g), C = (e) => {
6583
6591
  var n = B();
6584
6592
  W(P(n), () => t.children), V(e, n);
6585
- }, C = (e) => {
6593
+ }, w = (e) => {
6586
6594
  Sl(e, {
6587
6595
  gap: "md",
6588
6596
  children: (e, n) => {
@@ -6609,9 +6617,9 @@ function Cu(e, t) {
6609
6617
  });
6610
6618
  };
6611
6619
  U(S, (e) => {
6612
- p() ? e(ee) : e(C, -1);
6620
+ p() ? e(C) : e(w, -1);
6613
6621
  }), E(g);
6614
- var w = F(g, 2), te = (e) => {
6622
+ var ee = F(g, 2), te = (e) => {
6615
6623
  {
6616
6624
  let n = /* @__PURE__ */ A(() => t.lead ?? (t.status ? r : void 0));
6617
6625
  pu(e, {
@@ -6630,7 +6638,7 @@ function Cu(e, t) {
6630
6638
  });
6631
6639
  }
6632
6640
  };
6633
- U(w, (e) => {
6641
+ U(ee, (e) => {
6634
6642
  !L(_) && L(v) && e(te);
6635
6643
  }), I(() => {
6636
6644
  x = G(g, 1, "body svelte-1nboboq", null, x, { flush: p() }), K(g, "data-inset", !p() || void 0);
@@ -6655,7 +6663,7 @@ function Cu(e, t) {
6655
6663
  function S() {
6656
6664
  l(!1), t.onclose?.();
6657
6665
  }
6658
- var ee = B(), C = P(ee), w = (e) => {
6666
+ var C = B(), w = P(C), ee = (e) => {
6659
6667
  var t = xu();
6660
6668
  let r;
6661
6669
  var i = N(t);
@@ -6673,9 +6681,9 @@ function Cu(e, t) {
6673
6681
  }), K(t, "aria-labelledby", n), K(t, "role", d() ? "alertdialog" : "dialog");
6674
6682
  }), Qr("close", t, S), Qr("cancel", t, (e) => f() && e.preventDefault()), R("click", t, (e) => e.target === L(h) && !d() && !f() && x()), V(e, t);
6675
6683
  };
6676
- U(C, (e) => {
6677
- m() ? e(w) : e(te, -1);
6678
- }), V(e, ee), k();
6684
+ U(w, (e) => {
6685
+ m() ? e(ee) : e(te, -1);
6686
+ }), V(e, C), k();
6679
6687
  }
6680
6688
  $r(["click"]);
6681
6689
  //#endregion
@@ -7800,12 +7808,12 @@ function gd(e, t) {
7800
7808
  });
7801
7809
  var y = F(v, 2), b = N(y), S = Dn(b, !0);
7802
7810
  X(F(b), { name: "chevron-down" }), E(y);
7803
- var ee = F(y, 2), C = (e) => {
7811
+ var C = F(y, 2), w = (e) => {
7804
7812
  var t = md(), n = N(t), r = Dn(n, !0);
7805
7813
  X(F(n), { name: "chevron-down" }), E(t), I(() => H(r, L(u))), V(e, t);
7806
7814
  };
7807
- U(ee, (e) => {
7808
- L(u) !== void 0 && e(C);
7815
+ U(C, (e) => {
7816
+ L(u) !== void 0 && e(w);
7809
7817
  }), E(_), Ca(_, (e) => M(i, e), () => L(i)), E(f), Ca(f, (e) => M(r, e), () => L(r)), I((e) => {
7810
7818
  p = G(f, 1, "tabs svelte-dvdfj", null, p, { bar: L(a) }), K(f, "aria-label", t.label), K(f, "data-rule", L(a) ? void 0 : ""), H(S, e);
7811
7819
  }, [() => Y().more]), V(e, f), k();
@@ -8888,8 +8896,8 @@ $.prototype = {
8888
8896
  if (n = b, i = rf(n), Cp(Nf, t, Q, r, n, i, e, !1) !== !1) return g(), t.insertBefore(Q, b), jf = t, v(), _(!0);
8889
8897
  } else if (n.parentNode === t) {
8890
8898
  i = rf(n);
8891
- var x = 0, S, ee = Q.parentNode !== t, C = !hp(Q.animated && Q.toRect || r, n.animated && n.toRect || i, f), w = f ? "top" : "left", te = af(n, "top", "top") || af(Q, "top", "top"), ne = te ? te.scrollTop : void 0;
8892
- ep !== n && (S = i[w], np = !1, rp = !C && o.invertSwap || ee), x = Op(e, n, i, f, C ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, rp, ep === n);
8899
+ var x = 0, S, C = Q.parentNode !== t, w = !hp(Q.animated && Q.toRect || r, n.animated && n.toRect || i, f), ee = f ? "top" : "left", te = af(n, "top", "top") || af(Q, "top", "top"), ne = te ? te.scrollTop : void 0;
8900
+ ep !== n && (S = i[ee], np = !1, rp = !w && o.invertSwap || C), x = Op(e, n, i, f, w ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, rp, ep === n);
8893
8901
  var re;
8894
8902
  if (x !== 0) {
8895
8903
  var ie = cf(Q);
@@ -8902,7 +8910,7 @@ $.prototype = {
8902
8910
  var ae = n.nextElementSibling, oe = !1;
8903
8911
  oe = x === 1;
8904
8912
  var se = Cp(Nf, t, Q, r, n, i, e, oe);
8905
- if (se !== !1) return (se === 1 || se === -1) && (oe = se === 1), sp = !0, setTimeout(Tp, 30), g(), oe && !ae ? t.appendChild(Q) : n.parentNode.insertBefore(Q, oe ? ae : n), te && _f(te, 0, ne - te.scrollTop), jf = Q.parentNode, S !== void 0 && !rp && (ip = Math.abs(S - rf(n)[w])), v(), _(!0);
8913
+ if (se !== !1) return (se === 1 || se === -1) && (oe = se === 1), sp = !0, setTimeout(Tp, 30), g(), oe && !ae ? t.appendChild(Q) : n.parentNode.insertBefore(Q, oe ? ae : n), te && _f(te, 0, ne - te.scrollTop), jf = Q.parentNode, S !== void 0 && !rp && (ip = Math.abs(S - rf(n)[ee])), v(), _(!0);
8906
8914
  }
8907
8915
  if (t.contains(Q)) return _(!1);
8908
8916
  }
@@ -9189,9 +9197,9 @@ var Gp = hf(function(e, t, n, r) {
9189
9197
  Ip !== n && (Ip = n, Up(), Fp = t.scroll, u = t.scrollFn, Fp === !0 && (Fp = df(n, !0)));
9190
9198
  var d = 0, f = Fp;
9191
9199
  do {
9192
- var p = f, m = rf(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0, ee = p.scrollWidth, C = p.scrollHeight, w = Z(p), te = p.scrollLeft, ne = p.scrollTop;
9193
- p === c ? (x = y < ee && (w.overflowX === "auto" || w.overflowX === "scroll" || w.overflowX === "visible"), S = b < C && (w.overflowY === "auto" || w.overflowY === "scroll" || w.overflowY === "visible")) : (x = y < ee && (w.overflowX === "auto" || w.overflowX === "scroll"), S = b < C && (w.overflowY === "auto" || w.overflowY === "scroll"));
9194
- var re = x && (Math.abs(v - i) <= o && te + y < ee) - (Math.abs(_ - i) <= o && !!te), ie = S && (Math.abs(g - a) <= o && ne + b < C) - (Math.abs(h - a) <= o && !!ne);
9200
+ var p = f, m = rf(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0, C = p.scrollWidth, w = p.scrollHeight, ee = Z(p), te = p.scrollLeft, ne = p.scrollTop;
9201
+ p === c ? (x = y < C && (ee.overflowX === "auto" || ee.overflowX === "scroll" || ee.overflowX === "visible"), S = b < w && (ee.overflowY === "auto" || ee.overflowY === "scroll" || ee.overflowY === "visible")) : (x = y < C && (ee.overflowX === "auto" || ee.overflowX === "scroll"), S = b < w && (ee.overflowY === "auto" || ee.overflowY === "scroll"));
9202
+ var re = x && (Math.abs(v - i) <= o && te + y < C) - (Math.abs(_ - i) <= o && !!te), ie = S && (Math.abs(g - a) <= o && ne + b < w) - (Math.abs(h - a) <= o && !!ne);
9195
9203
  if (!Pp[d]) for (var ae = 0; ae <= d; ae++) Pp[ae] || (Pp[ae] = {});
9196
9204
  (Pp[d].vx != re || Pp[d].vy != ie || Pp[d].el !== p) && (Pp[d].el = p, Pp[d].vx = re, Pp[d].vy = ie, clearInterval(Pp[d].pid), (re != 0 || ie != 0) && (l = !0, Pp[d].pid = setInterval(function() {
9197
9205
  r && this.layer === 0 && $.active._onTouchMove(Bp);
@@ -9391,22 +9399,33 @@ function cm(e, t) {
9391
9399
  i?.disconnect(), a?.disconnect(), n && cancelAnimationFrame(n);
9392
9400
  };
9393
9401
  });
9394
- function g() {
9402
+ let g = /* @__PURE__ */ j(void 0), _ = /* @__PURE__ */ j(!1);
9403
+ zn(() => {
9404
+ let e = L(g);
9405
+ if (!e) return;
9406
+ let t = /* @__PURE__ */ new Set(), n = (e) => {
9407
+ let n = e.target;
9408
+ n && (e.detail?.open ? t.add(n) : t.delete(n), M(_, t.size > 0));
9409
+ };
9410
+ return e.addEventListener("kata-menu-toggle", n), () => e.removeEventListener("kata-menu-toggle", n);
9411
+ });
9412
+ function v() {
9395
9413
  i(!i()), t.ontoggle?.(i());
9396
9414
  }
9397
- function _(e) {
9415
+ function y(e) {
9398
9416
  let t = e.target;
9399
- t !== e.currentTarget && !t.classList.contains("chev") || r() && (e.key === "ArrowRight" && !i() || e.key === "ArrowLeft" && i()) && (e.preventDefault(), g());
9417
+ t !== e.currentTarget && !t.classList.contains("chev") || r() && (e.key === "ArrowRight" && !i() || e.key === "ArrowLeft" && i()) && (e.preventDefault(), v());
9400
9418
  }
9401
- let v = /* @__PURE__ */ A(() => [
9419
+ let b = /* @__PURE__ */ A(() => [
9402
9420
  L(p) ? "" : "auto",
9403
9421
  "minmax(0, 1fr)",
9404
9422
  L(h) > 0 ? "auto" : ""
9405
9423
  ].filter(Boolean).join(" "));
9406
- var y = sm();
9407
- fa(y, () => ({
9424
+ var x = sm();
9425
+ fa(x, () => ({
9408
9426
  class: "tree-row",
9409
9427
  "data-dim": c() || l() || u() ? "" : void 0,
9428
+ "data-open": L(_) ? "" : void 0,
9410
9429
  role: "treeitem",
9411
9430
  "aria-selected": s(),
9412
9431
  "aria-expanded": r() ? i() : void 0,
@@ -9420,12 +9439,12 @@ function cm(e, t) {
9420
9439
  },
9421
9440
  [ta]: { "--kata-tree-depth": n() }
9422
9441
  }), void 0, void 0, void 0, "svelte-19ffqlj");
9423
- var b = N(y);
9442
+ var S = N(x);
9424
9443
  {
9425
9444
  let e = /* @__PURE__ */ A(() => !!t.end);
9426
- nu(b, {
9445
+ nu(S, {
9427
9446
  get columns() {
9428
- return L(v);
9447
+ return L(b);
9429
9448
  },
9430
9449
  get sel() {
9431
9450
  return s();
@@ -9436,7 +9455,7 @@ function cm(e, t) {
9436
9455
  get onclick() {
9437
9456
  return t.onclick;
9438
9457
  },
9439
- onkeydown: _,
9458
+ onkeydown: y,
9440
9459
  children: (e, s) => {
9441
9460
  var c = om(), l = P(c), u = (e) => {
9442
9461
  var t = tm();
@@ -9461,17 +9480,17 @@ function cm(e, t) {
9461
9480
  E(n), I((e) => {
9462
9481
  K(n, "tabindex", t.onclick ? -1 : 0), K(n, "aria-label", e);
9463
9482
  }, [() => i() ? Y().collapse : Y().expand]), R("click", n, (e) => {
9464
- e.stopPropagation(), g();
9483
+ e.stopPropagation(), v();
9465
9484
  }), V(e, n);
9466
- }, _ = (e) => {
9485
+ }, g = (e) => {
9467
9486
  V(e, rm());
9468
9487
  };
9469
9488
  U(d, (e) => {
9470
- r() ? e(f) : L(p) || e(_, 1);
9489
+ r() ? e(f) : L(p) || e(g, 1);
9471
9490
  });
9472
- var v = F(d, 2);
9473
- W(N(v), () => t.children), E(v);
9474
- var y = F(v, 2), b = (e) => {
9491
+ var _ = F(d, 2);
9492
+ W(N(_), () => t.children), E(_);
9493
+ var y = F(_, 2), b = (e) => {
9475
9494
  var n = am(), r = P(n), i = (e) => {
9476
9495
  var t = im();
9477
9496
  let n;
@@ -9491,7 +9510,7 @@ function cm(e, t) {
9491
9510
  $$slots: { default: !0 }
9492
9511
  });
9493
9512
  }
9494
- E(y), V(e, y), k();
9513
+ E(x), Ca(x, (e) => M(g, e), () => L(g)), V(e, x), k();
9495
9514
  }
9496
9515
  $r(["click"]);
9497
9516
  //#endregion
@@ -9785,19 +9804,19 @@ function ym(e, t) {
9785
9804
  for (let r of t) e.push(r.id), r.children && L(_).has(r.id) && n(r.children);
9786
9805
  };
9787
9806
  return n(t.nodes), e;
9788
- }), S = /* @__PURE__ */ A(() => !!(t.onvisible || t.onlock || t.actions)), ee = /* @__PURE__ */ j(void 0);
9789
- function C(e, n) {
9807
+ }), S = /* @__PURE__ */ A(() => !!(t.onvisible || t.onlock || t.actions)), C = /* @__PURE__ */ j(void 0);
9808
+ function w(e, n) {
9790
9809
  n !== L(_).has(e) && (u(n ? [...u(), e] : u().filter((t) => t !== e)), t.onexpand?.(e, n));
9791
9810
  }
9792
- let w = null;
9811
+ let ee = null;
9793
9812
  function te(e, n) {
9794
9813
  if (e.selectable === !1) return;
9795
9814
  let r = {
9796
9815
  range: !!n?.shiftKey,
9797
9816
  toggle: !!(n?.metaKey || n?.ctrlKey),
9798
9817
  pressed: e.id
9799
- }, i, a = w ? L(b).indexOf(w) : -1, o = L(b).indexOf(e.id);
9800
- r.range && a !== -1 && o !== -1 ? i = L(b).slice(Math.min(a, o), Math.max(a, o) + 1).filter((e) => L(v).get(e)?.node.selectable !== !1) : r.toggle ? (i = L(y).has(e.id) ? l().filter((t) => t !== e.id) : [...l(), e.id], w = e.id) : (i = [e.id], w = e.id), l(i), t.onselect?.(i, r);
9818
+ }, i, a = ee ? L(b).indexOf(ee) : -1, o = L(b).indexOf(e.id);
9819
+ r.range && a !== -1 && o !== -1 ? i = L(b).slice(Math.min(a, o), Math.max(a, o) + 1).filter((e) => L(v).get(e)?.node.selectable !== !1) : r.toggle ? (i = L(y).has(e.id) ? l().filter((t) => t !== e.id) : [...l(), e.id], ee = e.id) : (i = [e.id], ee = e.id), l(i), t.onselect?.(i, r);
9801
9820
  }
9802
9821
  let ne = /* @__PURE__ */ j(null);
9803
9822
  function re(e) {
@@ -9809,10 +9828,10 @@ function ym(e, t) {
9809
9828
  }));
9810
9829
  }
9811
9830
  function ae() {
9812
- return L(ee) ? [...L(ee).querySelectorAll("[role=\"treeitem\"] > [data-role=\"list-item\"]")] : [];
9831
+ return L(C) ? [...L(C).querySelectorAll("[role=\"treeitem\"] > [data-role=\"list-item\"]")] : [];
9813
9832
  }
9814
9833
  function oe(e) {
9815
- return L(ee)?.querySelector(`[role="treeitem"][data-node="${CSS.escape(e)}"] > [data-role="list-item"]`) ?? void 0;
9834
+ return L(C)?.querySelector(`[role="treeitem"][data-node="${CSS.escape(e)}"] > [data-role="list-item"]`) ?? void 0;
9816
9835
  }
9817
9836
  function se(e) {
9818
9837
  let n = e.target;
@@ -9848,7 +9867,7 @@ function ym(e, t) {
9848
9867
  function me(e) {
9849
9868
  let t = e ? L(v).get(e.overId)?.node : void 0;
9850
9869
  return !e || !t?.children || L(_).has(t.id) || !le(e.dragId, t) ? (pe(), !1) : (de !== t.id && (pe(), de = t.id, fe = window.setTimeout(() => {
9851
- de && C(de, !0), pe();
9870
+ de && w(de, !0), pe();
9852
9871
  }, 550)), !0);
9853
9872
  }
9854
9873
  function he(e) {
@@ -9869,7 +9888,7 @@ function ym(e, t) {
9869
9888
  depth: n,
9870
9889
  expandable: !!e.children,
9871
9890
  expanded: L(_).has(e.id),
9872
- ontoggle: (t) => C(e.id, t),
9891
+ ontoggle: (t) => w(e.id, t),
9873
9892
  grip: i,
9874
9893
  gripShow: f() && i,
9875
9894
  hidden: !e.visible,
@@ -9907,7 +9926,7 @@ function ym(e, t) {
9907
9926
  };
9908
9927
  U(ve, (e) => {
9909
9928
  c() ? e(ye) : e(be, -1);
9910
- }), E(_e), Ca(_e, (e) => M(ee, e), () => L(ee)), Pi(_e, (e) => ce?.(e)), V(e, _e), k();
9929
+ }), E(_e), Ca(_e, (e) => M(C, e), () => L(C)), Pi(_e, (e) => ce?.(e)), V(e, _e), k();
9911
9930
  }
9912
9931
  //#endregion
9913
9932
  //#region ../node_modules/@sakuzu/kata/dist/svelte/components/Sheet.svelte
@@ -9922,51 +9941,60 @@ function xm(e, t) {
9922
9941
  peek: .14,
9923
9942
  half: .5,
9924
9943
  full: 1
9925
- }, c = /* @__PURE__ */ j(void 0), l = /* @__PURE__ */ j(null), u = /* @__PURE__ */ j(!1), d = 0, f = 0, p = 0, m = /* @__PURE__ */ A(() => Math.max(0, r().indexOf(n())));
9926
- function h(e) {
9944
+ }, c = /* @__PURE__ */ j(void 0), l = /* @__PURE__ */ j(null), u = /* @__PURE__ */ j(!1), d = !1, f = 0, p = 0, m = 0, h = /* @__PURE__ */ A(() => Math.max(0, r().indexOf(n())));
9945
+ function g(e) {
9927
9946
  e !== n() && (n(e), t.onstage?.(e));
9928
9947
  }
9929
- function g() {
9930
- L(u) || h(r()[L(m) >= r().length - 1 ? 0 : L(m) + 1]);
9931
- }
9932
9948
  function _(e) {
9933
- L(c) && (p = L(c).parentElement?.clientHeight ?? window.innerHeight, d = e.clientY, f = L(c).getBoundingClientRect().height, M(l, f, !0), M(u, !0), e.currentTarget.setPointerCapture?.(e.pointerId));
9949
+ if (!L(u)) {
9950
+ if (d && e.detail > 0) {
9951
+ d = !1;
9952
+ return;
9953
+ }
9954
+ g(r()[L(h) >= r().length - 1 ? 0 : L(h) + 1]);
9955
+ }
9934
9956
  }
9935
9957
  function v(e) {
9958
+ L(c) && (m = L(c).parentElement?.clientHeight ?? window.innerHeight, f = e.clientY, p = L(c).getBoundingClientRect().height, M(l, p, !0), M(u, !0), d = !1, e.currentTarget.setPointerCapture?.(e.pointerId));
9959
+ }
9960
+ function y(e) {
9936
9961
  if (!L(u)) return;
9937
- let t = f + (d - e.clientY);
9938
- M(l, Math.max(48, Math.min(p * .94, t)), !0);
9962
+ let t = p + (f - e.clientY);
9963
+ M(l, Math.max(48, Math.min(m * .94, t)), !0);
9939
9964
  }
9940
- function y() {
9965
+ function b(e) {
9941
9966
  if (!L(u)) return;
9942
9967
  M(u, !1);
9943
- let e = (L(l) ?? 0) / (p || 1);
9944
- if (M(l, null), i() && e < s[r()[0]] * .55) {
9968
+ let n = L(l) ?? 0;
9969
+ if (M(l, null), Math.abs(e.clientY - f) < 4) return;
9970
+ d = !0;
9971
+ let a = n / (m || 1);
9972
+ if (i() && a < s[r()[0]] * .55) {
9945
9973
  t.onclose?.();
9946
9974
  return;
9947
9975
  }
9948
- let n = r()[0], a = Infinity;
9949
- for (let t of r()) {
9950
- let r = Math.abs(s[t] - e);
9951
- r < a && (a = r, n = t);
9976
+ let o = r().filter((e, t) => n > p ? t >= L(h) : n < p ? t <= L(h) : !0), c = o[0], _ = Infinity;
9977
+ for (let e of o) {
9978
+ let t = Math.abs(s[e] - a);
9979
+ t < _ && (_ = t, c = e);
9952
9980
  }
9953
- h(n);
9981
+ g(c);
9954
9982
  }
9955
- function b(e) {
9956
- e.key === "ArrowUp" ? (e.preventDefault(), h(r()[Math.min(r().length - 1, L(m) + 1)])) : e.key === "ArrowDown" && (e.preventDefault(), L(m) === 0 && i() ? t.onclose?.() : h(r()[Math.max(0, L(m) - 1)]));
9957
- }
9958
- var S = bm();
9959
- let ee, C;
9960
- var w = N(S), te = F(w, 2);
9961
- W(te, () => t.head ?? x);
9962
- var ne = F(te, 2);
9963
- let re;
9964
- W(N(ne), () => t.children), E(ne), W(F(ne, 2), () => t.foot ?? x), E(S), Ca(S, (e) => M(c, e), () => L(c)), I((e) => {
9965
- ee = G(S, 1, "sheet svelte-1l2tcmc", null, ee, { dragging: L(u) }), K(S, "data-stage", n()), K(S, "data-inline", o() ? "" : void 0), K(S, "data-sheet", t.name), K(S, "aria-label", t.label), C = Gi(S, "", C, {
9983
+ function S(e) {
9984
+ e.key === "ArrowUp" ? (e.preventDefault(), g(r()[Math.min(r().length - 1, L(h) + 1)])) : e.key === "ArrowDown" && (e.preventDefault(), L(h) === 0 && i() ? t.onclose?.() : g(r()[Math.max(0, L(h) - 1)]));
9985
+ }
9986
+ var C = bm();
9987
+ let w, ee;
9988
+ var te = N(C), ne = F(te, 2);
9989
+ W(ne, () => t.head ?? x);
9990
+ var re = F(ne, 2);
9991
+ let ie;
9992
+ W(N(re), () => t.children), E(re), W(F(re, 2), () => t.foot ?? x), E(C), Ca(C, (e) => M(c, e), () => L(c)), I((e) => {
9993
+ w = G(C, 1, "sheet svelte-1l2tcmc", null, w, { dragging: L(u) }), K(C, "data-stage", n()), K(C, "data-inline", o() ? "" : void 0), K(C, "data-sheet", t.name), K(C, "aria-label", t.label), ee = Gi(C, "", ee, {
9966
9994
  "z-index": t.z,
9967
9995
  height: L(l) === null ? void 0 : `${L(l)}px`
9968
- }), K(w, "aria-label", e), re = G(ne, 1, "scroll svelte-1l2tcmc", null, re, { pane: a() });
9969
- }, [() => Y().sheetHeight]), R("click", w, g), R("pointerdown", w, _), R("pointermove", w, v), R("pointerup", w, y), Qr("pointercancel", w, y), R("keydown", w, b), V(e, S), k();
9996
+ }), K(te, "aria-label", e), ie = G(re, 1, "scroll svelte-1l2tcmc", null, ie, { pane: a() });
9997
+ }, [() => Y().sheetHeight]), R("click", te, _), R("pointerdown", te, v), R("pointermove", te, y), R("pointerup", te, b), Qr("pointercancel", te, b), R("keydown", te, S), V(e, C), k();
9970
9998
  }
9971
9999
  $r([
9972
10000
  "click",
@@ -10174,7 +10202,7 @@ function Mm(e, t) {
10174
10202
  }
10175
10203
  //#endregion
10176
10204
  //#region ../node_modules/@sakuzu/kata/dist/svelte/components/Stat.svelte
10177
- var Nm = /* @__PURE__ */ z("<div class=\"stat svelte-1hxotol\" data-role=\"stat\"><span class=\"v svelte-1hxotol\"> </span> <span class=\"k svelte-1hxotol\"><!><span class=\"t svelte-1hxotol\"> </span></span></div>");
10205
+ var Nm = /* @__PURE__ */ z("<div class=\"stat svelte-1hxotol\" data-role=\"stat\" data-pass=\"\"><span class=\"v svelte-1hxotol\"> </span> <span class=\"k svelte-1hxotol\"><!><span class=\"t svelte-1hxotol\"> </span></span></div>");
10178
10206
  function Pm(e, t) {
10179
10207
  var n = Nm(), r = N(n), i = Dn(r, !0), a = F(r, 2), o = N(a), s = (e) => {
10180
10208
  X(e, { get name() {
@@ -10515,7 +10543,7 @@ function rh(e, t) {
10515
10543
  U(i, (e) => {
10516
10544
  L(s).length > 0 && e(a);
10517
10545
  }), Ti(F(i, 2), 17, () => L(c), ([e, t]) => e, (e, t) => {
10518
- var r = /* @__PURE__ */ A(() => w(L(t), 2));
10546
+ var r = /* @__PURE__ */ A(() => ee(L(t), 2));
10519
10547
  let i = () => L(r)[0], a = () => L(r)[1];
10520
10548
  Mm(e, {
10521
10549
  get title() {
@@ -10559,16 +10587,16 @@ function Sh(e, t) {
10559
10587
  } });
10560
10588
  let m = fc(ec.narrow), h = fc(ec.mid);
10561
10589
  zn(() => m.start(L(p))), zn(() => h.start(L(p)));
10562
- let g = /* @__PURE__ */ A(() => t.narrow ?? m.current), _ = /* @__PURE__ */ A(() => L(g) ? "narrow" : h.current ? "mid" : "wide"), v = /* @__PURE__ */ A(() => L(_) === "narrow" ? "sheet" : L(_) === "wide" && r() === "beside" ? "beside" : "floating"), y = /* @__PURE__ */ A(() => !!t.dock && L(v) === "sheet"), b = ["half", "full"], S = /* @__PURE__ */ A(() => t.dockSheet?.stages ?? b), ee = /* @__PURE__ */ j(void 0);
10590
+ let g = /* @__PURE__ */ A(() => t.narrow ?? m.current), _ = /* @__PURE__ */ A(() => L(g) ? "narrow" : h.current ? "mid" : "wide"), v = /* @__PURE__ */ A(() => L(_) === "narrow" ? "sheet" : L(_) === "wide" && r() === "beside" ? "beside" : "floating"), y = /* @__PURE__ */ A(() => !!t.dock && L(v) === "sheet"), b = ["half", "full"], S = /* @__PURE__ */ A(() => t.dockSheet?.stages ?? b), C = /* @__PURE__ */ j(void 0);
10563
10591
  zn(() => {
10564
10592
  L(y) && Fr(() => {
10565
10593
  i(!1), a(!1);
10566
10594
  });
10567
10595
  });
10568
- let C = /* @__PURE__ */ j(hn([])), w = {};
10596
+ let w = /* @__PURE__ */ j(hn([])), ee = {};
10569
10597
  function te(e, n) {
10570
- let r = L(C).filter((t) => t !== e);
10571
- n && !L(C).includes(e) ? (w[e] = typeof document > "u" ? null : document.activeElement, M(C, [...r, e], !0), L(v) === "sheet" && (r.length > 0 && ne(r[0], !1), L(y) && t.ondockclose?.())) : !n && L(C).includes(e) && M(C, r, !0);
10598
+ let r = L(w).filter((t) => t !== e);
10599
+ n && !L(w).includes(e) ? (ee[e] = typeof document > "u" ? null : document.activeElement, M(w, [...r, e], !0), L(v) === "sheet" && (r.length > 0 && ne(r[0], !1), L(y) && t.ondockclose?.())) : !n && L(w).includes(e) && M(w, r, !0);
10572
10600
  }
10573
10601
  function ne(e, t) {
10574
10602
  e === "left" ? i(t) : a(t);
@@ -10581,14 +10609,14 @@ function Sh(e, t) {
10581
10609
  Fr(() => te("right", e));
10582
10610
  }), zn(() => {
10583
10611
  L(v) === "sheet" && Fr(() => {
10584
- L(C).length > 1 && ne(L(C)[0], !1);
10612
+ L(w).length > 1 && ne(L(w)[0], !1);
10585
10613
  });
10586
10614
  });
10587
- let re = (e) => e === "left" ? t.left : t.right, ie = (e) => L(C).includes(e), ae = [
10615
+ let re = (e) => e === "left" ? t.left : t.right, ie = (e) => L(w).includes(e), ae = [
10588
10616
  "peek",
10589
10617
  "half",
10590
10618
  "full"
10591
- ], oe = (e) => e === "left" ? t.leftSheet : t.rightSheet, se = (e) => oe(e)?.stages ?? ae, ce = (e) => oe(e)?.closable ?? !0, le = /* @__PURE__ */ A(() => L(v) === "sheet" ? [...["left", "right"].filter((e) => !ce(e) && !!re(e) && !ie(e)), ...L(C)] : []);
10619
+ ], oe = (e) => e === "left" ? t.leftSheet : t.rightSheet, se = (e) => oe(e)?.stages ?? ae, ce = (e) => oe(e)?.closable ?? !0, le = /* @__PURE__ */ A(() => L(v) === "sheet" ? [...["left", "right"].filter((e) => !ce(e) && !!re(e) && !ie(e)), ...L(w)] : []);
10592
10620
  function ue(e) {
10593
10621
  return ie(e) ? e === "left" ? u() : d() : se(e)[0];
10594
10622
  }
@@ -10607,8 +10635,8 @@ function Sh(e, t) {
10607
10635
  }
10608
10636
  function be(e) {
10609
10637
  e === "left" ? i(!1) : a(!1);
10610
- let t = w[e];
10611
- w[e] = null, t instanceof HTMLElement && t.isConnected && Mr().then(() => t.focus());
10638
+ let t = ee[e];
10639
+ ee[e] = null, t instanceof HTMLElement && t.isConnected && Mr().then(() => t.focus());
10612
10640
  }
10613
10641
  let xe = hn({
10614
10642
  left: 0,
@@ -10706,7 +10734,7 @@ function Sh(e, t) {
10706
10734
  function Re(e) {
10707
10735
  if (e.defaultPrevented || e.isComposing || s() || Le() || eh(e.target) || eh(document.activeElement)) return;
10708
10736
  if (e.key === "Escape" && !e.metaKey && !e.ctrlKey && !e.altKey) {
10709
- let n = L(v) === "sheet" ? L(C).at(-1) : void 0;
10737
+ let n = L(v) === "sheet" ? L(w).at(-1) : void 0;
10710
10738
  n ? (e.preventDefault(), be(n)) : t.onescape && t.onescape(e) !== !1 && e.preventDefault();
10711
10739
  return;
10712
10740
  }
@@ -10848,7 +10876,7 @@ function Sh(e, t) {
10848
10876
  }), V(e, t);
10849
10877
  }, ot = (e) => {
10850
10878
  var r = vh(), i = P(r), a = (e) => {
10851
- var n = gh(), r = N(n), i = () => L(ee) ?? L(S)[0], a = (e) => M(ee, e, !0);
10879
+ var n = gh(), r = N(n), i = () => L(C) ?? L(S)[0], a = (e) => M(C, e, !0);
10852
10880
  {
10853
10881
  let e = /* @__PURE__ */ A(() => t.dockSheet?.label ?? Y().dock);
10854
10882
  xm(r, {
@@ -11417,21 +11445,40 @@ function hg(e, t) {
11417
11445
  let f = (e, t) => (L(u), e[t]?.() === !0), p = (e) => r() && e.shortcut ? Km(Gh(e.shortcut)) : void 0, m = /* @__PURE__ */ j(void 0), h = /* @__PURE__ */ j(0), g = /* @__PURE__ */ j(null), _ = () => L(m)?.querySelector(":scope > [data-role=\"floating\"]"), v = () => t.corner?.querySelector(":scope > .maplibregl-control-container > .maplibregl-ctrl-bottom-left") ?? null, y = () => t.corner?.querySelector(":scope > .maplibregl-control-container > .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib") ?? null, b = (e) => e.querySelector("[data-region=\"bottom\"] [data-role=\"drawbar\"]"), x = (e) => e.querySelector(":scope > [data-role=\"reopen\"] > [data-role=\"floating\"]");
11418
11446
  function S() {
11419
11447
  let e = L(m)?.parentElement, t = _();
11420
- if (!e || !t) return;
11448
+ if (!e || !t) return null;
11421
11449
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = v()?.getBoundingClientRect(), a = i && i.width > 0 && i.height > 0 ? n.bottom - i.top : 0, o = y()?.getBoundingClientRect();
11422
11450
  o && o.width > 0 && o.height > 0 && o.left < r.right && r.left < o.right && (a = Math.max(a, n.bottom - o.top));
11423
- let l = b(e)?.getBoundingClientRect();
11424
- l && l.width > 0 && l.height > 0 && r.right > l.left && r.left < l.right && (a = Math.max(a, n.bottom - l.top)), a = Math.max(0, Math.round(a));
11425
- let u = `${Math.max(0, Math.round(r.height + (n.bottom - r.bottom) + (a - L(h))))}px`;
11426
- e.style.getPropertyValue(c) !== u && e.style.setProperty(c, u), M(h, a, !0);
11427
- let d = s() ? x(e)?.getBoundingClientRect() : void 0, f = d && d.height > 0 ? d.height : 0;
11428
- M(g, Math.max(0, Math.round(n.height - a - f)), !0);
11451
+ let c = b(e)?.getBoundingClientRect();
11452
+ c && c.width > 0 && c.height > 0 && r.right > c.left && r.left < c.right && (a = Math.max(a, n.bottom - c.top)), a = Math.max(0, Math.round(a));
11453
+ let l = `${Math.max(0, Math.round(r.height + (n.bottom - r.bottom) + (a - L(h))))}px`, u = s() ? x(e)?.getBoundingClientRect() : void 0, d = u && u.height > 0 ? u.height : 0;
11454
+ return {
11455
+ root: e,
11456
+ reserve: l,
11457
+ bottom: a,
11458
+ room: Math.max(0, Math.round(n.height - a - d))
11459
+ };
11460
+ }
11461
+ function C(e) {
11462
+ let { root: t, reserve: n } = e;
11463
+ t.style.getPropertyValue(c) !== n && t.style.setProperty(c, n), M(h, e.bottom, !0), M(g, e.room, !0);
11464
+ }
11465
+ let w = 0;
11466
+ function ee() {
11467
+ w && cancelAnimationFrame(w), w = 0;
11468
+ let e = S();
11469
+ e && C(e);
11470
+ }
11471
+ function te() {
11472
+ let e = S();
11473
+ w && cancelAnimationFrame(w), w = e ? requestAnimationFrame(() => {
11474
+ w = 0, C(e);
11475
+ }) : 0;
11429
11476
  }
11430
11477
  zn(() => {
11431
11478
  let e = L(m) && _(), n = L(m)?.parentElement;
11432
11479
  if (!e || !n) return;
11433
- if (L(d), L(l), o(), s(), typeof ResizeObserver > "u") return S(), () => n.style.removeProperty(c);
11434
- let r = new ResizeObserver(() => S()), i = null, a = () => {
11480
+ if (L(d), L(l), o(), s(), typeof ResizeObserver > "u") return ee(), () => n.style.removeProperty(c);
11481
+ let r = new ResizeObserver(() => te()), i = null, a = () => {
11435
11482
  i = b(n), r.disconnect();
11436
11483
  for (let t of [
11437
11484
  n,
@@ -11443,26 +11490,26 @@ function hg(e, t) {
11443
11490
  };
11444
11491
  a();
11445
11492
  let u = n.querySelector("[data-role=\"shell\"]"), f = typeof MutationObserver > "u" || !u ? null : new MutationObserver(() => {
11446
- b(n) !== i && (a(), S());
11493
+ b(n) !== i && (a(), te());
11447
11494
  });
11448
11495
  f?.observe(u, {
11449
11496
  childList: !0,
11450
11497
  subtree: !0
11451
11498
  });
11452
- let p = typeof MutationObserver > "u" || !t.corner ? null : new MutationObserver(() => S());
11499
+ let p = typeof MutationObserver > "u" || !t.corner ? null : new MutationObserver(() => te());
11453
11500
  return t.corner && p?.observe(t.corner, {
11454
11501
  attributes: !0,
11455
11502
  attributeFilter: ["style"]
11456
- }), S(), () => {
11457
- r.disconnect(), f?.disconnect(), p?.disconnect(), n.style.removeProperty(c);
11503
+ }), ee(), () => {
11504
+ w && cancelAnimationFrame(w), w = 0, r.disconnect(), f?.disconnect(), p?.disconnect(), n.style.removeProperty(c);
11458
11505
  };
11459
11506
  });
11460
- var ee = mg();
11461
- Qr("resize", vn, S);
11462
- var C = N(ee);
11507
+ var ne = mg();
11508
+ Qr("resize", vn, ee);
11509
+ var re = N(ne);
11463
11510
  {
11464
11511
  let e = /* @__PURE__ */ A(() => o() ? "calc(var(--kata-width-panel) + var(--kata-gap-md))" : "md"), r = /* @__PURE__ */ A(() => `calc(var(--kata-gap-md) + ${L(h)}px)`);
11465
- od(C, {
11512
+ od(re, {
11466
11513
  get left() {
11467
11514
  return L(e);
11468
11515
  },
@@ -11580,7 +11627,7 @@ function hg(e, t) {
11580
11627
  $$slots: { default: !0 }
11581
11628
  });
11582
11629
  }
11583
- E(ee), Ca(ee, (e) => M(m, e), () => L(m)), V(e, ee), k();
11630
+ E(ne), Ca(ne, (e) => M(m, e), () => L(m)), V(e, ne), k();
11584
11631
  }
11585
11632
  //#endregion
11586
11633
  //#region src/components/BasemapPanel.svelte
@@ -13166,7 +13213,7 @@ function ev(e, t) {
13166
13213
  $$slots: { default: !0 }
13167
13214
  });
13168
13215
  }
13169
- var ee = F(S, 2), C = (e) => {
13216
+ var C = F(S, 2), w = (e) => {
13170
13217
  {
13171
13218
  let n = /* @__PURE__ */ A(() => [L(s)]);
13172
13219
  q_(e, {
@@ -13191,8 +13238,8 @@ function ev(e, t) {
13191
13238
  });
13192
13239
  }
13193
13240
  };
13194
- U(ee, (e) => {
13195
- L(l).buffer && e(C);
13241
+ U(C, (e) => {
13242
+ L(l).buffer && e(w);
13196
13243
  }), V(e, x), k();
13197
13244
  }
13198
13245
  //#endregion
@@ -14272,21 +14319,21 @@ function Wv(e, t) {
14272
14319
  id: "group",
14273
14320
  label: L(u).newGroup,
14274
14321
  disabled: !Iv(L(p).get(), (e) => t.draw.features.get(e))
14275
- }] : void 0), S = (e) => L(h).get(e)?.node.kind, ee = (e) => {
14322
+ }] : void 0), S = (e) => L(h).get(e)?.node.kind, C = (e) => {
14276
14323
  let t = S(e);
14277
14324
  return mv(t) ? t : void 0;
14278
- }, C;
14279
- function w(e) {
14325
+ }, w;
14326
+ function ee(e) {
14280
14327
  let t = (e.target?.closest?.("[data-sortable-item]"))?.getAttribute("data-id"), n = t ? S(t) : void 0;
14281
- C = t && n ? {
14328
+ w = t && n ? {
14282
14329
  id: t,
14283
14330
  kind: n
14284
14331
  } : void 0;
14285
14332
  }
14286
14333
  function te(e) {
14287
- let n = C;
14288
- if (C = void 0, n && !mv(n.kind)) return;
14289
- let r = Pv(e, ee, mv(n?.kind) ? n.kind : void 0);
14334
+ let n = w;
14335
+ if (w = void 0, n && !mv(n.kind)) return;
14336
+ let r = Pv(e, C, mv(n?.kind) ? n.kind : void 0);
14290
14337
  if (!r) {
14291
14338
  t.draw.selection.clear();
14292
14339
  return;
@@ -14308,7 +14355,7 @@ function Wv(e, t) {
14308
14355
  }
14309
14356
  }
14310
14357
  function re(e, n) {
14311
- let r = ee(e);
14358
+ let r = C(e);
14312
14359
  r === "layer" ? t.draw.layers.update(e, { locked: n }) : r === "group" ? t.draw.groups.update(e, { locked: n }) : r === "feature" && t.draw.features.update(e, { locked: n });
14313
14360
  }
14314
14361
  function ie(e, n) {
@@ -14446,7 +14493,7 @@ function Wv(e, t) {
14446
14493
  };
14447
14494
  U(me, (e) => {
14448
14495
  c() && L(de) && !t.onopenbasemap ? e(he) : e(ge, -1);
14449
- }), E(pe), Qr("click", pe, w, !0), V(e, pe), k();
14496
+ }), E(pe), Qr("click", pe, ee, !0), V(e, pe), k();
14450
14497
  }
14451
14498
  //#endregion
14452
14499
  //#region src/layers/legend.ts
@@ -14919,64 +14966,64 @@ $r(["click"]);
14919
14966
  var oy = /* @__PURE__ */ z("<!> <!>", 1);
14920
14967
  function sy(e, t) {
14921
14968
  O(t, !0);
14922
- let n = J(t, "deletable", 3, !0), r = J(t, "snapping", 3, !0), i = J(t, "keys", 3, !1), a = /* @__PURE__ */ A(() => Aa(t.draw, ["mode.changed"], () => t.draw.getMode())), o = /* @__PURE__ */ A(() => Aa(t.draw, ["selection.changed"], () => t.draw.selection.get().ids.length)), s = /* @__PURE__ */ A(() => Aa(t.draw, ["options.changed"], () => t.draw.options.get().snapping?.enabled !== !1)), c = /* @__PURE__ */ j(void 0), l = /* @__PURE__ */ A(() => t.messages.get()), u = /* @__PURE__ */ A(() => t.tools.get().map((e) => Lh(e, L(l)))), d = /* @__PURE__ */ A(() => {
14969
+ let n = J(t, "deletable", 3, !0), r = J(t, "snapping", 3, !0), i = J(t, "keys", 3, !1), a = /* @__PURE__ */ A(() => Aa(t.draw, ["mode.changed"], () => t.draw.getMode())), o = /* @__PURE__ */ A(() => Aa(t.draw, ["selection.changed"], () => t.draw.selection.get().ids.length)), s = /* @__PURE__ */ A(() => Aa(t.draw, ["readOnly.changed"], () => t.draw.isReadOnly())), c = /* @__PURE__ */ A(() => Aa(t.draw, ["options.changed"], () => t.draw.options.get().snapping?.enabled !== !1)), l = /* @__PURE__ */ j(void 0), u = /* @__PURE__ */ A(() => t.messages.get()), d = /* @__PURE__ */ A(() => t.tools.get().map((e) => Lh(e, L(u)))), f = /* @__PURE__ */ A(() => {
14923
14970
  let e = L(a).get();
14924
- return L(u).find((t) => t.mode === e)?.id;
14925
- }), f = /* @__PURE__ */ A(() => [...Hh(L(u), i()), ...n() ? [{
14971
+ return L(d).find((t) => t.mode === e)?.id;
14972
+ }), p = /* @__PURE__ */ A(() => [...Hh(L(d), i()), ...n() ? [{
14926
14973
  id: Dh,
14927
- label: L(l).delete,
14974
+ label: L(u).delete,
14928
14975
  icon: kh[Dh],
14929
14976
  kbd: i() ? Km("delete") : void 0,
14930
14977
  group: Dh,
14931
14978
  tone: "danger",
14932
- disabled: L(o).get() === 0
14933
- }] : []]), p = /* @__PURE__ */ A(() => r() ? [{
14979
+ disabled: L(o).get() === 0 || L(s).get()
14980
+ }] : []]), m = /* @__PURE__ */ A(() => r() ? [{
14934
14981
  id: Oh,
14935
- label: L(l).snapping,
14982
+ label: L(u).snapping,
14936
14983
  icon: kh[Oh],
14937
- on: L(s).get(),
14938
- onchange: () => L(c)?.toggle()
14984
+ on: L(c).get(),
14985
+ onchange: () => L(l)?.toggle()
14939
14986
  }] : []);
14940
- function m(e) {
14987
+ function h(e) {
14941
14988
  if (n() && e === "delete") {
14942
14989
  t.draw.selection.delete();
14943
14990
  return;
14944
14991
  }
14945
- let r = L(u).find((t) => t.id === e);
14992
+ let r = L(d).find((t) => t.id === e);
14946
14993
  r && t.draw.setMode(r.mode);
14947
14994
  }
14948
- var h = oy(), g = P(h);
14949
- ju(g, {
14995
+ var g = oy(), _ = P(g);
14996
+ ju(_, {
14950
14997
  get label() {
14951
- return L(l).toolbar;
14998
+ return L(u).toolbar;
14952
14999
  },
14953
15000
  get tools() {
14954
- return L(f);
15001
+ return L(p);
14955
15002
  },
14956
15003
  get toggles() {
14957
- return L(p);
15004
+ return L(m);
14958
15005
  },
14959
15006
  get current() {
14960
- return L(d);
15007
+ return L(f);
14961
15008
  },
14962
- onselect: m
15009
+ onselect: h
14963
15010
  });
14964
- var _ = F(g, 2), v = (e) => {
15011
+ var v = F(_, 2), y = (e) => {
14965
15012
  Ca(ay(e, {
14966
15013
  get draw() {
14967
15014
  return t.draw;
14968
15015
  },
14969
15016
  get messages() {
14970
- return L(l);
15017
+ return L(u);
14971
15018
  },
14972
15019
  get label() {
14973
- return L(l).snapping;
15020
+ return L(u).snapping;
14974
15021
  }
14975
- }), (e) => M(c, e, !0), () => L(c));
15022
+ }), (e) => M(l, e, !0), () => L(l));
14976
15023
  };
14977
- U(_, (e) => {
14978
- r() && e(v);
14979
- }), V(e, h), k();
15024
+ U(v, (e) => {
15025
+ r() && e(y);
15026
+ }), V(e, g), k();
14980
15027
  }
14981
15028
  //#endregion
14982
15029
  //#region src/components/DrawUI.svelte
@@ -15097,7 +15144,7 @@ function dy(e, t) {
15097
15144
  run: () => {
15098
15145
  M(b, !L(b));
15099
15146
  }
15100
- }] : []), ee = /* @__PURE__ */ A(() => t.actions.list.get()), C = /* @__PURE__ */ A(() => t.actionsTitle ?? L(g).actions), w = /* @__PURE__ */ A(() => a() && L(ee).length > 0 ? $h(t.actions, L(C)) : []), te = /* @__PURE__ */ j(null);
15147
+ }] : []), C = /* @__PURE__ */ A(() => t.actions.list.get()), w = /* @__PURE__ */ A(() => t.actionsTitle ?? L(g).actions), ee = /* @__PURE__ */ A(() => a() && L(C).length > 0 ? $h(t.actions, L(w)) : []), te = /* @__PURE__ */ j(null);
15101
15148
  zn(() => {
15102
15149
  let e = L(te) ? { ...L(te).inset } : {
15103
15150
  top: 0,
@@ -15120,7 +15167,7 @@ function dy(e, t) {
15120
15167
  let e = /* @__PURE__ */ A(() => L(d) && L(f) ? L(g).basemap : L(g).inspector), t = /* @__PURE__ */ A(() => [
15121
15168
  ...L(v),
15122
15169
  ...L(S),
15123
- ...L(w)
15170
+ ...L(ee)
15124
15171
  ]), a = /* @__PURE__ */ A(() => L(y) ? r : void 0), s = /* @__PURE__ */ A(() => L(l) || L(d) ? i : void 0), c = /* @__PURE__ */ A(() => L(_) ? n : void 0);
15125
15172
  Sh(ce, {
15126
15173
  overlay: !0,
@@ -15209,7 +15256,7 @@ function dy(e, t) {
15209
15256
  return L(g);
15210
15257
  },
15211
15258
  get title() {
15212
- return L(C);
15259
+ return L(w);
15213
15260
  },
15214
15261
  get keys() {
15215
15262
  return a();
@@ -15233,7 +15280,7 @@ function dy(e, t) {
15233
15280
  }
15234
15281
  };
15235
15282
  U(pe, (e) => {
15236
- L(ee).length > 0 && e(me);
15283
+ L(C).length > 0 && e(me);
15237
15284
  });
15238
15285
  var he = F(pe, 2), ge = (e) => {
15239
15286
  var n = ly(), r = N(n);
@@ -15307,81 +15354,98 @@ var py = "data-mgd-ui-lift", my = (e, t, n) => ({
15307
15354
  bottom: e.bottom + n
15308
15355
  }), hy = (e, t) => e.left < t.right && t.left < e.right, gy = (e, t) => e.top < t.bottom && t.top < e.bottom;
15309
15356
  function _y(e, t) {
15310
- let n = !1, r, i = [], a = {
15357
+ let n = !1, r, i = 0, a = [], o = {
15311
15358
  top: 0,
15312
15359
  right: 0,
15313
15360
  bottom: 0,
15314
15361
  left: 0
15315
- }, o = {
15362
+ }, s = {
15316
15363
  left: 0,
15317
15364
  right: 0,
15318
15365
  shift: 0
15319
- }, s = "";
15366
+ }, c = "";
15320
15367
  e.setAttribute(py, "");
15321
- let c = (t) => e.querySelector(`:scope > .maplibregl-control-container > .maplibregl-ctrl-bottom-${t}`), l = () => t.querySelector("[data-region=\"bottom\"] [data-role=\"drawbar\"]"), u = () => c("right")?.querySelector(":scope > .maplibregl-ctrl-attrib") ?? null, d = () => t.querySelector("[data-role=\"shell\"] [data-region=\"right\"]"), f = () => [...c("right")?.querySelectorAll(":scope > .maplibregl-ctrl:not(.maplibregl-ctrl-attrib)") ?? []];
15322
- function p() {
15368
+ let l = (t) => e.querySelector(`:scope > .maplibregl-control-container > .maplibregl-ctrl-bottom-${t}`), u = () => t.querySelector("[data-region=\"bottom\"] [data-role=\"drawbar\"]"), d = () => l("right")?.querySelector(":scope > .maplibregl-ctrl-attrib") ?? null, f = () => t.querySelector("[data-role=\"shell\"] [data-region=\"right\"]"), p = () => [...l("right")?.querySelectorAll(":scope > .maplibregl-ctrl:not(.maplibregl-ctrl-attrib)") ?? []];
15369
+ function m() {
15323
15370
  let e = document.createElement("div");
15324
15371
  e.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;height:0;width:var(--kata-gap-md)", t.appendChild(e);
15325
15372
  let n = e.getBoundingClientRect().width;
15326
15373
  return e.remove(), n;
15327
15374
  }
15328
- function m(t, n, r) {
15329
- o = {
15375
+ function h(t, n, r) {
15376
+ s = {
15330
15377
  left: t,
15331
15378
  right: n,
15332
15379
  shift: r
15333
15380
  };
15334
15381
  let i = `${t} ${n} ${r}`;
15335
- i !== s && (s = i, e.style.setProperty("--mgd-ui-lift-left", `${t}px`), e.style.setProperty("--mgd-ui-lift-right", `${n}px`), e.style.setProperty("--mgd-ui-shift-right", `${r}px`));
15382
+ i !== c && (c = i, e.style.setProperty("--mgd-ui-lift-left", `${t}px`), e.style.setProperty("--mgd-ui-lift-right", `${n}px`), e.style.setProperty("--mgd-ui-shift-right", `${r}px`));
15336
15383
  }
15337
- function h() {
15338
- if (n) return;
15339
- if (!e.isConnected) {
15340
- m(0, 0, 0);
15341
- return;
15342
- }
15343
- let t = e.getBoundingClientRect(), r = (e) => {
15344
- let t = c(e);
15384
+ function g() {
15385
+ if (!e.isConnected) return {
15386
+ left: 0,
15387
+ right: 0,
15388
+ shift: 0
15389
+ };
15390
+ let t = e.getBoundingClientRect(), n = (e) => {
15391
+ let t = l(e);
15345
15392
  if (!t) return null;
15346
15393
  let n = t.getBoundingClientRect();
15347
- return n.width === 0 ? null : my(n, 0, e === "left" ? o.left : o.right);
15348
- }, i = r("left"), s = r("right"), h = l()?.getBoundingClientRect(), g = h && h.width > 0 && h.height > 0 ? h : null, _ = g ? Math.round(Math.max(0, Math.min(t.bottom - g.top, t.height))) : 0, v = (e) => !!e && !!g && hy(e, g), y = v(s) ? _ : 0, b = 0, x = f().map((e) => e.getBoundingClientRect()).filter((e) => e.width > 0 && e.height > 0).map((e) => my(e, o.shift, o.right)), S = a.right > 0 ? d()?.getBoundingClientRect() : void 0;
15349
- if (S && S.width > 0 && x.length > 0) {
15394
+ return n.width === 0 ? null : my(n, 0, e === "left" ? s.left : s.right);
15395
+ }, r = n("left"), i = n("right"), a = u()?.getBoundingClientRect(), c = a && a.width > 0 && a.height > 0 ? a : null, h = c ? Math.round(Math.max(0, Math.min(t.bottom - c.top, t.height))) : 0, g = (e) => !!e && !!c && hy(e, c), _ = g(i) ? h : 0, v = 0, y = p().map((e) => e.getBoundingClientRect()).filter((e) => e.width > 0 && e.height > 0).map((e) => my(e, s.shift, s.right)), b = o.right > 0 ? f()?.getBoundingClientRect() : void 0;
15396
+ if (b && b.width > 0 && y.length > 0) {
15350
15397
  let e = {
15351
- left: Math.min(...x.map((e) => e.left)),
15352
- right: Math.max(...x.map((e) => e.right)),
15353
- top: Math.min(...x.map((e) => e.top)),
15354
- bottom: Math.max(...x.map((e) => e.bottom))
15398
+ left: Math.min(...y.map((e) => e.left)),
15399
+ right: Math.max(...y.map((e) => e.right)),
15400
+ top: Math.min(...y.map((e) => e.top)),
15401
+ bottom: Math.max(...y.map((e) => e.bottom))
15355
15402
  };
15356
- gy(my(e, 0, -y), S) && (b = Math.round(a.right + p()), y === 0 && v(my(e, -b, 0)) && (y = _));
15403
+ gy(my(e, 0, -_), b) && (v = Math.round(o.right + m()), _ === 0 && g(my(e, -v, 0)) && (_ = h));
15357
15404
  }
15358
- let ee = v(i) ? _ : 0, C = u()?.getBoundingClientRect();
15359
- if (i && C && C.width > 0 && C.height > 0) {
15360
- let e = my(C, 0, o.right - y), t = my(i, 0, -ee);
15361
- hy(e, t) && gy(e, t) && (ee = Math.round(i.bottom - e.top));
15405
+ let x = g(r) ? h : 0, S = d()?.getBoundingClientRect();
15406
+ if (r && S && S.width > 0 && S.height > 0) {
15407
+ let e = my(S, 0, s.right - _), t = my(r, 0, -x);
15408
+ hy(e, t) && gy(e, t) && (x = Math.round(r.bottom - e.top));
15362
15409
  }
15363
- m(Math.max(0, ee), y, b);
15410
+ return {
15411
+ left: Math.max(0, x),
15412
+ right: _,
15413
+ shift: v
15414
+ };
15364
15415
  }
15365
- function g() {
15416
+ function _() {
15417
+ if (n) return;
15418
+ i && cancelAnimationFrame(i), i = 0;
15419
+ let e = g();
15420
+ h(e.left, e.right, e.shift);
15421
+ }
15422
+ function v() {
15423
+ if (n) return;
15424
+ let e = g();
15425
+ i && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
15426
+ i = 0, n || h(e.left, e.right, e.shift);
15427
+ });
15428
+ }
15429
+ function y() {
15366
15430
  let t = [
15367
15431
  e,
15368
- l(),
15369
- c("left"),
15370
- c("right"),
15371
15432
  u(),
15372
- a.right > 0 ? d() : null
15433
+ l("left"),
15434
+ l("right"),
15435
+ d(),
15436
+ o.right > 0 ? f() : null
15373
15437
  ].filter((e) => !!e);
15374
- if (!(t.length === i.length && t.every((e, t) => e === i[t])) && (r?.disconnect(), i = t, !(typeof ResizeObserver > "u"))) {
15375
- r ??= new ResizeObserver(h);
15376
- for (let e of i) r.observe(e);
15438
+ if (!(t.length === a.length && t.every((e, t) => e === a[t])) && (r?.disconnect(), a = t, !(typeof ResizeObserver > "u"))) {
15439
+ r ??= new ResizeObserver(v);
15440
+ for (let e of a) r.observe(e);
15377
15441
  }
15378
15442
  }
15379
15443
  return {
15380
15444
  update(e) {
15381
- n || (e && (a = { ...e }), g(), h());
15445
+ n || (e && (o = { ...e }), y(), _());
15382
15446
  },
15383
15447
  destroy() {
15384
- n || (n = !0, r?.disconnect(), r = void 0, i = [], e.removeAttribute(py), e.style.removeProperty("--mgd-ui-lift-left"), e.style.removeProperty("--mgd-ui-lift-right"), e.style.removeProperty("--mgd-ui-shift-right"));
15448
+ n || (n = !0, i && cancelAnimationFrame(i), i = 0, r?.disconnect(), r = void 0, a = [], e.removeAttribute(py), e.style.removeProperty("--mgd-ui-lift-left"), e.style.removeProperty("--mgd-ui-lift-right"), e.style.removeProperty("--mgd-ui-shift-right"));
15385
15449
  }
15386
15450
  };
15387
15451
  }
@@ -15535,21 +15599,21 @@ function ky(e, t = {}) {
15535
15599
  [e]: e === "layers" && null
15536
15600
  };
15537
15601
  s.set(n.layers || n.legend ? n : null);
15538
- }, ee = {
15602
+ }, C = {
15539
15603
  get element() {
15540
15604
  return p.querySelector("[data-role=\"layer-panel\"]") ?? p;
15541
15605
  },
15542
15606
  destroy() {
15543
15607
  S("layers");
15544
15608
  }
15545
- }, C = {
15609
+ }, w = {
15546
15610
  get element() {
15547
15611
  return p.querySelector("[data-role=\"legend\"]") ?? p;
15548
15612
  },
15549
15613
  destroy() {
15550
15614
  S("legend");
15551
15615
  }
15552
- }, w = {
15616
+ }, ee = {
15553
15617
  get element() {
15554
15618
  return p.querySelector("[data-role=\"drawbar\"]") ?? p;
15555
15619
  },
@@ -15568,7 +15632,7 @@ function ky(e, t = {}) {
15568
15632
  return {
15569
15633
  element: p,
15570
15634
  get toolbar() {
15571
- return !x && o.get() ? w : null;
15635
+ return !x && o.get() ? ee : null;
15572
15636
  },
15573
15637
  get inspector() {
15574
15638
  return !x && c.get() ? te : null;
@@ -15576,10 +15640,10 @@ function ky(e, t = {}) {
15576
15640
  tools: Oy(i, a, u),
15577
15641
  actions: Qh(u, i, a),
15578
15642
  get layers() {
15579
- return !x && s.get()?.layers ? ee : null;
15643
+ return !x && s.get()?.layers ? C : null;
15580
15644
  },
15581
15645
  get legend() {
15582
- return !x && s.get()?.legend ? C : null;
15646
+ return !x && s.get()?.legend ? w : null;
15583
15647
  },
15584
15648
  setLocale(e) {
15585
15649
  x || Dy(p, a, e);