@nice2dev/ui-3d 1.0.5 → 1.0.6

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 (95) hide show
  1. package/dist/cjs/core/i18n.js +3 -3
  2. package/dist/cjs/dance/DanceBridge.js +13 -13
  3. package/dist/cjs/dance/DanceScoreEngine.js +8 -8
  4. package/dist/cjs/dance/PoseDetector.js +20 -20
  5. package/dist/cjs/material/NiceMaterialEditor.js +19 -19
  6. package/dist/cjs/model/ModelEditorLeftPanel.js +5 -5
  7. package/dist/cjs/model/ModelEditorLeftPanel.js.map +1 -1
  8. package/dist/cjs/model/ModelEditorMenuBar.js +6 -5
  9. package/dist/cjs/model/ModelEditorMenuBar.js.map +1 -1
  10. package/dist/cjs/model/ModelEditorRightPanel.js +19 -17
  11. package/dist/cjs/model/ModelEditorRightPanel.js.map +1 -1
  12. package/dist/cjs/model/ModelEditorSubComponents.js +10 -9
  13. package/dist/cjs/model/ModelEditorSubComponents.js.map +1 -1
  14. package/dist/cjs/model/ModelEditorTimeline.js +6 -5
  15. package/dist/cjs/model/ModelEditorTimeline.js.map +1 -1
  16. package/dist/cjs/model/ModelEditorToolbar.js +4 -4
  17. package/dist/cjs/model/ModelEditorToolbar.js.map +1 -1
  18. package/dist/cjs/model/ModelEditorViewport.js +2 -2
  19. package/dist/cjs/model/ModelViewer.js +14 -13
  20. package/dist/cjs/model/ModelViewer.js.map +1 -1
  21. package/dist/cjs/model/NiceArmatureEditor.js +18 -18
  22. package/dist/cjs/model/NiceMorphTargetEditor.js +18 -18
  23. package/dist/cjs/model/NiceOctree.js +16 -16
  24. package/dist/cjs/model/NicePhysicsSimulation.js +24 -24
  25. package/dist/cjs/model/NiceProceduralGeometry.js +8 -8
  26. package/dist/cjs/model/NiceTerrainEditor.js +19 -19
  27. package/dist/cjs/model/NiceWeightPainter.js +14 -14
  28. package/dist/cjs/model/NiceXRPreview.js +18 -18
  29. package/dist/cjs/model/useModelEditor.js +127 -127
  30. package/dist/cjs/model/useModelViewer.js +61 -61
  31. package/dist/cjs/particle/NiceParticleEditor.js +11 -11
  32. package/dist/cjs/rendering/NiceCascadedShadows.js +12 -12
  33. package/dist/cjs/rendering/NiceRenderExport.js +5 -5
  34. package/dist/cjs/rendering/NiceSSAO.js +18 -18
  35. package/dist/cjs/rendering/NiceSSR.js +14 -14
  36. package/dist/cjs/rendering/NiceWebGPURenderer.js +21 -21
  37. package/dist/cjs/ui/dist/NiceButton-DmTHNHet.js +453 -0
  38. package/dist/cjs/ui/dist/NiceButton-DmTHNHet.js.map +1 -0
  39. package/dist/cjs/ui/dist/NiceErrorBoundary-D1hh5GGe.js +543 -0
  40. package/dist/cjs/ui/dist/NiceErrorBoundary-D1hh5GGe.js.map +1 -0
  41. package/dist/cjs/ui/dist/NiceModuleLifecyclePanel-BapdidD6.js +4772 -0
  42. package/dist/cjs/ui/dist/NiceModuleLifecyclePanel-BapdidD6.js.map +1 -0
  43. package/dist/cjs/ui/dist/NicePinCodeInput-4q8yULuo.js +11329 -0
  44. package/dist/cjs/ui/dist/NicePinCodeInput-4q8yULuo.js.map +1 -0
  45. package/dist/cjs/ui/dist/NiceSavedQueryPanel-DUw8plYP.js +5544 -0
  46. package/dist/cjs/ui/dist/NiceSavedQueryPanel-DUw8plYP.js.map +1 -0
  47. package/dist/cjs/ui/dist/NiceStockChart-Cpmv9_Cc.js +2244 -0
  48. package/dist/cjs/ui/dist/NiceStockChart-Cpmv9_Cc.js.map +1 -0
  49. package/dist/cjs/ui/dist/NiceToggle-C1UKGXmJ.js +212 -0
  50. package/dist/cjs/ui/dist/NiceToggle-C1UKGXmJ.js.map +1 -0
  51. package/dist/cjs/ui/dist/NiceWindow-D1awkyFl.js +697 -0
  52. package/dist/cjs/ui/dist/NiceWindow-D1awkyFl.js.map +1 -0
  53. package/dist/cjs/ui/dist/core-CfXsl755.js +9597 -0
  54. package/dist/cjs/ui/dist/core-CfXsl755.js.map +1 -0
  55. package/dist/cjs/ui/dist/index-CNwVELPJ.js +31214 -0
  56. package/dist/cjs/ui/dist/index-CNwVELPJ.js.map +1 -0
  57. package/dist/cjs/ui/dist/index-x8mRM4Jc.js +20 -0
  58. package/dist/cjs/ui/dist/index-x8mRM4Jc.js.map +1 -0
  59. package/dist/cjs/uv/NiceUVEditor.js +24 -24
  60. package/dist/esm/model/ModelEditorLeftPanel.js +5 -5
  61. package/dist/esm/model/ModelEditorMenuBar.js +6 -5
  62. package/dist/esm/model/ModelEditorMenuBar.js.map +1 -1
  63. package/dist/esm/model/ModelEditorRightPanel.js +19 -17
  64. package/dist/esm/model/ModelEditorRightPanel.js.map +1 -1
  65. package/dist/esm/model/ModelEditorSubComponents.js +7 -6
  66. package/dist/esm/model/ModelEditorSubComponents.js.map +1 -1
  67. package/dist/esm/model/ModelEditorTimeline.js +6 -5
  68. package/dist/esm/model/ModelEditorTimeline.js.map +1 -1
  69. package/dist/esm/model/ModelEditorToolbar.js +4 -4
  70. package/dist/esm/model/ModelEditorViewport.js +2 -2
  71. package/dist/esm/model/ModelViewer.js +6 -5
  72. package/dist/esm/model/ModelViewer.js.map +1 -1
  73. package/dist/esm/ui/dist/NiceButton-DmTHNHet.js +448 -0
  74. package/dist/esm/ui/dist/NiceButton-DmTHNHet.js.map +1 -0
  75. package/dist/esm/ui/dist/NiceErrorBoundary-D1hh5GGe.js +533 -0
  76. package/dist/esm/ui/dist/NiceErrorBoundary-D1hh5GGe.js.map +1 -0
  77. package/dist/esm/ui/dist/NiceModuleLifecyclePanel-BapdidD6.js +4731 -0
  78. package/dist/esm/ui/dist/NiceModuleLifecyclePanel-BapdidD6.js.map +1 -0
  79. package/dist/esm/ui/dist/NicePinCodeInput-4q8yULuo.js +11259 -0
  80. package/dist/esm/ui/dist/NicePinCodeInput-4q8yULuo.js.map +1 -0
  81. package/dist/esm/ui/dist/NiceSavedQueryPanel-DUw8plYP.js +5527 -0
  82. package/dist/esm/ui/dist/NiceSavedQueryPanel-DUw8plYP.js.map +1 -0
  83. package/dist/esm/ui/dist/NiceStockChart-Cpmv9_Cc.js +2222 -0
  84. package/dist/esm/ui/dist/NiceStockChart-Cpmv9_Cc.js.map +1 -0
  85. package/dist/esm/ui/dist/NiceToggle-C1UKGXmJ.js +208 -0
  86. package/dist/esm/ui/dist/NiceToggle-C1UKGXmJ.js.map +1 -0
  87. package/dist/esm/ui/dist/NiceWindow-D1awkyFl.js +686 -0
  88. package/dist/esm/ui/dist/NiceWindow-D1awkyFl.js.map +1 -0
  89. package/dist/esm/ui/dist/core-CfXsl755.js +9419 -0
  90. package/dist/esm/ui/dist/core-CfXsl755.js.map +1 -0
  91. package/dist/esm/ui/dist/index-CNwVELPJ.js +31110 -0
  92. package/dist/esm/ui/dist/index-CNwVELPJ.js.map +1 -0
  93. package/dist/esm/ui/dist/index-x8mRM4Jc.js +18 -0
  94. package/dist/esm/ui/dist/index-x8mRM4Jc.js.map +1 -0
  95. package/package.json +1 -1
