@nice2dev/ui 1.0.17 → 1.0.19

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 (180) hide show
  1. package/CHANGELOG.md +316 -0
  2. package/dist/NiceAlertDialog.doc-BST0-aVs.cjs +14 -0
  3. package/dist/NiceAlertDialog.doc-GRpJU_5Y.js +38 -0
  4. package/dist/NiceAnimatePresence.doc-BrttRpeS.js +36 -0
  5. package/dist/NiceAnimatePresence.doc-IdEWrSnT.cjs +12 -0
  6. package/dist/NiceCalendarScheduler.doc-Cc-DFMhR.js +33 -0
  7. package/dist/NiceCalendarScheduler.doc-TPe0kRBN.cjs +9 -0
  8. package/dist/NiceCameraFeed.doc-BJl0gdWv.js +31 -0
  9. package/dist/NiceCameraFeed.doc-Bt4eZ8MH.cjs +7 -0
  10. package/dist/NiceChip.doc-Bccf4IQe.cjs +7 -0
  11. package/dist/NiceChip.doc-DEsqjL7z.js +31 -0
  12. package/dist/NiceCombobox.doc-8hMzrsdM.js +34 -0
  13. package/dist/NiceCombobox.doc-C5IPnVuz.cjs +10 -0
  14. package/dist/NiceConfigProvider.doc-CKIudO44.js +32 -0
  15. package/dist/NiceConfigProvider.doc-bMLQj3Zx.cjs +8 -0
  16. package/dist/NiceCronEditor.doc-BThdELxx.js +31 -0
  17. package/dist/NiceCronEditor.doc-w_TbOWFo.cjs +7 -0
  18. package/dist/NiceDataList.doc-DHXrpTPT.cjs +9 -0
  19. package/dist/NiceDataList.doc-R8SchHqZ.js +33 -0
  20. package/dist/NiceDiagram.doc-CASS0Tnj.cjs +8 -0
  21. package/dist/NiceDiagram.doc-DGX-Hwhg.js +32 -0
  22. package/dist/NiceDocPage.doc-BVBe27kj.cjs +1 -0
  23. package/dist/NiceDocPage.doc-CDcL3Sqt.js +25 -0
  24. package/dist/NiceDrawingCanvas.doc-DYYFKKMW.js +32 -0
  25. package/dist/NiceDrawingCanvas.doc-wa684gbC.cjs +8 -0
  26. package/dist/NiceDropdown.doc-D2NS9hBT.js +35 -0
  27. package/dist/NiceDropdown.doc-dAgER8da.cjs +11 -0
  28. package/dist/NiceDropzone.doc-CVVNc9SE.cjs +9 -0
  29. package/dist/NiceDropzone.doc-aeajYWqU.js +33 -0
  30. package/dist/NiceEnergyMonitor.doc-BBnVKuwf.js +32 -0
  31. package/dist/NiceEnergyMonitor.doc-lf6CCIYi.cjs +8 -0
  32. package/dist/NiceErrorBoundary-COY0cEsF.js +762 -0
  33. package/dist/NiceErrorBoundary-CR-_ZScD.cjs +1 -0
  34. package/dist/NiceErrorBoundary-DBCCmeyl.js +770 -0
  35. package/dist/NiceErrorBoundary-V6wkSSLP.cjs +1 -0
  36. package/dist/NiceExpressionBuilder.doc-CTjqEcZR.cjs +8 -0
  37. package/dist/NiceExpressionBuilder.doc-Cu_ORFhd.js +32 -0
  38. package/dist/NiceFileExplorer.doc-B0aN041v.js +32 -0
  39. package/dist/NiceFileExplorer.doc-DNHYQF_t.cjs +8 -0
  40. package/dist/NiceFloatingActionButton.doc-BOlJwq4S.cjs +7 -0
  41. package/dist/NiceFloatingActionButton.doc-oYnwvMP9.js +31 -0
  42. package/dist/NiceFontPicker.doc-B10vOqeF.cjs +8 -0
  43. package/dist/NiceFontPicker.doc-DuPp0cDP.js +32 -0
  44. package/dist/NiceForm-COk1rNVa.js +5357 -0
  45. package/dist/NiceForm-CU8Dldq-.cjs +382 -0
  46. package/dist/NiceForm-DLADlHAQ.js +5383 -0
  47. package/dist/NiceForm-DUkduLqG.cjs +382 -0
  48. package/dist/NiceForm.css +1 -1
  49. package/dist/NiceGestureHandler.doc-9GGvVnM5.cjs +8 -0
  50. package/dist/NiceGestureHandler.doc-BduQU3SA.js +32 -0
  51. package/dist/NiceHeader.doc-Cxoy_f_k.cjs +6 -0
  52. package/dist/NiceHeader.doc-DjAVl-T4.js +30 -0
  53. package/dist/NiceImage.doc-COy4iVy1.js +34 -0
  54. package/dist/NiceImage.doc-CvnaTRj8.cjs +10 -0
  55. package/dist/NiceInPlaceEditor.doc-8nC6Kqvn.cjs +1 -0
  56. package/dist/NiceInPlaceEditor.doc-gF1XPyu5.js +25 -0
  57. package/dist/NiceInteractiveTimeline.doc-BTeASFR4.js +50 -0
  58. package/dist/NiceInteractiveTimeline.doc-WMOVQhMe.cjs +11 -0
  59. package/dist/NiceJsonEditor.doc-BpVa-AlY.js +31 -0
  60. package/dist/NiceJsonEditor.doc-DeyoVDQw.cjs +7 -0
  61. package/dist/NiceMegaMenu.doc-CO34gN43.cjs +7 -0
  62. package/dist/NiceMegaMenu.doc-DpchTBL6.js +31 -0
  63. package/dist/NiceMentionInput.doc-O0W58Unu.js +32 -0
  64. package/dist/NiceMentionInput.doc-ZSPjBsZc.cjs +8 -0
  65. package/dist/NiceModal-CIITx65V.cjs +1 -0
  66. package/dist/NiceModal-CN23FZsc.js +95 -0
  67. package/dist/NiceModal-CUdeVj-j.js +95 -0
  68. package/dist/NiceModal-Cc8R-DpX.cjs +1 -0
  69. package/dist/NiceModuleLifecyclePanel-4UEsYB5r.js +6553 -0
  70. package/dist/NiceModuleLifecyclePanel-BDnsr5ZW.js +6349 -0
  71. package/dist/NiceModuleLifecyclePanel-C6agdtTI.cjs +1 -0
  72. package/dist/NiceModuleLifecyclePanel-F1uN0gMh.cjs +1 -0
  73. package/dist/NiceModuleLifecyclePanel.css +1 -1
  74. package/dist/NiceMotion.doc-COF5BldG.cjs +9 -0
  75. package/dist/NiceMotion.doc-utheTBgM.js +33 -0
  76. package/dist/NiceMultiColumnComboBox.doc-Ben0Q0J0.cjs +1 -0
  77. package/dist/NiceMultiColumnComboBox.doc-CK1DppZI.js +25 -0
  78. package/dist/NiceNotificationList.doc-CBWusjJX.cjs +7 -0
  79. package/dist/NiceNotificationList.doc-D7lQIxK0.js +31 -0
  80. package/dist/NiceOfflineSync.doc-BLQFyOf2.cjs +8 -0
  81. package/dist/NiceOfflineSync.doc-CKWFmR3b.js +32 -0
  82. package/dist/NicePagination-B4U0LwZy.js +171 -0
  83. package/dist/NicePagination-CGQf54a9.cjs +1 -0
  84. package/dist/NicePagination-Cqr3Pe_F.js +171 -0
  85. package/dist/NicePagination-DyWWdtb3.cjs +1 -0
  86. package/dist/NicePinCodeInput-C6zJxUVf.cjs +419 -0
  87. package/dist/NicePinCodeInput-DG_-eXXJ.cjs +419 -0
  88. package/dist/NicePinCodeInput-g-yUiepm.js +11875 -0
  89. package/dist/NicePinCodeInput-ltwzQf4r.js +12240 -0
  90. package/dist/NicePinCodeInput.css +1 -1
  91. package/dist/NicePreview.doc-Cl7_5MVR.js +30 -0
  92. package/dist/NicePreview.doc-atKISvmp.cjs +6 -0
  93. package/dist/NicePropertyGrid.doc-D6xljYe1.cjs +7 -0
  94. package/dist/NicePropertyGrid.doc-nX2etusg.js +31 -0
  95. package/dist/NiceRadio.doc-BTURz62X.js +27 -0
  96. package/dist/NiceRadio.doc-Cc8-1vbn.cjs +3 -0
  97. package/dist/NiceRecurrencePicker.doc-78HjPJm0.js +31 -0
  98. package/dist/NiceRecurrencePicker.doc-vC2YmCXF.cjs +7 -0
  99. package/dist/NiceRichTextEditor.doc-ClPCkzCd.cjs +6 -0
  100. package/dist/NiceRichTextEditor.doc-CtmV9UvX.js +30 -0
  101. package/dist/NiceSavedQueryPanel-BIXW0y1X.js +6455 -0
  102. package/dist/NiceSavedQueryPanel-CE3QR4RY.js +6446 -0
  103. package/dist/NiceSavedQueryPanel-CFHwMDIx.cjs +596 -0
  104. package/dist/NiceSavedQueryPanel-DSnj-3Es.cjs +596 -0
  105. package/dist/NiceSavedQueryPanel.css +1 -1
  106. package/dist/NiceSceneSelector.doc-CY2OmaWQ.cjs +7 -0
  107. package/dist/NiceSceneSelector.doc-UsVgDrw1.js +31 -0
  108. package/dist/NiceScrollArea.doc-C6Y-odUa.js +27 -0
  109. package/dist/NiceScrollArea.doc-LdxDrGDY.cjs +3 -0
  110. package/dist/NiceSheet.doc-CsIu3Y1G.cjs +11 -0
  111. package/dist/NiceSheet.doc-DLfSY-MA.js +35 -0
  112. package/dist/NiceSpeedDial.doc-CSWvNR9n.cjs +7 -0
  113. package/dist/NiceSpeedDial.doc-DqnpBcMy.js +31 -0
  114. package/dist/NiceSplitPane.doc-Ck_FvdL6.cjs +9 -0
  115. package/dist/NiceSplitPane.doc-Di68JZuy.js +33 -0
  116. package/dist/NiceSpotlight.doc-CM4PnsHE.js +34 -0
  117. package/dist/NiceSpotlight.doc-Dm_B-kUJ.cjs +10 -0
  118. package/dist/NiceStepNavigation.doc-DXraCs7t.js +31 -0
  119. package/dist/NiceStepNavigation.doc-TSy2dWmf.cjs +7 -0
  120. package/dist/NiceSteps.doc-C_mkhnez.cjs +10 -0
  121. package/dist/NiceSteps.doc-PW1zubHM.js +34 -0
  122. package/dist/NiceSwitch.doc-CLc7OxrE.cjs +6 -0
  123. package/dist/NiceSwitch.doc-dGMMY4es.js +30 -0
  124. package/dist/NiceTabs-32xjguOv.cjs +1 -0
  125. package/dist/NiceTabs-B9zxj6qd.js +1657 -0
  126. package/dist/NiceTabs-Blk0h4jY.js +1624 -0
  127. package/dist/NiceTabs-CNauJ4fu.cjs +1 -0
  128. package/dist/NiceTransition.doc-BmImVoB8.js +35 -0
  129. package/dist/NiceTransition.doc-GA1N91ON.cjs +11 -0
  130. package/dist/NiceTree.doc-D7SCXljC.js +40 -0
  131. package/dist/NiceTree.doc-DZx3hUwY.cjs +16 -0
  132. package/dist/NiceUnitConverter.doc-DmiyYOH_.cjs +10 -0
  133. package/dist/NiceUnitConverter.doc-YnzD3uKT.js +34 -0
  134. package/dist/NiceVirtualGrid.doc-DI2c9ckY.js +35 -0
  135. package/dist/NiceVirtualGrid.doc-rtwudxTG.cjs +11 -0
  136. package/dist/NiceVirtualList.doc-BpoTiXoV.js +31 -0
  137. package/dist/NiceVirtualList.doc-C8q-Hfl0.cjs +7 -0
  138. package/dist/NiceWindow-B4jA_-hi.js +1409 -0
  139. package/dist/NiceWindow-Bo_yCa1o.js +1418 -0
  140. package/dist/NiceWindow-DPzJxOfx.cjs +1 -0
  141. package/dist/NiceWindow-UpKllge7.cjs +1 -0
  142. package/dist/charts-0BEMJ0Xt.js +4657 -0
  143. package/dist/charts-C60va95_.js +4657 -0
  144. package/dist/charts-CbxmU6Z2.cjs +761 -0
  145. package/dist/charts-D_I1iwel.cjs +761 -0
  146. package/dist/charts.cjs +1 -1
  147. package/dist/charts.css +1 -1
  148. package/dist/charts.d.ts +19 -19
  149. package/dist/charts.mjs +1 -1
  150. package/dist/core-BIA5_uSq.js +22316 -0
  151. package/dist/core-Bcc4sz15.cjs +96 -0
  152. package/dist/core-DQYnL6uf.cjs +96 -0
  153. package/dist/core-Da1dGJN3.js +22401 -0
  154. package/dist/data.cjs +1 -1
  155. package/dist/data.d.ts +5 -0
  156. package/dist/data.mjs +1 -1
  157. package/dist/editors.cjs +1 -1
  158. package/dist/editors.d.ts +44 -1
  159. package/dist/editors.mjs +3 -3
  160. package/dist/feedback.cjs +1 -1
  161. package/dist/feedback.d.ts +10 -10
  162. package/dist/feedback.mjs +2 -2
  163. package/dist/index-BjBsn6ad.cjs +5194 -0
  164. package/dist/index-C2Uoywo9.js +63852 -0
  165. package/dist/index-DCDfWfAt.js +64336 -0
  166. package/dist/index-DpiCo0_e.cjs +5194 -0
  167. package/dist/index.cjs +1 -1
  168. package/dist/index.css +1 -1
  169. package/dist/index.d.ts +1798 -57
  170. package/dist/index.mjs +943 -895
  171. package/dist/lazy.cjs +1 -1
  172. package/dist/lazy.d.ts +4 -3
  173. package/dist/lazy.mjs +3 -3
  174. package/dist/navigation.cjs +1 -1
  175. package/dist/navigation.d.ts +15 -1
  176. package/dist/navigation.mjs +30 -30
  177. package/dist/overlays.cjs +1 -1
  178. package/dist/overlays.mjs +53 -53
  179. package/dist/style.css +6 -6
  180. package/package.json +3 -3
