@web-canvas-ui/react 0.1.1 → 0.2.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.
Files changed (157) hide show
  1. package/README.md +172 -76
  2. package/index.js +2682 -0
  3. package/package.json +36 -27
  4. package/types/canvas-handle.d.ts +22 -0
  5. package/types/components/Button/button.d.ts +20 -0
  6. package/types/components/Button/logic.d.ts +3 -0
  7. package/types/components/CanvasView/canvasView.d.ts +28 -0
  8. package/types/components/CanvasView/index.d.ts +2 -0
  9. package/types/components/Carousel/carousel.d.ts +31 -0
  10. package/types/components/Carousel/logic.d.ts +2 -0
  11. package/types/components/Checkbox/checkbox.d.ts +8 -0
  12. package/types/components/ChoiceGroup/choiceGroup.d.ts +33 -0
  13. package/types/components/ChoiceGroup/logic.d.ts +3 -0
  14. package/types/components/Circle/circle.d.ts +9 -0
  15. package/types/components/Collapse/collapse.d.ts +32 -0
  16. package/types/components/Collapse/logic.d.ts +1 -0
  17. package/types/components/CustomDraw/customDraw.d.ts +22 -0
  18. package/types/components/CustomDraw/index.d.ts +2 -0
  19. package/types/components/DatePicker/datePicker.d.ts +24 -0
  20. package/types/components/Dialog/dialog.d.ts +20 -0
  21. package/types/components/Dropdown/dropdown.d.ts +30 -0
  22. package/types/components/Dropdown/logic.d.ts +5 -0
  23. package/{components/Grid/grid.ts → types/components/Grid/grid.d.ts} +3 -4
  24. package/{components/GridItem/gridItem.ts → types/components/GridItem/gridItem.d.ts} +1 -4
  25. package/{components/Group/group.ts → types/components/Group/group.d.ts} +1 -4
  26. package/types/components/Icon/icon.d.ts +14 -0
  27. package/types/components/Image/image.d.ts +12 -0
  28. package/types/components/Input/input.d.ts +32 -0
  29. package/types/components/Progress/progress.d.ts +15 -0
  30. package/types/components/Radio/radio.d.ts +8 -0
  31. package/types/components/Rect/rect.d.ts +11 -0
  32. package/types/components/Slider/logic.d.ts +1 -0
  33. package/types/components/Slider/slider.d.ts +17 -0
  34. package/types/components/Switch/logic.d.ts +2 -0
  35. package/types/components/Switch/switch.d.ts +14 -0
  36. package/types/components/Tabs/logic.d.ts +2 -0
  37. package/types/components/Tabs/tabs.d.ts +35 -0
  38. package/types/components/Text/text.d.ts +39 -0
  39. package/types/components/Textarea/textarea.d.ts +10 -0
  40. package/types/components/Upload/upload.d.ts +20 -0
  41. package/types/components/Video/index.d.ts +2 -0
  42. package/types/components/Video/video.d.ts +20 -0
  43. package/types/components/draw-utils.d.ts +48 -0
  44. package/types/components/shared.d.ts +7 -0
  45. package/types/components/size.d.ts +6 -0
  46. package/{components/types.ts → types/components/types.d.ts} +3 -12
  47. package/types/engine/carousel.d.ts +10 -0
  48. package/types/engine/events.d.ts +14 -0
  49. package/types/engine/hit-test.d.ts +31 -0
  50. package/types/engine/images.d.ts +8 -0
  51. package/types/engine/interaction.d.ts +11 -0
  52. package/types/engine/layout.d.ts +6 -0
  53. package/types/engine/nodes.d.ts +18 -0
  54. package/{engine/state.ts → types/engine/state.d.ts} +27 -22
  55. package/types/engine/text-controls.d.ts +10 -0
  56. package/types/engine/transform.d.ts +13 -0
  57. package/types/engine/videos.d.ts +14 -0
  58. package/types/engine/vnodes.d.ts +36 -0
  59. package/types/engine.d.ts +36 -0
  60. package/types/image-assets.d.ts +2 -0
  61. package/types/input-bridge.d.ts +40 -0
  62. package/types/react/Canvas.d.ts +4 -0
  63. package/types/react/components.d.ts +30 -0
  64. package/types/react/index.d.ts +4 -0
  65. package/types/renderer.d.ts +20 -0
  66. package/types/scene.d.ts +15 -0
  67. package/{types.ts → types/types.d.ts} +10 -142
  68. package/types/video-assets.d.ts +11 -0
  69. package/Canvas.tsx +0 -142
  70. package/__tests__/pure-logic.test.ts +0 -153
  71. package/__tests__/scene-and-node.test.ts +0 -131
  72. package/__tests__/scratch-space.test.ts +0 -30
  73. package/__tests__/textarea-caret.test.ts +0 -96
  74. package/__tests__/utils.test.ts +0 -114
  75. package/canvas-handle.ts +0 -114
  76. package/components/Button/button.ts +0 -57
  77. package/components/Button/logic.ts +0 -11
  78. package/components/CanvasView/canvasView.ts +0 -103
  79. package/components/CanvasView/index.ts +0 -7
  80. package/components/Carousel/carousel.ts +0 -107
  81. package/components/Carousel/logic.ts +0 -36
  82. package/components/Checkbox/checkbox.ts +0 -14
  83. package/components/ChoiceGroup/choiceGroup.ts +0 -172
  84. package/components/ChoiceGroup/logic.ts +0 -14
  85. package/components/Circle/circle.ts +0 -31
  86. package/components/Collapse/collapse.ts +0 -69
  87. package/components/Collapse/logic.ts +0 -14
  88. package/components/CustomDraw/customDraw.ts +0 -50
  89. package/components/CustomDraw/index.ts +0 -7
  90. package/components/DatePicker/datePicker.ts +0 -70
  91. package/components/Dialog/dialog.ts +0 -102
  92. package/components/Dropdown/dropdown.ts +0 -125
  93. package/components/Dropdown/logic.ts +0 -29
  94. package/components/Icon/icon.ts +0 -669
  95. package/components/Image/image.ts +0 -69
  96. package/components/Input/input.ts +0 -139
  97. package/components/Progress/progress.ts +0 -59
  98. package/components/Radio/radio.ts +0 -14
  99. package/components/Rect/rect.ts +0 -35
  100. package/components/Slider/logic.ts +0 -19
  101. package/components/Slider/slider.ts +0 -58
  102. package/components/Switch/logic.ts +0 -8
  103. package/components/Switch/switch.ts +0 -37
  104. package/components/Tabs/logic.ts +0 -14
  105. package/components/Tabs/tabs.ts +0 -78
  106. package/components/Text/text.ts +0 -95
  107. package/components/Textarea/textarea.ts +0 -16
  108. package/components/Upload/upload.ts +0 -66
  109. package/components/draw-utils.ts +0 -230
  110. package/components/shared.ts +0 -15
  111. package/components/size.ts +0 -20
  112. package/components.ts +0 -98
  113. package/engine/__tests__/carousel.test.ts +0 -218
  114. package/engine/__tests__/hit-test.test.ts +0 -282
  115. package/engine/__tests__/layout.test.ts +0 -474
  116. package/engine/carousel.ts +0 -150
  117. package/engine/events.ts +0 -73
  118. package/engine/hit-test.ts +0 -321
  119. package/engine/images.ts +0 -41
  120. package/engine/interaction.ts +0 -442
  121. package/engine/layout.ts +0 -355
  122. package/engine/nodes.ts +0 -166
  123. package/engine/text-controls.ts +0 -122
  124. package/engine/transform.ts +0 -61
  125. package/engine/vnodes.ts +0 -204
  126. package/engine.ts +0 -162
  127. package/image-assets.ts +0 -37
  128. package/index.ts +0 -78
  129. package/input-bridge.ts +0 -285
  130. package/renderer.ts +0 -303
  131. package/scene.ts +0 -122
  132. package/theme.scss +0 -234
  133. package/web-canvas-ui-react-0.1.1.tgz +0 -0
  134. /package/{components/Button/index.ts → types/components/Button/index.d.ts} +0 -0
  135. /package/{components/Carousel/index.ts → types/components/Carousel/index.d.ts} +0 -0
  136. /package/{components/Checkbox/index.ts → types/components/Checkbox/index.d.ts} +0 -0
  137. /package/{components/ChoiceGroup/index.ts → types/components/ChoiceGroup/index.d.ts} +0 -0
  138. /package/{components/Circle/index.ts → types/components/Circle/index.d.ts} +0 -0
  139. /package/{components/Collapse/index.ts → types/components/Collapse/index.d.ts} +0 -0
  140. /package/{components/DatePicker/index.ts → types/components/DatePicker/index.d.ts} +0 -0
  141. /package/{components/Dialog/index.ts → types/components/Dialog/index.d.ts} +0 -0
  142. /package/{components/Dropdown/index.ts → types/components/Dropdown/index.d.ts} +0 -0
  143. /package/{components/Grid/index.ts → types/components/Grid/index.d.ts} +0 -0
  144. /package/{components/GridItem/index.ts → types/components/GridItem/index.d.ts} +0 -0
  145. /package/{components/Group/index.ts → types/components/Group/index.d.ts} +0 -0
  146. /package/{components/Icon/index.ts → types/components/Icon/index.d.ts} +0 -0
  147. /package/{components/Image/index.ts → types/components/Image/index.d.ts} +0 -0
  148. /package/{components/Input/index.ts → types/components/Input/index.d.ts} +0 -0
  149. /package/{components/Progress/index.ts → types/components/Progress/index.d.ts} +0 -0
  150. /package/{components/Radio/index.ts → types/components/Radio/index.d.ts} +0 -0
  151. /package/{components/Rect/index.ts → types/components/Rect/index.d.ts} +0 -0
  152. /package/{components/Slider/index.ts → types/components/Slider/index.d.ts} +0 -0
  153. /package/{components/Switch/index.ts → types/components/Switch/index.d.ts} +0 -0
  154. /package/{components/Tabs/index.ts → types/components/Tabs/index.d.ts} +0 -0
  155. /package/{components/Text/index.ts → types/components/Text/index.d.ts} +0 -0
  156. /package/{components/Textarea/index.ts → types/components/Textarea/index.d.ts} +0 -0
  157. /package/{components/Upload/index.ts → types/components/Upload/index.d.ts} +0 -0
