twd-js 1.6.1 → 1.6.2

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, m, 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), (m = !!(4 & _.__u)) || f.__k === _.__k ? u = je(_, u, e, m) : 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, m, 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 (m = 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(m, I) : (t.__c = i = new K(m, 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(m, 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 && m !== _ && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, I), t.__v == r.__v || !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, I) === !1) {
135
+ t.__v != r.__v && (i.props = m, 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(m, 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 = m, 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, m = 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) {
189
+ if (e == null) {
176
190
  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;
191
+ e = document.createElementNS(o, g, m.is && m), 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 === m || d && e.data == m || (e.data = m);
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 m || a == "value" && "defaultValue" in m || a == "checked" && "defaultChecked" in m || J(e, a, null, _, o);
197
+ for (a in m) _ = m[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,66 @@ 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
+ const t = {
301
+ ..._t,
302
+ ...e
303
+ };
304
+ return Object.entries(t).map(([r, n]) => `${`--twd-${r.replace(/([A-Z])/g, "-$1").toLowerCase()}`}: ${n};`).join(`
310
305
  `);
311
306
  }
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);
307
+ function ft(e) {
308
+ const t = "twd-theme-variables";
309
+ let r = document.getElementById(t);
310
+ r || (r = document.createElement("style"), r.id = t, document.head.appendChild(r));
311
+ const n = pt(e);
317
312
  r.textContent = `
318
313
  :root {
319
314
  ${n}
320
315
  }
321
316
  `;
322
317
  }
323
- const ut = (t) => {
324
- const { Component: e, createRoot: r, theme: n } = t;
325
- ct(n);
318
+ var ht = (e) => {
319
+ const { Component: t, createRoot: r, theme: n } = e;
320
+ ft(n);
326
321
  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];
322
+ o.setAttribute("id", "twd-sidebar-root"), document.body.appendChild(o), r(o).render(t);
323
+ }, gt = async (e, t, r, n) => {
324
+ for (const o in e) await e[o]();
325
+ ht({
326
+ Component: t,
327
+ createRoot: r,
328
+ theme: n
329
+ });
330
+ }, 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.__;
331
+ function ve(e, t) {
332
+ x.__h && x.__h(S, e, te || t), te = 0;
333
+ var r = S.__H || (S.__H = {
334
+ __: [],
335
+ __h: []
336
+ });
337
+ return e >= r.__.length && r.__.push({}), r.__[e];
337
338
  }
338
- function B(t) {
339
- return Q = 1, pt(Ve, t);
339
+ function P(e) {
340
+ return te = 1, vt(Ge, e);
340
341
  }
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) {
342
+ function vt(e, t, r) {
343
+ var n = ve(j++, 2);
344
+ if (n.t = e, !n.__c && (n.__ = [r ? r(t) : Ge(void 0, t), function(d) {
344
345
  var u = n.__N ? n.__N[0] : n.__[0], a = n.t(u, d);
345
346
  u !== a && (n.__N = [a, n.__[1]], n.__c.setState({}));
346
- }], n.__c = k, !k.__f)) {
347
+ }], n.__c = S, !S.__f)) {
347
348
  var o = function(d, u, a) {
348
349
  if (!n.__c.__H) return !0;
349
350
  var p = n.__c.__H.__.filter(function(f) {
@@ -360,274 +361,291 @@ function pt(t, e, r) {
360
361
  }
361
362
  }), s && s.call(this, d, u, a) || i;
362
363
  };
363
- k.__f = !0;
364
- var s = k.shouldComponentUpdate, l = k.componentWillUpdate;
365
- k.componentWillUpdate = function(d, u, a) {
364
+ S.__f = !0;
365
+ var s = S.shouldComponentUpdate, l = S.componentWillUpdate;
366
+ S.componentWillUpdate = function(d, u, a) {
366
367
  if (this.__e) {
367
368
  var p = s;
368
369
  s = void 0, o(d, u, a), s = p;
369
370
  }
370
371
  l && l.call(this, d, u, a);
371
- }, k.shouldComponentUpdate = o;
372
+ }, S.shouldComponentUpdate = o;
372
373
  }
373
374
  return n.__N || n.__;
374
375
  }
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));
376
+ function oe(e, t) {
377
+ var r = ve(j++, 3);
378
+ !x.__s && Xe(r.__H, t) && (r.__ = e, r.u = t, S.__H.__h.push(r));
378
379
  }
379
- function F(t) {
380
- return Q = 5, z(function() {
381
- return { current: t };
380
+ function O(e) {
381
+ return te = 5, N(function() {
382
+ return { current: e };
382
383
  }, []);
383
384
  }
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.__;
385
+ function N(e, t) {
386
+ var r = ve(j++, 7);
387
+ return Xe(r.__H, t) && (r.__ = e(), r.__H = t, r.__h = e), r.__;
387
388
  }
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 = [];
389
+ function mt() {
390
+ for (var e; e = Je.shift(); ) {
391
+ var t = e.__H;
392
+ if (e.__P && t) try {
393
+ t.__h.some(Y), t.__h.some(_e), t.__h = [];
393
394
  } catch (r) {
394
- e.__h = [], S.__e(r, t.__v);
395
+ t.__h = [], x.__e(r, e.__v);
395
396
  }
396
397
  }
397
398
  }
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) {
399
+ x.__b = function(e) {
400
+ S = null, Te && Te(e);
401
+ }, x.__ = function(e, t) {
402
+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Ie && Ie(e, t);
403
+ }, x.__r = function(e) {
404
+ Re && Re(e), j = 0;
405
+ var t = (S = e.__c).__H;
406
+ t && (ae === S ? (t.__h = [], S.__h = [], t.__.some(function(r) {
406
407
  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) {
408
+ })) : (t.__h.some(Y), t.__h.some(_e), t.__h = [], j = 0)), ae = S;
409
+ }, x.diffed = function(e) {
410
+ Ce && Ce(e);
411
+ var t = e.__c;
412
+ 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
413
  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) {
414
+ })), ae = S = null;
415
+ }, x.__c = function(e, t) {
416
+ t.some(function(r) {
416
417
  try {
417
- r.__h.some(X), r.__h = r.__h.filter(function(n) {
418
- return !n.__ || de(n);
418
+ r.__h.some(Y), r.__h = r.__h.filter(function(n) {
419
+ return !n.__ || _e(n);
419
420
  });
420
421
  } catch (n) {
421
- e.some(function(o) {
422
+ t.some(function(o) {
422
423
  o.__h && (o.__h = []);
423
- }), e = [], S.__e(n, r.__v);
424
+ }), t = [], x.__e(n, r.__v);
424
425
  }
425
- }), Ce && Ce(t, e);
426
- }, S.unmount = function(t) {
427
- Re && Re(t);
428
- var e, r = t.__c;
426
+ }), $e && $e(e, t);
427
+ }, x.unmount = function(e) {
428
+ Ee && Ee(e);
429
+ var t, r = e.__c;
429
430
  r && r.__H && (r.__H.__.some(function(n) {
430
431
  try {
431
- X(n);
432
+ Y(n);
432
433
  } catch (o) {
433
- e = o;
434
+ t = o;
434
435
  }
435
- }), r.__H = void 0, e && S.__e(e, r.__v));
436
+ }), r.__H = void 0, t && x.__e(t, r.__v));
436
437
  };
