@web-canvas-ui/react 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -7,19 +7,41 @@ function l(e) {
7
7
  return t.displayName = e[0].toUpperCase() + e.slice(1), t[c] = e, t;
8
8
  }
9
9
  // tools/angular-build/.stage/react/components/Group/group.ts
10
- var u = l("group"), d = l("grid"), f = l("gridItem");
11
- // tools/angular-build/.stage/react/components/draw-utils.ts
10
+ var u = l("group"), d = /* @__PURE__ */ new WeakMap();
11
+ function f() {
12
+ let e = () => {
13
+ let e = d.get(t);
14
+ if (!e) throw Error("Form controller is not attached to a mounted Form.");
15
+ return e;
16
+ }, t = {
17
+ getValues: () => e().getValues(),
18
+ getFieldValue: (t) => e().getFieldValue(t),
19
+ setFieldValue: (t, n) => e().setFieldValue(t, n)
20
+ };
21
+ return d.set(t, null), t;
22
+ }
12
23
  function p(e, t) {
13
- return typeof e == "number" && Number.isFinite(e) ? e : t;
24
+ if (!d.has(e)) throw TypeError("Use createFormController() to create a Form controller.");
25
+ let n = d.get(e);
26
+ if (n && n.owner !== t.owner) throw Error("A Form controller can only be attached to one Form.");
27
+ d.set(e, t);
14
28
  }
15
29
  function m(e, t) {
30
+ d.get(e)?.owner === t && d.set(e, null);
31
+ }
32
+ var h = l("form"), g = l("formItem"), _ = l("grid"), v = l("gridItem");
33
+ // tools/angular-build/.stage/react/components/draw-utils.ts
34
+ function y(e, t) {
35
+ return typeof e == "number" && Number.isFinite(e) ? e : t;
36
+ }
37
+ function b(e, t) {
16
38
  return typeof e == "string" ? e : t;
17
39
  }
