bank20baht-ui 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,22 @@
1
- import { t as m, d as Wt, p as It, i as ve, f as At, a as me, b as xt, c as le, r as Jt, v as Gt, e as ye, g as $e, h as ge } from "./chunks/index-BI-29Q8f.js";
2
- import { j as Pa, k as ka, l as Ca, m as Da, n as Ea, o as ja, q as Ba, s as Sa, u as Fa, w as Na } from "./chunks/index-BI-29Q8f.js";
3
- import { LitElement as we, nothing as h, html as l, svg as D } from "lit";
4
- import { property as n, query as tt, customElement as p, state as f } from "lit/decorators.js";
1
+ import { t as m, d as Jt, p as It, i as me, f as At, a as ye, b as xt, c as ne, r as Gt, v as Yt, e as $e, g as ge, h as we } from "./chunks/index-BI-29Q8f.js";
2
+ import { j as Ca, k as Da, l as Ea, m as ja, n as Ba, o as Sa, q as Fa, s as Na, u as Ia, w as qa } from "./chunks/index-BI-29Q8f.js";
3
+ import { LitElement as _e, nothing as h, html as l, svg as D } from "lit";
4
+ import { property as n, query as et, customElement as c, state as b } from "lit/decorators.js";
5
+ import { a as Vt } from "./chunks/motion-BRVCzB4Z.js";
5
6
  import { live as S } from "lit/directives/live.js";
6
7
  import { ifDefined as O } from "lit/directives/if-defined.js";