@@ -0,0 +1,1418 @@
1
+ import { jsxs as y, Fragment as Te, jsx as o } from "react/jsx-runtime";
2
+ import { $ as ve, S as pt, H as Ce, A as ft, Z as wt } from "./core-Da1dGJN3.js";
3
+ import _t, { useRef as V, useState as Y, useCallback as k, useEffect as H, useReducer as gt, useMemo as ge, useContext as $e, createContext as Pe, forwardRef as Ie } from "react";
4
+ const $t = ({
5
+ visible: e,
6
+ onClose: t,
7
+ title: n,
8
+ items: s,
9
+ showCancelButton: m = !0,
10
+ cancelText: u,
11
+ className: h,
12
+ style: g
13
+ }) => {
14
+ const { t: p } = ve();
15
+ return e ? /* @__PURE__ */ y(Te, { children: [
16
+ /* @__PURE__ */ o("div", { className: "nice-actionsheet__overlay", onClick: t }),
17
+ /* @__PURE__ */ y("div", { className: `nice-actionsheet ${h || ""}`, style: g, children: [
18
+ n && /* @__PURE__ */ o("div", { className: "nice-actionsheet__title", children: n }),
19
+ /* @__PURE__ */ o("div", { className: "nice-actionsheet__items", children: s.map((E, r) => /* @__PURE__ */ y(
20
+ "button",
21
+ {
22
+ className: `nice-actionsheet__item ${E.type === "danger" ? "nice-actionsheet__item--danger" : ""}`,
23
+ disabled: E.disabled,
24
+ onClick: () => {
25
+ E.onClick?.(), t();
26
+ },
27
+ children: [
28
+ E.icon && /* @__PURE__ */ o("span", { className: "nice-actionsheet__icon", children: E.icon }),
29
+ E.text
30
+ ]
31
+ },
32
+ r
33
+ )) }),
34
+ m && /* @__PURE__ */ o("button", { className: "nice-actionsheet__cancel", onClick: t, children: u || p("cancel", "Cancel") })
35
+ ] })
36
+ ] }) : null;
37
+ }, Pt = ({
38
+ visible: e,
39
+ onClose: t,
40
+ targetRef: n,
41
+ position: s = "bottom",
42
+ title: m,
43
+ showArrow: u = !0,
44
+ width: h,
45
+ children: g,
46
+ className: p,
47
+ style: E,
48
+ displayStyle: r
49
+ }) => {
50
+ pt("tooltip", r);
51
+ const x = V(null), [X, f] = Y({ top: 0, left: 0 }), T = k(() => {
52
+ const w = n.current, O = x.current;
53
+ if (!w || !O)
54
+ return;
55
+ const c = w.getBoundingClientRect(), v = O.getBoundingClientRect();
56
+ let a = 0, C = 0;
57
+ const $ = 8;
58
+ switch (s) {
59
+ case "top":
60
+ a = c.top - v.height - $, C = c.left + (c.width - v.width) / 2;
61
+ break;
62
+ case "bottom":
63
+ a = c.bottom + $, C = c.left + (c.width - v.width) / 2;
64
+ break;
65
+ case "left":
66
+ a = c.top + (c.height - v.height) / 2, C = c.left - v.width - $;
67
+ break;
68
+ case "right":
69
+ a = c.top + (c.height - v.height) / 2, C = c.right + $;
70
+ break;
71
+ }
72
+ f({ top: a + window.scrollY, left: C + window.scrollX });
73
+ }, [n, s]);
74
+ return H(() => {
75
+ if (e) {
76
+ requestAnimationFrame(T);
77
+ const w = (O) => {
78
+ x.current && !x.current.contains(O.target) && n.current && !n.current.contains(O.target) && t();
79
+ };
80
+ return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
81
+ }
82
+ }, [e, T, t, n]), e ? /* @__PURE__ */ y(
83
+ "div",
84
+ {
85
+ ref: x,
86
+ className: `nice-popover nice-popover--${s} ${p || ""}`,
87
+ style: { ...E, position: "absolute", top: X.top, left: X.left, width: h },
88
+ children: [
89
+ u && /* @__PURE__ */ o("div", { className: `nice-popover__arrow nice-popover__arrow--${s}` }),
90
+ m && /* @__PURE__ */ o("div", { className: "nice-popover__title", children: m }),
91
+ /* @__PURE__ */ o("div", { className: "nice-popover__content", children: g })
92
+ ]
93
+ }
94
+ ) : null;
95
+ }, Dt = ({
96
+ visible: e,
97
+ message: t,
98
+ container: n,
99
+ showIndicator: s = !0,
100
+ shading: m = !0,
101
+ className: u,
102
+ style: h
103
+ }) => {
104
+ const { t: g } = ve();
105
+ if (!e)
106
+ return null;
107
+ const p = !!n?.current, E = /* @__PURE__ */ y("div", { className: `nice-loadpanel ${u || ""}`, style: h, children: [
108
+ m && /* @__PURE__ */ o("div", { className: "nice-loadpanel__shade" }),
109
+ /* @__PURE__ */ y("div", { className: "nice-loadpanel__box", children: [
110
+ s && /* @__PURE__ */ o("div", { className: "nice-spinner nice-spinner--md" }),
111
+ /* @__PURE__ */ o("span", { className: "nice-loadpanel__text", children: t || g("loading", "Loading...") })
112
+ ] })
113
+ ] });
114
+ if (p && n.current) {
115
+ const r = n.current;
116
+ return r.style.position = r.style.position || "relative", E;
117
+ }
118
+ return E;
119
+ }, Yt = ({
120
+ direction: e = "row",
121
+ align: t,
122
+ justify: n,
123
+ wrap: s,
124
+ gap: m,
125
+ flex: u,
126
+ children: h,
127
+ className: g,
128
+ style: p
129
+ }) => /* @__PURE__ */ o(
130
+ "div",
131
+ {
132
+ className: `nice-box ${g || ""}`,
133
+ style: {
134
+ display: "flex",
135
+ flexDirection: e,
136
+ alignItems: t,
137
+ justifyContent: n,
138
+ flexWrap: s ? "wrap" : void 0,
139
+ gap: m,
140
+ flex: u,
141
+ ...p
142
+ },
143
+ children: h
144
+ }
145
+ ), Xt = ({
146
+ direction: e = "row",
147
+ items: t,
148
+ gap: n,
149
+ className: s,
150
+ style: m
151
+ }) => /* @__PURE__ */ o(
152
+ "div",
153
+ {
154
+ className: `nice-responsivebox ${s || ""}`,
155
+ style: { display: "flex", flexDirection: e, gap: n, ...m },
156
+ children: t.map((u, h) => /* @__PURE__ */ o(
157
+ "div",
158
+ {
159
+ style: { flex: u.ratio ?? 1, flexBasis: u.baseSize, flexShrink: u.shrink ?? 1 },
160
+ children: u.children
161
+ },
162
+ h
163
+ ))
164
+ }
165
+ ), Ot = ({
166
+ width: e = 200,
167
+ height: t = 200,
168
+ minWidth: n = 50,
169
+ minHeight: s = 50,
170
+ maxWidth: m = 1 / 0,
171
+ maxHeight: u = 1 / 0,
172
+ handles: h = ["right", "bottom", "bottomRight"],
173
+ onResize: g,
174
+ children: p,
175
+ className: E,
176
+ style: r
177
+ }) => {
178
+ const [x, X] = Y({ width: e, height: t }), f = V(null), T = (c, v) => {
179
+ v.preventDefault();
180
+ const a = v.clientX, C = v.clientY, $ = x.width, B = x.height, I = {
181
+ n: "top",
182
+ s: "bottom",
183
+ e: "right",
184
+ w: "left",
185
+ ne: "topRight",
186
+ se: "bottomRight",
187
+ sw: "bottomLeft",
188
+ nw: "topLeft"
189
+ }[c] ?? c, i = I === "right" || I === "topRight" || I === "bottomRight", z = I === "left" || I === "topLeft" || I === "bottomLeft", S = I === "bottom" || I === "bottomRight" || I === "bottomLeft", L = I === "top" || I === "topRight" || I === "topLeft", l = (d) => {
190
+ const P = d.clientX - a, M = d.clientY - C;
191
+ let W = $, U = B;
192
+ i && (W = $ + P), z && (W = $ - P), S && (U = B + M), L && (U = B - M), W = Math.max(n, Math.min(m, W)), U = Math.max(s, Math.min(u, U)), X({ width: W, height: U }), g?.({ width: W, height: U });
193
+ }, b = () => {
194
+ document.removeEventListener("pointermove", l), document.removeEventListener("pointerup", b);
195
+ };
196
+ document.addEventListener("pointermove", l), document.addEventListener("pointerup", b);
197
+ }, w = (c) => {
198
+ switch (c) {
199
+ case "top":
200
+ case "bottom":
201
+ return "ns-resize";
202
+ case "left":
203
+ case "right":
204
+ return "ew-resize";
205
+ case "topLeft":
206
+ case "bottomRight":
207
+ return "nwse-resize";
208
+ case "topRight":
209
+ case "bottomLeft":
210
+ return "nesw-resize";
211
+ default:
212
+ return "default";
213
+ }
214
+ }, O = (c) => {
215
+ const v = { position: "absolute", zIndex: 1 }, a = 8;
216
+ return c === "right" ? {
217
+ ...v,
218
+ top: 0,
219
+ right: -a / 2,
220
+ width: a,
221
+ height: "100%",
222
+ cursor: w(c)
223
+ } : c === "bottom" ? {
224
+ ...v,
225
+ left: 0,
226
+ bottom: -a / 2,
227
+ width: "100%",
228
+ height: a,
229
+ cursor: w(c)
230
+ } : c === "left" ? { ...v, top: 0, left: -a / 2, width: a, height: "100%", cursor: w(c) } : c === "top" ? { ...v, top: -a / 2, left: 0, width: "100%", height: a, cursor: w(c) } : c === "bottomRight" ? {
231
+ ...v,
232
+ bottom: -a / 2,
233
+ right: -a / 2,
234
+ width: a * 2,
235
+ height: a * 2,
236
+ cursor: w(c)
237
+ } : c === "bottomLeft" ? {
238
+ ...v,
239
+ bottom: -a / 2,
240
+ left: -a / 2,
241
+ width: a * 2,
242
+ height: a * 2,
243
+ cursor: w(c)
244
+ } : c === "topRight" ? {
245
+ ...v,
246
+ top: -a / 2,
247
+ right: -a / 2,
248
+ width: a * 2,
249
+ height: a * 2,
250
+ cursor: w(c)
251
+ } : c === "topLeft" ? {
252
+ ...v,
253
+ top: -a / 2,
254
+ left: -a / 2,
255
+ width: a * 2,
256
+ height: a * 2,
257
+ cursor: w(c)
258
+ } : v;
259
+ };
260
+ return /* @__PURE__ */ y(
261
+ "div",
262
+ {
263
+ ref: f,
264
+ className: `nice-resizable ${E || ""}`,
265
+ style: {
266
+ ...r,
267
+ width: x.width,
268
+ height: x.height,
269
+ position: "relative",
270
+ overflow: "hidden"
271
+ },
272
+ children: [
273
+ p,
274
+ h.map((c) => /* @__PURE__ */ o("div", { style: O(c), onPointerDown: (v) => T(c, v) }, c))
275
+ ]
276
+ }
277
+ );
278
+ }, At = ({
279
+ direction: e = "vertical",
280
+ showScrollbar: t = "onInteraction",
281
+ width: n,
282
+ height: s,
283
+ onScroll: m,
284
+ children: u,
285
+ className: h,
286
+ style: g
287
+ }) => {
288
+ const p = e === "horizontal" || e === "both" ? "auto" : "hidden", E = e === "vertical" || e === "both" ? "auto" : "hidden";
289
+ return /* @__PURE__ */ o(
290
+ "div",
291
+ {
292
+ className: `nice-scrollview ${t === "never" ? "nice-scrollview--hide-sb" : t === "always" ? "nice-scrollview--show-sb" : ""} ${h || ""}`,
293
+ style: { ...g, width: n, height: s, overflowX: p, overflowY: E },
294
+ onScroll: m,
295
+ children: u
296
+ }
297
+ );
298
+ };
299
+ function ze(e, t) {
300
+ if (!e)
301
+ return { score: 1, indices: [] };
302
+ const n = e.toLowerCase(), s = t.toLowerCase();
303
+ let m = 0;
304
+ const u = [];
305
+ let h = 0, g = -1;
306
+ for (let p = 0; p < s.length && m < n.length; p++)
307
+ s[p] === n[m] && (u.push(p), g === p - 1 && (h += 3), (p === 0 || /[\s\-_/.]/.test(t[p - 1])) && (h += 5), t[p] === e[m] && (h += 1), h += 1, g = p, m++);
308
+ return m < n.length ? null : (h -= u[0] * 0.1, { score: h, indices: u });
309
+ }
310
+ function vt(e, t) {
311
+ if (t.length === 0)
312
+ return [e];
313
+ const n = [];
314
+ let s = 0;
315
+ const m = new Set(t);
316
+ for (let u = 0; u < e.length; u++)
317
+ m.has(u) && (s < u && n.push(e.slice(s, u)), n.push(
318
+ _t.createElement(
319
+ "mark",
320
+ { key: `m-${u}`, className: "nice-command-palette__match" },
321
+ e[u]
322
+ )
323
+ ), s = u + 1);
324
+ return s < e.length && n.push(e.slice(s)), n;
325
+ }
326
+ function bt(e, t) {
327
+ switch (t.type) {
328
+ case "REGISTER": {
329
+ const n = new Map(e.commands);
330
+ return n.set(t.command.id, t.command), { ...e, commands: n };
331
+ }
332
+ case "REGISTER_BATCH": {
333
+ const n = new Map(e.commands);
334
+ for (const s of t.commands)
335
+ n.set(s.id, s);
336
+ return { ...e, commands: n };
337
+ }
338
+ case "UNREGISTER": {
339
+ const n = new Map(e.commands);
340
+ return n.delete(t.id), { ...e, commands: n };
341
+ }
342
+ case "OPEN":
343
+ return { ...e, isOpen: !0, query: "", selectedIndex: 0 };
344
+ case "CLOSE":
345
+ return { ...e, isOpen: !1, query: "", selectedIndex: 0 };
346
+ case "SET_QUERY":
347
+ return { ...e, query: t.query, selectedIndex: 0 };
348
+ case "SET_SELECTED":
349
+ return { ...e, selectedIndex: t.index };
350
+ case "ADD_RECENT": {
351
+ const n = e.recentIds.filter((s) => s !== t.id);
352
+ return {
353
+ ...e,
354
+ recentIds: [t.id, ...n].slice(0, t.maxRecent)
355
+ };
356
+ }
357
+ default:
358
+ return e;
359
+ }
360
+ }
361
+ const De = Pe(null);
362
+ function yt() {
363
+ const e = $e(De);
364
+ if (!e)
365
+ throw new Error("useCommandPalette must be used within NiceCommandPaletteProvider");
366
+ return e;
367
+ }
368
+ const xt = ({
369
+ children: e,
370
+ commands: t,
371
+ placeholder: n = "Type a command...",
372
+ maxVisible: s = 10,
373
+ maxRecent: m = 5,
374
+ className: u,
375
+ emptyText: h = "No commands found",
376
+ closeOnAction: g = !0,
377
+ onOpen: p,
378
+ onClose: E
379
+ }) => {
380
+ const [r, x] = gt(bt, {
381
+ commands: new Map(t?.map((l) => [l.id, l]) ?? []),
382
+ isOpen: !1,
383
+ query: "",
384
+ selectedIndex: 0,
385
+ recentIds: []
386
+ }), X = V(null), f = V(null), [T, w] = Y(!1), O = k((l) => {
387
+ x({ type: "REGISTER", command: l });
388
+ }, []), c = k((l) => {
389
+ x({ type: "UNREGISTER", id: l });
390
+ }, []), v = k((l) => {
391
+ x({ type: "REGISTER_BATCH", commands: l });
392
+ }, []), a = k(() => {
393
+ x({ type: "OPEN" }), p?.();
394
+ }, [p]), C = k(() => {
395
+ x({ type: "CLOSE" }), E?.();
396
+ }, [E]), $ = k(() => {
397
+ r.isOpen ? C() : a();
398
+ }, [r.isOpen, C, a]), _ = ge(() => {
399
+ const l = Array.from(r.commands.values()).filter((d) => !d.hidden);
400
+ if (!r.query.trim()) {
401
+ const d = r.recentIds.map((M) => r.commands.get(M)).filter((M) => !!M && !M.hidden), P = l.filter((M) => !r.recentIds.includes(M.id));
402
+ return P.sort((M, W) => M.label.localeCompare(W.label)), [...d, ...P].map((M) => ({
403
+ command: M,
404
+ match: null,
405
+ isRecent: r.recentIds.includes(M.id)
406
+ }));
407
+ }
408
+ return l.map((d) => {
409
+ const P = ze(r.query, d.label), M = d.description ? ze(r.query, d.description) : null, W = d.keywords?.map((R) => ze(r.query, R)).filter(Boolean)[0] ?? null, U = [P, M, W].filter(Boolean).sort((R, A) => (A?.score ?? 0) - (R?.score ?? 0))[0];
410
+ return { command: d, match: U, isRecent: !1 };
411
+ }).filter((d) => d.match !== null).sort((d, P) => (P.match?.score ?? 0) - (d.match?.score ?? 0));
412
+ }, [r.commands, r.query, r.recentIds]).slice(0, s), I = k(
413
+ async (l) => {
414
+ const b = r.commands.get(l);
415
+ if (!(!b || b.disabled)) {
416
+ w(!0);
417
+ try {
418
+ await b.action(), x({ type: "ADD_RECENT", id: l, maxRecent: m });
419
+ } finally {
420
+ w(!1), g && C();
421
+ }
422
+ }
423
+ },
424
+ [r.commands, m, g, C]
425
+ );
426
+ H(() => {
427
+ const l = (b) => {
428
+ (b.metaKey || b.ctrlKey) && b.key === "k" && (b.preventDefault(), $()), b.key === "Escape" && r.isOpen && (b.preventDefault(), C());
429
+ };
430
+ return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
431
+ }, [$, r.isOpen, C]), H(() => {
432
+ r.isOpen && requestAnimationFrame(() => X.current?.focus());
433
+ }, [r.isOpen]);
434
+ const i = k(
435
+ (l) => {
436
+ const b = _.length;
437
+ if (b) {
438
+ if (l.key === "ArrowDown")
439
+ l.preventDefault(), x({ type: "SET_SELECTED", index: (r.selectedIndex + 1) % b });
440
+ else if (l.key === "ArrowUp")
441
+ l.preventDefault(), x({ type: "SET_SELECTED", index: (r.selectedIndex - 1 + b) % b });
442
+ else if (l.key === "Enter") {
443
+ l.preventDefault();
444
+ const d = _[r.selectedIndex];
445
+ d && I(d.command.id);
446
+ }
447
+ }
448
+ },
449
+ [_, r.selectedIndex, I]
450
+ );
451
+ H(() => {
452
+ if (!f.current)
453
+ return;
454
+ f.current.children[r.selectedIndex]?.scrollIntoView({ block: "nearest" });
455
+ }, [r.selectedIndex]);
456
+ const z = ge(
457
+ () => ({
458
+ registerCommand: O,
459
+ unregisterCommand: c,
460
+ registerCommands: v,
461
+ open: a,
462
+ close: C,
463
+ toggle: $,
464
+ isOpen: r.isOpen,
465
+ executeCommand: I
466
+ }),
467
+ [
468
+ O,
469
+ c,
470
+ v,
471
+ a,
472
+ C,
473
+ $,
474
+ r.isOpen,
475
+ I
476
+ ]
477
+ ), S = ge(() => {
478
+ const l = /* @__PURE__ */ new Map();
479
+ for (const b of _) {
480
+ const d = b.command.category ?? "General";
481
+ l.has(d) || l.set(d, []), l.get(d).push(b);
482
+ }
483
+ return l;
484
+ }, [_]);
485
+ let L = 0;
486
+ return /* @__PURE__ */ y(De.Provider, { value: z, children: [
487
+ e,
488
+ r.isOpen && /* @__PURE__ */ o("div", { className: `nice-command-palette__overlay ${u ?? ""}`, onClick: C, children: /* @__PURE__ */ y(
489
+ "div",
490
+ {
491
+ className: "nice-command-palette",
492
+ role: "dialog",
493
+ "aria-label": "Command Palette",
494
+ "aria-modal": "true",
495
+ onClick: (l) => l.stopPropagation(),
496
+ children: [
497
+ /* @__PURE__ */ o("div", { className: "nice-command-palette__input-wrapper", children: /* @__PURE__ */ o(
498
+ "input",
499
+ {
500
+ ref: X,
501
+ className: "nice-command-palette__input",
502
+ type: "text",
503
+ placeholder: n,
504
+ value: r.query,
505
+ onChange: (l) => x({ type: "SET_QUERY", query: l.target.value }),
506
+ onKeyDown: i,
507
+ "aria-label": "Search commands",
508
+ "aria-autocomplete": "list",
509
+ "aria-controls": "nice-command-palette-list",
510
+ "aria-activedescendant": _[r.selectedIndex] ? `nice-cmd-${_[r.selectedIndex].command.id}` : void 0
511
+ }
512
+ ) }),
513
+ /* @__PURE__ */ y(
514
+ "div",
515
+ {
516
+ ref: f,
517
+ id: "nice-command-palette-list",
518
+ className: "nice-command-palette__list",
519
+ role: "listbox",
520
+ children: [
521
+ _.length === 0 && /* @__PURE__ */ o("div", { className: "nice-command-palette__empty", children: h }),
522
+ Array.from(S.entries()).map(([l, b]) => /* @__PURE__ */ y("div", { className: "nice-command-palette__group", children: [
523
+ /* @__PURE__ */ o("div", { className: "nice-command-palette__category", children: l }),
524
+ b.map((d) => {
525
+ const P = L++, M = P === r.selectedIndex;
526
+ return /* @__PURE__ */ y(
527
+ "div",
528
+ {
529
+ id: `nice-cmd-${d.command.id}`,
530
+ className: `nice-command-palette__item ${M ? "nice-command-palette__item--selected" : ""} ${d.command.disabled ? "nice-command-palette__item--disabled" : ""}`,
531
+ role: "option",
532
+ "aria-selected": M,
533
+ "aria-disabled": d.command.disabled,
534
+ onClick: () => !d.command.disabled && I(d.command.id),
535
+ onMouseEnter: () => x({ type: "SET_SELECTED", index: P }),
536
+ children: [
537
+ d.command.icon && /* @__PURE__ */ o("span", { className: "nice-command-palette__icon", children: d.command.icon }),
538
+ /* @__PURE__ */ y("div", { className: "nice-command-palette__label-group", children: [
539
+ /* @__PURE__ */ o("span", { className: "nice-command-palette__label", children: d.match && r.query ? vt(d.command.label, d.match.indices) : d.command.label }),
540
+ d.command.description && /* @__PURE__ */ o("span", { className: "nice-command-palette__description", children: d.command.description })
541
+ ] }),
542
+ d.command.shortcut && /* @__PURE__ */ o("kbd", { className: "nice-command-palette__shortcut", children: d.command.shortcut }),
543
+ d.isRecent && /* @__PURE__ */ o("span", { className: "nice-command-palette__recent-badge", children: "Recent" })
544
+ ]
545
+ },
546
+ d.command.id
547
+ );
548
+ })
549
+ ] }, l))
550
+ ]
551
+ }
552
+ ),
553
+ T && /* @__PURE__ */ o("div", { className: "nice-command-palette__executing", children: "Executing..." })
554
+ ]
555
+ }
556
+ ) })
557
+ ] });
558
+ };
559
+ xt.displayName = "NiceCommandPaletteProvider";
560
+ function qt(e) {
561
+ const { registerCommands: t, unregisterCommand: n } = yt();
562
+ H(() => (t(e), () => {
563
+ for (const s of e)
564
+ n(s.id);
565
+ }), []);
566
+ }
567
+ const Nt = Ie(
568
+ ({ blocked: e, message: t, children: n, className: s, style: m, id: u }, h) => {
569
+ const g = Ce(u);
570
+ return /* @__PURE__ */ y(
571
+ "div",
572
+ {
573
+ ref: h,
574
+ id: g,
575
+ className: `nice-block-ui ${s || ""}`,
576
+ style: { position: "relative", ...m },
577
+ children: [
578
+ n,
579
+ e && /* @__PURE__ */ o("div", { className: "nice-block-ui__overlay", "aria-busy": "true", role: "alert", children: t && /* @__PURE__ */ o("div", { className: "nice-block-ui__message", children: t }) })
580
+ ]
581
+ }
582
+ );
583
+ }
584
+ );
585
+ Nt.displayName = "NiceBlockUI";
586
+ const kt = Ie(
587
+ ({
588
+ windows: e,
589
+ children: t,
590
+ onChange: n,
591
+ onClose: s,
592
+ onFocus: m,
593
+ showTaskbar: u = !0,
594
+ size: h = "md",
595
+ className: g,
596
+ style: p,
597
+ id: E,
598
+ ...r
599
+ }, x) => {
600
+ const X = Ce(E), { t: f } = ve(), [T, w] = Y(null), O = V(null), c = e ?? [], v = Math.max(1, ...c.map((i) => i.zIndex ?? 1)), a = k(
601
+ (i, z) => {
602
+ const S = c.map((L) => L.key === i ? { ...L, ...z } : L);
603
+ n?.(S);
604
+ },
605
+ [c, n]
606
+ ), C = k(
607
+ (i) => {
608
+ a(i, { zIndex: v + 1 }), m?.(i);
609
+ },
610
+ [a, v, m]
611
+ ), $ = k(
612
+ (i) => {
613
+ s?.(i), n?.(c.filter((z) => z.key !== i));
614
+ },
615
+ [c, n, s]
616
+ ), B = k(
617
+ (i) => {
618
+ const z = c.find((S) => S.key === i);
619
+ z && a(i, { minimized: !z.minimized, maximized: !1 });
620
+ },
621
+ [c, a]
622
+ ), _ = k(
623
+ (i) => {
624
+ const z = c.find((S) => S.key === i);
625
+ z && a(i, { maximized: !z.maximized, minimized: !1 });
626
+ },
627
+ [c, a]
628
+ );
629
+ H(() => {
630
+ if (!T)
631
+ return;
632
+ const i = (S) => {
633
+ const L = c.find((l) => l.key === T.key);
634
+ if (L)
635
+ if (T.mode === "move")
636
+ a(T.key, {
637
+ x: S.clientX - T.offsetX,
638
+ y: S.clientY - T.offsetY
639
+ });
640
+ else {
641
+ const b = O.current?.getBoundingClientRect(), d = b?.left ?? 0, P = b?.top ?? 0;
642
+ a(T.key, {
643
+ width: Math.max(200, S.clientX - d - L.x),
644
+ height: Math.max(100, S.clientY - P - L.y)
645
+ });
646
+ }
647
+ }, z = () => w(null);
648
+ return document.addEventListener("mousemove", i), document.addEventListener("mouseup", z), () => {
649
+ document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", z);
650
+ };
651
+ }, [T, c, a]);
652
+ const I = k(
653
+ (i, z, S) => {
654
+ z.preventDefault();
655
+ const L = c.find((l) => l.key === i);
656
+ L && (C(i), w({
657
+ key: i,
658
+ offsetX: S === "move" ? z.clientX - L.x : 0,
659
+ offsetY: S === "move" ? z.clientY - L.y : 0,
660
+ mode: S
661
+ }));
662
+ },
663
+ [c, C]
664
+ );
665
+ return /* @__PURE__ */ y(
666
+ "div",
667
+ {
668
+ ref: (i) => {
669
+ O.current = i, typeof x == "function" ? x(i) : x && (x.current = i);
670
+ },
671
+ id: X,
672
+ className: `nice-wm nice-wm--${h} ${g ?? ""}`,
673
+ style: { ...p, position: "relative", overflow: "hidden" },
674
+ ...r,
675
+ children: [
676
+ c.map((i) => {
677
+ if (i.minimized)
678
+ return null;
679
+ const z = i.maximized, S = z ? {
680
+ position: "absolute",
681
+ top: 0,
682
+ left: 0,
683
+ width: "100%",
684
+ height: "100%",
685
+ zIndex: i.zIndex ?? 1
686
+ } : {
687
+ position: "absolute",
688
+ top: i.y,
689
+ left: i.x,
690
+ width: i.width,
691
+ height: i.height,
692
+ zIndex: i.zIndex ?? 1
693
+ };
694
+ return /* @__PURE__ */ y(
695
+ "div",
696
+ {
697
+ className: `nice-wm__window ${z ? "nice-wm__window--maximized" : ""}`,
698
+ style: S,
699
+ onMouseDown: () => C(i.key),
700
+ role: "dialog",
701
+ "aria-label": i.title,
702
+ children: [
703
+ /* @__PURE__ */ y(
704
+ "div",
705
+ {
706
+ className: "nice-wm__titlebar",
707
+ onMouseDown: (L) => !z && I(i.key, L, "move"),
708
+ children: [
709
+ i.icon && /* @__PURE__ */ o("span", { className: "nice-wm__icon", children: i.icon }),
710
+ /* @__PURE__ */ o("span", { className: "nice-wm__title", children: i.title }),
711
+ /* @__PURE__ */ y("div", { className: "nice-wm__controls", children: [
712
+ (i.minimizable ?? !0) && /* @__PURE__ */ o(
713
+ "button",
714
+ {
715
+ type: "button",
716
+ className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--min",
717
+ onClick: () => B(i.key),
718
+ title: f("wm.minimize", "Minimize"),
719
+ children: "─"
720
+ }
721
+ ),
722
+ (i.maximizable ?? !0) && /* @__PURE__ */ o(
723
+ "button",
724
+ {
725
+ type: "button",
726
+ className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--max",
727
+ onClick: () => _(i.key),
728
+ title: f("wm.maximize", "Maximize"),
729
+ children: z ? "❐" : "☐"
730
+ }
731
+ ),
732
+ (i.closable ?? !0) && /* @__PURE__ */ o(
733
+ "button",
734
+ {
735
+ type: "button",
736
+ className: "nice-wm__ctrl-btn nice-wm__ctrl-btn--close",
737
+ onClick: () => $(i.key),
738
+ title: f("wm.close", "Close"),
739
+ children: "✕"
740
+ }
741
+ )
742
+ ] })
743
+ ]
744
+ }
745
+ ),
746
+ /* @__PURE__ */ o("div", { className: "nice-wm__body", children: i.content }),
747
+ (i.resizable ?? !0) && !z && /* @__PURE__ */ o(
748
+ "div",
749
+ {
750
+ className: "nice-wm__resize-handle",
751
+ onMouseDown: (L) => I(i.key, L, "resize")
752
+ }
753
+ )
754
+ ]
755
+ },
756
+ i.key
757
+ );
758
+ }),
759
+ e === void 0 && t,
760
+ u && /* @__PURE__ */ o("div", { className: "nice-wm__taskbar", role: "toolbar", "aria-label": f("wm.taskbar", "Taskbar"), children: c.map((i) => /* @__PURE__ */ y(
761
+ "button",
762
+ {
763
+ type: "button",
764
+ className: `nice-wm__taskbar-btn ${i.minimized ? "nice-wm__taskbar-btn--minimized" : ""}`,
765
+ onClick: () => {
766
+ i.minimized && B(i.key), C(i.key);
767
+ },
768
+ children: [
769
+ i.icon && /* @__PURE__ */ o("span", { className: "nice-wm__taskbar-icon", children: i.icon }),
770
+ /* @__PURE__ */ o("span", { className: "nice-wm__taskbar-label", children: i.title })
771
+ ]
772
+ },
773
+ i.key
774
+ )) })
775
+ ]
776
+ }
777
+ );
778
+ }
779
+ );
780
+ kt.displayName = "NiceWindowManager";
781
+ function Et(e, t) {
782
+ const n = document.querySelector(e);
783
+ if (!n)
784
+ return null;
785
+ const s = n.getBoundingClientRect();
786
+ return {
787
+ top: s.top - t + window.scrollY,
788
+ left: s.left - t + window.scrollX,
789
+ width: s.width + t * 2,
790
+ height: s.height + t * 2
791
+ };
792
+ }
793
+ function zt(e, t, n, s) {
794
+ const u = { w: window.innerWidth, h: window.innerHeight + window.scrollY }, h = {
795
+ top: {
796
+ top: e.top - n - 12,
797
+ left: e.left + e.width / 2 - t / 2
798
+ },
799
+ bottom: {
800
+ top: e.top + e.height + 12,
801
+ left: e.left + e.width / 2 - t / 2
802
+ },
803
+ left: {
804
+ top: e.top + e.height / 2 - n / 2,
805
+ left: e.left - t - 12
806
+ },
807
+ right: {
808
+ top: e.top + e.height / 2 - n / 2,
809
+ left: e.left + e.width + 12
810
+ }
811
+ };
812
+ if (s && s !== "auto")
813
+ return { ...h[s], actualPlacement: s };
814
+ for (const g of ["bottom", "top", "right", "left"]) {
815
+ const p = h[g];
816
+ if (p.top >= 0 && p.left >= 0 && p.top + n <= u.h && p.left + t <= u.w)
817
+ return { ...p, actualPlacement: g };
818
+ }
819
+ return { ...h.bottom, actualPlacement: "bottom" };
820
+ }
821
+ const Ye = ({
822
+ steps: e,
823
+ active: t,
824
+ onFinish: n,
825
+ onSkip: s,
826
+ onStepChange: m,
827
+ closeOnEscape: u = !0,
828
+ closeOnOverlayClick: h = !1,
829
+ showProgress: g = !0,
830
+ showSkipButton: p = !0,
831
+ labels: E,
832
+ animationDuration: r = 300,
833
+ overlayOpacity: x = 0.6,
834
+ zIndex: X = 1e4
835
+ }) => {
836
+ const [f, T] = Y(0), [w, O] = Y(null), [c, v] = Y({ w: 340, h: 200 }), [a, C] = Y(!0), $ = V(null), B = V(-1), _ = e[f], I = f === e.length - 1, i = f === 0, z = E?.next ?? "Next", S = E?.back ?? "Back", L = E?.finish ?? "Finish", l = E?.skip ?? "Skip", b = E?.stepOf ?? "of";
837
+ H(() => {
838
+ if ($.current) {
839
+ const R = $.current.getBoundingClientRect();
840
+ v({ w: R.width, h: R.height });
841
+ }
842
+ }, [f, t]), H(() => {
843
+ if (!t || !_)
844
+ return;
845
+ const R = () => {
846
+ const A = Et(_.target, _.highlightPadding ?? 8);
847
+ O(A);
848
+ };
849
+ if (R(), _.scrollIntoView !== !1) {
850
+ document.querySelector(_.target)?.scrollIntoView({ behavior: "smooth", block: "center" });
851
+ const le = setTimeout(R, 350);
852
+ return () => clearTimeout(le);
853
+ }
854
+ }, [t, _, f]), H(() => {
855
+ !t || !_ || B.current !== f && (B.current >= 0 && B.current < e.length && e[B.current]?.onLeave?.(), _.onEnter?.(), B.current = f);
856
+ }, [t, _, f, e]), H(() => {
857
+ if (!t || !_?.advanceOn)
858
+ return;
859
+ const R = document.querySelector(_.target);
860
+ if (!R)
861
+ return;
862
+ const A = () => d();
863
+ return R.addEventListener(_.advanceOn.event, A), () => R.removeEventListener(_.advanceOn.event, A);
864
+ }, [t, _, f]), H(() => {
865
+ if (!t)
866
+ return;
867
+ const R = (A) => {
868
+ A.key === "Escape" && u ? s?.() : A.key === "ArrowRight" ? d() : A.key === "ArrowLeft" && P();
869
+ };
870
+ return document.addEventListener("keydown", R), () => document.removeEventListener("keydown", R);
871
+ }, [t, f, u]), H(() => {
872
+ C(!0);
873
+ const R = setTimeout(() => C(!1), r);
874
+ return () => clearTimeout(R);
875
+ }, [f, r]);
876
+ const d = k(() => {
877
+ if (I)
878
+ _?.onLeave?.(), n?.();
879
+ else {
880
+ const R = f + 1;
881
+ T(R), m?.(R);
882
+ }
883
+ }, [f, I, n, m, _]), P = k(() => {
884
+ if (!i) {
885
+ const R = f - 1;
886
+ T(R), m?.(R);
887
+ }
888
+ }, [f, i, m]), M = ge(() => w ? zt(w, c.w, c.h, _?.placement) : {
889
+ top: window.innerHeight / 2,
890
+ left: window.innerWidth / 2,
891
+ actualPlacement: "bottom"
892
+ }, [w, c, _?.placement]);
893
+ if (!t || !_)
894
+ return null;
895
+ const W = Math.max(document.documentElement.scrollWidth, window.innerWidth), U = Math.max(document.documentElement.scrollHeight, window.innerHeight);
896
+ return /* @__PURE__ */ y(
897
+ "div",
898
+ {
899
+ className: "nice-tutorial",
900
+ style: { zIndex: X },
901
+ "aria-modal": "true",
902
+ role: "dialog",
903
+ "aria-label": "Tutorial",
904
+ children: [
905
+ /* @__PURE__ */ y(
906
+ "svg",
907
+ {
908
+ className: "nice-tutorial__overlay",
909
+ style: {
910
+ position: "absolute",
911
+ top: 0,
912
+ left: 0,
913
+ width: W,
914
+ height: U,
915
+ pointerEvents: "auto"
916
+ },
917
+ onClick: h ? s : void 0,
918
+ children: [
919
+ /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ y("mask", { id: "nice-tutorial-mask", children: [
920
+ /* @__PURE__ */ o("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: "white" }),
921
+ w && /* @__PURE__ */ o(
922
+ "rect",
923
+ {
924
+ x: w.left,
925
+ y: w.top,
926
+ width: w.width,
927
+ height: w.height,
928
+ rx: "8",
929
+ fill: "black",
930
+ className: a ? "nice-tutorial__spotlight--entering" : ""
931
+ }
932
+ )
933
+ ] }) }),
934
+ /* @__PURE__ */ o(
935
+ "rect",
936
+ {
937
+ x: "0",
938
+ y: "0",
939
+ width: "100%",
940
+ height: "100%",
941
+ fill: `rgba(0,0,0,${x})`,
942
+ mask: "url(#nice-tutorial-mask)"
943
+ }
944
+ )
945
+ ]
946
+ }
947
+ ),
948
+ w && /* @__PURE__ */ o(
949
+ "div",
950
+ {
951
+ className: `nice-tutorial__highlight ${a ? "nice-tutorial__highlight--entering" : ""}`,
952
+ style: {
953
+ position: "absolute",
954
+ top: w.top,
955
+ left: w.left,
956
+ width: w.width,
957
+ height: w.height,
958
+ transition: `all ${r}ms ease`
959
+ }
960
+ }
961
+ ),
962
+ _.disableInteraction && w && /* @__PURE__ */ o(
963
+ "div",
964
+ {
965
+ className: "nice-tutorial__blocker",
966
+ style: {
967
+ position: "absolute",
968
+ top: w.top,
969
+ left: w.left,
970
+ width: w.width,
971
+ height: w.height
972
+ }
973
+ }
974
+ ),
975
+ /* @__PURE__ */ y(
976
+ "div",
977
+ {
978
+ ref: $,
979
+ className: `nice-tutorial__tooltip nice-tutorial__tooltip--${M.actualPlacement} ${a ? "nice-tutorial__tooltip--entering" : ""}`,
980
+ style: {
981
+ position: "absolute",
982
+ top: M.top,
983
+ left: M.left,
984
+ transition: `all ${r}ms ease`,
985
+ maxWidth: 380,
986
+ zIndex: X + 1
987
+ },
988
+ children: [
989
+ _.showArrow !== !1 && /* @__PURE__ */ o(
990
+ "div",
991
+ {
992
+ className: `nice-tutorial__arrow nice-tutorial__arrow--${M.actualPlacement}`
993
+ }
994
+ ),
995
+ /* @__PURE__ */ y("div", { className: "nice-tutorial__header", children: [
996
+ /* @__PURE__ */ o("h4", { className: "nice-tutorial__title", children: _.title }),
997
+ p && /* @__PURE__ */ o(
998
+ "button",
999
+ {
1000
+ type: "button",
1001
+ className: "nice-tutorial__close",
1002
+ onClick: s,
1003
+ "aria-label": l,
1004
+ children: "✕"
1005
+ }
1006
+ )
1007
+ ] }),
1008
+ /* @__PURE__ */ o(
1009
+ "div",
1010
+ {
1011
+ className: "nice-tutorial__content",
1012
+ dangerouslySetInnerHTML: { __html: ft(_.content) }
1013
+ }
1014
+ ),
1015
+ /* @__PURE__ */ y("div", { className: "nice-tutorial__footer", children: [
1016
+ g && /* @__PURE__ */ y("div", { className: "nice-tutorial__progress", children: [
1017
+ e.map((R, A) => /* @__PURE__ */ o(
1018
+ "span",
1019
+ {
1020
+ className: `nice-tutorial__dot ${A === f ? "nice-tutorial__dot--active" : ""} ${A < f ? "nice-tutorial__dot--done" : ""}`
1021
+ },
1022
+ A
1023
+ )),
1024
+ /* @__PURE__ */ y("span", { className: "nice-tutorial__step-label", children: [
1025
+ f + 1,
1026
+ " ",
1027
+ b,
1028
+ " ",
1029
+ e.length
1030
+ ] })
1031
+ ] }),
1032
+ /* @__PURE__ */ y("div", { className: "nice-tutorial__actions", children: [
1033
+ p && !I && /* @__PURE__ */ o(
1034
+ "button",
1035
+ {
1036
+ type: "button",
1037
+ className: "nice-tutorial__btn nice-tutorial__btn--skip",
1038
+ onClick: s,
1039
+ children: l
1040
+ }
1041
+ ),
1042
+ !i && /* @__PURE__ */ o(
1043
+ "button",
1044
+ {
1045
+ type: "button",
1046
+ className: "nice-tutorial__btn nice-tutorial__btn--back",
1047
+ onClick: P,
1048
+ children: S
1049
+ }
1050
+ ),
1051
+ !_.waitForAction && /* @__PURE__ */ o(
1052
+ "button",
1053
+ {
1054
+ type: "button",
1055
+ className: "nice-tutorial__btn nice-tutorial__btn--next",
1056
+ onClick: d,
1057
+ children: I ? L : z
1058
+ }
1059
+ )
1060
+ ] })
1061
+ ] })
1062
+ ]
1063
+ }
1064
+ )
1065
+ ]
1066
+ }
1067
+ );
1068
+ };
1069
+ Ye.displayName = "NiceTutorial";
1070
+ const Xe = Pe({
1071
+ startTutorial: () => {
1072
+ },
1073
+ stopTutorial: () => {
1074
+ },
1075
+ isActive: !1,
1076
+ currentStep: 0,
1077
+ nextStep: () => {
1078
+ },
1079
+ prevStep: () => {
1080
+ },
1081
+ goToStep: () => {
1082
+ }
1083
+ });
1084
+ function Bt() {
1085
+ return $e(Xe);
1086
+ }
1087
+ const Ct = ({ children: e }) => {
1088
+ const [t, n] = Y([]), [s, m] = Y(!1), [u, h] = Y(0), g = k((f) => {
1089
+ n(f), h(0), m(!0);
1090
+ }, []), p = k(() => {
1091
+ m(!1), h(0), n([]);
1092
+ }, []), E = k(() => {
1093
+ h((f) => Math.min(f + 1, t.length - 1));
1094
+ }, [t.length]), r = k(() => {
1095
+ h((f) => Math.max(f - 1, 0));
1096
+ }, []), x = k(
1097
+ (f) => {
1098
+ h(Math.max(0, Math.min(f, t.length - 1)));
1099
+ },
1100
+ [t.length]
1101
+ ), X = {
1102
+ startTutorial: g,
1103
+ stopTutorial: p,
1104
+ isActive: s,
1105
+ currentStep: u,
1106
+ nextStep: E,
1107
+ prevStep: r,
1108
+ goToStep: x
1109
+ };
1110
+ return /* @__PURE__ */ y(Xe.Provider, { value: X, children: [
1111
+ e,
1112
+ s && t.length > 0 && /* @__PURE__ */ o(
1113
+ Ye,
1114
+ {
1115
+ steps: t,
1116
+ active: s,
1117
+ onFinish: p,
1118
+ onSkip: p,
1119
+ onStepChange: h
1120
+ }
1121
+ )
1122
+ ] });
1123
+ };
1124
+ Ct.displayName = "NiceTutorialProvider";
1125
+ function It(e, t, n, s, m) {
1126
+ const u = e <= m, h = e + m >= n, g = t <= m, p = t + m >= s;
1127
+ return g && u ? "top-left" : g && h ? "top-right" : p && u ? "bottom-left" : p && h ? "bottom-right" : u ? "left" : h ? "right" : g ? "top" : p ? "bottom" : "none";
1128
+ }
1129
+ function Mt(e) {
1130
+ switch (e) {
1131
+ case "left":
1132
+ return { left: 0, top: 0, width: "50%", height: "100%" };
1133
+ case "right":
1134
+ return { left: "50%", top: 0, width: "50%", height: "100%" };
1135
+ case "top":
1136
+ return { left: 0, top: 0, width: "100%", height: "50%" };
1137
+ case "bottom":
1138
+ return { left: 0, top: "50%", width: "100%", height: "50%" };
1139
+ case "top-left":
1140
+ return { left: 0, top: 0, width: "50%", height: "50%" };
1141
+ case "top-right":
1142
+ return { left: "50%", top: 0, width: "50%", height: "50%" };
1143
+ case "bottom-left":
1144
+ return { left: 0, top: "50%", width: "50%", height: "50%" };
1145
+ case "bottom-right":
1146
+ return { left: "50%", top: "50%", width: "50%", height: "50%" };
1147
+ default:
1148
+ return null;
1149
+ }
1150
+ }
1151
+ const Rt = Ie(
1152
+ ({
1153
+ windowKey: e,
1154
+ title: t,
1155
+ icon: n,
1156
+ children: s,
1157
+ footer: m,
1158
+ x: u,
1159
+ y: h,
1160
+ defaultPosition: g,
1161
+ width: p = 480,
1162
+ height: E = 360,
1163
+ minWidth: r = 200,
1164
+ minHeight: x = 120,
1165
+ maxWidth: X,
1166
+ maxHeight: f,
1167
+ zIndex: T = 1,
1168
+ closable: w = !0,
1169
+ minimizable: O = !0,
1170
+ maximizable: c = !0,
1171
+ fullscreenable: v = !1,
1172
+ pinnable: a = !1,
1173
+ resizable: C = !0,
1174
+ draggable: $ = !0,
1175
+ snappable: B = !0,
1176
+ snapThreshold: _ = 20,
1177
+ minimized: I,
1178
+ maximized: i,
1179
+ fullscreen: z,
1180
+ pinned: S,
1181
+ focused: L,
1182
+ onClose: l,
1183
+ onMinimize: b,
1184
+ onMaximize: d,
1185
+ onFullscreen: P,
1186
+ onPin: M,
1187
+ onFocus: W,
1188
+ onMove: U,
1189
+ onResize: R,
1190
+ onSnap: A,
1191
+ onTitleBarDoubleClick: le,
1192
+ size: Oe = "md",
1193
+ statusBar: Me,
1194
+ titleBarActions: Ae,
1195
+ className: qe,
1196
+ style: Be,
1197
+ id: Re,
1198
+ accessMode: We,
1199
+ ...He
1200
+ }, Fe) => {
1201
+ const Ue = Ce(Re), Ke = wt(We, Re), { t: de } = ve(), be = V(null);
1202
+ be.current == null && (be.current = `nice-window-${Math.random().toString(36).slice(2, 10)}`);
1203
+ const q = e ?? be.current, Ge = u ?? g?.x ?? 100, Ve = h ?? g?.y ?? 100;
1204
+ if (Ke === "hidden")
1205
+ return null;
1206
+ const [fe, re] = Y({ x: Ge, y: Ve }), [we, _e] = Y({ width: p, height: E }), [je, Ze] = Y(!1), [Qe, Je] = Y(!1), [et, tt] = Y(!1), [nt, it] = Y(!1), [Z, ye] = Y("none"), ot = I ?? je, j = i ?? Qe, K = z ?? et, ue = S ?? nt, xe = L ?? !0, ce = fe.x, se = fe.y, J = we.width, ee = we.height, te = V(
1207
+ null
1208
+ ), G = V(null), D = V(null), ct = k(() => {
1209
+ l?.(q);
1210
+ }, [q, l]), st = k(() => {
1211
+ Ze(!0), b?.(q);
1212
+ }, [q, b]), Ne = k(() => {
1213
+ const N = !j;
1214
+ Je(N), !N && D.current ? (re({ x: D.current.x, y: D.current.y }), _e({ width: D.current.w, height: D.current.h }), D.current = null) : N && (D.current = { x: ce, y: se, w: J, h: ee }), ye("none"), d?.(q, N);
1215
+ }, [q, j, ce, se, J, ee, d]), ke = k(() => {
1216
+ const N = !K;
1217
+ tt(N), N ? D.current = { x: ce, y: se, w: J, h: ee } : D.current && (re({ x: D.current.x, y: D.current.y }), _e({ width: D.current.w, height: D.current.h }), D.current = null), P?.(q, N);
1218
+ }, [q, K, ce, se, J, ee, P]), rt = k(() => {
1219
+ const N = !ue;
1220
+ it(N), M?.(q, N);
1221
+ }, [q, ue, M]), me = k(() => {
1222
+ W?.(q);
1223
+ }, [q, W]), at = k(() => {
1224
+ le ? le(q) : c && Ne();
1225
+ }, [q, c, Ne, le]);
1226
+ H(() => {
1227
+ const N = (ne) => {
1228
+ if (!te.current)
1229
+ return;
1230
+ const Q = ne.clientX - te.current.startX + te.current.origX, he = ne.clientY - te.current.startY + te.current.origY;
1231
+ re({ x: Q, y: he }), U?.(q, { x: Q, y: he });
1232
+ }, F = (ne) => {
1233
+ if (te.current) {
1234
+ if (B) {
1235
+ const Q = It(
1236
+ ne.clientX,
1237
+ ne.clientY,
1238
+ window.innerWidth,
1239
+ window.innerHeight,
1240
+ _
1241
+ );
1242
+ Q !== "none" && (D.current = { x: fe.x, y: fe.y, w: J, h: ee }, ye(Q), A?.(q, Q));
1243
+ }
1244
+ te.current = null;
1245
+ }
1246
+ };
1247
+ return document.addEventListener("mousemove", N), document.addEventListener("mouseup", F), () => {
1248
+ document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", F);
1249
+ };
1250
+ });
1251
+ const lt = k(
1252
+ (N) => {
1253
+ !$ || j || K || (N.preventDefault(), Z !== "none" && (D.current && (re({ x: D.current.x, y: D.current.y }), _e({ width: D.current.w, height: D.current.h })), ye("none")), me(), te.current = { startX: N.clientX, startY: N.clientY, origX: ce, origY: se });
1254
+ },
1255
+ [$, j, K, Z, ce, se, me]
1256
+ );
1257
+ H(() => {
1258
+ const N = (ne) => {
1259
+ if (!G.current)
1260
+ return;
1261
+ const Q = ne.clientX - G.current.startX, he = ne.clientY - G.current.startY, ae = G.current.handle;
1262
+ let ie = G.current.origW, oe = G.current.origH;
1263
+ if (ae.includes("e") && (ie = G.current.origW + Q), ae.includes("w") && (ie = G.current.origW - Q), ae.includes("s") && (oe = G.current.origH + he), ae.includes("n") && (oe = G.current.origH - he), ie = Math.max(r, X ? Math.min(X, ie) : ie), oe = Math.max(x, f ? Math.min(f, oe) : oe), ae.includes("w")) {
1264
+ const Ee = we.width - ie;
1265
+ re((pe) => ({ ...pe, x: pe.x + Ee }));
1266
+ }
1267
+ if (ae.includes("n")) {
1268
+ const Ee = we.height - oe;
1269
+ re((pe) => ({ ...pe, y: pe.y + Ee }));
1270
+ }
1271
+ _e({ width: ie, height: oe }), R?.(q, { width: ie, height: oe });
1272
+ }, F = () => {
1273
+ G.current = null;
1274
+ };
1275
+ return document.addEventListener("mousemove", N), document.addEventListener("mouseup", F), () => {
1276
+ document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", F);
1277
+ };
1278
+ });
1279
+ const dt = k(
1280
+ (N, F) => {
1281
+ !C || j || K || Z !== "none" || (F.preventDefault(), F.stopPropagation(), me(), G.current = { startX: F.clientX, startY: F.clientY, origW: J, origH: ee, handle: N });
1282
+ },
1283
+ [C, j, K, Z, J, ee, me]
1284
+ );
1285
+ if (H(() => {
1286
+ if (!xe)
1287
+ return;
1288
+ const N = (F) => {
1289
+ F.key === "Escape" && K && ke();
1290
+ };
1291
+ return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
1292
+ }, [xe, K, ke]), ot)
1293
+ return null;
1294
+ const Se = Z !== "none" ? Mt(Z) : null, Le = j || K, ut = K ? { position: "fixed", top: 0, left: 0, width: "100vw", height: "100vh", zIndex: 999999 } : j ? { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", zIndex: T } : Se ? { position: "absolute", ...Se, zIndex: T } : { position: "absolute", top: se, left: ce, width: J, height: ee, zIndex: T }, mt = ["n", "e", "s", "w", "ne", "se", "sw", "nw"], ht = {
1295
+ n: "ns-resize",
1296
+ s: "ns-resize",
1297
+ e: "ew-resize",
1298
+ w: "ew-resize",
1299
+ ne: "nesw-resize",
1300
+ sw: "nesw-resize",
1301
+ nw: "nwse-resize",
1302
+ se: "nwse-resize"
1303
+ };
1304
+ return /* @__PURE__ */ y(
1305
+ "div",
1306
+ {
1307
+ ref: Fe,
1308
+ id: Ue,
1309
+ className: `nice-window nice-window--${Oe} ${xe ? "nice-window--focused" : ""} ${ue ? "nice-window--pinned" : ""} ${Le ? "nice-window--maximized" : ""} ${Z !== "none" ? `nice-window--snapped-${Z}` : ""} ${qe ?? ""}`,
1310
+ style: { ...ut, ...Be },
1311
+ onMouseDown: me,
1312
+ role: "dialog",
1313
+ "aria-label": t,
1314
+ ...He,
1315
+ children: [
1316
+ /* @__PURE__ */ y(
1317
+ "div",
1318
+ {
1319
+ className: "nice-window__titlebar",
1320
+ onMouseDown: lt,
1321
+ onDoubleClick: at,
1322
+ children: [
1323
+ n && /* @__PURE__ */ o("span", { className: "nice-window__icon", children: n }),
1324
+ /* @__PURE__ */ o("span", { className: "nice-window__title", children: t }),
1325
+ /* @__PURE__ */ y("div", { className: "nice-window__actions", children: [
1326
+ Ae,
1327
+ a && /* @__PURE__ */ o(
1328
+ "button",
1329
+ {
1330
+ type: "button",
1331
+ className: `nice-window__action nice-window__action--pin ${ue ? "nice-window__action--active" : ""}`,
1332
+ onClick: rt,
1333
+ title: de("window.pin", ue ? "Unpin" : "Pin"),
1334
+ children: "📌"
1335
+ }
1336
+ ),
1337
+ O && /* @__PURE__ */ o(
1338
+ "button",
1339
+ {
1340
+ type: "button",
1341
+ className: "nice-window__action nice-window__action--minimize",
1342
+ onClick: st,
1343
+ title: de("window.minimize", "Minimize"),
1344
+ children: "─"
1345
+ }
1346
+ ),
1347
+ c && /* @__PURE__ */ o(
1348
+ "button",
1349
+ {
1350
+ type: "button",
1351
+ className: "nice-window__action nice-window__action--maximize",
1352
+ onClick: Ne,
1353
+ title: de("window.maximize", j ? "Restore" : "Maximize"),
1354
+ children: j ? "❐" : "☐"
1355
+ }
1356
+ ),
1357
+ v && /* @__PURE__ */ o(
1358
+ "button",
1359
+ {
1360
+ type: "button",
1361
+ className: "nice-window__action nice-window__action--fullscreen",
1362
+ onClick: ke,
1363
+ title: de("window.fullscreen", K ? "Exit Full Screen" : "Full Screen"),
1364
+ children: K ? "⇲" : "⇱"
1365
+ }
1366
+ ),
1367
+ w && /* @__PURE__ */ o(
1368
+ "button",
1369
+ {
1370
+ type: "button",
1371
+ className: "nice-window__action nice-window__action--close",
1372
+ onClick: ct,
1373
+ title: de("window.close", "Close"),
1374
+ children: "✕"
1375
+ }
1376
+ )
1377
+ ] })
1378
+ ]
1379
+ }
1380
+ ),
1381
+ /* @__PURE__ */ o("div", { className: "nice-window__body", children: s }),
1382
+ m && /* @__PURE__ */ o("div", { className: "nice-window__footer", children: m }),
1383
+ Me && /* @__PURE__ */ o("div", { className: "nice-window__statusbar", children: Me }),
1384
+ C && !Le && Z === "none" && /* @__PURE__ */ o(Te, { children: mt.map((N) => /* @__PURE__ */ o(
1385
+ "div",
1386
+ {
1387
+ className: `nice-window__resize nice-window__resize--${N}`,
1388
+ style: { cursor: ht[N] },
1389
+ onMouseDown: (F) => dt(N, F)
1390
+ },
1391
+ N
1392
+ )) })
1393
+ ]
1394
+ }
1395
+ );
1396
+ }
1397
+ );
1398
+ Rt.displayName = "NiceWindow";
1399
+ export {
1400
+ $t as N,
1401
+ Nt as a,
1402
+ Yt as b,
1403
+ xt as c,
1404
+ Dt as d,
1405
+ Pt as e,
1406
+ Ot as f,
1407
+ Xt as g,
1408
+ At as h,
1409
+ Ye as i,
1410
+ Ct as j,
1411
+ Rt as k,
1412
+ kt as l,
1413
+ qt as m,
1414
+ ze as n,
1415
+ vt as o,
1416
+ Bt as p,
1417
+ yt as u
1418
+ };