package/index.js ADDED
@@ -0,0 +1,2682 @@
1
+ import e, { forwardRef as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a } from "react";
2
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
3
+ // tools/angular-build/.stage/react/components/shared.ts
4
+ var c = Symbol.for("rnative55.web-canvas-ui.kind");
5
+ function l(e) {
6
+ let t = (() => null);
7
+ return t.displayName = e[0].toUpperCase() + e.slice(1), t[c] = e, t;
8
+ }
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
12
+ function p(e, t) {
13
+ return typeof e == "number" && Number.isFinite(e) ? e : t;
14
+ }
15
+ function m(e, t) {
16
+ return typeof e == "string" ? e : t;
17
+ }
18
+ var h = 1.2, g = "…", _ = /[\u2e80-\u9fff\uac00-\ud7af]/u;
19
+ function v(e) {
20
+ return (t) => e.measureText(t).width;
21
+ }
22
+ function y(e, t, n) {
23
+ let r = [];
24
+ for (let i of t.split("\n")) {
25
+ let t = "";
26
+ for (let a of i.split(/(\s+)/).filter(Boolean)) {
27
+ let i = t + a;
28
+ if (t && e(i) <= n) t = i;
29
+ else if (t || !/^\s+$/.test(a)) {
30
+ if (!t && e(a) <= n) t = a;
31
+ else {
32
+ t && !_.test(a) && (r.push(t.trimEnd()), t = "");
33
+ for (let i of Array.from(a)) t && e(t + i) > n && (r.push(t.trimEnd()), t = ""), t += i;
34
+ }
35
+ }
36
+ }
37
+ r.push(t);
38
+ }
39
+ return r;
40
+ }
41
+ function b(e, t, n) {
42
+ let r = Array.from(t), i = 0, a = r.length;
43
+ for (; i < a;) {
44
+ let t = Math.ceil((i + a) / 2);
45
+ e(r.slice(0, t).join("") + g) <= n ? i = t : a = t - 1;
46
+ }
47
+ return r.slice(0, i).join("") + g;
48
+ }
49
+ function x(e, t, n) {
50
+ return !t || e(t) <= n ? t : b(e, t, n);
51
+ }
52
+ function S(e, t, n, r) {
53
+ let i = y(e, t, n);
54
+ if (i.length <= r) return i;
55
+ let a = i.slice(0, r);
56
+ return a[r - 1] = b(e, a[r - 1], n), a;
57
+ }
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];
60
+ }
61
+ function w(e, t, n) {
62
+ return y(v(e), t, n);
63
+ }
64
+ function T(e, t, n) {
65
+ return x(v(e), t, n);
66
+ }
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;
70
+ }
71
+ 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);
74
+ }
75
+ function ne(e, t) {
76
+ let n = parseFloat(t) || 14;
77
+ return Array.from(e).reduce((e, t) => {
78
+ let r = _.test(t);
79
+ return e + n * (r ? 1 : .62);
80
+ }, 0);
81
+ }
82
+ function re(e, t, n, r, i, a, o) {
83
+ if (e.beginPath(), e.rect(0, 0, i, a), e.clip(), !(n > 0) || !(r > 0) || !(i > 0) || !(a > 0)) return;
84
+ if (o === "fill") {
85
+ e.drawImage(t, 0, 0, i, a);
86
+ return;
87
+ }
88
+ let s = o === "cover" ? Math.max(i / n, a / r) : o === "none" ? 1 : o === "scale-down" ? Math.min(1, i / n, a / r) : Math.min(i / n, a / r);
89
+ if (o === "cover") {
90
+ let o = i / s, c = a / s;
91
+ e.drawImage(t, (n - o) / 2, (r - c) / 2, o, c, 0, 0, i, a);
92
+ return;
93
+ }
94
+ let c = n * s, l = r * s;
95
+ e.drawImage(t, (i - c) / 2, (a - l) / 2, c, l);
96
+ }
97
+ var k = null;
98
+ function A() {
99
+ if (k !== null) return k;
100
+ let e = typeof document > "u" ? null : document.body;
101
+ if (!e) return 0;
102
+ let t = document.createElement("div");
103
+ t.style.position = "absolute", t.style.top = "-9999px", t.style.width = "100px", t.style.height = "100px", t.style.overflowY = "scroll";
104
+ 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;
106
+ }
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);
110
+ }
111
+ function ce() {
112
+ ie += 1;
113
+ }
114
+ function j(e, t, n) {
115
+ 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));
118
+ let a = i.get(t);
119
+ if (a && a.generation === ie) return a.value;
120
+ let o = getComputedStyle(r).getPropertyValue(t).trim() || n;
121
+ return i.set(t, {
122
+ generation: ie,
123
+ value: o
124
+ }), o;
125
+ }
126
+ // 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());
131
+ }
132
+ // 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());
137
+ }
138
+ // 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;
142
+ }
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)));
145
+ return {
146
+ lines: o,
147
+ width: a > 0 ? a : r(i),
148
+ height: o.length * t * h
149
+ };
150
+ }
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";
154
+ 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;
157
+ i.lines.forEach((t, r) => {
158
+ e.fillText(t, a, r * n * h);
159
+ }), e.textAlign = "left";
160
+ }
161
+ // 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;
173
+ if (n) {
174
+ let t = [], n = 0;
175
+ for (let e of _) {
176
+ let r = l.indexOf(e, n);
177
+ r < 0 && (r = n), t.length > 0 && e === "" && l[r] === "\n" && (r += 1), t.push(r), n = r + e.length;
178
+ }
179
+ let i = 0;
180
+ 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;
182
+ } 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);
184
+ }
185
+ e.restore();
186
+ }
187
+ function be(e, t, n, r, i) {
188
+ let a = Math.min(n, Math.max(16, n * n / r)), o = r - n, s = o > 0 ? (n - a) * i / o : 0;
189
+ 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
+ }
191
+ // tools/angular-build/.stage/react/components/Textarea/textarea.ts
192
+ var xe = l("textarea");
193
+ function Se(e, t) {
194
+ ye(e, t, !0);
195
+ }
196
+ // 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) => {
205
+ 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);
207
+ });
208
+ }
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();
211
+ }
212
+ function De(e) {
213
+ return Array.isArray(e) ? e.map((e) => typeof e == "string" ? {
214
+ label: e,
215
+ value: e
216
+ } : e) : [];
217
+ }
218
+ // tools/angular-build/.stage/react/components/Dropdown/logic.ts
219
+ function M(e) {
220
+ return Array.isArray(e) ? e.flatMap((e) => {
221
+ if (typeof e == "string") return [{
222
+ label: e,
223
+ value: e
224
+ }];
225
+ if (!e || typeof e != "object") return [];
226
+ let t = e;
227
+ return typeof t.label != "string" || typeof t.value != "string" ? [] : [{
228
+ label: t.label,
229
+ value: t.value,
230
+ disabled: t.disabled === !0
231
+ }];
232
+ }) : [];
233
+ }
234
+ function Oe(e, t) {
235
+ return M(e)[t];
236
+ }
237
+ function ke(e, t) {
238
+ e.setProps({
239
+ value: t.value,
240
+ open: !1
241
+ });
242
+ let n = e.props.onChange;
243
+ typeof n == "function" && n(t.value);
244
+ }
245
+ // 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();
250
+ }
251
+ // 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);
254
+ 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);
256
+ return Math.max(i, Math.min(a, i + Math.round((s - i) / o) * o));
257
+ }
258
+ // 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();
263
+ }
264
+ // tools/angular-build/.stage/react/components/Switch/logic.ts
265
+ function Fe(e) {
266
+ let t = !e.props.checked;
267
+ e.setProps({ checked: t });
268
+ let n = e.props.onChange;
269
+ typeof n == "function" && n(t);
270
+ }
271
+ // 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;
276
+ let o = n - 20, s = r / 2 - 7;
277
+ 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
+ }
279
+ // tools/angular-build/.stage/react/components/size.ts
280
+ function N(e, t) {
281
+ return p(Re(e)?.width, p(e.width, t));
282
+ }
283
+ function P(e, t) {
284
+ return p(Re(e)?.height, p(e.height, t));
285
+ }
286
+ function Re(e) {
287
+ let t = e.size;
288
+ if (typeof t == "object" && t && !Array.isArray(t)) return t;
289
+ }
290
+ // tools/angular-build/.stage/react/components/ChoiceGroup/choiceGroup.ts
291
+ function ze(e) {
292
+ return Array.isArray(e) ? e.map((e) => typeof e == "string" ? {
293
+ label: e,
294
+ value: e
295
+ } : e) : [];
296
+ }
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);
299
+ return {
300
+ width: N(e, n ? o : 200),
301
+ height: P(e, n ? a : s)
302
+ };
303
+ }
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;
306
+ e.font = `${o}px sans-serif`, e.textBaseline = "middle", e.lineWidth = 1;
307
+ let l = 0, u = 0;
308
+ 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;
311
+ }
312
+ }
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);
315
+ if (i) {
316
+ let e = 0;
317
+ for (let i of r) {
318
+ let r = Ue(i.label, o);
319
+ if (t >= e && t <= e + r && n >= 0 && n <= c.height) return i;
320
+ e += r + a;
321
+ }
322
+ return;
323
+ }
324
+ let l = Math.floor(n / (s + a));
325
+ return n - l * (s + a) <= s && t >= 0 && t <= c.width ? r[l] : void 0;
326
+ }
327
+ function Ue(e, t) {
328
+ return Math.max(24, O(e, `${t}px sans-serif`)) + 24;
329
+ }
330
+ // tools/angular-build/.stage/react/components/ChoiceGroup/logic.ts
331
+ function We(e, t) {
332
+ return e === t.value ? void 0 : t.value;
333
+ }
334
+ function Ge(e, t) {
335
+ let n = Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
336
+ return n.includes(t.value) ? n.filter((e) => e !== t.value) : [...n, t.value];
337
+ }
338
+ // tools/angular-build/.stage/react/components/Radio/radio.ts
339
+ var Ke = l("radio");
340
+ function qe(e, t) {
341
+ Ve(e, t, "radio");
342
+ }
343
+ // tools/angular-build/.stage/react/components/Checkbox/checkbox.ts
344
+ var Je = l("checkbox");
345
+ function Ye(e, t) {
346
+ Ve(e, t, "checkbox");
347
+ }
348
+ // tools/angular-build/.stage/react/components/Icon/icon.ts
349
+ var Xe = {
350
+ home: { paths: ["M3 10 L12 3 L21 10 M5 9 V21 H19 V9 M9 21 V14 H15 V21"] },
351
+ 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
+ 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"] },
353
+ apartment: { paths: ["M3 21 V3 H21 V21 M2 21 H22", "M7 7 H9 M15 7 H17 M7 11 H9 M15 11 H17 M7 15 H9 M15 15 H17 M10 21 V18 H14 V21"] },
354
+ store: { paths: ["M4 10 V21 H20 V10 M2 10 L4 3 H20 L22 10 M2 10 Q5 14 8 10 Q11 14 14 10 Q17 14 22 10", "M8 21 V14 H16 V21"] },
355
+ mapPin: {
356
+ paths: ["M12 22 C9 18 4 13 4 9 A8 8 0 0 1 20 9 C20 13 15 18 12 22 Z"],
357
+ circles: [[
358
+ 12,
359
+ 9,
360
+ 2.5
361
+ ]]
362
+ },
363
+ map: { paths: ["M3 6 L9 3 L15 6 L21 3 V18 L15 21 L9 18 L3 21 Z", "M9 3 V18 M15 6 V21"] },
364
+ globe: { paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 Z", "M2 12 H22 M12 2 C7 7 7 17 12 22 M12 2 C17 7 17 17 12 22 M4 7 H20 M4 17 H20"] },
365
+ compass: { paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 Z", "M15.5 8.5 L13 13 L8.5 15.5 L11 11 Z M12 2 V4 M22 12 H20"] },
366
+ navigation: { paths: ["M12 2 L21 21 L12 17 L3 21 Z M12 17 V9"] },
367
+ flag: { paths: ["M5 22 V3 M5 4 C10 1 14 8 20 4 V15 C14 19 10 12 5 15"] },
368
+ mountain: { paths: ["M2 21 L8 9 L11 14 L16 5 L22 21 Z M6 21 L10 14 M13 11 L16 15"] },
369
+ tree: { paths: ["M12 22 V15 M5 15 L12 4 L19 15 Z M7 10 L12 2 L17 10 Z M8 22 H16"] },
370
+ leaf: { paths: ["M21 3 C10 3 4 6 4 14 C4 18 7 21 11 20 C19 18 21 11 21 3 Z M3 21 L14 10 M8 16 L8 12 M12 12 L16 12"] },
371
+ flower: {
372
+ paths: ["M12 13 V22 M12 18 C8 16 7 19 6 21 M12 18 C16 16 17 19 18 21"],
373
+ circles: [
374
+ [
375
+ 12,
376
+ 7,
377
+ 2
378
+ ],
379
+ [
380
+ 12,
381
+ 3,
382
+ 2
383
+ ],
384
+ [
385
+ 16,
386
+ 7,
387
+ 2
388
+ ],
389
+ [
390
+ 12,
391
+ 11,
392
+ 2
393
+ ],
394
+ [
395
+ 8,
396
+ 7,
397
+ 2
398
+ ]
399
+ ]
400
+ },
401
+ sun: { paths: ["M12 7 A5 5 0 1 0 12 17 A5 5 0 1 0 12 7 Z", "M12 2 V4 M12 20 V22 M2 12 H4 M20 12 H22 M5 5 L6.5 6.5 M17.5 17.5 L19 19 M19 5 L17.5 6.5 M6.5 17.5 L5 19"] },
402
+ moon: { paths: ["M20 15 A8 8 0 0 1 9 4 A9 9 0 1 0 20 15 Z"] },
403
+ cloud: { paths: ["M7 18 H18 A4 4 0 0 0 18 10 A7 7 0 0 0 5 11 A3.5 3.5 0 0 0 7 18 Z"] },
404
+ rain: { paths: ["M7 14 H18 A4 4 0 0 0 18 6 A7 7 0 0 0 5 7 A3.5 3.5 0 0 0 7 14 Z", "M8 17 L7 20 M13 17 L12 20 M18 17 L17 20"] },
405
+ snow: { paths: ["M12 2 V22 M3.3 7 L20.7 17 M3.3 17 L20.7 7", "M9 4 L12 7 L15 4 M9 20 L12 17 L15 20 M4 10 L8 9 L7 5 M20 14 L16 15 L17 19 M4 14 L8 15 L7 19 M20 10 L16 9 L17 5"] },
406
+ fire: { paths: ["M12 22 C5 22 4 16 7 11 C8 9 9 7 9 4 C13 7 14 10 13 12 C16 11 17 8 17 7 C23 15 19 22 12 22 Z", "M12 19 C9 19 9 16 11 14 C12 13 13 12 13 11 C17 14 16 19 12 19 Z"] },
407
+ water: { paths: ["M12 2 C9 7 4 12 4 16 A8 8 0 0 0 20 16 C20 12 15 7 12 2 Z", "M8 17 C9 19 11 20 13 20"] },
408
+ wind: { paths: ["M3 8 H16 C20 8 20 3 17 3 C15 3 14 4 14 5 M2 12 H20 C23 12 23 17 20 17 C18 17 17 16 17 15 M4 16 H11"] },
409
+ car: {
410
+ paths: ["M3 16 L5 8 H19 L21 16 V20 H3 Z M5 8 L7 4 H17 L19 8 M3 13 H21 M6 20 V22 M18 20 V22"],
411
+ circles: [[
412
+ 7,
413
+ 17,
414
+ 1
415
+ ], [
416
+ 17,
417
+ 17,
418
+ 1
419
+ ]]
420
+ },
421
+ bus: {
422
+ paths: ["M5 3 H19 A2 2 0 0 1 21 5 V19 H3 V5 A2 2 0 0 1 5 3 Z M3 12 H21 M6 6 H10 V10 H6 Z M14 6 H18 V10 H14 Z M6 19 V22 M18 19 V22"],
423
+ circles: [[
424
+ 7,
425
+ 16,
426
+ 1
427
+ ], [
428
+ 17,
429
+ 16,
430
+ 1
431
+ ]]
432
+ },
433
+ train: {
434
+ paths: ["M7 3 H17 A3 3 0 0 1 20 6 V16 A3 3 0 0 1 17 19 H7 A3 3 0 0 1 4 16 V6 A3 3 0 0 1 7 3 Z M4 12 H20 M8 22 L10 19 M16 22 L14 19"],
435
+ circles: [[
436
+ 8,
437
+ 7,
438
+ 1
439
+ ], [
440
+ 16,
441
+ 7,
442
+ 1
443
+ ]]
444
+ },
445
+ plane: { paths: ["M2 13 L10 11 L14 3 L17 3 L16 10 L22 12 L22 14 L15 14 L12 21 L10 21 L10 14 L3 16 Z"] },
446
+ bicycle: { paths: ["M5 18 A3 3 0 1 0 5 24 A3 3 0 1 0 5 18 Z M19 18 A3 3 0 1 0 19 24 A3 3 0 1 0 19 18 Z M5 21 L9 13 L13 21 H5 L11 16 L15 11 L19 21 M13 11 H17 M9 13 H6"] },
447
+ ship: { paths: ["M3 14 L6 8 H18 L21 14 L19 19 H5 Z M8 8 V4 H15 V8 M2 21 Q6 19 10 21 Q14 19 18 21 Q20 20 22 21"] },
448
+ rocket: {
449
+ paths: ["M12 2 C17 5 19 10 19 16 L12 21 L5 16 C5 10 7 5 12 2 Z M8 16 L4 20 V14 M16 16 L20 20 V14 M9 22 H15"],
450
+ circles: [[
451
+ 12,
452
+ 9,
453
+ 2
454
+ ]]
455
+ },
456
+ truck: {
457
+ paths: ["M2 6 H15 V18 H2 Z M15 11 H19 L22 14 V18 H15 Z M5 18 V21 M19 18 V21 M15 14 H21"],
458
+ circles: [[
459
+ 6,
460
+ 18,
461
+ 1.5
462
+ ], [
463
+ 18,
464
+ 18,
465
+ 1.5
466
+ ]]
467
+ },
468
+ walk: { paths: ["M12 3 A2 2 0 1 0 12 7 A2 2 0 1 0 12 3 Z M11 9 L8 14 L4 16 M10 12 L15 14 L18 19 M8 14 L10 18 L8 22 M15 14 L14 18 L17 22"] },
469
+ phone: {
470
+ paths: ["M7 2 H17 A2 2 0 0 1 19 4 V20 A2 2 0 0 1 17 22 H7 A2 2 0 0 1 5 20 V4 A2 2 0 0 1 7 2 Z M5 18 H19 M10 5 H14"],
471
+ circles: [[
472
+ 12,
473
+ 20,
474
+ .6
475
+ ]]
476
+ },
477
+ message: { paths: ["M3 4 H21 V17 H11 L5 21 V17 H3 Z M7 9 H17 M7 13 H14"] },
478
+ mail: { paths: ["M3 5 H21 V19 H3 Z M3 6 L12 13 L21 6"] },
479
+ bell: {
480
+ paths: ["M5 17 H19 L17 14 V9 A5 5 0 0 0 7 9 V14 Z M10 20 H14"],
481
+ circles: [[
482
+ 12,
483
+ 3,
484
+ 1
485
+ ]]
486
+ },
487
+ calendar: { paths: ["M3 5 H21 V21 H3 Z M3 9 H21 M7 2 V7 M17 2 V7 M7 13 H9 M12 13 H14 M17 13 H19 M7 17 H9 M12 17 H14"] },
488
+ clock: { paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 Z M12 6 V12 L16 14"] },
489
+ alarm: { paths: ["M12 22 A8 8 0 1 0 12 6 A8 8 0 1 0 12 22 Z M12 10 V14 L15 16 M4 3 L2 6 M20 3 L22 6 M8 22 L6 24 M16 22 L18 24"] },
490
+ camera: {
491
+ paths: ["M3 7 H7 L9 4 H15 L17 7 H21 V20 H3 Z"],
492
+ circles: [[
493
+ 12,
494
+ 13,
495
+ 4
496
+ ], [
497
+ 12,
498
+ 13,
499
+ 2
500
+ ]]
501
+ },
502
+ image: {
503
+ paths: ["M3 4 H21 V20 H3 Z M4 18 L10 11 L14 15 L17 12 L21 17"],
504
+ circles: [[
505
+ 8,
506
+ 8,
507
+ 1.5
508
+ ]]
509
+ },
510
+ video: { paths: ["M3 6 H15 V18 H3 Z M15 10 L21 7 V17 L15 14 Z"] },
511
+ music: {
512
+ paths: ["M10 17 V5 L21 3 V15 M10 8 L21 6"],
513
+ circles: [[
514
+ 7,
515
+ 18,
516
+ 3
517
+ ], [
518
+ 18,
519
+ 16,
520
+ 3
521
+ ]]
522
+ },
523
+ microphone: { paths: ["M12 15 A3 3 0 0 0 15 12 V5 A3 3 0 0 0 9 5 V12 A3 3 0 0 0 12 15 Z M5 11 A7 7 0 0 0 19 11 M12 18 V22 M8 22 H16"] },
524
+ headphones: { paths: ["M3 13 V11 A9 9 0 0 1 21 11 V13 M3 13 H7 V20 H5 A2 2 0 0 1 3 18 Z M21 13 H17 V20 H19 A2 2 0 0 0 21 18 Z"] },
525
+ play: {
526
+ paths: ["M6 3 L21 12 L6 21 Z"],
527
+ filled: [0]
528
+ },
529
+ pause: {
530
+ paths: ["M6 4 H10 V20 H6 Z M14 4 H18 V20 H14 Z"],
531
+ filled: [0, 1]
532
+ },
533
+ stop: {
534
+ paths: ["M5 5 H19 V19 H5 Z"],
535
+ filled: [0]
536
+ },
537
+ record: {
538
+ paths: ["M3 12 A9 9 0 1 0 21 12 A9 9 0 1 0 3 12 Z"],
539
+ circles: [[
540
+ 12,
541
+ 12,
542
+ 3
543
+ ]]
544
+ },
545
+ volume: { paths: ["M3 9 H7 L13 4 V20 L7 15 H3 Z M17 9 Q21 12 17 15 M19 6 Q25 12 19 18"] },
546
+ wifi: {
547
+ paths: ["M2 8 Q12 0 22 8 M5 12 Q12 6 19 12 M8 16 Q12 12 16 16"],
548
+ circles: [[
549
+ 12,
550
+ 20,
551
+ 1
552
+ ]]
553
+ },
554
+ bluetooth: { paths: ["M12 2 L18 7 L12 12 L18 17 L12 22 V2 M5 7 L18 17 M5 17 L18 7"] },
555
+ battery: { paths: ["M3 7 H20 V19 H3 Z M20 10 H22 V16 H20 M6 10 V16 M10 10 V16 M14 10 V16"] },
556
+ signal: { paths: ["M3 20 V16 H6 V20 Z M9 20 V12 H12 V20 Z M15 20 V8 H18 V20 Z M21 20 V4 H24 V20 Z"] },
557
+ power: { paths: ["M12 2 V12 M6 5 A9 9 0 1 0 18 5"] },
558
+ monitor: { paths: ["M2 4 H22 V18 H2 Z M8 22 H16 M12 18 V22"] },
559
+ laptop: { paths: ["M4 4 H20 V16 H4 Z M2 20 H22 L20 17 H4 Z"] },
560
+ tablet: {
561
+ paths: ["M6 2 H18 A2 2 0 0 1 20 4 V20 A2 2 0 0 1 18 22 H6 A2 2 0 0 1 4 20 V4 A2 2 0 0 1 6 2 Z M4 18 H20"],
562
+ circles: [[
563
+ 12,
564
+ 20,
565
+ .6
566
+ ]]
567
+ },
568
+ keyboard: { paths: ["M2 6 H22 V18 H2 Z M5 9 H6 M9 9 H10 M13 9 H14 M17 9 H18 M5 12 H6 M9 12 H10 M13 12 H14 M17 12 H18 M7 15 H17"] },
569
+ mouse: { paths: ["M12 22 A8 8 0 0 0 20 14 V10 A8 8 0 0 0 4 10 V14 A8 8 0 0 0 12 22 Z M12 3 V11"] },
570
+ printer: {
571
+ paths: ["M6 8 V3 H18 V8 M6 17 H4 A2 2 0 0 1 2 15 V10 A2 2 0 0 1 4 8 H20 A2 2 0 0 1 22 10 V15 A2 2 0 0 1 20 17 H18 M6 14 H18 V21 H6 Z"],
572
+ circles: [[
573
+ 18,
574
+ 11,
575
+ .8
576
+ ]]
577
+ },
578
+ folder: { paths: ["M2 6 H10 L12 9 H22 V20 H2 Z M2 9 H22"] },
579
+ file: { paths: ["M5 2 H15 L20 7 V22 H5 Z M15 2 V7 H20 M8 12 H17 M8 16 H17"] },
580
+ document: { paths: ["M4 3 H17 L21 7 V21 H4 Z M17 3 V7 H21 M8 11 H17 M8 15 H17 M8 18 H14"] },
581
+ download: { paths: ["M12 2 V16 M6 10 L12 16 L18 10 M4 20 H20"] },
582
+ upload: { paths: ["M12 16 V2 M6 8 L12 2 L18 8 M4 20 H20"] },
583
+ share: {
584
+ paths: ["M6 12 L18 5 M6 12 L18 19"],
585
+ circles: [
586
+ [
587
+ 5,
588
+ 12,
589
+ 3
590
+ ],
591
+ [
592
+ 19,
593
+ 4,
594
+ 3
595
+ ],
596
+ [
597
+ 19,
598
+ 20,
599
+ 3
600
+ ]
601
+ ]
602
+ },
603
+ link: { paths: ["M9 15 L15 9 M7 17 L5 19 A4 4 0 0 1 2 13 L7 8 A4 4 0 0 1 13 8 M17 7 L19 5 A4 4 0 0 1 22 11 L17 16 A4 4 0 0 1 11 16"] },
604
+ search: {
605
+ paths: ["M15 15 L22 22"],
606
+ circles: [[
607
+ 10,
608
+ 10,
609
+ 7
610
+ ]]
611
+ },
612
+ settings: {
613
+ paths: ["M12 2 L14 4 L17 4 L18 7 L21 9 L20 12 L21 15 L18 17 L17 20 L14 20 L12 22 L10 20 L7 20 L6 17 L3 15 L4 12 L3 9 L6 7 L7 4 L10 4 Z"],
614
+ circles: [[
615
+ 12,
616
+ 12,
617
+ 3
618
+ ]]
619
+ },
620
+ sliders: {
621
+ paths: ["M3 6 H21 M3 12 H21 M3 18 H21"],
622
+ circles: [
623
+ [
624
+ 8,
625
+ 6,
626
+ 2
627
+ ],
628
+ [
629
+ 15,
630
+ 12,
631
+ 2
632
+ ],
633
+ [
634
+ 10,
635
+ 18,
636
+ 2
637
+ ]
638
+ ]
639
+ },
640
+ menu: { paths: ["M3 6 H21 M3 12 H21 M3 18 H21"] },
641
+ close: { paths: ["M5 5 L19 19 M19 5 L5 19"] },
642
+ check: { paths: ["M3 12 L9 18 L21 5"] },
643
+ plus: { paths: ["M12 3 V21 M3 12 H21"] },
644
+ minus: { paths: ["M3 12 H21"] },
645
+ edit: { paths: ["M4 16 L15 5 L19 9 L8 20 L3 21 Z M13 7 L17 11 M3 21 L4 16"] },
646
+ trash: { paths: ["M4 7 H20 M10 3 H14 M6 7 L7 21 H17 L18 7 M10 11 V17 M14 11 V17"] },
647
+ copy: { paths: ["M8 8 H20 V21 H8 Z M5 16 H3 V3 H15 V5"] },
648
+ save: { paths: ["M3 3 H18 L21 6 V21 H3 Z M7 3 V9 H16 V3 M7 21 V14 H17 V21"] },
649
+ lock: { paths: ["M5 11 H19 V21 H5 Z M8 11 V7 A4 4 0 0 1 16 7 V11"] },
650
+ unlock: { paths: ["M5 11 H19 V21 H5 Z M8 11 V7 A4 4 0 0 1 15 4"] },
651
+ key: {
652
+ paths: ["M14 10 L22 2 M18 6 L21 9 M15 9 L18 12"],
653
+ circles: [[
654
+ 8,
655
+ 14,
656
+ 6
657
+ ]]
658
+ },
659
+ user: {
660
+ paths: ["M4 21 C4 16 8 14 12 14 C16 14 20 16 20 21"],
661
+ circles: [[
662
+ 12,
663
+ 7,
664
+ 4
665
+ ]]
666
+ },
667
+ users: {
668
+ paths: ["M2 21 C2 17 5 15 9 15 M22 21 C22 17 19 15 15 15 M8 21 C8 16 11 14 15 14 C19 14 22 16 22 21"],
669
+ circles: [[
670
+ 8,
671
+ 7,
672
+ 3
673
+ ], [
674
+ 17,
675
+ 7,
676
+ 3
677
+ ]]
678
+ },
679
+ heart: {
680
+ paths: ["M12 21 L4 13 C-1 7 7 1 12 7 C17 1 25 7 20 13 Z"],
681
+ filled: [0]
682
+ },
683
+ star: {
684
+ paths: ["M12 2 L15 9 L22 10 L17 15 L18 22 L12 18 L6 22 L7 15 L2 10 L9 9 Z"],
685
+ filled: [0]
686
+ },
687
+ bookmark: { paths: ["M6 3 H18 V22 L12 18 L6 22 Z"] },
688
+ cart: {
689
+ paths: ["M2 3 H5 L8 17 H19 L22 7 H6 M9 21 H9.1 M18 21 H18.1"],
690
+ circles: [[
691
+ 10,
692
+ 21,
693
+ 1.5
694
+ ], [
695
+ 18,
696
+ 21,
697
+ 1.5
698
+ ]]
699
+ },
700
+ bag: { paths: ["M3 8 H21 L19 21 H5 Z M8 8 V6 A4 4 0 0 1 16 6 V8"] },
701
+ gift: { paths: ["M3 10 H21 V21 H3 Z M2 6 H22 V10 H2 Z M12 6 V21 M12 6 C5 7 5 2 8 2 C11 2 12 6 12 6 C12 6 13 2 16 2 C19 2 19 7 12 6 Z"] },
702
+ creditCard: { paths: ["M2 5 H22 V19 H2 Z M2 10 H22 M6 15 H11"] },
703
+ wallet: {
704
+ paths: ["M3 6 H19 A2 2 0 0 1 21 8 V20 H3 A2 2 0 0 1 1 18 V6 A3 3 0 0 1 4 3 H18 V6 M15 12 H21 V17 H15 A2 2 0 0 1 15 12 Z"],
705
+ circles: [[
706
+ 17,
707
+ 14.5,
708
+ .7
709
+ ]]
710
+ },
711
+ chart: { paths: ["M3 21 V3 M3 21 H22 M7 17 L11 12 L15 15 L21 7"] },
712
+ pieChart: { paths: ["M12 2 V12 H22 A10 10 0 1 1 12 2 Z M14 2 A8 8 0 0 1 22 10 H14 Z"] },
713
+ barChart: { paths: ["M3 21 H22 M5 18 V11 H9 V18 Z M12 18 V5 H16 V18 Z M19 18 V8 H22 V18 Z"] },
714
+ analytics: { paths: ["M3 21 V3 M3 21 H22 M6 17 L10 13 L13 15 L19 7 M16 7 H19 V10"] },
715
+ shield: { paths: ["M12 2 L21 6 V12 C21 17 17 20 12 22 C7 20 3 17 3 12 V6 Z M8 12 L11 15 L17 9"] },
716
+ warning: {
717
+ paths: ["M12 3 L22 21 H2 Z M12 9 V14"],
718
+ circles: [[
719
+ 12,
720
+ 18,
721
+ .8
722
+ ]]
723
+ },
724
+ info: {
725
+ paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 M12 11 V17"],
726
+ circles: [[
727
+ 12,
728
+ 7,
729
+ .8
730
+ ]]
731
+ },
732
+ help: {
733
+ paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 M9 9 A3 3 0 1 1 14 12 C12 13 12 14 12 15"],
734
+ circles: [[
735
+ 12,
736
+ 18,
737
+ .7
738
+ ]]
739
+ },
740
+ question: {
741
+ paths: ["M12 22 A10 10 0 1 0 12 2 A10 10 0 1 0 12 22 M9 9 A3 3 0 1 1 14 12 C12 13 12 14 12 15"],
742
+ circles: [[
743
+ 12,
744
+ 18,
745
+ .7
746
+ ]]
747
+ },
748
+ tag: {
749
+ paths: ["M3 4 H13 L22 13 L13 22 L3 12 Z"],
750
+ circles: [[
751
+ 8,
752
+ 9,
753
+ 1
754
+ ]]
755
+ },
756
+ puzzle: { paths: ["M3 3 H9 A3 3 0 1 0 15 3 H21 V9 A3 3 0 1 1 21 15 V21 H15 A3 3 0 1 0 9 21 H3 V15 A3 3 0 1 1 3 9 Z"] },
757
+ code: { paths: ["M8 5 L2 12 L8 19 M16 5 L22 12 L16 19 M14 3 L10 21"] },
758
+ 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
+ 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) {
762
+ 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);
765
+ if (i <= 0) throw RangeError("Icon size must be greater than zero.");
766
+ 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);
768
+ 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();
771
+ 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
+ e.restore();
773
+ }
774
+ function $e(e, t) {
775
+ let n = t.match(/[A-Z]|-?(?:\d+\.?\d*|\.\d+)/g) ?? [], r = 0, i = 0, a = 0, o = 0;
776
+ for (let t = 0; t < n.length;) {
777
+ let s = n[t++], c = () => Number(n[t++]);
778
+ switch (s) {
779
+ case "M":
780
+ r = c(), i = c(), a = r, o = i, e.moveTo(r, i);
781
+ break;
782
+ case "L":
783
+ r = c(), i = c(), e.lineTo(r, i);
784
+ break;
785
+ case "H":
786
+ r = c(), e.lineTo(r, i);
787
+ break;
788
+ case "V":
789
+ i = c(), e.lineTo(r, i);
790
+ break;
791
+ case "C": {
792
+ let t = c(), n = c(), a = c(), o = c();
793
+ r = c(), i = c(), e.bezierCurveTo(t, n, a, o, r, i);
794
+ break;
795
+ }
796
+ case "Q": {
797
+ let t = c(), n = c();
798
+ r = c(), i = c(), e.quadraticCurveTo(t, n, r, i);
799
+ break;
800
+ }
801
+ case "A": {
802
+ 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;
804
+ break;
805
+ }
806
+ case "Z":
807
+ e.closePath(), r = a, i = o;
808
+ break;
809
+ default: throw Error(`Unsupported path command: ${s}.`);
810
+ }
811
+ }
812
+ }
813
+ function et(e, t, n, r, i, a, o, s, c, l) {
814
+ let u = Math.abs(r), d = Math.abs(i);
815
+ if (u === 0 || d === 0 || t === c && n === l) {
816
+ e.lineTo(c, l);
817
+ return;
818
+ }
819
+ let f = a * Math.PI / 180, p = Math.cos(f), m = Math.sin(f), h = (t - c) / 2, g = (n - l) / 2, _ = p * h + m * g, v = -m * h + p * g, y = _ ** 2 / u ** 2 + v ** 2 / d ** 2;
820
+ if (y > 1) {
821
+ let e = Math.sqrt(y);
822
+ u *= e, d *= e;
823
+ }
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);
826
+ }
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));
833
+ 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, {
836
+ name: t.icon ?? "upload",
837
+ size: c,
838
+ color: o
839
+ }), e.restore(), d += c + (l ? 6 : 0), e.fillStyle = o, e.fillText(l, d, f);
840
+ }
841
+ // 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);
846
+ }
847
+ function ot(e, t) {
848
+ let n = p(t.width, 300), r = p(t.height, 180), i = p(t._itemCount, 0);
849
+ if (!(i < 2)) {
850
+ 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);
853
+ }
854
+ 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;
856
+ e.beginPath();
857
+ 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
+ e.fillStyle = a, e.fill();
859
+ let l = Math.max(0, Math.min(i - 1, p(t._activeIndex, 0)));
860
+ e.beginPath(), e.arc(s + l * 14, c, 4, 0, Math.PI * 2), e.fillStyle = o, e.fill();
861
+ }
862
+ }
863
+ }
864
+ function st(e, t, n, r, i) {
865
+ 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
+ }
867
+ // tools/angular-build/.stage/react/components/Carousel/logic.ts
868
+ function ct(e, t, n, r, i, a, o) {
869
+ if (!(r < 2 || t < 0 || t > a || n < 0 || n > o)) {
870
+ if (e.showArrows !== !1 && Math.abs(n - o / 2) <= 20) {
871
+ if (t <= 42) return i - 1;
872
+ if (t >= a - 42) return i + 1;
873
+ }
874
+ if (e.showDots !== !1 && n >= o - 26) {
875
+ let e = (a - (r - 1) * 14) / 2, n = Math.round((t - e) / 14);
876
+ if (n >= 0 && n < r && Math.abs(t - (e + n * 14)) <= 9) return n;
877
+ }
878
+ }
879
+ }
880
+ function lt(e, t, n, r) {
881
+ return n <= 0 ? 0 : r ? (e % n + n) % n : Math.max(0, Math.min(n - 1, e));
882
+ }
883
+ // 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";
888
+ }
889
+ // tools/angular-build/.stage/react/components/Button/logic.ts
890
+ function ft(e, t) {
891
+ e.setProps({ pressed: t });
892
+ }
893
+ function pt(e) {
894
+ if (e.props.disabled === !0) return;
895
+ let t = e.props.onClick;
896
+ typeof t == "function" && t();
897
+ }
898
+ // tools/angular-build/.stage/react/image-assets.ts
899
+ var mt = /* @__PURE__ */ new Map();
900
+ function ht(e) {
901
+ let t = mt.get(e);
902
+ if (t) return t;
903
+ let n = new Image(), r = {
904
+ image: n,
905
+ error: null,
906
+ listeners: /* @__PURE__ */ new Set()
907
+ };
908
+ return mt.set(e, r), n.onload = () => r.listeners.forEach((e) => e(null)), n.onerror = () => {
909
+ r.error = /* @__PURE__ */ Error(`Canvas image failed to load: ${e}`), r.listeners.forEach((e) => e(r.error));
910
+ }, n.src = e, r;
911
+ }
912
+ function gt(e) {
913
+ let t = ht(e);
914
+ return t.image.complete && t.image.naturalWidth > 0 ? t.image : null;
915
+ }
916
+ function _t(e, t) {
917
+ let n = ht(e);
918
+ return n.listeners.add(t), n.image.complete && t(n.error), () => n.listeners.delete(t);
919
+ }
920
+ // tools/angular-build/.stage/react/components/Image/image.ts
921
+ var vt = l("image");
922
+ function yt(e, t) {
923
+ let n = t.src;
924
+ if (typeof n != "string" || !n) return;
925
+ let r = gt(n);
926
+ 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();
929
+ }
930
+ // 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);
935
+ }
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";
938
+ }
939
+ // 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));
944
+ }
945
+ // 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 ?? [];
949
+ if (!i.length) return;
950
+ 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));
953
+ }), e.textAlign = "left";
954
+ }
955
+ // tools/angular-build/.stage/react/components/Tabs/logic.ts
956
+ function Ot(e, t, n, r, i) {
957
+ if (n >= i || e.length === 0) return;
958
+ let a = e[Math.floor(t / (r / e.length))];
959
+ if (a && !a.props.disabled && typeof a.props.id == "string") return a.props.id;
960
+ }
961
+ // 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);
966
+ }
967
+ // tools/angular-build/.stage/react/components/Collapse/logic.ts
968
+ function Mt(e, t, n) {
969
+ let r = new Set(e);
970
+ return r.has(t) ? r.delete(t) : (n && r.clear(), r.add(t)), [...r];
971
+ }
972
+ // tools/angular-build/.stage/react/components/CustomDraw/customDraw.ts
973
+ var Nt = l("customDraw");
974
+ function Pt(e, t) {
975
+ let n = t.draw;
976
+ 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");
978
+ e.save();
979
+ try {
980
+ n(e, {
981
+ width: r,
982
+ height: i
983
+ });
984
+ } finally {
985
+ e.restore();
986
+ }
987
+ }
988
+ function Ft(e, t) {
989
+ if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw RangeError(`<CustomDraw> ${t} must be a non-negative finite number.`);
990
+ return e;
991
+ }
992
+ // tools/angular-build/.stage/react/components/CanvasView/canvasView.ts
993
+ var It = l("canvasView");
994
+ function Lt(e, t) {
995
+ let n = t.source;
996
+ if (!zt(n)) throw TypeError("<CanvasView> requires an HTMLCanvasElement source.");
997
+ 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");
999
+ if (!n.width || !n.height || !r || !i) return;
1000
+ let a = {
1001
+ width: r,
1002
+ height: i
1003
+ }, o = t.fit ?? "contain";
1004
+ e.save();
1005
+ try {
1006
+ if (e.beginPath(), e.rect(0, 0, a.width, a.height), e.clip(), o === "fill") {
1007
+ e.drawImage(n, 0, 0, a.width, a.height);
1008
+ return;
1009
+ }
1010
+ if (o !== "contain" && o !== "cover") throw RangeError("<CanvasView> fit must be \"contain\", \"cover\", or \"fill\".");
1011
+ let t = o === "cover" ? Math.max(a.width / n.width, a.height / n.height) : Math.min(a.width / n.width, a.height / n.height), r = n.width * t, i = n.height * t;
1012
+ e.drawImage(n, (a.width - r) / 2, (a.height - i) / 2, r, i);
1013
+ } finally {
1014
+ e.restore();
1015
+ }
1016
+ }
1017
+ function Rt(e, t) {
1018
+ if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw RangeError(`<CanvasView> ${t} must be a non-negative finite number.`);
1019
+ return e;
1020
+ }
1021
+ function zt(e) {
1022
+ 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
+ }
1024
+ // tools/angular-build/.stage/react/video-assets.ts
1025
+ var F = /* @__PURE__ */ new Map();
1026
+ function Bt(e) {
1027
+ let t = F.get(e);
1028
+ 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 = {
1032
+ video: n,
1033
+ error: null,
1034
+ refs: 1,
1035
+ loadListeners: /* @__PURE__ */ new Set(),
1036
+ timeListeners: /* @__PURE__ */ new Set()
1037
+ };
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);
1058
+ };
1059
+ }
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()));
1063
+ }
1064
+ // tools/angular-build/.stage/react/components/Video/video.ts
1065
+ var Gt = l("video");
1066
+ function Kt(e, t) {
1067
+ let n = t.src;
1068
+ 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();
1077
+ }
1078
+ // tools/angular-build/.stage/react/react/components.ts
1079
+ var qt = /* @__PURE__ */ new WeakMap();
1080
+ function I(t, n) {
1081
+ if (t == null || typeof t == "boolean") return [];
1082
+ if (Array.isArray(t)) return t.flatMap((e, t) => I(e, `${n}.${t}`));
1083
+ if (typeof t == "string" || typeof t == "number") return [];
1084
+ if (!e.isValidElement(t)) throw Error(`Unsupported child inside <Canvas> at ${n}. Use Canvas UI components.`);
1085
+ if (t.type === e.Fragment) return I(t.props.children, n);
1086
+ let r = t.type[c];
1087
+ if (!r) throw Error(`Unsupported component inside <Canvas> at ${n}. Use Canvas UI components.`);
1088
+ if (r === "grid") {
1089
+ let e = qt.get(t);
1090
+ if (e) return e;
1091
+ }
1092
+ let i = { ...t.props }, a = i.children;
1093
+ delete i.children;
1094
+ let o = t.key ?? (typeof i.key == "string" ? i.key : null);
1095
+ 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";
1097
+ 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
+ r === "button" && i.text === void 0 && (i.text = typeof a == "string" || typeof a == "number" ? String(a) : "");
1099
+ let l = [{
1100
+ type: r,
1101
+ key: o,
1102
+ props: i,
1103
+ children: s ? I(a, n) : []
1104
+ }];
1105
+ return r === "grid" && i.virtual === !0 && qt.set(t, l), l;
1106
+ }
1107
+ function Jt(e) {
1108
+ return I(e, "canvas");
1109
+ }
1110
+ // tools/angular-build/.stage/react/scene.ts
1111
+ var Yt = class e {
1112
+ children = [];
1113
+ parent = null;
1114
+ dirty = !0;
1115
+ type;
1116
+ props;
1117
+ constructor(e, t = {}) {
1118
+ this.type = e, this.props = t;
1119
+ }
1120
+ setProps(e) {
1121
+ this.replaceProps({
1122
+ ...this.props,
1123
+ ...e
1124
+ });
1125
+ }
1126
+ replaceProps(e) {
1127
+ let t = /* @__PURE__ */ new Set([...Object.keys(this.props), ...Object.keys(e)]), n = !1;
1128
+ for (let r of t) if (this.props[r] !== e[r]) {
1129
+ n = !0;
1130
+ break;
1131
+ }
1132
+ n && (this.props = e, this.markDirty());
1133
+ }
1134
+ markDirty() {
1135
+ this.dirty = !0, this.parent?.markDirty();
1136
+ }
1137
+ syncChildren(t, n) {
1138
+ let r = [...this.children], i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
1139
+ if (t.some((e) => typeof e.props._gridVirtualIndex == "number")) for (let e of r) typeof e.props._gridVirtualIndex == "number" && a.set(e.props._gridVirtualIndex, e);
1140
+ let o = t.map((t, o) => {
1141
+ let s = t.key === null ? null : `${t.type}:${t.key}`, c = s === null ? typeof t.props._gridVirtualIndex == "number" ? a.get(t.props._gridVirtualIndex) : r[o]?.type === t.type && (r[o].props._gridVirtualIndex === void 0 || r[o].props._gridVirtualIndex === o) && !i.has(r[o]) ? r[o] : void 0 : r.find((e) => e.props._key === s && e.type === t.type && !i.has(e)), l = c?.type === t.type && !i.has(c) ? c : void 0, u = l ?? new e(t.type);
1142
+ l ? i.add(l) : u.parent = this;
1143
+ let d = {
1144
+ ...t.props,
1145
+ _key: s
1146
+ };
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;
1148
+ });
1149
+ for (let e of r) !i.has(e) && !o.includes(e) && (n(e), e.parent = null);
1150
+ (o.length !== this.children.length || o.some((e, t) => this.children[t] !== e)) && (this.children.splice(0, this.children.length, ...o), this.markDirty());
1151
+ }
1152
+ traverse(e) {
1153
+ e(this), this.children.forEach((t) => t.traverse(e));
1154
+ }
1155
+ };
1156
+ function Xt(e, t, n) {
1157
+ let r = e.props._gridVirtualIndex;
1158
+ return e.key === null ? `${n}/i${typeof r == "number" ? r : t}` : `${n}/k${e.key}`;
1159
+ }
1160
+ // 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
1184
+ };
1185
+ function Qt(e) {
1186
+ return e;
1187
+ }
1188
+ var $t = .5, en = class {
1189
+ gridCaches = /* @__PURE__ */ new WeakMap();
1190
+ cacheEnabled = !0;
1191
+ invalidateGridCache() {
1192
+ this.gridCaches = /* @__PURE__ */ new WeakMap();
1193
+ }
1194
+ render(e, t, n = !0) {
1195
+ this.cacheEnabled = n, n || this.invalidateGridCache();
1196
+ let r = e.canvas;
1197
+ e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.clearRect(0, 0, r.width, r.height), e.restore(), this.drawNode(e, t), this.drawDialogs(e, t), this.drawDropdownOverlays(e, t), t.traverse((e) => {
1198
+ e.dirty = !1;
1199
+ });
1200
+ }
1201
+ safeDraw(e, t, n) {
1202
+ if (t) {
1203
+ e.save();
1204
+ try {
1205
+ t(e, n.props);
1206
+ } catch (e) {
1207
+ console.error(`[canvas-ui] Skipped drawing <${n.type}> after a render error:`, e);
1208
+ } finally {
1209
+ e.restore();
1210
+ }
1211
+ }
1212
+ }
1213
+ drawNode(e, t) {
1214
+ 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);
1216
+ else if (t.type === "tabs") {
1217
+ let n = L(t.props.width, 300), r = L(t.props.height, 200), i = L(t.props.headerHeight, 40);
1218
+ 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));
1220
+ e.restore();
1221
+ }
1222
+ }
1223
+ 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);
1225
+ }
1226
+ 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;
1228
+ let n = e.getTransform();
1229
+ if (n.b !== 0 || n.c !== 0 || n.a <= 0 || n.d <= 0) return !1;
1230
+ 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);
1231
+ if (l <= 0 || u <= 0 || l > 4096 || u > 4096) return !1;
1232
+ let d = this.gridCaches.get(t);
1233
+ if (!d || t.dirty || d.sourceCanvas !== e.canvas || d.width !== r || d.height !== i || d.scaleX !== n.a || d.scaleY !== n.d || d.offsetX !== s || d.offsetY !== c) {
1234
+ let a = d?.canvas ?? e.canvas.ownerDocument.createElement("canvas");
1235
+ a.width = l, a.height = u;
1236
+ let o = a.getContext("2d");
1237
+ 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 = {
1239
+ canvas: a,
1240
+ sourceCanvas: e.canvas,
1241
+ width: r,
1242
+ height: i,
1243
+ scaleX: n.a,
1244
+ scaleY: n.d,
1245
+ offsetX: s,
1246
+ offsetY: c
1247
+ }, this.gridCaches.set(t, d);
1248
+ }
1249
+ return e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.drawImage(d.canvas, a, o), e.restore(), !0;
1250
+ }
1251
+ drawDialogs(e, t) {
1252
+ if (t.props.visible !== !1) {
1253
+ if (t.type === "dialog") {
1254
+ 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);
1256
+ 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
+ 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
+ } else t.children.forEach((t) => this.drawDialogs(e, t));
1259
+ }
1260
+ }
1261
+ 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());
1263
+ }
1264
+ };
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;
1267
+ return !1;
1268
+ }
1269
+ function nn(e, t) {
1270
+ e.fillStyle = t.props.backgroundColor, e.fillRect(0, 0, L(t.props._gridItemWidth, 0), L(t.props._gridItemHeight, 0));
1271
+ }
1272
+ function rn(e, t) {
1273
+ let n = L(t.props.height, 0), r = L(t.props._gridContentHeight, n);
1274
+ if (n <= 0 || r <= n) return;
1275
+ 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;
1276
+ e.fillStyle = "rgba(0, 0, 0, 0.08)", e.fillRect(a, 0, 6, n), e.fillStyle = "rgba(0, 0, 0, 0.35)", e.beginPath(), e.roundRect(a + 1, c, 4, o, 3), e.fill();
1277
+ }
1278
+ function L(e, t) {
1279
+ return typeof e == "number" && Number.isFinite(e) ? e : t;
1280
+ }
1281
+ // tools/angular-build/.stage/react/types.ts
1282
+ var R = [
1283
+ 1,
1284
+ 0,
1285
+ 0,
1286
+ 1,
1287
+ 0,
1288
+ 0
1289
+ ];
1290
+ // tools/angular-build/.stage/react/engine/transform.ts
1291
+ 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;
1293
+ return [
1294
+ m * s + g * c,
1295
+ h * s + _ * c,
1296
+ m * l + g * u,
1297
+ h * l + _ * u,
1298
+ m * d + g * f + v,
1299
+ h * d + _ * f + y
1300
+ ];
1301
+ }
1302
+ function B(e, t, n) {
1303
+ let [r, i, a, o, s, c] = n, l = r * o - i * a;
1304
+ if (!l) return null;
1305
+ let u = e - s, d = t - c;
1306
+ return {
1307
+ x: (o * u - a * d) / l,
1308
+ y: (-i * u + r * d) / l
1309
+ };
1310
+ }
1311
+ function V(e) {
1312
+ let t = [], n = e;
1313
+ for (; n;) t.push(n), n = n.parent;
1314
+ return t.reverse().reduce((e, t) => z(e, t.props), R);
1315
+ }
1316
+ // tools/angular-build/.stage/react/engine/nodes.ts
1317
+ function H(e) {
1318
+ let t = e;
1319
+ for (; t;) {
1320
+ if (t.props.visible === !1) return !1;
1321
+ t = t.parent;
1322
+ }
1323
+ return !0;
1324
+ }
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;
1328
+ }
1329
+ function U(e) {
1330
+ if (e.type === "root") throw Error("The Canvas root is not an event target.");
1331
+ let t = e.props._key, n = typeof t == "string" ? t.indexOf(":") : -1;
1332
+ return {
1333
+ type: e.type,
1334
+ key: typeof t != "string" || n < 0 ? null : t.slice(n + 1)
1335
+ };
1336
+ }
1337
+ function on(e) {
1338
+ 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
+ }
1340
+ function sn(e) {
1341
+ 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
+ }
1343
+ function W(e, t) {
1344
+ let n = e.parent;
1345
+ for (; n;) {
1346
+ if (n === t) return !0;
1347
+ n = n.parent;
1348
+ }
1349
+ return !1;
1350
+ }
1351
+ function G(e, t) {
1352
+ let n = t && e.props._userVisible !== !1;
1353
+ e.setProps({ visible: n }), e.children.forEach((e) => G(e, n));
1354
+ }
1355
+ function K(e) {
1356
+ if (e.type === "radio" || e.type === "checkbox") return Be(e.props);
1357
+ if (e.type === "icon") {
1358
+ let t = p(e.props.size, 24);
1359
+ return {
1360
+ width: t,
1361
+ height: t
1362
+ };
1363
+ }
1364
+ if (e.type === "customDraw") return {
1365
+ width: p(e.props.width, 0),
1366
+ height: p(e.props.height, 0)
1367
+ };
1368
+ 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))
1371
+ };
1372
+ 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)
1376
+ } : {
1377
+ width: N(e.props, t),
1378
+ height: P(e.props, n)
1379
+ };
1380
+ }
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);
1387
+ if (!c || c.x < 0 || c.x > l || c.y < 0 || c.y > u) return !1;
1388
+ }
1389
+ n = n.parent;
1390
+ }
1391
+ return !0;
1392
+ }
1393
+ // tools/angular-build/.stage/react/engine/text-controls.ts
1394
+ function ln(e, t, n) {
1395
+ let r = /* @__PURE__ */ new Map();
1396
+ e.scene.traverse((e) => {
1397
+ let t = e.props._canvasInputId;
1398
+ typeof t == "string" && r.set(t, e);
1399
+ });
1400
+ let i = new Set(n.map((e) => e.id));
1401
+ 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));
1402
+ for (let i of n) {
1403
+ let n = r.get(i.id);
1404
+ 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 ?? "";
1409
+ n.setProps({
1410
+ ...n.props,
1411
+ ...i.props,
1412
+ value: o,
1413
+ _canvasInputId: i.id,
1414
+ _controlledValue: i.props.value !== void 0
1415
+ });
1416
+ let s = t.textControls.get(i.id);
1417
+ if (s) {
1418
+ s.layout = a, e.inputBridge.update(i.id, {
1419
+ ...i.props,
1420
+ value: o
1421
+ }, a);
1422
+ continue;
1423
+ }
1424
+ let c = {
1425
+ input: (e, r) => {
1426
+ n.props._controlledValue !== !0 && t.inputValues.set(i.id, e), n.setProps({
1427
+ value: e,
1428
+ cursorPos: r
1429
+ });
1430
+ let a = n.props.onChange;
1431
+ typeof a == "function" && a(e);
1432
+ },
1433
+ selection: (e) => n.setProps({ cursorPos: e }),
1434
+ focus: () => {
1435
+ n.setProps({ focused: !0 });
1436
+ let e = n.props.onFocus;
1437
+ typeof e == "function" && e();
1438
+ },
1439
+ blur: () => {
1440
+ n.setProps({ focused: !1 });
1441
+ let e = n.props.onBlur;
1442
+ typeof e == "function" && e();
1443
+ },
1444
+ scroll: (e, t, r, i) => {
1445
+ (n.props._scrollTop !== e || n.props._scrollHeight !== t || n.props._scrollClientHeight !== r || n.props._scrollClientWidth !== i) && n.setProps({
1446
+ _scrollTop: e,
1447
+ _scrollHeight: t,
1448
+ _scrollClientHeight: r,
1449
+ _scrollClientWidth: i
1450
+ });
1451
+ }
1452
+ }, l = e.inputBridge.mount(i.id, {
1453
+ ...i.props,
1454
+ value: o
1455
+ }, a, c);
1456
+ t.textControls.set(i.id, {
1457
+ node: n,
1458
+ dispose: l,
1459
+ layout: a
1460
+ });
1461
+ }
1462
+ }
1463
+ 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));
1474
+ let n = t.props._canvasInputId;
1475
+ typeof n == "string" && (e.textControls.get(n)?.dispose(), e.textControls.delete(n), e.inputValues.delete(n));
1476
+ }
1477
+ // tools/angular-build/.stage/react/engine/images.ts
1478
+ function dn(e, t, n) {
1479
+ let r = /* @__PURE__ */ new Set(), i = (e) => e.forEach((e) => {
1480
+ e.type === "image" && typeof e.props.src == "string" && e.props.src && r.add(e.props.src), i(e.children);
1481
+ });
1482
+ i(n);
1483
+ for (let [e, n] of t.imageSubscriptions) r.has(e) || (n(), t.imageSubscriptions.delete(e));
1484
+ for (let n of r) {
1485
+ if (t.imageSubscriptions.has(n)) continue;
1486
+ let r = _t(n, (t) => {
1487
+ e.scene.markDirty(), t && e.scene.traverse((e) => {
1488
+ e.type === "image" && e.props.src === n && e.props.onError?.(t);
1489
+ });
1490
+ });
1491
+ t.imageSubscriptions.set(n, r);
1492
+ }
1493
+ }
1494
+ // 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);
1515
+ }
1516
+ }
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) => {
1521
+ if (e.type !== "video") return;
1522
+ r.add(e);
1523
+ 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) {
1527
+ t.videoFrames.set(e, {
1528
+ src: i,
1529
+ time: -1,
1530
+ playing: !1
1531
+ }), n = !0;
1532
+ return;
1533
+ }
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();
1539
+ }
1540
+ // 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);
1544
+ return {
1545
+ child: e,
1546
+ index: t,
1547
+ top: n,
1548
+ bottom: n + p(e.props._availableHeight, 0),
1549
+ maxBottom: 0
1550
+ };
1551
+ });
1552
+ n.sort((e, t) => e.top - t.top || e.index - t.index);
1553
+ let r = -Infinity;
1554
+ for (let e of n) r = Math.max(r, e.bottom), e.maxBottom = r;
1555
+ return {
1556
+ token: e.props._gridCacheToken,
1557
+ width: t.width,
1558
+ contentHeight: t.contentHeight,
1559
+ entries: n
1560
+ };
1561
+ }
1562
+ function hn(e, t, n, r) {
1563
+ let i = t - r, a = t + n + r, o = 0, s = e.entries.length;
1564
+ for (; o < s;) {
1565
+ let t = Math.floor((o + s) / 2);
1566
+ e.entries[t].maxBottom < i ? o = t + 1 : s = t;
1567
+ }
1568
+ let c = [];
1569
+ for (let t = o; t < e.entries.length; t++) {
1570
+ let n = e.entries[t];
1571
+ if (n.top > a) break;
1572
+ n.bottom >= i && c.push(n);
1573
+ }
1574
+ return c.sort((e, t) => e.index - t.index).map(({ child: e, index: n }) => ({
1575
+ ...e,
1576
+ props: {
1577
+ ...e.props,
1578
+ _gridVirtualIndex: n,
1579
+ _gridBaseY: e.props.y,
1580
+ y: p(e.props.y, 0) - t
1581
+ }
1582
+ }));
1583
+ }
1584
+ function gn(e) {
1585
+ let t = e.props.columns, n = e.props.cellWidth, r = e.props.width, i = e.props.cellHeight, a = e.props.gap ?? 0;
1586
+ if (!Number.isInteger(t) || t < 1) throw RangeError("Grid columns must be a positive integer.");
1587
+ if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw RangeError("Grid cellHeight must be a positive finite number.");
1588
+ if (typeof a != "number" || !Number.isFinite(a) || a < 0) throw RangeError("Grid gap must be a non-negative finite number.");
1589
+ if (r !== void 0 && (typeof r != "number" || !Number.isFinite(r) || r <= 0)) throw RangeError("Grid width must be a positive finite number when provided.");
1590
+ if (e.props.height !== void 0 && (typeof e.props.height != "number" || !Number.isFinite(e.props.height) || e.props.height <= 0)) throw RangeError("Grid height must be a positive finite number when provided.");
1591
+ let o = n === void 0 ? typeof r == "number" && Number.isFinite(r) && r > 0 ? (r - a * (t - 1)) / t : NaN : n;
1592
+ if (typeof o != "number" || !Number.isFinite(o) || o <= 0) throw RangeError("Grid requires a positive finite cellWidth, or a positive width large enough for its columns and gaps.");
1593
+ let s = typeof r == "number" && Number.isFinite(r) ? r : o * t + a * (t - 1), c = /* @__PURE__ */ new Set(), l = 0, u = 0;
1594
+ return {
1595
+ children: e.children.map((e) => {
1596
+ let n = e.type === "gridItem", r = n ? e.props.columnSpan ?? 1 : 1, s = n ? e.props.rowSpan ?? 1 : 1;
1597
+ if (!Number.isInteger(r) || r < 1 || r > t) throw RangeError("GridItem columnSpan must be a positive integer no greater than Grid columns.");
1598
+ if (!Number.isInteger(s) || s < 1) throw RangeError("GridItem rowSpan must be a positive integer.");
1599
+ 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;
1601
+ for (let e = d; e < d + s; e++) for (let t = f; t < f + r; t++) c.add(`${e}:${t}`);
1602
+ 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);
1604
+ return {
1605
+ ...e,
1606
+ props: {
1607
+ ...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,
1612
+ ...n ? {
1613
+ _gridItemWidth: m,
1614
+ _gridItemHeight: h
1615
+ } : {}
1616
+ },
1617
+ children: n ? _n(e.children, m, h) : e.children
1618
+ };
1619
+ }),
1620
+ contentHeight: u,
1621
+ width: s
1622
+ };
1623
+ }
1624
+ function _n(e, t, n) {
1625
+ return e.map((e) => ({
1626
+ ...e,
1627
+ props: {
1628
+ ...e.props,
1629
+ _availableWidth: t,
1630
+ _availableHeight: n
1631
+ }
1632
+ }));
1633
+ }
1634
+ function vn(e, t, n, r, i) {
1635
+ for (let a = t; a < t + i; a++) for (let t = n; t < n + r; t++) if (e.has(`${a}:${t}`)) return !1;
1636
+ return !0;
1637
+ }
1638
+ function yn(e, t, n) {
1639
+ return e.map((e) => ({
1640
+ ...e,
1641
+ props: {
1642
+ ...e.props,
1643
+ x: p(e.props.x, 0) + t,
1644
+ y: p(e.props.y, 0) + n
1645
+ }
1646
+ }));
1647
+ }
1648
+ function J(e, t) {
1649
+ return e.map((e) => {
1650
+ let n = typeof e.props._userVisible == "boolean" ? e.props._userVisible : e.props.visible !== !1, r = t && n;
1651
+ return {
1652
+ ...e,
1653
+ props: {
1654
+ ...e.props,
1655
+ visible: r,
1656
+ _userVisible: n
1657
+ },
1658
+ children: J(e.children, r)
1659
+ };
1660
+ });
1661
+ }
1662
+ function bn(e, t, n, r) {
1663
+ return t ? e === t.from ? -t.direction * r * n : e === t.to ? t.direction * r * (1 - n) : 0 : 0;
1664
+ }
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;
1667
+ return {
1668
+ width: r,
1669
+ height: t,
1670
+ maxScroll: i,
1671
+ thumbHeight: a,
1672
+ trackX: Math.max(0, r - 6),
1673
+ thumbY: i > 0 ? (t - a) * p(e._scrollTop, 0) / i : 0
1674
+ };
1675
+ }
1676
+ // tools/angular-build/.stage/react/engine/carousel.ts
1677
+ function Sn(e, t) {
1678
+ return e.duration <= 0 ? 1 : Math.max(0, Math.min(1, (t - e.startedAt) / e.duration));
1679
+ }
1680
+ function Cn(e, t, n, r) {
1681
+ let i = p(e.props.width, 300);
1682
+ 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);
1685
+ });
1686
+ }
1687
+ function wn(e, t, n) {
1688
+ for (let e of t.textControls.values()) W(e.node, n) && (e.layout = {
1689
+ ...e.layout,
1690
+ transform: V(e.node)
1691
+ });
1692
+ q(e, t);
1693
+ }
1694
+ function Tn(e, t, n, r) {
1695
+ let i = n.children.filter((e) => e.type === "carouselItem");
1696
+ if (!i.length) return;
1697
+ let a = p(n.props._activeIndex, 0), o = lt(r, a, i.length, n.props.loop !== !1);
1698
+ if (o === a) return;
1699
+ let s = String(n.props._stateKey ?? "");
1700
+ if (t.carouselTransitions.has(s)) return;
1701
+ let c = Math.max(0, p(n.props.transitionDuration, 450));
1702
+ if (c > 0) {
1703
+ let i = {
1704
+ from: a,
1705
+ to: o,
1706
+ direction: r > a ? 1 : -1,
1707
+ startedAt: t.currentFrameTime,
1708
+ duration: c
1709
+ };
1710
+ t.carouselTransitions.set(s, i), t.carouselFrameTimes.set(s, t.currentFrameTime), n.setProps({
1711
+ _activeIndex: o,
1712
+ _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);
1714
+ } 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);
1716
+ }), q(e, t)), n.props.onChange?.(o);
1717
+ }
1718
+ function En(e, t, n) {
1719
+ 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);
1728
+ 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);
1733
+ }
1734
+ return;
1735
+ }
1736
+ if (!H(i) || i.props.autoplay === !1 || i.children.filter((e) => e.type === "carouselItem").length < 2) {
1737
+ t.carouselFrameTimes.delete(a);
1738
+ return;
1739
+ }
1740
+ let s = t.carouselFrameTimes.get(a);
1741
+ if (s === void 0) {
1742
+ t.carouselFrameTimes.set(a, n);
1743
+ return;
1744
+ }
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));
1747
+ });
1748
+ for (let e of t.carouselFrameTimes.keys()) r.has(e) || t.carouselFrameTimes.delete(e);
1749
+ for (let e of t.carouselTransitions.keys()) r.has(e) || t.carouselTransitions.delete(e);
1750
+ }
1751
+ // tools/angular-build/.stage/react/engine/layout.ts
1752
+ var Dn = 100;
1753
+ function On(e) {
1754
+ return ge(e);
1755
+ }
1756
+ function kn(e) {
1757
+ let t = p(e.props.height, 0);
1758
+ if (t > 0) return t;
1759
+ let n = Dn;
1760
+ 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);
1763
+ }
1764
+ return n;
1765
+ }
1766
+ function An(e, t) {
1767
+ let n = e[t];
1768
+ return Array.isArray(n) ? n.join(",") : typeof n == "string" ? n : "";
1769
+ }
1770
+ function jn(e, t, n, r) {
1771
+ let i = n.activeKey;
1772
+ if (typeof i == "string") return i;
1773
+ let a = e.tabSelections.get(t), o = typeof n.defaultActiveKey == "string" ? n.defaultActiveKey : String(r[0]?.props.id ?? ""), s = a ?? o;
1774
+ return e.tabSelections.set(t, s), s;
1775
+ }
1776
+ function Mn(e, t, n) {
1777
+ if (Array.isArray(n.activeKeys)) {
1778
+ let e = n.activeKeys.filter((e) => typeof e == "string");
1779
+ return new Set(n.accordion ? e.slice(0, 1) : e);
1780
+ }
1781
+ 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
+ return e.collapseSelections.set(t, o), o;
1783
+ }
1784
+ function Nn(e, t) {
1785
+ let n = p(e.props.headerHeight, 40), r = p(e.props.width, 300), i = 0;
1786
+ for (let a of e.children) {
1787
+ if (a.type !== "collapseItem") continue;
1788
+ let e = t.has(String(a.props.id ?? ""));
1789
+ a.setProps({
1790
+ y: i + p(a.props._userY, 0),
1791
+ _expanded: e,
1792
+ _collapseWidth: r,
1793
+ _collapseHeaderHeight: n
1794
+ }), a.children.forEach((t) => G(t, e)), i += n + (e ? Pn(a) : 0);
1795
+ }
1796
+ }
1797
+ function Pn(e) {
1798
+ return p(e.props._collapseBodyHeight, p(e.props.height, Dn));
1799
+ }
1800
+ function Fn(e, t, n, r, i, a, o) {
1801
+ 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 };
1803
+ if (f._userVisible = typeof l._userVisible == "boolean" ? l._userVisible : l.visible !== !1, n.type === "text") {
1804
+ let e = On(f);
1805
+ f._textWidth = e.width, f._textHeight = e.height;
1806
+ }
1807
+ if (n.type === "input" || n.type === "datePicker" || n.type === "textarea") {
1808
+ let e = `${n.type}:${c}`;
1809
+ f._canvasInputId = e, f._controlledValue = l.value !== void 0, o.push({
1810
+ id: e,
1811
+ props: l,
1812
+ layout: {
1813
+ width: p(l.width, 200),
1814
+ height: p(l.height, 36),
1815
+ transform: u,
1816
+ visible: d
1817
+ }
1818
+ });
1819
+ }
1820
+ let m = n.children;
1821
+ if (n.type === "grid") {
1822
+ let e = c;
1823
+ if (l.virtual === !0 && typeof l.height != "number") throw RangeError("Virtual Grid requires a positive finite height.");
1824
+ 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) => ({
1828
+ ...e,
1829
+ props: {
1830
+ ...e.props,
1831
+ _gridBaseY: e.props.y,
1832
+ y: p(e.props.y, 0) - o
1833
+ }
1834
+ }));
1835
+ }
1836
+ if (n.type === "dialog") {
1837
+ 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);
1840
+ } 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);
1842
+ f._activeKey = r, f._tabItems = e.map((e) => ({
1843
+ title: e.props.title,
1844
+ disabled: e.props.disabled,
1845
+ selected: e.props.id === r
1846
+ }));
1847
+ let i = p(l.headerHeight, 40);
1848
+ m = m.map((e) => ({
1849
+ ...e,
1850
+ props: {
1851
+ ...e.props,
1852
+ visible: e.type !== "tabItem" || e.props.visible !== !1 && e.props.id === r,
1853
+ _userVisible: e.props._userVisible ?? e.props.visible !== !1
1854
+ },
1855
+ children: e.type === "tabItem" ? J(yn(e.children, 0, i), e.props.visible !== !1 && e.props.id === r) : e.children
1856
+ })), f._stateKey = n;
1857
+ } 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);
1859
+ o && r !== void 0 && i !== o.to && (t.carouselTransitions.delete(n), o = void 0);
1860
+ 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) => ({
1864
+ ...t,
1865
+ props: {
1866
+ ...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,
1869
+ visible: t.type !== "carouselItem" || t.props.visible !== !1 && (o ? e.indexOf(t) === o.from || e.indexOf(t) === o.to : e[s] === t),
1870
+ _userVisible: t.props._userVisible ?? t.props.visible !== !1
1871
+ },
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
1873
+ }));
1874
+ } 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) => {
1877
+ if (e.type !== "collapseItem") return e;
1878
+ let t = n.has(String(e.props.id ?? "")), o = kn(e), s = t ? o : 0, c = {
1879
+ ...e,
1880
+ props: {
1881
+ ...e.props,
1882
+ x: p(e.props.x, 0),
1883
+ y: a + p(e.props.y, 0),
1884
+ _userY: p(e.props.y, 0),
1885
+ visible: e.props.visible !== !1,
1886
+ _userVisible: e.props._userVisible ?? e.props.visible !== !1,
1887
+ _expanded: t,
1888
+ _collapseWidth: i,
1889
+ _collapseHeaderHeight: r,
1890
+ _collapseBodyHeight: o,
1891
+ backgroundColor: e.props.backgroundColor ?? l.backgroundColor,
1892
+ textColor: e.props.textColor ?? l.textColor,
1893
+ borderColor: e.props.borderColor ?? l.borderColor
1894
+ },
1895
+ children: J(yn(e.children, 0, r), t && e.props.visible !== !1)
1896
+ };
1897
+ return a += r + s, c;
1898
+ }), f._stateKey = e, f._activeKeys = [...n];
1899
+ }
1900
+ return {
1901
+ ...n,
1902
+ props: f,
1903
+ children: Fn(e, t, m, u, d, c, o)
1904
+ };
1905
+ });
1906
+ }
1907
+ // tools/angular-build/.stage/react/engine/hit-test.ts
1908
+ function Y(e, t, n, r) {
1909
+ let i = t.getBoundingClientRect();
1910
+ return !i.width || !i.height ? null : {
1911
+ x: (n - i.left) * t.width / i.width / e.pixelRatio,
1912
+ y: (r - i.top) * t.height / i.height / e.pixelRatio
1913
+ };
1914
+ }
1915
+ function X(e, t, n, r, i) {
1916
+ let a = t.getBoundingClientRect();
1917
+ if (!a.width || !a.height) return null;
1918
+ 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);
1920
+ if (e === i) return c = B(o, s, n), !0;
1921
+ for (let t of e.children) if (l(t, n)) return !0;
1922
+ return !1;
1923
+ };
1924
+ return l(e.scene, R), c;
1925
+ }
1926
+ function Z(e, t, n, r, i) {
1927
+ let a = i.parent;
1928
+ for (; a;) {
1929
+ 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);
1931
+ if (!i || i.x < 0 || i.x > o || i.y < 0 || i.y > s) return !1;
1932
+ }
1933
+ a = a.parent;
1934
+ }
1935
+ return !0;
1936
+ }
1937
+ function Q(e, t, n, r) {
1938
+ let i = t.getBoundingClientRect();
1939
+ 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({
1945
+ node: e,
1946
+ transform: i
1947
+ }), e.children.forEach((e) => c(e, i, r));
1948
+ };
1949
+ c(e.scene, R, !0);
1950
+ let l = [...s].reverse().find((e) => e.node.type === "dialog");
1951
+ for (let i = s.length - 1; i >= 0; i--) {
1952
+ 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;
1954
+ let u = B(a, o, c.transform);
1955
+ if (!u) continue;
1956
+ let { width: d, height: f } = K(c.node), p = M(c.node.props.options).length * f;
1957
+ if (u.x >= 0 && u.x <= d && u.y >= f && u.y <= f + p) return {
1958
+ node: c.node,
1959
+ x: u.x,
1960
+ y: u.y
1961
+ };
1962
+ }
1963
+ for (let i = s.length - 1; i >= 0; i--) {
1964
+ let c = s[i];
1965
+ if (l && c.node !== l.node && !W(c.node, l.node) || !Z(e, t, n, r, c.node)) continue;
1966
+ let u = B(a, o, c.transform);
1967
+ if (!u) continue;
1968
+ if (c.node.type === "customDraw") {
1969
+ let { width: e, height: t } = K(c.node);
1970
+ if (u.x < 0 || u.x > e || u.y < 0 || u.y > t) continue;
1971
+ let n = c.node.props.hitTest;
1972
+ if (typeof n == "function" && !n(u.x, u.y, {
1973
+ width: e,
1974
+ height: t
1975
+ })) continue;
1976
+ return {
1977
+ node: c.node,
1978
+ x: u.x,
1979
+ y: u.y
1980
+ };
1981
+ }
1982
+ if (c.node.type === "canvasView") {
1983
+ let e = c.node.props.source;
1984
+ if (!on(e) || !e.width || !e.height) continue;
1985
+ let { width: t, height: n } = K(c.node);
1986
+ if (u.x < 0 || u.x > t || u.y < 0 || u.y > n) continue;
1987
+ if ((c.node.props.fit ?? "contain") === "contain") {
1988
+ 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;
1989
+ if (u.x < o || u.x > o + i || u.y < s || u.y > s + a) continue;
1990
+ }
1991
+ return {
1992
+ node: c.node,
1993
+ x: u.x,
1994
+ y: u.y
1995
+ };
1996
+ }
1997
+ if (c.node.type === "dialog") return {
1998
+ node: c.node,
1999
+ x: u.x,
2000
+ y: u.y
2001
+ };
2002
+ if (c.node.type === "tabs") {
2003
+ let e = p(c.node.props.width, 300), t = p(c.node.props.height, 200);
2004
+ if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2005
+ node: c.node,
2006
+ x: u.x,
2007
+ y: u.y
2008
+ };
2009
+ continue;
2010
+ }
2011
+ if (c.node.type === "carousel") {
2012
+ let e = p(c.node.props.width, 300), t = p(c.node.props.height, 180);
2013
+ if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2014
+ node: c.node,
2015
+ x: u.x,
2016
+ y: u.y
2017
+ };
2018
+ continue;
2019
+ }
2020
+ if (c.node.type === "grid") {
2021
+ 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);
2023
+ if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2024
+ node: c.node,
2025
+ x: u.x,
2026
+ y: u.y
2027
+ };
2028
+ continue;
2029
+ }
2030
+ 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);
2032
+ if (u.x >= 0 && u.x <= e && u.y >= 0 && u.y <= t) return {
2033
+ node: c.node,
2034
+ x: u.x,
2035
+ y: u.y
2036
+ };
2037
+ continue;
2038
+ }
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 {
2041
+ node: c.node,
2042
+ x: u.x,
2043
+ y: u.y
2044
+ };
2045
+ }
2046
+ return null;
2047
+ }
2048
+ function In(e, t, n, r) {
2049
+ let i = [], a = [];
2050
+ e.scene.traverse((e) => {
2051
+ e.type === "dialog" && e.props.open === !0 && H(e) && a.push(e), e.type === "carousel" && H(e) && i.push(e);
2052
+ });
2053
+ let o = a[a.length - 1];
2054
+ for (let a of i.reverse()) {
2055
+ if (o && !W(a, o)) continue;
2056
+ let i = X(e, t, n, r, a);
2057
+ 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);
2059
+ if (d !== void 0) return {
2060
+ node: a,
2061
+ index: d
2062
+ };
2063
+ }
2064
+ return null;
2065
+ }
2066
+ function Ln(e, t, n, r) {
2067
+ let i = [];
2068
+ e.scene.traverse((e) => {
2069
+ e.type === "grid" && typeof e.props.height == "number" && i.push(e);
2070
+ });
2071
+ for (let a of i.reverse()) {
2072
+ if (!Z(e, t, n, r, a)) continue;
2073
+ let i = X(e, t, n, r, a);
2074
+ if (!i) continue;
2075
+ let o = xn(a.props);
2076
+ if (!(o.maxScroll <= 0 || i.x < o.trackX || i.x > o.width || i.y < o.thumbY || i.y > o.thumbY + o.thumbHeight)) return {
2077
+ node: a,
2078
+ pointerY: i.y,
2079
+ scrollTop: p(a.props._scrollTop, 0)
2080
+ };
2081
+ }
2082
+ return null;
2083
+ }
2084
+ // tools/angular-build/.stage/react/engine/events.ts
2085
+ function Rn(e, t, n, r, i) {
2086
+ e.onEvent?.({
2087
+ type: t,
2088
+ target: r ? U(r.node) : null,
2089
+ x: i.x,
2090
+ y: i.y,
2091
+ localX: r?.x,
2092
+ localY: r?.y,
2093
+ pointerId: n.pointerId
2094
+ });
2095
+ }
2096
+ function $(e, t, n, r, i) {
2097
+ let a = t.props.source;
2098
+ if (!on(a)) return;
2099
+ let { width: o, height: s } = K(t);
2100
+ if (!o || !s || !a.width || !a.height) return;
2101
+ 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
+ typeof g == "function" && g({
2103
+ type: e,
2104
+ source: a,
2105
+ x: n,
2106
+ y: r,
2107
+ sourceX: m,
2108
+ sourceY: h,
2109
+ sourceWidth: a.width,
2110
+ sourceHeight: a.height,
2111
+ pointerId: i.pointerId,
2112
+ pointerType: i.pointerType,
2113
+ pressure: i.pressure,
2114
+ isPrimary: i.isPrimary,
2115
+ button: i.button,
2116
+ buttons: i.buttons
2117
+ });
2118
+ }
2119
+ // 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 ? {
2122
+ node: a,
2123
+ x: o?.x ?? 0,
2124
+ y: o?.y ?? 0
2125
+ } : Q(e, n.currentTarget, n.clientX, n.clientY), c = Y(e, n.currentTarget, n.clientX, n.clientY);
2126
+ if (c && (t.pointerSequences.set(n.pointerId, {
2127
+ target: s?.node ?? null,
2128
+ x: c.x,
2129
+ y: c.y,
2130
+ 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();
2133
+ return;
2134
+ }
2135
+ if (i) {
2136
+ t.activeGridScroll = i, n.currentTarget.setPointerCapture(n.pointerId), n.preventDefault();
2137
+ return;
2138
+ }
2139
+ if (qn(e.scene, s?.node), !s || s.node.props.disabled) return;
2140
+ 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);
2143
+ else if (l.type === "radio") {
2144
+ let e = He(l.props, u, d), t = e && !e.disabled ? We(l.props.value, e) : void 0;
2145
+ if (t === void 0) return;
2146
+ l.props._controlledValue !== !0 && l.setProps({ value: t }), l.props.onChange?.(t);
2147
+ } else if (l.type === "checkbox") {
2148
+ let e = He(l.props, u, d);
2149
+ if (!e || e.disabled) return;
2150
+ let t = Ge(l.props.value, e);
2151
+ 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);
2154
+ 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));
2156
+ if (n === void 0) return;
2157
+ Wn(e, t, l, n);
2158
+ } 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);
2161
+ return d >= t && d <= t + n;
2162
+ });
2163
+ if (r && !r.props.disabled && typeof r.props.id == "string") Gn(e, t, l, r);
2164
+ else return;
2165
+ } else if (l.type === "dialog") {
2166
+ Kn(l, u, d), n.preventDefault();
2167
+ return;
2168
+ } else if (l.type === "dropdown") {
2169
+ let e = p(l.props.height, 36);
2170
+ 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 });
2173
+ } else l.setProps({ open: !0 });
2174
+ } else if (l.type !== "customDraw" && l.type !== "canvasView" && l.type !== "text" && l.type !== "image" && l.type !== "icon") return;
2175
+ n.currentTarget.setPointerCapture(n.pointerId), n.preventDefault();
2176
+ }
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);
2180
+ let a = t.pointerSequences.get(n.pointerId), o = a?.target?.type === "canvasView" ? a.target : r?.node.type === "canvasView" ? r.node : null;
2181
+ if (o) {
2182
+ let t = o === r?.node ? r : X(e, n.currentTarget, n.clientX, n.clientY, o);
2183
+ t && $("pointermove", o, t.x, t.y, n);
2184
+ }
2185
+ if (t.activeGridScroll) {
2186
+ let r = t.activeGridScroll, i = X(e, n.currentTarget, n.clientX, n.clientY, r.node);
2187
+ 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);
2190
+ }
2191
+ return;
2192
+ }
2193
+ if (!t.activeSlider) return;
2194
+ let s = X(e, n.currentTarget, n.clientX, n.clientY, t.activeSlider);
2195
+ s && Jn(t.activeSlider, s.x);
2196
+ }
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);
2199
+ if (t.pointerSequences.delete(n.pointerId), a) {
2200
+ Rn(e, r ? "pointercancel" : "pointerup", n, i, a);
2201
+ let t = o?.target?.type === "canvasView" ? o.target : i?.node.type === "canvasView" ? i.node : null;
2202
+ if (t) {
2203
+ let i = X(e, n.currentTarget, n.clientX, n.clientY, t);
2204
+ i && $(r ? "pointercancel" : "pointerup", t, i.x, i.y, n);
2205
+ }
2206
+ if (!r && o?.eligible && o.target === (i?.node ?? null) && Math.hypot(a.x - o.x, a.y - o.y) <= 8) {
2207
+ if (e.onEvent?.({
2208
+ type: "click",
2209
+ target: i ? U(i.node) : null,
2210
+ x: a.x,
2211
+ y: a.y,
2212
+ localX: i?.x,
2213
+ localY: i?.y,
2214
+ 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")) {
2216
+ let e = i.node.props.onClick;
2217
+ typeof e == "function" && e();
2218
+ }
2219
+ if (i?.node.type === "customDraw") {
2220
+ let e = i.node.props.onClick;
2221
+ if (typeof e == "function") {
2222
+ let t = K(i.node);
2223
+ e({
2224
+ x: i.x,
2225
+ y: i.y,
2226
+ canvasX: a.x,
2227
+ canvasY: a.y,
2228
+ width: t.width,
2229
+ height: t.height,
2230
+ pointerId: n.pointerId
2231
+ });
2232
+ }
2233
+ }
2234
+ }
2235
+ }
2236
+ if (t.activeSlider = null, t.activeGridScroll = null, t.activeButton) {
2237
+ let e = t.activeButton;
2238
+ ft(e, !1), i?.node === e && pt(e), t.activeButton = null;
2239
+ }
2240
+ n.currentTarget.hasPointerCapture(n.pointerId) && n.currentTarget.releasePointerCapture(n.pointerId);
2241
+ }
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);
2244
+ i && e.onEvent?.({
2245
+ type: "wheel",
2246
+ target: r ? U(r.node) : null,
2247
+ x: i.x,
2248
+ y: i.y,
2249
+ localX: r?.x,
2250
+ localY: r?.y,
2251
+ deltaY: n.deltaY
2252
+ });
2253
+ let a = r?.node ?? null;
2254
+ for (; a && a.type !== "grid";) a = a.parent;
2255
+ 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);
2257
+ if (!o || o.x < 0 || o.x > s || o.y < 0 || o.y > c || l <= c) return;
2258
+ let u = n.currentTarget.getBoundingClientRect();
2259
+ 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();
2264
+ }
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));
2267
+ if (a === n.props._scrollTop) return !1;
2268
+ n.setProps({ _scrollTop: a });
2269
+ let o = String(n.props._gridStateKey ?? "");
2270
+ 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 = {
2273
+ ...e.layout,
2274
+ transform: V(e.node)
2275
+ });
2276
+ return q(e, t), n.props.onScroll?.(a), !0;
2277
+ }
2278
+ function Wn(e, t, n, r) {
2279
+ let i = String(n.props._stateKey ?? "");
2280
+ n.props.activeKey === void 0 && (t.tabSelections.set(i, r), n.setProps({
2281
+ _activeKey: r,
2282
+ _tabItems: n.children.map((e) => ({
2283
+ title: e.props.title,
2284
+ disabled: e.props.disabled,
2285
+ selected: e.props.id === r
2286
+ }))
2287
+ }), n.children.forEach((e) => {
2288
+ e.type === "tabItem" && G(e, e.props.id === r);
2289
+ }), q(e, t)), n.props.onChange?.(r);
2290
+ }
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]);
2294
+ }
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;
2297
+ if (!l && e.props.closeOnBackdrop !== !1) {
2298
+ e.props.onCancel?.();
2299
+ return;
2300
+ }
2301
+ let u = o + i - 44;
2302
+ !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
+ }
2304
+ function qn(e, t) {
2305
+ e.traverse((e) => {
2306
+ e !== t && e.type === "dropdown" && e.props.open && e.setProps({ open: !1 });
2307
+ });
2308
+ }
2309
+ function Jn(e, t) {
2310
+ let { width: n } = K(e), r = Me(e.props, n, t);
2311
+ r !== void 0 && e.props.value !== r && (e.setProps({ value: r }), e.props.onChange?.(r));
2312
+ }
2313
+ // tools/angular-build/.stage/react/engine/state.ts
2314
+ var Yn = class {
2315
+ textControls = /* @__PURE__ */ new Map();
2316
+ inputValues = /* @__PURE__ */ new Map();
2317
+ imageSubscriptions = /* @__PURE__ */ new Map();
2318
+ videoSubscriptions = /* @__PURE__ */ new Map();
2319
+ videoFrames = /* @__PURE__ */ new Map();
2320
+ tabSelections = /* @__PURE__ */ new Map();
2321
+ carouselSelections = /* @__PURE__ */ new Map();
2322
+ carouselFrameTimes = /* @__PURE__ */ new Map();
2323
+ carouselTransitions = /* @__PURE__ */ new Map();
2324
+ collapseSelections = /* @__PURE__ */ new Map();
2325
+ gridScrollPositions = /* @__PURE__ */ new Map();
2326
+ virtualGridLayouts = /* @__PURE__ */ new Map();
2327
+ activeVirtualGridKeys = /* @__PURE__ */ new Set();
2328
+ pointerSequences = /* @__PURE__ */ new Map();
2329
+ activeSlider = null;
2330
+ activeButton = null;
2331
+ activeGridScroll = null;
2332
+ currentFrameTime = 0;
2333
+ }, Xn = class {
2334
+ scene = new Yt("root");
2335
+ renderer = new en();
2336
+ state = new Yn();
2337
+ context;
2338
+ core;
2339
+ animationFrame = null;
2340
+ themeObserver = null;
2341
+ running = !1;
2342
+ tree = [];
2343
+ constructor(e, t, n, r = 1, i) {
2344
+ this.context = e, this.core = {
2345
+ scene: this.scene,
2346
+ renderer: this.renderer,
2347
+ context: e,
2348
+ inputBridge: t,
2349
+ pixelRatio: r,
2350
+ onFrame: n,
2351
+ onEvent: i,
2352
+ refreshVirtualGrids: () => this.reconcile()
2353
+ };
2354
+ }
2355
+ update(e) {
2356
+ this.tree = e;
2357
+ for (let [e, t] of this.state.virtualGridLayouts) t.token === void 0 && this.state.virtualGridLayouts.delete(e);
2358
+ this.reconcile();
2359
+ }
2360
+ reconcile() {
2361
+ let e = [];
2362
+ this.state.activeVirtualGridKeys.clear();
2363
+ let t = Fn(this.core, this.state, this.tree, R, !0, "root", e);
2364
+ 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);
2366
+ }
2367
+ render() {
2368
+ this.renderer.render(this.context, this.scene);
2369
+ }
2370
+ requestRender() {
2371
+ this.renderer.invalidateGridCache(), this.scene.markDirty();
2372
+ }
2373
+ renderTo(e, t, n) {
2374
+ e.save(), e.scale(t, n), this.renderer.render(e, this.scene, !1), e.restore();
2375
+ }
2376
+ start() {
2377
+ if (this.running) return;
2378
+ this.running = !0;
2379
+ let e = this.context.canvas.ownerDocument.defaultView?.MutationObserver;
2380
+ if (e) {
2381
+ this.themeObserver = new e(() => {
2382
+ ce(), this.renderer.invalidateGridCache(), this.scene.markDirty();
2383
+ });
2384
+ let t = this.context.canvas;
2385
+ for (; t;) this.themeObserver.observe(t, {
2386
+ attributes: !0,
2387
+ attributeFilter: ["class", "style"]
2388
+ }), t = t.parentElement;
2389
+ }
2390
+ 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)));
2392
+ };
2393
+ this.animationFrame = requestAnimationFrame(t);
2394
+ }
2395
+ pointerDown(e) {
2396
+ zn(this.core, this.state, e);
2397
+ }
2398
+ pointerMove(e) {
2399
+ Bn(this.core, this.state, e);
2400
+ }
2401
+ pointerUp(e, t = !1) {
2402
+ Vn(this.core, this.state, e, t);
2403
+ }
2404
+ wheel(e) {
2405
+ Hn(this.core, this.state, e);
2406
+ }
2407
+ destroy() {
2408
+ this.running = !1, this.animationFrame !== null && cancelAnimationFrame(this.animationFrame), this.animationFrame = null, this.themeObserver?.disconnect(), this.themeObserver = null;
2409
+ 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();
2411
+ }
2412
+ };
2413
+ // tools/angular-build/.stage/react/input-bridge.ts
2414
+ function Zn(e, t) {
2415
+ let n = "padding" in e && typeof e.padding == "number" ? e.padding : 8, r = typeof e.fontSize == "number" ? e.fontSize : 14;
2416
+ return {
2417
+ fontFamily: ("fontFamily" in e && typeof e.fontFamily == "string" ? e.fontFamily : "") || "sans-serif",
2418
+ fontSize: `${r}px`,
2419
+ letterSpacing: "0px",
2420
+ fontKerning: "auto",
2421
+ textRendering: "auto",
2422
+ paddingLeft: `${n}px`,
2423
+ paddingRight: `${n}px`,
2424
+ ...t ? {
2425
+ paddingTop: `${n}px`,
2426
+ paddingBottom: `${n}px`,
2427
+ lineHeight: "1.35",
2428
+ overflowY: "auto",
2429
+ overflowX: "hidden"
2430
+ } : {}
2431
+ };
2432
+ }
2433
+ var Qn = class {
2434
+ mounted = /* @__PURE__ */ new Map();
2435
+ fileInputs = /* @__PURE__ */ new Set();
2436
+ originalDisplay;
2437
+ overlayHidden = !1;
2438
+ selectionTracked = 0;
2439
+ overlay;
2440
+ constructor(e) {
2441
+ this.overlay = e, this.originalDisplay = e.style.display;
2442
+ }
2443
+ mount(e, t, n, r) {
2444
+ this.unmount(e);
2445
+ 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, {
2447
+ position: "absolute",
2448
+ left: "0",
2449
+ top: "0",
2450
+ margin: "0",
2451
+ padding: "0",
2452
+ border: "0",
2453
+ outline: "0",
2454
+ opacity: "0",
2455
+ color: "transparent",
2456
+ caretColor: "transparent",
2457
+ background: "transparent",
2458
+ boxSizing: "border-box",
2459
+ transformOrigin: "0 0",
2460
+ pointerEvents: "auto"
2461
+ }), i.addEventListener("input", this.handleInput), i.addEventListener("select", this.handleSelection), i.addEventListener("focus", this.handleFocus), i.addEventListener("blur", this.handleBlur), i instanceof HTMLTextAreaElement && i.addEventListener("scroll", this.handleTextareaScroll), this.trackSelections(), this.mounted.set(e, {
2462
+ element: i,
2463
+ events: r
2464
+ }), this.overlay.appendChild(i), this.update(e, t, n), () => this.unmount(e);
2465
+ }
2466
+ update(e, t, n) {
2467
+ let r = this.mounted.get(e);
2468
+ if (!r) return;
2469
+ 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, {
2475
+ display: n.visible ? "block" : "none",
2476
+ width: `${n.width}px`,
2477
+ height: `${n.height}px`,
2478
+ transform: `matrix(${n.transform.join(",")})`,
2479
+ 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));
2483
+ }
2484
+ pickFiles(e, t, n) {
2485
+ let r = document.createElement("input");
2486
+ r.type = "file", r.accept = e ?? "", r.multiple = t, Object.assign(r.style, {
2487
+ position: "fixed",
2488
+ width: "1px",
2489
+ height: "1px",
2490
+ opacity: "0",
2491
+ pointerEvents: "none"
2492
+ });
2493
+ let i = () => {
2494
+ r.removeEventListener("change", a), r.removeEventListener("cancel", i), r.remove(), this.fileInputs.delete(r);
2495
+ }, a = () => {
2496
+ let e = Array.from(r.files ?? []);
2497
+ i(), e.length && n(e);
2498
+ };
2499
+ r.addEventListener("change", a, { once: !0 }), r.addEventListener("cancel", i, { once: !0 }), this.fileInputs.add(r), this.overlay.ownerDocument.body.appendChild(r), r.click();
2500
+ }
2501
+ focus(e) {
2502
+ this.mounted.get(e)?.element.focus();
2503
+ }
2504
+ setOverlayVisible(e) {
2505
+ if (e) {
2506
+ if (!this.overlayHidden) return;
2507
+ this.overlay.style.display = this.originalDisplay, this.overlayHidden = !1;
2508
+ return;
2509
+ }
2510
+ if (this.overlayHidden) return;
2511
+ let t = this.overlay.ownerDocument.activeElement;
2512
+ t instanceof HTMLElement && this.overlay.contains(t) && t.blur(), this.overlay.style.display = "none", this.overlayHidden = !0;
2513
+ }
2514
+ unmount(e) {
2515
+ let t = this.mounted.get(e);
2516
+ if (!t) return;
2517
+ 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);
2519
+ }
2520
+ destroy() {
2521
+ this.setOverlayVisible(!0);
2522
+ for (let e of this.mounted.keys()) this.unmount(e);
2523
+ this.fileInputs.forEach((e) => e.remove()), this.fileInputs.clear();
2524
+ }
2525
+ find(e) {
2526
+ for (let t of this.mounted.values()) if (t.element === e) return t;
2527
+ }
2528
+ handleInput = (e) => {
2529
+ let t = this.find(e.currentTarget);
2530
+ t && t.events.input(t.element.value, t.element.selectionStart ?? t.element.value.length);
2531
+ };
2532
+ handleSelection = (e) => {
2533
+ let t = this.find(e.currentTarget);
2534
+ t && t.events.selection(t.element.selectionStart ?? t.element.value.length);
2535
+ };
2536
+ trackSelections() {
2537
+ this.selectionTracked++ === 0 && this.overlay.ownerDocument.addEventListener("selectionchange", this.handleSelectionChange);
2538
+ }
2539
+ untrackSelections() {
2540
+ --this.selectionTracked === 0 && this.overlay.ownerDocument.removeEventListener("selectionchange", this.handleSelectionChange);
2541
+ }
2542
+ handleSelectionChange = () => {
2543
+ let e = this.overlay.ownerDocument.activeElement;
2544
+ if (!(e instanceof HTMLInputElement) && !(e instanceof HTMLTextAreaElement)) return;
2545
+ let t = this.find(e);
2546
+ t && t.events.selection(t.element.selectionStart ?? t.element.value.length);
2547
+ };
2548
+ handleFocus = (e) => this.find(e.currentTarget)?.events.focus();
2549
+ handleBlur = (e) => this.find(e.currentTarget)?.events.blur();
2550
+ handleTextareaScroll = (e) => {
2551
+ let t = this.find(e.currentTarget);
2552
+ t?.element instanceof HTMLTextAreaElement && t.events.scroll(t.element.scrollTop, t.element.scrollHeight, t.element.clientHeight, t.element.clientWidth);
2553
+ };
2554
+ };
2555
+ // tools/angular-build/.stage/react/canvas-handle.ts
2556
+ function $n() {
2557
+ return Math.max(1, window.devicePixelRatio || 1);
2558
+ }
2559
+ function er(e = {}, t) {
2560
+ return typeof e == "string" ? {
2561
+ type: e,
2562
+ quality: t
2563
+ } : {
2564
+ ...e,
2565
+ type: e.type ?? "image/png"
2566
+ };
2567
+ }
2568
+ function tr(e, t, n) {
2569
+ try {
2570
+ return e.toDataURL(t, n);
2571
+ } catch (e) {
2572
+ throw ir(e) ? ar() : e;
2573
+ }
2574
+ }
2575
+ function nr(e, t, n) {
2576
+ return new Promise((r, i) => {
2577
+ try {
2578
+ e.toBlob((e) => {
2579
+ e ? r(e) : i(/* @__PURE__ */ Error("Canvas image export failed."));
2580
+ }, t, n);
2581
+ } catch (e) {
2582
+ i(ir(e) ? ar() : e);
2583
+ }
2584
+ });
2585
+ }
2586
+ function rr(e, t, n, r) {
2587
+ let i = n.pixelRatio ?? r;
2588
+ if (!Number.isFinite(i) || i <= 0) throw RangeError("Export pixelRatio must be a positive finite number.");
2589
+ let a = n.width ?? e.width / r, o = n.height ?? e.height / r;
2590
+ if (!Number.isFinite(a) || a <= 0 || !Number.isFinite(o) || o <= 0) throw RangeError("Export width and height must be positive finite numbers.");
2591
+ let s = document.createElement("canvas");
2592
+ s.width = Math.max(1, Math.round(a * i)), s.height = Math.max(1, Math.round(o * i));
2593
+ let c = s.getContext("2d");
2594
+ if (!c) throw Error("Canvas 2D context is not available for image export.");
2595
+ return t ? t.renderTo(c, s.width / a, s.height / o) : c.drawImage(e, 0, 0, s.width, s.height), s;
2596
+ }
2597
+ function ir(e) {
2598
+ return typeof e == "object" && !!e && "name" in e && e.name === "SecurityError";
2599
+ }
2600
+ function ar() {
2601
+ return /* @__PURE__ */ Error("Canvas 导出失败:画布包含未授权跨域读取的图片。请配置图片服务器 CORS(Access-Control-Allow-Origin),或移除该跨域图片后重试。");
2602
+ }
2603
+ // 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);
2606
+ x.current = d;
2607
+ let S = a(void 0);
2608
+ return S.current = f, r(m, () => ({
2609
+ getCanvas: () => h.current,
2610
+ requestRender: () => v.current?.requestRender(),
2611
+ toDataURL: (e = {}, t) => {
2612
+ let n = h.current;
2613
+ 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);
2616
+ },
2617
+ toBlob: (e = {}, t) => new Promise((n, r) => {
2618
+ let i = h.current;
2619
+ if (!i) {
2620
+ r(/* @__PURE__ */ Error("Canvas is not mounted."));
2621
+ return;
2622
+ }
2623
+ let a = er(e, t);
2624
+ nr(rr(i, v.current, a, y.current), a.type, a.quality).then(n, r);
2625
+ })
2626
+ }), []), n(() => {
2627
+ let n = h.current, r = g.current, i = _.current;
2628
+ if (!n || !r || !i) return;
2629
+ let a = $n();
2630
+ y.current = a, n.width = Math.round(e * a), n.height = Math.round(t * a);
2631
+ let o = n.getContext("2d");
2632
+ if (!o) throw Error("Canvas 2D context is not available.");
2633
+ o.scale(a, a);
2634
+ let s = new Xn(o, new Qn(r), (e) => x.current?.(e), a, (e) => S.current?.(e));
2635
+ v.current = s, s.update(b), s.start();
2636
+ let c = (e) => {
2637
+ s.wheel({
2638
+ currentTarget: n,
2639
+ clientX: e.clientX,
2640
+ clientY: e.clientY,
2641
+ deltaY: e.deltaY,
2642
+ preventDefault: () => e.preventDefault()
2643
+ });
2644
+ };
2645
+ return i.addEventListener("wheel", c, { passive: !1 }), () => {
2646
+ i.removeEventListener("wheel", c), s.destroy(), v.current = null;
2647
+ };
2648
+ }, [e, t]), n(() => {
2649
+ v.current?.update(b);
2650
+ }, [b]), /* @__PURE__ */ s("div", {
2651
+ ref: _,
2652
+ className: l,
2653
+ style: {
2654
+ ...c,
2655
+ position: "relative",
2656
+ width: e,
2657
+ height: t
2658
+ },
2659
+ children: [/* @__PURE__ */ o("canvas", {
2660
+ ref: h,
2661
+ "aria-label": u,
2662
+ style: {
2663
+ display: "block",
2664
+ width: "100%",
2665
+ height: "100%"
2666
+ },
2667
+ onPointerDown: (e) => v.current?.pointerDown(e),
2668
+ onPointerMove: (e) => v.current?.pointerMove(e),
2669
+ onPointerUp: (e) => v.current?.pointerUp(e),
2670
+ onPointerCancel: (e) => v.current?.pointerUp(e, !0)
2671
+ }), /* @__PURE__ */ o("div", {
2672
+ ref: g,
2673
+ style: {
2674
+ position: "absolute",
2675
+ inset: 0,
2676
+ overflow: "hidden",
2677
+ pointerEvents: "none"
2678
+ }
2679
+ })]
2680
+ });
2681
+ });
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 };