437
- var $e = typeof requestAnimationFrame == "function";
438
- function ht(t) {
439
- var e, r = function() {
440
- clearTimeout(n), $e && cancelAnimationFrame(e), setTimeout(t);
438
+ var Ae = typeof requestAnimationFrame == "function";
439
+ function yt(e) {
440
+ var t, r = function() {
441
+ clearTimeout(n), Ae && cancelAnimationFrame(t), setTimeout(e);
441
442
  }, n = setTimeout(r, 35);
442
- $e && (e = requestAnimationFrame(r));
443
+ Ae && (t = requestAnimationFrame(r));
443
444
  }
444
- function X(t) {
445
- var e = k, r = t.__c;
446
- typeof r == "function" && (t.__c = void 0, r()), k = e;
445
+ function Y(e) {
446
+ var t = S, r = e.__c;
447
+ typeof r == "function" && (e.__c = void 0, r()), S = t;
447
448
  }
448
- function de(t) {
449
- var e = k;
450
- t.__c = t.__(), k = e;
449
+ function _e(e) {
450
+ var t = S;
451
+ e.__c = e.__(), S = t;
451
452
  }
452
- function qe(t, e) {
453
- return !t || t.length !== e.length || e.some(function(r, n) {
454
- return r !== t[n];
453
+ function Xe(e, t) {
454
+ return !e || e.length !== t.length || t.some(function(r, n) {
455
+ return r !== e[n];
455
456
  });
456
457
  }
457
- function Ve(t, e) {
458
- return typeof e == "function" ? e(t) : e;
458
+ function Ge(e, t) {
459
+ return typeof t == "function" ? t(e) : t;
459
460
  }
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 = `
461
+ var wt = 0;
462
+ function c(e, t, r, n, o, s) {
463
+ t || (t = {});
464
+ var l, d, u = t;
465
+ if ("ref" in u) for (d in u = {}, t) d == "ref" ? l = t[d] : u[d] = t[d];
466
+ var a = {
467
+ type: e,
468
+ props: u,
469
+ key: r,
470
+ ref: l,
471
+ __k: null,
472
+ __: null,
473
+ __b: 0,
474
+ __e: null,
475
+ __c: null,
476
+ constructor: void 0,
477
+ __v: --wt,
478
+ __i: -1,
479
+ __u: 0,
480
+ __source: o,
481
+ __self: s
482
+ };
483
+ if (typeof e == "function" && (l = e.defaultProps)) for (d in l) u[d] === void 0 && (u[d] = l[d]);
484
+ return y.vnode && y.vnode(a), a;
485
+ }
486
+ var bt = { animation: "spin 1s linear infinite" }, kt = () => /* @__PURE__ */ c("svg", {
487
+ xmlns: "http://www.w3.org/2000/svg",
488
+ width: "24",
489
+ height: "24",
490
+ viewBox: "0 0 24 24",
491
+ fill: "none",
492
+ stroke: "var(--twd-icon-color-secondary)",
493
+ strokeWidth: "2",
494
+ strokeLinecap: "round",
495
+ strokeLinejoin: "round",
496
+ className: "lucide lucide-loader-circle-icon lucide-loader-circle",
497
+ style: bt,
498
+ "data-testid": "loader-icon",
499
+ children: /* @__PURE__ */ c("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
500
+ }), X = document.createElement("style");
501
+ X && !document.getElementById("loader-spin-keyframes") && (X.id = "loader-spin-keyframes", X.innerHTML = `
481
502
  @keyframes spin {
482
503
  0% { transform: rotate(0deg); }
483
504
  100% { transform: rotate(360deg); }
484
505
  }
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,
506
+ `, document.head.appendChild(X));
507
+ var se = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ c("svg", {
508
+ xmlns: "http://www.w3.org/2000/svg",
509
+ width: "16",
510
+ height: "16",
511
+ viewBox: "0 0 24 24",
512
+ fill: "none",
513
+ stroke: "var(--twd-icon-color)",
514
+ strokeWidth: "2",
515
+ strokeLinecap: "round",
516
+ strokeLinejoin: "round",
517
+ className: `lucide ${e}`,
518
+ "data-testid": r,
519
+ children: t
520
+ }), St = () => /* @__PURE__ */ c(se, {
521
+ className: "lucide-play-icon lucide-play",
522
+ dataTestId: "play-icon",
523
+ 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" })
524
+ }), Ke = ({ id: e, name: t, skip: r, only: n }) => /* @__PURE__ */ c(V, { children: [
525
+ t,
504
526
  " ",
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) => {
527
+ n && /* @__PURE__ */ c("span", {
528
+ style: { color: "var(--twd-primary)" },
529
+ "data-testid": `only-indicator-${e}`,
530
+ children: [" ", "(only)"]
531
+ }),
532
+ r && /* @__PURE__ */ c("span", {
533
+ style: { color: "var(--twd-text-secondary)" },
534
+ "data-testid": `skip-indicator-${e}`,
535
+ children: [" ", "(skipped)"]
536
+ })
537
+ ] }), L = /* @__PURE__ */ (function(e) {
538
+ return e.CHAI_DIFF = "chai-diff", e.CHAI_MESSAGE = "chai-message", e.ERROR = "error", e;
539
+ })({}), xt = (e) => {
530
540
  try {
531
- const e = JSON.parse(t);
532
- if (e && typeof e == "object" && "type" in e)
533
- return e;
541
+ const t = JSON.parse(e);
542
+ if (t && typeof t == "object" && "type" in t) return t;
534
543
  } catch {
535
544
  }
536
545
  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
- {
546
+ }, Le = (e) => {
547
+ if (e === null) return "null";
548
+ if (e === void 0) return "undefined";
549
+ if (typeof e == "string") return e;
550
+ if (typeof e == "object") try {
551
+ return JSON.stringify(e, null, 2);
552
+ } catch {
553
+ return String(e);
554
+ }
555
+ return String(e);
556
+ }, Tt = (e) => e.startsWith("Assertion passed") || e.startsWith("Event fired") ? {
557
+ color: "var(--twd-success)",
558
+ fontWeight: "var(--twd-font-weight-bold)"
559
+ } : e.startsWith("Test failed") ? {
560
+ color: "var(--twd-error)",
561
+ fontWeight: "var(--twd-font-weight-bold)"
562
+ } : {}, 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 }) => {
563
+ const r = xt(e);
564
+ if (r?.type === L.CHAI_DIFF) return /* @__PURE__ */ c("li", {
565
+ style: {
566
+ fontSize: "var(--twd-font-size-sm)",
567
+ padding: "var(--twd-spacing-sm)",
568
+ borderBottom: "1px solid var(--twd-border-light)",
569
+ color: "var(--twd-text)"
570
+ },
571
+ children: [
572
+ /* @__PURE__ */ c("div", {
554
573
  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)"
574
+ color: "var(--twd-error)",
575
+ fontWeight: "var(--twd-font-weight-bold)",
576
+ marginBottom: "var(--twd-spacing-xs)"
559
577
  },
560
- children: [
561
- /* @__PURE__ */ c("div", { style: {
578
+ children: "❌ Assertion failed"
579
+ }),
580
+ /* @__PURE__ */ c("div", {
581
+ style: {
582
+ marginTop: "var(--twd-spacing-xs)",
583
+ paddingLeft: "var(--twd-spacing-sm)",
584
+ borderLeft: "2px solid var(--twd-success)"
585
+ },
586
+ children: [/* @__PURE__ */ c("div", {
587
+ style: {
588
+ color: "var(--twd-success)",
589
+ fontWeight: "var(--twd-font-weight-medium)",
590
+ marginBottom: "var(--twd-spacing-xs)"
591
+ },
592
+ children: "Expected:"
593
+ }), /* @__PURE__ */ c("pre", {
594
+ style: {
595
+ margin: 0,
596
+ padding: "var(--twd-spacing-xs)",
597
+ background: "var(--twd-background)",
598
+ borderRadius: "var(--twd-border-radius)",
599
+ fontSize: "var(--twd-font-size-xs)",
600
+ overflowX: "auto",
601
+ whiteSpace: "pre-wrap",
602
+ wordBreak: "break-word"
603
+ },
604
+ children: Le(r.expected)
605
+ })]
606
+ }),
607
+ /* @__PURE__ */ c("div", {
608
+ style: {
609
+ marginTop: "var(--twd-spacing-xs)",
610
+ paddingLeft: "var(--twd-spacing-sm)",
611
+ borderLeft: "2px solid var(--twd-error)"
612
+ },
613
+ children: [/* @__PURE__ */ c("div", {
614
+ style: {
562
615
  color: "var(--twd-error)",
563
- fontWeight: "var(--twd-font-weight-bold)",
616
+ fontWeight: "var(--twd-font-weight-medium)",
564
617
  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
618
+ },
619
+ children: "Actual:"
620
+ }), /* @__PURE__ */ c("pre", {
621
+ style: {
622
+ margin: 0,
623
+ padding: "var(--twd-spacing-xs)",
624
+ background: "var(--twd-background)",
625
+ borderRadius: "var(--twd-border-radius)",
626
+ fontSize: "var(--twd-font-size-xs)",
627
+ overflowX: "auto",
628
+ whiteSpace: "pre-wrap",
629
+ wordBreak: "break-word"
630
+ },
631
+ children: Le(r.actual)
632
+ })]
633
+ })
634
+ ]
635
+ }, t);
636
+ const n = Ct(e, r);
637
+ return /* @__PURE__ */ c("li", {
638
+ style: {
639
+ fontSize: "var(--twd-font-size-sm)",
640
+ padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
641
+ borderBottom: "1px solid var(--twd-border-light)",
642
+ color: "var(--twd-text)",
643
+ ...Tt(n)
624
644
  },
625
- e
626
- );
627
- }, H = {
628
- container: {
629
- marginBottom: "var(--twd-spacing-xs)"
630
- },
645
+ children: n
646
+ }, t);
647
+ }, D = {
648
+ container: { marginBottom: "var(--twd-spacing-xs)" },
631
649
  item: {
632
650
  display: "flex",
633
651
  alignItems: "left",
@@ -665,78 +683,43 @@ const wt = (t) => {
665
683
  marginTop: "var(--twd-spacing-xs)",
666
684
  textAlign: "left"
667
685
  }
668
- }, xt = (t) => {
669
- switch (t.status) {
686
+ }, Et = (e) => {
687
+ switch (e.status) {
670
688
  case "pass":
671
689
  return {
672
- item: {
673
- background: "var(--twd-success-bg)"
674
- },
675
- container: {
676
- borderLeft: "3px solid var(--twd-success)"
677
- }
690
+ item: { background: "var(--twd-success-bg)" },
691
+ container: { borderLeft: "3px solid var(--twd-success)" }
678
692
  };
679
693
  case "fail":
680
694
  return {
681
- item: {
682
- background: "var(--twd-error-bg)"
683
- },
684
- container: {
685
- borderLeft: "3px solid var(--twd-error)"
686
- }
695
+ item: { background: "var(--twd-error-bg)" },
696
+ container: { borderLeft: "3px solid var(--twd-error)" }
687
697
  };
688
698
  case "skip":
689
- return {
690
- item: {
691
- background: "var(--twd-skip-bg)"
692
- }
693
- };
699
+ return { item: { background: "var(--twd-skip-bg)" } };
694
700
  case "running":
695
- return {
696
- item: {
697
- background: "var(--twd-warning-bg)"
698
- }
699
- };
701
+ return { item: { background: "var(--twd-warning-bg)" } };
700
702
  default:
701
- return {
702
- item: {
703
- background: "transparent"
704
- }
705
- };
703
+ return { item: { background: "transparent" } };
706
704
  }
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(() => {
705
+ }, It = ({ node: e, depth: t, id: r, runTest: n }) => {
706
+ 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(() => ({
707
+ ...D.container,
708
+ marginLeft: `calc(${t} * var(--twd-spacing-sm))`,
709
+ ...d.container || {}
710
+ }), [t, d]), p = N(() => ({
711
+ ...D.item,
712
+ ...d.item,
713
+ ...u && { border: "1px dashed var(--twd-border)" }
714
+ }), [d, u]);
715
+ oe(() => {
731
716
  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(() => {
717
+ !f || !e.logs || e.logs.length === 0 || ((s.current === "running" && (e.status === "pass" || e.status === "fail") || e.logs.length > l.current) && setTimeout(() => {
735
718
  f.scrollTop = f.scrollHeight;
736
- }, 0), s.current = t.status, l.current = t.logs.length;
737
- }, [t.status, t.logs]);
719
+ }, 0), s.current = e.status, l.current = e.logs.length);
720
+ }, [e.status, e.logs]);
738
721
  const i = () => {
739
- switch (t.status) {
722
+ switch (e.status) {
740
723
  case "pass":
741
724
  return "passed";
742
725
  case "fail":
@@ -749,45 +732,53 @@ const wt = (t) => {
749
732
  return "not run";
750
733
  }
751
734
  };
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(() => {
735
+ return /* @__PURE__ */ c("li", {
736
+ style: a,
737
+ "data-testid": `test-list-item-${r}`,
738
+ "data-test-name": e.name,
739
+ role: "listitem",
740
+ "aria-label": `Test ${e.name}, status: ${i()}`,
741
+ children: [/* @__PURE__ */ c("div", {
742
+ style: p,
743
+ children: [/* @__PURE__ */ c("span", {
744
+ style: D.nameSpan,
745
+ children: /* @__PURE__ */ c(Ke, {
746
+ id: r,
747
+ name: e.name,
748
+ skip: e.skip,
749
+ only: e.only
750
+ })
751
+ }), /* @__PURE__ */ c("button", {
752
+ onClick: () => n(r),
753
+ "aria-label": `Run ${e.name} test`,
754
+ style: D.button,
755
+ disabled: e.status === "running",
756
+ "data-testid": `run-test-button-${r}`,
757
+ children: e.status === "running" ? /* @__PURE__ */ c(kt, {}) : /* @__PURE__ */ c(St, {})
758
+ })]
759
+ }), e.logs && e.logs.length > 0 && /* @__PURE__ */ c("ul", {
760
+ ref: o,
761
+ style: D.logsList,
762
+ children: e.logs.map((f, _) => /* @__PURE__ */ c($t, {
763
+ log: f,
764
+ index: _
765
+ }, _))
766
+ })]
767
+ }, e.name);
768
+ }, At = () => /* @__PURE__ */ c(se, {
769
+ className: "lucide-chevron-down-icon lucide-chevron-down",
770
+ dataTestId: "chevron-down-icon",
771
+ children: /* @__PURE__ */ c("path", { d: "m6 9 6 6 6-6" })
772
+ }), Lt = () => /* @__PURE__ */ c(se, {
773
+ className: "lucide-chevron-right-icon lucide-chevron-right",
774
+ dataTestId: "chevron-right-icon",
775
+ children: /* @__PURE__ */ c("path", { d: "m9 18 6-6-6-6" })
776
+ }), Mt = ({ roots: e, runTest: t, searchQuery: r = "" }) => {
777
+ const [n, o] = P({}), s = O(null), l = O(!1), d = (a) => o((p) => ({
778
+ ...p,
779
+ [a]: !p[a]
780
+ }));
781
+ oe(() => {
791
782
  if (l.current) return;
792
783
  const a = sessionStorage.getItem("twd-last-run-test-name");
793
784
  if (!a) return;
@@ -796,10 +787,9 @@ const wt = (t) => {
796
787
  if (i) {
797
788
  const f = s.current?.closest('[data-testid="twd-sidebar"]');
798
789
  if (f) {
799
- const _ = i.getBoundingClientRect(), v = f.getBoundingClientRect(), T = f.scrollTop, b = _.top - v.top + T;
790
+ const _ = i.getBoundingClientRect(), w = f.getBoundingClientRect(), C = f.scrollTop, k = _.top - w.top + C;
800
791
  f.scrollTo({
801
- top: b - 150,
802
- // 150px offset from top
792
+ top: k - 150,
803
793
  behavior: "smooth"
804
794
  });
805
795
  }
@@ -809,81 +799,83 @@ const wt = (t) => {
809
799
  return () => clearTimeout(p);
810
800
  }, []);
811
801
  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
- );
802
+ if (a.type === "test") return /* @__PURE__ */ c(It, {
803
+ node: a,
804
+ depth: p,
805
+ id: a.id,
806
+ runTest: () => t(a.id)
807
+ }, a.id);
823
808
  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
- {
809
+ return /* @__PURE__ */ c("li", {
810
+ style: { marginLeft: `calc(${p} * var(--twd-spacing-lg))` },
811
+ children: [/* @__PURE__ */ c("div", {
812
+ style: {
813
+ background: "var(--twd-describe-bg)",
814
+ borderLeft: "3px solid var(--twd-describe-border)",
815
+ borderRadius: "var(--twd-border-radius)",
816
+ padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
817
+ marginBottom: "var(--twd-spacing-sm)"
818
+ },
819
+ children: /* @__PURE__ */ c("span", {
828
820
  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)"
821
+ fontWeight: "var(--twd-font-weight-medium)",
822
+ fontSize: "var(--twd-font-size-sm)",
823
+ cursor: "pointer",
824
+ color: "var(--twd-describe-text)",
825
+ display: "flex",
826
+ alignItems: "center",
827
+ justifyContent: "space-between",
828
+ gap: "var(--twd-spacing-sm)",
829
+ textTransform: "uppercase",
830
+ letterSpacing: "0.05em"
834
831
  },
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);
832
+ "data-testid": `test-group-${a.name}`,
833
+ tabIndex: 0,
834
+ role: "button",
835
+ "aria-expanded": !i,
836
+ "aria-label": `${i ? "Expand" : "Collapse"} test suite ${a.name}`,
837
+ onClick: () => d(a.id),
838
+ children: [/* @__PURE__ */ c(Ke, {
839
+ id: a.id,
840
+ name: a.name,
841
+ skip: a.skip,
842
+ only: a.only
843
+ }), i ? /* @__PURE__ */ c(Lt, {}) : /* @__PURE__ */ c(At, {})]
844
+ })
845
+ }), !i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */ c("ul", {
846
+ style: {
847
+ listStyle: "none",
848
+ padding: 0,
849
+ margin: 0
850
+ },
851
+ children: a.childrenNodes.map((f) => u(f, p + 1))
852
+ })]
853
+ }, a.id);
866
854
  };
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: {
855
+ return /* @__PURE__ */ c("ul", {
856
+ ref: s,
857
+ style: {
858
+ listStyle: "none",
859
+ padding: 0,
860
+ margin: 0
861
+ },
862
+ role: "list",
863
+ "aria-label": "Test list",
864
+ children: e.length === 0 && r ? /* @__PURE__ */ c("li", {
865
+ style: {
875
866
  padding: "var(--twd-spacing-md)",
876
867
  color: "var(--twd-text-secondary)",
877
868
  fontSize: "var(--twd-font-size-sm)",
878
869
  textAlign: "center"
879
- }, children: [
870
+ },
871
+ children: [
880
872
  'No tests match "',
881
873
  r,
882
874
  '"'
883
- ] }) : t.map((a) => u(a))
884
- }
885
- );
886
- }, $t = {
875
+ ]
876
+ }) : e.map((a) => u(a))
877
+ });
878
+ }, zt = {
887
879
  left: {
888
880
  left: 0,
889
881
  borderTopRightRadius: "var(--twd-border-radius-lg)",
@@ -898,32 +890,60 @@ const wt = (t) => {
898
890
  borderTopRightRadius: "0",
899
891
  borderBottomRightRadius: "0"
900
892
  }
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(() => {
893
+ }, Nt = ({ setOpen: e, position: t }) => /* @__PURE__ */ c("button", {
894
+ "aria-label": "Open TWD sidebar",
895
+ style: {
896
+ position: "fixed",
897
+ top: "50%",
898
+ transform: "translateY(-50%)",
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,317 @@ 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(), v = 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
+ v.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 && v.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
+ v.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 && v.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
+ v.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 && v.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 && v.get(n).children.push(r), v.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 && v.get(n).children.push(r), v.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 && v.get(n).children.push(r), v.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 = v.get(n)?.parent;
1041
+ return {
1042
+ before: t,
1043
+ after: r
1044
+ };
1045
+ }, F = (e) => {
1046
+ const t = v.get(e);
1047
+ return t ? t.only ? !0 : t.children ? t.children.some((r) => F(r)) : !1 : !1;
1048
+ }, Ft = (e) => {
1049
+ let t = v.get(e);
1050
+ for (; t?.parent; ) {
1051
+ const r = v.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 = v.get(e);
1058
+ for (; t; ) {
1059
+ if (t.skip) return !0;
1060
+ if (!t.parent) break;
1061
+ t = v.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(v.values()).filter((r) => !r.parent && r.type === "suite"), t = Array.from(v.values()).some((r) => r.only);
1070
+ for (const r of e) await this.runSuite(r, t);
1071
+ return v;
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 = v.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(v.values()).filter((o) => !o.parent && o.type === "suite"), n = Array.from(v.values()).some((o) => o.only);
1079
+ for (const o of r) await this.runSuiteByIds(o, t, n);
1080
+ return v;
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) => v.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 = v.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) => v.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.2", 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
1148
  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) => {
1149
+ We = !0;
1150
+ const t = e ?? "/mock-sw.js";
1151
+ await navigator.serviceWorker.register(`${t}?v=${me}`), navigator.serviceWorker.controller || await new Promise((r) => {
1064
1152
  navigator.serviceWorker.addEventListener("controllerchange", r, { once: !0 });
1065
1153
  }), navigator.serviceWorker.addEventListener("message", (r) => {
1066
1154
  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;
1155
+ const { alias: n, request: o, hitCount: s } = r.data, l = ye.find((d) => d.alias === n);
1156
+ l && (l.executed = !0, l.request = o, l.hitCount = s), q.counts[n] = s ?? (q.counts[n] ?? 0) + 1;
1069
1157
  }
1070
1158
  });
1071
1159
  }
1072
- }, Ht = () => me, Bt = () => {
1160
+ }, Ut = () => ye, qt = () => {
1073
1161
  navigator.serviceWorker.controller?.postMessage({
1074
1162
  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: [
1163
+ version: me
1164
+ }), ye.length = 0;
1165
+ for (const e in q.counts) delete q.counts[e];
1166
+ }, Vt = () => /* @__PURE__ */ c(se, {
1167
+ className: "lucide-wifi-pen-icon lucide-wifi-pen",
1168
+ dataTestId: "wifi-pen-icon",
1169
+ children: [
1170
+ /* @__PURE__ */ c("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
1171
+ /* @__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" }),
1172
+ /* @__PURE__ */ c("path", { d: "M5 12.859a10 10 0 0 1 10.5-2.222" }),
1173
+ /* @__PURE__ */ c("path", { d: "M8.5 16.429a5 5 0 0 1 3-1.406" })
1174
+ ]
1175
+ }), Jt = () => {
1176
+ const e = Ut(), t = e.filter((n) => n.executed);
1177
+ return /* @__PURE__ */ c("button", {
1178
+ onClick: () => {
1179
+ 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();
1180
+ },
1181
+ "aria-label": "View mock rules details in console",
1182
+ style: {
1183
+ background: "var(--twd-button-secondary)",
1184
+ border: "1px solid var(--twd-button-border)",
1185
+ borderRadius: "var(--twd-border-radius-lg)",
1186
+ padding: "var(--twd-spacing-md) var(--twd-spacing-lg)",
1187
+ cursor: "pointer",
1188
+ fontSize: "var(--twd-font-size-sm)",
1189
+ color: "var(--twd-button-secondary-text)",
1190
+ display: "flex",
1191
+ alignItems: "center",
1192
+ gap: "var(--twd-spacing-md)",
1193
+ marginBottom: "10px",
1194
+ width: "100%",
1195
+ textAlign: "left",
1196
+ transition: "all var(--twd-animation-duration) ease",
1197
+ boxShadow: "var(--twd-shadow-sm)"
1198
+ },
1199
+ children: [
1200
+ /* @__PURE__ */ c(Vt, {}),
1201
+ /* @__PURE__ */ c("span", {
1202
+ style: { flex: 1 },
1203
+ children: [
1113
1204
  "Rules: ",
1114
- e.length,
1115
- "/",
1116
1205
  t.length,
1206
+ "/",
1207
+ e.length,
1117
1208
  " triggered"
1118
- ] }),
1119
- /* @__PURE__ */ c("span", { style: {
1209
+ ]
1210
+ }),
1211
+ /* @__PURE__ */ c("span", {
1212
+ style: {
1120
1213
  fontSize: "var(--twd-font-size-xs)",
1121
1214
  color: "var(--twd-text)",
1122
1215
  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();
1216
+ },
1217
+ children: "View rules in console"
1218
+ })
1219
+ ]
1220
+ });
1221
+ }, Xt = /* @__PURE__ */ new Map();
1222
+ function Gt() {
1223
+ Xt.clear();
1130
1224
  }
1131
- const Ut = (t) => t instanceof Error && "actual" in t && "expected" in t, Ge = (t) => t.actual !== void 0 && t.expected !== void 0 ? {
1225
+ var Kt = (e) => e instanceof Error && "actual" in e && "expected" in e, et = (e) => e.actual !== void 0 && e.expected !== void 0 ? {
1132
1226
  type: "diff",
1133
- actual: t.actual,
1134
- expected: t.expected,
1135
- operator: t.operator
1227
+ actual: e.actual,
1228
+ expected: e.expected,
1229
+ operator: e.operator
1136
1230
  } : {
1137
1231
  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];
1232
+ message: e.message
1233
+ }, Yt = (e) => {
1234
+ const t = et(e);
1235
+ if (t.type === "diff") {
1236
+ const r = t.operator || "unknown";
1237
+ console.error(`Assertion failed with operator: ${r}`), console.group("Expected:"), console.log(t.expected), console.groupEnd(), console.group("Actual:"), console.log(t.actual), console.groupEnd();
1238
+ } else console.error(t.message);
1239
+ }, Qt = (e) => {
1240
+ if (e.status === "pass") return `Test "${e.name}" passed.`;
1241
+ if (e.status === "fail") {
1242
+ if (!e.logs || e.logs.length === 0) return `Test "${e.name}" failed.`;
1243
+ const t = e.logs[e.logs.length - 1];
1153
1244
  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.`;
1245
+ const r = JSON.parse(t);
1246
+ 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
1247
  } catch {
1157
- return `Test "${t.name}" failed. ${e}`;
1248
+ return `Test "${e.name}" failed. ${t}`;
1158
1249
  }
1159
- } else if (t.status === "skip")
1160
- return `Test "${t.name}" skipped.`;
1250
+ } else if (e.status === "skip") return `Test "${e.name}" skipped.`;
1161
1251
  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 = [];
1252
+ }, Zt = (e) => {
1253
+ 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
1254
  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
- {
1255
+ }, er = ({ value: e, onChange: t }) => /* @__PURE__ */ c("div", {
1256
+ style: {
1257
+ position: "relative",
1258
+ marginBottom: "var(--twd-spacing-md)"
1259
+ },
1260
+ children: /* @__PURE__ */ c("input", {
1168
1261
  type: "search",
1169
1262
  id: "twd-search-input",
1170
1263
  "aria-label": "Filter tests",
1171
1264
  placeholder: "Filter tests...",
1172
- value: t,
1173
- onChange: (r) => e(r.target.value),
1265
+ value: e,
1266
+ onInput: (r) => t(r.target.value),
1174
1267
  style: {
1175
1268
  width: "100%",
1176
1269
  padding: "var(--twd-spacing-md)",
@@ -1182,151 +1275,173 @@ const Ut = (t) => t instanceof Error && "actual" in t && "expected" in t, Ge = (
1182
1275
  boxSizing: "border-box",
1183
1276
  outline: "none"
1184
1277
  }
1185
- }
1186
- ) }), Xt = (t, e) => {
1187
- if (!e.trim()) return t;
1188
- const r = e.toLowerCase(), n = (o) => {
1278
+ })
1279
+ }), tr = (e, t) => {
1280
+ if (!t.trim()) return e;
1281
+ const r = t.toLowerCase(), n = (o) => {
1189
1282
  const s = o.name.toLowerCase().includes(r);
1190
- if (o.type === "test")
1191
- return s ? o : null;
1283
+ if (o.type === "test") return s ? o : null;
1192
1284
  const l = (o.childrenNodes || []).map(n).filter((d) => d !== null);
1193
1285
  return s || l.length > 0 ? {
1194
1286
  ...o,
1195
1287
  childrenNodes: s ? o.childrenNodes : l
1196
1288
  } : null;
1197
1289
  };
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);
1290
+ return e.map(n).filter((o) => o !== null);
1291
+ }, rr = (e) => {
1292
+ const t = /* @__PURE__ */ new Map(), r = [];
1293
+ for (const n of e) t.set(n.id, {
1294
+ ...n,
1295
+ childrenNodes: []
1296
+ });
1297
+ for (const n of t.values()) n.parent ? t.get(n.parent)?.childrenNodes?.push(n) : r.push(n);
1204
1298
  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);
1299
+ }, nr = {
1300
+ left: {
1301
+ left: 0,
1302
+ borderRight: "1px solid var(--twd-border)"
1303
+ },
1304
+ right: {
1305
+ right: 0,
1306
+ borderLeft: "1px solid var(--twd-border)"
1307
+ }
1308
+ }, 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) => {
1309
+ const t = [];
1310
+ for (const r of e)
1311
+ r.type === "test" && t.push(r.id), r.childrenNodes && t.push(...tt(r.childrenNodes));
1312
+ return t;
1313
+ }, ar = ({ open: e, position: t = "left", search: r }) => {
1314
+ const [n, o] = P(0), [s, l] = P(ir(e));
1315
+ Wt({
1316
+ isOpen: s,
1317
+ position: t
1318
+ });
1319
+ const [d, u] = P(""), [a, p] = P(sr(r));
1320
+ oe(() => {
1321
+ const h = () => o((b) => b + 1);
1219
1322
  return window.addEventListener("twd:state-change", h), () => window.removeEventListener("twd:state-change", h);
1220
1323
  }, []);
1221
- const i = new Xe({
1324
+ const i = new Ze({
1222
1325
  onStart: (h) => {
1223
- h.status = "running", o((y) => y + 1);
1326
+ h.status = "running", o((b) => b + 1);
1224
1327
  },
1225
1328
  onPass: (h) => {
1226
- h.status = "pass", o((y) => y + 1);
1329
+ h.status = "pass", o((b) => b + 1);
1227
1330
  },
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
1331
+ onFail: (h, b) => {
1332
+ if (h.status = "fail", console.group(`%c❌ Test failed: ${h.name}`, "color: red; font-weight: bold;"), Kt(b)) {
1333
+ Yt(b);
1334
+ const R = et(b);
1335
+ R.type === "diff" ? h.logs.push(JSON.stringify({
1336
+ type: L.CHAI_DIFF,
1337
+ expected: R.expected,
1338
+ actual: R.actual
1236
1339
  })) : h.logs.push(JSON.stringify({
1237
- type: A.CHAI_MESSAGE,
1238
- message: `Test failed: ${C.message}`
1340
+ type: L.CHAI_MESSAGE,
1341
+ message: `Test failed: ${R.message}`
1239
1342
  }));
1240
1343
  } else
1241
- console.error(y.message), h.logs.push(JSON.stringify({
1242
- type: A.ERROR,
1243
- message: `Test failed: ${y.message}`
1344
+ console.error(b.message), h.logs.push(JSON.stringify({
1345
+ type: L.ERROR,
1346
+ message: `Test failed: ${b.message}`
1244
1347
  }));
1245
- console.groupEnd(), o((C) => C + 1);
1348
+ console.groupEnd(), o((R) => R + 1);
1246
1349
  },
1247
1350
  onSkip: (h) => {
1248
- h.status = "skip", o((y) => y + 1);
1351
+ h.status = "skip", o((b) => b + 1);
1249
1352
  }
1250
1353
  }), f = (h) => {
1251
1354
  p(h), h ? sessionStorage.setItem("twd-search-filter", h) : sessionStorage.removeItem("twd-search-filter");
1252
1355
  }, _ = (h) => {
1253
1356
  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(() => {
1357
+ }, w = Array.from(v.values()), C = N(() => rr(w), [n]), k = N(() => tr(C, a), [C, a]), { filteredTestIds: m, displayTests: g } = N(() => {
1262
1358
  if (a) {
1263
- const h = Ke(b), y = new Set(h);
1359
+ const h = tt(k), b = new Set(h);
1264
1360
  return {
1265
1361
  filteredTestIds: h,
1266
- displayTests: v.filter((C) => C.type === "test" && y.has(C.id))
1362
+ displayTests: w.filter((R) => R.type === "test" && b.has(R.id))
1267
1363
  };
1268
1364
  }
1269
1365
  return {
1270
1366
  filteredTestIds: null,
1271
- displayTests: v.filter((h) => h.type === "test")
1367
+ displayTests: w.filter((h) => h.type === "test")
1272
1368
  };
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);
1369
+ }, [
1370
+ k,
1371
+ a,
1372
+ n
1373
+ ]), $ = async () => {
1374
+ u(""), sessionStorage.removeItem("twd-last-run-test-name"), m ? await i.runByIds(m) : await i.runAll(), u(Zt(w));
1375
+ }, I = async (h) => {
1376
+ const b = Array.from(v.values()).filter((R) => R.type === "test").find((R) => R.id === h);
1377
+ b && (u(""), sessionStorage.setItem("twd-last-run-test-name", b.name), await i.runSingle(b.id), u(Qt(b)));
1283
1378
  };
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: {
1379
+ if (!s) return /* @__PURE__ */ c(Nt, {
1380
+ position: t,
1381
+ setOpen: _
1382
+ });
1383
+ const z = g.length;
1384
+ return /* @__PURE__ */ c("div", {
1385
+ style: {
1386
+ fontFamily: or,
1387
+ position: "fixed",
1388
+ top: 0,
1389
+ bottom: 0,
1390
+ width: "var(--twd-sidebar-width)",
1391
+ background: "var(--twd-background)",
1392
+ fontSize: "var(--twd-font-size-md)",
1393
+ overflowY: "auto",
1394
+ boxShadow: "var(--twd-shadow)",
1395
+ textAlign: "left",
1396
+ zIndex: "var(--twd-z-index-sidebar)",
1397
+ pointerEvents: "all",
1398
+ isolation: "isolate",
1399
+ ...nr[t]
1400
+ },
1401
+ "data-testid": "twd-sidebar",
1402
+ role: "complementary",
1403
+ "aria-label": "Test While Developing sidebar",
1404
+ children: [
1405
+ /* @__PURE__ */ c("div", {
1406
+ "aria-live": "polite",
1407
+ "aria-atomic": "true",
1408
+ style: {
1409
+ position: "absolute",
1410
+ width: "1px",
1411
+ height: "1px",
1412
+ margin: "-1px",
1413
+ border: "0",
1414
+ padding: "0",
1415
+ overflow: "hidden",
1416
+ clip: "rect(0 0 0 0)"
1417
+ },
1418
+ children: d
1419
+ }),
1420
+ /* @__PURE__ */ c("div", {
1421
+ style: {
1312
1422
  padding: "var(--twd-spacing-md)",
1313
1423
  background: "var(--twd-background)",
1314
1424
  position: "sticky",
1315
1425
  top: 0,
1316
1426
  zIndex: "var(--twd-z-index-sticky)",
1317
1427
  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,
1428
+ },
1429
+ children: [
1430
+ /* @__PURE__ */ c("div", {
1431
+ style: {
1432
+ display: "flex",
1433
+ justifyContent: "space-between",
1434
+ alignItems: "center",
1435
+ marginBottom: "var(--twd-spacing-xl)"
1436
+ },
1437
+ children: [/* @__PURE__ */ c("div", {
1438
+ style: {
1439
+ display: "flex",
1440
+ gap: "var(--twd-spacing-xs)"
1441
+ },
1442
+ children: [
1443
+ /* @__PURE__ */ c("button", {
1444
+ onClick: $,
1330
1445
  style: {
1331
1446
  background: "var(--twd-button-primary)",
1332
1447
  color: "var(--twd-button-primary-text)",
@@ -1335,14 +1450,14 @@ const Ut = (t) => t instanceof Error && "actual" in t && "expected" in t, Ge = (
1335
1450
  border: "none",
1336
1451
  cursor: "pointer"
1337
1452
  },
1338
- children: /* @__PURE__ */ c("span", { "aria-live": "polite", children: a ? "Run Filtered" : "Run All" })
1339
- }
1340
- ),
1341
- /* @__PURE__ */ c(
1342
- "button",
1343
- {
1453
+ children: /* @__PURE__ */ c("span", {
1454
+ "aria-live": "polite",
1455
+ children: a ? "Run Filtered" : "Run All"
1456
+ })
1457
+ }),
1458
+ /* @__PURE__ */ c("button", {
1344
1459
  onClick: () => {
1345
- Bt(), Ot();
1460
+ qt(), Gt();
1346
1461
  },
1347
1462
  "aria-label": "Clear all mocks",
1348
1463
  style: {
@@ -1354,83 +1469,87 @@ const Ut = (t) => t instanceof Error && "actual" in t && "expected" in t, Ge = (
1354
1469
  cursor: "pointer"
1355
1470
  },
1356
1471
  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(() => {
1472
+ }),
1473
+ /* @__PURE__ */ c("span", {
1474
+ style: {
1475
+ color: "var(--twd-text-secondary)",
1476
+ fontSize: "var(--twd-font-size-sm)",
1477
+ alignSelf: "center"
1478
+ },
1479
+ children: ["v", me]
1480
+ })
1481
+ ]
1482
+ }), /* @__PURE__ */ c("button", {
1483
+ "aria-label": "Close sidebar",
1484
+ style: {
1485
+ background: "transparent",
1486
+ border: "none",
1487
+ cursor: "pointer",
1488
+ fontSize: "var(--twd-font-size-md)",
1489
+ paddingRight: "0",
1490
+ paddingLeft: "0"
1491
+ },
1492
+ onClick: () => _(!1),
1493
+ children: ""
1494
+ })]
1495
+ }),
1496
+ /* @__PURE__ */ c("div", {
1497
+ style: {
1498
+ display: "flex",
1499
+ justifyContent: "space-between",
1500
+ alignItems: "center",
1501
+ fontSize: "var(--twd-font-size-md)",
1502
+ color: "var(--twd-text-secondary)",
1503
+ marginBottom: "10px"
1504
+ },
1505
+ children: [/* @__PURE__ */ c("span", {
1506
+ style: { color: "var(--twd-text)" },
1507
+ children: ["Total: ", z]
1508
+ }), /* @__PURE__ */ c("div", {
1509
+ style: {
1510
+ display: "flex",
1511
+ gap: "var(--twd-spacing-xs)"
1512
+ },
1513
+ children: [/* @__PURE__ */ c("span", {
1514
+ style: { color: "var(--twd-success)" },
1515
+ children: ["✓ ", g.filter((h) => h.status === "pass").length]
1516
+ }), /* @__PURE__ */ c("span", {
1517
+ style: { color: "var(--twd-error)" },
1518
+ children: ["✗ ", g.filter((h) => h.status === "fail").length]
1519
+ })]
1520
+ })]
1521
+ }),
1522
+ /* @__PURE__ */ c(Jt, {}),
1523
+ r && /* @__PURE__ */ c(er, {
1524
+ value: a,
1525
+ onChange: f
1526
+ })
1527
+ ]
1528
+ }),
1529
+ /* @__PURE__ */ c("div", {
1530
+ style: { padding: "var(--twd-spacing-md)" },
1531
+ children: /* @__PURE__ */ c(Mt, {
1532
+ roots: k,
1533
+ runTest: I,
1534
+ searchQuery: a
1535
+ })
1536
+ })
1537
+ ]
1538
+ });
1539
+ }, lr = (e) => ({ render: (t) => {
1540
+ ut(t, e);
1541
+ } }), dr = (e, t) => {
1542
+ const { open: r = !0, position: n = "left", serviceWorker: o = !0, serviceWorkerUrl: s = "/mock-sw.js", theme: l, search: d } = t || {};
1543
+ gt(e, /* @__PURE__ */ c(ar, {
1544
+ open: r,
1545
+ position: n,
1546
+ ...d !== void 0 && { search: d }
1547
+ }), lr, l), o && jt(s).then(() => {
1429
1548
  console.log("Request mocking initialized");
1430
1549
  }).catch((u) => {
1431
1550
  console.error("Error initializing request mocking:", u);
1432
1551
  });
1433
1552
  };
1434
1553
  export {
1435
- nr as initTWD
1554
+ dr as initTWD
1436
1555
  };