7
- import _e from "flatpickr";
8
- var xe = Object.defineProperty, et = (t, e, a, i) => {
8
+ import xe from "flatpickr";
9
+ var Oe = Object.defineProperty, st = (t, e, a, i) => {
9
10
  for (var s = void 0, r = t.length - 1, o; r >= 0; r--)
10
11
  (o = t[r]) && (s = o(e, a, s) || s);
11
- return s && xe(e, a, s), s;
12
+ return s && Oe(e, a, s), s;
12
13
  };
13
- class d extends we {
14
+ class d extends _e {
14
15
  createRenderRoot() {
15
16
  return this;
16
17
  }
17
18
  }
18
- function st(t, e) {
19
+ function at(t, e) {
19
20
  let a = e;
20
21
  for (; a.parentNode && a.parentNode !== t; ) a = a.parentNode;
21
22
  const i = Array.from(t.childNodes).filter(
@@ -23,10 +24,10 @@ function st(t, e) {
23
24
  );
24
25
  i.length > 0 && e.append(...i);
25
26
  }
26
- let Oe = 0;
27
+ let Pe = 0;
27
28
  class g extends d {
28
29
  constructor() {
29
- super(...arguments), this.uid = ++Oe, this.value = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.error = null;
30
+ super(...arguments), this.uid = ++Pe, this.value = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.error = null;
30
31
  }
31
32
  /** Emit the user's edit upward (composed so it crosses any boundary). */
32
33
  emitInput(e) {
@@ -75,25 +76,25 @@ class g extends d {
75
76
  ` : h;
76
77
  }
77
78
  }
78
- et([
79
+ st([
79
80
  n({ attribute: !1 })
80
81
  ], g.prototype, "field");
81
- et([
82
+ st([
82
83
  n({ attribute: !1 })
83
84
  ], g.prototype, "value");
84
- et([
85
+ st([
85
86
  n({ type: Boolean })
86
87
  ], g.prototype, "disabled");
87
- et([
88
+ st([
88
89
  n({ type: Boolean })
89
90
  ], g.prototype, "readonly");
90
- et([
91
+ st([
91
92
  n({ type: Boolean })
92
93
  ], g.prototype, "required");
93
- et([
94
+ st([
94
95
  n({ attribute: !1 })
95
96
  ], g.prototype, "error");
96
- const ne = {
97
+ const he = {
97
98
  copy: D`<rect x="6" y="6" width="8" height="8" rx="1.5"/><path d="M10 6V4.5A1.5 1.5 0 0 0 8.5 3H4.5A1.5 1.5 0 0 0 3 4.5v4A1.5 1.5 0 0 0 4.5 10H6"/>`,
98
99
  check: D`<path d="M3.5 8.5 6.5 11.5 12.5 4.5"/>`,
99
100
  download: D`<path d="M8 3v7m0 0 3-3m-3 3L5 7"/><path d="M3 12h10"/>`,
@@ -104,7 +105,7 @@ const ne = {
104
105
  play: D`<path d="M5 3.5v9l7-4.5z"/>`,
105
106
  search: D`<circle cx="7" cy="7" r="4"/><path d="m13 13-3.2-3.2"/>`
106
107
  };
107
- function W(t) {
108
+ function J(t) {
108
109
  return l`<svg
109
110
  class="baht-icon"
110
111
  width="16"
@@ -116,25 +117,25 @@ function W(t) {
116
117
  stroke-linecap="round"
117
118
  stroke-linejoin="round"
118
119
  aria-hidden="true"
119
- >${ne[t]}</svg>`;
120
+ >${he[t]}</svg>`;
120
121
  }
121
- function Pe(t) {
122
- return t in ne;
122
+ function ke(t) {
123
+ return t in he;
123
124
  }
124
- var ke = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, F = (t, e, a, i) => {
125
- for (var s = i > 1 ? void 0 : i ? Ce(e, a) : e, r = t.length - 1, o; r >= 0; r--)
125
+ var Ce = Object.defineProperty, De = Object.getOwnPropertyDescriptor, F = (t, e, a, i) => {
126
+ for (var s = i > 1 ? void 0 : i ? De(e, a) : e, r = t.length - 1, o; r >= 0; r--)
126
127
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
127
- return i && s && ke(e, a, s), s;
128
+ return i && s && Ce(e, a, s), s;
128
129
  };
129
130
  let E = class extends d {
130
131
  constructor() {
131
132
  super(...arguments), this.variant = "primary", this.size = "md", this.disabled = !1, this.type = "button", this.label = "", this.icon = "", this.iconOnly = !1;
132
133
  }
133
134
  firstUpdated() {
134
- this.iconOnly || st(this, this.buttonEl);
135
+ this.iconOnly || at(this, this.buttonEl);
135
136
  }
136
137
  render() {
137
- const t = this.variant === "primary" ? "" : ` baht-button--${this.variant}`, e = this.size === "md" ? "" : ` baht-button--${this.size}`, a = this.iconOnly ? " baht-button--icon" : "", i = this.icon && Pe(this.icon) ? W(this.icon) : h;
138
+ const t = this.variant === "primary" ? "" : ` baht-button--${this.variant}`, e = this.size === "md" ? "" : ` baht-button--${this.size}`, a = this.iconOnly ? " baht-button--icon" : "", i = this.icon && ke(this.icon) ? J(this.icon) : h;
138
139
  return l`<button
139
140
  class="baht-button${t}${e}${a}"
140
141
  type=${this.type}
@@ -165,15 +166,15 @@ F([
165
166
  n({ type: Boolean, attribute: "icon-only" })
166
167
  ], E.prototype, "iconOnly", 2);
167
168
  F([
168
- tt("button")
169
+ et("button")
169
170
  ], E.prototype, "buttonEl", 2);
170
171
  E = F([
171
- p("baht-button")
172
+ c("baht-button")
172
173
  ], E);
173
- var De = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, Ct = (t, e, a, i) => {
174
- for (var s = i > 1 ? void 0 : i ? Ee(e, a) : e, r = t.length - 1, o; r >= 0; r--)
174
+ var Ee = Object.defineProperty, je = Object.getOwnPropertyDescriptor, Ct = (t, e, a, i) => {
175
+ for (var s = i > 1 ? void 0 : i ? je(e, a) : e, r = t.length - 1, o; r >= 0; r--)
175
176
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
176
- return i && s && De(e, a, s), s;
177
+ return i && s && Ee(e, a, s), s;
177
178
  };
178
179
  let ht = class extends d {
179
180
  constructor() {
@@ -199,12 +200,12 @@ Ct([
199
200
  n({ attribute: !1 })
200
201
  ], ht.prototype, "dot", 2);
201
202
  ht = Ct([
202
- p("baht-badge")
203
+ c("baht-badge")
203
204
  ], ht);
204
- var je = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, Vt = (t, e, a, i) => {
205
- for (var s = i > 1 ? void 0 : i ? Be(e, a) : e, r = t.length - 1, o; r >= 0; r--)
205
+ var Be = Object.defineProperty, Se = Object.getOwnPropertyDescriptor, Kt = (t, e, a, i) => {
206
+ for (var s = i > 1 ? void 0 : i ? Se(e, a) : e, r = t.length - 1, o; r >= 0; r--)
206
207
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
207
- return i && s && je(e, a, s), s;
208
+ return i && s && Be(e, a, s), s;
208
209
  };
209
210
  let Ot = class extends d {
210
211
  constructor() {
@@ -212,25 +213,25 @@ let Ot = class extends d {
212
213
  }
213
214
  firstUpdated() {
214
215
  const t = this.renderRoot.querySelector(this.variant === "block" ? "pre" : "code");
215
- t && st(this, t);
216
+ t && at(this, t);
216
217
  }
217
218
  render() {
218
219
  return this.variant === "block" ? l`<pre class="baht-code baht-code--block" tabindex="0">${this.code}</pre>` : l`<code class="baht-code">${this.code}</code>`;
219
220
  }
220
221
  };
221
- Vt([
222
+ Kt([
222
223
  n()
223
224
  ], Ot.prototype, "variant", 2);
224
- Vt([
225
+ Kt([
225
226
  n()
226
227
  ], Ot.prototype, "code", 2);
227
- Ot = Vt([
228
- p("baht-code")
228
+ Ot = Kt([
229
+ c("baht-code")
229
230
  ], Ot);
230
- var Se = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, U = (t, e, a, i) => {
231
- for (var s = i > 1 ? void 0 : i ? Fe(e, a) : e, r = t.length - 1, o; r >= 0; r--)
231
+ var Fe = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, U = (t, e, a, i) => {
232
+ for (var s = i > 1 ? void 0 : i ? Ne(e, a) : e, r = t.length - 1, o; r >= 0; r--)
232
233
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
233
- return i && s && Se(e, a, s), s;
234
+ return i && s && Fe(e, a, s), s;
234
235
  };
235
236
  let N = class extends d {
236
237
  constructor() {
@@ -258,12 +259,12 @@ let N = class extends d {
258
259
  /** Visible page numbers with `null` marking an ellipsis gap. */
259
260
  get pageItems() {
260
261
  const { page: t, totalPages: e, siblings: a } = this, i = /* @__PURE__ */ new Set([1, e]);
261
- for (let c = t - a; c <= t + a; c++)
262
- c >= 1 && c <= e && i.add(c);
263
- const s = [...i].sort((c, b) => c - b), r = [];
262
+ for (let p = t - a; p <= t + a; p++)
263
+ p >= 1 && p <= e && i.add(p);
264
+ const s = [...i].sort((p, f) => p - f), r = [];
264
265
  let o = 0;
265
- for (const c of s)
266
- o && c - o === 2 ? r.push(o + 1) : o && c - o > 2 && r.push(null), r.push(c), o = c;
266
+ for (const p of s)
267
+ o && p - o === 2 ? r.push(o + 1) : o && p - o > 2 && r.push(null), r.push(p), o = p;
267
268
  return r;
268
269
  }
269
270
  render() {
@@ -305,14 +306,14 @@ U([
305
306
  n({ type: Boolean, attribute: "has-prev" })
306
307
  ], N.prototype, "hasPrev", 2);
307
308
  N = U([
308
- p("baht-pagination")
309
+ c("baht-pagination")
309
310
  ], N);
310
- var Ne = Object.defineProperty, Ie = Object.getOwnPropertyDescriptor, v = (t, e, a, i) => {
311
- for (var s = i > 1 ? void 0 : i ? Ie(e, a) : e, r = t.length - 1, o; r >= 0; r--)
311
+ var Ie = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, v = (t, e, a, i) => {
312
+ for (var s = i > 1 ? void 0 : i ? qe(e, a) : e, r = t.length - 1, o; r >= 0; r--)
312
313
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
313
- return i && s && Ne(e, a, s), s;
314
+ return i && s && Ie(e, a, s), s;
314
315
  };
315
- const qe = " › ", qt = (t) => t !== null && typeof t == "object" && !Array.isArray(t) && !(t instanceof Date), _t = (t) => t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
316
+ const Ae = " › ", qt = (t) => t !== null && typeof t == "object" && !Array.isArray(t) && !(t instanceof Date), _t = (t) => t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
316
317
  let u = class extends d {
317
318
  constructor() {
318
319
  super(...arguments), this.items = [], this.columns = {}, this.loading = !1, this.error = !1, this.errorMessage = "Couldn't load data. Try again.", this.emptyMessage = "No records yet.", this.showIndex = !0, this.indexOffset = 0, this.skeletonRows = 10, this.rowKey = "", this.clickable = !0, this.renderers = {}, this.visibleColumns = [], this.columnPicker = !0, this.page = 1, this.totalPages = 1, this.cursorMode = !1, this.hasNext = !1, this.hasPrev = !1, this.pickerOpen = !1, this.pickedColumns = null, this.draftColumns = [], this.pickAvail = [], this.pickSel = [], this.expanded = [], this.onPickerKeydown = (t) => {
@@ -380,7 +381,7 @@ let u = class extends d {
380
381
  }
381
382
  e.push(typeof s == "string" ? s : s.label), a = typeof s == "string" ? void 0 : s.fields;
382
383
  }
383
- return e.join(qe);
384
+ return e.join(Ae);
384
385
  }
385
386
  /** The row's value at a dotted key (`requester.department`). */
386
387
  static valueAt(t, e) {
@@ -649,30 +650,30 @@ v([
649
650
  n({ type: Boolean, attribute: "has-prev" })
650
651
  ], u.prototype, "hasPrev", 2);
651
652
  v([
652
- f()
653
+ b()
653
654
  ], u.prototype, "pickerOpen", 2);
654
655
  v([
655
- f()
656
+ b()
656
657
  ], u.prototype, "pickedColumns", 2);
657
658
  v([
658
- f()
659
+ b()
659
660
  ], u.prototype, "draftColumns", 2);
660
661
  v([
661
- f()
662
+ b()
662
663
  ], u.prototype, "pickAvail", 2);
663
664
  v([
664
- f()
665
+ b()
665
666
  ], u.prototype, "pickSel", 2);
666
667
  v([
667
- f()
668
+ b()
668
669
  ], u.prototype, "expanded", 2);
669
670
  u = v([
670
- p("baht-table")
671
+ c("baht-table")
671
672
  ], u);
672
- var Ae = Object.defineProperty, Me = Object.getOwnPropertyDescriptor, M = (t, e, a, i) => {
673
- for (var s = i > 1 ? void 0 : i ? Me(e, a) : e, r = t.length - 1, o; r >= 0; r--)
673
+ var Me = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, M = (t, e, a, i) => {
674
+ for (var s = i > 1 ? void 0 : i ? Re(e, a) : e, r = t.length - 1, o; r >= 0; r--)
674
675
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
675
- return i && s && Ae(e, a, s), s;
676
+ return i && s && Me(e, a, s), s;
676
677
  };
677
678
  let j = class extends d {
678
679
  constructor() {
@@ -741,16 +742,16 @@ M([
741
742
  n({ type: Boolean })
742
743
  ], j.prototype, "clickable", 2);
743
744
  j = M([
744
- p("baht-list")
745
+ c("baht-list")
745
746
  ], j);
746
- var Re = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, at = (t, e, a, i) => {
747
- for (var s = i > 1 ? void 0 : i ? Le(e, a) : e, r = t.length - 1, o; r >= 0; r--)
747
+ var Le = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, z = (t, e, a, i) => {
748
+ for (var s = i > 1 ? void 0 : i ? Te(e, a) : e, r = t.length - 1, o; r >= 0; r--)
748
749
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
749
- return i && s && Re(e, a, s), s;
750
+ return i && s && Le(e, a, s), s;
750
751
  };
751
752
  let x = class extends d {
752
753
  constructor() {
753
- super(...arguments), this.open = !1, this.heading = "", this.showClose = !0, this.closeOnScrim = !0, this.previousFocus = null, this.onKeydown = (t) => {
754
+ super(...arguments), this.open = !1, this.heading = "", this.showClose = !0, this.closeOnScrim = !0, this.closing = !1, this.closeToken = 0, this.previousFocus = null, this.onKeydown = (t) => {
754
755
  !this.open || x.openStack.at(-1) !== this || (t.key === "Escape" ? this.requestClose("escape") : t.key === "Tab" && this.trapFocus(t));
755
756
  };
756
757
  }
@@ -783,11 +784,20 @@ let x = class extends d {
783
784
  document.removeEventListener("keydown", this.onKeydown), x.openStack = x.openStack.filter((t) => t !== this), super.disconnectedCallback();
784
785
  }
785
786
  firstUpdated() {
786
- st(this, this.bodyEl);
787
+ at(this, this.bodyEl);
788
+ }
789
+ willUpdate(t) {
790
+ t.has("open") && (this.open ? this.closing = !1 : t.get("open") === !0 && (this.closing = !0));
787
791
  }
788
792
  updated(t) {
789
793
  var e, a;
790
- if (t.has("open") && (x.openStack = x.openStack.filter((i) => i !== this), this.open && x.openStack.push(this)), t.has("open") && this.open && (this.previousFocus = document.activeElement, (e = this.querySelector(".baht-modal")) == null || e.focus()), t.has("open") && !this.open && t.get("open") === !0) {
794
+ if (t.has("open") && (x.openStack = x.openStack.filter((i) => i !== this), this.open && x.openStack.push(this)), t.has("open") && !this.open && this.closing) {
795
+ const i = ++this.closeToken, s = this.querySelector(".baht-modal-scrim"), r = () => {
796
+ i === this.closeToken && !this.open && (this.closing = !1);
797
+ };
798
+ s ? Vt(s, r) : r();
799
+ }
800
+ if (t.has("open") && this.open && (this.previousFocus = document.activeElement, (e = this.querySelector(".baht-modal")) == null || e.focus()), t.has("open") && !this.open && t.get("open") === !0) {
791
801
  const i = this.previousFocus;
792
802
  this.previousFocus = null, i != null && i.isConnected && (!document.activeElement || document.activeElement === document.body || this.contains(document.activeElement)) && ((a = i.focus) == null || a.call(i));
793
803
  }
@@ -800,8 +810,8 @@ let x = class extends d {
800
810
  }
801
811
  render() {
802
812
  return l`<div
803
- class="baht-modal-scrim"
804
- style=${this.open ? h : "display:none"}
813
+ class="baht-modal-scrim${this.closing ? " baht-modal-scrim--closing" : ""}"
814
+ style=${this.open || this.closing ? h : "display:none"}
805
815
  @click=${(t) => this.closeOnScrim && t.target === t.currentTarget && this.requestClose("scrim")}
806
816
  >
807
817
  <div class="baht-modal" role="dialog" aria-modal="true" aria-label=${this.heading || "Dialog"} tabindex="-1">
@@ -815,36 +825,39 @@ let x = class extends d {
815
825
  }
816
826
  };
817
827
  x.openStack = [];
818
- at([
828
+ z([
819
829
  n({ type: Boolean, reflect: !0 })
820
830
  ], x.prototype, "open", 2);
821
- at([
831
+ z([
822
832
  n()
823
833
  ], x.prototype, "heading", 2);
824
- at([
834
+ z([
825
835
  n({ type: Boolean, attribute: "show-close" })
826
836
  ], x.prototype, "showClose", 2);
827
- at([
837
+ z([
828
838
  n({ type: Boolean, attribute: "close-on-scrim" })
829
839
  ], x.prototype, "closeOnScrim", 2);
830
- at([
831
- tt(".baht-modal-body")
840
+ z([
841
+ et(".baht-modal-body")
832
842
  ], x.prototype, "bodyEl", 2);
833
- x = at([
834
- p("baht-modal")
843
+ z([
844
+ b()
845
+ ], x.prototype, "closing", 2);
846
+ x = z([
847
+ c("baht-modal")
835
848
  ], x);
836
- var Te = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, Kt = (t, e, a, i) => {
837
- for (var s = i > 1 ? void 0 : i ? Ve(e, a) : e, r = t.length - 1, o; r >= 0; r--)
849
+ var Ve = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, Ut = (t, e, a, i) => {
850
+ for (var s = i > 1 ? void 0 : i ? Ke(e, a) : e, r = t.length - 1, o; r >= 0; r--)
838
851
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
839
- return i && s && Te(e, a, s), s;
852
+ return i && s && Ve(e, a, s), s;
840
853
  };
841
- let J = class extends d {
854
+ let G = class extends d {
842
855
  constructor() {
843
856
  super(...arguments), this.duration = 4e3, this.entries = [], this.timers = /* @__PURE__ */ new Map();
844
857
  }
845
858
  show(t) {
846
859
  const e = {
847
- id: ++J.counter,
860
+ id: ++G.counter,
848
861
  message: t.message,
849
862
  tone: t.tone ?? "neutral",
850
863
  duration: t.duration ?? this.duration
@@ -855,14 +868,23 @@ let J = class extends d {
855
868
  ), e.id;
856
869
  }
857
870
  dismiss(t) {
858
- const e = this.entries.find((a) => a.id === t);
859
- e && (clearTimeout(this.timers.get(t)), this.timers.delete(t), this.entries = this.entries.filter((a) => a.id !== t), this.dispatchEvent(
871
+ const e = this.entries.find((s) => s.id === t);
872
+ if (!e || e.leaving) return;
873
+ clearTimeout(this.timers.get(t)), this.timers.delete(t), this.entries = this.entries.map((s) => s.id === t ? { ...s, leaving: !0 } : s), this.dispatchEvent(
860
874
  new CustomEvent("baht-dismiss", {
861
875
  detail: { id: t, message: e.message },
862
876
  bubbles: !0,
863
877
  composed: !0
864
878
  })
865
- ));
879
+ );
880
+ const a = () => {
881
+ this.entries = this.entries.filter((s) => s.id !== t);
882
+ }, i = this.querySelector(`.baht-toast[data-toast="${t}"]`);
883
+ if (!i) {
884
+ a();
885
+ return;
886
+ }
887
+ i.classList.add("baht-toast--leaving"), Vt(i, a);
866
888
  }
867
889
  disconnectedCallback() {
868
890
  this.timers.forEach((t) => clearTimeout(t)), this.timers.clear(), super.disconnectedCallback();
@@ -872,7 +894,8 @@ let J = class extends d {
872
894
  ${this.entries.map(
873
895
  // Danger/warning interrupt (role=alert); the rest ride the polite container.
874
896
  (t) => l`<div
875
- class="baht-toast ${t.tone === "neutral" ? "" : `baht-toast--${t.tone}`}"
897
+ class="baht-toast ${t.tone === "neutral" ? "" : `baht-toast--${t.tone}`}${t.leaving ? " baht-toast--leaving" : ""}"
898
+ data-toast=${t.id}
876
899
  role=${t.tone === "danger" || t.tone === "warning" ? "alert" : h}
877
900
  >
878
901
  <span class="baht-toast-message">${t.message}</span>
@@ -882,20 +905,20 @@ let J = class extends d {
882
905
  </div>`;
883
906
  }
884
907
  };
885
- J.counter = 0;
886
- Kt([
908
+ G.counter = 0;
909
+ Ut([
887
910
  n({ type: Number })
888
- ], J.prototype, "duration", 2);
889
- Kt([
890
- f()
891
- ], J.prototype, "entries", 2);
892
- J = Kt([
893
- p("baht-toast")
894
- ], J);
895
- var Ke = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, vt = (t, e, a, i) => {
896
- for (var s = i > 1 ? void 0 : i ? Ue(e, a) : e, r = t.length - 1, o; r >= 0; r--)
911
+ ], G.prototype, "duration", 2);
912
+ Ut([
913
+ b()
914
+ ], G.prototype, "entries", 2);
915
+ G = Ut([
916
+ c("baht-toast")
917
+ ], G);
918
+ var Ue = Object.defineProperty, ze = Object.getOwnPropertyDescriptor, vt = (t, e, a, i) => {
919
+ for (var s = i > 1 ? void 0 : i ? ze(e, a) : e, r = t.length - 1, o; r >= 0; r--)
897
920
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
898
- return i && s && Ke(e, a, s), s;
921
+ return i && s && Ue(e, a, s), s;
899
922
  };
900
923
  let I = class extends d {
901
924
  constructor() {
@@ -916,7 +939,7 @@ let I = class extends d {
916
939
  t ? (t.setAttribute("aria-describedby", this.tooltipId), this.anchorEl.removeAttribute("tabindex"), this.anchorEl.removeAttribute("aria-describedby")) : (this.anchorEl.setAttribute("tabindex", "0"), this.anchorEl.setAttribute("aria-describedby", this.tooltipId));
917
940
  }
918
941
  firstUpdated() {
919
- st(this, this.anchorEl), this.wireDescribedBy(), setTimeout(() => this.isConnected && this.wireDescribedBy(), 0);
942
+ at(this, this.anchorEl), this.wireDescribedBy(), setTimeout(() => this.isConnected && this.wireDescribedBy(), 0);
920
943
  }
921
944
  onKeydown(t) {
922
945
  t.key === "Escape" && (this.dismissed = !0);
@@ -944,28 +967,36 @@ vt([
944
967
  n()
945
968
  ], I.prototype, "position", 2);
946
969
  vt([
947
- tt(".baht-tooltip-anchor")
970
+ et(".baht-tooltip-anchor")
948
971
  ], I.prototype, "anchorEl", 2);
949
972
  vt([
950
- f()
973
+ b()
951
974
  ], I.prototype, "dismissed", 2);
952
975
  I = vt([
953
- p("baht-tooltip")
976
+ c("baht-tooltip")
954
977
  ], I);
955
- var ze = Object.defineProperty, He = Object.getOwnPropertyDescriptor, it = (t, e, a, i) => {
956
- for (var s = i > 1 ? void 0 : i ? He(e, a) : e, r = t.length - 1, o; r >= 0; r--)
978
+ var He = Object.defineProperty, We = Object.getOwnPropertyDescriptor, it = (t, e, a, i) => {
979
+ for (var s = i > 1 ? void 0 : i ? We(e, a) : e, r = t.length - 1, o; r >= 0; r--)
957
980
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
958
- return i && s && ze(e, a, s), s;
981
+ return i && s && He(e, a, s), s;
959
982
  };
960
983
  let L = class extends d {
961
984
  constructor() {
962
- super(...arguments), this.tone = "info", this.heading = "", this.message = "", this.dismissible = !1, this.dismissed = !1;
985
+ super(...arguments), this.tone = "info", this.heading = "", this.message = "", this.dismissible = !1, this.dismissed = !1, this.generation = 0;
963
986
  }
964
987
  willUpdate(t) {
965
- (t.has("message") || t.has("heading")) && (this.dismissed = !1);
988
+ (t.has("message") || t.has("heading")) && (this.dismissed = !1, this.generation++);
966
989
  }
967
990
  dismiss() {
968
- this.dismissed = !0, this.dispatchEvent(new CustomEvent("baht-dismiss", { bubbles: !0, composed: !0 }));
991
+ this.dispatchEvent(new CustomEvent("baht-dismiss", { bubbles: !0, composed: !0 }));
992
+ const t = this.generation, e = () => {
993
+ t === this.generation && (this.dismissed = !0);
994
+ }, a = this.querySelector(".baht-alert");
995
+ if (!a) {
996
+ e();
997
+ return;
998
+ }
999
+ a.classList.add("baht-alert--leaving"), Vt(a, e);
969
1000
  }
970
1001
  render() {
971
1002
  return this.dismissed ? h : l`<div class="baht-alert baht-alert--${this.tone}" role="alert">
@@ -990,15 +1021,15 @@ it([
990
1021
  n({ type: Boolean })
991
1022
  ], L.prototype, "dismissible", 2);
992
1023
  it([
993
- f()
1024
+ b()
994
1025
  ], L.prototype, "dismissed", 2);
995
1026
  L = it([
996
- p("baht-alert")
1027
+ c("baht-alert")
997
1028
  ], L);
998
- var We = Object.defineProperty, Je = Object.getOwnPropertyDescriptor, rt = (t, e, a, i) => {
999
- for (var s = i > 1 ? void 0 : i ? Je(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1029
+ var Je = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, rt = (t, e, a, i) => {
1030
+ for (var s = i > 1 ? void 0 : i ? Ge(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1000
1031
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1001
- return i && s && We(e, a, s), s;
1032
+ return i && s && Je(e, a, s), s;
1002
1033
  };
1003
1034
  let T = class extends d {
1004
1035
  constructor() {
@@ -1066,15 +1097,15 @@ rt([
1066
1097
  n()
1067
1098
  ], T.prototype, "label", 2);
1068
1099
  rt([
1069
- f()
1100
+ b()
1070
1101
  ], T.prototype, "hover", 2);
1071
1102
  T = rt([
1072
- p("baht-rating")
1103
+ c("baht-rating")
1073
1104
  ], T);
1074
- var Ge = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, R = (t, e, a, i) => {
1075
- for (var s = i > 1 ? void 0 : i ? Ye(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1105
+ var Ye = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, R = (t, e, a, i) => {
1106
+ for (var s = i > 1 ? void 0 : i ? Qe(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1076
1107
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1077
- return i && s && Ge(e, a, s), s;
1108
+ return i && s && Ye(e, a, s), s;
1078
1109
  };
1079
1110
  let k = class extends d {
1080
1111
  constructor() {
@@ -1132,12 +1163,12 @@ R([
1132
1163
  n({ type: Boolean, attribute: "show-value" })
1133
1164
  ], k.prototype, "showValue", 2);
1134
1165
  k = R([
1135
- p("baht-range")
1166
+ c("baht-range")
1136
1167
  ], k);
1137
- var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, ot = (t, e, a, i) => {
1138
- for (var s = i > 1 ? void 0 : i ? Xe(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1168
+ var Xe = Object.defineProperty, Ze = Object.getOwnPropertyDescriptor, ot = (t, e, a, i) => {
1169
+ for (var s = i > 1 ? void 0 : i ? Ze(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1139
1170
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1140
- return i && s && Qe(e, a, s), s;
1171
+ return i && s && Xe(e, a, s), s;
1141
1172
  };
1142
1173
  let V = class extends d {
1143
1174
  constructor() {
@@ -1186,8 +1217,8 @@ let V = class extends d {
1186
1217
  var r, o;
1187
1218
  const a = e.target, i = this.clean(a.value);
1188
1219
  if (i.length > 1) {
1189
- const c = this.fill(t, i);
1190
- a.value = this._chars[t] ?? "", this.commit(), (r = this.inputs()[Math.min(c, this.length - 1)]) == null || r.focus();
1220
+ const p = this.fill(t, i);
1221
+ a.value = this._chars[t] ?? "", this.commit(), (r = this.inputs()[Math.min(p, this.length - 1)]) == null || r.focus();
1191
1222
  return;
1192
1223
  }
1193
1224
  const s = i.slice(-1);
@@ -1239,12 +1270,12 @@ ot([
1239
1270
  n()
1240
1271
  ], V.prototype, "label", 2);
1241
1272
  V = ot([
1242
- p("baht-otp")
1273
+ c("baht-otp")
1243
1274
  ], V);
1244
- var Ze = Object.defineProperty, ts = Object.getOwnPropertyDescriptor, lt = (t, e, a, i) => {
1245
- for (var s = i > 1 ? void 0 : i ? ts(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1275
+ var ts = Object.defineProperty, es = Object.getOwnPropertyDescriptor, lt = (t, e, a, i) => {
1276
+ for (var s = i > 1 ? void 0 : i ? es(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1246
1277
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1247
- return i && s && Ze(e, a, s), s;
1278
+ return i && s && ts(e, a, s), s;
1248
1279
  };
1249
1280
  let K = class extends d {
1250
1281
  constructor() {
@@ -1286,14 +1317,14 @@ lt([
1286
1317
  n()
1287
1318
  ], K.prototype, "label", 2);
1288
1319
  K = lt([
1289
- p("baht-filter")
1320
+ c("baht-filter")
1290
1321
  ], K);
1291
- var es = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, Dt = (t, e, a, i) => {
1292
- for (var s = i > 1 ? void 0 : i ? ss(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1322
+ var ss = Object.defineProperty, as = Object.getOwnPropertyDescriptor, Dt = (t, e, a, i) => {
1323
+ for (var s = i > 1 ? void 0 : i ? as(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1293
1324
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1294
- return i && s && es(e, a, s), s;
1325
+ return i && s && ss(e, a, s), s;
1295
1326
  };
1296
- let pt = class extends d {
1327
+ let ct = class extends d {
1297
1328
  constructor() {
1298
1329
  super(...arguments), this.variant = "rect", this.width = "100%", this.height = "";
1299
1330
  }
@@ -1308,22 +1339,22 @@ let pt = class extends d {
1308
1339
  };
1309
1340
  Dt([
1310
1341
  n()
1311
- ], pt.prototype, "variant", 2);
1342
+ ], ct.prototype, "variant", 2);
1312
1343
  Dt([
1313
1344
  n()
1314
- ], pt.prototype, "width", 2);
1345
+ ], ct.prototype, "width", 2);
1315
1346
  Dt([
1316
1347
  n()
1317
- ], pt.prototype, "height", 2);
1318
- pt = Dt([
1319
- p("baht-skeleton")
1320
- ], pt);
1321
- var as = Object.defineProperty, is = Object.getOwnPropertyDescriptor, mt = (t, e, a, i) => {
1322
- for (var s = i > 1 ? void 0 : i ? is(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1348
+ ], ct.prototype, "height", 2);
1349
+ ct = Dt([
1350
+ c("baht-skeleton")
1351
+ ], ct);
1352
+ var is = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, mt = (t, e, a, i) => {
1353
+ for (var s = i > 1 ? void 0 : i ? rs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1323
1354
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1324
- return i && s && as(e, a, s), s;
1355
+ return i && s && is(e, a, s), s;
1325
1356
  };
1326
- let G = class extends d {
1357
+ let Y = class extends d {
1327
1358
  constructor() {
1328
1359
  super(...arguments), this.value = null, this.tone = "primary", this.showLabel = !1, this.label = "Progress";
1329
1360
  }
@@ -1346,23 +1377,23 @@ let G = class extends d {
1346
1377
  };
1347
1378
  mt([
1348
1379
  n({ type: Number })
1349
- ], G.prototype, "value", 2);
1380
+ ], Y.prototype, "value", 2);
1350
1381
  mt([
1351
1382
  n()
1352
- ], G.prototype, "tone", 2);
1383
+ ], Y.prototype, "tone", 2);
1353
1384
  mt([
1354
1385
  n({ type: Boolean, attribute: "show-label" })
1355
- ], G.prototype, "showLabel", 2);
1386
+ ], Y.prototype, "showLabel", 2);
1356
1387
  mt([
1357
1388
  n()
1358
- ], G.prototype, "label", 2);
1359
- G = mt([
1360
- p("baht-progress")
1361
- ], G);
1362
- var rs = Object.defineProperty, os = Object.getOwnPropertyDescriptor, Ut = (t, e, a, i) => {
1363
- for (var s = i > 1 ? void 0 : i ? os(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1389
+ ], Y.prototype, "label", 2);
1390
+ Y = mt([
1391
+ c("baht-progress")
1392
+ ], Y);
1393
+ var os = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, zt = (t, e, a, i) => {
1394
+ for (var s = i > 1 ? void 0 : i ? ls(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1364
1395
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1365
- return i && s && rs(e, a, s), s;
1396
+ return i && s && os(e, a, s), s;
1366
1397
  };
1367
1398
  let Pt = class extends d {
1368
1399
  constructor() {
@@ -1373,26 +1404,26 @@ let Pt = class extends d {
1373
1404
  return l`<span class="baht-spinner${t}" role="status" aria-label=${this.label}></span>`;
1374
1405
  }
1375
1406
  };
1376
- Ut([
1407
+ zt([
1377
1408
  n()
1378
1409
  ], Pt.prototype, "size", 2);
1379
- Ut([
1410
+ zt([
1380
1411
  n()
1381
1412
  ], Pt.prototype, "label", 2);
1382
- Pt = Ut([
1383
- p("baht-spinner")
1413
+ Pt = zt([
1414
+ c("baht-spinner")
1384
1415
  ], Pt);
1385
- var ls = Object.defineProperty, ns = Object.getOwnPropertyDescriptor, yt = (t, e, a, i) => {
1386
- for (var s = i > 1 ? void 0 : i ? ns(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1416
+ var ns = Object.defineProperty, hs = Object.getOwnPropertyDescriptor, yt = (t, e, a, i) => {
1417
+ for (var s = i > 1 ? void 0 : i ? hs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1387
1418
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1388
- return i && s && ls(e, a, s), s;
1419
+ return i && s && ns(e, a, s), s;
1389
1420
  };
1390
- let Y = class extends d {
1421
+ let Q = class extends d {
1391
1422
  constructor() {
1392
1423
  super(...arguments), this.heading = "", this.subtitle = "", this.hero = !1;
1393
1424
  }
1394
1425
  firstUpdated() {
1395
- st(this, this.bodyEl);
1426
+ at(this, this.bodyEl);
1396
1427
  }
1397
1428
  render() {
1398
1429
  return l`<div class="baht-card${this.hero ? " baht-card--hero" : ""}">
@@ -1404,30 +1435,30 @@ let Y = class extends d {
1404
1435
  };
1405
1436
  yt([
1406
1437
  n()
1407
- ], Y.prototype, "heading", 2);
1438
+ ], Q.prototype, "heading", 2);
1408
1439
  yt([
1409
1440
  n()
1410
- ], Y.prototype, "subtitle", 2);
1441
+ ], Q.prototype, "subtitle", 2);
1411
1442
  yt([
1412
1443
  n({ type: Boolean })
1413
- ], Y.prototype, "hero", 2);
1444
+ ], Q.prototype, "hero", 2);
1414
1445
  yt([
1415
- tt(".baht-card-body")
1416
- ], Y.prototype, "bodyEl", 2);
1417
- Y = yt([
1418
- p("baht-card")
1419
- ], Y);
1420
- var hs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, Et = (t, e, a, i) => {
1446
+ et(".baht-card-body")
1447
+ ], Q.prototype, "bodyEl", 2);
1448
+ Q = yt([
1449
+ c("baht-card")
1450
+ ], Q);
1451
+ var cs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, Et = (t, e, a, i) => {
1421
1452
  for (var s = i > 1 ? void 0 : i ? ps(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1422
1453
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1423
- return i && s && hs(e, a, s), s;
1454
+ return i && s && cs(e, a, s), s;
1424
1455
  };
1425
- let ct = class extends d {
1456
+ let pt = class extends d {
1426
1457
  constructor() {
1427
1458
  super(...arguments), this.legend = "", this.disabled = !1;
1428
1459
  }
1429
1460
  firstUpdated() {
1430
- st(this, this.bodyEl);
1461
+ at(this, this.bodyEl);
1431
1462
  }
1432
1463
  render() {
1433
1464
  return l`<fieldset class="baht-fieldset" ?disabled=${this.disabled}>
@@ -1438,20 +1469,20 @@ let ct = class extends d {
1438
1469
  };
1439
1470
  Et([
1440
1471
  n()
1441
- ], ct.prototype, "legend", 2);
1472
+ ], pt.prototype, "legend", 2);
1442
1473
  Et([
1443
1474
  n({ type: Boolean })
1444
- ], ct.prototype, "disabled", 2);
1475
+ ], pt.prototype, "disabled", 2);
1445
1476
  Et([
1446
- tt(".baht-fieldset-body")
1447
- ], ct.prototype, "bodyEl", 2);
1448
- ct = Et([
1449
- p("baht-fieldset")
1450
- ], ct);
1451
- var cs = Object.defineProperty, ds = Object.getOwnPropertyDescriptor, he = (t, e, a, i) => {
1452
- for (var s = i > 1 ? void 0 : i ? ds(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1477
+ et(".baht-fieldset-body")
1478
+ ], pt.prototype, "bodyEl", 2);
1479
+ pt = Et([
1480
+ c("baht-fieldset")
1481
+ ], pt);
1482
+ var ds = Object.defineProperty, us = Object.getOwnPropertyDescriptor, ce = (t, e, a, i) => {
1483
+ for (var s = i > 1 ? void 0 : i ? us(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1453
1484
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1454
- return i && s && cs(e, a, s), s;
1485
+ return i && s && ds(e, a, s), s;
1455
1486
  };
1456
1487
  let Mt = class extends d {
1457
1488
  constructor() {
@@ -1477,16 +1508,16 @@ let Mt = class extends d {
1477
1508
  </div>`;
1478
1509
  }
1479
1510
  };
1480
- he([
1511
+ ce([
1481
1512
  n({ attribute: !1 })
1482
1513
  ], Mt.prototype, "items", 2);
1483
- Mt = he([
1484
- p("baht-timeline")
1514
+ Mt = ce([
1515
+ c("baht-timeline")
1485
1516
  ], Mt);
1486
- var us = Object.defineProperty, bs = Object.getOwnPropertyDescriptor, jt = (t, e, a, i) => {
1487
- for (var s = i > 1 ? void 0 : i ? bs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1517
+ var bs = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, jt = (t, e, a, i) => {
1518
+ for (var s = i > 1 ? void 0 : i ? fs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1488
1519
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1489
- return i && s && us(e, a, s), s;
1520
+ return i && s && bs(e, a, s), s;
1490
1521
  };
1491
1522
  let q = class extends d {
1492
1523
  constructor() {
@@ -1537,17 +1568,17 @@ jt([
1537
1568
  n({ type: Boolean })
1538
1569
  ], q.prototype, "multiple", 2);
1539
1570
  jt([
1540
- f()
1571
+ b()
1541
1572
  ], q.prototype, "openSet", 2);
1542
1573
  q = jt([
1543
- p("baht-accordion")
1574
+ c("baht-accordion")
1544
1575
  ], q);
1545
- var fs = Object.defineProperty, vs = Object.getOwnPropertyDescriptor, $t = (t, e, a, i) => {
1546
- for (var s = i > 1 ? void 0 : i ? vs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1576
+ var vs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, $t = (t, e, a, i) => {
1577
+ for (var s = i > 1 ? void 0 : i ? ms(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1547
1578
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1548
- return i && s && fs(e, a, s), s;
1579
+ return i && s && vs(e, a, s), s;
1549
1580
  };
1550
- let Q = class extends d {
1581
+ let X = class extends d {
1551
1582
  constructor() {
1552
1583
  super(...arguments), this.href = "", this.label = "", this.external = !1, this.externalHint = "opens in new tab";
1553
1584
  }
@@ -1562,23 +1593,23 @@ let Q = class extends d {
1562
1593
  };
1563
1594
  $t([
1564
1595
  n()
1565
- ], Q.prototype, "href", 2);
1596
+ ], X.prototype, "href", 2);
1566
1597
  $t([
1567
1598
  n()
1568
- ], Q.prototype, "label", 2);
1599
+ ], X.prototype, "label", 2);
1569
1600
  $t([
1570
1601
  n({ type: Boolean })
1571
- ], Q.prototype, "external", 2);
1602
+ ], X.prototype, "external", 2);
1572
1603
  $t([
1573
1604
  n({ attribute: "external-hint" })
1574
- ], Q.prototype, "externalHint", 2);
1575
- Q = $t([
1576
- p("baht-link")
1577
- ], Q);
1578
- var ms = Object.defineProperty, ys = Object.getOwnPropertyDescriptor, zt = (t, e, a, i) => {
1579
- for (var s = i > 1 ? void 0 : i ? ys(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1605
+ ], X.prototype, "externalHint", 2);
1606
+ X = $t([
1607
+ c("baht-link")
1608
+ ], X);
1609
+ var ys = Object.defineProperty, $s = Object.getOwnPropertyDescriptor, Ht = (t, e, a, i) => {
1610
+ for (var s = i > 1 ? void 0 : i ? $s(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1580
1611
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1581
- return i && s && ms(e, a, s), s;
1612
+ return i && s && ys(e, a, s), s;
1582
1613
  };
1583
1614
  let kt = class extends d {
1584
1615
  constructor() {
@@ -1605,21 +1636,21 @@ let kt = class extends d {
1605
1636
  </nav>`;
1606
1637
  }
1607
1638
  };
1608
- zt([
1639
+ Ht([
1609
1640
  n({ attribute: !1 })
1610
1641
  ], kt.prototype, "items", 2);
1611
- zt([
1642
+ Ht([
1612
1643
  n()
1613
1644
  ], kt.prototype, "separator", 2);
1614
- kt = zt([
1615
- p("baht-breadcrumbs")
1645
+ kt = Ht([
1646
+ c("baht-breadcrumbs")
1616
1647
  ], kt);
1617
- var $s = Object.getOwnPropertyDescriptor, gs = (t, e, a, i) => {
1618
- for (var s = i > 1 ? void 0 : i ? $s(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1648
+ var gs = Object.getOwnPropertyDescriptor, ws = (t, e, a, i) => {
1649
+ for (var s = i > 1 ? void 0 : i ? gs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1619
1650
  (o = t[r]) && (s = o(s) || s);
1620
1651
  return s;
1621
1652
  };
1622
- let Yt = class extends g {
1653
+ let Qt = class extends g {
1623
1654
  renderControl() {
1624
1655
  return l`<input
1625
1656
  class="baht-control baht-control--text"
@@ -1638,15 +1669,15 @@ let Yt = class extends g {
1638
1669
  />`;
1639
1670
  }
1640
1671
  };
1641
- Yt = gs([
1642
- p("baht-input")
1643
- ], Yt);
1644
- var ws = Object.getOwnPropertyDescriptor, _s = (t, e, a, i) => {
1645
- for (var s = i > 1 ? void 0 : i ? ws(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1672
+ Qt = ws([
1673
+ c("baht-input")
1674
+ ], Qt);
1675
+ var _s = Object.getOwnPropertyDescriptor, xs = (t, e, a, i) => {
1676
+ for (var s = i > 1 ? void 0 : i ? _s(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1646
1677
  (o = t[r]) && (s = o(s) || s);
1647
1678
  return s;
1648
1679
  };
1649
- let Qt = class extends g {
1680
+ let Xt = class extends g {
1650
1681
  renderControl() {
1651
1682
  return l`<textarea
1652
1683
  class="baht-control baht-control--textarea"
@@ -1665,15 +1696,15 @@ let Qt = class extends g {
1665
1696
  ></textarea>`;
1666
1697
  }
1667
1698
  };
1668
- Qt = _s([
1669
- p("baht-textarea")
1670
- ], Qt);
1671
- var xs = Object.getOwnPropertyDescriptor, Os = (t, e, a, i) => {
1672
- for (var s = i > 1 ? void 0 : i ? xs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1699
+ Xt = xs([
1700
+ c("baht-textarea")
1701
+ ], Xt);
1702
+ var Os = Object.getOwnPropertyDescriptor, Ps = (t, e, a, i) => {
1703
+ for (var s = i > 1 ? void 0 : i ? Os(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1673
1704
  (o = t[r]) && (s = o(s) || s);
1674
1705
  return s;
1675
1706
  };
1676
- let Xt = class extends g {
1707
+ let Zt = class extends g {
1677
1708
  renderControl() {
1678
1709
  return l`<input
1679
1710
  class="baht-control baht-control--number"
@@ -1696,15 +1727,15 @@ let Xt = class extends g {
1696
1727
  />`;
1697
1728
  }
1698
1729
  };
1699
- Xt = Os([
1700
- p("baht-number")
1701
- ], Xt);
1702
- var Ps = Object.getOwnPropertyDescriptor, ks = (t, e, a, i) => {
1703
- for (var s = i > 1 ? void 0 : i ? Ps(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1730
+ Zt = Ps([
1731
+ c("baht-number")
1732
+ ], Zt);
1733
+ var ks = Object.getOwnPropertyDescriptor, Cs = (t, e, a, i) => {
1734
+ for (var s = i > 1 ? void 0 : i ? ks(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1704
1735
  (o = t[r]) && (s = o(s) || s);
1705
1736
  return s;
1706
1737
  };
1707
- let Zt = class extends g {
1738
+ let te = class extends g {
1708
1739
  renderControl() {
1709
1740
  const t = this.value == null ? "" : String(this.value);
1710
1741
  return l`<select
@@ -1727,15 +1758,15 @@ let Zt = class extends g {
1727
1758
  </select>`;
1728
1759
  }
1729
1760
  };
1730
- Zt = ks([
1731
- p("baht-select")
1732
- ], Zt);
1733
- var Cs = Object.getOwnPropertyDescriptor, Ds = (t, e, a, i) => {
1734
- for (var s = i > 1 ? void 0 : i ? Cs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1761
+ te = Cs([
1762
+ c("baht-select")
1763
+ ], te);
1764
+ var Ds = Object.getOwnPropertyDescriptor, Es = (t, e, a, i) => {
1765
+ for (var s = i > 1 ? void 0 : i ? Ds(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1735
1766
  (o = t[r]) && (s = o(s) || s);
1736
1767
  return s;
1737
1768
  };
1738
- let te = class extends g {
1769
+ let ee = class extends g {
1739
1770
  get selected() {
1740
1771
  return Array.isArray(this.value) ? this.value : [];
1741
1772
  }
@@ -1765,15 +1796,15 @@ let te = class extends g {
1765
1796
  </div>`;
1766
1797
  }
1767
1798
  };
1768
- te = Ds([
1769
- p("baht-multiselect")
1770
- ], te);
1771
- var Es = Object.getOwnPropertyDescriptor, js = (t, e, a, i) => {
1772
- for (var s = i > 1 ? void 0 : i ? Es(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1799
+ ee = Es([
1800
+ c("baht-multiselect")
1801
+ ], ee);
1802
+ var js = Object.getOwnPropertyDescriptor, Bs = (t, e, a, i) => {
1803
+ for (var s = i > 1 ? void 0 : i ? js(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1773
1804
  (o = t[r]) && (s = o(s) || s);
1774
1805
  return s;
1775
1806
  };
1776
- let ee = class extends g {
1807
+ let se = class extends g {
1777
1808
  /** Label sits beside the box, so suppress the block label. */
1778
1809
  renderLabel() {
1779
1810
  return h;
@@ -1796,15 +1827,15 @@ let ee = class extends g {
1796
1827
  </label>`;
1797
1828
  }
1798
1829
  };
1799
- ee = js([
1800
- p("baht-checkbox")
1801
- ], ee);
1802
- var Bs = Object.getOwnPropertyDescriptor, Ss = (t, e, a, i) => {
1803
- for (var s = i > 1 ? void 0 : i ? Bs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1830
+ se = Bs([
1831
+ c("baht-checkbox")
1832
+ ], se);
1833
+ var Ss = Object.getOwnPropertyDescriptor, Fs = (t, e, a, i) => {
1834
+ for (var s = i > 1 ? void 0 : i ? Ss(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1804
1835
  (o = t[r]) && (s = o(s) || s);
1805
1836
  return s;
1806
1837
  };
1807
- let se = class extends g {
1838
+ let ae = class extends g {
1808
1839
  renderControl() {
1809
1840
  return l`<div
1810
1841
  class="baht-control baht-control--radio"
@@ -1830,15 +1861,15 @@ let se = class extends g {
1830
1861
  </div>`;
1831
1862
  }
1832
1863
  };
1833
- se = Ss([
1834
- p("baht-radio")
1835
- ], se);
1836
- var Fs = Object.getOwnPropertyDescriptor, Ns = (t, e, a, i) => {
1837
- for (var s = i > 1 ? void 0 : i ? Fs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1864
+ ae = Fs([
1865
+ c("baht-radio")
1866
+ ], ae);
1867
+ var Ns = Object.getOwnPropertyDescriptor, Is = (t, e, a, i) => {
1868
+ for (var s = i > 1 ? void 0 : i ? Ns(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1838
1869
  (o = t[r]) && (s = o(s) || s);
1839
1870
  return s;
1840
1871
  };
1841
- let ae = class extends g {
1872
+ let ie = class extends g {
1842
1873
  renderLabel() {
1843
1874
  return h;
1844
1875
  }
@@ -1863,15 +1894,15 @@ let ae = class extends g {
1863
1894
  </label>`;
1864
1895
  }
1865
1896
  };
1866
- ae = Ns([
1867
- p("baht-toggle")
1868
- ], ae);
1869
- var Is = Object.getOwnPropertyDescriptor, qs = (t, e, a, i) => {
1870
- for (var s = i > 1 ? void 0 : i ? Is(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1897
+ ie = Is([
1898
+ c("baht-toggle")
1899
+ ], ie);
1900
+ var qs = Object.getOwnPropertyDescriptor, As = (t, e, a, i) => {
1901
+ for (var s = i > 1 ? void 0 : i ? qs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1871
1902
  (o = t[r]) && (s = o(s) || s);
1872
1903
  return s;
1873
1904
  };
1874
- let ie = class extends g {
1905
+ let re = class extends g {
1875
1906
  constructor() {
1876
1907
  super(...arguments), this.lastEmitted = null;
1877
1908
  }
@@ -1902,7 +1933,7 @@ let ie = class extends g {
1902
1933
  return;
1903
1934
  }
1904
1935
  if (!this.fp || this.fp.input !== e || t.has("field") || t.has("disabled") || t.has("readonly")) {
1905
- this.teardown(), this.fp = _e(e, this.options());
1936
+ this.teardown(), this.fp = xe(e, this.options());
1906
1937
  return;
1907
1938
  }
1908
1939
  t.has("value") && (this.lastEmitted = null, this.syncValue());
@@ -1915,10 +1946,10 @@ let ie = class extends g {
1915
1946
  syncValue() {
1916
1947
  if (!this.fp) return;
1917
1948
  const t = this.datesOf(this.value);
1918
- re(this.fp.selectedDates, t) || (t.length === 0 ? this.fp.clear(!1) : this.fp.setDate(t, !1));
1949
+ oe(this.fp.selectedDates, t) || (t.length === 0 ? this.fp.clear(!1) : this.fp.setDate(t, !1));
1919
1950
  }
1920
1951
  options() {
1921
- const t = this.field, e = Wt(t), a = It(t.min), i = It(t.max);
1952
+ const t = this.field, e = Jt(t), a = It(t.min), i = It(t.max);
1922
1953
  return {
1923
1954
  static: !0,
1924
1955
  mode: e,
@@ -1928,7 +1959,7 @@ let ie = class extends g {
1928
1959
  defaultDate: this.datesOf(this.value),
1929
1960
  ...a ? { minDate: a } : {},
1930
1961
  ...i ? { maxDate: i } : {},
1931
- disable: As(t),
1962
+ disable: Ms(t),
1932
1963
  onChange: (s) => {
1933
1964
  e === "range" && s.length === 1 || this.emitIfChanged(s);
1934
1965
  },
@@ -1940,16 +1971,16 @@ let ie = class extends g {
1940
1971
  }
1941
1972
  emitIfChanged(t) {
1942
1973
  const e = this.lastEmitted ?? this.datesOf(this.value);
1943
- re(t, e) || (this.lastEmitted = [...t], this.emitInput(this.toValue(t)));
1974
+ oe(t, e) || (this.lastEmitted = [...t], this.emitInput(this.toValue(t)));
1944
1975
  }
1945
1976
  /** Host value (any mode) -> the Date list flatpickr works with. */
1946
1977
  datesOf(t) {
1947
- return ve(t).map(It).filter((e) => e !== null);
1978
+ return me(t).map(It).filter((e) => e !== null);
1948
1979
  }
1949
1980
  /** flatpickr's selection -> the value shape of the field's mode. */
1950
1981
  toValue(t) {
1951
1982
  const e = t.map(At);
1952
- switch (Wt(this.field)) {
1983
+ switch (Jt(this.field)) {
1953
1984
  case "range":
1954
1985
  return e.length === 2 ? [e[0], e[1]] : null;
1955
1986
  case "multiple":
@@ -1959,38 +1990,38 @@ let ie = class extends g {
1959
1990
  }
1960
1991
  }
1961
1992
  };
1962
- ie = qs([
1963
- p("baht-datepicker")
1964
- ], ie);
1965
- function re(t, e) {
1993
+ re = As([
1994
+ c("baht-datepicker")
1995
+ ], re);
1996
+ function oe(t, e) {
1966
1997
  return t.length !== e.length ? !1 : t.every((a, i) => At(a) === At(e[i]));
1967
1998
  }
1968
- function As(t) {
1999
+ function Ms(t) {
1969
2000
  const e = [];
1970
2001
  for (const i of t.disabledDates ?? []) {
1971
- const s = me(i);
2002
+ const s = ye(i);
1972
2003
  s && e.push(s[0].getTime() === s[1].getTime() ? s[0] : { from: s[0], to: s[1] });
1973
2004
  }
1974
2005
  const a = t.disabledWeekdays;
1975
2006
  return a != null && a.length && e.push((i) => a.includes(i.getDay())), e;
1976
2007
  }
1977
- var Ms = Object.defineProperty, Rs = Object.getOwnPropertyDescriptor, gt = (t, e, a, i) => {
1978
- for (var s = i > 1 ? void 0 : i ? Rs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2008
+ var Rs = Object.defineProperty, Ls = Object.getOwnPropertyDescriptor, gt = (t, e, a, i) => {
2009
+ for (var s = i > 1 ? void 0 : i ? Ls(e, a) : e, r = t.length - 1, o; r >= 0; r--)
1979
2010
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
1980
- return i && s && Ms(e, a, s), s;
2011
+ return i && s && Rs(e, a, s), s;
1981
2012
  };
1982
- function oe(t) {
2013
+ function le(t) {
1983
2014
  return t !== null && typeof t == "object" && typeof t.url == "string";
1984
2015
  }
1985
- function Ls(t) {
2016
+ function Ts(t) {
1986
2017
  return t >= 1024 * 1024 ? `${(t / 1024 / 1024).toFixed(1)} MB` : t >= 1024 ? `${Math.round(t / 1024)} KB` : `${t} B`;
1987
2018
  }
1988
- let X = class extends g {
2019
+ let Z = class extends g {
1989
2020
  constructor() {
1990
2021
  super(...arguments), this.uploadingCount = 0, this.uploadError = null, this.rejectedNames = [];
1991
2022
  }
1992
2023
  get refs() {
1993
- return Array.isArray(this.value) ? this.value.filter(oe) : oe(this.value) ? [this.value] : [];
2024
+ return Array.isArray(this.value) ? this.value.filter(le) : le(this.value) ? [this.value] : [];
1994
2025
  }
1995
2026
  emitRefs(t) {
1996
2027
  this.emitInput(this.field.multiple ? t : t[0] ?? null);
@@ -2038,7 +2069,7 @@ let X = class extends g {
2038
2069
  ${this.refs.map(
2039
2070
  (t) => l`<span class="baht-file-chip">
2040
2071
  <a href=${t.url} target="_blank" rel="noreferrer">${t.name}</a>
2041
- <span class="baht-file-size">${Ls(t.size)}</span>
2072
+ <span class="baht-file-size">${Ts(t.size)}</span>
2042
2073
  ${this.disabled || this.readonly ? h : l`<button
2043
2074
  type="button"
2044
2075
  class="baht-file-remove"
@@ -2054,23 +2085,23 @@ let X = class extends g {
2054
2085
  };
2055
2086
  gt([
2056
2087
  n({ attribute: !1 })
2057
- ], X.prototype, "uploader", 2);
2088
+ ], Z.prototype, "uploader", 2);
2058
2089
  gt([
2059
- f()
2060
- ], X.prototype, "uploadingCount", 2);
2090
+ b()
2091
+ ], Z.prototype, "uploadingCount", 2);
2061
2092
  gt([
2062
- f()
2063
- ], X.prototype, "uploadError", 2);
2093
+ b()
2094
+ ], Z.prototype, "uploadError", 2);
2064
2095
  gt([
2065
- f()
2066
- ], X.prototype, "rejectedNames", 2);
2067
- X = gt([
2068
- p("baht-file")
2069
- ], X);
2070
- var Ts = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, pe = (t, e, a, i) => {
2071
- for (var s = i > 1 ? void 0 : i ? Vs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2096
+ b()
2097
+ ], Z.prototype, "rejectedNames", 2);
2098
+ Z = gt([
2099
+ c("baht-file")
2100
+ ], Z);
2101
+ var Vs = Object.defineProperty, Ks = Object.getOwnPropertyDescriptor, pe = (t, e, a, i) => {
2102
+ for (var s = i > 1 ? void 0 : i ? Ks(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2072
2103
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2073
- return i && s && Ts(e, a, s), s;
2104
+ return i && s && Vs(e, a, s), s;
2074
2105
  };
2075
2106
  let Rt = class extends d {
2076
2107
  render() {
@@ -2083,12 +2114,12 @@ pe([
2083
2114
  n({ attribute: !1 })
2084
2115
  ], Rt.prototype, "field", 2);
2085
2116
  Rt = pe([
2086
- p("baht-text")
2117
+ c("baht-text")
2087
2118
  ], Rt);
2088
- var Ks = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, ce = (t, e, a, i) => {
2089
- for (var s = i > 1 ? void 0 : i ? Us(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2119
+ var Us = Object.defineProperty, zs = Object.getOwnPropertyDescriptor, de = (t, e, a, i) => {
2120
+ for (var s = i > 1 ? void 0 : i ? zs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2090
2121
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2091
- return i && s && Ks(e, a, s), s;
2122
+ return i && s && Us(e, a, s), s;
2092
2123
  };
2093
2124
  let Lt = class extends d {
2094
2125
  render() {
@@ -2097,16 +2128,16 @@ let Lt = class extends d {
2097
2128
  </div>` : h;
2098
2129
  }
2099
2130
  };
2100
- ce([
2131
+ de([
2101
2132
  n({ attribute: !1 })
2102
2133
  ], Lt.prototype, "field", 2);
2103
- Lt = ce([
2104
- p("baht-section")
2134
+ Lt = de([
2135
+ c("baht-section")
2105
2136
  ], Lt);
2106
- var zs = Object.defineProperty, Hs = Object.getOwnPropertyDescriptor, Bt = (t, e, a, i) => {
2107
- for (var s = i > 1 ? void 0 : i ? Hs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2137
+ var Hs = Object.defineProperty, Ws = Object.getOwnPropertyDescriptor, Bt = (t, e, a, i) => {
2138
+ for (var s = i > 1 ? void 0 : i ? Ws(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2108
2139
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2109
- return i && s && zs(e, a, s), s;
2140
+ return i && s && Hs(e, a, s), s;
2110
2141
  };
2111
2142
  let dt = class extends d {
2112
2143
  constructor() {
@@ -2132,16 +2163,16 @@ Bt([
2132
2163
  n()
2133
2164
  ], dt.prototype, "color", 2);
2134
2165
  dt = Bt([
2135
- p("baht-stat-chart")
2166
+ c("baht-stat-chart")
2136
2167
  ], dt);
2137
- const Ws = 10;
2138
- function de(t, e) {
2139
- return e && t === 0 ? e : `var(--baht-chart-${t % Ws + 1})`;
2168
+ const Js = 10;
2169
+ function ue(t, e) {
2170
+ return e && t === 0 ? e : `var(--baht-chart-${t % Js + 1})`;
2140
2171
  }
2141
- var Js = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor, nt = (t, e, a, i) => {
2142
- for (var s = i > 1 ? void 0 : i ? Gs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2172
+ var Gs = Object.defineProperty, Ys = Object.getOwnPropertyDescriptor, nt = (t, e, a, i) => {
2173
+ for (var s = i > 1 ? void 0 : i ? Ys(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2143
2174
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2144
- return i && s && Js(e, a, s), s;
2175
+ return i && s && Gs(e, a, s), s;
2145
2176
  };
2146
2177
  let B = class extends d {
2147
2178
  constructor() {
@@ -2150,17 +2181,17 @@ let B = class extends d {
2150
2181
  render() {
2151
2182
  if (this.groups.length === 0)
2152
2183
  return l`<div class="baht-chart-empty">${this.emptyMessage}</div>`;
2153
- const t = this.groups.reduce((o, c) => o + c.count, 0) || 1, e = this.total ?? this.groups.reduce((o, c) => o + c.count, 0), a = B.R, i = 2 * Math.PI * a;
2184
+ const t = this.groups.reduce((o, p) => o + p.count, 0) || 1, e = this.total ?? this.groups.reduce((o, p) => o + p.count, 0), a = B.R, i = 2 * Math.PI * a;
2154
2185
  let s = 0;
2155
- const r = this.groups.map((o, c) => {
2156
- const b = o.count / t, H = {
2186
+ const r = this.groups.map((o, p) => {
2187
+ const f = o.count / t, W = {
2157
2188
  ...o,
2158
- frac: b,
2159
- dash: `${b * i} ${i - b * i}`,
2189
+ frac: f,
2190
+ dash: `${f * i} ${i - f * i}`,
2160
2191
  offset: -s * i,
2161
- color: de(c, this.color || void 0)
2192
+ color: ue(p, this.color || void 0)
2162
2193
  };
2163
- return s += b, H;
2194
+ return s += f, W;
2164
2195
  });
2165
2196
  return l`<div class="baht-donut-chart">
2166
2197
  <svg width="160" height="160" viewBox="0 0 160 160" role="img" aria-label="Donut chart">
@@ -2203,12 +2234,12 @@ nt([
2203
2234
  n({ attribute: "empty-message" })
2204
2235
  ], B.prototype, "emptyMessage", 2);
2205
2236
  B = nt([
2206
- p("baht-donut-chart")
2237
+ c("baht-donut-chart")
2207
2238
  ], B);
2208
- var Ys = Object.defineProperty, Qs = Object.getOwnPropertyDescriptor, St = (t, e, a, i) => {
2209
- for (var s = i > 1 ? void 0 : i ? Qs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2239
+ var Qs = Object.defineProperty, Xs = Object.getOwnPropertyDescriptor, St = (t, e, a, i) => {
2240
+ for (var s = i > 1 ? void 0 : i ? Xs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2210
2241
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2211
- return i && s && Ys(e, a, s), s;
2242
+ return i && s && Qs(e, a, s), s;
2212
2243
  };
2213
2244
  let ut = class extends d {
2214
2245
  constructor() {
@@ -2225,7 +2256,7 @@ let ut = class extends d {
2225
2256
  <div class="baht-bar-chart-track">
2226
2257
  <div
2227
2258
  class="baht-bar-chart-bar"
2228
- style="width:${Math.max(2, e.count / t * 100)}%;background:${this.color || de(a)}"
2259
+ style="width:${Math.max(2, e.count / t * 100)}%;background:${this.color || ue(a)}"
2229
2260
  ></div>
2230
2261
  </div>
2231
2262
  <span class="baht-bar-chart-count">${e.count}</span>
@@ -2244,12 +2275,12 @@ St([
2244
2275
  n({ attribute: "empty-message" })
2245
2276
  ], ut.prototype, "emptyMessage", 2);
2246
2277
  ut = St([
2247
- p("baht-bar-chart")
2278
+ c("baht-bar-chart")
2248
2279
  ], ut);
2249
- var Xs = Object.defineProperty, Zs = Object.getOwnPropertyDescriptor, Ft = (t, e, a, i) => {
2250
- for (var s = i > 1 ? void 0 : i ? Zs(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2280
+ var Zs = Object.defineProperty, ta = Object.getOwnPropertyDescriptor, Ft = (t, e, a, i) => {
2281
+ for (var s = i > 1 ? void 0 : i ? ta(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2251
2282
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2252
- return i && s && Xs(e, a, s), s;
2283
+ return i && s && Zs(e, a, s), s;
2253
2284
  };
2254
2285
  let bt = class extends d {
2255
2286
  constructor() {
@@ -2273,14 +2304,14 @@ Ft([
2273
2304
  n()
2274
2305
  ], bt.prototype, "hint", 2);
2275
2306
  bt = Ft([
2276
- p("baht-empty-state")
2307
+ c("baht-empty-state")
2277
2308
  ], bt);
2278
- var ta = Object.defineProperty, ea = Object.getOwnPropertyDescriptor, wt = (t, e, a, i) => {
2279
- for (var s = i > 1 ? void 0 : i ? ea(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2309
+ var ea = Object.defineProperty, sa = Object.getOwnPropertyDescriptor, wt = (t, e, a, i) => {
2310
+ for (var s = i > 1 ? void 0 : i ? sa(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2280
2311
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2281
- return i && s && ta(e, a, s), s;
2312
+ return i && s && ea(e, a, s), s;
2282
2313
  };
2283
- let Z = class extends d {
2314
+ let tt = class extends d {
2284
2315
  constructor() {
2285
2316
  super(...arguments), this.icon = "⚠️", this.heading = "Something went wrong", this.message = "", this.retryLabel = "";
2286
2317
  }
@@ -2298,23 +2329,23 @@ let Z = class extends d {
2298
2329
  };
2299
2330
  wt([
2300
2331
  n()
2301
- ], Z.prototype, "icon", 2);
2332
+ ], tt.prototype, "icon", 2);
2302
2333
  wt([
2303
2334
  n()
2304
- ], Z.prototype, "heading", 2);
2335
+ ], tt.prototype, "heading", 2);
2305
2336
  wt([
2306
2337
  n()
2307
- ], Z.prototype, "message", 2);
2338
+ ], tt.prototype, "message", 2);
2308
2339
  wt([
2309
2340
  n({ attribute: "retry-label" })
2310
- ], Z.prototype, "retryLabel", 2);
2311
- Z = wt([
2312
- p("baht-error-state")
2313
- ], Z);
2314
- var sa = Object.defineProperty, aa = Object.getOwnPropertyDescriptor, z = (t, e, a, i) => {
2315
- for (var s = i > 1 ? void 0 : i ? aa(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2341
+ ], tt.prototype, "retryLabel", 2);
2342
+ tt = wt([
2343
+ c("baht-error-state")
2344
+ ], tt);
2345
+ var aa = Object.defineProperty, ia = Object.getOwnPropertyDescriptor, H = (t, e, a, i) => {
2346
+ for (var s = i > 1 ? void 0 : i ? ia(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2316
2347
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2317
- return i && s && sa(e, a, s), s;
2348
+ return i && s && aa(e, a, s), s;
2318
2349
  };
2319
2350
  let A = class extends d {
2320
2351
  constructor() {
@@ -2371,7 +2402,7 @@ let A = class extends d {
2371
2402
  aria-label="Remove row"
2372
2403
  ?disabled=${this.disabled}
2373
2404
  @click=${() => this.commit(this.rows.filter((a, i) => i !== e))}
2374
- >${W("close")}</button>
2405
+ >${J("close")}</button>
2375
2406
  </div>`
2376
2407
  )}
2377
2408
  <button
@@ -2379,39 +2410,39 @@ let A = class extends d {
2379
2410
  class="baht-keyvalue-add"
2380
2411
  ?disabled=${this.disabled}
2381
2412
  @click=${this.addRow}
2382
- >${W("plus")}${this.addLabel}</button>
2413
+ >${J("plus")}${this.addLabel}</button>
2383
2414
  </div>`;
2384
2415
  }
2385
2416
  };
2386
- z([
2417
+ H([
2387
2418
  n({ attribute: !1 })
2388
2419
  ], A.prototype, "value", 2);
2389
- z([
2420
+ H([
2390
2421
  n({ attribute: "key-placeholder" })
2391
2422
  ], A.prototype, "keyPlaceholder", 2);
2392
- z([
2423
+ H([
2393
2424
  n({ attribute: "value-placeholder" })
2394
2425
  ], A.prototype, "valuePlaceholder", 2);
2395
- z([
2426
+ H([
2396
2427
  n({ attribute: "add-label" })
2397
2428
  ], A.prototype, "addLabel", 2);
2398
- z([
2429
+ H([
2399
2430
  n({ type: Boolean })
2400
2431
  ], A.prototype, "disabled", 2);
2401
- z([
2402
- f()
2432
+ H([
2433
+ b()
2403
2434
  ], A.prototype, "rows", 2);
2404
- A = z([
2405
- p("baht-keyvalue-editor")
2435
+ A = H([
2436
+ c("baht-keyvalue-editor")
2406
2437
  ], A);
2407
- var ia = Object.defineProperty, ra = Object.getOwnPropertyDescriptor, w = (t, e, a, i) => {
2408
- for (var s = i > 1 ? void 0 : i ? ra(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2438
+ var ra = Object.defineProperty, oa = Object.getOwnPropertyDescriptor, w = (t, e, a, i) => {
2439
+ for (var s = i > 1 ? void 0 : i ? oa(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2409
2440
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2410
- return i && s && ia(e, a, s), s;
2441
+ return i && s && ra(e, a, s), s;
2411
2442
  };
2412
- let oa = 0, y = class extends d {
2443
+ let la = 0, y = class extends d {
2413
2444
  constructor() {
2414
- super(...arguments), this.label = "Reference", this.value = "", this.display = "", this.placeholder = "", this.disabled = !1, this.invalid = !1, this.href = "", this.lookupLabel = "Look up records", this.debounce = 200, this.fetcher = null, this.open = !1, this.term = "", this.options = [], this.loading = !1, this.activeIndex = -1, this.listboxId = `baht-refpicker-list-${++oa}`, this.fetchSeq = 0, this.onDocMousedown = (t) => {
2445
+ super(...arguments), this.label = "Reference", this.value = "", this.display = "", this.placeholder = "", this.disabled = !1, this.invalid = !1, this.href = "", this.lookupLabel = "Look up records", this.debounce = 200, this.fetcher = null, this.open = !1, this.term = "", this.options = [], this.loading = !1, this.activeIndex = -1, this.listboxId = `baht-refpicker-list-${++la}`, this.fetchSeq = 0, this.onDocMousedown = (t) => {
2415
2446
  this.contains(t.target) || this.close();
2416
2447
  };
2417
2448
  }
@@ -2500,7 +2531,7 @@ let oa = 0, y = class extends d {
2500
2531
  aria-label="Clear"
2501
2532
  @mousedown=${(e) => e.preventDefault()}
2502
2533
  @click=${() => this.clear()}
2503
- >${W("close")}</button>` : h}
2534
+ >${J("close")}</button>` : h}
2504
2535
  </div>
2505
2536
  <button
2506
2537
  type="button"
@@ -2509,13 +2540,13 @@ let oa = 0, y = class extends d {
2509
2540
  title=${this.lookupLabel}
2510
2541
  ?disabled=${this.disabled}
2511
2542
  @click=${() => this.open ? this.close() : this.openLookup()}
2512
- >${W("search")}</button>
2543
+ >${J("search")}</button>
2513
2544
  ${this.value && this.href ? l`<a
2514
2545
  class="baht-refpicker-open"
2515
2546
  href=${this.href}
2516
2547
  aria-label="Open record"
2517
2548
  title="Open record"
2518
- >${W("external")}</a>` : h}
2549
+ >${J("external")}</a>` : h}
2519
2550
  <div
2520
2551
  class="baht-refpicker-list"
2521
2552
  id=${this.listboxId}
@@ -2572,27 +2603,27 @@ w([
2572
2603
  n({ attribute: !1 })
2573
2604
  ], y.prototype, "fetcher", 2);
2574
2605
  w([
2575
- f()
2606
+ b()
2576
2607
  ], y.prototype, "open", 2);
2577
2608
  w([
2578
- f()
2609
+ b()
2579
2610
  ], y.prototype, "term", 2);
2580
2611
  w([
2581
- f()
2612
+ b()
2582
2613
  ], y.prototype, "options", 2);
2583
2614
  w([
2584
- f()
2615
+ b()
2585
2616
  ], y.prototype, "loading", 2);
2586
2617
  w([
2587
- f()
2618
+ b()
2588
2619
  ], y.prototype, "activeIndex", 2);
2589
2620
  w([
2590
- tt("input")
2621
+ et("input")
2591
2622
  ], y.prototype, "inputEl", 2);
2592
2623
  y = w([
2593
- p("baht-reference-picker")
2624
+ c("baht-reference-picker")
2594
2625
  ], y);
2595
- const ue = {
2626
+ const be = {
2596
2627
  text: "baht-input",
2597
2628
  email: "baht-input",
2598
2629
  password: "baht-input",
@@ -2609,12 +2640,12 @@ const ue = {
2609
2640
  section: "baht-section",
2610
2641
  repeater: "baht-repeater"
2611
2642
  };
2612
- var la = Object.defineProperty, na = Object.getOwnPropertyDescriptor, be = (t, e, a, i) => {
2613
- for (var s = i > 1 ? void 0 : i ? na(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2643
+ var na = Object.defineProperty, ha = Object.getOwnPropertyDescriptor, fe = (t, e, a, i) => {
2644
+ for (var s = i > 1 ? void 0 : i ? ha(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2614
2645
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2615
- return i && s && la(e, a, s), s;
2646
+ return i && s && na(e, a, s), s;
2616
2647
  };
2617
- const ha = {
2648
+ const ca = {
2618
2649
  "1/4": "baht-field--w-1-4",
2619
2650
  "1/2": "baht-field--w-1-2",
2620
2651
  "3/4": "baht-field--w-3-4",
@@ -2656,16 +2687,16 @@ let Tt = class extends g {
2656
2687
  return ((i = this.rowErrors.find((s) => s.key === a)) == null ? void 0 : i.message) ?? null;
2657
2688
  }
2658
2689
  renderSub(t, e, a) {
2659
- const i = ue[a.type];
2690
+ const i = be[a.type];
2660
2691
  if (!i) return h;
2661
2692
  const s = `${e}:${a.key}`;
2662
2693
  let r = this.controls.get(s);
2663
- (!r || r.tagName.toLowerCase() !== i) && (r = document.createElement(i), r.addEventListener("baht-input", (c) => {
2664
- c.stopPropagation();
2665
- const { value: b } = c.detail;
2666
- this.patchRow(e, a.key, b);
2694
+ (!r || r.tagName.toLowerCase() !== i) && (r = document.createElement(i), r.addEventListener("baht-input", (p) => {
2695
+ p.stopPropagation();
2696
+ const { value: f } = p.detail;
2697
+ this.patchRow(e, a.key, f);
2667
2698
  }), this.controls.set(s, r)), r.field = a, r.value = Object.hasOwn(t, a.key) ? t[a.key] : xt(a), r.disabled = this.disabled, r.readonly = this.readonly, r.required = !!a.required, r.error = this.errorFor(e, a.key);
2668
- const o = ha[a.width ?? "full"] ?? "baht-field--w-full";
2699
+ const o = ca[a.width ?? "full"] ?? "baht-field--w-full";
2669
2700
  return l`<div class="baht-field ${o}" data-key=${a.key} data-type=${a.type}>
2670
2701
  ${r}
2671
2702
  </div>`;
@@ -2703,14 +2734,14 @@ let Tt = class extends g {
2703
2734
  </div>`;
2704
2735
  }
2705
2736
  };
2706
- be([
2737
+ fe([
2707
2738
  n({ attribute: !1 })
2708
2739
  ], Tt.prototype, "rowErrors", 2);
2709
- Tt = be([
2710
- p("baht-repeater")
2740
+ Tt = fe([
2741
+ c("baht-repeater")
2711
2742
  ], Tt);
2712
- var pa = Object.defineProperty, ca = Object.getOwnPropertyDescriptor, Nt = (t, e, a, i) => {
2713
- for (var s = i > 1 ? void 0 : i ? ca(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2743
+ var pa = Object.defineProperty, da = Object.getOwnPropertyDescriptor, Nt = (t, e, a, i) => {
2744
+ for (var s = i > 1 ? void 0 : i ? da(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2714
2745
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2715
2746
  return i && s && pa(e, a, s), s;
2716
2747
  };
@@ -2747,14 +2778,14 @@ Nt([
2747
2778
  n()
2748
2779
  ], ft.prototype, "variant", 2);
2749
2780
  ft = Nt([
2750
- p("baht-steps")
2781
+ c("baht-steps")
2751
2782
  ], ft);
2752
- var da = Object.defineProperty, ua = Object.getOwnPropertyDescriptor, C = (t, e, a, i) => {
2753
- for (var s = i > 1 ? void 0 : i ? ua(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2783
+ var ua = Object.defineProperty, ba = Object.getOwnPropertyDescriptor, C = (t, e, a, i) => {
2784
+ for (var s = i > 1 ? void 0 : i ? ba(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2754
2785
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2755
- return i && s && da(e, a, s), s;
2786
+ return i && s && ua(e, a, s), s;
2756
2787
  };
2757
- const ba = {
2788
+ const fa = {
2758
2789
  "1/4": "baht-field--w-1-4",
2759
2790
  "1/2": "baht-field--w-1-2",
2760
2791
  "3/4": "baht-field--w-3-4",
@@ -2768,7 +2799,7 @@ let P = class extends d {
2768
2799
  return this.form ? ((this.flagCache.form !== this.form || this.flagCache.flags !== this.flags) && (this.flagCache = {
2769
2800
  form: this.form,
2770
2801
  flags: this.flags,
2771
- out: le(this.form, this.flags)
2802
+ out: ne(this.form, this.flags)
2772
2803
  }), this.flagCache.out) : this.form;
2773
2804
  }
2774
2805
  willUpdate(t) {
@@ -2784,7 +2815,7 @@ let P = class extends d {
2784
2815
  const t = this.getData();
2785
2816
  for (const i of ((e = this.effectiveForm) == null ? void 0 : e.field_data) ?? []) {
2786
2817
  if (!i.optionsFrom) continue;
2787
- const s = JSON.stringify((i.optionsDeps ?? []).map((b) => t[b] ?? null));
2818
+ const s = JSON.stringify((i.optionsDeps ?? []).map((f) => t[f] ?? null));
2788
2819
  if (this.optionsSnapshots.get(i.key) === s) continue;
2789
2820
  this.optionsSnapshots.set(i.key, s);
2790
2821
  const r = (this.optionsEpoch.get(i.key) ?? 0) + 1;
@@ -2794,12 +2825,12 @@ let P = class extends d {
2794
2825
  console.warn(`[bahtui] unknown options fetcher "${i.optionsFrom}" — skipped`), this.dynamicOptions.set(i.key, []);
2795
2826
  continue;
2796
2827
  }
2797
- const c = o(t);
2798
- c instanceof Promise ? c.then((b) => {
2799
- this.optionsEpoch.get(i.key) === r && (this.dynamicOptions.set(i.key, b), this.requestUpdate());
2800
- }).catch((b) => {
2801
- console.warn(`[bahtui] options fetcher "${i.optionsFrom}" failed`, b), this.optionsEpoch.get(i.key) === r && this.optionsSnapshots.delete(i.key);
2802
- }) : this.dynamicOptions.set(i.key, c);
2828
+ const p = o(t);
2829
+ p instanceof Promise ? p.then((f) => {
2830
+ this.optionsEpoch.get(i.key) === r && (this.dynamicOptions.set(i.key, f), this.requestUpdate());
2831
+ }).catch((f) => {
2832
+ console.warn(`[bahtui] options fetcher "${i.optionsFrom}" failed`, f), this.optionsEpoch.get(i.key) === r && this.optionsSnapshots.delete(i.key);
2833
+ }) : this.dynamicOptions.set(i.key, p);
2803
2834
  }
2804
2835
  }
2805
2836
  /**
@@ -2818,8 +2849,8 @@ let P = class extends d {
2818
2849
  }
2819
2850
  get sortedFields() {
2820
2851
  if (!this.form) return [];
2821
- const t = Jt(this.effectiveForm, this.view);
2822
- return t || (this.view !== void 0 && !this.warnedViews.has(this.view) && (this.warnedViews.add(this.view), console.warn(`[bahtui] unknown view "${this.view}" — showing the full form`)), Jt(this.effectiveForm) ?? []);
2852
+ const t = Gt(this.effectiveForm, this.view);
2853
+ return t || (this.view !== void 0 && !this.warnedViews.has(this.view) && (this.warnedViews.add(this.view), console.warn(`[bahtui] unknown view "${this.view}" — showing the full form`)), Gt(this.effectiveForm) ?? []);
2823
2854
  }
2824
2855
  stateFor(t) {
2825
2856
  return this.fieldStates[t.key] ?? {
@@ -2851,7 +2882,7 @@ let P = class extends d {
2851
2882
  const s = this.stateFor(i);
2852
2883
  if (!s.visible) continue;
2853
2884
  const r = s.required === !!i.required ? i : { ...i, required: s.required };
2854
- t.push(...Gt(r, this.valueFor(i), this.registry, e));
2885
+ t.push(...Yt(r, this.valueFor(i), this.registry, e));
2855
2886
  }
2856
2887
  this.errors = t;
2857
2888
  const a = { valid: t.length === 0, errors: t };
@@ -2881,7 +2912,7 @@ let P = class extends d {
2881
2912
  const e = this.stateFor(t);
2882
2913
  if (!e.visible) return [];
2883
2914
  const a = this.getData(), i = e.required === !!t.required ? t : { ...t, required: e.required };
2884
- return Gt(i, this.valueFor(t), this.registry, a);
2915
+ return Yt(i, this.valueFor(t), this.registry, a);
2885
2916
  }
2886
2917
  /** `validateOn: 'blur'` — validate just the field the user left, same as
2887
2918
  * how errors are shown elsewhere (merged into `this.errors`, painted by
@@ -2892,21 +2923,21 @@ let P = class extends d {
2892
2923
  this.errors = [...a, ...e];
2893
2924
  }
2894
2925
  renderField(t) {
2895
- var o, c;
2896
- const e = ue[t.type];
2926
+ var o, p;
2927
+ const e = be[t.type];
2897
2928
  if (!e)
2898
2929
  return console.warn(`[bahtui] unknown field type "${t.type}" — skipped`), h;
2899
- const a = this.stateFor(t), i = ba[t.width ?? "full"] ?? "baht-field--w-full", s = ((o = this.errors.find((b) => b.key === t.key)) == null ? void 0 : o.message) ?? null;
2930
+ const a = this.stateFor(t), i = fa[t.width ?? "full"] ?? "baht-field--w-full", s = ((o = this.errors.find((f) => f.key === t.key)) == null ? void 0 : o.message) ?? null;
2900
2931
  if (this.readonly && t.type !== "label" && t.type !== "section")
2901
2932
  return this.renderReadonlyField(t, i, a.visible);
2902
2933
  let r = this.controls.get(t.key);
2903
- if ((!r || r.tagName.toLowerCase() !== e) && (r = document.createElement(e), r.addEventListener("baht-input", (b) => {
2904
- var Ht;
2905
- const H = (Ht = this.effectiveForm) == null ? void 0 : Ht.field_data.find((fe) => fe.key === t.key);
2906
- H && this.onFieldInput(H, b);
2907
- }), this.controls.set(t.key, r)), r.field = t.optionsFrom ? { ...t, options: this.dynamicOptions.get(t.key) ?? t.options ?? [] } : t, r.value = this.valueFor(t), r.disabled = !a.enabled, r.readonly = this.readonly || a.readonly, r.required = a.required, r.error = s, t.type === "repeater" && (r.rowErrors = this.errors.filter((b) => b.key.startsWith(`${t.key}[`))), t.type === "file" && t.uploader) {
2908
- const b = (c = this.registry.uploaders) == null ? void 0 : c[t.uploader];
2909
- b || console.warn(`[bahtui] unknown uploader "${t.uploader}" — capture only`), r.uploader = b;
2934
+ if ((!r || r.tagName.toLowerCase() !== e) && (r = document.createElement(e), r.addEventListener("baht-input", (f) => {
2935
+ var Wt;
2936
+ const W = (Wt = this.effectiveForm) == null ? void 0 : Wt.field_data.find((ve) => ve.key === t.key);
2937
+ W && this.onFieldInput(W, f);
2938
+ }), this.controls.set(t.key, r)), r.field = t.optionsFrom ? { ...t, options: this.dynamicOptions.get(t.key) ?? t.options ?? [] } : t, r.value = this.valueFor(t), r.disabled = !a.enabled, r.readonly = this.readonly || a.readonly, r.required = a.required, r.error = s, t.type === "repeater" && (r.rowErrors = this.errors.filter((f) => f.key.startsWith(`${t.key}[`))), t.type === "file" && t.uploader) {
2939
+ const f = (p = this.registry.uploaders) == null ? void 0 : p[t.uploader];
2940
+ f || console.warn(`[bahtui] unknown uploader "${t.uploader}" — capture only`), r.uploader = f;
2910
2941
  }
2911
2942
  return l`<div
2912
2943
  class="baht-field ${i} ${a.visible ? "" : "baht-field--hidden"}"
@@ -2918,15 +2949,15 @@ let P = class extends d {
2918
2949
  </div>`;
2919
2950
  }
2920
2951
  renderReadonlyField(t, e, a) {
2921
- const i = t.optionsFrom ? this.dynamicOptions.get(t.key) ?? t.options ?? [] : t.options, s = ye(t, this.valueFor(t), i), r = s.kind === "empty" ? l`<span class="baht-readonly-value baht-readonly-value--empty">${m("emptyValue")}</span>` : s.kind === "text" ? l`<span class="baht-readonly-value">${s.text}</span>` : s.kind === "chips" ? l`<span class="baht-readonly-value baht-readonly-chips"
2952
+ const i = t.optionsFrom ? this.dynamicOptions.get(t.key) ?? t.options ?? [] : t.options, s = $e(t, this.valueFor(t), i), r = s.kind === "empty" ? l`<span class="baht-readonly-value baht-readonly-value--empty">${m("emptyValue")}</span>` : s.kind === "text" ? l`<span class="baht-readonly-value">${s.text}</span>` : s.kind === "chips" ? l`<span class="baht-readonly-value baht-readonly-chips"
2922
2953
  >${s.items.map((o) => l`<span class="baht-readonly-chip">${o}</span>`)}</span
2923
2954
  >` : l`<div class="baht-readonly-rows">
2924
2955
  ${s.rows.map(
2925
2956
  (o) => l`<div class="baht-readonly-row">
2926
2957
  ${o.map(
2927
- (c) => l`<span class="baht-readonly-cell"
2928
- ><span class="baht-readonly-cell-label">${c.label}</span
2929
- ><span class="baht-readonly-cell-value">${c.text}</span></span
2958
+ (p) => l`<span class="baht-readonly-cell"
2959
+ ><span class="baht-readonly-cell-label">${p.label}</span
2960
+ ><span class="baht-readonly-cell-value">${p.text}</span></span
2930
2961
  >`
2931
2962
  )}
2932
2963
  </div>`
@@ -2972,18 +3003,18 @@ C([
2972
3003
  n({ type: Boolean })
2973
3004
  ], P.prototype, "readonly", 2);
2974
3005
  C([
2975
- f()
3006
+ b()
2976
3007
  ], P.prototype, "edits", 2);
2977
3008
  C([
2978
- f()
3009
+ b()
2979
3010
  ], P.prototype, "errors", 2);
2980
3011
  P = C([
2981
- p("baht-form")
3012
+ c("baht-form")
2982
3013
  ], P);
2983
- var fa = Object.defineProperty, va = Object.getOwnPropertyDescriptor, _ = (t, e, a, i) => {
2984
- for (var s = i > 1 ? void 0 : i ? va(e, a) : e, r = t.length - 1, o; r >= 0; r--)
3014
+ var va = Object.defineProperty, ma = Object.getOwnPropertyDescriptor, _ = (t, e, a, i) => {
3015
+ for (var s = i > 1 ? void 0 : i ? ma(e, a) : e, r = t.length - 1, o; r >= 0; r--)
2985
3016
  (o = t[r]) && (s = (i ? o(e, a, s) : o(s)) || s);
2986
- return i && s && fa(e, a, s), s;
3017
+ return i && s && va(e, a, s), s;
2987
3018
  };
2988
3019
  let $ = class extends d {
2989
3020
  constructor() {
@@ -2996,7 +3027,7 @@ let $ = class extends d {
2996
3027
  return this.workflow ? ((this.flagCache.workflow !== this.workflow || this.flagCache.flags !== this.flags) && (this.flagCache = {
2997
3028
  workflow: this.workflow,
2998
3029
  flags: this.flags,
2999
- out: le(this.workflow, this.flags)
3030
+ out: ne(this.workflow, this.flags)
3000
3031
  }), this.flagCache.out) : this.workflow;
3001
3032
  }
3002
3033
  willUpdate(t) {
@@ -3004,7 +3035,7 @@ let $ = class extends d {
3004
3035
  t.has("workflow") || t.has("value") ? (this.data = structuredClone(this.value ?? {}), this.reevaluate(), this.history = [], this.current = ((e = this.visibleForms[0]) == null ? void 0 : e.formName) ?? null, this.approvalError = null) : t.has("flags") && (this.reevaluate(), this.current && !this.visibleForms.some((i) => i.formName === this.current) && (this.current = ((a = this.visibleForms[0]) == null ? void 0 : a.formName) ?? null));
3005
3036
  }
3006
3037
  reevaluate() {
3007
- this.derived = $e(this.effectiveWorkflow, this.data), this.data = this.derived.data;
3038
+ this.derived = ge(this.effectiveWorkflow, this.data), this.data = this.derived.data;
3008
3039
  }
3009
3040
  /** Forms in ascending order whose derived visibility is true. */
3010
3041
  get visibleForms() {
@@ -3024,7 +3055,7 @@ let $ = class extends d {
3024
3055
  if (!this.current) return "end";
3025
3056
  const t = this.effectiveWorkflow;
3026
3057
  if (t.transitions && t.transitions.length > 0)
3027
- return ge(t, this.current, this.data);
3058
+ return we(t, this.current, this.data);
3028
3059
  const e = this.visibleForms, a = e.findIndex((s) => s.formName === this.current);
3029
3060
  return ((i = e[a + 1]) == null ? void 0 : i.formName) ?? "end";
3030
3061
  }
@@ -3101,10 +3132,10 @@ let $ = class extends d {
3101
3132
  this.decide("rejected");
3102
3133
  }
3103
3134
  decide(t) {
3104
- var b;
3135
+ var f;
3105
3136
  const e = this.currentForm;
3106
3137
  if (!e || e.kind !== "approval") return;
3107
- const a = e.approval ?? {}, i = String(((b = this.data[e.formName]) == null ? void 0 : b.comment) ?? ""), s = a.comment ?? "optional";
3138
+ const a = e.approval ?? {}, i = String(((f = this.data[e.formName]) == null ? void 0 : f.comment) ?? ""), s = a.comment ?? "optional";
3108
3139
  if ((s === "required" || s === "requireOnReject" && t === "rejected") && i.trim() === "") {
3109
3140
  this.approvalError = m("commentRequired");
3110
3141
  return;
@@ -3119,8 +3150,8 @@ let $ = class extends d {
3119
3150
  return;
3120
3151
  }
3121
3152
  this.emit("baht-reject", o);
3122
- const c = a.onReject ?? { action: "end" };
3123
- c.action === "goto" && this.visibleForms.some((H) => H.formName === c.form) ? this.gotoForm(c.form) : this.emit("baht-complete", { data: this.getData(), status: "rejected" });
3153
+ const p = a.onReject ?? { action: "end" };
3154
+ p.action === "goto" && this.visibleForms.some((W) => W.formName === p.form) ? this.gotoForm(p.form) : this.emit("baht-complete", { data: this.getData(), status: "rejected" });
3124
3155
  }
3125
3156
  /** Jump back to a visible form, truncating the history to that point. */
3126
3157
  gotoForm(t) {
@@ -3276,19 +3307,19 @@ _([
3276
3307
  n({ attribute: "steps-variant" })
3277
3308
  ], $.prototype, "stepsVariant", 2);
3278
3309
  _([
3279
- f()
3310
+ b()
3280
3311
  ], $.prototype, "data", 2);
3281
3312
  _([
3282
- f()
3313
+ b()
3283
3314
  ], $.prototype, "derived", 2);
3284
3315
  _([
3285
- f()
3316
+ b()
3286
3317
  ], $.prototype, "current", 2);
3287
3318
  _([
3288
- f()
3319
+ b()
3289
3320
  ], $.prototype, "approvalError", 2);
3290
3321
  $ = _([
3291
- p("baht-workflow")
3322
+ c("baht-workflow")
3292
3323
  ], $);
3293
3324
  export {
3294
3325
  q as BahtAccordion,
@@ -3297,72 +3328,72 @@ export {
3297
3328
  ut as BahtBarChart,
3298
3329
  kt as BahtBreadcrumbs,
3299
3330
  E as BahtButton,
3300
- Y as BahtCard,
3301
- ee as BahtCheckbox,
3331
+ Q as BahtCard,
3332
+ se as BahtCheckbox,
3302
3333
  Ot as BahtCode,
3303
- ie as BahtDatepicker,
3334
+ re as BahtDatepicker,
3304
3335
  B as BahtDonutChart,
3305
3336
  d as BahtElement,
3306
3337
  bt as BahtEmptyState,
3307
- Z as BahtErrorState,
3338
+ tt as BahtErrorState,
3308
3339
  g as BahtFieldBase,
3309
- ct as BahtFieldset,
3310
- X as BahtFile,
3340
+ pt as BahtFieldset,
3341
+ Z as BahtFile,
3311
3342
  K as BahtFilter,
3312
3343
  P as BahtForm,
3313
- Yt as BahtInput,
3344
+ Qt as BahtInput,
3314
3345
  A as BahtKeyvalueEditor,
3315
- Q as BahtLink,
3346
+ X as BahtLink,
3316
3347
  j as BahtList,
3317
3348
  x as BahtModal,
3318
- te as BahtMultiselect,
3319
- Xt as BahtNumber,
3349
+ ee as BahtMultiselect,
3350
+ Zt as BahtNumber,
3320
3351
  V as BahtOtp,
3321
3352
  N as BahtPagination,
3322
- G as BahtProgress,
3323
- se as BahtRadio,
3353
+ Y as BahtProgress,
3354
+ ae as BahtRadio,
3324
3355
  k as BahtRange,
3325
3356
  T as BahtRating,
3326
3357
  y as BahtReferencePicker,
3327
3358
  Tt as BahtRepeater,
3328
3359
  Lt as BahtSection,
3329
- Zt as BahtSelect,
3330
- pt as BahtSkeleton,
3360
+ te as BahtSelect,
3361
+ ct as BahtSkeleton,
3331
3362
  Pt as BahtSpinner,
3332
3363
  dt as BahtStatChart,
3333
3364
  ft as BahtSteps,
3334
3365
  u as BahtTable,
3335
3366
  Rt as BahtText,
3336
- Qt as BahtTextarea,
3367
+ Xt as BahtTextarea,
3337
3368
  Mt as BahtTimeline,
3338
- J as BahtToast,
3339
- ae as BahtToggle,
3369
+ G as BahtToast,
3370
+ ie as BahtToggle,
3340
3371
  I as BahtTooltip,
3341
3372
  $ as BahtWorkflow,
3342
- ue as TAG_FOR_TYPE,
3343
- st as adoptLightChildren,
3344
- le as applyFlags,
3345
- Pa as approvalFields,
3346
- de as chartColor,
3373
+ be as TAG_FOR_TYPE,
3374
+ at as adoptLightChildren,
3375
+ ne as applyFlags,
3376
+ Ca as approvalFields,
3377
+ ue as chartColor,
3347
3378
  xt as defaultValue,
3348
- ye as displayValue,
3349
- ka as evalCondition,
3350
- Ca as evalValueExpr,
3351
- $e as evaluate,
3352
- Da as flagEnabled,
3379
+ $e as displayValue,
3380
+ Da as evalCondition,
3381
+ Ea as evalValueExpr,
3382
+ ge as evaluate,
3383
+ ja as flagEnabled,
3353
3384
  At as formatIsoDate,
3354
- Ea as getCatalog,
3355
- ja as isDateDisabled,
3356
- Pe as isIconName,
3357
- me as parseDisabledEntry,
3385
+ Ba as getCatalog,
3386
+ Sa as isDateDisabled,
3387
+ ke as isIconName,
3388
+ ye as parseDisabledEntry,
3358
3389
  It as parseIsoDate,
3359
- Ba as readRef,
3360
- W as renderIcon,
3361
- ge as resolveNext,
3362
- Jt as resolveViewFields,
3363
- Sa as setCatalog,
3364
- Fa as setLocale,
3390
+ Fa as readRef,
3391
+ J as renderIcon,
3392
+ we as resolveNext,
3393
+ Gt as resolveViewFields,
3394
+ Na as setCatalog,
3395
+ Ia as setLocale,
3365
3396
  m as t,
3366
- Gt as validateField,
3367
- Na as walkPath
3397
+ Yt as validateField,
3398
+ qa as walkPath
3368
3399
  };