twd-js 1.6.1 → 1.6.3

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.
@@ -1,286 +1,283 @@
1
- var Ye = Object.defineProperty;
2
- var Qe = (t, e, r) => e in t ? Ye(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var ne = (t, e, r) => Qe(t, typeof e != "symbol" ? e + "" : e, r);
4
- var Z, w, ze, M, ve, Ne, We, He, ce, ie, ae, G = {}, K = [], Ze = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ee = Array.isArray;
5
- function E(t, e) {
6
- for (var r in e) t[r] = e[r];
7
- return t;
1
+ var re, y, He, rt, M, we, Be, De, Pe, pe, de, ce, nt, Q = {}, Z = [], ot = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ne = Array.isArray;
2
+ function A(e, t) {
3
+ for (var r in t) e[r] = t[r];
4
+ return e;
8
5
  }
9
- function ue(t) {
10
- t && t.parentNode && t.parentNode.removeChild(t);
6
+ function fe(e) {
7
+ e && e.parentNode && e.parentNode.removeChild(e);
11
8
  }
12
- function et(t, e, r) {
9
+ function st(e, t, r) {
13
10
  var n, o, s, l = {};
14
- for (s in e) s == "key" ? n = e[s] : s == "ref" ? o = e[s] : l[s] = e[s];
15
- if (arguments.length > 2 && (l.children = arguments.length > 3 ? Z.call(arguments, 2) : r), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) l[s] === void 0 && (l[s] = t.defaultProps[s]);
16
- return V(t, l, n, o, null);
11
+ for (s in t) s == "key" ? n = t[s] : s == "ref" ? o = t[s] : l[s] = t[s];
12
+ if (arguments.length > 2 && (l.children = arguments.length > 3 ? re.call(arguments, 2) : r), typeof e == "function" && e.defaultProps != null) for (s in e.defaultProps) l[s] === void 0 && (l[s] = e.defaultProps[s]);
13
+ return G(e, l, n, o, null);
17
14
  }
18
- function V(t, e, r, n, o) {
19
- var s = { type: t, props: e, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: o ?? ++ze, __i: -1, __u: 0 };
20
- return o == null && w.vnode != null && w.vnode(s), s;
15
+ function G(e, t, r, n, o) {
16
+ var s = {
17
+ type: e,
18
+ props: t,
19
+ key: r,
20
+ ref: n,
21
+ __k: null,
22
+ __: null,
23
+ __b: 0,
24
+ __e: null,
25
+ __c: null,
26
+ constructor: void 0,
27
+ __v: o ?? ++He,
28
+ __i: -1,
29
+ __u: 0
30
+ };
31
+ return o == null && y.vnode != null && y.vnode(s), s;
21
32
  }
22
- function U(t) {
23
- return t.children;
33
+ function V(e) {
34
+ return e.children;
24
35
  }
25
- function J(t, e) {
26
- this.props = t, this.context = e;
36
+ function K(e, t) {
37
+ this.props = e, this.context = t;
27
38
  }
28
- function W(t, e) {
29
- if (e == null) return t.__ ? W(t.__, t.__i + 1) : null;
30
- for (var r; e < t.__k.length; e++) if ((r = t.__k[e]) != null && r.__e != null) return r.__e;
31
- return typeof t.type == "function" ? W(t) : null;
39
+ function H(e, t) {
40
+ if (t == null) return e.__ ? H(e.__, e.__i + 1) : null;
41
+ for (var r; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) return r.__e;
42
+ return typeof e.type == "function" ? H(e) : null;
32
43
  }
33
- function tt(t) {
34
- if (t.__P && t.__d) {
35
- var e = t.__v, r = e.__e, n = [], o = [], s = E({}, e);
36
- s.__v = e.__v + 1, w.vnode && w.vnode(s), _e(t.__P, s, e, t.__n, t.__P.namespaceURI, 32 & e.__u ? [r] : null, n, r ?? W(e), !!(32 & e.__u), o), s.__v = e.__v, s.__.__k[s.__i] = s, Pe(n, s, o), e.__e = e.__ = null, s.__e != r && Be(s);
44
+ function it(e) {
45
+ if (e.__P && e.__d) {
46
+ var t = e.__v, r = t.__e, n = [], o = [], s = A({}, t);
47
+ s.__v = t.__v + 1, y.vnode && y.vnode(s), he(e.__P, s, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [r] : null, n, r ?? H(t), !!(32 & t.__u), o), s.__v = t.__v, s.__.__k[s.__i] = s, Ue(n, s, o), t.__e = t.__ = null, s.__e != r && Fe(s);
37
48
  }
38
49
  }
39
- function Be(t) {
40
- if ((t = t.__) != null && t.__c != null) return t.__e = t.__c.base = null, t.__k.some(function(e) {
41
- if (e != null && e.__e != null) return t.__e = t.__c.base = e.__e;
42
- }), Be(t);
50
+ function Fe(e) {
51
+ if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
52
+ if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
53
+ }), Fe(e);
43
54
  }
44
- function we(t) {
45
- (!t.__d && (t.__d = !0) && M.push(t) && !Y.__r++ || ve != w.debounceRendering) && ((ve = w.debounceRendering) || Ne)(Y);
55
+ function be(e) {
56
+ (!e.__d && (e.__d = !0) && M.push(e) && !ee.__r++ || we != y.debounceRendering) && ((we = y.debounceRendering) || Be)(ee);
46
57
  }
47
- function Y() {
48
- for (var t, e = 1; M.length; ) M.length > e && M.sort(We), t = M.shift(), e = M.length, tt(t);
49
- Y.__r = 0;
58
+ function ee() {
59
+ try {
60
+ for (var e, t = 1; M.length; ) M.length > t && M.sort(De), e = M.shift(), t = M.length, it(e);
61
+ } finally {
62
+ M.length = ee.__r = 0;
63
+ }
50
64
  }
51
- function De(t, e, r, n, o, s, l, d, u, a, p) {
52
- var i, f, _, v, T, b, m, g = n && n.__k || K, I = e.length;
53
- for (u = rt(r, e, g, u, I), i = 0; i < I; i++) (_ = r.__k[i]) != null && (f = _.__i != -1 && g[_.__i] || G, _.__i = i, b = _e(t, _, f, o, s, l, d, u, a, p), v = _.__e, _.ref && f.ref != _.ref && (f.ref && pe(f.ref, null, _), p.push(_.ref, _.__c || v, _)), T == null && v != null && (T = v), (m = !!(4 & _.__u)) || f.__k === _.__k ? u = Fe(_, u, t, m) : typeof _.type == "function" && b !== void 0 ? u = b : v && (u = v.nextSibling), _.__u &= -7);
54
- return r.__e = T, u;
65
+ function Oe(e, t, r, n, o, s, l, d, u, a, p) {
66
+ var i, f, _, w, C, k, v, g = n && n.__k || Z, $ = t.length;
67
+ for (u = at(r, t, g, u, $), i = 0; i < $; i++) (_ = r.__k[i]) != null && (f = _.__i != -1 && g[_.__i] || Q, _.__i = i, k = he(e, _, f, o, s, l, d, u, a, p), w = _.__e, _.ref && f.ref != _.ref && (f.ref && ge(f.ref, null, _), p.push(_.ref, _.__c || w, _)), C == null && w != null && (C = w), (v = !!(4 & _.__u)) || f.__k === _.__k ? u = je(_, u, e, v) : typeof _.type == "function" && k !== void 0 ? u = k : w && (u = w.nextSibling), _.__u &= -7);
68
+ return r.__e = C, u;
55
69
  }
56
- function rt(t, e, r, n, o) {
70
+ function at(e, t, r, n, o) {
57
71
  var s, l, d, u, a, p = r.length, i = p, f = 0;
58
- for (t.__k = new Array(o), s = 0; s < o; s++) (l = e[s]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = t.__k[s] = V(null, l, null, null, null) : ee(l) ? l = t.__k[s] = V(U, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = t.__k[s] = V(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : t.__k[s] = l, u = s + f, l.__ = t, l.__b = t.__b + 1, d = null, (a = l.__i = nt(l, r, u, i)) != -1 && (i--, (d = r[a]) && (d.__u |= 2)), d == null || d.__v == null ? (a == -1 && (o > p ? f-- : o < p && f++), typeof l.type != "function" && (l.__u |= 4)) : a != u && (a == u - 1 ? f-- : a == u + 1 ? f++ : (a > u ? f-- : f++, l.__u |= 4))) : t.__k[s] = null;
59
- if (i) for (s = 0; s < p; s++) (d = r[s]) != null && (2 & d.__u) == 0 && (d.__e == n && (n = W(d)), Ue(d, d));
72
+ for (e.__k = new Array(o), s = 0; s < o; s++) (l = t[s]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = e.__k[s] = G(null, l, null, null, null) : ne(l) ? l = e.__k[s] = G(V, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = e.__k[s] = G(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : e.__k[s] = l, u = s + f, l.__ = e, l.__b = e.__b + 1, d = null, (a = l.__i = lt(l, r, u, i)) != -1 && (i--, (d = r[a]) && (d.__u |= 2)), d == null || d.__v == null ? (a == -1 && (o > p ? f-- : o < p && f++), typeof l.type != "function" && (l.__u |= 4)) : a != u && (a == u - 1 ? f-- : a == u + 1 ? f++ : (a > u ? f-- : f++, l.__u |= 4))) : e.__k[s] = null;
73
+ if (i) for (s = 0; s < p; s++) (d = r[s]) != null && (2 & d.__u) == 0 && (d.__e == n && (n = H(d)), Ve(d, d));
60
74
  return n;
61
75
  }
62
- function Fe(t, e, r, n) {
76
+ function je(e, t, r, n) {
63
77
  var o, s;
64
- if (typeof t.type == "function") {
65
- for (o = t.__k, s = 0; o && s < o.length; s++) o[s] && (o[s].__ = t, e = Fe(o[s], e, r, n));
66
- return e;
78
+ if (typeof e.type == "function") {
79
+ for (o = e.__k, s = 0; o && s < o.length; s++) o[s] && (o[s].__ = e, t = je(o[s], t, r, n));
80
+ return t;
67
81
  }
68
- t.__e != e && (n && (e && t.type && !e.parentNode && (e = W(t)), r.insertBefore(t.__e, e || null)), e = t.__e);
82
+ e.__e != t && (n && (t && e.type && !t.parentNode && (t = H(e)), r.insertBefore(e.__e, t || null)), t = e.__e);
69
83
  do
70
- e = e && e.nextSibling;
71
- while (e != null && e.nodeType == 8);
72
- return e;
84
+ t = t && t.nextSibling;
85
+ while (t != null && t.nodeType == 8);
86
+ return t;
73
87
  }
74
- function nt(t, e, r, n) {
75
- var o, s, l, d = t.key, u = t.type, a = e[r], p = a != null && (2 & a.__u) == 0;
88
+ function lt(e, t, r, n) {
89
+ var o, s, l, d = e.key, u = e.type, a = t[r], p = a != null && (2 & a.__u) == 0;
76
90
  if (a === null && d == null || p && d == a.key && u == a.type) return r;
77
91
  if (n > (p ? 1 : 0)) {
78
- for (o = r - 1, s = r + 1; o >= 0 || s < e.length; ) if ((a = e[l = o >= 0 ? o-- : s++]) != null && (2 & a.__u) == 0 && d == a.key && u == a.type) return l;
92
+ for (o = r - 1, s = r + 1; o >= 0 || s < t.length; ) if ((a = t[l = o >= 0 ? o-- : s++]) != null && (2 & a.__u) == 0 && d == a.key && u == a.type) return l;
79
93
  }
80
94
  return -1;
81
95
  }
82
- function ye(t, e, r) {
83
- e[0] == "-" ? t.setProperty(e, r ?? "") : t[e] = r == null ? "" : typeof r != "number" || Ze.test(e) ? r : r + "px";
96
+ function ke(e, t, r) {
97
+ t[0] == "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" || ot.test(t) ? r : r + "px";
84
98
  }
85
- function j(t, e, r, n, o) {
99
+ function J(e, t, r, n, o) {
86
100
  var s, l;
87
- e: if (e == "style") if (typeof r == "string") t.style.cssText = r;
101
+ e: if (t == "style") if (typeof r == "string") e.style.cssText = r;
88
102
  else {
89
- if (typeof n == "string" && (t.style.cssText = n = ""), n) for (e in n) r && e in r || ye(t.style, e, "");
90
- if (r) for (e in r) n && r[e] == n[e] || ye(t.style, e, r[e]);
103
+ if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) r && t in r || ke(e.style, t, "");
104
+ if (r) for (t in r) n && r[t] == n[t] || ke(e.style, t, r[t]);
91
105
  }
92
- else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(He, "$1")), l = e.toLowerCase(), e = l in t || e == "onFocusOut" || e == "onFocusIn" ? l.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = r, r ? n ? r.u = n.u : (r.u = ce, t.addEventListener(e, s ? ae : ie, s)) : t.removeEventListener(e, s ? ae : ie, s);
106
+ else if (t[0] == "o" && t[1] == "n") s = t != (t = t.replace(Pe, "$1")), l = t.toLowerCase(), t = l in e || t == "onFocusOut" || t == "onFocusIn" ? l.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + s] = r, r ? n ? r.u = n.u : (r.u = pe, e.addEventListener(t, s ? ce : de, s)) : e.removeEventListener(t, s ? ce : de, s);
93
107
  else {
94
- if (o == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
95
- else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
96
- t[e] = r ?? "";
108
+ if (o == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
109
+ else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
110
+ e[t] = r ?? "";
97
111
  break e;
98
112
  } catch {
99
113
  }
100
- typeof r == "function" || (r == null || r === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && r == 1 ? "" : r));
114
+ typeof r == "function" || (r == null || r === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && r == 1 ? "" : r));
101
115
  }
102
116
  }
103
- function be(t) {
104
- return function(e) {
117
+ function Se(e) {
118
+ return function(t) {
105
119
  if (this.l) {
106
- var r = this.l[e.type + t];
107
- if (e.t == null) e.t = ce++;
108
- else if (e.t < r.u) return;
109
- return r(w.event ? w.event(e) : e);
120
+ var r = this.l[t.type + e];
121
+ if (t.t == null) t.t = pe++;
122
+ else if (t.t < r.u) return;
123
+ return r(y.event ? y.event(t) : t);
110
124
  }
111
125
  };
112
126
  }
113
- function _e(t, e, r, n, o, s, l, d, u, a) {
114
- var p, i, f, _, v, T, b, m, g, I, $, L, h, y, C, R = e.type;
115
- if (e.constructor !== void 0) return null;
116
- 128 & r.__u && (u = !!(32 & r.__u), s = [d = e.__e = r.__e]), (p = w.__b) && p(e);
117
- e: if (typeof R == "function") try {
118
- if (m = e.props, g = "prototype" in R && R.prototype.render, I = (p = R.contextType) && n[p.__c], $ = p ? I ? I.props.value : p.__ : n, r.__c ? b = (i = e.__c = r.__c).__ = i.__E : (g ? e.__c = i = new R(m, $) : (e.__c = i = new J(m, $), i.constructor = R, i.render = ot), I && I.sub(i), i.state || (i.state = {}), i.__n = n, f = i.__d = !0, i.__h = [], i._sb = []), g && i.__s == null && (i.__s = i.state), g && R.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = E({}, i.__s)), E(i.__s, R.getDerivedStateFromProps(m, i.__s))), _ = i.props, v = i.state, i.__v = e, f) g && R.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), g && i.componentDidMount != null && i.__h.push(i.componentDidMount);
127
+ function he(e, t, r, n, o, s, l, d, u, a) {
128
+ var p, i, f, _, w, C, k, v, g, $, I, z, h, b, R, E = t.type;
129
+ if (t.constructor !== void 0) return null;
130
+ 128 & r.__u && (u = !!(32 & r.__u), s = [d = t.__e = r.__e]), (p = y.__b) && p(t);
131
+ e: if (typeof E == "function") try {
132
+ if (v = t.props, g = E.prototype && E.prototype.render, $ = (p = E.contextType) && n[p.__c], I = p ? $ ? $.props.value : p.__ : n, r.__c ? k = (i = t.__c = r.__c).__ = i.__E : (g ? t.__c = i = new E(v, I) : (t.__c = i = new K(v, I), i.constructor = E, i.render = ct), $ && $.sub(i), i.state || (i.state = {}), i.__n = n, f = i.__d = !0, i.__h = [], i._sb = []), g && i.__s == null && (i.__s = i.state), g && E.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = A({}, i.__s)), A(i.__s, E.getDerivedStateFromProps(v, i.__s))), _ = i.props, w = i.state, i.__v = t, f) g && E.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), g && i.componentDidMount != null && i.__h.push(i.componentDidMount);
119
133
  else {
120
- if (g && R.getDerivedStateFromProps == null && m !== _ && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, $), e.__v == r.__v || !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, $) === !1) {
121
- e.__v != r.__v && (i.props = m, i.state = i.__s, i.__d = !1), e.__e = r.__e, e.__k = r.__k, e.__k.some(function(N) {
122
- N && (N.__ = e);
123
- }), K.push.apply(i.__h, i._sb), i._sb = [], i.__h.length && l.push(i);
134
+ if (g && E.getDerivedStateFromProps == null && v !== _ && i.componentWillReceiveProps != null && i.componentWillReceiveProps(v, I), t.__v == r.__v || !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(v, i.__s, I) === !1) {
135
+ t.__v != r.__v && (i.props = v, i.state = i.__s, i.__d = !1), t.__e = r.__e, t.__k = r.__k, t.__k.some(function(W) {
136
+ W && (W.__ = t);
137
+ }), Z.push.apply(i.__h, i._sb), i._sb = [], i.__h.length && l.push(i);
124
138
  break e;
125
139
  }
126
- i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s, $), g && i.componentDidUpdate != null && i.__h.push(function() {
127
- i.componentDidUpdate(_, v, T);
140
+ i.componentWillUpdate != null && i.componentWillUpdate(v, i.__s, I), g && i.componentDidUpdate != null && i.__h.push(function() {
141
+ i.componentDidUpdate(_, w, C);
128
142
  });
129
143
  }
130
- if (i.context = $, i.props = m, i.__P = t, i.__e = !1, L = w.__r, h = 0, g) i.state = i.__s, i.__d = !1, L && L(e), p = i.render(i.props, i.state, i.context), K.push.apply(i.__h, i._sb), i._sb = [];
144
+ if (i.context = I, i.props = v, i.__P = e, i.__e = !1, z = y.__r, h = 0, g) i.state = i.__s, i.__d = !1, z && z(t), p = i.render(i.props, i.state, i.context), Z.push.apply(i.__h, i._sb), i._sb = [];
131
145
  else do
132
- i.__d = !1, L && L(e), p = i.render(i.props, i.state, i.context), i.state = i.__s;
146
+ i.__d = !1, z && z(t), p = i.render(i.props, i.state, i.context), i.state = i.__s;
133
147
  while (i.__d && ++h < 25);
134
- i.state = i.__s, i.getChildContext != null && (n = E(E({}, n), i.getChildContext())), g && !f && i.getSnapshotBeforeUpdate != null && (T = i.getSnapshotBeforeUpdate(_, v)), y = p != null && p.type === U && p.key == null ? Oe(p.props.children) : p, d = De(t, ee(y) ? y : [y], e, r, n, o, s, l, d, u, a), i.base = e.__e, e.__u &= -161, i.__h.length && l.push(i), b && (i.__E = i.__ = null);
135
- } catch (N) {
136
- if (e.__v = null, u || s != null) if (N.then) {
137
- for (e.__u |= u ? 160 : 128; d && d.nodeType == 8 && d.nextSibling; ) d = d.nextSibling;
138
- s[s.indexOf(d)] = null, e.__e = d;
148
+ i.state = i.__s, i.getChildContext != null && (n = A(A({}, n), i.getChildContext())), g && !f && i.getSnapshotBeforeUpdate != null && (C = i.getSnapshotBeforeUpdate(_, w)), b = p != null && p.type === V && p.key == null ? qe(p.props.children) : p, d = Oe(e, ne(b) ? b : [b], t, r, n, o, s, l, d, u, a), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), k && (i.__E = i.__ = null);
149
+ } catch (W) {
150
+ if (t.__v = null, u || s != null) if (W.then) {
151
+ for (t.__u |= u ? 160 : 128; d && d.nodeType == 8 && d.nextSibling; ) d = d.nextSibling;
152
+ s[s.indexOf(d)] = null, t.__e = d;
139
153
  } else {
140
- for (C = s.length; C--; ) ue(s[C]);
141
- le(e);
154
+ for (R = s.length; R--; ) fe(s[R]);
155
+ ue(t);
142
156
  }
143
- else e.__e = r.__e, e.__k = r.__k, N.then || le(e);
144
- w.__e(N, e, r);
157
+ else t.__e = r.__e, t.__k = r.__k, W.then || ue(t);
158
+ y.__e(W, t, r);
145
159
  }
146
- else s == null && e.__v == r.__v ? (e.__k = r.__k, e.__e = r.__e) : d = e.__e = st(r.__e, e, r, n, o, s, l, u, a);
147
- return (p = w.diffed) && p(e), 128 & e.__u ? void 0 : d;
160
+ else s == null && t.__v == r.__v ? (t.__k = r.__k, t.__e = r.__e) : d = t.__e = dt(r.__e, t, r, n, o, s, l, u, a);
161
+ return (p = y.diffed) && p(t), 128 & t.__u ? void 0 : d;
148
162
  }
149
- function le(t) {
150
- t && (t.__c && (t.__c.__e = !0), t.__k && t.__k.some(le));
163
+ function ue(e) {
164
+ e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(ue));
151
165
  }
152
- function Pe(t, e, r) {
153
- for (var n = 0; n < r.length; n++) pe(r[n], r[++n], r[++n]);
154
- w.__c && w.__c(e, t), t.some(function(o) {
166
+ function Ue(e, t, r) {
167
+ for (var n = 0; n < r.length; n++) ge(r[n], r[++n], r[++n]);
168
+ y.__c && y.__c(t, e), e.some(function(o) {
155
169
  try {
156
- t = o.__h, o.__h = [], t.some(function(s) {
170
+ e = o.__h, o.__h = [], e.some(function(s) {
157
171
  s.call(o);
158
172
  });
159
173
  } catch (s) {
160
- w.__e(s, o.__v);
174
+ y.__e(s, o.__v);
161
175
  }
162
176
  });
163
177
  }
164
- function Oe(t) {
165
- return typeof t != "object" || t == null || t.__b > 0 ? t : ee(t) ? t.map(Oe) : E({}, t);
178
+ function qe(e) {
179
+ return typeof e != "object" || e == null || e.__b > 0 ? e : ne(e) ? e.map(qe) : A({}, e);
166
180
  }
167
- function st(t, e, r, n, o, s, l, d, u) {
168
- var a, p, i, f, _, v, T, b = r.props || G, m = e.props, g = e.type;
181
+ function dt(e, t, r, n, o, s, l, d, u) {
182
+ var a, p, i, f, _, w, C, k = r.props || Q, v = t.props, g = t.type;
169
183
  if (g == "svg" ? o = "http://www.w3.org/2000/svg" : g == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), s != null) {
170
184
  for (a = 0; a < s.length; a++) if ((_ = s[a]) && "setAttribute" in _ == !!g && (g ? _.localName == g : _.nodeType == 3)) {
171
- t = _, s[a] = null;
185
+ e = _, s[a] = null;
172
186
  break;
173
187
  }
174
188
  }
175
- if (t == null) {
176
- if (g == null) return document.createTextNode(m);
177
- t = document.createElementNS(o, g, m.is && m), d && (w.__m && w.__m(e, s), d = !1), s = null;
189
+ if (e == null) {
190
+ if (g == null) return document.createTextNode(v);
191
+ e = document.createElementNS(o, g, v.is && v), d && (y.__m && y.__m(t, s), d = !1), s = null;
178
192
  }
179
- if (g == null) b === m || d && t.data == m || (t.data = m);
193
+ if (g == null) k === v || d && e.data == v || (e.data = v);
180
194
  else {
181
- if (s = s && Z.call(t.childNodes), !d && s != null) for (b = {}, a = 0; a < t.attributes.length; a++) b[(_ = t.attributes[a]).name] = _.value;
182
- for (a in b) _ = b[a], a == "dangerouslySetInnerHTML" ? i = _ : a == "children" || a in m || a == "value" && "defaultValue" in m || a == "checked" && "defaultChecked" in m || j(t, a, null, _, o);
183
- for (a in m) _ = m[a], a == "children" ? f = _ : a == "dangerouslySetInnerHTML" ? p = _ : a == "value" ? v = _ : a == "checked" ? T = _ : d && typeof _ != "function" || b[a] === _ || j(t, a, _, b[a], o);
184
- if (p) d || i && (p.__html == i.__html || p.__html == t.innerHTML) || (t.innerHTML = p.__html), e.__k = [];
185
- else if (i && (t.innerHTML = ""), De(e.type == "template" ? t.content : t, ee(f) ? f : [f], e, r, n, g == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, s, l, s ? s[0] : r.__k && W(r, 0), d, u), s != null) for (a = s.length; a--; ) ue(s[a]);
186
- d || (a = "value", g == "progress" && v == null ? t.removeAttribute("value") : v != null && (v !== t[a] || g == "progress" && !v || g == "option" && v != b[a]) && j(t, a, v, b[a], o), a = "checked", T != null && T != t[a] && j(t, a, T, b[a], o));
195
+ if (s = s && re.call(e.childNodes), !d && s != null) for (k = {}, a = 0; a < e.attributes.length; a++) k[(_ = e.attributes[a]).name] = _.value;
196
+ for (a in k) _ = k[a], a == "dangerouslySetInnerHTML" ? i = _ : a == "children" || a in v || a == "value" && "defaultValue" in v || a == "checked" && "defaultChecked" in v || J(e, a, null, _, o);
197
+ for (a in v) _ = v[a], a == "children" ? f = _ : a == "dangerouslySetInnerHTML" ? p = _ : a == "value" ? w = _ : a == "checked" ? C = _ : d && typeof _ != "function" || k[a] === _ || J(e, a, _, k[a], o);
198
+ if (p) d || i && (p.__html == i.__html || p.__html == e.innerHTML) || (e.innerHTML = p.__html), t.__k = [];
199
+ else if (i && (e.innerHTML = ""), Oe(t.type == "template" ? e.content : e, ne(f) ? f : [f], t, r, n, g == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, s, l, s ? s[0] : r.__k && H(r, 0), d, u), s != null) for (a = s.length; a--; ) fe(s[a]);
200
+ d || (a = "value", g == "progress" && w == null ? e.removeAttribute("value") : w != null && (w !== e[a] || g == "progress" && !w || g == "option" && w != k[a]) && J(e, a, w, k[a], o), a = "checked", C != null && C != e[a] && J(e, a, C, k[a], o));
187
201
  }
188
- return t;
202
+ return e;
189
203
  }
190
- function pe(t, e, r) {
204
+ function ge(e, t, r) {
191
205
  try {
192
- if (typeof t == "function") {
193
- var n = typeof t.__u == "function";
194
- n && t.__u(), n && e == null || (t.__u = t(e));
195
- } else t.current = e;
206
+ if (typeof e == "function") {
207
+ var n = typeof e.__u == "function";
208
+ n && e.__u(), n && t == null || (e.__u = e(t));
209
+ } else e.current = t;
196
210
  } catch (o) {
197
- w.__e(o, r);
211
+ y.__e(o, r);
198
212
  }
199
213
  }
200
- function Ue(t, e, r) {
214
+ function Ve(e, t, r) {
201
215
  var n, o;
202
- if (w.unmount && w.unmount(t), (n = t.ref) && (n.current && n.current != t.__e || pe(n, null, e)), (n = t.__c) != null) {
216
+ if (y.unmount && y.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || ge(n, null, t)), (n = e.__c) != null) {
203
217
  if (n.componentWillUnmount) try {
204
218
  n.componentWillUnmount();
205
219
  } catch (s) {
206
- w.__e(s, e);
220
+ y.__e(s, t);
207
221
  }
208
222
  n.base = n.__P = null;
209
223
  }
210
- if (n = t.__k) for (o = 0; o < n.length; o++) n[o] && Ue(n[o], e, r || typeof t.type != "function");
211
- r || ue(t.__e), t.__c = t.__ = t.__e = void 0;
224
+ if (n = e.__k) for (o = 0; o < n.length; o++) n[o] && Ve(n[o], t, r || typeof e.type != "function");
225
+ r || fe(e.__e), e.__c = e.__ = e.__e = void 0;
212
226
  }
213
- function ot(t, e, r) {
214
- return this.constructor(t, r);
227
+ function ct(e, t, r) {
228
+ return this.constructor(e, r);
215
229
  }
216
- function it(t, e, r) {
230
+ function ut(e, t, r) {
217
231
  var n, o, s, l;
218
- e == document && (e = document.documentElement), w.__ && w.__(t, e), o = (n = !1) ? null : e.__k, s = [], l = [], _e(e, t = e.__k = et(U, null, [t]), o || G, G, e.namespaceURI, o ? null : e.firstChild ? Z.call(e.childNodes) : null, s, o ? o.__e : e.firstChild, n, l), Pe(s, t, l);
232
+ t == document && (t = document.documentElement), y.__ && y.__(e, t), o = (n = typeof r == "function") ? null : r && r.__k || t.__k, s = [], l = [], he(t, e = (!n && r || t).__k = st(V, null, [e]), o || Q, Q, t.namespaceURI, !n && r ? [r] : o ? null : t.firstChild ? re.call(t.childNodes) : null, s, !n && r ? r : o ? o.__e : t.firstChild, n, l), Ue(s, e, l);
219
233
  }
220
- Z = K.slice, w = { __e: function(t, e, r, n) {
221
- for (var o, s, l; e = e.__; ) if ((o = e.__c) && !o.__) try {
222
- if ((s = o.constructor) && s.getDerivedStateFromError != null && (o.setState(s.getDerivedStateFromError(t)), l = o.__d), o.componentDidCatch != null && (o.componentDidCatch(t, n || {}), l = o.__d), l) return o.__E = o;
234
+ re = Z.slice, y = { __e: function(e, t, r, n) {
235
+ for (var o, s, l; t = t.__; ) if ((o = t.__c) && !o.__) try {
236
+ if ((s = o.constructor) && s.getDerivedStateFromError != null && (o.setState(s.getDerivedStateFromError(e)), l = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, n || {}), l = o.__d), l) return o.__E = o;
223
237
  } catch (d) {
224
- t = d;
238
+ e = d;
225
239
  }
226
- throw t;
227
- } }, ze = 0, J.prototype.setState = function(t, e) {
228
- var r;
229
- r = this.__s != null && this.__s != this.state ? this.__s : this.__s = E({}, this.state), typeof t == "function" && (t = t(E({}, r), this.props)), t && E(r, t), t != null && this.__v && (e && this._sb.push(e), we(this));
230
- }, J.prototype.forceUpdate = function(t) {
231
- this.__v && (this.__e = !0, t && this.__h.push(t), we(this));
232
- }, J.prototype.render = U, M = [], Ne = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, We = function(t, e) {
233
- return t.__v.__b - e.__v.__b;
234
- }, Y.__r = 0, He = /(PointerCapture)$|Capture$/i, ce = 0, ie = be(!1), ae = be(!0);
235
- var at = 0;
236
- function c(t, e, r, n, o, s) {
237
- e || (e = {});
238
- var l, d, u = e;
239
- if ("ref" in u) for (d in u = {}, e) d == "ref" ? l = e[d] : u[d] = e[d];
240
- var a = { type: t, props: u, key: r, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --at, __i: -1, __u: 0, __source: o, __self: s };
241
- if (typeof t == "function" && (l = t.defaultProps)) for (d in l) u[d] === void 0 && (u[d] = l[d]);
242
- return w.vnode && w.vnode(a), a;
243
- }
244
- const lt = {
245
- // Colors
240
+ throw e;
241
+ } }, He = 0, rt = function(e) {
242
+ return e != null && e.constructor === void 0;
243
+ }, K.prototype.setState = function(e, t) {
244
+ var r = this.__s != null && this.__s != this.state ? this.__s : this.__s = A({}, this.state);
245
+ typeof e == "function" && (e = e(A({}, r), this.props)), e && A(r, e), e != null && this.__v && (t && this._sb.push(t), be(this));
246
+ }, K.prototype.forceUpdate = function(e) {
247
+ this.__v && (this.__e = !0, e && this.__h.push(e), be(this));
248
+ }, K.prototype.render = V, M = [], Be = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, De = function(e, t) {
249
+ return e.__v.__b - t.__v.__b;
250
+ }, ee.__r = 0, Pe = /(PointerCapture)$|Capture$/i, pe = 0, de = Se(!1), ce = Se(!0), nt = 0;
251
+ var _t = {
246
252
  primary: "#2563eb",
247
- // Darker blue for AA contrast with white text (4.5:1)
248
253
  background: "#1e293b",
249
254
  backgroundSecondary: "#182130",
250
- // Darker background for AA contrast with error text (4.5:1)
251
255
  border: "#475569",
252
256
  borderLight: "#64748b",
253
257
  text: "#f1f5f9",
254
258
  textSecondary: "#cbd5e1",
255
259
  textMuted: "#94a3b8",
256
- // Describe blocks
257
260
  describeBg: "#0f172a",
258
261
  describeText: "#94a3b8",
259
262
  describeBorder: "#334155",
260
- // Status colors
261
263
  success: "#22c55e",
262
264
  successBg: "#14532d",
263
265
  error: "#ff5252",
264
- // Strong red for AA contrast on darker backgroundSecondary (4.5:1)
265
266
  errorBg: "#7f1d1d",
266
267
  warning: "#fbbf24",
267
268
  warningBg: "#78350f",
268
269
  skip: "#475569",
269
270
  skipBg: "#334155",
270
- // Interactive elements
271
271
  buttonPrimary: "#2563eb",
272
- // Darker blue for AA contrast with white text (4.5:1)
273
272
  buttonPrimaryText: "#ffffff",
274
273
  buttonSecondary: "#334155",
275
274
  buttonSecondaryText: "#f1f5f9",
276
275
  buttonBorder: "#475569",
277
- // Spacing
278
276
  spacingXs: "4px",
279
277
  spacingSm: "6px",
280
278
  spacingMd: "8px",
281
279
  spacingLg: "12px",
282
280
  spacingXl: "14px",
283
- // Typography
284
281
  fontSizeXs: "10px",
285
282
  fontSizeSm: "12px",
286
283
  fontSizeMd: "14px",
@@ -288,62 +285,65 @@ const lt = {
288
285
  fontWeightNormal: "400",
289
286
  fontWeightMedium: "500",
290
287
  fontWeightBold: "700",
291
- // Layout
292
288
  sidebarWidth: "320px",
293
289
  borderRadius: "8px",
294
290
  borderRadiusLg: "6px",
295
- // Effects
296
291
  shadow: "2px 0 8px rgba(0,0,0,0.3)",
297
292
  shadowSm: "0 2px 4px rgba(0, 0, 0, 0.2)",
298
- // Z-index
299
293
  zIndexSidebar: "99999",
300
294
  zIndexSticky: "100000",
301
- // Animation
302
295
  animationDuration: "0.2s",
303
- // Icon colors
304
296
  iconColor: "#f1f5f9",
305
297
  iconColorSecondary: "#cbd5e1"
306
298
  };
307
- function dt(t = {}) {
308
- const e = { ...lt, ...t };
309
- return Object.entries(e).map(([r, n]) => `${`--twd-${r.replace(/([A-Z])/g, "-$1").toLowerCase()}`}: ${n};`).join(`
299
+ function pt(e = {}) {
300
+ return Object.entries({
301
+ ..._t,
302
+ ...e
303
+ }).map(([t, r]) => `${`--twd-${t.replace(/([A-Z])/g, "-$1").toLowerCase()}`}: ${r};`).join(`
310
304
  `);
311
305
  }
312
- function ct(t) {
313
- const e = "twd-theme-variables";
314
- let r = document.getElementById(e);
315
- r || (r = document.createElement("style"), r.id = e, document.head.appendChild(r));
316
- const n = dt(t);
306
+ function ft(e) {
307
+ const t = "twd-theme-variables";
308
+ let r = document.getElementById(t);
309
+ r || (r = document.createElement("style"), r.id = t, document.head.appendChild(r));
310
+ const n = pt(e);
317
311
  r.textContent = `
318
312
  :root {
319
313
  ${n}
320
314
  }
321
315
  `;
322
316
  }
323
- const ut = (t) => {
324
- const { Component: e, createRoot: r, theme: n } = t;
325
- ct(n);
317
+ var ht = (e) => {
318
+ const { Component: t, createRoot: r, theme: n } = e;
319
+ ft(n);
326
320
  const o = document.createElement("div");
327
- o.setAttribute("id", "twd-sidebar-root"), document.body.appendChild(o), r(o).render(e);
328
- }, _t = async (t, e, r, n) => {
329
- for (const o in t) await t[o]();
330
- ut({ Component: e, createRoot: r, theme: n });
331
- };
332
- var P, k, se, ke, Q = 0, je = [], S = w, Se = S.__b, xe = S.__r, Te = S.diffed, Ce = S.__c, Re = S.unmount, Ie = S.__;
333
- function fe(t, e) {
334
- S.__h && S.__h(k, t, Q || e), Q = 0;
335
- var r = k.__H || (k.__H = { __: [], __h: [] });
336
- return t >= r.__.length && r.__.push({}), r.__[t];
321
+ o.setAttribute("id", "twd-sidebar-root"), document.body.appendChild(o), r(o).render(t);
322
+ }, gt = async (e, t, r, n) => {
323
+ for (const o in e) await e[o]();
324
+ ht({
325
+ Component: t,
326
+ createRoot: r,
327
+ theme: n
328
+ });
329
+ }, j, S, ae, xe, te = 0, Je = [], x = y, Te = x.__b, Re = x.__r, Ce = x.diffed, $e = x.__c, Ee = x.unmount, Ie = x.__;
330
+ function ve(e, t) {
331
+ x.__h && x.__h(S, e, te || t), te = 0;
332
+ var r = S.__H || (S.__H = {
333
+ __: [],
334
+ __h: []
335
+ });
336
+ return e >= r.__.length && r.__.push({}), r.__[e];
337
337
  }
338
- function B(t) {
339
- return Q = 1, pt(Ve, t);
338
+ function P(e) {
339
+ return te = 1, vt(Ge, e);
340
340
  }
341
- function pt(t, e, r) {
342
- var n = fe(P++, 2);
343
- if (n.t = t, !n.__c && (n.__ = [Ve(void 0, e), function(d) {
341
+ function vt(e, t, r) {
342
+ var n = ve(j++, 2);
343
+ if (n.t = e, !n.__c && (n.__ = [r ? r(t) : Ge(void 0, t), function(d) {
344
344
  var u = n.__N ? n.__N[0] : n.__[0], a = n.t(u, d);
345
345
  u !== a && (n.__N = [a, n.__[1]], n.__c.setState({}));
346
- }], n.__c = k, !k.__f)) {
346
+ }], n.__c = S, !S.__f)) {
347
347
  var o = function(d, u, a) {
348
348
  if (!n.__c.__H) return !0;
349
349
  var p = n.__c.__H.__.filter(function(f) {
@@ -360,274 +360,291 @@ function pt(t, e, r) {
360
360
  }
361
361
  }), s && s.call(this, d, u, a) || i;
362
362
  };
363
- k.__f = !0;
364
- var s = k.shouldComponentUpdate, l = k.componentWillUpdate;
365
- k.componentWillUpdate = function(d, u, a) {
363
+ S.__f = !0;
364
+ var s = S.shouldComponentUpdate, l = S.componentWillUpdate;
365
+ S.componentWillUpdate = function(d, u, a) {
366
366
  if (this.__e) {
367
367
  var p = s;
368
368
  s = void 0, o(d, u, a), s = p;
369
369
  }
370
370
  l && l.call(this, d, u, a);
371
- }, k.shouldComponentUpdate = o;
371
+ }, S.shouldComponentUpdate = o;
372
372
  }
373
373
  return n.__N || n.__;
374
374
  }
375
- function te(t, e) {
376
- var r = fe(P++, 3);
377
- !S.__s && qe(r.__H, e) && (r.__ = t, r.u = e, k.__H.__h.push(r));
375
+ function oe(e, t) {
376
+ var r = ve(j++, 3);
377
+ !x.__s && Xe(r.__H, t) && (r.__ = e, r.u = t, S.__H.__h.push(r));
378
378
  }
379
- function F(t) {
380
- return Q = 5, z(function() {
381
- return { current: t };
379
+ function O(e) {
380
+ return te = 5, N(function() {
381
+ return { current: e };
382
382
  }, []);
383
383
  }
384
- function z(t, e) {
385
- var r = fe(P++, 7);
386
- return qe(r.__H, e) && (r.__ = t(), r.__H = e, r.__h = t), r.__;
384
+ function N(e, t) {
385
+ var r = ve(j++, 7);
386
+ return Xe(r.__H, t) && (r.__ = e(), r.__H = t, r.__h = e), r.__;
387
387
  }
388
- function ft() {
389
- for (var t; t = je.shift(); ) {
390
- var e = t.__H;
391
- if (t.__P && e) try {
392
- e.__h.some(X), e.__h.some(de), e.__h = [];
388
+ function mt() {
389
+ for (var e; e = Je.shift(); ) {
390
+ var t = e.__H;
391
+ if (e.__P && t) try {
392
+ t.__h.some(Y), t.__h.some(_e), t.__h = [];
393
393
  } catch (r) {
394
- e.__h = [], S.__e(r, t.__v);
394
+ t.__h = [], x.__e(r, e.__v);
395
395
  }
396
396
  }
397
397
  }
398
- S.__b = function(t) {
399
- k = null, Se && Se(t);
400
- }, S.__ = function(t, e) {
401
- t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Ie && Ie(t, e);
402
- }, S.__r = function(t) {
403
- xe && xe(t), P = 0;
404
- var e = (k = t.__c).__H;
405
- e && (se === k ? (e.__h = [], k.__h = [], e.__.some(function(r) {
398
+ x.__b = function(e) {
399
+ S = null, Te && Te(e);
400
+ }, x.__ = function(e, t) {
401
+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Ie && Ie(e, t);
402
+ }, x.__r = function(e) {
403
+ Re && Re(e), j = 0;
404
+ var t = (S = e.__c).__H;
405
+ t && (ae === S ? (t.__h = [], S.__h = [], t.__.some(function(r) {
406
406
  r.__N && (r.__ = r.__N), r.u = r.__N = void 0;
407
- })) : (e.__h.some(X), e.__h.some(de), e.__h = [], P = 0)), se = k;
408
- }, S.diffed = function(t) {
409
- Te && Te(t);
410
- var e = t.__c;
411
- e && e.__H && (e.__H.__h.length && (je.push(e) !== 1 && ke === S.requestAnimationFrame || ((ke = S.requestAnimationFrame) || ht)(ft)), e.__H.__.some(function(r) {
407
+ })) : (t.__h.some(Y), t.__h.some(_e), t.__h = [], j = 0)), ae = S;
408
+ }, x.diffed = function(e) {
409
+ Ce && Ce(e);
410
+ var t = e.__c;
411
+ t && t.__H && (t.__H.__h.length && (Je.push(t) !== 1 && xe === x.requestAnimationFrame || ((xe = x.requestAnimationFrame) || yt)(mt)), t.__H.__.some(function(r) {
412
412
  r.u && (r.__H = r.u), r.u = void 0;
413
- })), se = k = null;
414
- }, S.__c = function(t, e) {
415
- e.some(function(r) {
413
+ })), ae = S = null;
414
+ }, x.__c = function(e, t) {
415
+ t.some(function(r) {
416
416
  try {
417
- r.__h.some(X), r.__h = r.__h.filter(function(n) {
418
- return !n.__ || de(n);
417
+ r.__h.some(Y), r.__h = r.__h.filter(function(n) {
418
+ return !n.__ || _e(n);
419
419
  });
420
420
  } catch (n) {
421
- e.some(function(o) {
421
+ t.some(function(o) {
422
422
  o.__h && (o.__h = []);
423
- }), e = [], S.__e(n, r.__v);
423
+ }), t = [], x.__e(n, r.__v);
424
424
  }
425
- }), Ce && Ce(t, e);
426
- }, S.unmount = function(t) {
427
- Re && Re(t);
428
- var e, r = t.__c;
425
+ }), $e && $e(e, t);
426
+ }, x.unmount = function(e) {
427
+ Ee && Ee(e);
428
+ var t, r = e.__c;
429
429
  r && r.__H && (r.__H.__.some(function(n) {
430
430
  try {
431
- X(n);
431
+ Y(n);
432
432
  } catch (o) {
433
- e = o;
433
+ t = o;
434
434
  }
435
- }), r.__H = void 0, e && S.__e(e, r.__v));
435
+ }), r.__H = void 0, t && x.__e(t, r.__v));
436
436
  };
437
- var $e = typeof requestAnimationFrame == "function";
438
- function ht(t) {
439
- var e, r = function() {
440
- clearTimeout(n), $e && cancelAnimationFrame(e), setTimeout(t);
437
+ var Ae = typeof requestAnimationFrame == "function";
438
+ function yt(e) {
439
+ var t, r = function() {
440
+ clearTimeout(n), Ae && cancelAnimationFrame(t), setTimeout(e);
441
441
  }, n = setTimeout(r, 35);
442
- $e && (e = requestAnimationFrame(r));
442
+ Ae && (t = requestAnimationFrame(r));
443
443
  }
444
- function X(t) {
445
- var e = k, r = t.__c;
446
- typeof r == "function" && (t.__c = void 0, r()), k = e;
444
+ function Y(e) {
445
+ var t = S, r = e.__c;
446
+ typeof r == "function" && (e.__c = void 0, r()), S = t;
447
447
  }
448
- function de(t) {
449
- var e = k;
450
- t.__c = t.__(), k = e;
448
+ function _e(e) {
449
+ var t = S;
450
+ e.__c = e.__(), S = t;
451
451
  }
452
- function qe(t, e) {
453
- return !t || t.length !== e.length || e.some(function(r, n) {
454
- return r !== t[n];
452
+ function Xe(e, t) {
453
+ return !e || e.length !== t.length || t.some(function(r, n) {
454
+ return r !== e[n];
455
455
  });
456
456
  }
457
- function Ve(t, e) {
458
- return typeof e == "function" ? e(t) : e;
457
+ function Ge(e, t) {
458
+ return typeof t == "function" ? t(e) : t;
459
459
  }
460
- const gt = {
461
- animation: "spin 1s linear infinite"
462
- }, mt = () => /* @__PURE__ */ c(
463
- "svg",
464
- {
465
- xmlns: "http://www.w3.org/2000/svg",
466
- width: "24",
467
- height: "24",
468
- viewBox: "0 0 24 24",
469
- fill: "none",
470
- stroke: "var(--twd-icon-color-secondary)",
471
- strokeWidth: "2",
472
- strokeLinecap: "round",
473
- strokeLinejoin: "round",
474
- className: "lucide lucide-loader-circle-icon lucide-loader-circle",
475
- style: gt,
476
- "data-testid": "loader-icon",
477
- children: /* @__PURE__ */ c("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
478
- }
479
- ), q = document.createElement("style");
480
- q && !document.getElementById("loader-spin-keyframes") && (q.id = "loader-spin-keyframes", q.innerHTML = `
460
+ var wt = 0;
461
+ function c(e, t, r, n, o, s) {
462
+ t || (t = {});
463
+ var l, d, u = t;
464
+ if ("ref" in u) for (d in u = {}, t) d == "ref" ? l = t[d] : u[d] = t[d];
465
+ var a = {
466
+ type: e,
467
+ props: u,
468
+ key: r,
469
+ ref: l,
470
+ __k: null,
471
+ __: null,
472
+ __b: 0,
473
+ __e: null,
474
+ __c: null,
475
+ constructor: void 0,
476
+ __v: --wt,
477
+ __i: -1,
478
+ __u: 0,
479
+ __source: o,
480
+ __self: s
481
+ };
482
+ if (typeof e == "function" && (l = e.defaultProps)) for (d in l) u[d] === void 0 && (u[d] = l[d]);
483
+ return y.vnode && y.vnode(a), a;
484
+ }
485
+ var bt = { animation: "spin 1s linear infinite" }, kt = () => /* @__PURE__ */ c("svg", {
486
+ xmlns: "http://www.w3.org/2000/svg",
487
+ width: "24",
488
+ height: "24",
489
+ viewBox: "0 0 24 24",
490
+ fill: "none",
491
+ stroke: "var(--twd-icon-color-secondary)",
492
+ strokeWidth: "2",
493
+ strokeLinecap: "round",
494
+ strokeLinejoin: "round",
495
+ className: "lucide lucide-loader-circle-icon lucide-loader-circle",
496
+ style: bt,
497
+ "data-testid": "loader-icon",
498
+ children: /* @__PURE__ */ c("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
499
+ }), X = document.createElement("style");
500
+ X && !document.getElementById("loader-spin-keyframes") && (X.id = "loader-spin-keyframes", X.innerHTML = `
481
501
  @keyframes spin {
482
502
  0% { transform: rotate(0deg); }
483
503
  100% { transform: rotate(360deg); }
484
504
  }
485
- `, document.head.appendChild(q));
486
- const re = ({ className: t, children: e, dataTestId: r }) => /* @__PURE__ */ c(
487
- "svg",
488
- {
489
- xmlns: "http://www.w3.org/2000/svg",
490
- width: "16",
491
- height: "16",
492
- viewBox: "0 0 24 24",
493
- fill: "none",
494
- stroke: "var(--twd-icon-color)",
495
- strokeWidth: "2",
496
- strokeLinecap: "round",
497
- strokeLinejoin: "round",
498
- className: `lucide ${t}`,
499
- "data-testid": r,
500
- children: e
501
- }
502
- ), vt = () => /* @__PURE__ */ c(re, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ c("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) }), Je = ({ id: t, name: e, skip: r, only: n }) => /* @__PURE__ */ c(U, { children: [
503
- e,
505
+ `, document.head.appendChild(X));
506
+ var se = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("svg", {
507
+ xmlns: "http://www.w3.org/2000/svg",
508
+ width: "16",
509
+ height: "16",
510
+ viewBox: "0 0 24 24",
511
+ fill: "none",
512
+ stroke: "var(--twd-icon-color)",
513
+ strokeWidth: "2",
514
+ strokeLinecap: "round",
515
+ strokeLinejoin: "round",
516
+ className: `lucide ${e}`,
517
+ "data-testid": r,
518
+ children: t
519
+ }), St = () => /* @__PURE__ */ c(se, {
520
+ className: "lucide-play-icon lucide-play",
521
+ dataTestId: "play-icon",
522
+ children: /* @__PURE__ */ c("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" })
523
+ }), Ke = ({ id: e, name: t, skip: r, only: n }) => /* @__PURE__ */ c(V, { children: [
524
+ t,
504
525
  " ",
505
- n && /* @__PURE__ */ c(
506
- "span",
507
- {
508
- style: { color: "var(--twd-primary)" },
509
- "data-testid": `only-indicator-${t}`,
510
- children: [
511
- " ",
512
- "(only)"
513
- ]
514
- }
515
- ),
516
- r && /* @__PURE__ */ c(
517
- "span",
518
- {
519
- style: { color: "var(--twd-text-secondary)" },
520
- "data-testid": `skip-indicator-${t}`,
521
- children: [
522
- " ",
523
- "(skipped)"
524
- ]
525
- }
526
- )
527
- ] });
528
- var A = /* @__PURE__ */ ((t) => (t.CHAI_DIFF = "chai-diff", t.CHAI_MESSAGE = "chai-message", t.ERROR = "error", t))(A || {});
529
- const wt = (t) => {
526
+ n && /* @__PURE__ */ c("span", {
527
+ style: { color: "var(--twd-primary)" },
528
+ "data-testid": `only-indicator-${e}`,
529
+ children: [" ", "(only)"]
530
+ }),
531
+ r && /* @__PURE__ */ c("span", {
532
+ style: { color: "var(--twd-text-secondary)" },
533
+ "data-testid": `skip-indicator-${e}`,
534
+ children: [" ", "(skipped)"]
535
+ })
536
+ ] }), L = /* @__PURE__ */ (function(e) {
537
+ return e.CHAI_DIFF = "chai-diff", e.CHAI_MESSAGE = "chai-message", e.ERROR = "error", e;
538
+ })({}), xt = (e) => {
530
539
  try {
531
- const e = JSON.parse(t);
532
- if (e && typeof e == "object" && "type" in e)
533
- return e;
540
+ const t = JSON.parse(e);
541
+ if (t && typeof t == "object" && "type" in t) return t;
534
542
  } catch {
535
543
  }
536
544
  return null;
537
- }, Ee = (t) => {
538
- if (t === null) return "null";
539
- if (t === void 0) return "undefined";
540
- if (typeof t == "string") return t;
541
- if (typeof t == "object")
542
- try {
543
- return JSON.stringify(t, null, 2);
544
- } catch {
545
- return String(t);
546
- }
547
- return String(t);
548
- }, yt = (t) => t.startsWith("Assertion passed") || t.startsWith("Event fired") ? { color: "var(--twd-success)", fontWeight: "var(--twd-font-weight-bold)" } : t.startsWith("Test failed") ? { color: "var(--twd-error)", fontWeight: "var(--twd-font-weight-bold)" } : {}, bt = (t) => t.type === "chai-message" || t.type === "error", kt = (t, e) => e && bt(e) ? e.message : t, St = ({ log: t, index: e }) => {
549
- const r = wt(t);
550
- if (r?.type === A.CHAI_DIFF)
551
- return /* @__PURE__ */ c(
552
- "li",
553
- {
545
+ }, Le = (e) => {
546
+ if (e === null) return "null";
547
+ if (e === void 0) return "undefined";
548
+ if (typeof e == "string") return e;
549
+ if (typeof e == "object") try {
550
+ return JSON.stringify(e, null, 2);
551
+ } catch {
552
+ return String(e);
553
+ }
554
+ return String(e);
555
+ }, Tt = (e) => e.startsWith("Assertion passed") || e.startsWith("Event fired") ? {
556
+ color: "var(--twd-success)",
557
+ fontWeight: "var(--twd-font-weight-bold)"
558
+ } : e.startsWith("Test failed") ? {
559
+ color: "var(--twd-error)",
560
+ fontWeight: "var(--twd-font-weight-bold)"
561
+ } : {}, Rt = (e) => e.type === L.CHAI_MESSAGE || e.type === L.ERROR, Ct = (e, t) => t && Rt(t) ? t.message : e, $t = ({ log: e, index: t }) => {
562
+ const r = xt(e);
563
+ if (r?.type === L.CHAI_DIFF) return /* @__PURE__ */ c("li", {
564
+ style: {
565
+ fontSize: "var(--twd-font-size-sm)",
566
+ padding: "var(--twd-spacing-sm)",
567
+ borderBottom: "1px solid var(--twd-border-light)",
568
+ color: "var(--twd-text)"
569
+ },
570
+ children: [
571
+ /* @__PURE__ */ c("div", {
554
572
  style: {
555
- fontSize: "var(--twd-font-size-sm)",
556
- padding: "var(--twd-spacing-sm)",
557
- borderBottom: "1px solid var(--twd-border-light)",
558
- color: "var(--twd-text)"
573
+ color: "var(--twd-error)",
574
+ fontWeight: "var(--twd-font-weight-bold)",
575
+ marginBottom: "var(--twd-spacing-xs)"
559
576
  },
560
- children: [
561
- /* @__PURE__ */ c("div", { style: {
577
+ children: "❌ Assertion failed"
578
+ }),
579
+ /* @__PURE__ */ c("div", {
580
+ style: {
581
+ marginTop: "var(--twd-spacing-xs)",
582
+ paddingLeft: "var(--twd-spacing-sm)",
583
+ borderLeft: "2px solid var(--twd-success)"
584
+ },
585
+ children: [/* @__PURE__ */ c("div", {
586
+ style: {
587
+ color: "var(--twd-success)",
588
+ fontWeight: "var(--twd-font-weight-medium)",
589
+ marginBottom: "var(--twd-spacing-xs)"
590
+ },
591
+ children: "Expected:"
592
+ }), /* @__PURE__ */ c("pre", {
593
+ style: {
594
+ margin: 0,
595
+ padding: "var(--twd-spacing-xs)",
596
+ background: "var(--twd-background)",
597
+ borderRadius: "var(--twd-border-radius)",
598
+ fontSize: "var(--twd-font-size-xs)",
599
+ overflowX: "auto",
600
+ whiteSpace: "pre-wrap",
601
+ wordBreak: "break-word"
602
+ },
603
+ children: Le(r.expected)
604
+ })]
605
+ }),
606
+ /* @__PURE__ */ c("div", {
607
+ style: {
608
+ marginTop: "var(--twd-spacing-xs)",
609
+ paddingLeft: "var(--twd-spacing-sm)",
610
+ borderLeft: "2px solid var(--twd-error)"
611
+ },
612
+ children: [/* @__PURE__ */ c("div", {
613
+ style: {
562
614
  color: "var(--twd-error)",
563
- fontWeight: "var(--twd-font-weight-bold)",
615
+ fontWeight: "var(--twd-font-weight-medium)",
564
616
  marginBottom: "var(--twd-spacing-xs)"
565
- }, children: "❌ Assertion failed" }),
566
- /* @__PURE__ */ c("div", { style: {
567
- marginTop: "var(--twd-spacing-xs)",
568
- paddingLeft: "var(--twd-spacing-sm)",
569
- borderLeft: "2px solid var(--twd-success)"
570
- }, children: [
571
- /* @__PURE__ */ c("div", { style: {
572
- color: "var(--twd-success)",
573
- fontWeight: "var(--twd-font-weight-medium)",
574
- marginBottom: "var(--twd-spacing-xs)"
575
- }, children: "Expected:" }),
576
- /* @__PURE__ */ c("pre", { style: {
577
- margin: 0,
578
- padding: "var(--twd-spacing-xs)",
579
- background: "var(--twd-background)",
580
- borderRadius: "var(--twd-border-radius)",
581
- fontSize: "var(--twd-font-size-xs)",
582
- overflowX: "auto",
583
- whiteSpace: "pre-wrap",
584
- wordBreak: "break-word"
585
- }, children: Ee(r.expected) })
586
- ] }),
587
- /* @__PURE__ */ c("div", { style: {
588
- marginTop: "var(--twd-spacing-xs)",
589
- paddingLeft: "var(--twd-spacing-sm)",
590
- borderLeft: "2px solid var(--twd-error)"
591
- }, children: [
592
- /* @__PURE__ */ c("div", { style: {
593
- color: "var(--twd-error)",
594
- fontWeight: "var(--twd-font-weight-medium)",
595
- marginBottom: "var(--twd-spacing-xs)"
596
- }, children: "Actual:" }),
597
- /* @__PURE__ */ c("pre", { style: {
598
- margin: 0,
599
- padding: "var(--twd-spacing-xs)",
600
- background: "var(--twd-background)",
601
- borderRadius: "var(--twd-border-radius)",
602
- fontSize: "var(--twd-font-size-xs)",
603
- overflowX: "auto",
604
- whiteSpace: "pre-wrap",
605
- wordBreak: "break-word"
606
- }, children: Ee(r.actual) })
607
- ] })
608
- ]
609
- },
610
- e
611
- );
612
- const n = kt(t, r);
613
- return /* @__PURE__ */ c(
614
- "li",
615
- {
616
- style: {
617
- fontSize: "var(--twd-font-size-sm)",
618
- padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
619
- borderBottom: "1px solid var(--twd-border-light)",
620
- color: "var(--twd-text)",
621
- ...yt(n)
622
- },
623
- children: n
617
+ },
618
+ children: "Actual:"
619
+ }), /* @__PURE__ */ c("pre", {
620
+ style: {
621
+ margin: 0,
622
+ padding: "var(--twd-spacing-xs)",
623
+ background: "var(--twd-background)",
624
+ borderRadius: "var(--twd-border-radius)",
625
+ fontSize: "var(--twd-font-size-xs)",
626
+ overflowX: "auto",
627
+ whiteSpace: "pre-wrap",
628
+ wordBreak: "break-word"
629
+ },
630
+ children: Le(r.actual)
631
+ })]
632
+ })
633
+ ]
634
+ }, t);
635
+ const n = Ct(e, r);
636
+ return /* @__PURE__ */ c("li", {
637
+ style: {
638
+ fontSize: "var(--twd-font-size-sm)",
639
+ padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
640
+ borderBottom: "1px solid var(--twd-border-light)",
641
+ color: "var(--twd-text)",
642
+ ...Tt(n)
624
643
  },
625
- e
626
- );
627
- }, H = {
628
- container: {
629
- marginBottom: "var(--twd-spacing-xs)"
630
- },
644
+ children: n
645
+ }, t);
646
+ }, D = {
647
+ container: { marginBottom: "var(--twd-spacing-xs)" },
631
648
  item: {
632
649
  display: "flex",
633
650
  alignItems: "left",
@@ -665,78 +682,43 @@ const wt = (t) => {
665
682
  marginTop: "var(--twd-spacing-xs)",
666
683
  textAlign: "left"
667
684
  }
668
- }, xt = (t) => {
669
- switch (t.status) {
685
+ }, Et = (e) => {
686
+ switch (e.status) {
670
687
  case "pass":
671
688
  return {
672
- item: {
673
- background: "var(--twd-success-bg)"
674
- },
675
- container: {
676
- borderLeft: "3px solid var(--twd-success)"
677
- }
689
+ item: { background: "var(--twd-success-bg)" },
690
+ container: { borderLeft: "3px solid var(--twd-success)" }
678
691
  };
679
692
  case "fail":
680
693
  return {
681
- item: {
682
- background: "var(--twd-error-bg)"
683
- },
684
- container: {
685
- borderLeft: "3px solid var(--twd-error)"
686
- }
694
+ item: { background: "var(--twd-error-bg)" },
695
+ container: { borderLeft: "3px solid var(--twd-error)" }
687
696
  };
688
697
  case "skip":
689
- return {
690
- item: {
691
- background: "var(--twd-skip-bg)"
692
- }
693
- };
698
+ return { item: { background: "var(--twd-skip-bg)" } };
694
699
  case "running":
695
- return {
696
- item: {
697
- background: "var(--twd-warning-bg)"
698
- }
699
- };
700
+ return { item: { background: "var(--twd-warning-bg)" } };
700
701
  default:
701
- return {
702
- item: {
703
- background: "transparent"
704
- }
705
- };
702
+ return { item: { background: "transparent" } };
706
703
  }
707
- }, Tt = ({
708
- node: t,
709
- depth: e,
710
- id: r,
711
- runTest: n
712
- }) => {
713
- const o = F(null), s = F(t.status), l = F(t.logs?.length || 0), d = z(() => xt(t), [t.status]), u = typeof window < "u" && sessionStorage.getItem("twd-last-run-test-name") === t.name, a = z(
714
- () => ({
715
- ...H.container,
716
- marginLeft: `calc(${e} * var(--twd-spacing-sm))`,
717
- ...d.container || {}
718
- }),
719
- [e, d]
720
- ), p = z(
721
- () => ({
722
- ...H.item,
723
- ...d.item,
724
- ...u && {
725
- border: "1px dashed var(--twd-border)"
726
- }
727
- }),
728
- [d, u]
729
- );
730
- te(() => {
704
+ }, It = ({ node: e, depth: t, id: r, runTest: n }) => {
705
+ const o = O(null), s = O(e.status), l = O(e.logs?.length || 0), d = N(() => Et(e), [e.status]), u = typeof window < "u" && sessionStorage.getItem("twd-last-run-test-name") === e.name, a = N(() => ({
706
+ ...D.container,
707
+ marginLeft: `calc(${t} * var(--twd-spacing-sm))`,
708
+ ...d.container || {}
709
+ }), [t, d]), p = N(() => ({
710
+ ...D.item,
711
+ ...d.item,
712
+ ...u && { border: "1px dashed var(--twd-border)" }
713
+ }), [d, u]);
714
+ oe(() => {
731
715
  const f = o.current;
732
- if (!f || !t.logs || t.logs.length === 0) return;
733
- const _ = s.current === "running" && (t.status === "pass" || t.status === "fail"), v = t.logs.length > l.current;
734
- (_ || v) && setTimeout(() => {
716
+ !f || !e.logs || e.logs.length === 0 || ((s.current === "running" && (e.status === "pass" || e.status === "fail") || e.logs.length > l.current) && setTimeout(() => {
735
717
  f.scrollTop = f.scrollHeight;
736
- }, 0), s.current = t.status, l.current = t.logs.length;
737
- }, [t.status, t.logs]);
718
+ }, 0), s.current = e.status, l.current = e.logs.length);
719
+ }, [e.status, e.logs]);
738
720
  const i = () => {
739
- switch (t.status) {
721
+ switch (e.status) {
740
722
  case "pass":
741
723
  return "passed";
742
724
  case "fail":
@@ -749,45 +731,53 @@ const wt = (t) => {
749
731
  return "not run";
750
732
  }
751
733
  };
752
- return /* @__PURE__ */ c(
753
- "li",
754
- {
755
- style: a,
756
- "data-testid": `test-list-item-${r}`,
757
- "data-test-name": t.name,
758
- role: "listitem",
759
- "aria-label": `Test ${t.name}, status: ${i()}`,
760
- children: [
761
- /* @__PURE__ */ c("div", { style: p, children: [
762
- /* @__PURE__ */ c("span", { style: H.nameSpan, children: /* @__PURE__ */ c(
763
- Je,
764
- {
765
- id: r,
766
- name: t.name,
767
- skip: t.skip,
768
- only: t.only
769
- }
770
- ) }),
771
- /* @__PURE__ */ c(
772
- "button",
773
- {
774
- onClick: () => n(r),
775
- "aria-label": `Run ${t.name} test`,
776
- style: H.button,
777
- disabled: t.status === "running",
778
- "data-testid": `run-test-button-${r}`,
779
- children: t.status === "running" ? /* @__PURE__ */ c(mt, {}) : /* @__PURE__ */ c(vt, {})
780
- }
781
- )
782
- ] }),
783
- t.logs && t.logs.length > 0 && /* @__PURE__ */ c("ul", { ref: o, style: H.logsList, children: t.logs.map((f, _) => /* @__PURE__ */ c(St, { log: f, index: _ }, _)) })
784
- ]
785
- },
786
- t.name
787
- );
788
- }, Ct = () => /* @__PURE__ */ c(re, { className: "lucide-chevron-down-icon lucide-chevron-down", dataTestId: "chevron-down-icon", children: /* @__PURE__ */ c("path", { d: "m6 9 6 6 6-6" }) }), Rt = () => /* @__PURE__ */ c(re, { className: "lucide-chevron-right-icon lucide-chevron-right", dataTestId: "chevron-right-icon", children: /* @__PURE__ */ c("path", { d: "m9 18 6-6-6-6" }) }), It = ({ roots: t, runTest: e, searchQuery: r = "" }) => {
789
- const [n, o] = B({}), s = F(null), l = F(!1), d = (a) => o((p) => ({ ...p, [a]: !p[a] }));
790
- te(() => {
734
+ return /* @__PURE__ */ c("li", {
735
+ style: a,
736
+ "data-testid": `test-list-item-${r}`,
737
+ "data-test-name": e.name,
738
+ role: "listitem",
739
+ "aria-label": `Test ${e.name}, status: ${i()}`,
740
+ children: [/* @__PURE__ */ c("div", {
741
+ style: p,
742
+ children: [/* @__PURE__ */ c("span", {
743
+ style: D.nameSpan,
744
+ children: /* @__PURE__ */ c(Ke, {
745
+ id: r,
746
+ name: e.name,
747
+ skip: e.skip,
748
+ only: e.only
749
+ })
750
+ }), /* @__PURE__ */ c("button", {
751
+ onClick: () => n(r),
752
+ "aria-label": `Run ${e.name} test`,
753
+ style: D.button,
754
+ disabled: e.status === "running",
755
+ "data-testid": `run-test-button-${r}`,
756
+ children: e.status === "running" ? /* @__PURE__ */ c(kt, {}) : /* @__PURE__ */ c(St, {})
757
+ })]
758
+ }), e.logs && e.logs.length > 0 && /* @__PURE__ */ c("ul", {
759
+ ref: o,
760
+ style: D.logsList,
761
+ children: e.logs.map((f, _) => /* @__PURE__ */ c($t, {
762
+ log: f,
763
+ index: _
764
+ }, _))
765
+ })]
766
+ }, e.name);
767
+ }, At = () => /* @__PURE__ */ c(se, {
768
+ className: "lucide-chevron-down-icon lucide-chevron-down",
769
+ dataTestId: "chevron-down-icon",
770
+ children: /* @__PURE__ */ c("path", { d: "m6 9 6 6 6-6" })
771
+ }), Lt = () => /* @__PURE__ */ c(se, {
772
+ className: "lucide-chevron-right-icon lucide-chevron-right",
773
+ dataTestId: "chevron-right-icon",
774
+ children: /* @__PURE__ */ c("path", { d: "m9 18 6-6-6-6" })
775
+ }), Mt = ({ roots: e, runTest: t, searchQuery: r = "" }) => {
776
+ const [n, o] = P({}), s = O(null), l = O(!1), d = (a) => o((p) => ({
777
+ ...p,
778
+ [a]: !p[a]
779
+ }));
780
+ oe(() => {
791
781
  if (l.current) return;
792
782
  const a = sessionStorage.getItem("twd-last-run-test-name");
793
783
  if (!a) return;
@@ -796,10 +786,9 @@ const wt = (t) => {
796
786
  if (i) {
797
787
  const f = s.current?.closest('[data-testid="twd-sidebar"]');
798
788
  if (f) {
799
- const _ = i.getBoundingClientRect(), v = f.getBoundingClientRect(), T = f.scrollTop, b = _.top - v.top + T;
789
+ const _ = i.getBoundingClientRect(), w = f.getBoundingClientRect(), C = f.scrollTop, k = _.top - w.top + C, v = f.querySelector('[data-testid="twd-sidebar-header"]'), g = v ? v.getBoundingClientRect().height + 16 : 150;
800
790
  f.scrollTo({
801
- top: b - 150,
802
- // 150px offset from top
791
+ top: k - g,
803
792
  behavior: "smooth"
804
793
  });
805
794
  }
@@ -809,81 +798,83 @@ const wt = (t) => {
809
798
  return () => clearTimeout(p);
810
799
  }, []);
811
800
  const u = (a, p = 0) => {
812
- if (a.type === "test")
813
- return /* @__PURE__ */ c(
814
- Tt,
815
- {
816
- node: a,
817
- depth: p,
818
- id: a.id,
819
- runTest: () => e(a.id)
820
- },
821
- a.id
822
- );
801
+ if (a.type === "test") return /* @__PURE__ */ c(It, {
802
+ node: a,
803
+ depth: p,
804
+ id: a.id,
805
+ runTest: () => t(a.id)
806
+ }, a.id);
823
807
  const i = n[a.id];
824
- return /* @__PURE__ */ c("li", { style: { marginLeft: `calc(${p} * var(--twd-spacing-lg))` }, children: [
825
- /* @__PURE__ */ c(
826
- "div",
827
- {
808
+ return /* @__PURE__ */ c("li", {
809
+ style: { marginLeft: `calc(${p} * var(--twd-spacing-lg))` },
810
+ children: [/* @__PURE__ */ c("div", {
811
+ style: {
812
+ background: "var(--twd-describe-bg)",
813
+ borderLeft: "3px solid var(--twd-describe-border)",
814
+ borderRadius: "var(--twd-border-radius)",
815
+ padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
816
+ marginBottom: "var(--twd-spacing-sm)"
817
+ },
818
+ children: /* @__PURE__ */ c("span", {
828
819
  style: {
829
- background: "var(--twd-describe-bg)",
830
- borderLeft: "3px solid var(--twd-describe-border)",
831
- borderRadius: "var(--twd-border-radius)",
832
- padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
833
- marginBottom: "var(--twd-spacing-sm)"
820
+ fontWeight: "var(--twd-font-weight-medium)",
821
+ fontSize: "var(--twd-font-size-sm)",
822
+ cursor: "pointer",
823
+ color: "var(--twd-describe-text)",
824
+ display: "flex",
825
+ alignItems: "center",
826
+ justifyContent: "space-between",
827
+ gap: "var(--twd-spacing-sm)",
828
+ textTransform: "uppercase",
829
+ letterSpacing: "0.05em"
834
830
  },
835
- children: /* @__PURE__ */ c(
836
- "span",
837
- {
838
- style: {
839
- fontWeight: "var(--twd-font-weight-medium)",
840
- fontSize: "var(--twd-font-size-sm)",
841
- cursor: "pointer",
842
- color: "var(--twd-describe-text)",
843
- display: "flex",
844
- alignItems: "center",
845
- justifyContent: "space-between",
846
- gap: "var(--twd-spacing-sm)",
847
- textTransform: "uppercase",
848
- letterSpacing: "0.05em"
849
- },
850
- "data-testid": `test-group-${a.name}`,
851
- tabIndex: 0,
852
- role: "button",
853
- "aria-expanded": !i,
854
- "aria-label": `${i ? "Expand" : "Collapse"} test suite ${a.name}`,
855
- onClick: () => d(a.id),
856
- children: [
857
- /* @__PURE__ */ c(Je, { id: a.id, name: a.name, skip: a.skip, only: a.only }),
858
- i ? /* @__PURE__ */ c(Rt, {}) : /* @__PURE__ */ c(Ct, {})
859
- ]
860
- }
861
- )
862
- }
863
- ),
864
- !i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */ c("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: a.childrenNodes.map((f) => u(f, p + 1)) })
865
- ] }, a.id);
831
+ "data-testid": `test-group-${a.name}`,
832
+ tabIndex: 0,
833
+ role: "button",
834
+ "aria-expanded": !i,
835
+ "aria-label": `${i ? "Expand" : "Collapse"} test suite ${a.name}`,
836
+ onClick: () => d(a.id),
837
+ children: [/* @__PURE__ */ c(Ke, {
838
+ id: a.id,
839
+ name: a.name,
840
+ skip: a.skip,
841
+ only: a.only
842
+ }), i ? /* @__PURE__ */ c(Lt, {}) : /* @__PURE__ */ c(At, {})]
843
+ })
844
+ }), !i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */ c("ul", {
845
+ style: {
846
+ listStyle: "none",
847
+ padding: 0,
848
+ margin: 0
849
+ },
850
+ children: a.childrenNodes.map((f) => u(f, p + 1))
851
+ })]
852
+ }, a.id);
866
853
  };
867
- return /* @__PURE__ */ c(
868
- "ul",
869
- {
870
- ref: s,
871
- style: { listStyle: "none", padding: 0, margin: 0 },
872
- role: "list",
873
- "aria-label": "Test list",
874
- children: t.length === 0 && r ? /* @__PURE__ */ c("li", { style: {
854
+ return /* @__PURE__ */ c("ul", {
855
+ ref: s,
856
+ style: {
857
+ listStyle: "none",
858
+ padding: 0,
859
+ margin: 0
860
+ },
861
+ role: "list",
862
+ "aria-label": "Test list",
863
+ children: e.length === 0 && r ? /* @__PURE__ */ c("li", {
864
+ style: {
875
865
  padding: "var(--twd-spacing-md)",
876
866
  color: "var(--twd-text-secondary)",
877
867
  fontSize: "var(--twd-font-size-sm)",
878
868
  textAlign: "center"
879
- }, children: [
869
+ },
870
+ children: [
880
871
  'No tests match "',
881
872
  r,
882
873
  '"'
883
- ] }) : t.map((a) => u(a))
884
- }
885
- );
886
- }, $t = {
874
+ ]
875
+ }) : e.map((a) => u(a))
876
+ });
877
+ }, zt = {
887
878
  left: {
888
879
  left: 0,
889
880
  borderTopRightRadius: "var(--twd-border-radius-lg)",
@@ -898,32 +889,61 @@ const wt = (t) => {
898
889
  borderTopRightRadius: "0",
899
890
  borderBottomRightRadius: "0"
900
891
  }
901
- }, Et = ({ setOpen: t, position: e }) => /* @__PURE__ */ c(
902
- "button",
903
- {
904
- "aria-label": "Open TWD sidebar",
905
- style: {
906
- position: "fixed",
907
- top: "50%",
908
- transform: "translateY(-50%)",
909
- background: "var(--twd-button-primary)",
910
- color: "var(--twd-button-primary-text)",
911
- padding: "var(--twd-spacing-sm) 10px",
912
- cursor: "pointer",
913
- fontSize: "var(--twd-font-size-sm)",
914
- ...$t[e]
915
- },
916
- onClick: () => t(!0),
917
- children: "TWD"
918
- }
919
- ), At = ({ isOpen: t, position: e }) => {
920
- te(() => {
892
+ }, Nt = ({ setOpen: e, position: t }) => /* @__PURE__ */ c("button", {
893
+ "aria-label": "Open TWD sidebar",
894
+ style: {
895
+ position: "fixed",
896
+ top: "50%",
897
+ transform: "translateY(-50%)",
898
+ zIndex: "var(--twd-z-index-sidebar)",
899
+ background: "var(--twd-button-primary)",
900
+ color: "var(--twd-button-primary-text)",
901
+ padding: "var(--twd-spacing-sm) 10px",
902
+ cursor: "pointer",
903
+ fontSize: "var(--twd-font-size-sm)",
904
+ ...zt[t]
905
+ },
906
+ onClick: () => e(!0),
907
+ children: "TWD"
908
+ }), Wt = ({ isOpen: e, position: t }) => {
909
+ oe(() => {
921
910
  const r = document.documentElement, n = getComputedStyle(document.documentElement).getPropertyValue("--twd-sidebar-width") || "280px";
922
- return t ? e === "left" ? r.style.marginLeft = n : r.style.marginRight = n : (r.style.marginRight = "0", r.style.marginLeft = "0"), () => {
911
+ return e ? t === "left" ? r.style.marginLeft = n : r.style.marginRight = n : (r.style.marginRight = "0", r.style.marginLeft = "0"), () => {
923
912
  r.style.marginRight = "0", r.style.marginLeft = "0";
924
913
  };
925
- }, [t, e]);
926
- }, Lt = () => typeof window < "u" ? (window.__TWD_STATE__ || (window.__TWD_STATE__ = {
914
+ }, [e, t]);
915
+ };
916
+ function U(e) {
917
+ "@babel/helpers - typeof";
918
+ return U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
919
+ return typeof t;
920
+ } : function(t) {
921
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
922
+ }, U(e);
923
+ }
924
+ function Ht(e, t) {
925
+ if (U(e) != "object" || !e) return e;
926
+ var r = e[Symbol.toPrimitive];
927
+ if (r !== void 0) {
928
+ var n = r.call(e, t || "default");
929
+ if (U(n) != "object") return n;
930
+ throw new TypeError("@@toPrimitive must return a primitive value.");
931
+ }
932
+ return (t === "string" ? String : Number)(e);
933
+ }
934
+ function Bt(e) {
935
+ var t = Ht(e, "string");
936
+ return U(t) == "symbol" ? t : t + "";
937
+ }
938
+ function Me(e, t, r) {
939
+ return (t = Bt(t)) in e ? Object.defineProperty(e, t, {
940
+ value: r,
941
+ enumerable: !0,
942
+ configurable: !0,
943
+ writable: !0
944
+ }) : e[t] = r, e;
945
+ }
946
+ var Dt = () => typeof window < "u" ? (window.__TWD_STATE__ || (window.__TWD_STATE__ = {
927
947
  handlers: /* @__PURE__ */ new Map(),
928
948
  beforeEachHooks: /* @__PURE__ */ new Map(),
929
949
  afterEachHooks: /* @__PURE__ */ new Map(),
@@ -933,244 +953,310 @@ const wt = (t) => {
933
953
  beforeEachHooks: /* @__PURE__ */ new Map(),
934
954
  afterEachHooks: /* @__PURE__ */ new Map(),
935
955
  stack: []
936
- }, he = Lt(), x = he.handlers, Ae = he.beforeEachHooks, Le = he.afterEachHooks, Mt = (t) => {
937
- const e = [], r = [];
938
- let n = t;
956
+ }, ie = Dt(), m = ie.handlers, ze = ie.beforeEachHooks, Ne = ie.afterEachHooks, T = ie.stack, B = () => Math.random().toString(36).slice(2, 11), Ye = (e, t) => {
957
+ const r = B(), n = T.at(-1);
958
+ m.set(r, {
959
+ id: r,
960
+ name: e,
961
+ type: "suite",
962
+ children: [],
963
+ logs: [],
964
+ depth: T.length,
965
+ parent: n,
966
+ handler: t
967
+ }), n && m.get(n).children.push(r), T.push(r), t(), T.pop();
968
+ };
969
+ Ye.only = (e, t) => {
970
+ const r = B(), n = T.at(-1);
971
+ m.set(r, {
972
+ id: r,
973
+ name: e,
974
+ type: "suite",
975
+ children: [],
976
+ logs: [],
977
+ depth: T.length,
978
+ parent: n,
979
+ handler: t,
980
+ only: !0
981
+ }), n && m.get(n).children.push(r), T.push(r), t(), T.pop();
982
+ };
983
+ Ye.skip = (e, t) => {
984
+ const r = B(), n = T.at(-1);
985
+ m.set(r, {
986
+ id: r,
987
+ name: e,
988
+ type: "suite",
989
+ children: [],
990
+ logs: [],
991
+ depth: T.length,
992
+ parent: n,
993
+ handler: t,
994
+ skip: !0
995
+ }), n && m.get(n).children.push(r), T.push(r), t(), T.pop();
996
+ };
997
+ var Qe = (e, t) => {
998
+ const r = B(), n = T.at(-1), o = {
999
+ id: r,
1000
+ name: e,
1001
+ type: "test",
1002
+ depth: T.length,
1003
+ handler: t,
1004
+ logs: [],
1005
+ parent: n
1006
+ };
1007
+ n && m.get(n).children.push(r), m.set(r, o);
1008
+ };
1009
+ Qe.only = (e, t) => {
1010
+ const r = B(), n = T.at(-1), o = {
1011
+ id: r,
1012
+ name: e,
1013
+ type: "test",
1014
+ depth: T.length,
1015
+ handler: t,
1016
+ logs: [],
1017
+ parent: n,
1018
+ only: !0
1019
+ };
1020
+ n && m.get(n).children.push(r), m.set(r, o);
1021
+ };
1022
+ Qe.skip = (e, t) => {
1023
+ const r = B(), n = T.at(-1), o = {
1024
+ id: r,
1025
+ name: e,
1026
+ type: "test",
1027
+ depth: T.length,
1028
+ handler: t || (() => {
1029
+ }),
1030
+ logs: [],
1031
+ parent: n,
1032
+ skip: !0
1033
+ };
1034
+ n && m.get(n).children.push(r), m.set(r, o);
1035
+ };
1036
+ var Pt = (e) => {
1037
+ const t = [], r = [];
1038
+ let n = e;
939
1039
  for (; n; )
940
- Ae.has(n) && e.unshift(...Ae.get(n)), Le.has(n) && r.push(...Le.get(n)), n = x.get(n)?.parent;
941
- return { before: e, after: r };
942
- }, D = (t) => {
943
- const e = x.get(t);
944
- return e ? e.only ? !0 : e.children ? e.children.some((r) => D(r)) : !1 : !1;
945
- }, zt = (t) => {
946
- let e = x.get(t);
947
- for (; e?.parent; ) {
948
- const r = x.get(e.parent);
1040
+ ze.has(n) && t.unshift(...ze.get(n)), Ne.has(n) && r.push(...Ne.get(n)), n = m.get(n)?.parent;
1041
+ return {
1042
+ before: t,
1043
+ after: r
1044
+ };
1045
+ }, F = (e) => {
1046
+ const t = m.get(e);
1047
+ return t ? t.only ? !0 : t.children ? t.children.some((r) => F(r)) : !1 : !1;
1048
+ }, Ft = (e) => {
1049
+ let t = m.get(e);
1050
+ for (; t?.parent; ) {
1051
+ const r = m.get(t.parent);
949
1052
  if (r?.only) return !0;
950
- e = r;
1053
+ t = r;
951
1054
  }
952
1055
  return !1;
953
- }, oe = (t) => {
954
- let e = x.get(t);
955
- for (; e; ) {
956
- if (e.skip) return !0;
957
- if (!e.parent) break;
958
- e = x.get(e.parent);
1056
+ }, le = (e) => {
1057
+ let t = m.get(e);
1058
+ for (; t; ) {
1059
+ if (t.skip) return !0;
1060
+ if (!t.parent) break;
1061
+ t = m.get(t.parent);
959
1062
  }
960
1063
  return !1;
961
- };
962
- class Xe {
963
- constructor(e, r) {
964
- ne(this, "events");
965
- ne(this, "retryCount");
966
- this.events = e, this.retryCount = r?.retryCount ?? 1;
1064
+ }, Ze = class {
1065
+ constructor(e, t) {
1066
+ Me(this, "events", void 0), Me(this, "retryCount", void 0), this.events = e, this.retryCount = t?.retryCount ?? 1;
967
1067
  }
968
1068
  async runAll() {
969
- const e = Array.from(x.values()).filter(
970
- (n) => !n.parent && n.type === "suite"
971
- ), r = Array.from(x.values()).some((n) => n.only);
972
- for (const n of e)
973
- await this.runSuite(n, r);
974
- return x;
1069
+ const e = Array.from(m.values()).filter((r) => !r.parent && r.type === "suite"), t = Array.from(m.values()).some((r) => r.only);
1070
+ for (const r of e) await this.runSuite(r, t);
1071
+ return m;
975
1072
  }
976
1073
  async runSingle(e) {
977
- const r = x.get(e);
978
- if (!r || r.type !== "test") return;
979
- await this.runTest(r, !1);
1074
+ const t = m.get(e);
1075
+ !t || t.type !== "test" || await this.runTest(t, !1);
980
1076
  }
981
1077
  async runByIds(e) {
982
- const r = new Set(e), n = Array.from(x.values()).filter(
983
- (s) => !s.parent && s.type === "suite"
984
- ), o = Array.from(x.values()).some((s) => s.only);
985
- for (const s of n)
986
- await this.runSuiteByIds(s, r, o);
987
- return x;
1078
+ const t = new Set(e), r = Array.from(m.values()).filter((o) => !o.parent && o.type === "suite"), n = Array.from(m.values()).some((o) => o.only);
1079
+ for (const o of r) await this.runSuiteByIds(o, t, n);
1080
+ return m;
988
1081
  }
989
- async runSuiteByIds(e, r, n) {
990
- if (!this.hasDescendantInSet(e, r)) return;
991
- if (oe(e.id) && !D(e.id)) {
1082
+ async runSuiteByIds(e, t, r) {
1083
+ if (!this.hasDescendantInSet(e, t)) return;
1084
+ if (le(e.id) && !F(e.id)) {
992
1085
  this.events.onSkip?.(e);
993
1086
  return;
994
1087
  }
995
- if (n && !D(e.id)) return;
1088
+ if (r && !F(e.id)) return;
996
1089
  this.events.onSuiteStart?.(e);
997
- const l = (e.children || []).map((d) => x.get(d));
998
- for (const d of l)
999
- d.type === "suite" ? await this.runSuiteByIds(d, r, n) : d.type === "test" && r.has(d.id) && await this.runTest(d, n);
1090
+ const n = (e.children || []).map((o) => m.get(o));
1091
+ for (const o of n) o.type === "suite" ? await this.runSuiteByIds(o, t, r) : o.type === "test" && t.has(o.id) && await this.runTest(o, r);
1000
1092
  this.events.onSuiteEnd?.(e);
1001
1093
  }
1002
- hasDescendantInSet(e, r) {
1003
- return r.has(e.id) ? !0 : e.children ? e.children.some((n) => {
1004
- const o = x.get(n);
1005
- return o ? this.hasDescendantInSet(o, r) : !1;
1094
+ hasDescendantInSet(e, t) {
1095
+ return t.has(e.id) ? !0 : e.children ? e.children.some((r) => {
1096
+ const n = m.get(r);
1097
+ return n ? this.hasDescendantInSet(n, t) : !1;
1006
1098
  }) : !1;
1007
1099
  }
1008
- async runSuite(e, r) {
1009
- if (oe(e.id) && !D(e.id)) {
1100
+ async runSuite(e, t) {
1101
+ if (le(e.id) && !F(e.id)) {
1010
1102
  this.events.onSkip?.(e);
1011
1103
  return;
1012
1104
  }
1013
- if (r && !D(e.id)) return;
1105
+ if (t && !F(e.id)) return;
1014
1106
  this.events.onSuiteStart?.(e);
1015
- const o = (e.children || []).map((s) => x.get(s));
1016
- for (const s of o)
1017
- s.type === "suite" ? await this.runSuite(s, r) : s.type === "test" && await this.runTest(s, r);
1107
+ const r = (e.children || []).map((n) => m.get(n));
1108
+ for (const n of r) n.type === "suite" ? await this.runSuite(n, t) : n.type === "test" && await this.runTest(n, t);
1018
1109
  this.events.onSuiteEnd?.(e);
1019
1110
  }
1020
- async runTest(e, r) {
1021
- if ((oe(e.id) || e.skip) && !e.only) {
1111
+ async runTest(e, t) {
1112
+ if ((le(e.id) || e.skip) && !e.only) {
1022
1113
  this.events.onSkip(e);
1023
1114
  return;
1024
1115
  }
1025
- const o = zt(e.id);
1026
- if (r && !e.only && !o) {
1116
+ const r = Ft(e.id);
1117
+ if (t && !e.only && !r) {
1027
1118
  this.events.onSkip(e);
1028
1119
  return;
1029
1120
  }
1030
1121
  this.events.onStart?.(e);
1031
- const s = Mt(e.parent);
1032
- let l = null;
1033
- for (let d = 1; d <= this.retryCount; d++)
1034
- try {
1035
- for (const u of s.before) await u();
1036
- e.logs = [], await e.handler(), this.events.onPass(e, d > 1 ? d : void 0);
1037
- return;
1038
- } catch (u) {
1039
- l = u;
1040
- } finally {
1041
- for (const u of s.after) await u();
1042
- }
1043
- this.events.onFail(e, l);
1122
+ const n = Pt(e.parent);
1123
+ let o = null;
1124
+ for (let s = 1; s <= this.retryCount; s++) try {
1125
+ for (const l of n.before) await l();
1126
+ e.logs = [], await e.handler(), this.events.onPass(e, s > 1 ? s : void 0);
1127
+ return;
1128
+ } catch (l) {
1129
+ o = l;
1130
+ } finally {
1131
+ for (const l of n.after) await l();
1132
+ }
1133
+ this.events.onFail(e, o);
1044
1134
  }
1045
- }
1046
- window.__testRunner = Xe;
1047
- const ge = "1.6.1", Nt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
1135
+ };
1136
+ window.__testRunner = Ze;
1137
+ var me = "1.6.3", Ot = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
1048
1138
  rules: [],
1049
1139
  counts: {}
1050
1140
  }), window.__TWD_MOCK_STATE__) : {
1051
1141
  rules: [],
1052
1142
  counts: {}
1053
- }, O = Nt(), me = O.rules;
1054
- let Me = !1;
1055
- const Wt = async (t) => {
1056
- if (Me) {
1143
+ }, q = Ot(), ye = q.rules, We = !1, jt = async (e) => {
1144
+ if (We) {
1057
1145
  console.warn("[TWD] Request mocking already initialized");
1058
1146
  return;
1059
1147
  }
1060
- if ("serviceWorker" in navigator) {
1061
- Me = !0;
1062
- const e = t ?? "/mock-sw.js";
1063
- await navigator.serviceWorker.register(`${e}?v=${ge}`), navigator.serviceWorker.controller || await new Promise((r) => {
1064
- navigator.serviceWorker.addEventListener("controllerchange", r, { once: !0 });
1065
- }), navigator.serviceWorker.addEventListener("message", (r) => {
1066
- if (r.data?.type === "EXECUTED") {
1067
- const { alias: n, request: o, hitCount: s } = r.data, l = me.find((d) => d.alias === n);
1068
- l && (l.executed = !0, l.request = o, l.hitCount = s), O.counts[n] = s ?? (O.counts[n] ?? 0) + 1;
1069
- }
1070
- });
1071
- }
1072
- }, Ht = () => me, Bt = () => {
1148
+ "serviceWorker" in navigator && (We = !0, await navigator.serviceWorker.register(`${e ?? "/mock-sw.js"}?v=${me}`), navigator.serviceWorker.controller || await new Promise((t) => {
1149
+ navigator.serviceWorker.addEventListener("controllerchange", t, { once: !0 });
1150
+ }), navigator.serviceWorker.addEventListener("message", (t) => {
1151
+ if (t.data?.type === "EXECUTED") {
1152
+ const { alias: r, request: n, hitCount: o } = t.data, s = ye.find((l) => l.alias === r);
1153
+ s && (s.executed = !0, s.request = n, s.hitCount = o), q.counts[r] = o ?? (q.counts[r] ?? 0) + 1;
1154
+ }
1155
+ }));
1156
+ }, Ut = () => ye, qt = () => {
1073
1157
  navigator.serviceWorker.controller?.postMessage({
1074
1158
  type: "CLEAR_RULES",
1075
- version: ge
1076
- }), me.length = 0;
1077
- for (const t in O.counts)
1078
- delete O.counts[t];
1079
- }, Dt = () => /* @__PURE__ */ c(re, { className: "lucide-wifi-pen-icon lucide-wifi-pen", dataTestId: "wifi-pen-icon", children: [
1080
- /* @__PURE__ */ c("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
1081
- /* @__PURE__ */ c("path", { d: "M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z" }),
1082
- /* @__PURE__ */ c("path", { d: "M5 12.859a10 10 0 0 1 10.5-2.222" }),
1083
- /* @__PURE__ */ c("path", { d: "M8.5 16.429a5 5 0 0 1 3-1.406" })
1084
- ] }), Ft = () => {
1085
- const t = Ht(), e = t.filter((n) => n.executed);
1086
- return /* @__PURE__ */ c(
1087
- "button",
1088
- {
1089
- onClick: () => {
1090
- console.group("🌐 TWD Mock Rules"), console.log("Total rules:", t.length), console.log("Triggered rules:", e.length), console.log("Rules details:"), console.log(t), console.groupEnd();
1091
- },
1092
- "aria-label": "View mock rules details in console",
1093
- style: {
1094
- background: "var(--twd-button-secondary)",
1095
- border: "1px solid var(--twd-button-border)",
1096
- borderRadius: "var(--twd-border-radius-lg)",
1097
- padding: "var(--twd-spacing-md) var(--twd-spacing-lg)",
1098
- cursor: "pointer",
1099
- fontSize: "var(--twd-font-size-sm)",
1100
- color: "var(--twd-button-secondary-text)",
1101
- display: "flex",
1102
- alignItems: "center",
1103
- gap: "var(--twd-spacing-md)",
1104
- marginBottom: "10px",
1105
- width: "100%",
1106
- textAlign: "left",
1107
- transition: "all var(--twd-animation-duration) ease",
1108
- boxShadow: "var(--twd-shadow-sm)"
1109
- },
1110
- children: [
1111
- /* @__PURE__ */ c(Dt, {}),
1112
- /* @__PURE__ */ c("span", { style: { flex: 1 }, children: [
1159
+ version: me
1160
+ }), ye.length = 0;
1161
+ for (const e in q.counts) delete q.counts[e];
1162
+ }, Vt = () => /* @__PURE__ */ c(se, {
1163
+ className: "lucide-wifi-pen-icon lucide-wifi-pen",
1164
+ dataTestId: "wifi-pen-icon",
1165
+ children: [
1166
+ /* @__PURE__ */ c("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
1167
+ /* @__PURE__ */ c("path", { d: "M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z" }),
1168
+ /* @__PURE__ */ c("path", { d: "M5 12.859a10 10 0 0 1 10.5-2.222" }),
1169
+ /* @__PURE__ */ c("path", { d: "M8.5 16.429a5 5 0 0 1 3-1.406" })
1170
+ ]
1171
+ }), Jt = () => {
1172
+ const e = Ut(), t = e.filter((n) => n.executed);
1173
+ return /* @__PURE__ */ c("button", {
1174
+ onClick: () => {
1175
+ console.group("🌐 TWD Mock Rules"), console.log("Total rules:", e.length), console.log("Triggered rules:", t.length), console.log("Rules details:"), console.log(e), console.groupEnd();
1176
+ },
1177
+ "aria-label": "View mock rules details in console",
1178
+ style: {
1179
+ background: "var(--twd-button-secondary)",
1180
+ border: "1px solid var(--twd-button-border)",
1181
+ borderRadius: "var(--twd-border-radius-lg)",
1182
+ padding: "var(--twd-spacing-md) var(--twd-spacing-lg)",
1183
+ cursor: "pointer",
1184
+ fontSize: "var(--twd-font-size-sm)",
1185
+ color: "var(--twd-button-secondary-text)",
1186
+ display: "flex",
1187
+ alignItems: "center",
1188
+ gap: "var(--twd-spacing-md)",
1189
+ marginBottom: "10px",
1190
+ width: "100%",
1191
+ textAlign: "left",
1192
+ transition: "all var(--twd-animation-duration) ease",
1193
+ boxShadow: "var(--twd-shadow-sm)"
1194
+ },
1195
+ children: [
1196
+ /* @__PURE__ */ c(Vt, {}),
1197
+ /* @__PURE__ */ c("span", {
1198
+ style: { flex: 1 },
1199
+ children: [
1113
1200
  "Rules: ",
1114
- e.length,
1115
- "/",
1116
1201
  t.length,
1202
+ "/",
1203
+ e.length,
1117
1204
  " triggered"
1118
- ] }),
1119
- /* @__PURE__ */ c("span", { style: {
1205
+ ]
1206
+ }),
1207
+ /* @__PURE__ */ c("span", {
1208
+ style: {
1120
1209
  fontSize: "var(--twd-font-size-xs)",
1121
1210
  color: "var(--twd-text)",
1122
1211
  fontWeight: "var(--twd-font-weight-medium)"
1123
- }, children: "View rules in console" })
1124
- ]
1125
- }
1126
- );
1127
- }, Pt = /* @__PURE__ */ new Map();
1128
- function Ot() {
1129
- Pt.clear();
1212
+ },
1213
+ children: "View rules in console"
1214
+ })
1215
+ ]
1216
+ });
1217
+ }, Xt = /* @__PURE__ */ new Map();
1218
+ function Gt() {
1219
+ Xt.clear();
1130
1220
  }
1131
- const Ut = (t) => t instanceof Error && "actual" in t && "expected" in t, Ge = (t) => t.actual !== void 0 && t.expected !== void 0 ? {
1221
+ var Kt = (e) => e instanceof Error && "actual" in e && "expected" in e, et = (e) => e.actual !== void 0 && e.expected !== void 0 ? {
1132
1222
  type: "diff",
1133
- actual: t.actual,
1134
- expected: t.expected,
1135
- operator: t.operator
1223
+ actual: e.actual,
1224
+ expected: e.expected,
1225
+ operator: e.operator
1136
1226
  } : {
1137
1227
  type: "message",
1138
- message: t.message
1139
- }, jt = (t) => {
1140
- const e = Ge(t);
1141
- if (e.type === "diff") {
1142
- const r = e.operator || "unknown";
1143
- console.error(`Assertion failed with operator: ${r}`), console.group("Expected:"), console.log(e.expected), console.groupEnd(), console.group("Actual:"), console.log(e.actual), console.groupEnd();
1144
- } else
1145
- console.error(e.message);
1146
- }, qt = (t) => {
1147
- if (t.status === "pass")
1148
- return `Test "${t.name}" passed.`;
1149
- if (t.status === "fail") {
1150
- if (!t.logs || t.logs.length === 0)
1151
- return `Test "${t.name}" failed.`;
1152
- const e = t.logs[t.logs.length - 1];
1228
+ message: e.message
1229
+ }, Yt = (e) => {
1230
+ const t = et(e);
1231
+ t.type === "diff" ? (console.error(`Assertion failed with operator: ${t.operator || "unknown"}`), console.group("Expected:"), console.log(t.expected), console.groupEnd(), console.group("Actual:"), console.log(t.actual), console.groupEnd()) : console.error(t.message);
1232
+ }, Qt = (e) => {
1233
+ if (e.status === "pass") return `Test "${e.name}" passed.`;
1234
+ if (e.status === "fail") {
1235
+ if (!e.logs || e.logs.length === 0) return `Test "${e.name}" failed.`;
1236
+ const t = e.logs[e.logs.length - 1];
1153
1237
  try {
1154
- const r = JSON.parse(e);
1155
- return r.type === A.CHAI_MESSAGE || r.type === A.ERROR ? `Test "${t.name}" failed. ${r.message}` : r.type === A.CHAI_DIFF ? `Test "${t.name}" failed. Expected value does not match actual value.` : `Test "${t.name}" failed.`;
1238
+ const r = JSON.parse(t);
1239
+ return r.type === L.CHAI_MESSAGE || r.type === L.ERROR ? `Test "${e.name}" failed. ${r.message}` : r.type === L.CHAI_DIFF ? `Test "${e.name}" failed. Expected value does not match actual value.` : `Test "${e.name}" failed.`;
1156
1240
  } catch {
1157
- return `Test "${t.name}" failed. ${e}`;
1241
+ return `Test "${e.name}" failed. ${t}`;
1158
1242
  }
1159
- } else if (t.status === "skip")
1160
- return `Test "${t.name}" skipped.`;
1243
+ } else if (e.status === "skip") return `Test "${e.name}" skipped.`;
1161
1244
  return "";
1162
- }, Vt = (t) => {
1163
- const e = t.filter((l) => l.type === "test"), r = e.filter((l) => l.status === "pass").length, n = e.filter((l) => l.status === "fail").length, o = e.filter((l) => l.status === "skip").length, s = [];
1245
+ }, Zt = (e) => {
1246
+ const t = e.filter((l) => l.type === "test"), r = t.filter((l) => l.status === "pass").length, n = t.filter((l) => l.status === "fail").length, o = t.filter((l) => l.status === "skip").length, s = [];
1164
1247
  return n > 0 ? (s.push("Test run completed."), s.push(`${r} test${r !== 1 ? "s" : ""} passed`), s.push(`${n} test${n !== 1 ? "s" : ""} failed`), o > 0 && s.push(`${o} test${o !== 1 ? "s" : ""} skipped`), s.join(", ") + ".") : (s.push("All tests passed."), s.push(`${r} test${r !== 1 ? "s" : ""} completed`), o > 0 && s.push(`${o} test${o !== 1 ? "s" : ""} skipped`), s.join(", ") + ".");
1165
- }, Jt = ({ value: t, onChange: e }) => /* @__PURE__ */ c("div", { style: { position: "relative", marginBottom: "var(--twd-spacing-md)" }, children: /* @__PURE__ */ c(
1166
- "input",
1167
- {
1248
+ }, er = ({ value: e, onChange: t }) => /* @__PURE__ */ c("div", {
1249
+ style: {
1250
+ position: "relative",
1251
+ marginBottom: "var(--twd-spacing-md)"
1252
+ },
1253
+ children: /* @__PURE__ */ c("input", {
1168
1254
  type: "search",
1169
1255
  id: "twd-search-input",
1170
1256
  "aria-label": "Filter tests",
1171
1257
  placeholder: "Filter tests...",
1172
- value: t,
1173
- onChange: (r) => e(r.target.value),
1258
+ value: e,
1259
+ onInput: (r) => t(r.target.value),
1174
1260
  style: {
1175
1261
  width: "100%",
1176
1262
  padding: "var(--twd-spacing-md)",
@@ -1182,151 +1268,174 @@ const Ut = (t) => t instanceof Error && "actual" in t && "expected" in t, Ge = (
1182
1268
  boxSizing: "border-box",
1183
1269
  outline: "none"
1184
1270
  }
1185
- }
1186
- ) }), Xt = (t, e) => {
1187
- if (!e.trim()) return t;
1188
- const r = e.toLowerCase(), n = (o) => {
1271
+ })
1272
+ }), tr = (e, t) => {
1273
+ if (!t.trim()) return e;
1274
+ const r = t.toLowerCase(), n = (o) => {
1189
1275
  const s = o.name.toLowerCase().includes(r);
1190
- if (o.type === "test")
1191
- return s ? o : null;
1276
+ if (o.type === "test") return s ? o : null;
1192
1277
  const l = (o.childrenNodes || []).map(n).filter((d) => d !== null);
1193
1278
  return s || l.length > 0 ? {
1194
1279
  ...o,
1195
1280
  childrenNodes: s ? o.childrenNodes : l
1196
1281
  } : null;
1197
1282
  };
1198
- return t.map(n).filter((o) => o !== null);
1199
- }, Gt = (t) => {
1200
- const e = /* @__PURE__ */ new Map(), r = [];
1201
- for (const n of t) e.set(n.id, { ...n, childrenNodes: [] });
1202
- for (const n of e.values())
1203
- n.parent ? e.get(n.parent)?.childrenNodes?.push(n) : r.push(n);
1283
+ return e.map(n).filter((o) => o !== null);
1284
+ }, rr = (e) => {
1285
+ const t = /* @__PURE__ */ new Map(), r = [];
1286
+ for (const n of e) t.set(n.id, {
1287
+ ...n,
1288
+ childrenNodes: []
1289
+ });
1290
+ for (const n of t.values()) n.parent ? t.get(n.parent)?.childrenNodes?.push(n) : r.push(n);
1204
1291
  return r;
1205
- }, Kt = {
1206
- left: { left: 0, borderRight: "1px solid var(--twd-border)" },
1207
- right: { right: 0, borderLeft: "1px solid var(--twd-border)" }
1208
- }, Yt = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Qt = (t) => t ? sessionStorage.getItem("twd-search-filter") || "" : (sessionStorage.removeItem("twd-search-filter"), ""), Zt = (t) => sessionStorage.getItem("twd-sidebar-open") ? sessionStorage.getItem("twd-sidebar-open") === "true" : t, Ke = (t) => {
1209
- const e = [];
1210
- for (const r of t)
1211
- r.type === "test" && e.push(r.id), r.childrenNodes && e.push(...Ke(r.childrenNodes));
1212
- return e;
1213
- }, er = ({ open: t, position: e = "left", search: r }) => {
1214
- const [n, o] = B(0), [s, l] = B(Zt(t));
1215
- At({ isOpen: s, position: e });
1216
- const [d, u] = B(""), [a, p] = B(Qt(r));
1217
- te(() => {
1218
- const h = () => o((y) => y + 1);
1292
+ }, nr = {
1293
+ left: {
1294
+ left: 0,
1295
+ borderRight: "1px solid var(--twd-border)"
1296
+ },
1297
+ right: {
1298
+ right: 0,
1299
+ borderLeft: "1px solid var(--twd-border)"
1300
+ }
1301
+ }, or = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', sr = (e) => e ? sessionStorage.getItem("twd-search-filter") || "" : (sessionStorage.removeItem("twd-search-filter"), ""), ir = (e) => sessionStorage.getItem("twd-sidebar-open") ? sessionStorage.getItem("twd-sidebar-open") === "true" : e, tt = (e) => {
1302
+ const t = [];
1303
+ for (const r of e)
1304
+ r.type === "test" && t.push(r.id), r.childrenNodes && t.push(...tt(r.childrenNodes));
1305
+ return t;
1306
+ }, ar = ({ open: e, position: t = "left", search: r }) => {
1307
+ const [n, o] = P(0), [s, l] = P(ir(e));
1308
+ Wt({
1309
+ isOpen: s,
1310
+ position: t
1311
+ });
1312
+ const [d, u] = P(""), [a, p] = P(sr(r));
1313
+ oe(() => {
1314
+ const h = () => o((b) => b + 1);
1219
1315
  return window.addEventListener("twd:state-change", h), () => window.removeEventListener("twd:state-change", h);
1220
1316
  }, []);
1221
- const i = new Xe({
1317
+ const i = new Ze({
1222
1318
  onStart: (h) => {
1223
- h.status = "running", o((y) => y + 1);
1319
+ h.status = "running", o((b) => b + 1);
1224
1320
  },
1225
1321
  onPass: (h) => {
1226
- h.status = "pass", o((y) => y + 1);
1322
+ h.status = "pass", o((b) => b + 1);
1227
1323
  },
1228
- onFail: (h, y) => {
1229
- if (h.status = "fail", console.group(`%c❌ Test failed: ${h.name}`, "color: red; font-weight: bold;"), Ut(y)) {
1230
- jt(y);
1231
- const C = Ge(y);
1232
- C.type === "diff" ? h.logs.push(JSON.stringify({
1233
- type: A.CHAI_DIFF,
1234
- expected: C.expected,
1235
- actual: C.actual
1324
+ onFail: (h, b) => {
1325
+ if (h.status = "fail", console.group(`%c❌ Test failed: ${h.name}`, "color: red; font-weight: bold;"), Kt(b)) {
1326
+ Yt(b);
1327
+ const R = et(b);
1328
+ R.type === "diff" ? h.logs.push(JSON.stringify({
1329
+ type: L.CHAI_DIFF,
1330
+ expected: R.expected,
1331
+ actual: R.actual
1236
1332
  })) : h.logs.push(JSON.stringify({
1237
- type: A.CHAI_MESSAGE,
1238
- message: `Test failed: ${C.message}`
1333
+ type: L.CHAI_MESSAGE,
1334
+ message: `Test failed: ${R.message}`
1239
1335
  }));
1240
1336
  } else
1241
- console.error(y.message), h.logs.push(JSON.stringify({
1242
- type: A.ERROR,
1243
- message: `Test failed: ${y.message}`
1337
+ console.error(b.message), h.logs.push(JSON.stringify({
1338
+ type: L.ERROR,
1339
+ message: `Test failed: ${b.message}`
1244
1340
  }));
1245
- console.groupEnd(), o((C) => C + 1);
1341
+ console.groupEnd(), o((R) => R + 1);
1246
1342
  },
1247
1343
  onSkip: (h) => {
1248
- h.status = "skip", o((y) => y + 1);
1344
+ h.status = "skip", o((b) => b + 1);
1249
1345
  }
1250
1346
  }), f = (h) => {
1251
1347
  p(h), h ? sessionStorage.setItem("twd-search-filter", h) : sessionStorage.removeItem("twd-search-filter");
1252
1348
  }, _ = (h) => {
1253
1349
  l(h), sessionStorage.setItem("twd-sidebar-open", h.toString());
1254
- }, v = Array.from(x.values()), T = z(
1255
- () => Gt(v),
1256
- // eslint-disable-next-line react-hooks/exhaustive-deps
1257
- [n]
1258
- ), b = z(
1259
- () => Xt(T, a),
1260
- [T, a]
1261
- ), { filteredTestIds: m, displayTests: g } = z(() => {
1350
+ }, w = Array.from(m.values()), C = N(() => rr(w), [n]), k = N(() => tr(C, a), [C, a]), { filteredTestIds: v, displayTests: g } = N(() => {
1262
1351
  if (a) {
1263
- const h = Ke(b), y = new Set(h);
1352
+ const h = tt(k), b = new Set(h);
1264
1353
  return {
1265
1354
  filteredTestIds: h,
1266
- displayTests: v.filter((C) => C.type === "test" && y.has(C.id))
1355
+ displayTests: w.filter((R) => R.type === "test" && b.has(R.id))
1267
1356
  };
1268
1357
  }
1269
1358
  return {
1270
1359
  filteredTestIds: null,
1271
- displayTests: v.filter((h) => h.type === "test")
1360
+ displayTests: w.filter((h) => h.type === "test")
1272
1361
  };
1273
- }, [b, a, n]), I = async () => {
1274
- u(""), sessionStorage.removeItem("twd-last-run-test-name"), m ? await i.runByIds(m) : await i.runAll();
1275
- const h = Vt(v);
1276
- u(h);
1277
- }, $ = async (h) => {
1278
- const y = Array.from(x.values()).filter((R) => R.type === "test").find((R) => R.id === h);
1279
- if (!y) return;
1280
- u(""), sessionStorage.setItem("twd-last-run-test-name", y.name), await i.runSingle(y.id);
1281
- const C = qt(y);
1282
- u(C);
1362
+ }, [
1363
+ k,
1364
+ a,
1365
+ n
1366
+ ]), $ = async () => {
1367
+ u(""), sessionStorage.removeItem("twd-last-run-test-name"), v ? await i.runByIds(v) : await i.runAll(), u(Zt(w));
1368
+ }, I = async (h) => {
1369
+ const b = Array.from(m.values()).filter((R) => R.type === "test").find((R) => R.id === h);
1370
+ b && (u(""), sessionStorage.setItem("twd-last-run-test-name", b.name), await i.runSingle(b.id), u(Qt(b)));
1283
1371
  };
1284
- if (!s)
1285
- return /* @__PURE__ */ c(Et, { position: e, setOpen: _ });
1286
- const L = g.length;
1287
- return /* @__PURE__ */ c(
1288
- "div",
1289
- {
1290
- style: {
1291
- fontFamily: Yt,
1292
- position: "fixed",
1293
- top: 0,
1294
- bottom: 0,
1295
- width: "var(--twd-sidebar-width)",
1296
- background: "var(--twd-background)",
1297
- fontSize: "var(--twd-font-size-md)",
1298
- overflowY: "auto",
1299
- boxShadow: "var(--twd-shadow)",
1300
- textAlign: "left",
1301
- zIndex: "var(--twd-z-index-sidebar)",
1302
- pointerEvents: "all",
1303
- isolation: "isolate",
1304
- ...Kt[e]
1305
- },
1306
- "data-testid": "twd-sidebar",
1307
- role: "complementary",
1308
- "aria-label": "Test While Developing sidebar",
1309
- children: [
1310
- /* @__PURE__ */ c("div", { "aria-live": "polite", "aria-atomic": "true", style: { position: "absolute", width: "1px", height: "1px", margin: "-1px", border: "0", padding: "0", overflow: "hidden", clip: "rect(0 0 0 0)" }, children: d }),
1311
- /* @__PURE__ */ c("div", { style: {
1372
+ if (!s) return /* @__PURE__ */ c(Nt, {
1373
+ position: t,
1374
+ setOpen: _
1375
+ });
1376
+ const z = g.length;
1377
+ return /* @__PURE__ */ c("div", {
1378
+ style: {
1379
+ fontFamily: or,
1380
+ position: "fixed",
1381
+ top: 0,
1382
+ bottom: 0,
1383
+ width: "var(--twd-sidebar-width)",
1384
+ background: "var(--twd-background)",
1385
+ fontSize: "var(--twd-font-size-md)",
1386
+ overflowY: "auto",
1387
+ boxShadow: "var(--twd-shadow)",
1388
+ textAlign: "left",
1389
+ zIndex: "var(--twd-z-index-sidebar)",
1390
+ pointerEvents: "all",
1391
+ isolation: "isolate",
1392
+ ...nr[t]
1393
+ },
1394
+ "data-testid": "twd-sidebar",
1395
+ role: "complementary",
1396
+ "aria-label": "Test While Developing sidebar",
1397
+ children: [
1398
+ /* @__PURE__ */ c("div", {
1399
+ "aria-live": "polite",
1400
+ "aria-atomic": "true",
1401
+ style: {
1402
+ position: "absolute",
1403
+ width: "1px",
1404
+ height: "1px",
1405
+ margin: "-1px",
1406
+ border: "0",
1407
+ padding: "0",
1408
+ overflow: "hidden",
1409
+ clip: "rect(0 0 0 0)"
1410
+ },
1411
+ children: d
1412
+ }),
1413
+ /* @__PURE__ */ c("div", {
1414
+ "data-testid": "twd-sidebar-header",
1415
+ style: {
1312
1416
  padding: "var(--twd-spacing-md)",
1313
1417
  background: "var(--twd-background)",
1314
1418
  position: "sticky",
1315
1419
  top: 0,
1316
1420
  zIndex: "var(--twd-z-index-sticky)",
1317
1421
  borderBottom: "1px solid var(--twd-border)"
1318
- }, children: [
1319
- /* @__PURE__ */ c("div", { style: {
1320
- display: "flex",
1321
- justifyContent: "space-between",
1322
- alignItems: "center",
1323
- marginBottom: "var(--twd-spacing-xl)"
1324
- }, children: [
1325
- /* @__PURE__ */ c("div", { style: { display: "flex", gap: "var(--twd-spacing-xs)" }, children: [
1326
- /* @__PURE__ */ c(
1327
- "button",
1328
- {
1329
- onClick: I,
1422
+ },
1423
+ children: [
1424
+ /* @__PURE__ */ c("div", {
1425
+ style: {
1426
+ display: "flex",
1427
+ justifyContent: "space-between",
1428
+ alignItems: "center",
1429
+ marginBottom: "var(--twd-spacing-xl)"
1430
+ },
1431
+ children: [/* @__PURE__ */ c("div", {
1432
+ style: {
1433
+ display: "flex",
1434
+ gap: "var(--twd-spacing-xs)"
1435
+ },
1436
+ children: [
1437
+ /* @__PURE__ */ c("button", {
1438
+ onClick: $,
1330
1439
  style: {
1331
1440
  background: "var(--twd-button-primary)",
1332
1441
  color: "var(--twd-button-primary-text)",
@@ -1335,14 +1444,14 @@ const Ut = (t) => t instanceof Error && "actual" in t && "expected" in t, Ge = (
1335
1444
  border: "none",
1336
1445
  cursor: "pointer"
1337
1446
  },
1338
- children: /* @__PURE__ */ c("span", { "aria-live": "polite", children: a ? "Run Filtered" : "Run All" })
1339
- }
1340
- ),
1341
- /* @__PURE__ */ c(
1342
- "button",
1343
- {
1447
+ children: /* @__PURE__ */ c("span", {
1448
+ "aria-live": "polite",
1449
+ children: a ? "Run Filtered" : "Run All"
1450
+ })
1451
+ }),
1452
+ /* @__PURE__ */ c("button", {
1344
1453
  onClick: () => {
1345
- Bt(), Ot();
1454
+ qt(), Gt();
1346
1455
  },
1347
1456
  "aria-label": "Clear all mocks",
1348
1457
  style: {
@@ -1354,83 +1463,87 @@ const Ut = (t) => t instanceof Error && "actual" in t && "expected" in t, Ge = (
1354
1463
  cursor: "pointer"
1355
1464
  },
1356
1465
  children: "Clear mocks"
1357
- }
1358
- ),
1359
- /* @__PURE__ */ c("span", { style: {
1360
- color: "var(--twd-text-secondary)",
1361
- fontSize: "var(--twd-font-size-sm)",
1362
- alignSelf: "center"
1363
- }, children: [
1364
- "v",
1365
- ge
1366
- ] })
1367
- ] }),
1368
- /* @__PURE__ */ c(
1369
- "button",
1370
- {
1371
- "aria-label": "Close sidebar",
1372
- style: {
1373
- background: "transparent",
1374
- border: "none",
1375
- cursor: "pointer",
1376
- fontSize: "var(--twd-font-size-md)",
1377
- paddingRight: "0",
1378
- paddingLeft: "0"
1379
- },
1380
- onClick: () => _(!1),
1381
- children: ""
1382
- }
1383
- )
1384
- ] }),
1385
- /* @__PURE__ */ c("div", { style: {
1386
- display: "flex",
1387
- justifyContent: "space-between",
1388
- alignItems: "center",
1389
- fontSize: "var(--twd-font-size-md)",
1390
- color: "var(--twd-text-secondary)",
1391
- marginBottom: "10px"
1392
- }, children: [
1393
- /* @__PURE__ */ c("span", { style: { color: "var(--twd-text)" }, children: [
1394
- "Total: ",
1395
- L
1396
- ] }),
1397
- /* @__PURE__ */ c("div", { style: { display: "flex", gap: "var(--twd-spacing-xs)" }, children: [
1398
- /* @__PURE__ */ c("span", { style: { color: "var(--twd-success)" }, children: [
1399
- " ",
1400
- g.filter((h) => h.status === "pass").length
1401
- ] }),
1402
- /* @__PURE__ */ c("span", { style: { color: "var(--twd-error)" }, children: [
1403
- "✗ ",
1404
- g.filter((h) => h.status === "fail").length
1405
- ] })
1406
- ] })
1407
- ] }),
1408
- /* @__PURE__ */ c(Ft, {}),
1409
- r && /* @__PURE__ */ c(Jt, { value: a, onChange: f })
1410
- ] }),
1411
- /* @__PURE__ */ c("div", { style: { padding: "var(--twd-spacing-md)" }, children: /* @__PURE__ */ c(
1412
- It,
1413
- {
1414
- roots: b,
1415
- runTest: $,
1416
- searchQuery: a
1417
- }
1418
- ) })
1419
- ]
1420
- }
1421
- );
1422
- }, tr = (t) => ({
1423
- render: (e) => {
1424
- it(e, t);
1425
- }
1426
- }), nr = (t, e) => {
1427
- const { open: r = !0, position: n = "left", serviceWorker: o = !0, serviceWorkerUrl: s = "/mock-sw.js", theme: l, search: d } = e || {};
1428
- _t(t, /* @__PURE__ */ c(er, { open: r, position: n, ...d !== void 0 && { search: d } }), tr, l), o && Wt(s).then(() => {
1466
+ }),
1467
+ /* @__PURE__ */ c("span", {
1468
+ style: {
1469
+ color: "var(--twd-text-secondary)",
1470
+ fontSize: "var(--twd-font-size-sm)",
1471
+ alignSelf: "center"
1472
+ },
1473
+ children: ["v", me]
1474
+ })
1475
+ ]
1476
+ }), /* @__PURE__ */ c("button", {
1477
+ "aria-label": "Close sidebar",
1478
+ style: {
1479
+ background: "transparent",
1480
+ border: "none",
1481
+ cursor: "pointer",
1482
+ fontSize: "var(--twd-font-size-md)",
1483
+ paddingRight: "0",
1484
+ paddingLeft: "0"
1485
+ },
1486
+ onClick: () => _(!1),
1487
+ children: ""
1488
+ })]
1489
+ }),
1490
+ /* @__PURE__ */ c("div", {
1491
+ style: {
1492
+ display: "flex",
1493
+ justifyContent: "space-between",
1494
+ alignItems: "center",
1495
+ fontSize: "var(--twd-font-size-md)",
1496
+ color: "var(--twd-text-secondary)",
1497
+ marginBottom: "10px"
1498
+ },
1499
+ children: [/* @__PURE__ */ c("span", {
1500
+ style: { color: "var(--twd-text)" },
1501
+ children: ["Total: ", z]
1502
+ }), /* @__PURE__ */ c("div", {
1503
+ style: {
1504
+ display: "flex",
1505
+ gap: "var(--twd-spacing-xs)"
1506
+ },
1507
+ children: [/* @__PURE__ */ c("span", {
1508
+ style: { color: "var(--twd-success)" },
1509
+ children: ["✓ ", g.filter((h) => h.status === "pass").length]
1510
+ }), /* @__PURE__ */ c("span", {
1511
+ style: { color: "var(--twd-error)" },
1512
+ children: ["✗ ", g.filter((h) => h.status === "fail").length]
1513
+ })]
1514
+ })]
1515
+ }),
1516
+ /* @__PURE__ */ c(Jt, {}),
1517
+ r && /* @__PURE__ */ c(er, {
1518
+ value: a,
1519
+ onChange: f
1520
+ })
1521
+ ]
1522
+ }),
1523
+ /* @__PURE__ */ c("div", {
1524
+ style: { padding: "var(--twd-spacing-md)" },
1525
+ children: /* @__PURE__ */ c(Mt, {
1526
+ roots: k,
1527
+ runTest: I,
1528
+ searchQuery: a
1529
+ })
1530
+ })
1531
+ ]
1532
+ });
1533
+ }, lr = (e) => ({ render: (t) => {
1534
+ ut(t, e);
1535
+ } }), dr = (e, t) => {
1536
+ const { open: r = !0, position: n = "left", serviceWorker: o = !0, serviceWorkerUrl: s = "/mock-sw.js", theme: l, search: d } = t || {};
1537
+ gt(e, /* @__PURE__ */ c(ar, {
1538
+ open: r,
1539
+ position: n,
1540
+ ...d !== void 0 && { search: d }
1541
+ }), lr, l), o && jt(s).then(() => {
1429
1542
  console.log("Request mocking initialized");
1430
1543
  }).catch((u) => {
1431
1544
  console.error("Error initializing request mocking:", u);
1432
1545
  });
1433
1546
  };
1434
1547
  export {
1435
- nr as initTWD
1548
+ dr as initTWD
1436
1549
  };