@@ -0,0 +1,533 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { d as cl, b as de, c as ll, h as ws, u as ys } from './core-CfXsl755.js';
3
+ import we, { useState, useCallback, useEffect, useRef, forwardRef, Component } from 'react';
4
+
5
+ const Q = {
6
+ info: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" }) }),
7
+ success: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", clipRule: "evenodd" }) }),
8
+ warning: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
9
+ error: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z", clipRule: "evenodd" }) })
10
+ }, he = ({
11
+ variant: n = "info",
12
+ title: t,
13
+ children: s,
14
+ closable: r,
15
+ onClose: i,
16
+ icon: c,
17
+ size: l = "md",
18
+ className: u,
19
+ style: d,
20
+ displayStyle: p
21
+ }) => {
22
+ const m = cl("card", p);
23
+ return /* @__PURE__ */ jsxs(
24
+ "div",
25
+ {
26
+ className: `nice-alert nice-alert--${n} nice-alert--${l} nice-alert--ds-${m} ${u || ""}`,
27
+ style: d,
28
+ role: "alert",
29
+ children: [
30
+ /* @__PURE__ */ jsx("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: c || Q[n] }),
31
+ /* @__PURE__ */ jsxs("div", { className: "nice-alert__content", children: [
32
+ t && /* @__PURE__ */ jsx("div", { className: "nice-alert__title", children: t }),
33
+ /* @__PURE__ */ jsx("div", { children: s })
34
+ ] }),
35
+ r && /* @__PURE__ */ jsx("button", { type: "button", className: "nice-alert__close", onClick: i, "aria-label": "Close", children: "✕" })
36
+ ]
37
+ }
38
+ );
39
+ }, fe = ({
40
+ open: n,
41
+ onClose: t,
42
+ title: s,
43
+ size: r = "md",
44
+ children: i,
45
+ footer: c,
46
+ closeOnOverlay: l = true,
47
+ closeOnEscape: u = true,
48
+ fullscreenable: d,
49
+ zIndex: p,
50
+ className: m,
51
+ style: y,
52
+ displayStyle: v
53
+ }) => {
54
+ const { t: _ } = de(), g = useRef(null), [h, o] = useState(false), $ = ll("modal", v), w = cl("modal", v);
55
+ return ws(g, n), useEffect(() => {
56
+ if (!n || !u) return;
57
+ const f = (C) => {
58
+ C.key === "Escape" && t();
59
+ };
60
+ return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
61
+ }, [n, u, t]), useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
62
+ document.body.style.overflow = "";
63
+ }), [n]), n ? /* @__PURE__ */ jsx(
64
+ "div",
65
+ {
66
+ className: "nice-modal-overlay",
67
+ style: p ? { zIndex: p } : void 0,
68
+ onClick: l ? t : void 0,
69
+ children: /* @__PURE__ */ jsxs(
70
+ "div",
71
+ {
72
+ ref: g,
73
+ className: `nice-modal nice-modal--${h ? "full" : r} nice-modal--ds-${w} ${m || ""}`,
74
+ style: { ...$, ...y },
75
+ role: "dialog",
76
+ "aria-modal": "true",
77
+ "aria-label": s,
78
+ onClick: (f) => f.stopPropagation(),
79
+ children: [
80
+ s && /* @__PURE__ */ jsxs("div", { className: "nice-modal__header", children: [
81
+ /* @__PURE__ */ jsx("h2", { className: "nice-modal__title", children: s }),
82
+ /* @__PURE__ */ jsxs("div", { className: "nice-modal__header-actions", children: [
83
+ d && /* @__PURE__ */ jsx(
84
+ "button",
85
+ {
86
+ type: "button",
87
+ className: "nice-modal__fullscreen",
88
+ onClick: () => o((f) => !f),
89
+ "aria-label": h ? "Exit fullscreen" : "Fullscreen",
90
+ children: h ? "⇲" : "⇱"
91
+ }
92
+ ),
93
+ /* @__PURE__ */ jsx(
94
+ "button",
95
+ {
96
+ type: "button",
97
+ className: "nice-modal__close",
98
+ onClick: t,
99
+ "aria-label": _("controls.close", "Close"),
100
+ children: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
101
+ }
102
+ )
103
+ ] })
104
+ ] }),
105
+ /* @__PURE__ */ jsx("div", { className: "nice-modal__body", children: i }),
106
+ c && /* @__PURE__ */ jsx("div", { className: "nice-modal__footer", children: c })
107
+ ]
108
+ }
109
+ )
110
+ }
111
+ ) : null;
112
+ }, _e = ({
113
+ open: n,
114
+ onClose: t,
115
+ title: s,
116
+ position: r = "right",
117
+ size: i = "md",
118
+ children: c,
119
+ footer: l,
120
+ transitionDuration: u,
121
+ className: d,
122
+ style: p,
123
+ displayStyle: m
124
+ }) => {
125
+ const y = ll("modal", m), v = cl("modal", m), { t: _ } = de(), g = useRef(null);
126
+ return ws(g, n), useEffect(() => {
127
+ if (!n) return;
128
+ const h = (o) => {
129
+ o.key === "Escape" && t();
130
+ };
131
+ return document.addEventListener("keydown", h), document.body.style.overflow = "hidden", () => {
132
+ document.removeEventListener("keydown", h), document.body.style.overflow = "";
133
+ };
134
+ }, [n, t]), n ? /* @__PURE__ */ jsxs(Fragment, { children: [
135
+ /* @__PURE__ */ jsx("div", { className: "nice-drawer-overlay", onClick: t }),
136
+ /* @__PURE__ */ jsxs(
137
+ "div",
138
+ {
139
+ ref: g,
140
+ className: `nice-drawer nice-drawer--${r} nice-drawer--${i} nice-drawer--ds-${v} ${d || ""}`,
141
+ style: {
142
+ ...y,
143
+ ...p,
144
+ ...u != null ? { transitionDuration: `${u}ms` } : {}
145
+ },
146
+ role: "dialog",
147
+ "aria-modal": "true",
148
+ "aria-label": s,
149
+ children: [
150
+ s && /* @__PURE__ */ jsxs("div", { className: "nice-drawer__header", children: [
151
+ /* @__PURE__ */ jsx("h3", { className: "nice-drawer__title", children: s }),
152
+ /* @__PURE__ */ jsx(
153
+ "button",
154
+ {
155
+ type: "button",
156
+ className: "nice-drawer__close",
157
+ onClick: t,
158
+ "aria-label": _("controls.close", "Close"),
159
+ children: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
160
+ }
161
+ )
162
+ ] }),
163
+ /* @__PURE__ */ jsx("div", { className: "nice-drawer__body", children: c }),
164
+ l && /* @__PURE__ */ jsx("div", { className: "nice-drawer__footer", children: l })
165
+ ]
166
+ }
167
+ )
168
+ ] }) : null;
169
+ }, be = ({
170
+ toasts: n,
171
+ onDismiss: t,
172
+ position: s = "top-right"
173
+ }) => /* @__PURE__ */ jsx("div", { className: `nice-toast-container nice-toast-container--${s}`, children: n.map((r) => /* @__PURE__ */ jsx(ne, { toast: r, onDismiss: t }, r.id)) }), ne = ({ toast: n, onDismiss: t }) => {
174
+ const [s, r] = useState(false);
175
+ return useEffect(() => {
176
+ if (!n.duration && n.duration !== 0) {
177
+ const i = setTimeout(() => r(true), 4e3);
178
+ return () => clearTimeout(i);
179
+ }
180
+ if (n.duration > 0) {
181
+ const i = setTimeout(() => r(true), n.duration);
182
+ return () => clearTimeout(i);
183
+ }
184
+ }, [n.duration]), useEffect(() => {
185
+ if (s) {
186
+ const i = setTimeout(() => t(n.id), 200);
187
+ return () => clearTimeout(i);
188
+ }
189
+ }, [s, n.id, t]), /* @__PURE__ */ jsxs("div", { className: `nice-toast nice-toast--${n.variant} ${s ? "nice-toast--exiting" : ""}`, role: "alert", style: { position: "relative" }, children: [
190
+ /* @__PURE__ */ jsx("div", { className: "nice-toast__icon", children: Q[n.variant] }),
191
+ /* @__PURE__ */ jsxs("div", { className: "nice-toast__content", children: [
192
+ n.title && /* @__PURE__ */ jsx("div", { className: "nice-toast__title", children: n.title }),
193
+ /* @__PURE__ */ jsx("div", { className: "nice-toast__message", children: n.message })
194
+ ] }),
195
+ /* @__PURE__ */ jsx("button", { type: "button", className: "nice-toast__close", onClick: () => r(true), children: "✕" })
196
+ ] });
197
+ };
198
+ let ie = 0;
199
+ function pe() {
200
+ const [n, t] = useState([]), s = useCallback((i, c, l) => {
201
+ const u = `toast-${++ie}`;
202
+ return t((d) => [...d, { id: u, variant: i, message: c, title: l?.title, duration: l?.duration }]), u;
203
+ }, []), r = useCallback((i) => {
204
+ t((c) => c.filter((l) => l.id !== i));
205
+ }, []);
206
+ return {
207
+ toasts: n,
208
+ dismiss: r,
209
+ info: (i, c) => s("info", i, c),
210
+ success: (i, c) => s("success", i, c),
211
+ warning: (i, c) => s("warning", i, c),
212
+ error: (i, c) => s("error", i, c)
213
+ };
214
+ }
215
+ const te = {
216
+ info: /* @__PURE__ */ jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }),
217
+ warning: /* @__PURE__ */ jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) }),
218
+ error: /* @__PURE__ */ jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) }),
219
+ success: /* @__PURE__ */ jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) })
220
+ }, ve = ({
221
+ visible: n,
222
+ message: t,
223
+ header: s,
224
+ icon: r,
225
+ variant: i = "warning",
226
+ acceptLabel: c,
227
+ rejectLabel: l,
228
+ onAccept: u,
229
+ onReject: d,
230
+ closeOnOverlay: p = false,
231
+ closeOnEscape: m = true,
232
+ size: y = "md",
233
+ className: v,
234
+ style: _
235
+ }) => {
236
+ const { t: g } = de();
237
+ if (we.useEffect(() => {
238
+ if (!n || !m) return;
239
+ const w = (f) => {
240
+ f.key === "Escape" && d();
241
+ };
242
+ return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
243
+ }, [n, m, d]), we.useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
244
+ document.body.style.overflow = "";
245
+ }), [n]), !n) return null;
246
+ const h = r ?? te[i], o = c ?? g("confirm.accept", "Yes"), $ = l ?? g("confirm.reject", "No");
247
+ return /* @__PURE__ */ jsx("div", { className: "nice-modal-overlay", onClick: p ? d : void 0, children: /* @__PURE__ */ jsxs(
248
+ "div",
249
+ {
250
+ className: `nice-confirm nice-confirm--${i} nice-confirm--${y} ${v || ""}`,
251
+ style: _,
252
+ role: "alertdialog",
253
+ "aria-modal": "true",
254
+ "aria-label": s,
255
+ "aria-describedby": "nice-confirm-message",
256
+ onClick: (w) => w.stopPropagation(),
257
+ children: [
258
+ s && /* @__PURE__ */ jsx("div", { className: "nice-confirm__header", children: /* @__PURE__ */ jsx("h3", { className: "nice-confirm__title", children: s }) }),
259
+ /* @__PURE__ */ jsxs("div", { className: "nice-confirm__body", children: [
260
+ h && /* @__PURE__ */ jsx("div", { className: `nice-confirm__icon nice-confirm__icon--${i}`, children: h }),
261
+ /* @__PURE__ */ jsx("div", { id: "nice-confirm-message", className: "nice-confirm__message", children: t })
262
+ ] }),
263
+ /* @__PURE__ */ jsxs("div", { className: "nice-confirm__footer", children: [
264
+ /* @__PURE__ */ jsx(
265
+ "button",
266
+ {
267
+ type: "button",
268
+ className: "nice-btn nice-btn--ghost nice-btn--md",
269
+ onClick: d,
270
+ children: $
271
+ }
272
+ ),
273
+ /* @__PURE__ */ jsx(
274
+ "button",
275
+ {
276
+ type: "button",
277
+ className: `nice-btn nice-btn--${i === "error" ? "error" : "primary"} nice-btn--md`,
278
+ onClick: u,
279
+ autoFocus: true,
280
+ children: o
281
+ }
282
+ )
283
+ ] })
284
+ ]
285
+ }
286
+ ) });
287
+ };
288
+ const oe = forwardRef(
289
+ ({
290
+ visible: n,
291
+ onAcceptAll: t,
292
+ onRejectAll: s,
293
+ onSave: r,
294
+ categories: i = ["necessary", "analytics", "marketing", "preferences"],
295
+ defaults: c,
296
+ position: l = "bottom",
297
+ size: u = "md",
298
+ policyUrl: d,
299
+ showDetails: p = false,
300
+ className: m,
301
+ style: y,
302
+ id: v,
303
+ ..._
304
+ }, g) => {
305
+ const h = ys(v), { t: o } = de(), [$, w] = useState(true), f = n ?? $, [C, z] = useState(p), [b, T] = useState(() => {
306
+ const N = { necessary: true, analytics: false, marketing: false, preferences: false };
307
+ return c && Object.assign(N, c), N.necessary = true, N;
308
+ }), M = {
309
+ necessary: o("cookie.necessary", "Necessary"),
310
+ analytics: o("cookie.analytics", "Analytics"),
311
+ marketing: o("cookie.marketing", "Marketing"),
312
+ preferences: o("cookie.preferences", "Preferences")
313
+ }, D = {
314
+ necessary: o("cookie.necessaryDesc", "Required for the website to function. Cannot be disabled."),
315
+ analytics: o("cookie.analyticsDesc", "Help us understand how visitors interact with the website."),
316
+ marketing: o("cookie.marketingDesc", "Used to deliver relevant advertisements."),
317
+ preferences: o("cookie.preferencesDesc", "Allow the website to remember your choices.")
318
+ }, R = useCallback(() => {
319
+ const N = { necessary: true, analytics: true, marketing: true, preferences: true };
320
+ t?.(), r?.(N), w(false);
321
+ }, [t, r]), S = useCallback(() => {
322
+ const N = { necessary: true, analytics: false, marketing: false, preferences: false };
323
+ s?.(), r?.(N), w(false);
324
+ }, [s, r]), A = useCallback(() => {
325
+ r?.({ ...b, necessary: true }), w(false);
326
+ }, [b, r]);
327
+ return f ? /* @__PURE__ */ jsx(
328
+ "div",
329
+ {
330
+ ref: g,
331
+ id: h,
332
+ className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${u} ${m ?? ""}`,
333
+ style: y,
334
+ role: "dialog",
335
+ "aria-label": o("cookie.label", "Cookie Consent"),
336
+ "aria-modal": "true",
337
+ ..._,
338
+ children: /* @__PURE__ */ jsxs("div", { className: "nice-cookie-consent__content", children: [
339
+ /* @__PURE__ */ jsxs("p", { className: "nice-cookie-consent__message", children: [
340
+ o("cookie.message", "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."),
341
+ d && /* @__PURE__ */ jsxs(Fragment, { children: [
342
+ " ",
343
+ /* @__PURE__ */ jsx("a", { href: d, className: "nice-cookie-consent__link", target: "_blank", rel: "noopener noreferrer", children: o("cookie.learnMore", "Learn more") })
344
+ ] })
345
+ ] }),
346
+ C && /* @__PURE__ */ jsx("div", { className: "nice-cookie-consent__details", children: i.map((N) => /* @__PURE__ */ jsxs("label", { className: "nice-cookie-consent__category", children: [
347
+ /* @__PURE__ */ jsx(
348
+ "input",
349
+ {
350
+ type: "checkbox",
351
+ checked: b[N],
352
+ disabled: N === "necessary",
353
+ onChange: (B) => T((F) => ({ ...F, [N]: B.target.checked })),
354
+ className: "nice-cookie-consent__checkbox"
355
+ }
356
+ ),
357
+ /* @__PURE__ */ jsxs("div", { className: "nice-cookie-consent__cat-info", children: [
358
+ /* @__PURE__ */ jsx("strong", { children: M[N] }),
359
+ /* @__PURE__ */ jsx("span", { className: "nice-cookie-consent__cat-desc", children: D[N] })
360
+ ] })
361
+ ] }, N)) }),
362
+ /* @__PURE__ */ jsxs("div", { className: "nice-cookie-consent__actions", children: [
363
+ !C && /* @__PURE__ */ jsx("button", { type: "button", className: "nice-cookie-consent__btn nice-cookie-consent__btn--details", onClick: () => z(true), children: o("cookie.customize", "Customize") }),
364
+ C && /* @__PURE__ */ jsx("button", { type: "button", className: "nice-cookie-consent__btn nice-cookie-consent__btn--save", onClick: A, children: o("cookie.savePreferences", "Save preferences") }),
365
+ /* @__PURE__ */ jsx("button", { type: "button", className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject", onClick: S, children: o("cookie.rejectAll", "Reject all") }),
366
+ /* @__PURE__ */ jsx("button", { type: "button", className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept", onClick: R, children: o("cookie.acceptAll", "Accept all") })
367
+ ] })
368
+ ] })
369
+ }
370
+ ) : null;
371
+ }
372
+ );
373
+ oe.displayName = "NiceCookieConsent";
374
+ const le = forwardRef(
375
+ ({
376
+ onSubmit: n,
377
+ onForgotPassword: t,
378
+ onRegister: s,
379
+ loading: r = false,
380
+ error: i,
381
+ variant: c = "primary",
382
+ size: l = "md",
383
+ showRememberMe: u = true,
384
+ showForgotPassword: d = true,
385
+ showRegister: p = false,
386
+ title: m,
387
+ logo: y,
388
+ usernameLabel: v,
389
+ passwordLabel: _,
390
+ usernamePlaceholder: g,
391
+ passwordPlaceholder: h,
392
+ className: o,
393
+ style: $,
394
+ id: w,
395
+ ...f
396
+ }, C) => {
397
+ const z = ys(w), { t: b } = de(), [T, M] = useState(""), [D, R] = useState(""), [S, A] = useState(false), [N, B] = useState(false), F = `${z}-user`, H = `${z}-pass`, V = `${z}-remember`, X = useCallback(
398
+ (E) => {
399
+ E.preventDefault(), !r && n?.({ username: T, password: D, rememberMe: S });
400
+ },
401
+ [r, T, D, S, n]
402
+ );
403
+ return /* @__PURE__ */ jsxs(
404
+ "form",
405
+ {
406
+ ref: C,
407
+ id: z,
408
+ className: `nice-login nice-login--${c} nice-login--${l} ${o ?? ""}`,
409
+ style: $,
410
+ onSubmit: X,
411
+ noValidate: true,
412
+ ...f,
413
+ children: [
414
+ y && /* @__PURE__ */ jsx("div", { className: "nice-login__logo", children: y }),
415
+ m && /* @__PURE__ */ jsx("h2", { className: "nice-login__title", children: m ?? b("login.title", "Sign In") }),
416
+ i && /* @__PURE__ */ jsx("div", { className: "nice-login__error", role: "alert", children: i }),
417
+ /* @__PURE__ */ jsxs("div", { className: "nice-login__field", children: [
418
+ /* @__PURE__ */ jsx("label", { htmlFor: F, className: "nice-login__label", children: v ?? b("login.username", "Username") }),
419
+ /* @__PURE__ */ jsx(
420
+ "input",
421
+ {
422
+ id: F,
423
+ className: "nice-login__input",
424
+ type: "text",
425
+ value: T,
426
+ onChange: (E) => M(E.target.value),
427
+ placeholder: g ?? b("login.usernamePlaceholder", "Enter your username"),
428
+ autoComplete: "username",
429
+ required: true,
430
+ disabled: r,
431
+ "aria-required": "true"
432
+ }
433
+ )
434
+ ] }),
435
+ /* @__PURE__ */ jsxs("div", { className: "nice-login__field", children: [
436
+ /* @__PURE__ */ jsx("label", { htmlFor: H, className: "nice-login__label", children: _ ?? b("login.password", "Password") }),
437
+ /* @__PURE__ */ jsxs("div", { className: "nice-login__password-wrap", children: [
438
+ /* @__PURE__ */ jsx(
439
+ "input",
440
+ {
441
+ id: H,
442
+ className: "nice-login__input",
443
+ type: N ? "text" : "password",
444
+ value: D,
445
+ onChange: (E) => R(E.target.value),
446
+ placeholder: h ?? b("login.passwordPlaceholder", "Enter your password"),
447
+ autoComplete: "current-password",
448
+ required: true,
449
+ disabled: r,
450
+ "aria-required": "true"
451
+ }
452
+ ),
453
+ /* @__PURE__ */ jsx(
454
+ "button",
455
+ {
456
+ type: "button",
457
+ className: "nice-login__toggle-password",
458
+ onClick: () => B(!N),
459
+ "aria-label": N ? b("login.hidePassword", "Hide password") : b("login.showPassword", "Show password"),
460
+ tabIndex: -1,
461
+ children: N ? "🙈" : "👁"
462
+ }
463
+ )
464
+ ] })
465
+ ] }),
466
+ /* @__PURE__ */ jsxs("div", { className: "nice-login__options", children: [
467
+ u && /* @__PURE__ */ jsxs("label", { className: "nice-login__remember", htmlFor: V, children: [
468
+ /* @__PURE__ */ jsx(
469
+ "input",
470
+ {
471
+ id: V,
472
+ type: "checkbox",
473
+ checked: S,
474
+ onChange: (E) => A(E.target.checked),
475
+ disabled: r
476
+ }
477
+ ),
478
+ /* @__PURE__ */ jsx("span", { children: b("login.rememberMe", "Remember me") })
479
+ ] }),
480
+ d && t && /* @__PURE__ */ jsx("button", { type: "button", className: "nice-login__forgot", onClick: t, disabled: r, children: b("login.forgotPassword", "Forgot password?") })
481
+ ] }),
482
+ /* @__PURE__ */ jsx(
483
+ "button",
484
+ {
485
+ type: "submit",
486
+ className: `nice-login__submit nice-login__submit--${c}`,
487
+ disabled: r || !T || !D,
488
+ children: r ? b("login.loading", "Signing in...") : b("login.submit", "Sign In")
489
+ }
490
+ ),
491
+ p && s && /* @__PURE__ */ jsxs("p", { className: "nice-login__register", children: [
492
+ b("login.noAccount", "Don't have an account?"),
493
+ " ",
494
+ /* @__PURE__ */ jsx("button", { type: "button", className: "nice-login__register-link", onClick: s, disabled: r, children: b("login.register", "Register") })
495
+ ] })
496
+ ]
497
+ }
498
+ );
499
+ }
500
+ );
501
+ le.displayName = "NiceLoginForm";
502
+ const q = class q extends Component {
503
+ constructor() {
504
+ super(...arguments), this.state = {
505
+ hasError: false,
506
+ error: null
507
+ }, this.handleReset = () => {
508
+ this.setState({ hasError: false, error: null });
509
+ };
510
+ }
511
+ static getDerivedStateFromError(t) {
512
+ return { hasError: true, error: t };
513
+ }
514
+ componentDidCatch(t, s) {
515
+ this.props.onError?.(t, s);
516
+ }
517
+ render() {
518
+ if (this.state.hasError && this.state.error) {
519
+ const { fallback: t, showRetry: s = true, retryLabel: r = "Retry", title: i = "Something went wrong" } = this.props;
520
+ return typeof t == "function" ? t(this.state.error, this.handleReset) : t || /* @__PURE__ */ jsxs("div", { className: "nice-error-boundary", role: "alert", children: [
521
+ /* @__PURE__ */ jsx("div", { className: "nice-error-boundary__icon", children: "⚠️" }),
522
+ /* @__PURE__ */ jsx("h2", { className: "nice-error-boundary__title", children: i }),
523
+ /* @__PURE__ */ jsx("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
524
+ s && /* @__PURE__ */ jsx("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
525
+ ] });
526
+ }
527
+ return this.props.children;
528
+ }
529
+ };
530
+ q.displayName = "NiceErrorBoundary";
531
+
532
+ export { he as N, ve as a, oe as b, _e as c, le as e, fe as f, be as j, Q as k, pe as u };
533
+ //# sourceMappingURL=NiceErrorBoundary-D1hh5GGe.js.map