18
- var h = 1.2, g = "…", _ = /[\u2e80-\u9fff\uac00-\ud7af]/u;
19
- function v(e) {
40
+ var x = 1.2, S = "…", C = /[\u2e80-\u9fff\uac00-\ud7af]/u;
41
+ function w(e) {
20
42
  return (t) => e.measureText(t).width;
21
43
  }
22
- function y(e, t, n) {
44
+ function T(e, t, n) {
23
45
  let r = [];
24
46
  for (let i of t.split("\n")) {
25
47
  let t = "";
@@ -29,7 +51,7 @@ function y(e, t, n) {
29
51
  else if (t || !/^\s+$/.test(a)) {
30
52
  if (!t && e(a) <= n) t = a;
31
53
  else {
32
- t && !_.test(a) && (r.push(t.trimEnd()), t = "");
54
+ t && !C.test(a) && (r.push(t.trimEnd()), t = "");
33
55
  for (let i of Array.from(a)) t && e(t + i) > n && (r.push(t.trimEnd()), t = ""), t += i;
34
56
  }
35
57
  }
@@ -38,48 +60,48 @@ function y(e, t, n) {
38
60
  }
39
61
  return r;
40
62
  }
41
- function b(e, t, n) {
63
+ function ee(e, t, n) {
42
64
  let r = Array.from(t), i = 0, a = r.length;
43
65
  for (; i < a;) {
44
66
  let t = Math.ceil((i + a) / 2);
45
- e(r.slice(0, t).join("") + g) <= n ? i = t : a = t - 1;
67
+ e(r.slice(0, t).join("") + S) <= n ? i = t : a = t - 1;
46
68
  }
47
- return r.slice(0, i).join("") + g;
69
+ return r.slice(0, i).join("") + S;
48
70
  }
49
- function x(e, t, n) {
50
- return !t || e(t) <= n ? t : b(e, t, n);
71
+ function te(e, t, n) {
72
+ return !t || e(t) <= n ? t : ee(e, t, n);
51
73
  }
52
- function S(e, t, n, r) {
53
- let i = y(e, t, n);
74
+ function ne(e, t, n, r) {
75
+ let i = T(e, t, n);
54
76
  if (i.length <= r) return i;
55
77
  let a = i.slice(0, r);
56
- return a[r - 1] = b(e, a[r - 1], n), a;
78
+ return a[r - 1] = ee(e, a[r - 1], n), a;
57
79
  }
58
- function C(e, t, n, r = 0) {
59
- return n > 0 ? r > 0 ? S(e, t, n, Math.max(1, Math.round(r))) : y(e, t, n) : [t];
80
+ function re(e, t, n, r = 0) {
81
+ return n > 0 ? r > 0 ? ne(e, t, n, Math.max(1, Math.round(r))) : T(e, t, n) : [t];
60
82
  }
61
- function w(e, t, n) {
62
- return y(v(e), t, n);
83
+ function ie(e, t, n) {
84
+ return T(w(e), t, n);
63
85
  }
64
- function T(e, t, n) {
65
- return x(v(e), t, n);
86
+ function E(e, t, n) {
87
+ return te(w(e), t, n);
66
88
  }
67
- var ee = null, E = !1, D = "";
68
- function te() {
69
- return E || (E = !0, typeof document < "u" && (ee = document.createElement("canvas").getContext("2d"))), ee;
89
+ var ae = null, oe = !1, D = "";
90
+ function se() {
91
+ return oe || (oe = !0, typeof document < "u" && (ae = document.createElement("canvas").getContext("2d"))), ae;
70
92
  }
71
93
  function O(e, t) {
72
- let n = te();
73
- return n ? (D !== t && (n.font = t, D = t), n.measureText(e).width) : ne(e, t);
94
+ let n = se();
95
+ return n ? (D !== t && (n.font = t, D = t), n.measureText(e).width) : ce(e, t);
74
96
  }
75
- function ne(e, t) {
97
+ function ce(e, t) {
76
98
  let n = parseFloat(t) || 14;
77
99
  return Array.from(e).reduce((e, t) => {
78
- let r = _.test(t);
100
+ let r = C.test(t);
79
101
  return e + n * (r ? 1 : .62);
80
102
  }, 0);
81
103
  }
82
- function re(e, t, n, r, i, a, o) {
104
+ function le(e, t, n, r, i, a, o) {
83
105
  if (e.beginPath(), e.rect(0, 0, i, a), e.clip(), !(n > 0) || !(r > 0) || !(i > 0) || !(a > 0)) return;
84
106
  if (o === "fill") {
85
107
  e.drawImage(t, 0, 0, i, a);
@@ -94,129 +116,129 @@ function re(e, t, n, r, i, a, o) {
94
116
  let c = n * s, l = r * s;
95
117
  e.drawImage(t, (i - c) / 2, (a - l) / 2, c, l);
96
118
  }
97
- var k = null;
98
- function A() {
99
- if (k !== null) return k;
119
+ var ue = null;
120
+ function de() {
121
+ if (ue !== null) return ue;
100
122
  let e = typeof document > "u" ? null : document.body;
101
123
  if (!e) return 0;
102
124
  let t = document.createElement("div");
103
125
  t.style.position = "absolute", t.style.top = "-9999px", t.style.width = "100px", t.style.height = "100px", t.style.overflowY = "scroll";
104
126
  let n = document.createElement("div");
105
- return n.style.width = "10px", n.style.height = "200px", t.appendChild(n), e.appendChild(t), k = Math.max(0, t.offsetWidth - t.clientWidth), t.remove(), k;
127
+ return n.style.width = "10px", n.style.height = "200px", t.appendChild(n), e.appendChild(t), ue = Math.max(0, t.offsetWidth - t.clientWidth), t.remove(), ue;
106
128
  }
107
- var ie = 0, ae = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new WeakMap();
108
- function se(e, t) {
109
- oe.set(e, oe.get(t) ?? t);
129
+ var fe = 0, pe = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap();
130
+ function he(e, t) {
131
+ me.set(e, me.get(t) ?? t);
110
132
  }
111
- function ce() {
112
- ie += 1;
133
+ function ge() {
134
+ fe += 1;
113
135
  }
114
- function j(e, t, n) {
136
+ function k(e, t, n) {
115
137
  if (typeof getComputedStyle != "function") return n;
116
- let r = oe.get(e.canvas) ?? e.canvas, i = ae.get(r);
117
- i || (i = /* @__PURE__ */ new Map(), ae.set(r, i));
138
+ let r = me.get(e.canvas) ?? e.canvas, i = pe.get(r);
139
+ i || (i = /* @__PURE__ */ new Map(), pe.set(r, i));
118
140
  let a = i.get(t);
119
- if (a && a.generation === ie) return a.value;
141
+ if (a && a.generation === fe) return a.value;
120
142
  let o = getComputedStyle(r).getPropertyValue(t).trim() || n;
121
143
  return i.set(t, {
122
- generation: ie,
144
+ generation: fe,
123
145
  value: o
124
146
  }), o;
125
147
  }
126
148
  // tools/angular-build/.stage/react/components/Rect/rect.ts
127
- var le = l("rect");
128
- function ue(e, t) {
129
- let n = p(t.width, 100), r = p(t.height, 40), i = Math.max(0, Math.min(p(t.radius, 0), n / 2, r / 2));
130
- e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = m(t.color, j(e, "--canvas-ui-rect-background", "transparent")), e.fill(), t.stroke && (e.strokeStyle = m(t.stroke, j(e, "--canvas-ui-rect-border", "#000")), e.lineWidth = p(t.strokeWidth, 1), e.stroke());
149
+ var _e = l("rect");
150
+ function ve(e, t) {
151
+ let n = y(t.width, 100), r = y(t.height, 40), i = Math.max(0, Math.min(y(t.radius, 0), n / 2, r / 2));
152
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = b(t.color, k(e, "--canvas-ui-rect-background", "transparent")), e.fill(), t.stroke && (e.strokeStyle = b(t.stroke, k(e, "--canvas-ui-rect-border", "#000")), e.lineWidth = y(t.strokeWidth, 1), e.stroke());
131
153
  }
132
154
  // tools/angular-build/.stage/react/components/Circle/circle.ts
133
- var de = l("circle");
134
- function fe(e, t) {
135
- let n = p(t.radius, 10);
136
- e.beginPath(), e.arc(0, 0, n, 0, Math.PI * 2), e.fillStyle = m(t.color, j(e, "--canvas-ui-circle-background", "#e74c3c")), e.fill(), t.stroke && (e.strokeStyle = m(t.stroke, j(e, "--canvas-ui-circle-border", "#000")), e.lineWidth = p(t.strokeWidth, 1), e.stroke());
155
+ var ye = l("circle");
156
+ function be(e, t) {
157
+ let n = y(t.radius, 10);
158
+ e.beginPath(), e.arc(0, 0, n, 0, Math.PI * 2), e.fillStyle = b(t.color, k(e, "--canvas-ui-circle-background", "#e74c3c")), e.fill(), t.stroke && (e.strokeStyle = b(t.stroke, k(e, "--canvas-ui-circle-border", "#000")), e.lineWidth = y(t.strokeWidth, 1), e.stroke());
137
159
  }
138
160
  // tools/angular-build/.stage/react/components/Text/text.ts
139
- var pe = 16, me = l("text");
140
- function he(e, t) {
141
- return e > 0 ? Math.max(1, Math.floor(e / (t * h))) : 0;
161
+ var xe = 16, Se = l("text");
162
+ function Ce(e, t) {
163
+ return e > 0 ? Math.max(1, Math.floor(e / (t * x))) : 0;
142
164
  }
143
- function ge(e) {
144
- let t = p(e.fontSize, pe), n = `${t}px ${m(e.fontFamily, "sans-serif")}`, r = (e) => O(e, n), i = String(e.text ?? ""), a = p(e.width, p(e._availableWidth, 0)), o = C(r, i, a, p(e.maxLines, he(p(e._availableHeight, 0), t)));
165
+ function we(e) {
166
+ let t = y(e.fontSize, xe), n = `${t}px ${b(e.fontFamily, "sans-serif")}`, r = (e) => O(e, n), i = String(e.text ?? ""), a = y(e.width, y(e._availableWidth, 0)), o = re(r, i, a, y(e.maxLines, Ce(y(e._availableHeight, 0), t)));
145
167
  return {
146
168
  lines: o,
147
169
  width: a > 0 ? a : r(i),
148
- height: o.length * t * h
170
+ height: o.length * t * x
149
171
  };
150
172
  }
151
- function _e(e, t) {
152
- let n = p(t.fontSize, pe);
153
- e.font = `${n}px ${m(t.fontFamily, "sans-serif")}`, e.textBaseline = t.baseline ?? "top";
173
+ function Te(e, t) {
174
+ let n = y(t.fontSize, xe);
175
+ e.font = `${n}px ${b(t.fontFamily, "sans-serif")}`, e.textBaseline = t.baseline ?? "top";
154
176
  let r = t.textAlign === "center" || t.textAlign === "right" ? t.textAlign : "left";
155
- e.textAlign = r, e.fillStyle = m(t.color, j(e, "--canvas-ui-text-color", "#333"));
156
- let i = ge(t), a = r === "center" ? i.width / 2 : r === "right" ? i.width : 0;
177
+ e.textAlign = r, e.fillStyle = b(t.color, k(e, "--canvas-ui-text-color", "#333"));
178
+ let i = we(t), a = r === "center" ? i.width / 2 : r === "right" ? i.width : 0;
157
179
  i.lines.forEach((t, r) => {
158
- e.fillText(t, a, r * n * h);
180
+ e.fillText(t, a, r * n * x);
159
181
  }), e.textAlign = "left";
160
182
  }
161
183
  // tools/angular-build/.stage/react/components/Input/input.ts
162
- var ve = l("input");
163
- function ye(e, t, n = !1) {
164
- let r = p(t.width, 200), i = p(t.height, 36), a = Math.max(0, Math.min(p(t.borderRadius, 4), r / 2, i / 2)), o = p(t.padding, 8), s = String(t.value ?? ""), c = String(t.placeholder ?? ""), l = t.type === "password" ? "•".repeat(s.length) : s;
165
- e.beginPath(), e.roundRect(0, 0, r, i, a), e.fillStyle = m(t.bgColor, j(e, "--canvas-ui-input-background", "#fff")), e.fill(), e.strokeStyle = t.focused ? m(t.focusBorderColor, j(e, "--canvas-ui-input-focus-border", "#1677ff")) : m(t.borderColor, j(e, "--canvas-ui-input-border", "#d9d9d9")), e.lineWidth = 1, e.stroke(), e.save(), e.beginPath(), e.rect(0, 0, r, i), e.clip();
166
- let u = p(t.fontSize, 14);
167
- e.font = `${u}px ${m(t.fontFamily, "sans-serif")}`, e.textBaseline = n ? "top" : "middle", e.fillStyle = s ? m(t.color, j(e, "--canvas-ui-input-color", "#333")) : j(e, "--canvas-ui-input-placeholder-color", "#999");
168
- let d = u * 1.35, f = p(t._scrollClientWidth, 0), h = n && f > 0 ? Math.max(0, r - f) : n && p(t._scrollHeight, 0) > i ? A() : 0, g = Math.max(1, r - o * 2 - h), _ = n ? w(e, l || c, g) : [], v = n ? Math.max(p(t._scrollHeight, 0), _.length * d + o * 2) : 0, y = n ? Math.max(0, Math.min(v - i, p(t._scrollTop, 0))) : 0;
169
- if (n ? (_.forEach((t, n) => {
170
- e.fillText(t, o, o + n * d - y);
171
- }), v > i && be(e, r, i, v, y)) : e.fillText(l || c, o, i / 2), t.focused && !t.disabled) {
172
- let r = Math.max(0, Math.min(p(t.cursorPos, s.length), l.length)), a, c;
184
+ var Ee = l("input");
185
+ function De(e, t, n = !1) {
186
+ let r = y(t.width, 200), i = y(t.height, 36), a = Math.max(0, Math.min(y(t.borderRadius, 4), r / 2, i / 2)), o = y(t.padding, 8), s = String(t.value ?? ""), c = String(t.placeholder ?? ""), l = t.type === "password" ? "•".repeat(s.length) : s;
187
+ e.beginPath(), e.roundRect(0, 0, r, i, a), e.fillStyle = b(t.bgColor, k(e, "--canvas-ui-input-background", "#fff")), e.fill(), e.strokeStyle = t.focused ? b(t.focusBorderColor, k(e, "--canvas-ui-input-focus-border", "#1677ff")) : b(t.borderColor, k(e, "--canvas-ui-input-border", "#d9d9d9")), e.lineWidth = 1, e.stroke(), e.save(), e.beginPath(), e.rect(0, 0, r, i), e.clip();
188
+ let u = y(t.fontSize, 14);
189
+ e.font = `${u}px ${b(t.fontFamily, "sans-serif")}`, e.textBaseline = n ? "top" : "middle", e.fillStyle = s ? b(t.color, k(e, "--canvas-ui-input-color", "#333")) : k(e, "--canvas-ui-input-placeholder-color", "#999");
190
+ let d = u * 1.35, f = y(t._scrollClientWidth, 0), p = n && f > 0 ? Math.max(0, r - f) : n && y(t._scrollHeight, 0) > i ? de() : 0, m = Math.max(1, r - o * 2 - p), h = n ? ie(e, l || c, m) : [], g = n ? Math.max(y(t._scrollHeight, 0), h.length * d + o * 2) : 0, _ = n ? Math.max(0, Math.min(g - i, y(t._scrollTop, 0))) : 0;
191
+ if (n ? (h.forEach((t, n) => {
192
+ e.fillText(t, o, o + n * d - _);
193
+ }), g > i && Oe(e, r, i, g, _)) : e.fillText(l || c, o, i / 2), t.focused && !t.disabled) {
194
+ let r = Math.max(0, Math.min(y(t.cursorPos, s.length), l.length)), a, c;
173
195
  if (n) {
174
196
  let t = [], n = 0;
175
- for (let e of _) {
197
+ for (let e of h) {
176
198
  let r = l.indexOf(e, n);
177
199
  r < 0 && (r = n), t.length > 0 && e === "" && l[r] === "\n" && (r += 1), t.push(r), n = r + e.length;
178
200
  }
179
201
  let i = 0;
180
202
  for (let e = 1; e < t.length && !(r < t[e]); e++) i = e;
181
- a = e.measureText(l.slice(t[i] ?? 0, r)).width, c = o + i * d - y;
203
+ a = e.measureText(l.slice(t[i] ?? 0, r)).width, c = o + i * d - _;
182
204
  } else a = e.measureText(l.slice(0, r)).width, c = (i - u) / 2;
183
- e.fillStyle = m(t.color, j(e, "--canvas-ui-input-color", "#333")), (!n || c + u >= 0 && c <= i) && e.fillRect(o + a, c, 1, u);
205
+ e.fillStyle = b(t.color, k(e, "--canvas-ui-input-color", "#333")), (!n || c + u >= 0 && c <= i) && e.fillRect(o + a, c, 1, u);
184
206
  }
185
207
  e.restore();
186
208
  }
187
- function be(e, t, n, r, i) {
209
+ function Oe(e, t, n, r, i) {
188
210
  let a = Math.min(n, Math.max(16, n * n / r)), o = r - n, s = o > 0 ? (n - a) * i / o : 0;
189
211
  e.fillStyle = "rgba(0, 0, 0, 0.08)", e.fillRect(t - 5, 0, 5, n), e.fillStyle = "rgba(0, 0, 0, 0.35)", e.beginPath(), e.roundRect(t - 5 + 1, s, 3, a, 2), e.fill();
190
212
  }
191
213
  // tools/angular-build/.stage/react/components/Textarea/textarea.ts
192
- var xe = l("textarea");
193
- function Se(e, t) {
194
- ye(e, t, !0);
214
+ var ke = l("textarea");
215
+ function Ae(e, t) {
216
+ De(e, t, !0);
195
217
  }
196
218
  // tools/angular-build/.stage/react/components/Dropdown/dropdown.ts
197
- var Ce = l("dropdown");
198
- function we(e, t) {
199
- let n = p(t.width, 200), r = p(t.height, 36), i = De(t.options).find((e) => e.value === String(t.value ?? ""));
200
- Ee(e, n, r, p(t.borderRadius, 4), t, !!(t.focused || t.open)), e.font = `${p(t.fontSize, 14)}px sans-serif`, e.textBaseline = "middle", e.fillStyle = i ? m(t.color, j(e, "--canvas-ui-dropdown-color", "#333")) : j(e, "--canvas-ui-dropdown-placeholder-color", "#999"), e.fillText(T(e, i?.label ?? m(t.placeholder, "Select..."), Math.max(0, n - 34)), 8, r / 2), e.fillStyle = m(t.color, j(e, "--canvas-ui-dropdown-color", "#555")), e.beginPath(), e.moveTo(n - 18, r / 2 - 3), e.lineTo(n - 12, r / 2 + 3), e.lineTo(n - 6, r / 2 - 3), e.stroke();
201
- }
202
- function Te(e, t) {
203
- let n = p(t.width, 200), r = p(t.height, 36);
204
- e.font = `${p(t.fontSize, 14)}px sans-serif`, e.textBaseline = "middle", De(t.options).forEach((i, a) => {
219
+ var je = l("dropdown");
220
+ function Me(e, t) {
221
+ let n = y(t.width, 200), r = y(t.height, 36), i = Fe(t.options).find((e) => e.value === String(t.value ?? ""));
222
+ Pe(e, n, r, y(t.borderRadius, 4), t, !!(t.focused || t.open)), e.font = `${y(t.fontSize, 14)}px sans-serif`, e.textBaseline = "middle", e.fillStyle = i ? b(t.color, k(e, "--canvas-ui-dropdown-color", "#333")) : k(e, "--canvas-ui-dropdown-placeholder-color", "#999"), e.fillText(E(e, i?.label ?? b(t.placeholder, "Select..."), Math.max(0, n - 34)), 8, r / 2), e.fillStyle = b(t.color, k(e, "--canvas-ui-dropdown-color", "#555")), e.beginPath(), e.moveTo(n - 18, r / 2 - 3), e.lineTo(n - 12, r / 2 + 3), e.lineTo(n - 6, r / 2 - 3), e.stroke();
223
+ }
224
+ function Ne(e, t) {
225
+ let n = y(t.width, 200), r = y(t.height, 36);
226
+ e.font = `${y(t.fontSize, 14)}px sans-serif`, e.textBaseline = "middle", Fe(t.options).forEach((i, a) => {
205
227
  let o = r * (a + 1);
206
- e.fillStyle = j(e, "--canvas-ui-dropdown-option-background", "#fff"), e.fillRect(0, o, n, r), e.strokeStyle = j(e, "--canvas-ui-dropdown-option-border", "#e3e7ed"), e.strokeRect(0, o, n, r), e.fillStyle = i.disabled ? j(e, "--canvas-ui-dropdown-disabled-color", "#aaa") : m(t.color, j(e, "--canvas-ui-dropdown-color", "#333")), e.fillText(T(e, i.label, Math.max(0, n - 16)), 8, o + r / 2);
228
+ e.fillStyle = k(e, "--canvas-ui-dropdown-option-background", "#fff"), e.fillRect(0, o, n, r), e.strokeStyle = k(e, "--canvas-ui-dropdown-option-border", "#e3e7ed"), e.strokeRect(0, o, n, r), e.fillStyle = i.disabled ? k(e, "--canvas-ui-dropdown-disabled-color", "#aaa") : b(t.color, k(e, "--canvas-ui-dropdown-color", "#333")), e.fillText(E(e, i.label, Math.max(0, n - 16)), 8, o + r / 2);
207
229
  });
208
230
  }
209
- function Ee(e, t, n, r, i, a) {
210
- e.beginPath(), e.roundRect(0, 0, t, n, r), e.fillStyle = m(i.bgColor, j(e, "--canvas-ui-dropdown-background", "#fff")), e.fill(), e.strokeStyle = a ? m(i.focusBorderColor, j(e, "--canvas-ui-dropdown-focus-border", "#1677ff")) : m(i.borderColor, j(e, "--canvas-ui-dropdown-border", "#d9d9d9")), e.stroke();
231
+ function Pe(e, t, n, r, i, a) {
232
+ e.beginPath(), e.roundRect(0, 0, t, n, r), e.fillStyle = b(i.bgColor, k(e, "--canvas-ui-dropdown-background", "#fff")), e.fill(), e.strokeStyle = a ? b(i.focusBorderColor, k(e, "--canvas-ui-dropdown-focus-border", "#1677ff")) : b(i.borderColor, k(e, "--canvas-ui-dropdown-border", "#d9d9d9")), e.stroke();
211
233
  }
212
- function De(e) {
234
+ function Fe(e) {
213
235
  return Array.isArray(e) ? e.map((e) => typeof e == "string" ? {
214
236
  label: e,
215
237
  value: e
216
238
  } : e) : [];
217
239
  }
218
240
  // tools/angular-build/.stage/react/components/Dropdown/logic.ts
219
- function M(e) {
241
+ function A(e) {
220
242
  return Array.isArray(e) ? e.flatMap((e) => {
221
243
  if (typeof e == "string") return [{
222
244
  label: e,
@@ -231,10 +253,10 @@ function M(e) {
231
253
  }];
232
254
  }) : [];
233
255
  }
234
- function Oe(e, t) {
235
- return M(e)[t];
256
+ function Ie(e, t) {
257
+ return A(e)[t];
236
258
  }
237
- function ke(e, t) {
259
+ function Le(e, t) {
238
260
  e.setProps({
239
261
  value: t.value,
240
262
  open: !1
@@ -243,79 +265,79 @@ function ke(e, t) {
243
265
  typeof n == "function" && n(t.value);
244
266
  }
245
267
  // tools/angular-build/.stage/react/components/Slider/slider.ts
246
- var Ae = l("slider");
247
- function je(e, t) {
248
- let n = p(t.width, 160), r = p(t.height, 32), i = p(t.min, 0), a = p(t.max, 100), o = Math.max(i, Math.min(a, p(t.value, i))), s = a === i ? 0 : (o - i) / (a - i), c = r / 2, l = Math.min(8, r / 3), u = l + s * Math.max(0, n - l * 2);
249
- e.beginPath(), e.roundRect(l, c - 3, Math.max(0, n - l * 2), 6, 3), e.fillStyle = m(t.trackColor, j(e, "--canvas-ui-slider-track", "#f0f0f0")), e.fill(), e.beginPath(), e.roundRect(l, c - 3, Math.max(0, u - l), 6, 3), e.fillStyle = m(t.activeColor, j(e, "--canvas-ui-slider-active", "#1677ff")), e.fill(), e.beginPath(), e.arc(u, c, l, 0, Math.PI * 2), e.fillStyle = m(t.thumbColor, j(e, "--canvas-ui-slider-thumb", "#fff")), e.fill(), e.strokeStyle = m(t.activeColor, j(e, "--canvas-ui-slider-active", "#1677ff")), e.stroke();
268
+ var Re = l("slider");
269
+ function ze(e, t) {
270
+ let n = y(t.width, 160), r = y(t.height, 32), i = y(t.min, 0), a = y(t.max, 100), o = Math.max(i, Math.min(a, y(t.value, i))), s = a === i ? 0 : (o - i) / (a - i), c = r / 2, l = Math.min(8, r / 3), u = l + s * Math.max(0, n - l * 2);
271
+ e.beginPath(), e.roundRect(l, c - 3, Math.max(0, n - l * 2), 6, 3), e.fillStyle = b(t.trackColor, k(e, "--canvas-ui-slider-track", "#f0f0f0")), e.fill(), e.beginPath(), e.roundRect(l, c - 3, Math.max(0, u - l), 6, 3), e.fillStyle = b(t.activeColor, k(e, "--canvas-ui-slider-active", "#1677ff")), e.fill(), e.beginPath(), e.arc(u, c, l, 0, Math.PI * 2), e.fillStyle = b(t.thumbColor, k(e, "--canvas-ui-slider-thumb", "#fff")), e.fill(), e.strokeStyle = b(t.activeColor, k(e, "--canvas-ui-slider-active", "#1677ff")), e.stroke();
250
272
  }
251
273
  // tools/angular-build/.stage/react/components/Slider/logic.ts
252
- function Me(e, t, n) {
253
- let r = Math.min(8, p(e.height, 32) / 3), i = p(e.min, 0), a = p(e.max, 100);
274
+ function Be(e, t, n) {
275
+ let r = Math.min(8, y(e.height, 32) / 3), i = y(e.min, 0), a = y(e.max, 100);
254
276
  if (a <= i) return;
255
- let o = Math.max(2 ** -52, p(e.step, 1)), s = i + Math.max(0, Math.min(1, (n - r) / Math.max(1, t - r * 2))) * (a - i);
277
+ let o = Math.max(2 ** -52, y(e.step, 1)), s = i + Math.max(0, Math.min(1, (n - r) / Math.max(1, t - r * 2))) * (a - i);
256
278
  return Math.max(i, Math.min(a, i + Math.round((s - i) / o) * o));
257
279
  }
258
280
  // tools/angular-build/.stage/react/components/Switch/switch.ts
259
- var Ne = l("switch");
260
- function Pe(e, t) {
261
- let n = p(t.width, 44), r = p(t.height, 24), i = r / 2, a = !!t.checked;
262
- e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = a ? m(t.onColor, j(e, "--canvas-ui-switch-on", "#1677ff")) : m(t.offColor, j(e, "--canvas-ui-switch-off", "#d9d9d9")), e.fill(), e.beginPath(), e.arc(a ? n - i : i, i, Math.max(1, i - 3), 0, Math.PI * 2), e.fillStyle = m(t.thumbColor, j(e, "--canvas-ui-switch-thumb", "#fff")), e.fill();
281
+ var Ve = l("switch");
282
+ function He(e, t) {
283
+ let n = y(t.width, 44), r = y(t.height, 24), i = r / 2, a = !!t.checked;
284
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = a ? b(t.onColor, k(e, "--canvas-ui-switch-on", "#1677ff")) : b(t.offColor, k(e, "--canvas-ui-switch-off", "#d9d9d9")), e.fill(), e.beginPath(), e.arc(a ? n - i : i, i, Math.max(1, i - 3), 0, Math.PI * 2), e.fillStyle = b(t.thumbColor, k(e, "--canvas-ui-switch-thumb", "#fff")), e.fill();
263
285
  }
264
286
  // tools/angular-build/.stage/react/components/Switch/logic.ts
265
- function Fe(e) {
287
+ function Ue(e) {
266
288
  let t = !e.props.checked;
267
289
  e.setProps({ checked: t });
268
290
  let n = e.props.onChange;
269
291
  typeof n == "function" && n(t);
270
292
  }
271
293
  // tools/angular-build/.stage/react/components/DatePicker/datePicker.ts
272
- var Ie = l("datePicker");
273
- function Le(e, t) {
274
- let n = p(t.width, 200), r = p(t.height, 36), i = Math.max(0, Math.min(p(t.borderRadius, 4), n / 2, r / 2)), a = String(t.value ?? "");
275
- e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = m(t.bgColor, j(e, "--canvas-ui-input-background", "#fff")), e.fill(), e.strokeStyle = t.focused ? m(t.focusBorderColor, j(e, "--canvas-ui-input-focus-border", "#1677ff")) : m(t.borderColor, j(e, "--canvas-ui-input-border", "#d9d9d9")), e.stroke(), e.font = `${p(t.fontSize, 14)}px sans-serif`, e.textBaseline = "middle", e.fillStyle = a ? m(t.color, j(e, "--canvas-ui-input-color", "#333")) : j(e, "--canvas-ui-input-placeholder-color", "#999"), e.fillText(a || m(t.placeholder, "Select date"), 8, r / 2), e.fillStyle = m(t.color, j(e, "--canvas-ui-input-color", "#666")), e.strokeStyle = e.fillStyle, e.lineWidth = 1.4;
294
+ var We = l("datePicker");
295
+ function Ge(e, t) {
296
+ let n = y(t.width, 200), r = y(t.height, 36), i = Math.max(0, Math.min(y(t.borderRadius, 4), n / 2, r / 2)), a = String(t.value ?? "");
297
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = b(t.bgColor, k(e, "--canvas-ui-input-background", "#fff")), e.fill(), e.strokeStyle = t.focused ? b(t.focusBorderColor, k(e, "--canvas-ui-input-focus-border", "#1677ff")) : b(t.borderColor, k(e, "--canvas-ui-input-border", "#d9d9d9")), e.stroke(), e.font = `${y(t.fontSize, 14)}px sans-serif`, e.textBaseline = "middle", e.fillStyle = a ? b(t.color, k(e, "--canvas-ui-input-color", "#333")) : k(e, "--canvas-ui-input-placeholder-color", "#999"), e.fillText(a || b(t.placeholder, "Select date"), 8, r / 2), e.fillStyle = b(t.color, k(e, "--canvas-ui-input-color", "#666")), e.strokeStyle = e.fillStyle, e.lineWidth = 1.4;
276
298
  let o = n - 20, s = r / 2 - 7;
277
299
  e.strokeRect(o, s + 2, 13, 12), e.beginPath(), e.moveTo(o, s + 5), e.lineTo(o + 13, s + 5), e.moveTo(o + 3, s), e.lineTo(o + 3, s + 4), e.moveTo(o + 10, s), e.lineTo(o + 10, s + 4), e.stroke();
278
300
  }
279
301
  // tools/angular-build/.stage/react/components/size.ts
280
- function N(e, t) {
281
- return p(Re(e)?.width, p(e.width, t));
302
+ function Ke(e, t) {
303
+ return y(qe(e)?.width, y(e.width, t));
282
304
  }
283
- function P(e, t) {
284
- return p(Re(e)?.height, p(e.height, t));
305
+ function j(e, t) {
306
+ return y(qe(e)?.height, y(e.height, t));
285
307
  }
286
- function Re(e) {
308
+ function qe(e) {
287
309
  let t = e.size;
288
310
  if (typeof t == "object" && t && !Array.isArray(t)) return t;
289
311
  }
290
312
  // tools/angular-build/.stage/react/components/ChoiceGroup/choiceGroup.ts
291
- function ze(e) {
313
+ function M(e) {
292
314
  return Array.isArray(e) ? e.map((e) => typeof e == "string" ? {
293
315
  label: e,
294
316
  value: e
295
317
  } : e) : [];
296
318
  }
297
- function Be(e) {
298
- let t = ze(e.options), n = e.direction !== "vertical", r = p(e.gap, 12), i = p(e.fontSize, 14), a = p(e.optionHeight, 28), o = t.reduce((e, t) => e + Ue(t.label, i), 0) + r * Math.max(0, t.length - 1), s = t.length * a + r * Math.max(0, t.length - 1);
319
+ function Je(e) {
320
+ let t = M(e.options), n = e.direction !== "vertical", r = y(e.gap, 12), i = y(e.fontSize, 14), a = y(e.optionHeight, 28), o = t.reduce((e, t) => e + N(t.label, i), 0) + r * Math.max(0, t.length - 1), s = t.length * a + r * Math.max(0, t.length - 1);
299
321
  return {
300
- width: N(e, n ? o : 200),
301
- height: P(e, n ? a : s)
322
+ width: Ke(e, n ? o : 200),
323
+ height: j(e, n ? a : s)
302
324
  };
303
325
  }
304
- function Ve(e, t, n) {
305
- let r = ze(t.options), i = t.direction !== "vertical", a = p(t.gap, 12), o = p(t.fontSize, 14), s = p(t.optionHeight, 28), c = t.value;
326
+ function Ye(e, t, n) {
327
+ let r = M(t.options), i = t.direction !== "vertical", a = y(t.gap, 12), o = y(t.fontSize, 14), s = y(t.optionHeight, 28), c = t.value;
306
328
  e.font = `${o}px sans-serif`, e.textBaseline = "middle", e.lineWidth = 1;
307
329
  let l = 0, u = 0;
308
330
  for (let d of r) {
309
- let r = Array.isArray(c) ? c.includes(d.value) : c === d.value, f = u + s / 2, p = l + 9, h = d.disabled === !0;
310
- e.strokeStyle = h ? m(t.disabledColor, j(e, "--canvas-ui-choice-disabled", "#bfbfbf")) : m(t.borderColor, j(e, "--canvas-ui-choice-border", "#d9d9d9")), e.fillStyle = h ? j(e, "--canvas-ui-choice-disabled-background", "#f5f5f5") : "#fff", n === "radio" ? (e.beginPath(), e.arc(p, f, 8, 0, Math.PI * 2), e.fill(), e.stroke(), r && (e.beginPath(), e.arc(p, f, 4, 0, Math.PI * 2), e.fillStyle = m(t.activeColor, j(e, "--canvas-ui-choice-active", "#1677ff")), e.fill())) : (e.beginPath(), e.roundRect(l + 1, f - 8, 16, 16, 3), e.fill(), e.stroke(), r && (e.strokeStyle = m(t.activeColor, j(e, "--canvas-ui-choice-active", "#1677ff")), e.lineWidth = 2, e.beginPath(), e.moveTo(l + 5, f), e.lineTo(l + 8, f + 3), e.lineTo(l + 13, f - 4), e.stroke(), e.lineWidth = 1)), e.fillStyle = h ? m(t.disabledColor, j(e, "--canvas-ui-choice-disabled", "#bfbfbf")) : m(t.color, j(e, "--canvas-ui-choice-color", "#333")), e.fillText(d.label, l + 23, f), i ? l += Ue(d.label, o) + a : u += s + a;
331
+ let r = Array.isArray(c) ? c.includes(d.value) : c === d.value, f = u + s / 2, p = l + 9, m = d.disabled === !0;
332
+ e.strokeStyle = m ? b(t.disabledColor, k(e, "--canvas-ui-choice-disabled", "#bfbfbf")) : b(t.borderColor, k(e, "--canvas-ui-choice-border", "#d9d9d9")), e.fillStyle = m ? k(e, "--canvas-ui-choice-disabled-background", "#f5f5f5") : "#fff", n === "radio" ? (e.beginPath(), e.arc(p, f, 8, 0, Math.PI * 2), e.fill(), e.stroke(), r && (e.beginPath(), e.arc(p, f, 4, 0, Math.PI * 2), e.fillStyle = b(t.activeColor, k(e, "--canvas-ui-choice-active", "#1677ff")), e.fill())) : (e.beginPath(), e.roundRect(l + 1, f - 8, 16, 16, 3), e.fill(), e.stroke(), r && (e.strokeStyle = b(t.activeColor, k(e, "--canvas-ui-choice-active", "#1677ff")), e.lineWidth = 2, e.beginPath(), e.moveTo(l + 5, f), e.lineTo(l + 8, f + 3), e.lineTo(l + 13, f - 4), e.stroke(), e.lineWidth = 1)), e.fillStyle = m ? b(t.disabledColor, k(e, "--canvas-ui-choice-disabled", "#bfbfbf")) : b(t.color, k(e, "--canvas-ui-choice-color", "#333")), e.fillText(d.label, l + 23, f), i ? l += N(d.label, o) + a : u += s + a;
311
333
  }
312
334
  }
313
- function He(e, t, n) {
314
- let r = ze(e.options), i = e.direction !== "vertical", a = p(e.gap, 12), o = p(e.fontSize, 14), s = p(e.optionHeight, 28), c = Be(e);
335
+ function Xe(e, t, n) {
336
+ let r = M(e.options), i = e.direction !== "vertical", a = y(e.gap, 12), o = y(e.fontSize, 14), s = y(e.optionHeight, 28), c = Je(e);
315
337
  if (i) {
316
338
  let e = 0;
317
339
  for (let i of r) {
318
- let r = Ue(i.label, o);
340
+ let r = N(i.label, o);
319
341
  if (t >= e && t <= e + r && n >= 0 && n <= c.height) return i;
320
342
  e += r + a;
321
343
  }
@@ -324,29 +346,29 @@ function He(e, t, n) {
324
346
  let l = Math.floor(n / (s + a));
325
347
  return n - l * (s + a) <= s && t >= 0 && t <= c.width ? r[l] : void 0;
326
348
  }
327
- function Ue(e, t) {
349
+ function N(e, t) {
328
350
  return Math.max(24, O(e, `${t}px sans-serif`)) + 24;
329
351
  }
330
352
  // tools/angular-build/.stage/react/components/ChoiceGroup/logic.ts
331
- function We(e, t) {
353
+ function Ze(e, t) {
332
354
  return e === t.value ? void 0 : t.value;
333
355
  }
334
- function Ge(e, t) {
356
+ function Qe(e, t) {
335
357
  let n = Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
336
358
  return n.includes(t.value) ? n.filter((e) => e !== t.value) : [...n, t.value];
337
359
  }
338
360
  // tools/angular-build/.stage/react/components/Radio/radio.ts
339
- var Ke = l("radio");
340
- function qe(e, t) {
341
- Ve(e, t, "radio");
361
+ var $e = l("radio");
362
+ function et(e, t) {
363
+ Ye(e, t, "radio");
342
364
  }
343
365
  // tools/angular-build/.stage/react/components/Checkbox/checkbox.ts
344
- var Je = l("checkbox");
345
- function Ye(e, t) {
346
- Ve(e, t, "checkbox");
366
+ var tt = l("checkbox");
367
+ function nt(e, t) {
368
+ Ye(e, t, "checkbox");
347
369
  }
348
370
  // tools/angular-build/.stage/react/components/Icon/icon.ts
349
- var Xe = {
371
+ var rt = {
350
372
  home: { paths: ["M3 10 L12 3 L21 10 M5 9 V21 H19 V9 M9 21 V14 H15 V21"] },
351
373
  house: { paths: ["M2 11 L12 2 L22 11 M4 10 V21 H20 V10 M9 21 V14 H15 V21", "M3 11 H6 M18 11 H21"] },
352
374
  building: { paths: ["M4 21 V4 H16 V21 M16 9 H21 V21 M2 21 H22", "M7 7 H9 M12 7 H14 M7 11 H9 M12 11 H14 M7 15 H9 M12 15 H14 M18 12 H19 M18 16 H19"] },
@@ -757,21 +779,21 @@ var Xe = {
757
779
  code: { paths: ["M8 5 L2 12 L8 19 M16 5 L22 12 L16 19 M14 3 L10 21"] },
758
780
  database: { paths: ["M3 5 C3 1 21 1 21 5 V19 C21 23 3 23 3 19 Z M3 5 C3 9 21 9 21 5 M3 12 C3 16 21 16 21 12"] },
759
781
  cloudDownload: { paths: ["M7 15 H17 A4 4 0 0 0 17 7 A7 7 0 0 0 4 8 A3.5 3.5 0 0 0 7 15 Z M12 12 V21 M8 17 L12 21 L16 17"] }
760
- }, Ze = l("icon");
761
- function Qe(e, t) {
782
+ }, it = l("icon");
783
+ function at(e, t) {
762
784
  let n = t.name;
763
- if (typeof n != "string" || !Object.prototype.hasOwnProperty.call(Xe, n)) throw Error(`Unknown Canvas UI icon: ${String(n)}.`);
764
- let r = Xe[n], i = p(t.size, 24);
785
+ if (typeof n != "string" || !Object.prototype.hasOwnProperty.call(rt, n)) throw Error(`Unknown Canvas UI icon: ${String(n)}.`);
786
+ let r = rt[n], i = y(t.size, 24);
765
787
  if (i <= 0) throw RangeError("Icon size must be greater than zero.");
766
788
  if (t.variant !== void 0 && t.variant !== "outline" && t.variant !== "solid") throw TypeError(`Unknown Canvas UI icon variant: ${String(t.variant)}.`);
767
- let a = t.variant === "solid" ? "solid" : "outline", o = p(t.strokeWidth, 2);
789
+ let a = t.variant === "solid" ? "solid" : "outline", o = y(t.strokeWidth, 2);
768
790
  if (o <= 0) throw RangeError("Icon strokeWidth must be greater than zero.");
769
- e.save(), e.translate(i / 2, i / 2), e.scale(i / 24, i / 24), e.translate(-12, -12), e.strokeStyle = m(t.color, j(e, "--canvas-ui-icon-color", "#333")), e.fillStyle = e.strokeStyle, e.lineWidth = (a === "solid" ? Math.max(o, 4) : o) * 24 / i, e.lineCap = "round", e.lineJoin = "round";
770
- for (let t = 0; t < r.paths.length; t++) e.beginPath(), $e(e, r.paths[t]), a === "solid" && r.filled?.includes(t) && e.fill(), e.stroke();
791
+ e.save(), e.translate(i / 2, i / 2), e.scale(i / 24, i / 24), e.translate(-12, -12), e.strokeStyle = b(t.color, k(e, "--canvas-ui-icon-color", "#333")), e.fillStyle = e.strokeStyle, e.lineWidth = (a === "solid" ? Math.max(o, 4) : o) * 24 / i, e.lineCap = "round", e.lineJoin = "round";
792
+ for (let t = 0; t < r.paths.length; t++) e.beginPath(), ot(e, r.paths[t]), a === "solid" && r.filled?.includes(t) && e.fill(), e.stroke();
771
793
  for (let [t, n, i] of r.circles ?? []) e.beginPath(), e.arc(t, n, i, 0, Math.PI * 2), a === "solid" ? e.fill() : e.stroke();
772
794
  e.restore();
773
795
  }
774
- function $e(e, t) {
796
+ function ot(e, t) {
775
797
  let n = t.match(/[A-Z]|-?(?:\d+\.?\d*|\.\d+)/g) ?? [], r = 0, i = 0, a = 0, o = 0;
776
798
  for (let t = 0; t < n.length;) {
777
799
  let s = n[t++], c = () => Number(n[t++]);
@@ -800,7 +822,7 @@ function $e(e, t) {
800
822
  }
801
823
  case "A": {
802
824
  let t = c(), n = c(), a = c(), o = c() !== 0, s = c() !== 0, l = c(), u = c();
803
- et(e, r, i, t, n, a, o, s, l, u), r = l, i = u;
825
+ st(e, r, i, t, n, a, o, s, l, u), r = l, i = u;
804
826
  break;
805
827
  }
806
828
  case "Z":
@@ -810,7 +832,7 @@ function $e(e, t) {
810
832
  }
811
833
  }
812
834
  }
813
- function et(e, t, n, r, i, a, o, s, c, l) {
835
+ function st(e, t, n, r, i, a, o, s, c, l) {
814
836
  let u = Math.abs(r), d = Math.abs(i);
815
837
  if (u === 0 || d === 0 || t === c && n === l) {
816
838
  e.lineTo(c, l);
@@ -821,51 +843,60 @@ function et(e, t, n, r, i, a, o, s, c, l) {
821
843
  let e = Math.sqrt(y);
822
844
  u *= e, d *= e;
823
845
  }
824
- let b = Math.max(0, u ** 2 * d ** 2 - u ** 2 * v ** 2 - d ** 2 * _ ** 2), x = u ** 2 * v ** 2 + d ** 2 * _ ** 2, S = x === 0 ? 0 : (o === s ? -1 : 1) * Math.sqrt(b / x), C = S * u * v / d, w = S * -d * _ / u, T = p * C - m * w + (t + c) / 2, ee = m * C + p * w + (n + l) / 2, E = (_ - C) / u, D = (v - w) / d, te = (-_ - C) / u, O = (-v - w) / d, ne = Math.atan2(D, E), re = E * O - D * te, k = E * te + D * O, A = Math.atan2(re, k);
825
- s && A < 0 && (A += Math.PI * 2), !s && A > 0 && (A -= Math.PI * 2), e.ellipse(T, ee, u, d, f, ne, ne + A, !s);
846
+ let b = Math.max(0, u ** 2 * d ** 2 - u ** 2 * v ** 2 - d ** 2 * _ ** 2), x = u ** 2 * v ** 2 + d ** 2 * _ ** 2, S = x === 0 ? 0 : (o === s ? -1 : 1) * Math.sqrt(b / x), C = S * u * v / d, w = S * -d * _ / u, T = p * C - m * w + (t + c) / 2, ee = m * C + p * w + (n + l) / 2, te = (_ - C) / u, ne = (v - w) / d, re = (-_ - C) / u, ie = (-v - w) / d, E = Math.atan2(ne, te), ae = te * ie - ne * re, oe = te * re + ne * ie, D = Math.atan2(ae, oe);
847
+ s && D < 0 && (D += Math.PI * 2), !s && D > 0 && (D -= Math.PI * 2), e.ellipse(T, ee, u, d, f, E, E + D, !s);
826
848
  }
827
- // tools/angular-build/.stage/react/components/Upload/upload.ts
828
- var tt = l("upload");
829
- function nt(e, t) {
830
- let n = p(t.width, 120), r = p(t.height, 40), i = p(t.borderRadius, 6);
831
- e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = m(t.backgroundColor, j(e, "--canvas-ui-button-background", "#1677ff")), e.fill(), t.borderColor && (e.strokeStyle = m(t.borderColor, "#1677ff"), e.stroke());
832
- let a = m(t.text, "Choose File"), o = m(t.textColor, j(e, "--canvas-ui-button-color", "#fff")), s = p(t.fontSize, 15), c = p(t.iconSize, Math.round(s * 1.1));
849
+ function ct(e) {
850
+ let t = Array.isArray(e.value) ? e.value : [];
851
+ return y(e.height, 40) + t.length * 28;
852
+ }
853
+ var lt = l("upload");
854
+ function ut(e, t) {
855
+ let n = y(t.width, 120), r = y(t.height, 40), i = y(t.borderRadius, 6);
856
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = b(t.backgroundColor, k(e, "--canvas-ui-button-background", "#1677ff")), e.fill(), t.borderColor && (e.strokeStyle = b(t.borderColor, "#1677ff"), e.stroke());
857
+ let a = t._uploadError ? "Invalid file" : b(t.text, "Choose File"), o = b(t.textColor, k(e, "--canvas-ui-button-color", "#fff")), s = y(t.fontSize, 15), c = y(t.iconSize, Math.round(s * 1.1));
833
858
  e.font = `${s}px sans-serif`, e.textBaseline = "middle", e.textAlign = "left";
834
- let l = T(e, a, Math.max(0, n - 12 - c - 6)), u = l ? e.measureText(l).width : 0, d = (n - (c + (l ? 6 : 0) + u)) / 2, f = r / 2;
835
- e.save(), e.translate(d, f - c / 2), Qe(e, {
859
+ let l = E(e, a, Math.max(0, n - 12 - c - 6)), u = l ? e.measureText(l).width : 0, d = (n - (c + (l ? 6 : 0) + u)) / 2, f = r / 2;
860
+ e.save(), e.translate(d, f - c / 2), at(e, {
836
861
  name: t.icon ?? "upload",
837
862
  size: c,
838
863
  color: o
839
864
  }), e.restore(), d += c + (l ? 6 : 0), e.fillStyle = o, e.fillText(l, d, f);
865
+ let p = t.value ?? [];
866
+ e.font = "13px sans-serif", e.textAlign = "left";
867
+ for (let [t, i] of p.entries()) {
868
+ let a = r + t * 28;
869
+ e.fillStyle = k(e, "--canvas-ui-input-color", "#333"), e.fillText(E(e, i.name, Math.max(0, n - 32)), 4, a + 14), e.textAlign = "center", e.fillText("×", n - 12, a + 14), e.textAlign = "left";
870
+ }
840
871
  }
841
872
  // tools/angular-build/.stage/react/components/Carousel/carousel.ts
842
- var rt = l("carousel"), it = l("carouselItem");
843
- function at(e, t) {
844
- let n = p(t.width, 300), r = p(t.height, 180);
845
- e.fillStyle = m(t.backgroundColor, "transparent"), e.fillRect(0, 0, n, r);
873
+ var dt = l("carousel"), ft = l("carouselItem");
874
+ function pt(e, t) {
875
+ let n = y(t.width, 300), r = y(t.height, 180);
876
+ e.fillStyle = b(t.backgroundColor, "transparent"), e.fillRect(0, 0, n, r);
846
877
  }
847
- function ot(e, t) {
848
- let n = p(t.width, 300), r = p(t.height, 180), i = p(t._itemCount, 0);
878
+ function mt(e, t) {
879
+ let n = y(t.width, 300), r = y(t.height, 180), i = y(t._itemCount, 0);
849
880
  if (!(i < 2)) {
850
881
  if (t.showArrows !== !1) {
851
- let i = m(t.arrowColor, j(e, "--canvas-ui-carousel-arrow", "#fff")), a = r / 2;
852
- st(e, 22, a, -1, i), st(e, n - 22, a, 1, i);
882
+ let i = b(t.arrowColor, k(e, "--canvas-ui-carousel-arrow", "#fff")), a = r / 2;
883
+ ht(e, 22, a, -1, i), ht(e, n - 22, a, 1, i);
853
884
  }
854
885
  if (t.showDots !== !1) {
855
- let a = m(t.dotColor, j(e, "--canvas-ui-carousel-dot", "rgba(255,255,255,0.65)")), o = m(t.activeDotColor, j(e, "--canvas-ui-carousel-active-dot", "#1677ff")), s = (n - (i - 1) * 14) / 2, c = r - 14;
886
+ let a = b(t.dotColor, k(e, "--canvas-ui-carousel-dot", "rgba(255,255,255,0.65)")), o = b(t.activeDotColor, k(e, "--canvas-ui-carousel-active-dot", "#1677ff")), s = (n - (i - 1) * 14) / 2, c = r - 14;
856
887
  e.beginPath();
857
888
  for (let t = 0; t < i; t++) e.moveTo(s + t * 14 + 4, c), e.arc(s + t * 14, c, 4, 0, Math.PI * 2);
858
889
  e.fillStyle = a, e.fill();
859
- let l = Math.max(0, Math.min(i - 1, p(t._activeIndex, 0)));
890
+ let l = Math.max(0, Math.min(i - 1, y(t._activeIndex, 0)));
860
891
  e.beginPath(), e.arc(s + l * 14, c, 4, 0, Math.PI * 2), e.fillStyle = o, e.fill();
861
892
  }
862
893
  }
863
894
  }
864
- function st(e, t, n, r, i) {
895
+ function ht(e, t, n, r, i) {
865
896
  e.fillStyle = "rgba(0, 0, 0, 0.3)", e.beginPath(), e.arc(t, n, 16, 0, Math.PI * 2), e.fill(), e.strokeStyle = i, e.lineWidth = 2, e.beginPath(), e.moveTo(t - r * 3, n - 6), e.lineTo(t + r * 3, n), e.lineTo(t - r * 3, n + 6), e.stroke();
866
897
  }
867
898
  // tools/angular-build/.stage/react/components/Carousel/logic.ts
868
- function ct(e, t, n, r, i, a, o) {
899
+ function gt(e, t, n, r, i, a, o) {
869
900
  if (!(r < 2 || t < 0 || t > a || n < 0 || n > o)) {
870
901
  if (e.showArrows !== !1 && Math.abs(n - o / 2) <= 20) {
871
902
  if (t <= 42) return i - 1;
@@ -877,104 +908,104 @@ function ct(e, t, n, r, i, a, o) {
877
908
  }
878
909
  }
879
910
  }
880
- function lt(e, t, n, r) {
911
+ function _t(e, t, n, r) {
881
912
  return n <= 0 ? 0 : r ? (e % n + n) % n : Math.max(0, Math.min(n - 1, e));
882
913
  }
883
914
  // tools/angular-build/.stage/react/components/Button/button.ts
884
- var ut = l("button");
885
- function dt(e, t) {
886
- let n = p(t.width, 120), r = p(t.height, 40), i = p(t.borderRadius, 6);
887
- e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = t.pressed ? j(e, "--canvas-ui-button-pressed-background", "#0958d9") : m(t.backgroundColor, j(e, "--canvas-ui-button-background", "#1677ff")), e.fill(), t.borderColor && (e.strokeStyle = m(t.borderColor, j(e, "--canvas-ui-button-border", "#1677ff")), e.stroke()), e.font = `${p(t.fontSize, 15)}px sans-serif`, e.textBaseline = "middle", e.textAlign = "center", e.fillStyle = m(t.fontColor, j(e, "--canvas-ui-button-color", "#fff")), e.fillText(T(e, String(t.text ?? ""), Math.max(0, n - 16)), n / 2, r / 2), e.textAlign = "left";
915
+ var vt = l("button");
916
+ function yt(e, t) {
917
+ let n = y(t.width, 120), r = y(t.height, 40), i = y(t.borderRadius, 6);
918
+ e.beginPath(), e.roundRect(0, 0, n, r, i), e.fillStyle = t.pressed ? k(e, "--canvas-ui-button-pressed-background", "#0958d9") : b(t.backgroundColor, k(e, "--canvas-ui-button-background", "#1677ff")), e.fill(), t.borderColor && (e.strokeStyle = b(t.borderColor, k(e, "--canvas-ui-button-border", "#1677ff")), e.stroke()), e.font = `${y(t.fontSize, 15)}px sans-serif`, e.textBaseline = "middle", e.textAlign = "center", e.fillStyle = b(t.fontColor, k(e, "--canvas-ui-button-color", "#fff")), e.fillText(E(e, String(t.text ?? ""), Math.max(0, n - 16)), n / 2, r / 2), e.textAlign = "left";
888
919
  }
889
920
  // tools/angular-build/.stage/react/components/Button/logic.ts
890
- function ft(e, t) {
921
+ function bt(e, t) {
891
922
  e.setProps({ pressed: t });
892
923
  }
893
- function pt(e) {
924
+ function xt(e) {
894
925
  if (e.props.disabled === !0) return;
895
926
  let t = e.props.onClick;
896
927
  typeof t == "function" && t();
897
928
  }
898
929
  // tools/angular-build/.stage/react/image-assets.ts
899
- var mt = /* @__PURE__ */ new Map();
900
- function ht(e) {
901
- let t = mt.get(e);
930
+ var St = /* @__PURE__ */ new Map();
931
+ function Ct(e) {
932
+ let t = St.get(e);
902
933
  if (t) return t;
903
934
  let n = new Image(), r = {
904
935
  image: n,
905
936
  error: null,
906
937
  listeners: /* @__PURE__ */ new Set()
907
938
  };
908
- return mt.set(e, r), n.onload = () => r.listeners.forEach((e) => e(null)), n.onerror = () => {
939
+ return St.set(e, r), n.onload = () => r.listeners.forEach((e) => e(null)), n.onerror = () => {
909
940
  r.error = /* @__PURE__ */ Error(`Canvas image failed to load: ${e}`), r.listeners.forEach((e) => e(r.error));
910
941
  }, n.src = e, r;
911
942
  }
912
- function gt(e) {
913
- let t = ht(e);
943
+ function wt(e) {
944
+ let t = Ct(e);
914
945
  return t.image.complete && t.image.naturalWidth > 0 ? t.image : null;
915
946
  }
916
- function _t(e, t) {
917
- let n = ht(e);
947
+ function Tt(e, t) {
948
+ let n = Ct(e);
918
949
  return n.listeners.add(t), n.image.complete && t(n.error), () => n.listeners.delete(t);
919
950
  }
920
951
  // tools/angular-build/.stage/react/components/Image/image.ts
921
- var vt = l("image");
922
- function yt(e, t) {
952
+ var Et = l("image");
953
+ function Dt(e, t) {
923
954
  let n = t.src;
924
955
  if (typeof n != "string" || !n) return;
925
- let r = gt(n);
956
+ let r = wt(n);
926
957
  if (!r) return;
927
- let i = p(t.width, r.naturalWidth), a = p(t.height, r.naturalHeight);
928
- e.save(), re(e, r, r.naturalWidth, r.naturalHeight, i, a, t.objectFit ?? "contain"), e.restore();
958
+ let i = y(t.width, r.naturalWidth), a = y(t.height, r.naturalHeight);
959
+ e.save(), le(e, r, r.naturalWidth, r.naturalHeight, i, a, t.objectFit ?? "contain"), e.restore();
929
960
  }
930
961
  // tools/angular-build/.stage/react/components/Dialog/dialog.ts
931
- var bt = l("dialog");
932
- function xt(e, t) {
933
- let n = p(t._viewportWidth, e.canvas.width), r = p(t._viewportHeight, e.canvas.height), i = p(t.width, 420), a = p(t.height, 240), o = (n - i) / 2, s = (r - a) / 2;
934
- e.fillStyle = j(e, "--canvas-ui-dialog-mask", "rgba(0, 0, 0, 0.45)"), e.fillRect(0, 0, n, r), e.fillStyle = j(e, "--canvas-ui-dialog-background", "#fff"), e.beginPath(), e.roundRect(o, s, i, a, 8), e.fill(), e.fillStyle = j(e, "--canvas-ui-dialog-title-color", "#1f1f1f"), e.font = "600 16px sans-serif", e.textBaseline = "middle", e.fillText(T(e, String(t.title ?? "Confirm"), Math.max(0, i - 48)), o + 24, s + 28), e.strokeStyle = j(e, "--canvas-ui-dialog-border", "#f0f0f0"), e.beginPath(), e.moveTo(o, s + 56), e.lineTo(o + i, s + 56), e.moveTo(o, s + a - 56), e.lineTo(o + i, s + a - 56), e.stroke(), St(e, o + i - 196, s + a - 44, 80, 32, String(t.cancelText ?? "Cancel"), !1), St(e, o + i - 104, s + a - 44, 80, 32, String(t.confirmText ?? "OK"), !0);
962
+ var Ot = l("dialog");
963
+ function kt(e, t) {
964
+ let n = y(t._viewportWidth, e.canvas.width), r = y(t._viewportHeight, e.canvas.height), i = y(t.width, 420), a = y(t.height, 240), o = (n - i) / 2, s = (r - a) / 2;
965
+ e.fillStyle = k(e, "--canvas-ui-dialog-mask", "rgba(0, 0, 0, 0.45)"), e.fillRect(0, 0, n, r), e.fillStyle = k(e, "--canvas-ui-dialog-background", "#fff"), e.beginPath(), e.roundRect(o, s, i, a, 8), e.fill(), e.fillStyle = k(e, "--canvas-ui-dialog-title-color", "#1f1f1f"), e.font = "600 16px sans-serif", e.textBaseline = "middle", e.fillText(E(e, String(t.title ?? "Confirm"), Math.max(0, i - 48)), o + 24, s + 28), e.strokeStyle = k(e, "--canvas-ui-dialog-border", "#f0f0f0"), e.beginPath(), e.moveTo(o, s + 56), e.lineTo(o + i, s + 56), e.moveTo(o, s + a - 56), e.lineTo(o + i, s + a - 56), e.stroke(), At(e, o + i - 196, s + a - 44, 80, 32, String(t.cancelText ?? "Cancel"), !1), At(e, o + i - 104, s + a - 44, 80, 32, String(t.confirmText ?? "OK"), !0);
935
966
  }
936
- function St(e, t, n, r, i, a, o) {
937
- e.beginPath(), e.roundRect(t, n, r, i, 6), e.fillStyle = o ? j(e, "--canvas-ui-dialog-confirm-background", "#1677ff") : j(e, "--canvas-ui-dialog-cancel-background", "#fff"), e.fill(), e.strokeStyle = o ? j(e, "--canvas-ui-dialog-confirm-background", "#1677ff") : j(e, "--canvas-ui-dialog-border", "#d9d9d9"), e.stroke(), e.fillStyle = o ? j(e, "--canvas-ui-dialog-confirm-color", "#fff") : j(e, "--canvas-ui-dialog-cancel-color", "#333"), e.font = "14px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText(T(e, a, Math.max(0, r - 16)), t + r / 2, n + i / 2), e.textAlign = "left";
967
+ function At(e, t, n, r, i, a, o) {
968
+ e.beginPath(), e.roundRect(t, n, r, i, 6), e.fillStyle = o ? k(e, "--canvas-ui-dialog-confirm-background", "#1677ff") : k(e, "--canvas-ui-dialog-cancel-background", "#fff"), e.fill(), e.strokeStyle = o ? k(e, "--canvas-ui-dialog-confirm-background", "#1677ff") : k(e, "--canvas-ui-dialog-border", "#d9d9d9"), e.stroke(), e.fillStyle = o ? k(e, "--canvas-ui-dialog-confirm-color", "#fff") : k(e, "--canvas-ui-dialog-cancel-color", "#333"), e.font = "14px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText(E(e, a, Math.max(0, r - 16)), t + r / 2, n + i / 2), e.textAlign = "left";
938
969
  }
939
970
  // tools/angular-build/.stage/react/components/Progress/progress.ts
940
- var Ct = l("progress");
941
- function wt(e, t) {
942
- let n = p(t.width, 200), r = p(t.height, 12), i = p(t.min, 0), a = p(t.max, 100), o = Math.max(i, Math.min(a, p(t.value, i))), s = a > i ? (o - i) / (a - i) : 0, c = Math.max(0, Math.min(p(t.borderRadius, r / 2), r / 2, n / 2));
943
- e.beginPath(), e.roundRect(0, 0, n, r, c), e.fillStyle = m(t.trackColor, j(e, "--canvas-ui-progress-track", "#f0f0f0")), e.fill(), s > 0 && (e.save(), e.beginPath(), e.roundRect(0, 0, n, r, c), e.clip(), e.fillStyle = m(t.color, j(e, "--canvas-ui-progress-active", "#1677ff")), e.fillRect(0, 0, n * s, r), e.restore()), t.showText && (e.font = `${Math.max(10, r)}px sans-serif`, e.textBaseline = "middle", e.fillStyle = m(t.textColor, j(e, "--canvas-ui-progress-text", "#333")), e.fillText(`${Math.round(s * 100)}%`, n + 8, r / 2));
971
+ var jt = l("progress");
972
+ function Mt(e, t) {
973
+ let n = y(t.width, 200), r = y(t.height, 12), i = y(t.min, 0), a = y(t.max, 100), o = Math.max(i, Math.min(a, y(t.value, i))), s = a > i ? (o - i) / (a - i) : 0, c = Math.max(0, Math.min(y(t.borderRadius, r / 2), r / 2, n / 2));
974
+ e.beginPath(), e.roundRect(0, 0, n, r, c), e.fillStyle = b(t.trackColor, k(e, "--canvas-ui-progress-track", "#f0f0f0")), e.fill(), s > 0 && (e.save(), e.beginPath(), e.roundRect(0, 0, n, r, c), e.clip(), e.fillStyle = b(t.color, k(e, "--canvas-ui-progress-active", "#1677ff")), e.fillRect(0, 0, n * s, r), e.restore()), t.showText && (e.font = `${Math.max(10, r)}px sans-serif`, e.textBaseline = "middle", e.fillStyle = b(t.textColor, k(e, "--canvas-ui-progress-text", "#333")), e.fillText(`${Math.round(s * 100)}%`, n + 8, r / 2));
944
975
  }
945
976
  // tools/angular-build/.stage/react/components/Tabs/tabs.ts
946
- var Tt = l("tabs"), Et = l("tabItem");
947
- function Dt(e, t) {
948
- let n = p(t.width, 300), r = p(t.headerHeight, 40), i = t._tabItems ?? [];
977
+ var Nt = l("tabs"), Pt = l("tabItem");
978
+ function Ft(e, t) {
979
+ let n = y(t.width, 300), r = y(t.headerHeight, 40), i = t._tabItems ?? [];
949
980
  if (!i.length) return;
950
981
  let a = n / i.length;
951
- e.fillStyle = m(t.backgroundColor, j(e, "--canvas-ui-tabs-background", "#fff")), e.fillRect(0, 0, n, r), e.font = "14px sans-serif", e.textAlign = "center", e.textBaseline = "middle", i.forEach((n, i) => {
952
- e.fillStyle = n.disabled ? j(e, "--canvas-ui-tabs-disabled-color", "#bfbfbf") : n.selected ? m(t.activeColor, j(e, "--canvas-ui-tabs-active-color", "#1677ff")) : m(t.textColor, j(e, "--canvas-ui-tabs-color", "#595959")), e.fillText(T(e, n.title, Math.max(0, a - 16)), a * (i + .5), r / 2), n.selected && (e.fillStyle = m(t.indicatorColor, j(e, "--canvas-ui-tabs-indicator", "#1677ff")), e.fillRect(a * i, r - 2, a, 2));
982
+ e.fillStyle = b(t.backgroundColor, k(e, "--canvas-ui-tabs-background", "#fff")), e.fillRect(0, 0, n, r), e.font = "14px sans-serif", e.textAlign = "center", e.textBaseline = "middle", i.forEach((n, i) => {
983
+ e.fillStyle = n.disabled ? k(e, "--canvas-ui-tabs-disabled-color", "#bfbfbf") : n.selected ? b(t.activeColor, k(e, "--canvas-ui-tabs-active-color", "#1677ff")) : b(t.textColor, k(e, "--canvas-ui-tabs-color", "#595959")), e.fillText(E(e, n.title, Math.max(0, a - 16)), a * (i + .5), r / 2), n.selected && (e.fillStyle = b(t.indicatorColor, k(e, "--canvas-ui-tabs-indicator", "#1677ff")), e.fillRect(a * i, r - 2, a, 2));
953
984
  }), e.textAlign = "left";
954
985
  }
955
986
  // tools/angular-build/.stage/react/components/Tabs/logic.ts
956
- function Ot(e, t, n, r, i) {
987
+ function It(e, t, n, r, i) {
957
988
  if (n >= i || e.length === 0) return;
958
989
  let a = e[Math.floor(t / (r / e.length))];
959
990
  if (a && !a.props.disabled && typeof a.props.id == "string") return a.props.id;
960
991
  }
961
992
  // tools/angular-build/.stage/react/components/Collapse/collapse.ts
962
- var kt = l("collapse"), At = l("collapseItem");
963
- function jt(e, t) {
964
- let n = p(t._collapseWidth, 300), r = p(t._collapseHeaderHeight, 40);
965
- e.fillStyle = m(t.backgroundColor, j(e, "--canvas-ui-collapse-header-background", "#fafafa")), e.fillRect(0, 0, n, r), e.strokeStyle = m(t.borderColor, j(e, "--canvas-ui-collapse-border", "#d9d9d9")), e.strokeRect(0, 0, n, r), e.font = "14px sans-serif", e.textBaseline = "middle", e.fillStyle = t.disabled ? j(e, "--canvas-ui-collapse-disabled-color", "#bfbfbf") : m(t.textColor, j(e, "--canvas-ui-collapse-color", "#262626")), e.fillText(T(e, `${t._expanded ? "−" : "+"} ${String(t.title ?? "")}`, Math.max(0, n - 24)), 12, r / 2);
993
+ var Lt = l("collapse"), Rt = l("collapseItem");
994
+ function zt(e, t) {
995
+ let n = y(t._collapseWidth, 300), r = y(t._collapseHeaderHeight, 40);
996
+ e.fillStyle = b(t.backgroundColor, k(e, "--canvas-ui-collapse-header-background", "#fafafa")), e.fillRect(0, 0, n, r), e.strokeStyle = b(t.borderColor, k(e, "--canvas-ui-collapse-border", "#d9d9d9")), e.strokeRect(0, 0, n, r), e.font = "14px sans-serif", e.textBaseline = "middle", e.fillStyle = t.disabled ? k(e, "--canvas-ui-collapse-disabled-color", "#bfbfbf") : b(t.textColor, k(e, "--canvas-ui-collapse-color", "#262626")), e.fillText(E(e, `${t._expanded ? "−" : "+"} ${String(t.title ?? "")}`, Math.max(0, n - 24)), 12, r / 2);
966
997
  }
967
998
  // tools/angular-build/.stage/react/components/Collapse/logic.ts
968
- function Mt(e, t, n) {
999
+ function Bt(e, t, n) {
969
1000
  let r = new Set(e);
970
1001
  return r.has(t) ? r.delete(t) : (n && r.clear(), r.add(t)), [...r];
971
1002
  }
972
1003
  // tools/angular-build/.stage/react/components/CustomDraw/customDraw.ts
973
- var Nt = l("customDraw");
974
- function Pt(e, t) {
1004
+ var Vt = l("customDraw");
1005
+ function Ht(e, t) {
975
1006
  let n = t.draw;
976
1007
  if (typeof n != "function") throw TypeError("<CustomDraw> requires a draw(context, size) function.");
977
- let r = Ft(t.width, "width"), i = Ft(t.height, "height");
1008
+ let r = Ut(t.width, "width"), i = Ut(t.height, "height");
978
1009
  e.save();
979
1010
  try {
980
1011
  n(e, {
@@ -985,17 +1016,17 @@ function Pt(e, t) {
985
1016
  e.restore();
986
1017
  }
987
1018
  }
988
- function Ft(e, t) {
1019
+ function Ut(e, t) {
989
1020
  if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw RangeError(`<CustomDraw> ${t} must be a non-negative finite number.`);
990
1021
  return e;
991
1022
  }
992
1023
  // tools/angular-build/.stage/react/components/CanvasView/canvasView.ts
993
- var It = l("canvasView");
994
- function Lt(e, t) {
1024
+ var Wt = l("canvasView");
1025
+ function Gt(e, t) {
995
1026
  let n = t.source;
996
- if (!zt(n)) throw TypeError("<CanvasView> requires an HTMLCanvasElement source.");
1027
+ if (!qt(n)) throw TypeError("<CanvasView> requires an HTMLCanvasElement source.");
997
1028
  if (n === e.canvas) throw TypeError("<CanvasView> cannot draw the destination Canvas into itself.");
998
- let r = Rt(t.width, "width"), i = Rt(t.height, "height");
1029
+ let r = Kt(t.width, "width"), i = Kt(t.height, "height");
999
1030
  if (!n.width || !n.height || !r || !i) return;
1000
1031
  let a = {
1001
1032
  width: r,
@@ -1014,69 +1045,160 @@ function Lt(e, t) {
1014
1045
  e.restore();
1015
1046
  }
1016
1047
  }
1017
- function Rt(e, t) {
1048
+ function Kt(e, t) {
1018
1049
  if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw RangeError(`<CanvasView> ${t} must be a non-negative finite number.`);
1019
1050
  return e;
1020
1051
  }
1021
- function zt(e) {
1052
+ function qt(e) {
1022
1053
  return typeof e == "object" && !!e && "nodeName" in e && e.nodeName === "CANVAS" && "width" in e && typeof e.width == "number" && "height" in e && typeof e.height == "number" && "getContext" in e && typeof e.getContext == "function";
1023
1054
  }
1024
1055
  // tools/angular-build/.stage/react/video-assets.ts
1025
- var F = /* @__PURE__ */ new Map();
1026
- function Bt(e) {
1027
- let t = F.get(e);
1056
+ var Jt = /* @__PURE__ */ new Map();
1057
+ function Yt(e, t) {
1058
+ e.preload = "auto", e.playsInline = !0, e.crossOrigin = "anonymous";
1059
+ let n = !0, r = () => {
1060
+ n = !1, t.onReady();
1061
+ }, i = () => {
1062
+ n ? (n = !1, e.removeAttribute("crossorigin"), e.load()) : t.onFail(/* @__PURE__ */ Error(`Canvas video failed to load: ${e.src}`));
1063
+ }, a = () => {
1064
+ t.onTime(e.currentTime, e.duration);
1065
+ }, o = () => t.onSeeked?.();
1066
+ return e.addEventListener("loadeddata", r), e.addEventListener("error", i), e.addEventListener("timeupdate", a), e.addEventListener("seeked", o), e.addEventListener("canplay", o), () => {
1067
+ e.removeEventListener("loadeddata", r), e.removeEventListener("error", i), e.removeEventListener("timeupdate", a), e.removeEventListener("seeked", o), e.removeEventListener("canplay", o);
1068
+ };
1069
+ }
1070
+ function Xt(e) {
1071
+ let t = Jt.get(e);
1028
1072
  if (t) return t.refs += 1, t;
1029
- let n = document.createElement("video");
1030
- n.preload = "auto", n.playsInline = !0, n.crossOrigin = "anonymous";
1031
- let r = {
1073
+ let n = document.createElement("video"), r = {
1032
1074
  video: n,
1033
1075
  error: null,
1034
1076
  refs: 1,
1035
1077
  loadListeners: /* @__PURE__ */ new Set(),
1036
1078
  timeListeners: /* @__PURE__ */ new Set()
1037
1079
  };
1038
- F.set(e, r);
1039
- let i = !0;
1040
- return n.addEventListener("loadeddata", () => {
1041
- i = !1, r.error = null, r.loadListeners.forEach((e) => e(null));
1042
- }), n.addEventListener("error", () => {
1043
- i ? (i = !1, n.removeAttribute("crossorigin"), n.load()) : (r.error = /* @__PURE__ */ Error(`Canvas video failed to load: ${e}`), r.loadListeners.forEach((e) => e(r.error)));
1044
- }), n.addEventListener("timeupdate", () => {
1045
- r.timeListeners.forEach((e) => e(n.currentTime, n.duration));
1046
- }), n.src = e, r;
1047
- }
1048
- function Vt(e) {
1049
- return Bt(e).video;
1050
- }
1051
- function Ht(e) {
1052
- return F.get(e)?.video ?? null;
1053
- }
1054
- function Ut(e, t, n) {
1055
- let r = Bt(e);
1056
- return r.loadListeners.add(t), r.timeListeners.add(n), r.video.readyState >= 2 && t(r.error), () => {
1057
- r.loadListeners.delete(t), r.timeListeners.delete(n);
1080
+ return Yt(n, {
1081
+ onReady: () => {
1082
+ r.error = null, r.loadListeners.forEach((e) => e(null));
1083
+ },
1084
+ onFail: (e) => {
1085
+ r.error = e, r.loadListeners.forEach((t) => t(e));
1086
+ },
1087
+ onTime: (e, t) => {
1088
+ r.timeListeners.forEach((n) => n(e, t));
1089
+ }
1090
+ }), Jt.set(e, r), n.src = e, r;
1091
+ }
1092
+ function Zt(e) {
1093
+ return Xt(e).video;
1094
+ }
1095
+ function Qt(e) {
1096
+ return Jt.get(e)?.video ?? null;
1097
+ }
1098
+ function $t(e, t, n, r) {
1099
+ let i = document.createElement("video"), a = Yt(i, {
1100
+ onReady: () => t(null),
1101
+ onFail: (e) => t(e),
1102
+ onTime: (e, t) => n(e, t),
1103
+ onSeeked: r
1104
+ });
1105
+ i.src = e;
1106
+ let o = {
1107
+ src: e,
1108
+ video: i,
1109
+ frame: void 0,
1110
+ captureFrame: () => {
1111
+ if (i.readyState < 2 || i.seeking || !i.videoWidth || !i.videoHeight) return;
1112
+ let e = o.frame ?? document.createElement("canvas"), t = e.getContext("2d");
1113
+ if (!t) throw Error("Canvas 2D context is not available for video seeking.");
1114
+ e.width !== i.videoWidth && (e.width = i.videoWidth), e.height !== i.videoHeight && (e.height = i.videoHeight), t.drawImage(i, 0, 0), o.frame = e;
1115
+ },
1116
+ dispose: () => {
1117
+ o.fullscreenCleanup?.(), a(), i.pause(), i.removeAttribute("src"), i.load(), o.frame = void 0;
1118
+ }
1058
1119
  };
1120
+ return o;
1121
+ }
1122
+ // tools/angular-build/.stage/react/components/Video/logic.ts
1123
+ var en = "11px sans-serif", tn = 24, nn = 32, P = 24;
1124
+ function F(e) {
1125
+ let t = Math.max(0, Math.floor(y(e, 0))), n = t % 60, r = Math.floor(t / 60) % 60, i = Math.floor(t / 3600), a = (e) => String(e).padStart(2, "0");
1126
+ return i > 0 ? `${i}:${a(r)}:${a(n)}` : `${r}:${a(n)}`;
1127
+ }
1128
+ function rn(e, t, n) {
1129
+ let r = Math.min(Math.max(tn, Math.round(t / 6)), nn, Math.max(0, t)), i = t - r, a = {
1130
+ x: 4,
1131
+ y: i + Math.max(0, (r - P) / 2),
1132
+ width: P,
1133
+ height: Math.min(P, r)
1134
+ }, o = a.x + P + 6, s = {
1135
+ x: Math.max(0, e - 28),
1136
+ y: a.y,
1137
+ width: e >= 56 ? P : 0,
1138
+ height: a.height
1139
+ }, c = Math.max(0, e - 40 - n - o);
1140
+ return {
1141
+ bar: {
1142
+ y: i,
1143
+ height: r
1144
+ },
1145
+ play: a,
1146
+ fullscreen: s,
1147
+ track: {
1148
+ x: o,
1149
+ y: i + r / 2 - 2,
1150
+ width: c,
1151
+ height: 4
1152
+ }
1153
+ };
1154
+ }
1155
+ function an(e, t, n) {
1156
+ return n < e.bar.y || n > e.bar.y + e.bar.height ? null : t >= e.play.x && t <= e.play.x + e.play.width ? "play" : e.fullscreen.width > 0 && t >= e.fullscreen.x && t <= e.fullscreen.x + e.fullscreen.width ? "fullscreen" : e.track.width > 0 && t >= e.track.x - 4 && t <= e.track.x + e.track.width + 4 ? "track" : null;
1157
+ }
1158
+ function on(e, t) {
1159
+ return e.track.width <= 0 ? 0 : Math.max(0, Math.min(1, (t - e.track.x) / e.track.width));
1059
1160
  }
1060
- function Wt(e) {
1061
- let t = F.get(e);
1062
- t && (--t.refs, t.refs > 0 || (F.delete(e), t.video.pause(), t.video.removeAttribute("src"), t.video.load()));
1161
+ function sn(e, t) {
1162
+ e.paused ? e.play().catch(() => void 0) : e.pause(), t?.(e.paused);
1163
+ }
1164
+ function cn(e, t, n, r) {
1165
+ if (!Number.isFinite(e.duration) || e.duration <= 0) return;
1166
+ let i = Math.max(0, Math.min(e.duration, t * e.duration));
1167
+ Math.abs(e.currentTime - i) > 1e-4 && (r?.(), e.currentTime = i), n?.(i);
1063
1168
  }
1064
1169
  // tools/angular-build/.stage/react/components/Video/video.ts
1065
- var Gt = l("video");
1066
- function Kt(e, t) {
1170
+ var ln = l("video");
1171
+ function un(e, t, n) {
1172
+ if (typeof t.muted == "boolean" && (e.muted = t.muted), typeof t.loop == "boolean" && (e.loop = t.loop), typeof t.currentTime == "number" && Number.isFinite(t.currentTime)) {
1173
+ let r = Math.max(0, t.currentTime);
1174
+ Math.abs(e.currentTime - r) > 1e-4 && (n?.(), e.currentTime = r);
1175
+ }
1176
+ t.paused === !1 || t.autoplay && t.paused !== !0 ? e.paused && e.play().catch(() => void 0) : t.paused === !0 && !e.paused && e.pause();
1177
+ }
1178
+ function dn(e, t) {
1067
1179
  let n = t.src;
1068
1180
  if (typeof n != "string" || !n) return;
1069
- let r = Ht(n) ?? Vt(n);
1070
- if (typeof t.muted == "boolean" && (r.muted = t.muted), typeof t.loop == "boolean" && (r.loop = t.loop), typeof t.currentTime == "number" && Number.isFinite(t.currentTime)) {
1071
- let e = Math.max(0, t.currentTime);
1072
- Math.abs(r.currentTime - e) > 1e-4 && (r.currentTime = e);
1073
- }
1074
- if (t.paused === !1 || t.autoplay && t.paused !== !0 ? r.play().catch(() => void 0) : t.paused === !0 && !r.paused && r.pause(), r.readyState < 2 || r.videoWidth === 0) return;
1075
- let i = p(t.width, r.videoWidth), a = p(t.height, r.videoHeight);
1076
- e.save(), re(e, r, r.videoWidth, r.videoHeight, i, a, t.objectFit ?? "contain"), e.restore();
1181
+ let r = t._videoElement ?? Qt(n) ?? Zt(n), i = y(t.width, r.videoWidth), a = y(t.height, r.videoHeight), o = r.readyState >= 2 && !r.seeking && r.videoWidth > 0 ? r : t._videoFrame;
1182
+ o && (e.save(), le(e, o, o === r ? r.videoWidth : o.width, o === r ? r.videoHeight : o.height, i, a, t.objectFit ?? "contain"), e.restore()), t.controls === !0 && (t.controlsOnHover !== !0 || t._videoControlsVisible === !0) && hn(e, t, r, i, a);
1183
+ }
1184
+ var fn = "rgba(0, 0, 0, 0.55)", pn = "#fff", mn = "rgba(255, 255, 255, 0.35)";
1185
+ function hn(e, t, n, r, i) {
1186
+ let a = Number.isFinite(n.duration) && n.duration > 0 ? n.duration : 0, o = typeof t._videoScrubRatio == "number" ? a * Math.min(1, Math.max(0, t._videoScrubRatio)) : a > 0 ? Math.min(Math.max(0, n.currentTime), a) : 0, s = `${F(o)} / ${F(a)}`, c = O(s, en), l = rn(r, i, c);
1187
+ if (r <= 0 || i <= 0 || l.bar.height <= 0) return;
1188
+ let u = b(t.controlsColor, pn), d = l.track.y + l.track.height / 2;
1189
+ if (e.fillStyle = b(t.controlsBarColor, fn), e.fillRect(0, l.bar.y, r, l.bar.height), _n(e, u, l.play.x + l.play.width / 2, d, n.paused || n.ended), l.fullscreen.width > 0 && gn(e, u, l.fullscreen.x + l.fullscreen.width / 2, d), l.track.width <= 0) return;
1190
+ e.fillStyle = b(t.controlsTrackColor, mn), e.beginPath(), e.roundRect(l.track.x, l.track.y, l.track.width, l.track.height, 2), e.fill();
1191
+ let f = a > 0 ? o / a : 0;
1192
+ f > 0 && (e.fillStyle = u, e.beginPath(), e.roundRect(l.track.x, l.track.y, l.track.width * f, l.track.height, 2), e.fill()), e.beginPath(), e.arc(l.track.x + l.track.width * f, d, 4, 0, Math.PI * 2), e.fillStyle = u, e.fill(), e.font = en, e.textBaseline = "middle", e.textAlign = "left", e.fillText(s, r - 36 - c, d);
1193
+ }
1194
+ function gn(e, t, n, r) {
1195
+ e.strokeStyle = t, e.lineWidth = 1.5, e.beginPath(), e.moveTo(n - 6, r - 2), e.lineTo(n - 6, r - 6), e.lineTo(n - 2, r - 6), e.moveTo(n + 2, r - 6), e.lineTo(n + 6, r - 6), e.lineTo(n + 6, r - 2), e.moveTo(n + 6, r + 2), e.lineTo(n + 6, r + 6), e.lineTo(n + 2, r + 6), e.moveTo(n - 2, r + 6), e.lineTo(n - 6, r + 6), e.lineTo(n - 6, r + 2), e.stroke();
1196
+ }
1197
+ function _n(e, t, n, r, i) {
1198
+ e.fillStyle = t, e.beginPath(), i ? (e.moveTo(n - 4, r - 6), e.lineTo(n - 4, r + 6), e.lineTo(n + 6, r)) : (e.moveTo(n - 5, r - 6), e.lineTo(n - 5, r + 6), e.lineTo(n - 1, r + 6), e.lineTo(n - 1, r - 6), e.moveTo(n + 1, r - 6), e.lineTo(n + 1, r + 6), e.lineTo(n + 5, r + 6), e.lineTo(n + 5, r - 6)), e.closePath(), e.fill();
1077
1199
  }
1078
1200
  // tools/angular-build/.stage/react/react/components.ts
1079
- var qt = /* @__PURE__ */ new WeakMap();
1201
+ var vn = /* @__PURE__ */ new WeakMap();
1080
1202
  function I(t, n) {
1081
1203
  if (t == null || typeof t == "boolean") return [];
1082
1204
  if (Array.isArray(t)) return t.flatMap((e, t) => I(e, `${n}.${t}`));
@@ -1086,14 +1208,14 @@ function I(t, n) {
1086
1208
  let r = t.type[c];
1087
1209
  if (!r) throw Error(`Unsupported component inside <Canvas> at ${n}. Use Canvas UI components.`);
1088
1210
  if (r === "grid") {
1089
- let e = qt.get(t);
1211
+ let e = vn.get(t);
1090
1212
  if (e) return e;
1091
1213
  }
1092
1214
  let i = { ...t.props }, a = i.children;
1093
1215
  delete i.children;
1094
1216
  let o = t.key ?? (typeof i.key == "string" ? i.key : null);
1095
1217
  delete i.key, r === "grid" && i.virtual === !0 && (i._gridCacheToken = t);
1096
- let s = r === "group" || r === "grid" || r === "gridItem" || r === "dialog" || r === "tabs" || r === "tabItem" || r === "collapse" || r === "collapseItem" || r === "carousel" || r === "carouselItem";
1218
+ let s = r === "group" || r === "form" || r === "formItem" || r === "grid" || r === "gridItem" || r === "dialog" || r === "tabs" || r === "tabItem" || r === "collapse" || r === "collapseItem" || r === "carousel" || r === "carouselItem";
1097
1219
  if (!s && a != null && typeof a != "boolean" && (r !== "button" || typeof a != "string" && typeof a != "number")) throw Error(r === "button" ? "<Button> accepts only text children; components and elements are not supported." : `<${r}> does not accept children.${r === "text" ? " Use the text prop instead." : ""}`);
1098
1220
  r === "button" && i.text === void 0 && (i.text = typeof a == "string" || typeof a == "number" ? String(a) : "");
1099
1221
  let l = [{
@@ -1102,13 +1224,13 @@ function I(t, n) {
1102
1224
  props: i,
1103
1225
  children: s ? I(a, n) : []
1104
1226
  }];
1105
- return r === "grid" && i.virtual === !0 && qt.set(t, l), l;
1227
+ return r === "grid" && i.virtual === !0 && vn.set(t, l), l;
1106
1228
  }
1107
- function Jt(e) {
1229
+ function yn(e) {
1108
1230
  return I(e, "canvas");
1109
1231
  }
1110
1232
  // tools/angular-build/.stage/react/scene.ts
1111
- var Yt = class e {
1233
+ var bn = class e {
1112
1234
  children = [];
1113
1235
  parent = null;
1114
1236
  dirty = !0;
@@ -1144,7 +1266,7 @@ var Yt = class e {
1144
1266
  ...t.props,
1145
1267
  _key: s
1146
1268
  };
1147
- return (t.type === "input" || t.type === "datePicker" || t.type === "textarea" || t.type === "dropdown" || t.type === "slider") && (d.value === void 0 && (d.value = l?.props.value ?? d.defaultValue ?? (t.type === "slider" ? d.min ?? 0 : "")), (t.type === "input" || t.type === "datePicker" || t.type === "textarea") && (d.focused = l?.props.focused ?? !1, d.cursorPos = l?.props.cursorPos ?? String(d.value).length), t.type === "dropdown" && (d.open = l?.props.open ?? !1)), t.type === "switch" && (d.checked = d.checked ?? l?.props.checked ?? d.defaultChecked ?? !1), (t.type === "radio" || t.type === "checkbox") && (d.value = d.value ?? l?.props.value ?? d.defaultValue ?? (t.type === "checkbox" ? [] : "")), u.replaceProps(d), u.syncChildren(t.children, n), u;
1269
+ return (t.type === "input" || t.type === "datePicker" || t.type === "textarea" || t.type === "dropdown" || t.type === "slider") && (d.value === void 0 && (d.value = l?.props.value ?? d.defaultValue ?? (t.type === "slider" ? d.min ?? 0 : "")), (t.type === "input" || t.type === "datePicker" || t.type === "textarea") && (d.focused = l?.props.focused ?? !1, d.cursorPos = l?.props.cursorPos ?? String(d.value).length), t.type === "dropdown" && (d.open = l?.props.open ?? !1)), t.type === "switch" && (d.checked = d.checked ?? l?.props.checked ?? d.defaultChecked ?? !1), (t.type === "radio" || t.type === "checkbox") && (d.value = d.value ?? l?.props.value ?? d.defaultValue ?? (t.type === "checkbox" ? [] : "")), t.type === "upload" && (d._controlledValue = t.props.value !== void 0, d.value = d.value ?? l?.props.value ?? d.defaultValue ?? [], d._uploadError = l?.props._formResetVersion === d._formResetVersion ? l?.props._uploadError : void 0), u.replaceProps(d), u.syncChildren(t.children, n), u;
1148
1270
  });
1149
1271
  for (let e of r) !i.has(e) && !o.includes(e) && (n(e), e.parent = null);
1150
1272
  (o.length !== this.children.length || o.some((e, t) => this.children[t] !== e)) && (this.children.splice(0, this.children.length, ...o), this.markDirty());
@@ -1153,39 +1275,39 @@ var Yt = class e {
1153
1275
  e(this), this.children.forEach((t) => t.traverse(e));
1154
1276
  }
1155
1277
  };
1156
- function Xt(e, t, n) {
1278
+ function xn(e, t, n) {
1157
1279
  let r = e.props._gridVirtualIndex;
1158
1280
  return e.key === null ? `${n}/i${typeof r == "number" ? r : t}` : `${n}/k${e.key}`;
1159
1281
  }
1160
1282
  // tools/angular-build/.stage/react/renderer.ts
1161
- var Zt = {
1162
- rect: ue,
1163
- circle: fe,
1164
- customDraw: Pt,
1165
- canvasView: Lt,
1166
- text: _e,
1167
- input: ye,
1168
- datePicker: Le,
1169
- radio: qe,
1170
- checkbox: Ye,
1171
- upload: nt,
1172
- carousel: at,
1173
- textarea: Se,
1174
- dropdown: we,
1175
- slider: je,
1176
- switch: Pe,
1177
- button: dt,
1178
- image: yt,
1179
- icon: Qe,
1180
- progress: wt,
1181
- tabs: Dt,
1182
- collapseItem: jt,
1183
- video: Kt
1283
+ var Sn = {
1284
+ rect: ve,
1285
+ circle: be,
1286
+ customDraw: Ht,
1287
+ canvasView: Gt,
1288
+ text: Te,
1289
+ input: De,
1290
+ datePicker: Ge,
1291
+ radio: et,
1292
+ checkbox: nt,
1293
+ upload: ut,
1294
+ carousel: pt,
1295
+ textarea: Ae,
1296
+ dropdown: Me,
1297
+ slider: ze,
1298
+ switch: He,
1299
+ button: yt,
1300
+ image: Dt,
1301
+ icon: at,
1302
+ progress: Mt,
1303
+ tabs: Ft,
1304
+ collapseItem: zt,
1305
+ video: dn
1184
1306
  };
1185
- function Qt(e) {
1307
+ function Cn(e) {
1186
1308
  return e;
1187
1309
  }
1188
- var $t = .5, en = class {
1310
+ var wn = .5, Tn = class {
1189
1311
  gridCaches = /* @__PURE__ */ new WeakMap();
1190
1312
  cacheEnabled = !0;
1191
1313
  invalidateGridCache() {
@@ -1212,19 +1334,19 @@ var $t = .5, en = class {
1212
1334
  }
1213
1335
  drawNode(e, t) {
1214
1336
  if (t.props.visible !== !1 && t.type !== "dialog") {
1215
- if (e.save(), e.translate(L(t.props.x, 0), L(t.props.y, 0)), e.rotate(L(t.props.rotation, 0)), e.scale(L(t.props.scaleX, 1), L(t.props.scaleY, 1)), t.props.disabled === !0 && (e.globalAlpha *= $t), t.type === "gridItem" && typeof t.props.backgroundColor == "string" && nn(e, t), t.type !== "root" && this.safeDraw(e, Zt[t.type], t), t.type === "grid" && typeof t.props.height == "number") this.drawCachedGrid(e, t) || this.drawGrid(e, t);
1337
+ if (e.save(), e.translate(L(t.props.x, 0), L(t.props.y, 0)), e.rotate(L(t.props.rotation, 0)), e.scale(L(t.props.scaleX, 1), L(t.props.scaleY, 1)), t.props.disabled === !0 && (e.globalAlpha *= wn), t.type === "gridItem" && typeof t.props.backgroundColor == "string" && Dn(e, t), t.type !== "root" && this.safeDraw(e, Sn[t.type], t), t.type === "grid" && typeof t.props.height == "number") this.drawCachedGrid(e, t) || this.drawGrid(e, t);
1216
1338
  else if (t.type === "tabs") {
1217
1339
  let n = L(t.props.width, 300), r = L(t.props.height, 200), i = L(t.props.headerHeight, 40);
1218
1340
  e.save(), e.beginPath(), e.rect(0, i, n, Math.max(0, r - i)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore();
1219
- } else t.type === "carousel" ? (e.save(), e.beginPath(), e.rect(0, 0, L(t.props.width, 300), L(t.props.height, 180)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore(), this.safeDraw(e, Qt(ot), t)) : t.children.forEach((t) => this.drawNode(e, t));
1341
+ } else t.type === "carousel" ? (e.save(), e.beginPath(), e.rect(0, 0, L(t.props.width, 300), L(t.props.height, 180)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore(), this.safeDraw(e, Cn(mt), t)) : t.children.forEach((t) => this.drawNode(e, t));
1220
1342
  e.restore();
1221
1343
  }
1222
1344
  }
1223
1345
  drawGrid(e, t) {
1224
- e.save(), e.beginPath(), e.rect(0, 0, L(t.props._gridWidth, L(t.props.width, 0)), L(t.props.height, 0)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore(), rn(e, t);
1346
+ e.save(), e.beginPath(), e.rect(0, 0, L(t.props._gridWidth, L(t.props.width, 0)), L(t.props.height, 0)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore(), On(e, t);
1225
1347
  }
1226
1348
  drawCachedGrid(e, t) {
1227
- if (!this.cacheEnabled || t.props.virtual !== !0 || e.globalAlpha !== 1 || e.globalCompositeOperation !== "source-over" || e.filter !== "none" || e.shadowColor !== "rgba(0, 0, 0, 0)" || tn(t)) return !1;
1349
+ if (!this.cacheEnabled || t.props.virtual !== !0 || e.globalAlpha !== 1 || e.globalCompositeOperation !== "source-over" || e.filter !== "none" || e.shadowColor !== "rgba(0, 0, 0, 0)" || En(t)) return !1;
1228
1350
  let n = e.getTransform();
1229
1351
  if (n.b !== 0 || n.c !== 0 || n.a <= 0 || n.d <= 0) return !1;
1230
1352
  let r = L(t.props._gridWidth, L(t.props.width, 0)), i = L(t.props.height, 0), a = Math.floor(n.e), o = Math.floor(n.f), s = n.e - a, c = n.f - o, l = Math.ceil(s + r * n.a), u = Math.ceil(c + i * n.d);
@@ -1235,7 +1357,7 @@ var $t = .5, en = class {
1235
1357
  a.width = l, a.height = u;
1236
1358
  let o = a.getContext("2d");
1237
1359
  if (!o) return this.gridCaches.delete(t), !1;
1238
- se(a, e.canvas), o.setTransform(n.a, 0, 0, n.d, s, c), this.drawGrid(o, t), d = {
1360
+ he(a, e.canvas), o.setTransform(n.a, 0, 0, n.d, s, c), this.drawGrid(o, t), d = {
1239
1361
  canvas: a,
1240
1362
  sourceCanvas: e.canvas,
1241
1363
  width: r,
@@ -1252,24 +1374,24 @@ var $t = .5, en = class {
1252
1374
  if (t.props.visible !== !1) {
1253
1375
  if (t.type === "dialog") {
1254
1376
  if (!t.props.open) return;
1255
- e.save(), e.translate(L(t.props.x, 0), L(t.props.y, 0)), e.rotate(L(t.props.rotation, 0)), e.scale(L(t.props.scaleX, 1), L(t.props.scaleY, 1)), t.props.disabled === !0 && (e.globalAlpha *= $t), this.safeDraw(e, Qt(xt), t);
1377
+ e.save(), e.translate(L(t.props.x, 0), L(t.props.y, 0)), e.rotate(L(t.props.rotation, 0)), e.scale(L(t.props.scaleX, 1), L(t.props.scaleY, 1)), t.props.disabled === !0 && (e.globalAlpha *= wn), this.safeDraw(e, Cn(kt), t);
1256
1378
  let n = L(t.props._dialogPanelX, 0), r = L(t.props._dialogPanelY, 0), i = L(t.props.width, 420), a = L(t.props.height, 240);
1257
1379
  e.save(), e.beginPath(), e.rect(n + 12, r + 56, Math.max(0, i - 24), Math.max(0, a - 112)), e.clip(), t.children.forEach((t) => this.drawNode(e, t)), e.restore(), e.restore();
1258
1380
  } else t.children.forEach((t) => this.drawDialogs(e, t));
1259
1381
  }
1260
1382
  }
1261
1383
  drawDropdownOverlays(e, t) {
1262
- t.props.visible !== !1 && (e.save(), e.translate(L(t.props.x, 0), L(t.props.y, 0)), e.rotate(L(t.props.rotation, 0)), e.scale(L(t.props.scaleX, 1), L(t.props.scaleY, 1)), t.props.disabled === !0 && (e.globalAlpha *= $t), t.type === "dropdown" && t.props.open && this.safeDraw(e, Qt(Te), t), t.type === "grid" && typeof t.props.height == "number" || t.type === "carousel" ? (e.save(), e.beginPath(), e.rect(0, 0, t.type === "grid" ? L(t.props._gridWidth, L(t.props.width, 0)) : L(t.props.width, 300), L(t.props.height, t.type === "carousel" ? 180 : 0)), e.clip(), t.children.forEach((t) => this.drawDropdownOverlays(e, t)), e.restore()) : t.children.forEach((t) => this.drawDropdownOverlays(e, t)), e.restore());
1384
+ t.props.visible !== !1 && (e.save(), e.translate(L(t.props.x, 0), L(t.props.y, 0)), e.rotate(L(t.props.rotation, 0)), e.scale(L(t.props.scaleX, 1), L(t.props.scaleY, 1)), t.props.disabled === !0 && (e.globalAlpha *= wn), t.type === "dropdown" && t.props.open && this.safeDraw(e, Cn(Ne), t), t.type === "grid" && typeof t.props.height == "number" || t.type === "carousel" ? (e.save(), e.beginPath(), e.rect(0, 0, t.type === "grid" ? L(t.props._gridWidth, L(t.props.width, 0)) : L(t.props.width, 300), L(t.props.height, t.type === "carousel" ? 180 : 0)), e.clip(), t.children.forEach((t) => this.drawDropdownOverlays(e, t)), e.restore()) : t.children.forEach((t) => this.drawDropdownOverlays(e, t)), e.restore());
1263
1385
  }
1264
1386
  };
1265
- function tn(e) {
1266
- for (let t of e.children) if (t.type === "video" || t.type === "image" || t.type === "customDraw" || t.type === "canvasView" || tn(t)) return !0;
1387
+ function En(e) {
1388
+ for (let t of e.children) if (t.type === "video" || t.type === "image" || t.type === "customDraw" || t.type === "canvasView" || En(t)) return !0;
1267
1389
  return !1;
1268
1390
  }
1269
- function nn(e, t) {
1391
+ function Dn(e, t) {
1270
1392
  e.fillStyle = t.props.backgroundColor, e.fillRect(0, 0, L(t.props._gridItemWidth, 0), L(t.props._gridItemHeight, 0));
1271
1393
  }
1272
- function rn(e, t) {
1394
+ function On(e, t) {
1273
1395
  let n = L(t.props.height, 0), r = L(t.props._gridContentHeight, n);
1274
1396
  if (n <= 0 || r <= n) return;
1275
1397
  let i = L(t.props._gridWidth, L(t.props.width, 0)), a = Math.max(0, i - 6), o = Math.min(n, Math.max(18, n * n / r)), s = r - n, c = (n - o) * L(t.props._scrollTop, 0) / s;
@@ -1289,14 +1411,14 @@ var R = [
1289
1411
  ];
1290
1412
  // tools/angular-build/.stage/react/engine/transform.ts
1291
1413
  function z(e, t) {
1292
- let n = p(t.rotation, 0), r = p(t.scaleX, 1), i = p(t.scaleY, 1), a = Math.cos(n), o = Math.sin(n), s = a * r, c = o * r, l = -o * i, u = a * i, d = p(t.x, 0), f = p(t.y, 0), [m, h, g, _, v, y] = e;
1414
+ let n = y(t.rotation, 0), r = y(t.scaleX, 1), i = y(t.scaleY, 1), a = Math.cos(n), o = Math.sin(n), s = a * r, c = o * r, l = -o * i, u = a * i, d = y(t.x, 0), f = y(t.y, 0), [p, m, h, g, _, v] = e;
1293
1415
  return [
1416
+ p * s + h * c,
1294
1417
  m * s + g * c,
1295
- h * s + _ * c,
1418
+ p * l + h * u,
1296
1419
  m * l + g * u,
1297
- h * l + _ * u,
1298
- m * d + g * f + v,
1299
- h * d + _ * f + y
1420
+ p * d + h * f + _,
1421
+ m * d + g * f + v
1300
1422
  ];
1301
1423
  }
1302
1424
  function B(e, t, n) {
@@ -1311,7 +1433,7 @@ function B(e, t, n) {
1311
1433
  function V(e) {
1312
1434
  let t = [], n = e;
1313
1435
  for (; n;) t.push(n), n = n.parent;
1314
- return t.reverse().reduce((e, t) => z(e, t.props), R);
1436
+ return t.reverse().reduce((e, t) => z(t.type === "dialog" ? R : e, t.props), R);
1315
1437
  }
1316
1438
  // tools/angular-build/.stage/react/engine/nodes.ts
1317
1439
  function H(e) {
@@ -1322,11 +1444,13 @@ function H(e) {
1322
1444
  }
1323
1445
  return !0;
1324
1446
  }
1325
- function an(e, t) {
1326
- let n = t && e.props.visible !== !1;
1327
- return n ? e.type === "dialog" && e.props.open === !0 || e.children.some((e) => an(e, n)) : !1;
1447
+ function kn(e) {
1448
+ let t = null, n = (e) => {
1449
+ e.props.visible !== !1 && (e.type === "dialog" ? e.props.open === !0 && (t = e) : e.children.forEach(n));
1450
+ };
1451
+ return n(e), t;
1328
1452
  }
1329
- function U(e) {
1453
+ function An(e) {
1330
1454
  if (e.type === "root") throw Error("The Canvas root is not an event target.");
1331
1455
  let t = e.props._key, n = typeof t == "string" ? t.indexOf(":") : -1;
1332
1456
  return {
@@ -1334,13 +1458,13 @@ function U(e) {
1334
1458
  key: typeof t != "string" || n < 0 ? null : t.slice(n + 1)
1335
1459
  };
1336
1460
  }
1337
- function on(e) {
1461
+ function jn(e) {
1338
1462
  return typeof e == "object" && !!e && "nodeName" in e && e.nodeName === "CANVAS" && "width" in e && typeof e.width == "number" && "height" in e && typeof e.height == "number";
1339
1463
  }
1340
- function sn(e) {
1464
+ function Mn(e) {
1341
1465
  return e === "button" || e === "upload" || e === "switch" || e === "slider" || e === "dropdown" || e === "tabs" || e === "collapse" || e === "grid" || e === "radio" || e === "checkbox" || e === "carousel" || e === "customDraw" || e === "canvasView";
1342
1466
  }
1343
- function W(e, t) {
1467
+ function U(e, t) {
1344
1468
  let n = e.parent;
1345
1469
  for (; n;) {
1346
1470
  if (n === t) return !0;
@@ -1348,50 +1472,145 @@ function W(e, t) {
1348
1472
  }
1349
1473
  return !1;
1350
1474
  }
1351
- function G(e, t) {
1475
+ function W(e, t) {
1352
1476
  let n = t && e.props._userVisible !== !1;
1353
- e.setProps({ visible: n }), e.children.forEach((e) => G(e, n));
1477
+ e.setProps({ visible: n }), e.children.forEach((e) => W(e, n));
1354
1478
  }
1355
- function K(e) {
1356
- if (e.type === "radio" || e.type === "checkbox") return Be(e.props);
1479
+ function G(e) {
1480
+ if (e.type === "radio" || e.type === "checkbox") return Je(e.props);
1357
1481
  if (e.type === "icon") {
1358
- let t = p(e.props.size, 24);
1482
+ let t = y(e.props.size, 24);
1359
1483
  return {
1360
1484
  width: t,
1361
1485
  height: t
1362
1486
  };
1363
1487
  }
1364
1488
  if (e.type === "customDraw") return {
1365
- width: p(e.props.width, 0),
1366
- height: p(e.props.height, 0)
1489
+ width: y(e.props.width, 0),
1490
+ height: y(e.props.height, 0)
1367
1491
  };
1368
1492
  if (e.type === "text") return {
1369
- width: N(e.props, p(e.props._textWidth, 0)),
1370
- height: P(e.props, p(e.props._textHeight, 0))
1493
+ width: Ke(e.props, y(e.props._textWidth, 0)),
1494
+ height: j(e.props, y(e.props._textHeight, 0))
1371
1495
  };
1496
+ if (e.type === "video") {
1497
+ let t = e.props._videoElement;
1498
+ return {
1499
+ width: y(e.props.width, t?.videoWidth ?? 300),
1500
+ height: y(e.props.height, t?.videoHeight ?? 150)
1501
+ };
1502
+ }
1372
1503
  let t = e.type === "upload" ? 120 : e.type === "switch" ? 44 : e.type === "slider" ? 160 : e.type === "button" ? 120 : 200, n = e.type === "upload" ? 40 : e.type === "switch" ? 24 : e.type === "slider" ? 32 : e.type === "button" ? 40 : 36;
1373
- return e.type === "switch" || e.type === "slider" || e.type === "button" || e.type === "upload" || e.type === "dropdown" || e.type === "datePicker" ? {
1374
- width: p(e.props.width, t),
1375
- height: p(e.props.height, n)
1504
+ return e.type === "switch" || e.type === "slider" ? {
1505
+ width: y(e.props.width, t),
1506
+ height: y(e.props.height, n)
1507
+ } : e.type === "upload" ? {
1508
+ width: y(e.props.width, t),
1509
+ height: ct(e.props)
1510
+ } : e.type === "button" || e.type === "dropdown" || e.type === "datePicker" ? {
1511
+ width: y(e.props.width, t),
1512
+ height: y(e.props.height, n)
1376
1513
  } : {
1377
- width: N(e.props, t),
1378
- height: P(e.props, n)
1514
+ width: Ke(e.props, t),
1515
+ height: j(e.props, n)
1379
1516
  };
1380
1517
  }
1381
- function cn(e, t) {
1382
- let n = e;
1383
- for (; n;) {
1384
- if (n.props.visible === !1) return !1;
1385
- if (n.type === "grid" && typeof n.props.height == "number") {
1386
- let [e, r, i, a, o, s] = t.transform, c = B(e * t.width / 2 + i * t.height / 2 + o, r * t.width / 2 + a * t.height / 2 + s, V(n)), l = p(n.props._gridWidth, p(n.props.width, 0)), u = p(n.props.height, 0);
1518
+ function Nn(e, t, n = null) {
1519
+ if (n && !U(e, n)) return !1;
1520
+ let r = e;
1521
+ for (; r;) {
1522
+ if (r.props.visible === !1) return !1;
1523
+ if (r.type === "dialog") return r === n && r.props.open === !0;
1524
+ if (r.type === "grid" && typeof r.props.height == "number") {
1525
+ let [e, n, i, a, o, s] = t.transform, c = B(e * t.width / 2 + i * t.height / 2 + o, n * t.width / 2 + a * t.height / 2 + s, V(r)), l = y(r.props._gridWidth, y(r.props.width, 0)), u = y(r.props.height, 0);
1387
1526
  if (!c || c.x < 0 || c.x > l || c.y < 0 || c.y > u) return !1;
1388
1527
  }
1389
- n = n.parent;
1528
+ r = r.parent;
1390
1529
  }
1391
1530
  return !0;
1392
1531
  }
1532
+ function Pn(e, t) {
1533
+ let [n, r, i, a, o, s] = t;
1534
+ return {
1535
+ x: n * e.x + i * e.y + o,
1536
+ y: r * e.x + a * e.y + s
1537
+ };
1538
+ }
1539
+ function Fn(e, t, n, r) {
1540
+ if (!e.length) return [];
1541
+ let i = [], a = (e) => r ? e[t] >= n : e[t] <= n, o = e[e.length - 1];
1542
+ for (let r of e) {
1543
+ if (a(r) !== a(o)) {
1544
+ let e = (n - o[t]) / (r[t] - o[t]);
1545
+ i.push({
1546
+ x: o.x + (r.x - o.x) * e,
1547
+ y: o.y + (r.y - o.y) * e
1548
+ });
1549
+ }
1550
+ a(r) && i.push(r), o = r;
1551
+ }
1552
+ return i;
1553
+ }
1554
+ function K(e, t, n) {
1555
+ if (!Nn(e, t, n)) return {
1556
+ ...t,
1557
+ visible: !1
1558
+ };
1559
+ if (!n) return {
1560
+ ...t,
1561
+ visible: t.visible,
1562
+ clipPath: void 0
1563
+ };
1564
+ let r = V(n), i = y(n.props._dialogPanelX, 0), a = y(n.props._dialogPanelY, 0), o = y(n.props.width, 420), s = y(n.props.height, 240), c = i + 12, l = a + 56, u = c + Math.max(0, o - 24), d = l + Math.max(0, s - 112), f = [
1565
+ {
1566
+ x: 0,
1567
+ y: 0
1568
+ },
1569
+ {
1570
+ x: t.width,
1571
+ y: 0
1572
+ },
1573
+ {
1574
+ x: t.width,
1575
+ y: t.height
1576
+ },
1577
+ {
1578
+ x: 0,
1579
+ y: t.height
1580
+ }
1581
+ ].map((e) => {
1582
+ let n = Pn(e, t.transform);
1583
+ return B(n.x, n.y, r);
1584
+ });
1585
+ if (f.some((e) => e === null) || u <= c || d <= l) return {
1586
+ ...t,
1587
+ visible: !1
1588
+ };
1589
+ let p = f.filter((e) => e !== null);
1590
+ if (p.every((e) => e.x >= c && e.x <= u && e.y >= l && e.y <= d)) return {
1591
+ ...t,
1592
+ clipPath: void 0
1593
+ };
1594
+ if (p = Fn(p, "x", c, !0), p = Fn(p, "x", u, !1), p = Fn(p, "y", l, !0), p = Fn(p, "y", d, !1), p.length < 3) return {
1595
+ ...t,
1596
+ visible: !1
1597
+ };
1598
+ let m = p.map((e) => {
1599
+ let n = Pn(e, r);
1600
+ return B(n.x, n.y, t.transform);
1601
+ });
1602
+ if (m.some((e) => e === null)) return {
1603
+ ...t,
1604
+ visible: !1
1605
+ };
1606
+ let h = `polygon(${m.filter((e) => e !== null).map((e) => `${e.x}px ${e.y}px`).join(", ")})`;
1607
+ return {
1608
+ ...t,
1609
+ clipPath: h
1610
+ };
1611
+ }
1393
1612
  // tools/angular-build/.stage/react/engine/text-controls.ts
1394
- function ln(e, t, n) {
1613
+ function In(e, t, n) {
1395
1614
  let r = /* @__PURE__ */ new Map();
1396
1615
  e.scene.traverse((e) => {
1397
1616
  let t = e.props._canvasInputId;
@@ -1399,29 +1618,27 @@ function ln(e, t, n) {
1399
1618
  });
1400
1619
  let i = new Set(n.map((e) => e.id));
1401
1620
  for (let [e, n] of t.textControls) i.has(e) && r.get(e) === n.node || (n.dispose(), t.textControls.delete(e), t.inputValues.delete(e));
1621
+ let a = kn(e.scene);
1402
1622
  for (let i of n) {
1403
1623
  let n = r.get(i.id);
1404
1624
  if (!n) continue;
1405
- let a = {
1406
- ...i.layout,
1407
- visible: cn(n, i.layout)
1408
- }, o = i.props.value ?? t.inputValues.get(i.id) ?? i.props.defaultValue ?? "";
1625
+ let o = K(n, i.layout, a), s = i.props.value ?? t.inputValues.get(i.id) ?? i.props.defaultValue ?? "";
1409
1626
  n.setProps({
1410
1627
  ...n.props,
1411
1628
  ...i.props,
1412
- value: o,
1629
+ value: s,
1413
1630
  _canvasInputId: i.id,
1414
1631
  _controlledValue: i.props.value !== void 0
1415
1632
  });
1416
- let s = t.textControls.get(i.id);
1417
- if (s) {
1418
- s.layout = a, e.inputBridge.update(i.id, {
1633
+ let c = t.textControls.get(i.id);
1634
+ if (c) {
1635
+ c.layout = o, e.inputBridge.update(i.id, {
1419
1636
  ...i.props,
1420
- value: o
1421
- }, a);
1637
+ value: s
1638
+ }, o);
1422
1639
  continue;
1423
1640
  }
1424
- let c = {
1641
+ let l = {
1425
1642
  input: (e, r) => {
1426
1643
  n.props._controlledValue !== !0 && t.inputValues.set(i.id, e), n.setProps({
1427
1644
  value: e,
@@ -1449,33 +1666,31 @@ function ln(e, t, n) {
1449
1666
  _scrollClientWidth: i
1450
1667
  });
1451
1668
  }
1452
- }, l = e.inputBridge.mount(i.id, {
1669
+ }, u = e.inputBridge.mount(i.id, {
1453
1670
  ...i.props,
1454
- value: o
1455
- }, a, c);
1671
+ value: s
1672
+ }, o, l);
1456
1673
  t.textControls.set(i.id, {
1457
1674
  node: n,
1458
- dispose: l,
1459
- layout: a
1675
+ dispose: u,
1676
+ layout: o
1460
1677
  });
1461
1678
  }
1462
1679
  }
1463
1680
  function q(e, t) {
1464
- for (let n of t.textControls.values()) {
1465
- let t = cn(n.node, n.layout);
1466
- n.layout = {
1467
- ...n.layout,
1468
- visible: t
1469
- }, e.inputBridge.update(String(n.node.props._canvasInputId), n.node.props, n.layout);
1470
- }
1471
- }
1472
- function un(e, t) {
1473
- t.children.forEach((t) => un(e, t));
1681
+ let n = kn(e.scene);
1682
+ for (let r of t.textControls.values()) r.layout = K(r.node, {
1683
+ ...r.layout,
1684
+ visible: !0
1685
+ }, n), e.inputBridge.update(String(r.node.props._canvasInputId), r.node.props, r.layout);
1686
+ }
1687
+ function Ln(e, t) {
1688
+ t.children.forEach((t) => Ln(e, t));
1474
1689
  let n = t.props._canvasInputId;
1475
1690
  typeof n == "string" && (e.textControls.get(n)?.dispose(), e.textControls.delete(n), e.inputValues.delete(n));
1476
1691
  }
1477
1692
  // tools/angular-build/.stage/react/engine/images.ts
1478
- function dn(e, t, n) {
1693
+ function Rn(e, t, n) {
1479
1694
  let r = /* @__PURE__ */ new Set(), i = (e) => e.forEach((e) => {
1480
1695
  e.type === "image" && typeof e.props.src == "string" && e.props.src && r.add(e.props.src), i(e.children);
1481
1696
  });
@@ -1483,7 +1698,7 @@ function dn(e, t, n) {
1483
1698
  for (let [e, n] of t.imageSubscriptions) r.has(e) || (n(), t.imageSubscriptions.delete(e));
1484
1699
  for (let n of r) {
1485
1700
  if (t.imageSubscriptions.has(n)) continue;
1486
- let r = _t(n, (t) => {
1701
+ let r = Tt(n, (t) => {
1487
1702
  e.scene.markDirty(), t && e.scene.traverse((e) => {
1488
1703
  e.type === "image" && e.props.src === n && e.props.onError?.(t);
1489
1704
  });
@@ -1492,60 +1707,98 @@ function dn(e, t, n) {
1492
1707
  }
1493
1708
  }
1494
1709
  // tools/angular-build/.stage/react/engine/videos.ts
1495
- function fn(e, t) {
1496
- let n = /* @__PURE__ */ new Set();
1497
- e.scene.traverse((e) => {
1498
- if (e.type !== "video") return;
1499
- let t = e.props.src;
1500
- typeof t == "string" && t && n.add(t);
1501
- });
1502
- for (let [e, r] of t.videoSubscriptions) n.has(e) || (r(), t.videoSubscriptions.delete(e), Wt(e));
1503
- for (let r of n) {
1504
- if (t.videoSubscriptions.has(r)) continue;
1505
- let n = Ut(r, (t) => {
1506
- e.scene.markDirty(), t && e.scene.traverse((e) => {
1507
- e.type === "video" && e.props.src === r && e.props.onError?.(t);
1508
- });
1509
- }, (t, n) => {
1510
- e.scene.traverse((e) => {
1511
- e.type === "video" && e.props.src === r && e.props.onTimeUpdate?.(t, n);
1512
- });
1513
- });
1514
- t.videoSubscriptions.set(r, n);
1710
+ function zn(e, t) {
1711
+ if (e.fullscreenCleanup) return;
1712
+ let n = e.video, r = n.ownerDocument, i = (e) => {
1713
+ let n = e instanceof Error ? e : /* @__PURE__ */ Error(`Video fullscreen failed: ${String(e)}`), r = t.props.onError;
1714
+ typeof r == "function" ? r(n) : console.error("[canvas-ui] Failed to enter video fullscreen:", n);
1715
+ };
1716
+ if (!r.body) {
1717
+ i(/* @__PURE__ */ Error("Video fullscreen requires a document body."));
1718
+ return;
1719
+ }
1720
+ let a = n.getAttribute("style"), o = n.controls, s = !1, c = () => {
1721
+ r.fullscreenElement === n ? s = !0 : s && p();
1722
+ }, l = () => {
1723
+ s = !0;
1724
+ }, u = () => {
1725
+ t.setProps({ paused: n.paused }), t.props.onPausedChange?.(n.paused);
1726
+ }, d = () => t.setProps({ currentTime: void 0 }), f = () => {
1727
+ t.markDirty(), t.props.onSeek?.(n.currentTime);
1728
+ }, p = () => {
1729
+ s && t.setProps({ paused: n.paused }), r.removeEventListener("fullscreenchange", c), n.removeEventListener("webkitbeginfullscreen", l), n.removeEventListener("webkitendfullscreen", p), n.removeEventListener("play", u), n.removeEventListener("pause", u), n.removeEventListener("seeking", d), n.removeEventListener("seeked", f), n.controls = o, a === null ? n.removeAttribute("style") : n.setAttribute("style", a), n.remove(), e.fullscreenCleanup = void 0, t.markDirty();
1730
+ };
1731
+ e.fullscreenCleanup = p, r.addEventListener("fullscreenchange", c), n.addEventListener("webkitbeginfullscreen", l), n.addEventListener("webkitendfullscreen", p), n.addEventListener("play", u), n.addEventListener("pause", u), n.addEventListener("seeking", d), n.addEventListener("seeked", f);
1732
+ try {
1733
+ n.controls = !0, n.style.cssText = "position:fixed;inset:0;width:100%;height:100%;object-fit:contain;background:#000;z-index:2147483647", r.body.appendChild(n), typeof n.requestFullscreen == "function" ? n.requestFullscreen().catch((t) => {
1734
+ e.fullscreenCleanup === p && (p(), i(t));
1735
+ }) : typeof n.webkitEnterFullscreen == "function" ? n.webkitEnterFullscreen() : (p(), i(/* @__PURE__ */ Error("Native video fullscreen is not supported by this browser.")));
1736
+ } catch (e) {
1737
+ p(), i(e);
1515
1738
  }
1516
1739
  }
1517
- function pn(e, t) {
1518
- if (t.videoSubscriptions.size === 0 && t.videoFrames.size === 0) return;
1519
- let n = !1, r = /* @__PURE__ */ new Set();
1520
- e.scene.traverse((e) => {
1740
+ function Bn(e, t) {
1741
+ let n = t.videoNodes;
1742
+ n.length = 0, e.scene.traverse((e) => {
1521
1743
  if (e.type !== "video") return;
1522
- r.add(e);
1744
+ let t = e.props.src;
1745
+ typeof t == "string" && t && n.push(e);
1746
+ }), t.hoveredVideo && (!n.includes(t.hoveredVideo) || t.hoveredVideo.props.controls !== !0 || t.hoveredVideo.props.controlsOnHover !== !0 || t.hoveredVideo.props.visible === !1 || t.hoveredVideo.props.disabled === !0) && (t.hoveredVideo = null);
1747
+ for (let [e, r] of t.videoElements) {
1523
1748
  let i = e.props.src;
1524
- if (typeof i != "string" || !i || e.props.visible === !1) return;
1525
- let a = t.videoFrames.get(e);
1526
- if (!a || a.src !== i) {
1749
+ n.includes(e) && r.src === i || (r.dispose(), t.videoElements.delete(e));
1750
+ }
1751
+ for (let r of n) {
1752
+ let n = r.props.src, i = t.videoElements.get(r);
1753
+ i && i.src === n || (i = $t(n, (t) => {
1754
+ e.scene.markDirty(), t && r.props.onError?.(t);
1755
+ }, (e, t) => {
1756
+ r.props.onTimeUpdate?.(e, t);
1757
+ }, () => e.scene.markDirty()), t.videoElements.set(r, i)), r.props._videoElement = i.video, r.props._videoFrame = i.frame, r.props._videoControlsVisible = t.hoveredVideo === r;
1758
+ }
1759
+ for (let e of t.videoFrames.keys()) n.includes(e) || t.videoFrames.delete(e);
1760
+ }
1761
+ function Vn(e, t) {
1762
+ let n = t.videoNodes;
1763
+ if (n.length === 0 && t.videoFrames.size === 0) return;
1764
+ let r = !1;
1765
+ for (let e of n) {
1766
+ let n = e.props.src;
1767
+ if (typeof n != "string" || !n || e.props.visible === !1) continue;
1768
+ let i = t.videoElements.get(e);
1769
+ if (!i || i.src !== n) continue;
1770
+ let a = i.video, o = e.props;
1771
+ un(a, i.fullscreenCleanup ? {
1772
+ ...o,
1773
+ paused: void 0,
1774
+ autoplay: !1,
1775
+ currentTime: void 0
1776
+ } : o, () => {
1777
+ i.captureFrame(), e.props._videoFrame = i.frame;
1778
+ });
1779
+ let s = t.videoFrames.get(e);
1780
+ if (!s || s.src !== n) {
1527
1781
  t.videoFrames.set(e, {
1528
- src: i,
1782
+ src: n,
1529
1783
  time: -1,
1530
1784
  playing: !1
1531
- }), n = !0;
1532
- return;
1785
+ }), r = !0;
1786
+ continue;
1533
1787
  }
1534
- let o = Ht(i), s = !(!o || o.paused || o.ended), c = o ? o.currentTime : 0;
1535
- (s || c !== a.time || a.playing) && (n = !0), a.time = c, a.playing = s;
1536
- });
1537
- for (let e of t.videoFrames.keys()) r.has(e) || t.videoFrames.delete(e);
1538
- n && e.scene.markDirty();
1788
+ let c = !a.paused && !a.ended, l = a.currentTime;
1789
+ (c || l !== s.time || s.playing) && (r = !0), s.time = l, s.playing = c;
1790
+ }
1791
+ r && e.scene.markDirty();
1539
1792
  }
1540
1793
  // tools/angular-build/.stage/react/engine/vnodes.ts
1541
- function mn(e) {
1542
- let t = gn(e), n = t.children.map((e, t) => {
1543
- let n = p(e.props.y, 0);
1794
+ function Hn(e) {
1795
+ let t = Wn(e), n = t.children.map((e, t) => {
1796
+ let n = y(e.props.y, 0);
1544
1797
  return {
1545
1798
  child: e,
1546
1799
  index: t,
1547
1800
  top: n,
1548
- bottom: n + p(e.props._availableHeight, 0),
1801
+ bottom: n + y(e.props._availableHeight, 0),
1549
1802
  maxBottom: 0
1550
1803
  };
1551
1804
  });
@@ -1559,7 +1812,7 @@ function mn(e) {
1559
1812
  entries: n
1560
1813
  };
1561
1814
  }
1562
- function hn(e, t, n, r) {
1815
+ function Un(e, t, n, r) {
1563
1816
  let i = t - r, a = t + n + r, o = 0, s = e.entries.length;
1564
1817
  for (; o < s;) {
1565
1818
  let t = Math.floor((o + s) / 2);
@@ -1577,11 +1830,11 @@ function hn(e, t, n, r) {
1577
1830
  ...e.props,
1578
1831
  _gridVirtualIndex: n,
1579
1832
  _gridBaseY: e.props.y,
1580
- y: p(e.props.y, 0) - t
1833
+ y: y(e.props.y, 0) - t
1581
1834
  }
1582
1835
  }));
1583
1836
  }
1584
- function gn(e) {
1837
+ function Wn(e) {
1585
1838
  let t = e.props.columns, n = e.props.cellWidth, r = e.props.width, i = e.props.cellHeight, a = e.props.gap ?? 0;
1586
1839
  if (!Number.isInteger(t) || t < 1) throw RangeError("Grid columns must be a positive integer.");
1587
1840
  if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw RangeError("Grid cellHeight must be a positive finite number.");
@@ -1597,31 +1850,31 @@ function gn(e) {
1597
1850
  if (!Number.isInteger(r) || r < 1 || r > t) throw RangeError("GridItem columnSpan must be a positive integer no greater than Grid columns.");
1598
1851
  if (!Number.isInteger(s) || s < 1) throw RangeError("GridItem rowSpan must be a positive integer.");
1599
1852
  let d = Math.floor(l / t), f = l % t;
1600
- for (; f + r > t || !vn(c, d, f, r, s);) l++, d = Math.floor(l / t), f = l % t;
1853
+ for (; f + r > t || !Kn(c, d, f, r, s);) l++, d = Math.floor(l / t), f = l % t;
1601
1854
  for (let e = d; e < d + s; e++) for (let t = f; t < f + r; t++) c.add(`${e}:${t}`);
1602
1855
  u = Math.max(u, d * (i + a) + s * i + (s - 1) * a), l++;
1603
- let m = o * r + a * (r - 1), h = i * s + a * (s - 1);
1856
+ let p = o * r + a * (r - 1), m = i * s + a * (s - 1);
1604
1857
  return {
1605
1858
  ...e,
1606
1859
  props: {
1607
1860
  ...e.props,
1608
- x: p(e.props.x, 0) + f * (o + a),
1609
- y: p(e.props.y, 0) + d * (i + a),
1610
- _availableWidth: m,
1611
- _availableHeight: h,
1861
+ x: y(e.props.x, 0) + f * (o + a),
1862
+ y: y(e.props.y, 0) + d * (i + a),
1863
+ _availableWidth: p,
1864
+ _availableHeight: m,
1612
1865
  ...n ? {
1613
- _gridItemWidth: m,
1614
- _gridItemHeight: h
1866
+ _gridItemWidth: p,
1867
+ _gridItemHeight: m
1615
1868
  } : {}
1616
1869
  },
1617
- children: n ? _n(e.children, m, h) : e.children
1870
+ children: n ? Gn(e.children, p, m) : e.children
1618
1871
  };
1619
1872
  }),
1620
1873
  contentHeight: u,
1621
1874
  width: s
1622
1875
  };
1623
1876
  }
1624
- function _n(e, t, n) {
1877
+ function Gn(e, t, n) {
1625
1878
  return e.map((e) => ({
1626
1879
  ...e,
1627
1880
  props: {
@@ -1631,21 +1884,21 @@ function _n(e, t, n) {
1631
1884
  }
1632
1885
  }));
1633
1886
  }
1634
- function vn(e, t, n, r, i) {
1887
+ function Kn(e, t, n, r, i) {
1635
1888
  for (let a = t; a < t + i; a++) for (let t = n; t < n + r; t++) if (e.has(`${a}:${t}`)) return !1;
1636
1889
  return !0;
1637
1890
  }
1638
- function yn(e, t, n) {
1891
+ function qn(e, t, n) {
1639
1892
  return e.map((e) => ({
1640
1893
  ...e,
1641
1894
  props: {
1642
1895
  ...e.props,
1643
- x: p(e.props.x, 0) + t,
1644
- y: p(e.props.y, 0) + n
1896
+ x: y(e.props.x, 0) + t,
1897
+ y: y(e.props.y, 0) + n
1645
1898
  }
1646
1899
  }));
1647
1900
  }
1648
- function J(e, t) {
1901
+ function Jn(e, t) {
1649
1902
  return e.map((e) => {
1650
1903
  let n = typeof e.props._userVisible == "boolean" ? e.props._userVisible : e.props.visible !== !1, r = t && n;
1651
1904
  return {
@@ -1655,50 +1908,50 @@ function J(e, t) {
1655
1908
  visible: r,
1656
1909
  _userVisible: n
1657
1910
  },
1658
- children: J(e.children, r)
1911
+ children: Jn(e.children, r)
1659
1912
  };
1660
1913
  });
1661
1914
  }
1662
- function bn(e, t, n, r) {
1915
+ function Yn(e, t, n, r) {
1663
1916
  return t ? e === t.from ? -t.direction * r * n : e === t.to ? t.direction * r * (1 - n) : 0 : 0;
1664
1917
  }
1665
- function xn(e) {
1666
- let t = p(e.height, 0), n = p(e._gridContentHeight, t), r = p(e._gridWidth, p(e.width, 0)), i = Math.max(0, n - t), a = i > 0 ? Math.min(t, Math.max(18, t * t / n)) : t;
1918
+ function Xn(e) {
1919
+ let t = y(e.height, 0), n = y(e._gridContentHeight, t), r = y(e._gridWidth, y(e.width, 0)), i = Math.max(0, n - t), a = i > 0 ? Math.min(t, Math.max(18, t * t / n)) : t;
1667
1920
  return {
1668
1921
  width: r,
1669
1922
  height: t,
1670
1923
  maxScroll: i,
1671
1924
  thumbHeight: a,
1672
1925
  trackX: Math.max(0, r - 6),
1673
- thumbY: i > 0 ? (t - a) * p(e._scrollTop, 0) / i : 0
1926
+ thumbY: i > 0 ? (t - a) * y(e._scrollTop, 0) / i : 0
1674
1927
  };
1675
1928
  }
1676
1929
  // tools/angular-build/.stage/react/engine/carousel.ts
1677
- function Sn(e, t) {
1930
+ function Zn(e, t) {
1678
1931
  return e.duration <= 0 ? 1 : Math.max(0, Math.min(1, (t - e.startedAt) / e.duration));
1679
1932
  }
1680
- function Cn(e, t, n, r) {
1681
- let i = p(e.props.width, 300);
1933
+ function Qn(e, t, n, r) {
1934
+ let i = y(e.props.width, 300);
1682
1935
  e.children.filter((e) => e.type === "carouselItem").forEach((e, a) => {
1683
- let o = n ? (a === n.from || a === n.to) && e.props._userVisible !== !1 : a === t && e.props._userVisible !== !1, s = p(e.props._carouselBaseX, p(e.props.x, 0)), c = bn(a, n, r, i);
1684
- e.setProps({ x: s + c }), G(e, o);
1936
+ let o = n ? (a === n.from || a === n.to) && e.props._userVisible !== !1 : a === t && e.props._userVisible !== !1, s = y(e.props._carouselBaseX, y(e.props.x, 0)), c = Yn(a, n, r, i);
1937
+ e.setProps({ x: s + c }), W(e, o);
1685
1938
  });
1686
1939
  }
1687
- function wn(e, t, n) {
1688
- for (let e of t.textControls.values()) W(e.node, n) && (e.layout = {
1940
+ function $n(e, t, n) {
1941
+ for (let e of t.textControls.values()) U(e.node, n) && (e.layout = {
1689
1942
  ...e.layout,
1690
1943
  transform: V(e.node)
1691
1944
  });
1692
1945
  q(e, t);
1693
1946
  }
1694
- function Tn(e, t, n, r) {
1947
+ function er(e, t, n, r) {
1695
1948
  let i = n.children.filter((e) => e.type === "carouselItem");
1696
1949
  if (!i.length) return;
1697
- let a = p(n.props._activeIndex, 0), o = lt(r, a, i.length, n.props.loop !== !1);
1950
+ let a = y(n.props._activeIndex, 0), o = _t(r, a, i.length, n.props.loop !== !1);
1698
1951
  if (o === a) return;
1699
1952
  let s = String(n.props._stateKey ?? "");
1700
1953
  if (t.carouselTransitions.has(s)) return;
1701
- let c = Math.max(0, p(n.props.transitionDuration, 450));
1954
+ let c = Math.max(0, y(n.props.transitionDuration, 450));
1702
1955
  if (c > 0) {
1703
1956
  let i = {
1704
1957
  from: a,
@@ -1710,70 +1963,291 @@ function Tn(e, t, n, r) {
1710
1963
  t.carouselTransitions.set(s, i), t.carouselFrameTimes.set(s, t.currentFrameTime), n.setProps({
1711
1964
  _activeIndex: o,
1712
1965
  _transitionProgress: 0
1713
- }), Cn(n, o, i, 0), wn(e, t, n), n.props.activeIndex === void 0 && t.carouselSelections.set(s, o), n.props.onChange?.(o);
1966
+ }), Qn(n, o, i, 0), $n(e, t, n), n.props.activeIndex === void 0 && t.carouselSelections.set(s, o), n.props.onChange?.(o);
1714
1967
  } else t.carouselFrameTimes.set(s, t.currentFrameTime), n.props.activeIndex === void 0 && (t.carouselSelections.set(s, o), n.setProps({ _activeIndex: o }), i.forEach((e, t) => {
1715
- G(e, t === o && e.props._userVisible !== !1);
1968
+ W(e, t === o && e.props._userVisible !== !1);
1716
1969
  }), q(e, t)), n.props.onChange?.(o);
1717
1970
  }
1718
- function En(e, t, n) {
1971
+ function tr(e, t, n) {
1719
1972
  t.currentFrameTime = n;
1720
- let r = /* @__PURE__ */ new Set();
1721
- e.scene.traverse((i) => {
1722
- if (i.type !== "carousel") return;
1723
- let a = String(i.props._stateKey ?? "");
1724
- r.add(a);
1725
- let o = t.carouselTransitions.get(a);
1726
- if (o) {
1727
- if (n - o.startedAt >= o.duration) t.carouselTransitions.delete(a), i.setProps({ _transitionProgress: 1 }), Cn(i, o.to, null, 1), wn(e, t, i), t.carouselFrameTimes.set(a, n);
1973
+ let r = /* @__PURE__ */ new Set(), i = !1;
1974
+ e.scene.traverse((a) => {
1975
+ if (a.type !== "carousel") return;
1976
+ let o = String(a.props._stateKey ?? "");
1977
+ r.add(o);
1978
+ let s = t.carouselTransitions.get(o);
1979
+ if (s) {
1980
+ if (i = !0, n - s.startedAt >= s.duration) t.carouselTransitions.delete(o), a.setProps({ _transitionProgress: 1 }), Qn(a, s.to, null, 1), $n(e, t, a), t.carouselFrameTimes.set(o, n);
1728
1981
  else {
1729
- let r = Sn(o, n);
1730
- i.setProps({ _transitionProgress: r });
1731
- let a = r * r * (3 - 2 * r);
1732
- Cn(i, o.to, o, a), wn(e, t, i);
1982
+ let r = Zn(s, n);
1983
+ a.setProps({ _transitionProgress: r });
1984
+ let i = r * r * (3 - 2 * r);
1985
+ Qn(a, s.to, s, i), $n(e, t, a);
1733
1986
  }
1734
1987
  return;
1735
1988
  }
1736
- if (!H(i) || i.props.autoplay === !1 || i.children.filter((e) => e.type === "carouselItem").length < 2) {
1737
- t.carouselFrameTimes.delete(a);
1989
+ if (!H(a) || a.props.autoplay === !1 || a.children.filter((e) => e.type === "carouselItem").length < 2) {
1990
+ t.carouselFrameTimes.delete(o);
1738
1991
  return;
1739
1992
  }
1740
- let s = t.carouselFrameTimes.get(a);
1741
- if (s === void 0) {
1742
- t.carouselFrameTimes.set(a, n);
1993
+ let c = t.carouselFrameTimes.get(o);
1994
+ if (c === void 0) {
1995
+ t.carouselFrameTimes.set(o, n);
1743
1996
  return;
1744
1997
  }
1745
- let c = Math.max(250, p(i.props.interval, 3e3));
1746
- n - s < c || (t.carouselFrameTimes.set(a, n), Tn(e, t, i, p(i.props._activeIndex, 0) + 1));
1998
+ let l = Math.max(250, y(a.props.interval, 3e3));
1999
+ n - c < l || (t.carouselFrameTimes.set(o, n), er(e, t, a, y(a.props._activeIndex, 0) + 1), i = !0);
1747
2000
  });
1748
2001
  for (let e of t.carouselFrameTimes.keys()) r.has(e) || t.carouselFrameTimes.delete(e);
1749
2002
  for (let e of t.carouselTransitions.keys()) r.has(e) || t.carouselTransitions.delete(e);
2003
+ return i;
2004
+ }
2005
+ // tools/angular-build/.stage/react/engine/forms.ts
2006
+ function nr(e) {
2007
+ e.attachedController && m(e.attachedController, e), e.attachedController = void 0;
2008
+ }
2009
+ function rr(e) {
2010
+ e.controller !== void 0 && e.binding && (p(e.controller, e.binding), e.attachedController = e.controller);
2011
+ }
2012
+ var ir = /* @__PURE__ */ new Set([
2013
+ "input",
2014
+ "textarea",
2015
+ "datePicker",
2016
+ "radio",
2017
+ "checkbox",
2018
+ "dropdown",
2019
+ "slider",
2020
+ "switch",
2021
+ "upload"
2022
+ ]);
2023
+ function J(e) {
2024
+ return Array.isArray(e) ? e.slice() : e;
2025
+ }
2026
+ function Y(e) {
2027
+ return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, J(t)]));
2028
+ }
2029
+ function ar(e) {
2030
+ return typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e) || Array.isArray(e) && (e.every((e) => typeof e == "string") || typeof File < "u" && e.every((e) => e instanceof File));
2031
+ }
2032
+ function or(e) {
2033
+ return typeof e == "string" ? e.trim().length === 0 : e === !1 || Array.isArray(e) && !e.length;
2034
+ }
2035
+ function sr(e, t, n) {
2036
+ let r = (i) => {
2037
+ if (i >= t.length) return;
2038
+ let a = t[i], o = or(e);
2039
+ if (a.required && o) return a.message ?? "This field is required.";
2040
+ if (!o && a.minLength !== void 0 && (typeof e == "string" || Array.isArray(e)) && e.length < a.minLength) return a.message ?? `Minimum length is ${a.minLength}.`;
2041
+ if (!o && a.maxLength !== void 0 && (typeof e == "string" || Array.isArray(e)) && e.length > a.maxLength) return a.message ?? `Maximum length is ${a.maxLength}.`;
2042
+ if (!o && a.pattern && typeof e == "string") {
2043
+ let t = a.pattern.lastIndex;
2044
+ a.pattern.lastIndex = 0;
2045
+ let n = a.pattern.test(e);
2046
+ if (a.pattern.lastIndex = t, !n) return a.message ?? "Invalid format.";
2047
+ }
2048
+ let s = a.validator?.(e, n), c = (e) => {
2049
+ if (e !== void 0 && typeof e != "string") throw TypeError("Form validators must return a string or undefined.");
2050
+ return e ? a.message ?? e : r(i + 1);
2051
+ };
2052
+ return s instanceof Promise ? s.then(c) : c(s);
2053
+ };
2054
+ return r(0);
2055
+ }
2056
+ function cr(e) {
2057
+ return `Validation failed: ${e instanceof Error ? e.message : String(e)}`;
2058
+ }
2059
+ function lr(e, t) {
2060
+ let n = {}, r = [], i = (e, t) => {
2061
+ t && Object.defineProperty(n, e.name, {
2062
+ value: t,
2063
+ enumerable: !0,
2064
+ configurable: !0
2065
+ });
2066
+ };
2067
+ for (let n of e) {
2068
+ let e = sr(t[n.name], n.rules, t);
2069
+ e instanceof Promise ? r.push(e.then((e) => i(n, e), (e) => i(n, cr(e)))) : i(n, e);
2070
+ }
2071
+ return r.length ? Promise.all(r).then(() => n) : n;
2072
+ }
2073
+ function ur(e) {
2074
+ let t = e.props, n = e.type === "switch" ? t.checked ?? t.defaultChecked : t.value ?? t.defaultValue;
2075
+ if (n !== void 0) {
2076
+ if (!ar(n)) throw TypeError(`Invalid initial value for <${e.type}> in <FormItem>.`);
2077
+ return J(n);
2078
+ }
2079
+ return e.type === "checkbox" || e.type === "upload" ? [] : e.type === "switch" ? !1 : e.type === "slider" ? typeof t.min == "number" ? t.min : 0 : "";
2080
+ }
2081
+ function dr(e, t) {
2082
+ return e === "checkbox" ? Array.isArray(t) && t.every((e) => typeof e == "string") : e === "upload" ? Array.isArray(t) && (t.length === 0 || typeof File < "u" && t.every((e) => e instanceof File)) : e === "switch" ? typeof t == "boolean" : e === "slider" ? typeof t == "number" : typeof t == "string";
2083
+ }
2084
+ function fr(e, t, n, r) {
2085
+ t.activeFormKeys.add(r);
2086
+ let i = n.props, a = t.forms.get(r);
2087
+ a || (a = {
2088
+ values: {},
2089
+ errors: {},
2090
+ attempted: !1,
2091
+ revision: 0,
2092
+ submission: 0,
2093
+ resetVersion: 0,
2094
+ validationEpoch: 0,
2095
+ fieldValidations: /* @__PURE__ */ new Map()
2096
+ }, t.forms.set(r, a));
2097
+ let o = a, s = [], c = /* @__PURE__ */ new Set(), l = (e) => t.forms.get(r) === o && o.revision === e, u = (e, t, n) => {
2098
+ e instanceof Promise ? e.then((e) => {
2099
+ l(t) && n(e);
2100
+ }) : l(t) && n(e);
2101
+ }, d = (t, n, r, a) => {
2102
+ if (!ar(r) || !dr(n, r)) throw TypeError(`Invalid value for form field "${t}".`);
2103
+ o.values[t] = J(r);
2104
+ let c = ++o.revision;
2105
+ o.attempted && (o.validationEpoch++, u(lr(s, Y(o.values)), c, (t) => {
2106
+ o.errors = t, e.refreshVirtualGrids();
2107
+ })), e.refreshVirtualGrids(), typeof a == "function" && a(r), i.onValuesChange?.(Y(o.values));
2108
+ };
2109
+ function f(t) {
2110
+ if (t.type === "form") throw Error("Nested <Form> components are not supported.");
2111
+ if (t.type === "formItem") {
2112
+ let n = t.props.name;
2113
+ if (typeof n != "string" || !n) throw Error("<FormItem> requires a name.");
2114
+ if (c.has(n)) throw Error(`Duplicate <FormItem> name: ${n}`);
2115
+ c.add(n);
2116
+ let r = t.children.filter((e) => ir.has(e.type));
2117
+ if (r.length !== 1 || t.children.length !== 1) throw Error(`<FormItem name="${n}"> requires exactly one direct form control.`);
2118
+ let a = r[0], l = i.initialValues && Object.hasOwn(i.initialValues, n) ? i.initialValues[n] : ur(a);
2119
+ if (!ar(l) || !dr(a.type, l)) throw TypeError(`Invalid initial value for form field "${n}".`);
2120
+ let f = t.props.rules;
2121
+ if (f !== void 0 && !Array.isArray(f)) throw TypeError("FormItem rules must be an array.");
2122
+ s.push({
2123
+ name: n,
2124
+ kind: a.type,
2125
+ initial: J(l),
2126
+ rules: f ?? []
2127
+ }), Object.hasOwn(o.values, n) && dr(a.type, o.values[n]) || (o.revision++, Object.defineProperty(o.values, n, {
2128
+ value: J(l),
2129
+ writable: !0,
2130
+ enumerable: !0,
2131
+ configurable: !0
2132
+ }), delete o.errors[n]);
2133
+ let p = a.props.onChange, m = (e) => d(n, a.type, e, p), h = a.props.onBlur, g = () => {
2134
+ let t = o.revision, r = o.validationEpoch, i = (o.fieldValidations.get(n) ?? 0) + 1;
2135
+ o.fieldValidations.set(n, i);
2136
+ let a = s.find((e) => e.name === n);
2137
+ a && u(lr([a], Y(o.values)), t, (t) => {
2138
+ o.validationEpoch === r && o.fieldValidations.get(n) === i && (Object.hasOwn(t, n) ? Object.defineProperty(o.errors, n, {
2139
+ value: t[n],
2140
+ writable: !0,
2141
+ enumerable: !0,
2142
+ configurable: !0
2143
+ }) : delete o.errors[n], e.refreshVirtualGrids());
2144
+ }), typeof h == "function" && h();
2145
+ }, _ = {
2146
+ ...a,
2147
+ props: {
2148
+ ...a.props,
2149
+ [a.type === "switch" ? "checked" : "value"]: J(o.values[n]),
2150
+ _formError: Object.hasOwn(o.errors, n) ? o.errors[n] : void 0,
2151
+ _formResetVersion: o.resetVersion,
2152
+ onChange: m,
2153
+ onBlur: g,
2154
+ _formBlur: g
2155
+ }
2156
+ }, v = {
2157
+ type: "text",
2158
+ key: "$form-error",
2159
+ props: {
2160
+ y: typeof t.props.errorY == "number" ? t.props.errorY : (a.type === "upload" ? ct({
2161
+ ...a.props,
2162
+ value: o.values[n]
2163
+ }) : a.type === "radio" || a.type === "checkbox" ? Je(a.props).height : j(a.props, a.type === "switch" ? 24 : a.type === "slider" ? 32 : 36)) + 4,
2164
+ text: Object.hasOwn(o.errors, n) ? o.errors[n] : "",
2165
+ color: t.props.errorColor ?? "#d93025",
2166
+ fontSize: t.props.errorFontSize ?? 12
2167
+ },
2168
+ children: []
2169
+ };
2170
+ return {
2171
+ ...t,
2172
+ props: {
2173
+ ...t.props,
2174
+ _formItemManaged: !0
2175
+ },
2176
+ children: [_, v]
2177
+ };
2178
+ }
2179
+ if (t.type === "button" && (t.props.formAction === "submit" || t.props.formAction === "reset")) {
2180
+ let n = t.props.onClick;
2181
+ return {
2182
+ ...t,
2183
+ props: {
2184
+ ...t.props,
2185
+ onClick: () => {
2186
+ if (t.props.formAction === "reset") o.values = Object.fromEntries(s.map((e) => [e.name, J(e.initial)])), o.errors = {}, o.attempted = !1, o.revision++, o.submission++, o.resetVersion++, o.validationEpoch++, o.fieldValidations.clear(), e.refreshVirtualGrids(), i.onReset?.();
2187
+ else {
2188
+ o.attempted = !0, o.validationEpoch++;
2189
+ let t = Y(o.values), n = o.revision, r = ++o.submission;
2190
+ u(lr(s, t), n, (n) => {
2191
+ o.submission === r && (o.errors = n, e.refreshVirtualGrids(), Object.keys(n).length ? i.onInvalid?.({ ...n }, t) : i.onSubmit?.(t));
2192
+ });
2193
+ }
2194
+ typeof n == "function" && n();
2195
+ }
2196
+ }
2197
+ };
2198
+ }
2199
+ let n = t.children.map(f);
2200
+ return {
2201
+ ...t,
2202
+ props: t.type === "grid" && t.props.virtual === !0 ? {
2203
+ ...t.props,
2204
+ _gridCacheToken: n
2205
+ } : t.props,
2206
+ children: n
2207
+ };
2208
+ }
2209
+ let p = n.children.map(f);
2210
+ for (let e of Object.keys(o.values)) c.has(e) || (o.revision++, delete o.values[e], delete o.errors[e]);
2211
+ return o.controller = i.controller, o.binding = o.controller === void 0 ? void 0 : {
2212
+ owner: o,
2213
+ getValues: () => Y(o.values),
2214
+ getFieldValue: (e) => {
2215
+ if (!Object.hasOwn(o.values, e)) throw Error(`Unknown form field "${e}".`);
2216
+ return J(o.values[e]);
2217
+ },
2218
+ setFieldValue: (e, t) => {
2219
+ let n = s.find((t) => t.name === e);
2220
+ if (!n) throw Error(`Unknown form field "${e}".`);
2221
+ d(e, n.kind, t);
2222
+ }
2223
+ }, p;
1750
2224
  }
1751
2225
  // tools/angular-build/.stage/react/engine/layout.ts
1752
- var Dn = 100;
1753
- function On(e) {
1754
- return ge(e);
2226
+ var pr = 100;
2227
+ function mr(e) {
2228
+ return we(e);
1755
2229
  }
1756
- function kn(e) {
1757
- let t = p(e.props.height, 0);
2230
+ function hr(e) {
2231
+ let t = y(e.props.height, 0);
1758
2232
  if (t > 0) return t;
1759
- let n = Dn;
2233
+ let n = pr;
1760
2234
  for (let t of e.children) {
1761
- let e = t.type === "text" ? On(t.props).height : p(t.props.height, 0);
1762
- n = Math.max(n, p(t.props.y, 0) + e);
2235
+ let e = t.type === "text" ? mr(t.props).height : y(t.props.height, 0);
2236
+ n = Math.max(n, y(t.props.y, 0) + e);
1763
2237
  }
1764
2238
  return n;
1765
2239
  }
1766
- function An(e, t) {
2240
+ function gr(e, t) {
1767
2241
  let n = e[t];
1768
2242
  return Array.isArray(n) ? n.join(",") : typeof n == "string" ? n : "";
1769
2243
  }
1770
- function jn(e, t, n, r) {
2244
+ function _r(e, t, n, r) {
1771
2245
  let i = n.activeKey;
1772
2246
  if (typeof i == "string") return i;
1773
2247
  let a = e.tabSelections.get(t), o = typeof n.defaultActiveKey == "string" ? n.defaultActiveKey : String(r[0]?.props.id ?? ""), s = a ?? o;
1774
2248
  return e.tabSelections.set(t, s), s;
1775
2249
  }
1776
- function Mn(e, t, n) {
2250
+ function vr(e, t, n) {
1777
2251
  if (Array.isArray(n.activeKeys)) {
1778
2252
  let e = n.activeKeys.filter((e) => typeof e == "string");
1779
2253
  return new Set(n.accordion ? e.slice(0, 1) : e);
@@ -1781,27 +2255,29 @@ function Mn(e, t, n) {
1781
2255
  let r = e.collapseSelections.get(t), i = Array.isArray(n.defaultActiveKeys) ? n.defaultActiveKeys.filter((e) => typeof e == "string") : [], a = n.accordion ? i.slice(0, 1) : i, o = r ?? new Set(a);
1782
2256
  return e.collapseSelections.set(t, o), o;
1783
2257
  }
1784
- function Nn(e, t) {
1785
- let n = p(e.props.headerHeight, 40), r = p(e.props.width, 300), i = 0;
2258
+ function yr(e, t) {
2259
+ let n = y(e.props.headerHeight, 40), r = y(e.props.width, 300), i = 0;
1786
2260
  for (let a of e.children) {
1787
2261
  if (a.type !== "collapseItem") continue;
1788
2262
  let e = t.has(String(a.props.id ?? ""));
1789
2263
  a.setProps({
1790
- y: i + p(a.props._userY, 0),
2264
+ y: i + y(a.props._userY, 0),
1791
2265
  _expanded: e,
1792
2266
  _collapseWidth: r,
1793
2267
  _collapseHeaderHeight: n
1794
- }), a.children.forEach((t) => G(t, e)), i += n + (e ? Pn(a) : 0);
2268
+ }), a.children.forEach((t) => W(t, e)), i += n + (e ? br(a) : 0);
1795
2269
  }
1796
2270
  }
1797
- function Pn(e) {
1798
- return p(e.props._collapseBodyHeight, p(e.props.height, Dn));
2271
+ function br(e) {
2272
+ return y(e.props._collapseBodyHeight, y(e.props.height, pr));
1799
2273
  }
1800
- function Fn(e, t, n, r, i, a, o) {
2274
+ function xr(e, t, n, r, i, a, o) {
1801
2275
  return n.map((n, s) => {
1802
- let c = Xt(n, s, a), l = n.props, u = z(r, l), d = i && l.visible !== !1 && (n.type !== "dialog" || l.open === !0), f = { ...l };
2276
+ let c = xn(n, s, a), l = n.props;
2277
+ if (n.type === "formItem" && l._formItemManaged !== !0) throw Error("<FormItem> must be used inside <Form>.");
2278
+ let u = z(n.type === "dialog" ? R : r, l), d = i && l.visible !== !1 && (n.type !== "dialog" || l.open === !0), f = { ...l };
1803
2279
  if (f._userVisible = typeof l._userVisible == "boolean" ? l._userVisible : l.visible !== !1, n.type === "text") {
1804
- let e = On(f);
2280
+ let e = mr(f);
1805
2281
  f._textWidth = e.width, f._textHeight = e.height;
1806
2282
  }
1807
2283
  if (n.type === "input" || n.type === "datePicker" || n.type === "textarea") {
@@ -1810,78 +2286,78 @@ function Fn(e, t, n, r, i, a, o) {
1810
2286
  id: e,
1811
2287
  props: l,
1812
2288
  layout: {
1813
- width: p(l.width, 200),
1814
- height: p(l.height, 36),
2289
+ width: y(l.width, 200),
2290
+ height: y(l.height, 36),
1815
2291
  transform: u,
1816
2292
  visible: d
1817
2293
  }
1818
2294
  });
1819
2295
  }
1820
- let m = n.children;
1821
- if (n.type === "grid") {
2296
+ let p = n.children;
2297
+ if (n.type === "form" && (p = fr(e, t, n, c)), n.type === "grid") {
1822
2298
  let e = c;
1823
2299
  if (l.virtual === !0 && typeof l.height != "number") throw RangeError("Virtual Grid requires a positive finite height.");
1824
2300
  let r = l.virtual === !0 ? t.virtualGridLayouts.get(e) : void 0;
1825
- r && r.token !== l._gridCacheToken && (r = void 0), l.virtual === !0 && t.activeVirtualGridKeys.add(e), l.virtual === !0 && !r && (r = mn(n), t.virtualGridLayouts.set(e, r));
1826
- let i = r ?? gn(n), a = typeof l.height == "number" ? Math.max(0, i.contentHeight - l.height) : 0, o = Math.max(0, Math.min(a, t.gridScrollPositions.get(e) ?? 0));
1827
- t.gridScrollPositions.set(e, o), f._gridStateKey = e, f._gridWidth = i.width, f._gridContentHeight = i.contentHeight, f._scrollTop = o, m = "entries" in i ? hn(i, o, p(l.height, 0), p(l.cellHeight, 0) + p(l.gap, 0)) : i.children.map((e) => ({
2301
+ r && r.token !== l._gridCacheToken && (r = void 0), l.virtual === !0 && t.activeVirtualGridKeys.add(e), l.virtual === !0 && !r && (r = Hn(n), t.virtualGridLayouts.set(e, r));
2302
+ let i = r ?? Wn(n), a = typeof l.height == "number" ? Math.max(0, i.contentHeight - l.height) : 0, o = Math.max(0, Math.min(a, t.gridScrollPositions.get(e) ?? 0));
2303
+ t.gridScrollPositions.set(e, o), f._gridStateKey = e, f._gridWidth = i.width, f._gridContentHeight = i.contentHeight, f._scrollTop = o, p = "entries" in i ? Un(i, o, y(l.height, 0), y(l.cellHeight, 0) + y(l.gap, 0)) : i.children.map((e) => ({
1828
2304
  ...e,
1829
2305
  props: {
1830
2306
  ...e.props,
1831
2307
  _gridBaseY: e.props.y,
1832
- y: p(e.props.y, 0) - o
2308
+ y: y(e.props.y, 0) - o
1833
2309
  }
1834
2310
  }));
1835
2311
  }
1836
2312
  if (n.type === "dialog") {
1837
2313
  f._viewportWidth = e.context.canvas.width / e.pixelRatio, f._viewportHeight = e.context.canvas.height / e.pixelRatio;
1838
- let t = p(l.width, 420), n = p(l.height, 240), r = (p(f._viewportWidth, 0) - t) / 2, i = (p(f._viewportHeight, 0) - n) / 2;
1839
- f._dialogPanelX = r, f._dialogPanelY = i, m = yn(m, r + 24, i + 64);
2314
+ let t = y(l.width, 420), n = y(l.height, 240), r = (y(f._viewportWidth, 0) - t) / 2, i = (y(f._viewportHeight, 0) - n) / 2;
2315
+ f._dialogPanelX = r, f._dialogPanelY = i, p = qn(p, r + 24, i + 64);
1840
2316
  } else if (n.type === "tabs") {
1841
- let e = m.filter((e) => e.type === "tabItem"), n = `${c}:${An(l, "defaultActiveKey")}`, r = jn(t, n, l, e);
2317
+ let e = p.filter((e) => e.type === "tabItem"), n = `${c}:${gr(l, "defaultActiveKey")}`, r = _r(t, n, l, e);
1842
2318
  f._activeKey = r, f._tabItems = e.map((e) => ({
1843
2319
  title: e.props.title,
1844
2320
  disabled: e.props.disabled,
1845
2321
  selected: e.props.id === r
1846
2322
  }));
1847
- let i = p(l.headerHeight, 40);
1848
- m = m.map((e) => ({
2323
+ let i = y(l.headerHeight, 40);
2324
+ p = p.map((e) => ({
1849
2325
  ...e,
1850
2326
  props: {
1851
2327
  ...e.props,
1852
2328
  visible: e.type !== "tabItem" || e.props.visible !== !1 && e.props.id === r,
1853
2329
  _userVisible: e.props._userVisible ?? e.props.visible !== !1
1854
2330
  },
1855
- children: e.type === "tabItem" ? J(yn(e.children, 0, i), e.props.visible !== !1 && e.props.id === r) : e.children
2331
+ children: e.type === "tabItem" ? Jn(qn(e.children, 0, i), e.props.visible !== !1 && e.props.id === r) : e.children
1856
2332
  })), f._stateKey = n;
1857
2333
  } else if (n.type === "carousel") {
1858
- let e = m.filter((e) => e.type === "carouselItem"), n = c, r = l.activeIndex, i = typeof r == "number" && Number.isInteger(r) ? r : t.carouselSelections.get(n) ?? (typeof l.defaultActiveIndex == "number" ? l.defaultActiveIndex : 0), a = i, o = t.carouselTransitions.get(n);
2334
+ let e = p.filter((e) => e.type === "carouselItem"), n = c, r = l.activeIndex, i = typeof r == "number" && Number.isInteger(r) ? r : t.carouselSelections.get(n) ?? (typeof l.defaultActiveIndex == "number" ? l.defaultActiveIndex : 0), a = i, o = t.carouselTransitions.get(n);
1859
2335
  o && r !== void 0 && i !== o.to && (t.carouselTransitions.delete(n), o = void 0);
1860
2336
  let s = e.length ? Math.max(0, Math.min(e.length - 1, a)) : 0;
1861
- o && (o.from >= e.length || o.to >= e.length) && (t.carouselTransitions.delete(n), o = void 0), o && (a = o.to), l.activeIndex === void 0 && t.carouselSelections.set(n, s), f._stateKey = n, f._activeIndex = o ? o.to : s, f._itemCount = e.length, f._transitionProgress = o ? Sn(o, t.currentFrameTime) : 1;
1862
- let u = p(f._transitionProgress, 1), d = u * u * (3 - 2 * u);
1863
- m = m.map((t) => ({
2337
+ o && (o.from >= e.length || o.to >= e.length) && (t.carouselTransitions.delete(n), o = void 0), o && (a = o.to), l.activeIndex === void 0 && t.carouselSelections.set(n, s), f._stateKey = n, f._activeIndex = o ? o.to : s, f._itemCount = e.length, f._transitionProgress = o ? Zn(o, t.currentFrameTime) : 1;
2338
+ let u = y(f._transitionProgress, 1), d = u * u * (3 - 2 * u);
2339
+ p = p.map((t) => ({
1864
2340
  ...t,
1865
2341
  props: {
1866
2342
  ...t.props,
1867
- _carouselBaseX: t.props._carouselBaseX ?? p(t.props.x, 0),
1868
- x: t.type === "carouselItem" ? p(t.props.x, 0) + bn(e.indexOf(t), o, d, p(l.width, 300)) : t.props.x,
2343
+ _carouselBaseX: t.props._carouselBaseX ?? y(t.props.x, 0),
2344
+ x: t.type === "carouselItem" ? y(t.props.x, 0) + Yn(e.indexOf(t), o, d, y(l.width, 300)) : t.props.x,
1869
2345
  visible: t.type !== "carouselItem" || t.props.visible !== !1 && (o ? e.indexOf(t) === o.from || e.indexOf(t) === o.to : e[s] === t),
1870
2346
  _userVisible: t.props._userVisible ?? t.props.visible !== !1
1871
2347
  },
1872
- children: t.type === "carouselItem" ? J(t.children, t.props.visible !== !1 && (o ? e.indexOf(t) === o.from || e.indexOf(t) === o.to : e[s] === t)) : t.children
2348
+ children: t.type === "carouselItem" ? Jn(t.children, t.props.visible !== !1 && (o ? e.indexOf(t) === o.from || e.indexOf(t) === o.to : e[s] === t)) : t.children
1873
2349
  }));
1874
2350
  } else if (n.type === "collapse") {
1875
- let e = `${c}:${An(l, "defaultActiveKeys")}`, n = Mn(t, e, l), r = p(l.headerHeight, 40), i = p(l.width, 300), a = 0;
1876
- m = m.map((e) => {
2351
+ let e = `${c}:${gr(l, "defaultActiveKeys")}`, n = vr(t, e, l), r = y(l.headerHeight, 40), i = y(l.width, 300), a = 0;
2352
+ p = p.map((e) => {
1877
2353
  if (e.type !== "collapseItem") return e;
1878
- let t = n.has(String(e.props.id ?? "")), o = kn(e), s = t ? o : 0, c = {
2354
+ let t = n.has(String(e.props.id ?? "")), o = hr(e), s = t ? o : 0, c = {
1879
2355
  ...e,
1880
2356
  props: {
1881
2357
  ...e.props,
1882
- x: p(e.props.x, 0),
1883
- y: a + p(e.props.y, 0),
1884
- _userY: p(e.props.y, 0),
2358
+ x: y(e.props.x, 0),
2359
+ y: a + y(e.props.y, 0),
2360
+ _userY: y(e.props.y, 0),
1885
2361
  visible: e.props.visible !== !1,
1886
2362
  _userVisible: e.props._userVisible ?? e.props.visible !== !1,
1887
2363
  _expanded: t,
@@ -1892,7 +2368,7 @@ function Fn(e, t, n, r, i, a, o) {
1892
2368
  textColor: e.props.textColor ?? l.textColor,
1893
2369
  borderColor: e.props.borderColor ?? l.borderColor
1894
2370
  },
1895
- children: J(yn(e.children, 0, r), t && e.props.visible !== !1)
2371
+ children: Jn(qn(e.children, 0, r), t && e.props.visible !== !1)
1896
2372
  };
1897
2373
  return a += r + s, c;
1898
2374
  }), f._stateKey = e, f._activeKeys = [...n];
@@ -1900,12 +2376,55 @@ function Fn(e, t, n, r, i, a, o) {
1900
2376
  return {
1901
2377
  ...n,
1902
2378
  props: f,
1903
- children: Fn(e, t, m, u, d, c, o)
2379
+ children: xr(e, t, p, u, d, c, o)
1904
2380
  };
1905
2381
  });
1906
2382
  }
2383
+ // tools/angular-build/.stage/react/engine/uploads.ts
2384
+ function Sr(e) {
2385
+ return Array.isArray(e.props.value) ? e.props.value : [];
2386
+ }
2387
+ function Cr(e, t) {
2388
+ let n = t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
2389
+ if (!n.length) return !0;
2390
+ let r = e.name.toLowerCase(), i = e.type.toLowerCase();
2391
+ return n.some((e) => e.startsWith(".") ? r.endsWith(e) : e.endsWith("/*") ? i.startsWith(e.slice(0, -1)) : i === e);
2392
+ }
2393
+ function wr(e, t, n) {
2394
+ (e.props.value === void 0 || e.props._controlledValue !== !0) && e.setProps({ value: n });
2395
+ let r = e.props.onChange;
2396
+ typeof r == "function" && r([...n]), t.refreshVirtualGrids();
2397
+ }
2398
+ function Tr(e, t) {
2399
+ if (e.props.disabled) return;
2400
+ let n = typeof e.props.accept == "string" ? e.props.accept : "", r = e.props.maxSize;
2401
+ if (r !== void 0 && (typeof r != "number" || !Number.isFinite(r) || r < 0)) throw RangeError("Upload maxSize must be a non-negative finite number of bytes.");
2402
+ t.inputBridge.pickFiles(n || void 0, !!e.props.multiple, (i) => {
2403
+ if (!e.parent || e.props.disabled) return;
2404
+ let a = [], o = [];
2405
+ for (let e of i) Cr(e, n) ? typeof r == "number" && e.size > r ? o.push({
2406
+ file: e,
2407
+ reason: "size"
2408
+ }) : a.push(e) : o.push({
2409
+ file: e,
2410
+ reason: "type"
2411
+ });
2412
+ e.setProps({ _uploadError: o.length ? "Some files have an invalid type or size." : void 0 });
2413
+ let s = e.props.onReject;
2414
+ a.length ? wr(e, t, e.props.multiple ? [...Sr(e), ...a] : [a[0]]) : t.refreshVirtualGrids(), o.length && typeof s == "function" && s(o);
2415
+ });
2416
+ }
2417
+ function Er(e, t, n) {
2418
+ if (e.props.disabled) return;
2419
+ let r = Sr(e);
2420
+ n < 0 || n >= r.length || (e.setProps({ _uploadError: void 0 }), wr(e, t, r.filter((e, t) => t !== n)));
2421
+ }
2422
+ function Dr(e, t, n) {
2423
+ let r = y(e.props.height, 40), i = y(e.props.width, 120), a = Math.floor((n - r) / 28);
2424
+ return t >= i - 24 && t <= i && n >= r && a < Sr(e).length ? a : void 0;
2425
+ }
1907
2426
  // tools/angular-build/.stage/react/engine/hit-test.ts
1908
- function Y(e, t, n, r) {
2427
+ function Or(e, t, n, r) {
1909
2428
  let i = t.getBoundingClientRect();
1910
2429
  return !i.width || !i.height ? null : {
1911
2430
  x: (n - i.left) * t.width / i.width / e.pixelRatio,
@@ -1916,44 +2435,44 @@ function X(e, t, n, r, i) {
1916
2435
  let a = t.getBoundingClientRect();
1917
2436
  if (!a.width || !a.height) return null;
1918
2437
  let o = (n - a.left) * t.width / a.width / e.pixelRatio, s = (r - a.top) * t.height / a.height / e.pixelRatio, c = null, l = (e, t) => {
1919
- let n = z(t, e.props);
2438
+ let n = e.type === "dialog" ? z(R, e.props) : z(t, e.props);
1920
2439
  if (e === i) return c = B(o, s, n), !0;
1921
2440
  for (let t of e.children) if (l(t, n)) return !0;
1922
2441
  return !1;
1923
2442
  };
1924
2443
  return l(e.scene, R), c;
1925
2444
  }
1926
- function Z(e, t, n, r, i) {
2445
+ function kr(e, t, n, r, i) {
1927
2446
  let a = i.parent;
1928
- for (; a;) {
2447
+ for (; a && a.type !== "dialog";) {
1929
2448
  if (a.type === "grid" && typeof a.props.height == "number" || a.type === "carousel") {
1930
- let i = X(e, t, n, r, a), o = a.type === "grid" ? p(a.props._gridWidth, p(a.props.width, 0)) : p(a.props.width, 300), s = p(a.props.height, a.type === "carousel" ? 180 : 0);
2449
+ let i = X(e, t, n, r, a), o = a.type === "grid" ? y(a.props._gridWidth, y(a.props.width, 0)) : y(a.props.width, 300), s = y(a.props.height, a.type === "carousel" ? 180 : 0);
1931
2450
  if (!i || i.x < 0 || i.x > o || i.y < 0 || i.y > s) return !1;
1932
2451
  }
1933
2452
  a = a.parent;
1934
2453
  }
1935
2454
  return !0;
1936
2455
  }
1937
- function Q(e, t, n, r) {
2456
+ function Ar(e, t, n, r) {
1938
2457
  let i = t.getBoundingClientRect();
1939
2458
  if (!i.width || !i.height) return null;
1940
- let a = (n - i.left) * t.width / i.width / e.pixelRatio, o = (r - i.top) * t.height / i.height / e.pixelRatio, s = [], c = (e, t, n) => {
1941
- let r = n && e.props.visible !== !1;
1942
- if (!r) return;
1943
- let i = e.type === "dialog" ? z(R, e.props) : z(t, e.props);
1944
- (sn(e.type) || e.type === "dialog" && e.props.open === !0 || (e.type === "text" || e.type === "image" || e.type === "icon") && typeof e.props.onClick == "function") && s.push({
2459
+ let a = (n - i.left) * t.width / i.width / e.pixelRatio, o = (r - i.top) * t.height / i.height / e.pixelRatio, s = [], c = (e, t, n, r) => {
2460
+ let i = n && e.props.visible !== !1;
2461
+ if (!i || e.type === "dialog" && (r || e.props.open !== !0)) return;
2462
+ let a = e.type === "dialog" ? z(R, e.props) : z(t, e.props);
2463
+ (Mn(e.type) || e.type === "dialog" && e.props.open === !0 || (e.type === "text" || e.type === "image" || e.type === "icon") && typeof e.props.onClick == "function" || e.type === "video" && e.props.controls === !0) && s.push({
1945
2464
  node: e,
1946
- transform: i
1947
- }), e.children.forEach((e) => c(e, i, r));
2465
+ transform: a
2466
+ }), e.children.forEach((t) => c(t, a, i, r || e.type === "dialog"));
1948
2467
  };
1949
- c(e.scene, R, !0);
2468
+ c(e.scene, R, !0, !1);
1950
2469
  let l = [...s].reverse().find((e) => e.node.type === "dialog");
1951
2470
  for (let i = s.length - 1; i >= 0; i--) {
1952
2471
  let c = s[i];
1953
- if (l && c.node !== l.node && !W(c.node, l.node) || c.node.type !== "dropdown" || !c.node.props.open || c.node.props.disabled || !Z(e, t, n, r, c.node)) continue;
2472
+ if (l && c.node !== l.node && !U(c.node, l.node) || c.node.type !== "dropdown" || !c.node.props.open || c.node.props.disabled || !kr(e, t, n, r, c.node)) continue;
1954
2473
  let u = B(a, o, c.transform);
1955
2474
  if (!u) continue;
1956
- let { width: d, height: f } = K(c.node), p = M(c.node.props.options).length * f;
2475
+ let { width: d, height: f } = G(c.node), p = A(c.node.props.options).length * f;
1957
2476
  if (u.x >= 0 && u.x <= d && u.y >= f && u.y <= f + p) return {
1958
2477
  node: c.node,
1959
2478
  x: u.x,
@@ -1962,11 +2481,11 @@ function Q(e, t, n, r) {
1962
2481
  }
1963
2482
  for (let i = s.length - 1; i >= 0; i--) {
1964
2483
  let c = s[i];
1965
- if (l && c.node !== l.node && !W(c.node, l.node) || !Z(e, t, n, r, c.node)) continue;
2484
+ if (l && c.node !== l.node && !U(c.node, l.node) || !kr(e, t, n, r, c.node)) continue;
1966
2485
  let u = B(a, o, c.transform);
1967
2486
  if (!u) continue;
1968
2487
  if (c.node.type === "customDraw") {
1969
- let { width: e, height: t } = K(c.node);
2488
+ let { width: e, height: t } = G(c.node);
1970
2489
  if (u.x < 0 || u.x > e || u.y < 0 || u.y > t) continue;
1971
2490
  let n = c.node.props.hitTest;
1972
2491
  if (typeof n == "function" && !n(u.x, u.y, {
@@ -1981,8 +2500,8 @@ function Q(e, t, n, r) {
1981
2500
  }
1982
2501
  if (c.node.type === "canvasView") {
1983
2502
  let e = c.node.props.source;
1984
- if (!on(e) || !e.width || !e.height) continue;
1985
- let { width: t, height: n } = K(c.node);
2503
+ if (!jn(e) || !e.width || !e.height) continue;
2504
+ let { width: t, height: n } = G(c.node);
1986
2505
  if (u.x < 0 || u.x > t || u.y < 0 || u.y > n) continue;
1987
2506
  if ((c.node.props.fit ?? "contain") === "contain") {
1988
2507
  let r = Math.min(t / e.width, n / e.height), i = e.width * r, a = e.height * r, o = (t - i) / 2, s = (n - a) / 2;
@@ -2000,7 +2519,7 @@ function Q(e, t, n, r) {
2000
2519
  y: u.y
2001
2520
  };
2002
2521
  if (c.node.type === "tabs") {
2003
- let e = p(c.node.props.width, 300), t = p(c.node.props.height, 200);
2522
+ let e = y(c.node.props.width, 300), t = y(c.node.props.height, 200);
2004
2523
  if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2005
2524
  node: c.node,
2006
2525
  x: u.x,
@@ -2009,7 +2528,7 @@ function Q(e, t, n, r) {
2009
2528
  continue;
2010
2529
  }
2011
2530
  if (c.node.type === "carousel") {
2012
- let e = p(c.node.props.width, 300), t = p(c.node.props.height, 180);
2531
+ let e = y(c.node.props.width, 300), t = y(c.node.props.height, 180);
2013
2532
  if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2014
2533
  node: c.node,
2015
2534
  x: u.x,
@@ -2019,7 +2538,7 @@ function Q(e, t, n, r) {
2019
2538
  }
2020
2539
  if (c.node.type === "grid") {
2021
2540
  if (typeof c.node.props.height != "number") continue;
2022
- let e = p(c.node.props._gridWidth, p(c.node.props.width, 0)), t = p(c.node.props.height, 0);
2541
+ let e = y(c.node.props._gridWidth, y(c.node.props.width, 0)), t = y(c.node.props.height, 0);
2023
2542
  if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2024
2543
  node: c.node,
2025
2544
  x: u.x,
@@ -2028,7 +2547,7 @@ function Q(e, t, n, r) {
2028
2547
  continue;
2029
2548
  }
2030
2549
  if (c.node.type === "collapse") {
2031
- let e = p(c.node.props.width, 300), t = c.node.children.reduce((e, t) => e + p(t.props._collapseHeaderHeight, 40) + (t.props._expanded ? p(t.props.height, 100) : 0), 0);
2550
+ let e = y(c.node.props.width, 300), t = c.node.children.reduce((e, t) => e + y(t.props._collapseHeaderHeight, 40) + (t.props._expanded ? y(t.props.height, 100) : 0), 0);
2032
2551
  if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2033
2552
  node: c.node,
2034
2553
  x: u.x,
@@ -2036,8 +2555,8 @@ function Q(e, t, n, r) {
2036
2555
  };
2037
2556
  continue;
2038
2557
  }
2039
- let { width: d, height: f } = K(c.node), m = c.node.type === "dropdown" && c.node.props.open ? M(c.node.props.options).length * f : 0;
2040
- if (u.x >= 0 && u.x <= d && u.y >= 0 && u.y <= f + m) return {
2558
+ let { width: d, height: f } = G(c.node), p = c.node.type === "dropdown" && c.node.props.open ? A(c.node.props.options).length * f : 0;
2559
+ if (u.x >= 0 && u.x <= d && u.y >= 0 && u.y <= f + p) return {
2041
2560
  node: c.node,
2042
2561
  x: u.x,
2043
2562
  y: u.y
@@ -2045,17 +2564,17 @@ function Q(e, t, n, r) {
2045
2564
  }
2046
2565
  return null;
2047
2566
  }
2048
- function In(e, t, n, r) {
2567
+ function jr(e, t, n, r) {
2049
2568
  let i = [], a = [];
2050
2569
  e.scene.traverse((e) => {
2051
2570
  e.type === "dialog" && e.props.open === !0 && H(e) && a.push(e), e.type === "carousel" && H(e) && i.push(e);
2052
2571
  });
2053
2572
  let o = a[a.length - 1];
2054
2573
  for (let a of i.reverse()) {
2055
- if (o && !W(a, o)) continue;
2574
+ if (o && !U(a, o)) continue;
2056
2575
  let i = X(e, t, n, r, a);
2057
2576
  if (!i) continue;
2058
- let s = p(a.props.width, 300), c = p(a.props.height, 180), l = a.children.filter((e) => e.type === "carouselItem").length, u = p(a.props._activeIndex, 0), d = ct(a.props, i.x, i.y, l, u, s, c);
2577
+ let s = y(a.props.width, 300), c = y(a.props.height, 180), l = a.children.filter((e) => e.type === "carouselItem").length, u = y(a.props._activeIndex, 0), d = gt(a.props, i.x, i.y, l, u, s, c);
2059
2578
  if (d !== void 0) return {
2060
2579
  node: a,
2061
2580
  index: d
@@ -2063,29 +2582,29 @@ function In(e, t, n, r) {
2063
2582
  }
2064
2583
  return null;
2065
2584
  }
2066
- function Ln(e, t, n, r) {
2585
+ function Mr(e, t, n, r) {
2067
2586
  let i = [];
2068
2587
  e.scene.traverse((e) => {
2069
2588
  e.type === "grid" && typeof e.props.height == "number" && i.push(e);
2070
2589
  });
2071
2590
  for (let a of i.reverse()) {
2072
- if (!Z(e, t, n, r, a)) continue;
2591
+ if (!kr(e, t, n, r, a)) continue;
2073
2592
  let i = X(e, t, n, r, a);
2074
2593
  if (!i) continue;
2075
- let o = xn(a.props);
2594
+ let o = Xn(a.props);
2076
2595
  if (!(o.maxScroll <= 0 || i.x < o.trackX || i.x > o.width || i.y < o.thumbY || i.y > o.thumbY + o.thumbHeight)) return {
2077
2596
  node: a,
2078
2597
  pointerY: i.y,
2079
- scrollTop: p(a.props._scrollTop, 0)
2598
+ scrollTop: y(a.props._scrollTop, 0)
2080
2599
  };
2081
2600
  }
2082
2601
  return null;
2083
2602
  }
2084
2603
  // tools/angular-build/.stage/react/engine/events.ts
2085
- function Rn(e, t, n, r, i) {
2604
+ function Nr(e, t, n, r, i) {
2086
2605
  e.onEvent?.({
2087
2606
  type: t,
2088
- target: r ? U(r.node) : null,
2607
+ target: r ? An(r.node) : null,
2089
2608
  x: i.x,
2090
2609
  y: i.y,
2091
2610
  localX: r?.x,
@@ -2093,10 +2612,10 @@ function Rn(e, t, n, r, i) {
2093
2612
  pointerId: n.pointerId
2094
2613
  });
2095
2614
  }
2096
- function $(e, t, n, r, i) {
2615
+ function Pr(e, t, n, r, i) {
2097
2616
  let a = t.props.source;
2098
- if (!on(a)) return;
2099
- let { width: o, height: s } = K(t);
2617
+ if (!jn(a)) return;
2618
+ let { width: o, height: s } = G(t);
2100
2619
  if (!o || !s || !a.width || !a.height) return;
2101
2620
  let c = t.props.fit ?? "contain", l = c === "cover" ? Math.max(o / a.width, s / a.height) : c === "fill" ? null : Math.min(o / a.width, s / a.height), u = l === null ? o : a.width * l, d = l === null ? s : a.height * l, f = (o - u) / 2, p = (s - d) / 2, m = l === null ? n * a.width / o : (n - f) / l, h = l === null ? r * a.height / s : (r - p) / l, g = t.props.onPointerEvent;
2102
2621
  typeof g == "function" && g({
@@ -2117,109 +2636,138 @@ function $(e, t, n, r, i) {
2117
2636
  });
2118
2637
  }
2119
2638
  // tools/angular-build/.stage/react/engine/interaction.ts
2120
- function zn(e, t, n) {
2121
- let r = In(e, n.currentTarget, n.clientX, n.clientY), i = Ln(e, n.currentTarget, n.clientX, n.clientY), a = r?.node ?? i?.node, o = a ? X(e, n.currentTarget, n.clientX, n.clientY, a) : null, s = a ? {
2639
+ function Fr(e, t, n) {
2640
+ let r = jr(e, n.currentTarget, n.clientX, n.clientY), i = Mr(e, n.currentTarget, n.clientX, n.clientY), a = r?.node ?? i?.node, o = a ? X(e, n.currentTarget, n.clientX, n.clientY, a) : null, s = a ? {
2122
2641
  node: a,
2123
2642
  x: o?.x ?? 0,
2124
2643
  y: o?.y ?? 0
2125
- } : Q(e, n.currentTarget, n.clientX, n.clientY), c = Y(e, n.currentTarget, n.clientX, n.clientY);
2644
+ } : Ar(e, n.currentTarget, n.clientX, n.clientY), c = Or(e, n.currentTarget, n.clientX, n.clientY);
2126
2645
  if (c && (t.pointerSequences.set(n.pointerId, {
2127
2646
  target: s?.node ?? null,
2128
2647
  x: c.x,
2129
2648
  y: c.y,
2130
2649
  eligible: s?.node.props.disabled !== !0
2131
- }), Rn(e, "pointerdown", n, s, c), s?.node.type === "canvasView" && $("pointerdown", s.node, s.x, s.y, n)), r) {
2132
- Tn(e, t, r.node, r.index), n.currentTarget.setPointerCapture(n.pointerId), n.preventDefault();
2650
+ }), Nr(e, "pointerdown", n, s, c), s?.node.type === "canvasView" && Pr("pointerdown", s.node, s.x, s.y, n)), n.pointerType === "touch") {
2651
+ let e = s?.node.type === "video" && s.node.props.controls === !0 && s.node.props.controlsOnHover === !0 && !s.node.props.disabled ? s.node : null;
2652
+ if (e !== t.hoveredVideo) {
2653
+ if (Rr(t, e), e) {
2654
+ n.preventDefault();
2655
+ return;
2656
+ }
2657
+ } else if (e && !an(Jr(t, e), s?.x ?? 0, s?.y ?? 0)) {
2658
+ Rr(t, null), n.preventDefault();
2659
+ return;
2660
+ }
2661
+ } else t.activeVideo || zr(t, s?.node ?? null);
2662
+ if (r) {
2663
+ er(e, t, r.node, r.index), n.currentTarget.setPointerCapture(n.pointerId), n.preventDefault();
2133
2664
  return;
2134
2665
  }
2135
2666
  if (i) {
2136
2667
  t.activeGridScroll = i, n.currentTarget.setPointerCapture(n.pointerId), n.preventDefault();
2137
2668
  return;
2138
2669
  }
2139
- if (qn(e.scene, s?.node), !s || s.node.props.disabled) return;
2670
+ if (Kr(e.scene, s?.node), !s || s.node.props.disabled) return;
2140
2671
  let { node: l, x: u, y: d } = s;
2141
- if (l.type === "slider") t.activeSlider = l, Jn(l, u);
2142
- else if (l.type === "switch") Fe(l);
2672
+ if (l.type === "slider") t.activeSlider = l, qr(l, u);
2673
+ else if (l.type === "video" && l.props.controls === !0) {
2674
+ let n = an(Jr(t, l), u, d);
2675
+ if (n === "play") Yr(t, l);
2676
+ else if (n === "fullscreen") {
2677
+ let e = t.videoElements.get(l);
2678
+ e && zn(e, l);
2679
+ } else if (n === "track") t.activeVideo = l, Xr(e, t, l, u);
2680
+ else return;
2681
+ } else if (l.type === "switch") Ue(l);
2143
2682
  else if (l.type === "radio") {
2144
- let e = He(l.props, u, d), t = e && !e.disabled ? We(l.props.value, e) : void 0;
2683
+ let e = Xe(l.props, u, d), t = e && !e.disabled ? Ze(l.props.value, e) : void 0;
2145
2684
  if (t === void 0) return;
2146
2685
  l.props._controlledValue !== !0 && l.setProps({ value: t }), l.props.onChange?.(t);
2147
2686
  } else if (l.type === "checkbox") {
2148
- let e = He(l.props, u, d);
2687
+ let e = Xe(l.props, u, d);
2149
2688
  if (!e || e.disabled) return;
2150
- let t = Ge(l.props.value, e);
2689
+ let t = Qe(l.props.value, e);
2151
2690
  l.props._controlledValue !== !0 && l.setProps({ value: t }), l.props.onChange?.(t);
2152
- } else if (l.type === "upload") e.inputBridge.pickFiles(typeof l.props.accept == "string" ? l.props.accept : void 0, !!l.props.multiple, (e) => l.props.onChange?.(e));
2153
- else if (l.type === "button") t.activeButton = l, ft(l, !0);
2691
+ } else if (l.type === "upload") {
2692
+ let t = Dr(l, u, d);
2693
+ t === void 0 ? d <= y(l.props.height, 40) && Tr(l, e) : Er(l, e, t);
2694
+ } else if (l.type === "button") t.activeButton = l, bt(l, !0);
2154
2695
  else if (l.type === "tabs") {
2155
- let n = Ot(l.children.filter((e) => e.type === "tabItem"), u, d, p(l.props.width, 300), p(l.props.headerHeight, 40));
2696
+ let n = It(l.children.filter((e) => e.type === "tabItem"), u, d, y(l.props.width, 300), y(l.props.headerHeight, 40));
2156
2697
  if (n === void 0) return;
2157
- Wn(e, t, l, n);
2698
+ Ur(e, t, l, n);
2158
2699
  } else if (l.type === "collapse") {
2159
- let n = p(l.props.headerHeight, 40), r = [...l.children].reverse().find((e) => {
2160
- let t = p(e.props.y, 0);
2700
+ let n = y(l.props.headerHeight, 40), r = [...l.children].reverse().find((e) => {
2701
+ let t = y(e.props.y, 0);
2161
2702
  return d >= t && d <= t + n;
2162
2703
  });
2163
- if (r && !r.props.disabled && typeof r.props.id == "string") Gn(e, t, l, r);
2704
+ if (r && !r.props.disabled && typeof r.props.id == "string") Wr(e, t, l, r);
2164
2705
  else return;
2165
2706
  } else if (l.type === "dialog") {
2166
- Kn(l, u, d), n.preventDefault();
2707
+ Gr(l, u, d), n.preventDefault();
2167
2708
  return;
2168
2709
  } else if (l.type === "dropdown") {
2169
- let e = p(l.props.height, 36);
2710
+ let e = y(l.props.height, 36);
2170
2711
  if (l.props.open) {
2171
- let t = Math.floor(d / e) - 1, n = Oe(l.props.options, t);
2172
- d >= e && n && !n.disabled ? ke(l, n) : l.setProps({ open: !1 });
2712
+ let t = Math.floor(d / e) - 1, n = Ie(l.props.options, t);
2713
+ d >= e && n && !n.disabled ? Le(l, n) : l.setProps({ open: !1 });
2173
2714
  } else l.setProps({ open: !0 });
2174
2715
  } else if (l.type !== "customDraw" && l.type !== "canvasView" && l.type !== "text" && l.type !== "image" && l.type !== "icon") return;
2175
2716
  n.currentTarget.setPointerCapture(n.pointerId), n.preventDefault();
2176
2717
  }
2177
- function Bn(e, t, n) {
2178
- let r = Q(e, n.currentTarget, n.clientX, n.clientY), i = Y(e, n.currentTarget, n.clientX, n.clientY);
2179
- i && Rn(e, "pointermove", n, r, i);
2718
+ function Ir(e, t, n) {
2719
+ let r = Ar(e, n.currentTarget, n.clientX, n.clientY);
2720
+ n.pointerType !== "touch" && !t.activeVideo && zr(t, r?.node ?? null);
2721
+ let i = Or(e, n.currentTarget, n.clientX, n.clientY);
2722
+ i && Nr(e, "pointermove", n, r, i);
2180
2723
  let a = t.pointerSequences.get(n.pointerId), o = a?.target?.type === "canvasView" ? a.target : r?.node.type === "canvasView" ? r.node : null;
2181
2724
  if (o) {
2182
2725
  let t = o === r?.node ? r : X(e, n.currentTarget, n.clientX, n.clientY, o);
2183
- t && $("pointermove", o, t.x, t.y, n);
2726
+ t && Pr("pointermove", o, t.x, t.y, n);
2184
2727
  }
2185
2728
  if (t.activeGridScroll) {
2186
2729
  let r = t.activeGridScroll, i = X(e, n.currentTarget, n.clientX, n.clientY, r.node);
2187
2730
  if (i) {
2188
- let n = xn(r.node.props), a = n.height - n.thumbHeight;
2189
- a > 0 && Un(e, t, r.node, r.scrollTop + (i.y - r.pointerY) * n.maxScroll / a);
2731
+ let n = Xn(r.node.props), a = n.height - n.thumbHeight;
2732
+ a > 0 && Hr(e, t, r.node, r.scrollTop + (i.y - r.pointerY) * n.maxScroll / a);
2190
2733
  }
2191
2734
  return;
2192
2735
  }
2736
+ if (t.activeVideo) {
2737
+ let r = t.activeVideo, i = X(e, n.currentTarget, n.clientX, n.clientY, r);
2738
+ i && Xr(e, t, r, i.x);
2739
+ return;
2740
+ }
2193
2741
  if (!t.activeSlider) return;
2194
2742
  let s = X(e, n.currentTarget, n.clientX, n.clientY, t.activeSlider);
2195
- s && Jn(t.activeSlider, s.x);
2743
+ s && qr(t.activeSlider, s.x);
2196
2744
  }
2197
- function Vn(e, t, n, r = !1) {
2198
- let i = r ? null : Q(e, n.currentTarget, n.clientX, n.clientY), a = Y(e, n.currentTarget, n.clientX, n.clientY), o = t.pointerSequences.get(n.pointerId);
2745
+ function Lr(e, t, n, r = !1) {
2746
+ let i = r ? null : Ar(e, n.currentTarget, n.clientX, n.clientY), a = Or(e, n.currentTarget, n.clientX, n.clientY), o = t.pointerSequences.get(n.pointerId);
2199
2747
  if (t.pointerSequences.delete(n.pointerId), a) {
2200
- Rn(e, r ? "pointercancel" : "pointerup", n, i, a);
2748
+ Nr(e, r ? "pointercancel" : "pointerup", n, i, a);
2201
2749
  let t = o?.target?.type === "canvasView" ? o.target : i?.node.type === "canvasView" ? i.node : null;
2202
2750
  if (t) {
2203
2751
  let i = X(e, n.currentTarget, n.clientX, n.clientY, t);
2204
- i && $(r ? "pointercancel" : "pointerup", t, i.x, i.y, n);
2752
+ i && Pr(r ? "pointercancel" : "pointerup", t, i.x, i.y, n);
2205
2753
  }
2206
2754
  if (!r && o?.eligible && o.target === (i?.node ?? null) && Math.hypot(a.x - o.x, a.y - o.y) <= 8) {
2207
2755
  if (e.onEvent?.({
2208
2756
  type: "click",
2209
- target: i ? U(i.node) : null,
2757
+ target: i ? An(i.node) : null,
2210
2758
  x: a.x,
2211
2759
  y: a.y,
2212
2760
  localX: i?.x,
2213
2761
  localY: i?.y,
2214
2762
  pointerId: n.pointerId
2215
- }), i?.node.type === "canvasView" && $("click", i.node, i.x, i.y, n), i && i.node.props.disabled !== !0 && (i.node.type === "text" || i.node.type === "image" || i.node.type === "icon")) {
2763
+ }), i?.node.type === "canvasView" && Pr("click", i.node, i.x, i.y, n), i && i.node.props.disabled !== !0 && (i.node.type === "text" || i.node.type === "image" || i.node.type === "icon")) {
2216
2764
  let e = i.node.props.onClick;
2217
2765
  typeof e == "function" && e();
2218
2766
  }
2219
2767
  if (i?.node.type === "customDraw") {
2220
2768
  let e = i.node.props.onClick;
2221
2769
  if (typeof e == "function") {
2222
- let t = K(i.node);
2770
+ let t = G(i.node);
2223
2771
  e({
2224
2772
  x: i.x,
2225
2773
  y: i.y,
@@ -2233,17 +2781,34 @@ function Vn(e, t, n, r = !1) {
2233
2781
  }
2234
2782
  }
2235
2783
  }
2236
- if (t.activeSlider = null, t.activeGridScroll = null, t.activeButton) {
2784
+ if (t.activeVideo) {
2785
+ let n = t.activeVideo;
2786
+ r ? n.setProps({ _videoScrubRatio: void 0 }) : Zr(e, t, n);
2787
+ }
2788
+ if (t.activeSlider = null, t.activeVideo = null, t.activeGridScroll = null, n.pointerType !== "touch") {
2789
+ let e = n.currentTarget.getBoundingClientRect();
2790
+ zr(t, !r && n.clientX >= e.left && n.clientX <= e.left + e.width && n.clientY >= e.top && n.clientY <= e.top + e.height ? i?.node ?? null : null);
2791
+ }
2792
+ if (t.activeButton) {
2237
2793
  let e = t.activeButton;
2238
- ft(e, !1), i?.node === e && pt(e), t.activeButton = null;
2794
+ bt(e, !1), i?.node === e && xt(e), t.activeButton = null;
2239
2795
  }
2240
2796
  n.currentTarget.hasPointerCapture(n.pointerId) && n.currentTarget.releasePointerCapture(n.pointerId);
2241
2797
  }
2242
- function Hn(e, t, n) {
2243
- let r = Q(e, n.currentTarget, n.clientX, n.clientY), i = Y(e, n.currentTarget, n.clientX, n.clientY);
2798
+ function Rr(e, t) {
2799
+ e.hoveredVideo !== t && (e.hoveredVideo?.setProps({ _videoControlsVisible: !1 }), e.hoveredVideo = t, t?.setProps({ _videoControlsVisible: !0 }));
2800
+ }
2801
+ function zr(e, t) {
2802
+ Rr(e, t?.type === "video" && t.props.controls === !0 && t.props.controlsOnHover === !0 && t.props.disabled !== !0 ? t : null);
2803
+ }
2804
+ function Br(e, t) {
2805
+ t !== "touch" && !e.activeVideo && Rr(e, null);
2806
+ }
2807
+ function Vr(e, t, n) {
2808
+ let r = Ar(e, n.currentTarget, n.clientX, n.clientY), i = Or(e, n.currentTarget, n.clientX, n.clientY);
2244
2809
  i && e.onEvent?.({
2245
2810
  type: "wheel",
2246
- target: r ? U(r.node) : null,
2811
+ target: r ? An(r.node) : null,
2247
2812
  x: i.x,
2248
2813
  y: i.y,
2249
2814
  localX: r?.x,
@@ -2253,29 +2818,29 @@ function Hn(e, t, n) {
2253
2818
  let a = r?.node ?? null;
2254
2819
  for (; a && a.type !== "grid";) a = a.parent;
2255
2820
  if (!a || typeof a.props.height != "number") return;
2256
- let o = X(e, n.currentTarget, n.clientX, n.clientY, a), s = p(a.props._gridWidth, p(a.props.width, 0)), c = p(a.props.height, 0), l = p(a.props._gridContentHeight, c);
2821
+ let o = X(e, n.currentTarget, n.clientX, n.clientY, a), s = y(a.props._gridWidth, y(a.props.width, 0)), c = y(a.props.height, 0), l = y(a.props._gridContentHeight, c);
2257
2822
  if (!o || o.x < 0 || o.x > s || o.y < 0 || o.y > c || l <= c) return;
2258
2823
  let u = n.currentTarget.getBoundingClientRect();
2259
2824
  if (!u.height) return;
2260
- let [d, f, m, h] = V(a), g = d * h - f * m;
2261
- if (!g) return;
2262
- let _ = n.deltaY * n.currentTarget.height / u.height / e.pixelRatio, v = p(a.props._scrollTop, 0) + _ * d / g;
2263
- Un(e, t, a, v), n.preventDefault();
2825
+ let [d, f, p, m] = V(a), h = d * m - f * p;
2826
+ if (!h) return;
2827
+ let g = n.deltaY * n.currentTarget.height / u.height / e.pixelRatio, _ = y(a.props._scrollTop, 0) + g * d / h;
2828
+ Hr(e, t, a, _), n.preventDefault();
2264
2829
  }
2265
- function Un(e, t, n, r) {
2266
- let i = Math.max(0, p(n.props._gridContentHeight, 0) - p(n.props.height, 0)), a = Math.max(0, Math.min(i, r));
2830
+ function Hr(e, t, n, r) {
2831
+ let i = Math.max(0, y(n.props._gridContentHeight, 0) - y(n.props.height, 0)), a = Math.max(0, Math.min(i, r));
2267
2832
  if (a === n.props._scrollTop) return !1;
2268
2833
  n.setProps({ _scrollTop: a });
2269
2834
  let o = String(n.props._gridStateKey ?? "");
2270
2835
  if (t.gridScrollPositions.set(o, a), n.props.virtual === !0) return e.refreshVirtualGrids(), n.props.onScroll?.(a), !0;
2271
- for (let e of n.children) e.setProps({ y: p(e.props._gridBaseY, p(e.props.y, 0)) - a });
2272
- for (let e of t.textControls.values()) W(e.node, n) && (e.layout = {
2836
+ for (let e of n.children) e.setProps({ y: y(e.props._gridBaseY, y(e.props.y, 0)) - a });
2837
+ for (let e of t.textControls.values()) U(e.node, n) && (e.layout = {
2273
2838
  ...e.layout,
2274
2839
  transform: V(e.node)
2275
2840
  });
2276
2841
  return q(e, t), n.props.onScroll?.(a), !0;
2277
2842
  }
2278
- function Wn(e, t, n, r) {
2843
+ function Ur(e, t, n, r) {
2279
2844
  let i = String(n.props._stateKey ?? "");
2280
2845
  n.props.activeKey === void 0 && (t.tabSelections.set(i, r), n.setProps({
2281
2846
  _activeKey: r,
@@ -2285,15 +2850,15 @@ function Wn(e, t, n, r) {
2285
2850
  selected: e.props.id === r
2286
2851
  }))
2287
2852
  }), n.children.forEach((e) => {
2288
- e.type === "tabItem" && G(e, e.props.id === r);
2853
+ e.type === "tabItem" && W(e, e.props.id === r);
2289
2854
  }), q(e, t)), n.props.onChange?.(r);
2290
2855
  }
2291
- function Gn(e, t, n, r) {
2292
- let i = String(n.props._stateKey ?? ""), a = new Set(Array.isArray(n.props._activeKeys) ? n.props._activeKeys.filter((e) => typeof e == "string") : Mn(t, i, n.props)), o = String(r.props.id), s = Mt([...a], o, !!n.props.accordion);
2293
- a.clear(), s.forEach((e) => a.add(e)), n.props.activeKeys === void 0 && (t.collapseSelections.set(i, a), n.setProps({ _activeKeys: [...a] }), Nn(n, a), q(e, t)), n.props.onChange?.([...a]);
2856
+ function Wr(e, t, n, r) {
2857
+ let i = String(n.props._stateKey ?? ""), a = new Set(Array.isArray(n.props._activeKeys) ? n.props._activeKeys.filter((e) => typeof e == "string") : vr(t, i, n.props)), o = String(r.props.id), s = Bt([...a], o, !!n.props.accordion);
2858
+ a.clear(), s.forEach((e) => a.add(e)), n.props.activeKeys === void 0 && (t.collapseSelections.set(i, a), n.setProps({ _activeKeys: [...a] }), yr(n, a), q(e, t)), n.props.onChange?.([...a]);
2294
2859
  }
2295
- function Kn(e, t, n) {
2296
- let r = p(e.props.width, 420), i = p(e.props.height, 240), a = p(e.props._dialogPanelX, 0), o = p(e.props._dialogPanelY, 0), s = t, c = n, l = s >= a && s <= a + r && c >= o && c <= o + i;
2860
+ function Gr(e, t, n) {
2861
+ let r = y(e.props.width, 420), i = y(e.props.height, 240), a = y(e.props._dialogPanelX, 0), o = y(e.props._dialogPanelY, 0), s = t, c = n, l = s >= a && s <= a + r && c >= o && c <= o + i;
2297
2862
  if (!l && e.props.closeOnBackdrop !== !1) {
2298
2863
  e.props.onCancel?.();
2299
2864
  return;
@@ -2301,22 +2866,249 @@ function Kn(e, t, n) {
2301
2866
  let u = o + i - 44;
2302
2867
  !l || c < u || c > u + 32 || (s >= a + r - 104 && s <= a + r - 24 ? e.props.onConfirm?.() : s >= a + r - 196 && s <= a + r - 116 && e.props.onCancel?.());
2303
2868
  }
2304
- function qn(e, t) {
2869
+ function Kr(e, t) {
2305
2870
  e.traverse((e) => {
2306
2871
  e !== t && e.type === "dropdown" && e.props.open && e.setProps({ open: !1 });
2307
2872
  });
2308
2873
  }
2309
- function Jn(e, t) {
2310
- let { width: n } = K(e), r = Me(e.props, n, t);
2874
+ function qr(e, t) {
2875
+ let { width: n } = G(e), r = Be(e.props, n, t);
2311
2876
  r !== void 0 && e.props.value !== r && (e.setProps({ value: r }), e.props.onChange?.(r));
2312
2877
  }
2878
+ function Jr(e, t) {
2879
+ let { width: n, height: r } = G(t), i = e.videoElements.get(t)?.video, a = typeof t.props._videoScrubRatio == "number" ? t.props._videoScrubRatio : null;
2880
+ return rn(n, r, O(`${F(a === null ? i?.currentTime ?? 0 : (i?.duration ?? 0) * a)} / ${F(i?.duration ?? 0)}`, en));
2881
+ }
2882
+ function Yr(e, t) {
2883
+ let n = e.videoElements.get(t);
2884
+ n && (sn(n.video, t.props.onPausedChange), t.setProps({ paused: n.video.paused }));
2885
+ }
2886
+ function Xr(e, t, n, r) {
2887
+ let i = on(Jr(t, n), r);
2888
+ n.setProps({ _videoScrubRatio: i }), e.scene.markDirty();
2889
+ }
2890
+ function Zr(e, t, n) {
2891
+ let r = n.props._videoScrubRatio;
2892
+ if (typeof r != "number") return;
2893
+ n.setProps({
2894
+ _videoScrubRatio: void 0,
2895
+ currentTime: void 0
2896
+ });
2897
+ let i = t.videoElements.get(n);
2898
+ i && (cn(i.video, r, n.props.onSeek, () => {
2899
+ i.captureFrame(), n.props._videoFrame = i.frame;
2900
+ }), e.scene.markDirty());
2901
+ }
2902
+ // tools/angular-build/.stage/react/engine/accessibility.ts
2903
+ var Qr = /* @__PURE__ */ new WeakMap(), $r = 0;
2904
+ function ei(e) {
2905
+ let t = Qr.get(e);
2906
+ return t || (t = `canvas-control-${++$r}`, Qr.set(e, t)), t;
2907
+ }
2908
+ function Z(e, t) {
2909
+ return typeof e.props.ariaLabel == "string" && e.props.ariaLabel.trim() ? e.props.ariaLabel : t;
2910
+ }
2911
+ function Q(e) {
2912
+ return typeof e.props._formError == "string" && e.props._formError ? e.props._formError : void 0;
2913
+ }
2914
+ function $(e, t) {
2915
+ return K(e, {
2916
+ ...G(e),
2917
+ transform: V(e),
2918
+ visible: !0
2919
+ }, t);
2920
+ }
2921
+ function ti(e, t) {
2922
+ let n = e.scene, r = kn(n), i = [], a = [], o = (e) => {
2923
+ e.layout.visible && (i.push(e), a.push(e.id));
2924
+ }, s = (e) => () => {
2925
+ e(), t();
2926
+ };
2927
+ if (n.traverse((n) => {
2928
+ if (!H(n)) return;
2929
+ let i = ei(n);
2930
+ if (n.type === "input" || n.type === "textarea" || n.type === "datePicker") {
2931
+ let e = n.props._canvasInputId;
2932
+ typeof e == "string" && $(n, r).visible && a.push(e);
2933
+ return;
2934
+ }
2935
+ let c = n.props.disabled === !0, l = typeof n.props._formBlur == "function" ? () => {
2936
+ let e = n.props._formBlur;
2937
+ typeof e == "function" && e();
2938
+ } : void 0;
2939
+ if (n.type === "button") o({
2940
+ id: i,
2941
+ kind: "button",
2942
+ label: Z(n, String(n.props.text || "Button")),
2943
+ layout: $(n, r),
2944
+ disabled: c,
2945
+ activate: s(() => xt(n))
2946
+ });
2947
+ else if (n.type === "upload") {
2948
+ let t = y(n.props.width, 120), a = y(n.props.height, 40), u = V(n);
2949
+ o({
2950
+ id: i,
2951
+ kind: "button",
2952
+ label: Z(n, String(n.props.text || "Choose File")),
2953
+ layout: K(n, {
2954
+ width: t,
2955
+ height: a,
2956
+ transform: u,
2957
+ visible: !0
2958
+ }, r),
2959
+ disabled: c,
2960
+ error: Q(n) ?? (typeof n.props._uploadError == "string" ? n.props._uploadError : void 0),
2961
+ blur: l,
2962
+ activate: s(() => Tr(n, e))
2963
+ }), (Array.isArray(n.props.value) ? n.props.value : []).forEach((l, d) => o({
2964
+ id: `${i}:remove:${d}`,
2965
+ kind: "button",
2966
+ label: `Remove ${l.name}`,
2967
+ layout: K(n, {
2968
+ width: 24,
2969
+ height: 28,
2970
+ transform: z(u, {
2971
+ x: t - 24,
2972
+ y: a + d * 28
2973
+ }),
2974
+ visible: !0
2975
+ }, r),
2976
+ disabled: c,
2977
+ activate: s(() => Er(n, e, d))
2978
+ }));
2979
+ } else if (n.type === "switch") o({
2980
+ id: i,
2981
+ kind: "switch",
2982
+ label: Z(n, "Switch"),
2983
+ layout: $(n, r),
2984
+ disabled: c,
2985
+ checked: !!n.props.checked,
2986
+ error: Q(n),
2987
+ blur: l,
2988
+ activate: s(() => {
2989
+ n.props.disabled || Ue(n);
2990
+ })
2991
+ });
2992
+ else if (n.type === "radio" || n.type === "checkbox") {
2993
+ let e = M(n.props.options), t = n.props.direction !== "vertical", a = y(n.props.gap, 12), u = y(n.props.fontSize, 14), d = y(n.props.optionHeight, 28), f = G(n), p = 0, m = /* @__PURE__ */ new Map();
2994
+ e.forEach((e) => {
2995
+ let h = m.get(e.value) ?? 0;
2996
+ m.set(e.value, h + 1);
2997
+ let g = t ? N(e.label, u) : f.width, _ = K(n, {
2998
+ width: g,
2999
+ height: t ? f.height : d,
3000
+ transform: z(V(n), t ? { x: p } : { y: p }),
3001
+ visible: !0
3002
+ }, r), v = n.props.value;
3003
+ o({
3004
+ id: `${i}:${JSON.stringify(e.value)}:${h}`,
3005
+ kind: n.type === "radio" ? "radio" : "checkbox",
3006
+ label: Z(n, "") ? `${Z(n, "")}: ${e.label}` : e.label,
3007
+ layout: _,
3008
+ disabled: c || e.disabled === !0,
3009
+ checked: Array.isArray(v) ? v.includes(e.value) : v === e.value,
3010
+ group: i,
3011
+ error: Q(n),
3012
+ blur: l,
3013
+ activate: s(() => {
3014
+ if (n.props.disabled || e.disabled) return;
3015
+ let t = n.type === "radio" ? Ze(n.props.value, e) : Qe(n.props.value, e);
3016
+ if (t === void 0) return;
3017
+ n.props._controlledValue !== !0 && n.setProps({ value: t });
3018
+ let r = n.props.onChange;
3019
+ typeof r == "function" && r(t);
3020
+ })
3021
+ }), p += (t ? g : d) + a;
3022
+ });
3023
+ } else if (n.type === "slider") {
3024
+ let e = y(n.props.min, 0), a = y(n.props.max, 100);
3025
+ o({
3026
+ id: i,
3027
+ kind: "slider",
3028
+ label: Z(n, "Slider"),
3029
+ layout: $(n, r),
3030
+ disabled: c || a <= e,
3031
+ min: e,
3032
+ max: a,
3033
+ step: Math.max(2 ** -52, y(n.props.step, 1)),
3034
+ value: y(n.props.value, e),
3035
+ error: Q(n),
3036
+ blur: l,
3037
+ change: (e) => {
3038
+ let r = Number(e);
3039
+ if (!Number.isFinite(r) || n.props.disabled || n.props.value === r) return;
3040
+ n.setProps({ value: r });
3041
+ let i = n.props.onChange;
3042
+ typeof i == "function" && i(r), t();
3043
+ }
3044
+ });
3045
+ } else n.type === "dropdown" && o({
3046
+ id: i,
3047
+ kind: "select",
3048
+ label: Z(n, String(n.props.placeholder || "Select")),
3049
+ layout: $(n, r),
3050
+ disabled: c,
3051
+ value: String(n.props.value ?? ""),
3052
+ options: A(n.props.options),
3053
+ error: Q(n),
3054
+ blur: l,
3055
+ change: (e) => {
3056
+ if (n.props.disabled) return;
3057
+ let r = A(n.props.options).find((t) => t.value === e);
3058
+ r && !r.disabled && (Le(n, r), t());
3059
+ }
3060
+ });
3061
+ }), r) {
3062
+ let e = y(r.props.width, 420), t = y(r.props.height, 240), n = y(r.props._dialogPanelX, 0), i = y(r.props._dialogPanelY, 0), a = V(r);
3063
+ for (let [c, l, u] of [[
3064
+ "cancel",
3065
+ 196,
3066
+ "Cancel"
3067
+ ], [
3068
+ "confirm",
3069
+ 104,
3070
+ "OK"
3071
+ ]]) o({
3072
+ id: `${ei(r)}-${c}`,
3073
+ kind: "button",
3074
+ label: String(r.props[c === "cancel" ? "cancelText" : "confirmText"] ?? u),
3075
+ layout: {
3076
+ width: 80,
3077
+ height: 32,
3078
+ visible: !0,
3079
+ transform: z(a, {
3080
+ x: n + e - l,
3081
+ y: i + t - 44
3082
+ })
3083
+ },
3084
+ disabled: r.props.disabled === !0,
3085
+ activate: s(() => {
3086
+ let e = r.props[c === "cancel" ? "onCancel" : "onConfirm"];
3087
+ typeof e == "function" && e();
3088
+ })
3089
+ });
3090
+ }
3091
+ return {
3092
+ controls: i,
3093
+ order: a,
3094
+ dialog: r ? {
3095
+ id: ei(r),
3096
+ label: Z(r, String(r.props.title ?? "Dialog")),
3097
+ cancel: () => {
3098
+ let e = r.props.onCancel;
3099
+ typeof e == "function" && e(), t();
3100
+ }
3101
+ } : void 0
3102
+ };
3103
+ }
2313
3104
  // tools/angular-build/.stage/react/engine/state.ts
2314
- var Yn = class {
3105
+ var ni = class {
2315
3106
  textControls = /* @__PURE__ */ new Map();
2316
3107
  inputValues = /* @__PURE__ */ new Map();
2317
3108
  imageSubscriptions = /* @__PURE__ */ new Map();
2318
- videoSubscriptions = /* @__PURE__ */ new Map();
3109
+ videoElements = /* @__PURE__ */ new Map();
2319
3110
  videoFrames = /* @__PURE__ */ new Map();
3111
+ videoNodes = [];
2320
3112
  tabSelections = /* @__PURE__ */ new Map();
2321
3113
  carouselSelections = /* @__PURE__ */ new Map();
2322
3114
  carouselFrameTimes = /* @__PURE__ */ new Map();
@@ -2325,15 +3117,19 @@ var Yn = class {
2325
3117
  gridScrollPositions = /* @__PURE__ */ new Map();
2326
3118
  virtualGridLayouts = /* @__PURE__ */ new Map();
2327
3119
  activeVirtualGridKeys = /* @__PURE__ */ new Set();
3120
+ forms = /* @__PURE__ */ new Map();
3121
+ activeFormKeys = /* @__PURE__ */ new Set();
2328
3122
  pointerSequences = /* @__PURE__ */ new Map();
2329
3123
  activeSlider = null;
2330
3124
  activeButton = null;
2331
3125
  activeGridScroll = null;
3126
+ activeVideo = null;
3127
+ hoveredVideo = null;
2332
3128
  currentFrameTime = 0;
2333
- }, Xn = class {
2334
- scene = new Yt("root");
2335
- renderer = new en();
2336
- state = new Yn();
3129
+ }, ri = class {
3130
+ scene = new bn("root");
3131
+ renderer = new Tn();
3132
+ state = new ni();
2337
3133
  context;
2338
3134
  core;
2339
3135
  animationFrame = null;
@@ -2359,14 +3155,24 @@ var Yn = class {
2359
3155
  }
2360
3156
  reconcile() {
2361
3157
  let e = [];
2362
- this.state.activeVirtualGridKeys.clear();
2363
- let t = Fn(this.core, this.state, this.tree, R, !0, "root", e);
3158
+ this.state.activeVirtualGridKeys.clear(), this.state.activeFormKeys.clear();
3159
+ let t = xr(this.core, this.state, this.tree, R, !0, "root", e);
2364
3160
  for (let e of this.state.virtualGridLayouts.keys()) this.state.activeVirtualGridKeys.has(e) || this.state.virtualGridLayouts.delete(e);
2365
- this.scene.syncChildren(t, (e) => un(this.state, e)), this.core.inputBridge.setOverlayVisible(!an(this.scene, !0)), ln(this.core, this.state, e), dn(this.core, this.state, t), fn(this.core, this.state);
3161
+ for (let e of this.state.forms.keys()) if (!this.state.activeFormKeys.has(e)) {
3162
+ let t = this.state.forms.get(e);
3163
+ t && nr(t), this.state.forms.delete(e);
3164
+ }
3165
+ for (let e of this.state.forms.values()) e.attachedController !== e.controller && nr(e);
3166
+ this.state.forms.forEach(rr), this.scene.syncChildren(t, (e) => Ln(this.state, e));
3167
+ let n = kn(this.scene);
3168
+ this.core.inputBridge.prepareAccessibility?.(n ? ei(n) : void 0), In(this.core, this.state, e), Rn(this.core, this.state, t), Bn(this.core, this.state), this.syncAccessibility();
2366
3169
  }
2367
3170
  render() {
2368
3171
  this.renderer.render(this.context, this.scene);
2369
3172
  }
3173
+ syncAccessibility() {
3174
+ this.core.inputBridge.syncAccessibility?.(ti(this.core, () => this.syncAccessibility()));
3175
+ }
2370
3176
  requestRender() {
2371
3177
  this.renderer.invalidateGridCache(), this.scene.markDirty();
2372
3178
  }
@@ -2379,7 +3185,7 @@ var Yn = class {
2379
3185
  let e = this.context.canvas.ownerDocument.defaultView?.MutationObserver;
2380
3186
  if (e) {
2381
3187
  this.themeObserver = new e(() => {
2382
- ce(), this.renderer.invalidateGridCache(), this.scene.markDirty();
3188
+ ge(), this.renderer.invalidateGridCache(), this.scene.markDirty();
2383
3189
  });
2384
3190
  let t = this.context.canvas;
2385
3191
  for (; t;) this.themeObserver.observe(t, {
@@ -2388,30 +3194,32 @@ var Yn = class {
2388
3194
  }), t = t.parentElement;
2389
3195
  }
2390
3196
  let t = (e) => {
2391
- this.running && (En(this.core, this.state, e), pn(this.core, this.state), this.scene.dirty && this.render(), this.core.onFrame?.(e), this.running && (this.animationFrame = requestAnimationFrame(t)));
3197
+ this.running && (tr(this.core, this.state, e) && this.syncAccessibility(), Vn(this.core, this.state), this.scene.dirty && this.render(), this.core.onFrame?.(e), this.running && (this.animationFrame = requestAnimationFrame(t)));
2392
3198
  };
2393
3199
  this.animationFrame = requestAnimationFrame(t);
2394
3200
  }
2395
3201
  pointerDown(e) {
2396
- zn(this.core, this.state, e);
3202
+ Fr(this.core, this.state, e), this.syncAccessibility();
2397
3203
  }
2398
3204
  pointerMove(e) {
2399
- Bn(this.core, this.state, e);
3205
+ Ir(this.core, this.state, e), (this.state.activeSlider || this.state.activeGridScroll) && this.syncAccessibility();
3206
+ }
3207
+ pointerLeave(e) {
3208
+ Br(this.state, e);
2400
3209
  }
2401
3210
  pointerUp(e, t = !1) {
2402
- Vn(this.core, this.state, e, t);
3211
+ Lr(this.core, this.state, e, t), this.syncAccessibility();
2403
3212
  }
2404
3213
  wheel(e) {
2405
- Hn(this.core, this.state, e);
3214
+ Vr(this.core, this.state, e), this.syncAccessibility();
2406
3215
  }
2407
3216
  destroy() {
2408
3217
  this.running = !1, this.animationFrame !== null && cancelAnimationFrame(this.animationFrame), this.animationFrame = null, this.themeObserver?.disconnect(), this.themeObserver = null;
2409
3218
  for (let e of this.state.textControls.values()) e.dispose();
2410
- this.state.textControls.clear(), this.state.inputValues.clear(), this.state.imageSubscriptions.forEach((e) => e()), this.state.imageSubscriptions.clear(), this.state.videoSubscriptions.forEach((e) => e()), this.state.videoSubscriptions.clear(), this.state.videoFrames.clear(), this.state.tabSelections.clear(), this.state.carouselSelections.clear(), this.state.carouselFrameTimes.clear(), this.state.carouselTransitions.clear(), this.state.collapseSelections.clear(), this.state.gridScrollPositions.clear(), this.state.virtualGridLayouts.clear(), this.state.activeVirtualGridKeys.clear(), this.tree = [], this.state.pointerSequences.clear(), this.state.activeSlider = null, this.state.activeButton = null, this.state.activeGridScroll = null, this.core.inputBridge.destroy();
3219
+ this.state.textControls.clear(), this.state.inputValues.clear(), this.state.imageSubscriptions.forEach((e) => e()), this.state.imageSubscriptions.clear(), this.state.videoElements.forEach((e) => e.dispose()), this.state.videoElements.clear(), this.state.videoFrames.clear(), this.state.videoNodes.length = 0, this.state.tabSelections.clear(), this.state.carouselSelections.clear(), this.state.carouselFrameTimes.clear(), this.state.carouselTransitions.clear(), this.state.collapseSelections.clear(), this.state.gridScrollPositions.clear(), this.state.virtualGridLayouts.clear(), this.state.activeVirtualGridKeys.clear(), this.state.forms.forEach(nr), this.state.forms.clear(), this.tree = [], this.state.pointerSequences.clear(), this.state.activeSlider = null, this.state.activeButton = null, this.state.activeGridScroll = null, this.state.activeVideo = null, this.state.hoveredVideo = null, this.core.inputBridge.destroy();
2411
3220
  }
2412
- };
2413
- // tools/angular-build/.stage/react/input-bridge.ts
2414
- function Zn(e, t) {
3221
+ }, ii = 0;
3222
+ function ai(e, t) {
2415
3223
  let n = "padding" in e && typeof e.padding == "number" ? e.padding : 8, r = typeof e.fontSize == "number" ? e.fontSize : 14;
2416
3224
  return {
2417
3225
  fontFamily: ("fontFamily" in e && typeof e.fontFamily == "string" ? e.fontFamily : "") || "sans-serif",
@@ -2430,20 +3238,27 @@ function Zn(e, t) {
2430
3238
  } : {}
2431
3239
  };
2432
3240
  }
2433
- var Qn = class {
3241
+ var oi = class {
2434
3242
  mounted = /* @__PURE__ */ new Map();
3243
+ accessible = /* @__PURE__ */ new Map();
3244
+ errors = /* @__PURE__ */ new Map();
2435
3245
  fileInputs = /* @__PURE__ */ new Set();
2436
3246
  originalDisplay;
2437
3247
  overlayHidden = !1;
2438
3248
  selectionTracked = 0;
2439
3249
  overlay;
3250
+ dialogElement = null;
3251
+ dialogId;
3252
+ returnFocus = null;
3253
+ returnFocusId;
3254
+ dialogCancel;
2440
3255
  constructor(e) {
2441
3256
  this.overlay = e, this.originalDisplay = e.style.display;
2442
3257
  }
2443
3258
  mount(e, t, n, r) {
2444
3259
  this.unmount(e);
2445
3260
  let i = document.createElement(e.startsWith("textarea:") ? "textarea" : "input");
2446
- return i.setAttribute("aria-label", t.placeholder || "Canvas input"), i instanceof HTMLInputElement && (i.autocomplete = "off"), Object.assign(i.style, {
3261
+ return i instanceof HTMLInputElement && (i.autocomplete = "off"), Object.assign(i.style, {
2447
3262
  position: "absolute",
2448
3263
  left: "0",
2449
3264
  top: "0",
@@ -2467,19 +3282,24 @@ var Qn = class {
2467
3282
  let r = this.mounted.get(e);
2468
3283
  if (!r) return;
2469
3284
  let { element: i } = r, a = t.value ?? t.defaultValue ?? "";
2470
- i instanceof HTMLInputElement && (i.type = e.startsWith("datePicker:") ? "date" : "type" in t ? t.type ?? "text" : "text"), i.placeholder = t.placeholder ?? "", i.disabled = t.disabled ?? !1;
2471
- let o = "maxLength" in t ? t.maxLength : void 0;
2472
- typeof o == "number" && Number.isInteger(o) && o >= 0 ? i.maxLength = o : i.removeAttribute("maxLength"), i.value !== a && (i.value = a);
2473
- let s = i instanceof HTMLTextAreaElement;
2474
- Object.assign(i.style, {
3285
+ i instanceof HTMLInputElement && (i.type = e.startsWith("datePicker:") ? "date" : "type" in t ? t.type ?? "text" : "text"), i.placeholder = t.placeholder ?? "", i.setAttribute("aria-label", t.ariaLabel || t.placeholder || "Canvas input");
3286
+ let o = "_formError" in t && typeof t._formError == "string" ? t._formError : void 0;
3287
+ this.setError(e, i, o);
3288
+ let s = this.errors.get(e);
3289
+ s && (s.hidden = !n.visible), i.disabled = t.disabled ?? !1;
3290
+ let c = "maxLength" in t ? t.maxLength : void 0;
3291
+ typeof c == "number" && Number.isInteger(c) && c >= 0 ? i.maxLength = c : i.removeAttribute("maxLength"), i.value !== a && (i.value = a);
3292
+ let l = i instanceof HTMLTextAreaElement;
3293
+ !n.visible && i === this.overlay.ownerDocument.activeElement && i.blur(), Object.assign(i.style, {
2475
3294
  display: n.visible ? "block" : "none",
2476
3295
  width: `${n.width}px`,
2477
3296
  height: `${n.height}px`,
2478
3297
  transform: `matrix(${n.transform.join(",")})`,
3298
+ clipPath: n.clipPath ?? "",
2479
3299
  resize: "none",
2480
- whiteSpace: s ? "pre-wrap" : "normal",
2481
- ...Zn(t, s)
2482
- }), s && (i.wrap = "soft", r.events.scroll(i.scrollTop, i.scrollHeight, i.clientHeight, i.clientWidth));
3300
+ whiteSpace: l ? "pre-wrap" : "normal",
3301
+ ...ai(t, l)
3302
+ }), l && (i.wrap = "soft", r.events.scroll(i.scrollTop, i.scrollHeight, i.clientHeight, i.clientWidth));
2483
3303
  }
2484
3304
  pickFiles(e, t, n) {
2485
3305
  let r = document.createElement("input");
@@ -2511,16 +3331,173 @@ var Qn = class {
2511
3331
  let t = this.overlay.ownerDocument.activeElement;
2512
3332
  t instanceof HTMLElement && this.overlay.contains(t) && t.blur(), this.overlay.style.display = "none", this.overlayHidden = !0;
2513
3333
  }
3334
+ prepareAccessibility(e) {
3335
+ if (!this.dialogId && e) {
3336
+ let e = this.overlay.ownerDocument.activeElement;
3337
+ this.returnFocus = e instanceof HTMLElement ? e : null, this.returnFocusId = [...this.accessible.entries()].find(([, t]) => t.element === e)?.[0];
3338
+ }
3339
+ }
3340
+ syncAccessibility(e) {
3341
+ let t = this.dialogId, n = e.dialog?.id;
3342
+ if (n && !this.dialogElement) {
3343
+ let e = this.overlay.ownerDocument.createElement("div");
3344
+ e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.tabIndex = -1, Object.assign(e.style, {
3345
+ position: "absolute",
3346
+ inset: "0",
3347
+ pointerEvents: "none"
3348
+ }), e.addEventListener("keydown", this.handleDialogKey), this.overlay.appendChild(e), this.dialogElement = e;
3349
+ }
3350
+ this.dialogElement && e.dialog && (this.dialogElement.setAttribute("aria-label", e.dialog.label), this.dialogCancel = e.dialog.cancel);
3351
+ let r = new Set(e.controls.map((e) => e.id)), i = this.overlay.ownerDocument.activeElement, a = [...this.accessible].find(([e, t]) => e.includes(":remove:") && !r.has(e) && t.element === i)?.[0].split(":remove:")[0];
3352
+ for (let [e, t] of this.accessible) r.has(e) || (t.element.remove(), t.ring.remove(), this.removeError(e), this.accessible.delete(e));
3353
+ for (let t of e.controls) this.updateAccessible(t);
3354
+ let o = n ? this.dialogElement : this.overlay;
3355
+ if (!o) return;
3356
+ if (!n && this.dialogElement) {
3357
+ for (let e of this.mounted.values()) this.dialogElement.contains(e.element) && this.overlay.appendChild(e.element);
3358
+ for (let e of this.accessible.values()) this.dialogElement.contains(e.element) && this.overlay.appendChild(e.element);
3359
+ }
3360
+ let s = e.order.flatMap((e) => {
3361
+ let t = this.mounted.get(e)?.element ?? this.accessible.get(e)?.element;
3362
+ return t ? [t] : [];
3363
+ }), c = new Set(s), l = null;
3364
+ for (let e of [...s].reverse()) {
3365
+ let t = e.nextElementSibling;
3366
+ for (; t && !c.has(t);) t = t.nextElementSibling;
3367
+ (e.parentElement !== o || t !== l) && o.insertBefore(e, l), l = e;
3368
+ }
3369
+ let u = new Set(e.order);
3370
+ for (let [e, t] of this.errors) {
3371
+ let r = n && u.has(e) ? o : this.overlay;
3372
+ t.parentElement !== r && r.appendChild(t);
3373
+ }
3374
+ if (!n && this.dialogElement && (this.dialogElement.removeEventListener("keydown", this.handleDialogKey), this.dialogElement.remove(), this.dialogElement = null, this.dialogCancel = void 0), this.dialogId = n, n && n !== t) (this.dialogFocusable()[0] ?? this.dialogElement)?.focus();
3375
+ else if (t && !n) {
3376
+ let e = this.returnFocusId ? this.accessible.get(this.returnFocusId)?.element : this.returnFocus;
3377
+ e?.isConnected && e.focus(), this.returnFocus = null, this.returnFocusId = void 0;
3378
+ } else a && this.accessible.get(a)?.element.focus();
3379
+ }
3380
+ updateAccessible(e) {
3381
+ let t = this.accessible.get(e.id);
3382
+ if (t && t.control.kind !== e.kind && (t.element.remove(), t.ring.remove(), this.removeError(e.id), this.accessible.delete(e.id), t = void 0), !t) {
3383
+ let n = this.overlay.ownerDocument, r = e.kind === "button" || e.kind === "switch" ? n.createElement("button") : e.kind === "select" ? n.createElement("select") : n.createElement("input");
3384
+ r instanceof HTMLButtonElement && (r.type = "button"), r instanceof HTMLInputElement && (r.type = e.kind === "slider" ? "range" : e.kind === "radio" ? "radio" : "checkbox");
3385
+ let i = n.createElement("div");
3386
+ i.setAttribute("aria-hidden", "true"), Object.assign(i.style, {
3387
+ position: "absolute",
3388
+ left: "0",
3389
+ top: "0",
3390
+ pointerEvents: "none",
3391
+ outline: "2px solid #1677ff",
3392
+ outlineOffset: "2px",
3393
+ display: "none",
3394
+ transformOrigin: "0 0",
3395
+ boxSizing: "border-box"
3396
+ }), Object.assign(r.style, {
3397
+ position: "absolute",
3398
+ left: "0",
3399
+ top: "0",
3400
+ margin: "0",
3401
+ opacity: "0",
3402
+ pointerEvents: "none",
3403
+ transformOrigin: "0 0",
3404
+ boxSizing: "border-box"
3405
+ });
3406
+ let a = {
3407
+ element: r,
3408
+ ring: i,
3409
+ control: e
3410
+ };
3411
+ r.addEventListener("focus", () => {
3412
+ a.ring.style.display = "block";
3413
+ }), r.addEventListener("blur", () => {
3414
+ a.ring.style.display = "none", a.control.blur?.();
3415
+ }), r.addEventListener("click", () => {
3416
+ (a.control.kind === "button" || a.control.kind === "switch") && a.control.activate?.();
3417
+ }), r.addEventListener("change", () => {
3418
+ a.control.kind === "checkbox" || a.control.kind === "radio" ? a.control.activate?.() : a.control.kind === "select" && a.control.change?.(a.element.value);
3419
+ }), r.addEventListener("input", () => {
3420
+ a.control.kind === "slider" && a.control.change?.(a.element.value);
3421
+ }), this.overlay.appendChild(i), this.overlay.appendChild(r), this.accessible.set(e.id, a), t = a;
3422
+ }
3423
+ t.control = e;
3424
+ let { element: n, ring: r } = t;
3425
+ if (n.setAttribute("aria-label", e.label), n.disabled = e.disabled, e.kind === "switch" && (n.setAttribute("role", "switch"), n.setAttribute("aria-checked", String(!!e.checked))), n instanceof HTMLInputElement && (e.kind === "radio" && (n.name = e.group ?? e.id), (e.kind === "radio" || e.kind === "checkbox") && (n.checked = !!e.checked), e.kind === "slider" && (n.min = String(e.min), n.max = String(e.max), n.step = String(e.step), n.value = String(e.value))), n instanceof HTMLSelectElement) {
3426
+ let t = e.options ?? [], r = JSON.stringify([t, e.label]), i = "__canvas_ui_placeholder__";
3427
+ for (; t.some((e) => e.value === i);) i += "_";
3428
+ if (n.dataset.options !== r) {
3429
+ n.replaceChildren();
3430
+ let a = this.overlay.ownerDocument.createElement("option");
3431
+ a.value = i, a.textContent = e.label, a.disabled = !0, n.appendChild(a);
3432
+ for (let e of t) {
3433
+ let t = this.overlay.ownerDocument.createElement("option");
3434
+ t.value = e.value, t.textContent = e.label, t.disabled = e.disabled === !0, n.appendChild(t);
3435
+ }
3436
+ n.dataset.options = r;
3437
+ }
3438
+ let a = String(e.value ?? "");
3439
+ n.value = t.some((e) => e.value === a) ? a : i;
3440
+ }
3441
+ this.setError(e.id, n, e.error);
3442
+ let { width: i, height: a, transform: o, clipPath: s } = e.layout, c = {
3443
+ width: `${i}px`,
3444
+ height: `${a}px`,
3445
+ transform: `matrix(${o.join(",")})`,
3446
+ clipPath: s ?? ""
3447
+ };
3448
+ Object.assign(n.style, c), Object.assign(r.style, c);
3449
+ }
3450
+ setError(e, t, n) {
3451
+ if (!n) {
3452
+ this.removeError(e), t.removeAttribute("aria-invalid"), t.removeAttribute("aria-describedby");
3453
+ return;
3454
+ }
3455
+ let r = this.errors.get(e);
3456
+ r || (r = this.overlay.ownerDocument.createElement("span"), r.id = `canvas-ui-error-${++ii}`, r.setAttribute("aria-live", "polite"), Object.assign(r.style, {
3457
+ position: "absolute",
3458
+ width: "1px",
3459
+ height: "1px",
3460
+ overflow: "hidden",
3461
+ clipPath: "inset(50%)"
3462
+ }), this.overlay.appendChild(r), this.errors.set(e, r)), r.textContent !== n && (r.textContent = n), t.setAttribute("aria-invalid", "true"), t.setAttribute("aria-describedby", r.id);
3463
+ }
3464
+ removeError(e) {
3465
+ this.errors.get(e)?.remove(), this.errors.delete(e);
3466
+ }
3467
+ dialogFocusable() {
3468
+ if (!this.dialogElement) return [];
3469
+ let e = Array.from(this.dialogElement.querySelectorAll("input, textarea, select, button")).filter((e) => !("disabled" in e && e.disabled) && e.style.display !== "none");
3470
+ return e.filter((t) => {
3471
+ if (!(t instanceof HTMLInputElement) || t.type !== "radio") return !0;
3472
+ let n = e.filter((e) => e instanceof HTMLInputElement && e.type === "radio" && e.name === t.name);
3473
+ return t === (n.find((e) => e.checked) ?? n[0]);
3474
+ });
3475
+ }
3476
+ handleDialogKey = (e) => {
3477
+ if (e.key === "Escape" && !e.defaultPrevented) e.preventDefault(), this.dialogCancel?.();
3478
+ else if (e.key === "Tab") {
3479
+ let t = this.dialogFocusable();
3480
+ if (!t.length) {
3481
+ e.preventDefault(), this.dialogElement?.focus();
3482
+ return;
3483
+ }
3484
+ let n = t.indexOf(this.overlay.ownerDocument.activeElement), r = e.shiftKey ? n <= 0 ? t.length - 1 : n - 1 : n < 0 || n === t.length - 1 ? 0 : n + 1;
3485
+ e.preventDefault(), t[r].focus();
3486
+ }
3487
+ };
2514
3488
  unmount(e) {
2515
3489
  let t = this.mounted.get(e);
2516
3490
  if (!t) return;
2517
3491
  let { element: n } = t;
2518
- n.removeEventListener("input", this.handleInput), n.removeEventListener("select", this.handleSelection), n.removeEventListener("focus", this.handleFocus), n.removeEventListener("blur", this.handleBlur), n instanceof HTMLTextAreaElement && n.removeEventListener("scroll", this.handleTextareaScroll), this.untrackSelections(), n.remove(), this.mounted.delete(e);
3492
+ n.removeEventListener("input", this.handleInput), n.removeEventListener("select", this.handleSelection), n.removeEventListener("focus", this.handleFocus), n.removeEventListener("blur", this.handleBlur), n instanceof HTMLTextAreaElement && n.removeEventListener("scroll", this.handleTextareaScroll), this.untrackSelections(), n.remove(), this.removeError(e), this.mounted.delete(e);
2519
3493
  }
2520
3494
  destroy() {
2521
3495
  this.setOverlayVisible(!0);
2522
3496
  for (let e of this.mounted.keys()) this.unmount(e);
2523
- this.fileInputs.forEach((e) => e.remove()), this.fileInputs.clear();
3497
+ for (let e of this.accessible.values()) e.element.remove(), e.ring.remove();
3498
+ this.accessible.clear();
3499
+ for (let e of this.errors.keys()) this.removeError(e);
3500
+ this.dialogElement?.removeEventListener("keydown", this.handleDialogKey), this.dialogElement?.remove(), this.dialogElement = null, this.fileInputs.forEach((e) => e.remove()), this.fileInputs.clear();
2524
3501
  }
2525
3502
  find(e) {
2526
3503
  for (let t of this.mounted.values()) if (t.element === e) return t;
@@ -2553,10 +3530,10 @@ var Qn = class {
2553
3530
  };
2554
3531
  };
2555
3532
  // tools/angular-build/.stage/react/canvas-handle.ts
2556
- function $n() {
3533
+ function si() {
2557
3534
  return Math.max(1, window.devicePixelRatio || 1);
2558
3535
  }
2559
- function er(e = {}, t) {
3536
+ function ci(e = {}, t) {
2560
3537
  return typeof e == "string" ? {
2561
3538
  type: e,
2562
3539
  quality: t
@@ -2565,25 +3542,25 @@ function er(e = {}, t) {
2565
3542
  type: e.type ?? "image/png"
2566
3543
  };
2567
3544
  }
2568
- function tr(e, t, n) {
3545
+ function li(e, t, n) {
2569
3546
  try {
2570
3547
  return e.toDataURL(t, n);
2571
3548
  } catch (e) {
2572
- throw ir(e) ? ar() : e;
3549
+ throw fi(e) ? pi() : e;
2573
3550
  }
2574
3551
  }
2575
- function nr(e, t, n) {
3552
+ function ui(e, t, n) {
2576
3553
  return new Promise((r, i) => {
2577
3554
  try {
2578
3555
  e.toBlob((e) => {
2579
3556
  e ? r(e) : i(/* @__PURE__ */ Error("Canvas image export failed."));
2580
3557
  }, t, n);
2581
3558
  } catch (e) {
2582
- i(ir(e) ? ar() : e);
3559
+ i(fi(e) ? pi() : e);
2583
3560
  }
2584
3561
  });
2585
3562
  }
2586
- function rr(e, t, n, r) {
3563
+ function di(e, t, n, r) {
2587
3564
  let i = n.pixelRatio ?? r;
2588
3565
  if (!Number.isFinite(i) || i <= 0) throw RangeError("Export pixelRatio must be a positive finite number.");
2589
3566
  let a = n.width ?? e.width / r, o = n.height ?? e.height / r;
@@ -2594,15 +3571,15 @@ function rr(e, t, n, r) {
2594
3571
  if (!c) throw Error("Canvas 2D context is not available for image export.");
2595
3572
  return t ? t.renderTo(c, s.width / a, s.height / o) : c.drawImage(e, 0, 0, s.width, s.height), s;
2596
3573
  }
2597
- function ir(e) {
3574
+ function fi(e) {
2598
3575
  return typeof e == "object" && !!e && "name" in e && e.name === "SecurityError";
2599
3576
  }
2600
- function ar() {
3577
+ function pi() {
2601
3578
  return /* @__PURE__ */ Error("Canvas 导出失败:画布包含未授权跨域读取的图片。请配置图片服务器 CORS(Access-Control-Allow-Origin),或移除该跨域图片后重试。");
2602
3579
  }
2603
3580
  // tools/angular-build/.stage/react/react/Canvas.tsx
2604
- var or = t(function({ width: e, height: t, style: c, className: l, ariaLabel: u = "Canvas", onFrame: d, onEvent: f, children: p }, m) {
2605
- let h = a(null), g = a(null), _ = a(null), v = a(null), y = a(1), b = i(() => Jt(p), [p]), x = a(d);
3581
+ var mi = t(function({ width: e, height: t, style: c, className: l, ariaLabel: u = "Canvas", onFrame: d, onEvent: f, children: p }, m) {
3582
+ let h = a(null), g = a(null), _ = a(null), v = a(null), y = a(1), b = i(() => yn(p), [p]), x = a(d);
2606
3583
  x.current = d;
2607
3584
  let S = a(void 0);
2608
3585
  return S.current = f, r(m, () => ({
@@ -2611,8 +3588,8 @@ var or = t(function({ width: e, height: t, style: c, className: l, ariaLabel: u
2611
3588
  toDataURL: (e = {}, t) => {
2612
3589
  let n = h.current;
2613
3590
  if (!n) throw Error("Canvas is not mounted.");
2614
- let r = er(e, t);
2615
- return tr(rr(n, v.current, r, y.current), r.type, r.quality);
3591
+ let r = ci(e, t);
3592
+ return li(di(n, v.current, r, y.current), r.type, r.quality);
2616
3593
  },
2617
3594
  toBlob: (e = {}, t) => new Promise((n, r) => {
2618
3595
  let i = h.current;
@@ -2620,18 +3597,18 @@ var or = t(function({ width: e, height: t, style: c, className: l, ariaLabel: u
2620
3597
  r(/* @__PURE__ */ Error("Canvas is not mounted."));
2621
3598
  return;
2622
3599
  }
2623
- let a = er(e, t);
2624
- nr(rr(i, v.current, a, y.current), a.type, a.quality).then(n, r);
3600
+ let a = ci(e, t);
3601
+ ui(di(i, v.current, a, y.current), a.type, a.quality).then(n, r);
2625
3602
  })
2626
3603
  }), []), n(() => {
2627
3604
  let n = h.current, r = g.current, i = _.current;
2628
3605
  if (!n || !r || !i) return;
2629
- let a = $n();
3606
+ let a = si();
2630
3607
  y.current = a, n.width = Math.round(e * a), n.height = Math.round(t * a);
2631
3608
  let o = n.getContext("2d");
2632
3609
  if (!o) throw Error("Canvas 2D context is not available.");
2633
3610
  o.scale(a, a);
2634
- let s = new Xn(o, new Qn(r), (e) => x.current?.(e), a, (e) => S.current?.(e));
3611
+ let s = new ri(o, new oi(r), (e) => x.current?.(e), a, (e) => S.current?.(e));
2635
3612
  v.current = s, s.update(b), s.start();
2636
3613
  let c = (e) => {
2637
3614
  s.wheel({
@@ -2666,6 +3643,7 @@ var or = t(function({ width: e, height: t, style: c, className: l, ariaLabel: u
2666
3643
  },
2667
3644
  onPointerDown: (e) => v.current?.pointerDown(e),
2668
3645
  onPointerMove: (e) => v.current?.pointerMove(e),
3646
+ onPointerLeave: (e) => v.current?.pointerLeave(e.pointerType),
2669
3647
  onPointerUp: (e) => v.current?.pointerUp(e),
2670
3648
  onPointerCancel: (e) => v.current?.pointerUp(e, !0)
2671
3649
  }), /* @__PURE__ */ o("div", {
@@ -2679,4 +3657,4 @@ var or = t(function({ width: e, height: t, style: c, className: l, ariaLabel: u
2679
3657
  })]
2680
3658
  });
2681
3659
  });
2682
- export { ut as Button, or as Canvas, It as CanvasView, rt as Carousel, it as CarouselItem, Je as Checkbox, de as Circle, kt as Collapse, At as CollapseItem, Nt as CustomDraw, Ie as DatePicker, bt as Dialog, Ce as Dropdown, d as Grid, f as GridItem, u as Group, Ze as Icon, vt as Image, ve as Input, Ct as Progress, Ke as Radio, le as Rect, Ae as Slider, Ne as Switch, Et as TabItem, Tt as Tabs, me as Text, xe as Textarea, tt as Upload, Gt as Video };
3660
+ export { vt as Button, mi as Canvas, Wt as CanvasView, dt as Carousel, ft as CarouselItem, tt as Checkbox, ye as Circle, Lt as Collapse, Rt as CollapseItem, Vt as CustomDraw, We as DatePicker, Ot as Dialog, je as Dropdown, h as Form, g as FormItem, _ as Grid, v as GridItem, u as Group, it as Icon, Et as Image, Ee as Input, jt as Progress, $e as Radio, _e as Rect, Re as Slider, Ve as Switch, Pt as TabItem, Nt as Tabs, Se as Text, ke as Textarea, lt as Upload, ln as Video, f as createFormController };