@sensorario/sg-components 0.0.103 → 0.0.105

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 (34) hide show
  1. package/dist/components/AppLauncher/AppLauncher.d.ts +1 -1
  2. package/dist/components/Avatar/Avatar.d.ts +10 -0
  3. package/dist/components/Avatar/Avatar.stories.d.ts +8 -0
  4. package/dist/components/Badge/Badge.d.ts +17 -0
  5. package/dist/components/Badge/Badge.stories.d.ts +8 -0
  6. package/dist/components/Button/Button.d.ts +1 -0
  7. package/dist/components/Button/Button.stories.d.ts +1 -0
  8. package/dist/components/Card/Card.d.ts +20 -0
  9. package/dist/components/Card/Card.stories.d.ts +9 -0
  10. package/dist/components/ConfirmModal/ConfirmModal.d.ts +18 -0
  11. package/dist/components/ConfirmModal/ConfirmModal.stories.d.ts +7 -0
  12. package/dist/components/FormField/FormField.d.ts +19 -0
  13. package/dist/components/FormField/FormField.stories.d.ts +6 -0
  14. package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts +6 -0
  15. package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts +5 -0
  16. package/dist/components/Modal/Modal.d.ts +1 -0
  17. package/dist/components/PasswordInput/PasswordInput.d.ts +1 -0
  18. package/dist/components/ProgressBar/ProgressBar.d.ts +16 -0
  19. package/dist/components/ProgressBar/ProgressBar.stories.d.ts +10 -0
  20. package/dist/components/Quadrato/Header/QuadratoHeader.d.ts +2 -0
  21. package/dist/components/Select/Select.d.ts +7 -0
  22. package/dist/components/StatusMessage/StatusMessage.d.ts +13 -0
  23. package/dist/components/StatusMessage/StatusMessage.stories.d.ts +10 -0
  24. package/dist/components/Table/Table.stories.d.ts +5 -0
  25. package/dist/components/Tabs/Tabs.d.ts +19 -0
  26. package/dist/components/Tabs/Tabs.stories.d.ts +8 -0
  27. package/dist/components/Textarea/Textarea.d.ts +7 -0
  28. package/dist/components/Toggle/Toggle.d.ts +5 -1
  29. package/dist/components/Toggle/Toggle.stories.d.ts +1 -0
  30. package/dist/i18n/index.d.ts +13 -0
  31. package/dist/index.d.ts +14 -0
  32. package/dist/index.es.js +846 -341
  33. package/dist/sg-components.css +1 -1
  34. package/package.json +13 -2
package/dist/index.es.js CHANGED
@@ -1,172 +1,174 @@
1
- import e, { forwardRef as t, useEffect as n, useId as r, useImperativeHandle as i, useRef as a, useState as o } from "react";
2
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
1
+ import e, { cloneElement as t, createElement as n, forwardRef as r, isValidElement as i, useEffect as a, useId as o, useImperativeHandle as s, useRef as c, useState as l } from "react";
2
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
3
+ import { setI18n as p, useTranslation as m } from "react-i18next";
4
+ import h from "i18next";
3
5
  //#region src/components/Icon/Icon.tsx
4
- var u = {
5
- menu: /* @__PURE__ */ l(s, { children: [
6
- /* @__PURE__ */ c("line", {
6
+ var g = {
7
+ menu: /* @__PURE__ */ f(u, { children: [
8
+ /* @__PURE__ */ d("line", {
7
9
  x1: "3",
8
10
  y1: "6",
9
11
  x2: "21",
10
12
  y2: "6"
11
13
  }),
12
- /* @__PURE__ */ c("line", {
14
+ /* @__PURE__ */ d("line", {
13
15
  x1: "3",
14
16
  y1: "12",
15
17
  x2: "21",
16
18
  y2: "12"
17
19
  }),
18
- /* @__PURE__ */ c("line", {
20
+ /* @__PURE__ */ d("line", {
19
21
  x1: "3",
20
22
  y1: "18",
21
23
  x2: "21",
22
24
  y2: "18"
23
25
  })
24
26
  ] }),
25
- layout: /* @__PURE__ */ l(s, { children: [
26
- /* @__PURE__ */ c("rect", {
27
+ layout: /* @__PURE__ */ f(u, { children: [
28
+ /* @__PURE__ */ d("rect", {
27
29
  x: "3",
28
30
  y: "3",
29
31
  width: "18",
30
32
  height: "18",
31
33
  rx: "2"
32
34
  }),
33
- /* @__PURE__ */ c("line", {
35
+ /* @__PURE__ */ d("line", {
34
36
  x1: "3",
35
37
  y1: "9",
36
38
  x2: "21",
37
39
  y2: "9"
38
40
  }),
39
- /* @__PURE__ */ c("line", {
41
+ /* @__PURE__ */ d("line", {
40
42
  x1: "9",
41
43
  y1: "9",
42
44
  x2: "9",
43
45
  y2: "21"
44
46
  })
45
47
  ] }),
46
- edit: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("path", { d: "M4 20l1-4L16 5l3 3L8 19l-4 1z" }), /* @__PURE__ */ c("line", {
48
+ edit: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", { d: "M4 20l1-4L16 5l3 3L8 19l-4 1z" }), /* @__PURE__ */ d("line", {
47
49
  x1: "14",
48
50
  y1: "7",
49
51
  x2: "17",
50
52
  y2: "10"
51
53
  })] }),
52
- "help-circle": /* @__PURE__ */ l(s, { children: [
53
- /* @__PURE__ */ c("circle", {
54
+ "help-circle": /* @__PURE__ */ f(u, { children: [
55
+ /* @__PURE__ */ d("circle", {
54
56
  cx: "12",
55
57
  cy: "12",
56
58
  r: "9"
57
59
  }),
58
- /* @__PURE__ */ c("path", { d: "M9.5 9a2.5 2.5 0 0 1 5 0c0 2-2.5 2-2.5 4" }),
59
- /* @__PURE__ */ c("line", {
60
+ /* @__PURE__ */ d("path", { d: "M9.5 9a2.5 2.5 0 0 1 5 0c0 2-2.5 2-2.5 4" }),
61
+ /* @__PURE__ */ d("line", {
60
62
  x1: "12",
61
63
  y1: "17",
62
64
  x2: "12",
63
65
  y2: "17.01"
64
66
  })
65
67
  ] }),
66
- check: /* @__PURE__ */ c("polyline", { points: "4 12 9 17 20 6" }),
67
- x: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("line", {
68
+ check: /* @__PURE__ */ d("polyline", { points: "4 12 9 17 20 6" }),
69
+ x: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("line", {
68
70
  x1: "6",
69
71
  y1: "6",
70
72
  x2: "18",
71
73
  y2: "18"
72
- }), /* @__PURE__ */ c("line", {
74
+ }), /* @__PURE__ */ d("line", {
73
75
  x1: "18",
74
76
  y1: "6",
75
77
  x2: "6",
76
78
  y2: "18"
77
79
  })] }),
78
- "file-plus": /* @__PURE__ */ l(s, { children: [
79
- /* @__PURE__ */ c("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
80
- /* @__PURE__ */ c("polyline", { points: "14 3 14 8 19 8" }),
81
- /* @__PURE__ */ c("line", {
80
+ "file-plus": /* @__PURE__ */ f(u, { children: [
81
+ /* @__PURE__ */ d("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
82
+ /* @__PURE__ */ d("polyline", { points: "14 3 14 8 19 8" }),
83
+ /* @__PURE__ */ d("line", {
82
84
  x1: "12",
83
85
  y1: "12",
84
86
  x2: "12",
85
87
  y2: "17"
86
88
  }),
87
- /* @__PURE__ */ c("line", {
89
+ /* @__PURE__ */ d("line", {
88
90
  x1: "9.5",
89
91
  y1: "14.5",
90
92
  x2: "14.5",
91
93
  y2: "14.5"
92
94
  })
93
95
  ] }),
94
- link: /* @__PURE__ */ l(s, { children: [
95
- /* @__PURE__ */ c("path", { d: "M9 15l6-6" }),
96
- /* @__PURE__ */ c("path", { d: "M8 13.5 5.5 16a3 3 0 0 0 4.24 4.24l2.5-2.5" }),
97
- /* @__PURE__ */ c("path", { d: "M16 10.5 18.5 8a3 3 0 0 0-4.24-4.24l-2.5 2.5" })
96
+ link: /* @__PURE__ */ f(u, { children: [
97
+ /* @__PURE__ */ d("path", { d: "M9 15l6-6" }),
98
+ /* @__PURE__ */ d("path", { d: "M8 13.5 5.5 16a3 3 0 0 0 4.24 4.24l2.5-2.5" }),
99
+ /* @__PURE__ */ d("path", { d: "M16 10.5 18.5 8a3 3 0 0 0-4.24-4.24l-2.5 2.5" })
98
100
  ] }),
99
- "share-2": /* @__PURE__ */ l(s, { children: [
100
- /* @__PURE__ */ c("circle", {
101
+ "share-2": /* @__PURE__ */ f(u, { children: [
102
+ /* @__PURE__ */ d("circle", {
101
103
  cx: "6",
102
104
  cy: "12",
103
105
  r: "2.4"
104
106
  }),
105
- /* @__PURE__ */ c("circle", {
107
+ /* @__PURE__ */ d("circle", {
106
108
  cx: "18",
107
109
  cy: "6",
108
110
  r: "2.4"
109
111
  }),
110
- /* @__PURE__ */ c("circle", {
112
+ /* @__PURE__ */ d("circle", {
111
113
  cx: "18",
112
114
  cy: "18",
113
115
  r: "2.4"
114
116
  }),
115
- /* @__PURE__ */ c("line", {
117
+ /* @__PURE__ */ d("line", {
116
118
  x1: "8.2",
117
119
  y1: "10.8",
118
120
  x2: "15.8",
119
121
  y2: "7.2"
120
122
  }),
121
- /* @__PURE__ */ c("line", {
123
+ /* @__PURE__ */ d("line", {
122
124
  x1: "8.2",
123
125
  y1: "13.2",
124
126
  x2: "15.8",
125
127
  y2: "16.8"
126
128
  })
127
129
  ] }),
128
- download: /* @__PURE__ */ l(s, { children: [
129
- /* @__PURE__ */ c("path", { d: "M12 3v12" }),
130
- /* @__PURE__ */ c("polyline", { points: "7 11 12 16 17 11" }),
131
- /* @__PURE__ */ c("path", { d: "M5 19h14" })
130
+ download: /* @__PURE__ */ f(u, { children: [
131
+ /* @__PURE__ */ d("path", { d: "M12 3v12" }),
132
+ /* @__PURE__ */ d("polyline", { points: "7 11 12 16 17 11" }),
133
+ /* @__PURE__ */ d("path", { d: "M5 19h14" })
132
134
  ] }),
133
- book: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("path", { d: "M4 5.5A2.5 2.5 0 0 1 6.5 3H12v18H6.5A2.5 2.5 0 0 1 4 18.5z" }), /* @__PURE__ */ c("path", { d: "M20 5.5A2.5 2.5 0 0 0 17.5 3H12v18h5.5a2.5 2.5 0 0 0 2.5-2.5z" })] }),
134
- printer: /* @__PURE__ */ l(s, { children: [
135
- /* @__PURE__ */ c("path", { d: "M6 9V3h12v6" }),
136
- /* @__PURE__ */ c("rect", {
135
+ book: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", { d: "M4 5.5A2.5 2.5 0 0 1 6.5 3H12v18H6.5A2.5 2.5 0 0 1 4 18.5z" }), /* @__PURE__ */ d("path", { d: "M20 5.5A2.5 2.5 0 0 0 17.5 3H12v18h5.5a2.5 2.5 0 0 0 2.5-2.5z" })] }),
136
+ printer: /* @__PURE__ */ f(u, { children: [
137
+ /* @__PURE__ */ d("path", { d: "M6 9V3h12v6" }),
138
+ /* @__PURE__ */ d("rect", {
137
139
  x: "4",
138
140
  y: "9",
139
141
  width: "16",
140
142
  height: "8",
141
143
  rx: "1.5"
142
144
  }),
143
- /* @__PURE__ */ c("path", { d: "M6 17v4h12v-4" })
145
+ /* @__PURE__ */ d("path", { d: "M6 17v4h12v-4" })
144
146
  ] }),
145
- eye: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("path", { d: "M2 12c2.5-5 7-8 10-8s7.5 3 10 8c-2.5 5-7 8-10 8s-7.5-3-10-8z" }), /* @__PURE__ */ c("circle", {
147
+ eye: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", { d: "M2 12c2.5-5 7-8 10-8s7.5 3 10 8c-2.5 5-7 8-10 8s-7.5-3-10-8z" }), /* @__PURE__ */ d("circle", {
146
148
  cx: "12",
147
149
  cy: "12",
148
150
  r: "3"
149
151
  })] }),
150
- columns: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
152
+ columns: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
151
153
  x: "3",
152
154
  y: "4",
153
155
  width: "8",
154
156
  height: "16",
155
157
  rx: "1.5"
156
- }), /* @__PURE__ */ c("rect", {
158
+ }), /* @__PURE__ */ d("rect", {
157
159
  x: "13",
158
160
  y: "4",
159
161
  width: "8",
160
162
  height: "16",
161
163
  rx: "1.5"
162
164
  })] }),
163
- "sidebar-left": /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
165
+ "sidebar-left": /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
164
166
  x: "3",
165
167
  y: "4",
166
168
  width: "18",
167
169
  height: "16",
168
170
  rx: "2"
169
- }), /* @__PURE__ */ c("rect", {
171
+ }), /* @__PURE__ */ d("rect", {
170
172
  x: "4",
171
173
  y: "5",
172
174
  width: "6",
@@ -175,13 +177,13 @@ var u = {
175
177
  fill: "currentColor",
176
178
  stroke: "none"
177
179
  })] }),
178
- "sidebar-right": /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
180
+ "sidebar-right": /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
179
181
  x: "3",
180
182
  y: "4",
181
183
  width: "18",
182
184
  height: "16",
183
185
  rx: "2"
184
- }), /* @__PURE__ */ c("rect", {
186
+ }), /* @__PURE__ */ d("rect", {
185
187
  x: "14",
186
188
  y: "5",
187
189
  width: "6",
@@ -190,29 +192,29 @@ var u = {
190
192
  fill: "currentColor",
191
193
  stroke: "none"
192
194
  })] }),
193
- play: /* @__PURE__ */ c("polygon", { points: "5 3 19 12 5 21 5 3" }),
194
- pause: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
195
+ play: /* @__PURE__ */ d("polygon", { points: "5 3 19 12 5 21 5 3" }),
196
+ pause: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
195
197
  x: "6",
196
198
  y: "4",
197
199
  width: "4",
198
200
  height: "16",
199
201
  rx: "1"
200
- }), /* @__PURE__ */ c("rect", {
202
+ }), /* @__PURE__ */ d("rect", {
201
203
  x: "14",
202
204
  y: "4",
203
205
  width: "4",
204
206
  height: "16",
205
207
  rx: "1"
206
208
  })] }),
207
- "volume-2": /* @__PURE__ */ l(s, { children: [
208
- /* @__PURE__ */ c("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
209
- /* @__PURE__ */ c("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
210
- /* @__PURE__ */ c("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
209
+ "volume-2": /* @__PURE__ */ f(u, { children: [
210
+ /* @__PURE__ */ d("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
211
+ /* @__PURE__ */ d("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
212
+ /* @__PURE__ */ d("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
211
213
  ] }),
212
- "tech-node": /* @__PURE__ */ c("polygon", { points: "12,3 19.8,7.5 19.8,16.5 12,21 4.2,16.5 4.2,7.5" }),
213
- "tech-go": /* @__PURE__ */ c("polygon", { points: "12,3 21,12 12,21 3,12" }),
214
- "tech-php": /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("path", { d: "M9 4c-1.5 0-2.5 1-2.5 2.5v3c0 1-.5 1.5-1.5 2.5 1 1 1.5 1.5 1.5 2.5v3c0 1.5 1 2.5 2.5 2.5" }), /* @__PURE__ */ c("path", { d: "M15 4c1.5 0 2.5 1 2.5 2.5v3c0 1 .5 1.5 1.5 2.5-1 1-1.5 1.5-1.5 2.5v3c0 1.5-1 2.5-2.5 2.5" })] }),
215
- grid: /* @__PURE__ */ c("g", {
214
+ "tech-node": /* @__PURE__ */ d("polygon", { points: "12,3 19.8,7.5 19.8,16.5 12,21 4.2,16.5 4.2,7.5" }),
215
+ "tech-go": /* @__PURE__ */ d("polygon", { points: "12,3 21,12 12,21 3,12" }),
216
+ "tech-php": /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("path", { d: "M9 4c-1.5 0-2.5 1-2.5 2.5v3c0 1-.5 1.5-1.5 2.5 1 1 1.5 1.5 1.5 2.5v3c0 1.5 1 2.5 2.5 2.5" }), /* @__PURE__ */ d("path", { d: "M15 4c1.5 0 2.5 1 2.5 2.5v3c0 1 .5 1.5 1.5 2.5-1 1-1.5 1.5-1.5 2.5v3c0 1.5-1 2.5-2.5 2.5" })] }),
217
+ grid: /* @__PURE__ */ d("g", {
216
218
  fill: "currentColor",
217
219
  stroke: "none",
218
220
  children: [
@@ -223,20 +225,20 @@ var u = {
223
225
  5,
224
226
  12,
225
227
  19
226
- ].map((t) => /* @__PURE__ */ c("circle", {
228
+ ].map((t) => /* @__PURE__ */ d("circle", {
227
229
  cx: t,
228
230
  cy: e,
229
231
  r: "2"
230
232
  }, `${t}-${e}`)))
231
233
  }),
232
- lock: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("rect", {
234
+ lock: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("rect", {
233
235
  x: "5",
234
236
  y: "11",
235
237
  width: "14",
236
238
  height: "10",
237
239
  rx: "2"
238
- }), /* @__PURE__ */ c("path", { d: "M8 11V7a4 4 0 0 1 8 0v4" })] })
239
- }, d = ({ name: e, size: t = 18, ...n }) => /* @__PURE__ */ c("svg", {
240
+ }), /* @__PURE__ */ d("path", { d: "M8 11V7a4 4 0 0 1 8 0v4" })] })
241
+ }, _ = ({ name: e, size: t = 18, ...n }) => /* @__PURE__ */ d("svg", {
240
242
  className: "sg-icon",
241
243
  width: t,
242
244
  height: t,
@@ -248,50 +250,51 @@ var u = {
248
250
  strokeLinejoin: "round",
249
251
  "aria-hidden": "true",
250
252
  ...n,
251
- children: u[e]
252
- }), f = ({ label: e, icon: t, iconOnly: n, className: r, title: i, ...a }) => /* @__PURE__ */ l("button", {
253
+ children: g[e]
254
+ }), v = ({ label: e, icon: t, iconOnly: n, variant: r = "primary", className: i, title: a, ...o }) => /* @__PURE__ */ f("button", {
253
255
  className: [
254
256
  "custom-button",
257
+ r === "primary" ? "" : `custom-button--${r}`,
255
258
  t ? "custom-button-with-icon" : "",
256
- r
259
+ i
257
260
  ].filter(Boolean).join(" "),
258
- title: i ?? (n ? e : void 0),
259
- ...a,
260
- children: [t && /* @__PURE__ */ c(d, { name: t }), /* @__PURE__ */ c("span", {
261
+ title: a ?? (n ? e : void 0),
262
+ ...o,
263
+ children: [t && /* @__PURE__ */ d(_, { name: t }), /* @__PURE__ */ d("span", {
261
264
  className: n ? "custom-button-label-visually-hidden" : void 0,
262
265
  children: e
263
266
  })]
264
- }), p = ({ copyright: e = "© 2026 My Company", href: t = "#", links: n = [] }) => /* @__PURE__ */ l("footer", {
267
+ }), y = ({ copyright: e = "© 2026 My Company", href: t = "#", links: n = [] }) => /* @__PURE__ */ f("footer", {
265
268
  className: "footer",
266
- children: [/* @__PURE__ */ c("span", { children: /* @__PURE__ */ c("a", {
269
+ children: [/* @__PURE__ */ d("span", { children: /* @__PURE__ */ d("a", {
267
270
  href: t,
268
271
  children: e
269
- }) }), n.length > 0 && /* @__PURE__ */ c("nav", { children: n.map(({ label: e, href: t }) => /* @__PURE__ */ c("a", {
272
+ }) }), n.length > 0 && /* @__PURE__ */ d("nav", { children: n.map(({ label: e, href: t }) => /* @__PURE__ */ d("a", {
270
273
  href: t,
271
274
  style: { marginLeft: "16px" },
272
275
  children: e
273
276
  }, t)) })]
274
- }), m = "simonegentili.com-cookie-consent", h = 3600 * 24 * 365;
275
- function g() {
276
- return document.cookie.split("; ").some((e) => e.startsWith(`${m}=`));
277
+ }), b = "simonegentili.com-cookie-consent", x = 3600 * 24 * 365;
278
+ function S() {
279
+ return document.cookie.split("; ").some((e) => e.startsWith(`${b}=`));
277
280
  }
278
- function _() {
279
- document.cookie = `${m}=accepted; path=/; domain=.simonegentili.com; max-age=${h}; secure; samesite=strict`;
281
+ function C() {
282
+ document.cookie = `${b}=accepted; path=/; domain=.simonegentili.com; max-age=${x}; secure; samesite=strict`;
280
283
  }
281
- var v = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
282
- let [t, r] = o(!1);
283
- return n(() => {
284
- r(!g());
285
- }, []), t ? /* @__PURE__ */ l("div", {
284
+ var w = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
285
+ let [t, n] = l(!1);
286
+ return a(() => {
287
+ n(!S());
288
+ }, []), t ? /* @__PURE__ */ f("div", {
286
289
  className: "cookie-consent",
287
290
  role: "region",
288
291
  "aria-label": "Informativa sui cookie",
289
- children: [/* @__PURE__ */ l("p", {
292
+ children: [/* @__PURE__ */ f("p", {
290
293
  className: "cookie-consent-text",
291
294
  children: [
292
295
  "Questo sito utilizza esclusivamente cookie tecnici necessari al funzionamento (es. autenticazione). Non sono presenti cookie di profilazione o di terze parti. Per saperne di più consulta la",
293
296
  " ",
294
- /* @__PURE__ */ c("a", {
297
+ /* @__PURE__ */ d("a", {
295
298
  href: e,
296
299
  target: "_blank",
297
300
  rel: "noopener noreferrer",
@@ -299,15 +302,15 @@ var v = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
299
302
  }),
300
303
  "."
301
304
  ]
302
- }), /* @__PURE__ */ c(f, {
305
+ }), /* @__PURE__ */ d(v, {
303
306
  label: "Accetta",
304
307
  onClick: () => {
305
- _(), r(!1);
308
+ C(), n(!1);
306
309
  },
307
310
  className: "cookie-consent-accept"
308
311
  })]
309
312
  }) : null;
310
- }, y = [
313
+ }, T = [
311
314
  {
312
315
  label: "guitar",
313
316
  href: "https://guitar.simonegentili.com"
@@ -328,68 +331,337 @@ var v = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
328
331
  label: "code2image",
329
332
  href: "https://code2image.simonegentili.com"
330
333
  }
331
- ], b = () => /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(p, {
334
+ ], E = () => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(y, {
332
335
  href: "https://simonegentili.com",
333
336
  copyright: "© 2026 simonegentili.com",
334
- links: y
335
- }), /* @__PURE__ */ c(v, {})] }), x = ({ onNavigate: e, title: t = "Simone Gentili - senior web developer, tech author and chess enthusiast", homePageKey: n = "home", children: r, className: i }) => /* @__PURE__ */ c("header", {
337
+ links: T
338
+ }), /* @__PURE__ */ d(w, {})] }), D = ({ onNavigate: e, title: t = "Simone Gentili - senior web developer, tech author and chess enthusiast", homePageKey: n = "home", children: r, className: i }) => /* @__PURE__ */ d("header", {
336
339
  className: i ? `header ${i}` : "header",
337
- children: /* @__PURE__ */ l("div", {
340
+ children: /* @__PURE__ */ f("div", {
338
341
  className: "header-container",
339
- children: [/* @__PURE__ */ c("div", {
342
+ children: [/* @__PURE__ */ d("div", {
340
343
  className: "logo",
341
344
  onClick: () => {
342
345
  e?.(n);
343
346
  },
344
- children: /* @__PURE__ */ c("h1", {
347
+ children: /* @__PURE__ */ d("h1", {
345
348
  className: "logo-text",
346
349
  children: t
347
350
  })
348
- }), r && /* @__PURE__ */ c("div", {
351
+ }), r && /* @__PURE__ */ d("div", {
349
352
  className: "header-actions",
350
353
  children: r
351
354
  })]
352
355
  })
353
- }), S = ({ onNavigate: e }) => /* @__PURE__ */ c(x, {
356
+ }), O = ({ onNavigate: e }) => /* @__PURE__ */ d(D, {
354
357
  onNavigate: e,
355
358
  title: "Simone Gentili - senior web developer, tech author and chess enthusiast",
356
359
  homePageKey: "home"
357
- }), C = "https://api.simonegentili.com/heimdall", w = (e) => e.endsWith("/") ? e : `${e}/`, T = (e) => {
358
- let t = w(window.location.origin + window.location.pathname);
359
- return e.filter((e) => t.startsWith(w(e.url))).sort((e, t) => t.url.length - e.url.length)[0] ?? null;
360
- }, E = ({ token: e, heimdallUrl: t = C }) => {
361
- let [r, i] = o(null), [a, u] = o(!1), [d, p] = o(!1);
362
- n(() => {
360
+ }), k = {
361
+ auth: {
362
+ login: "Accedi",
363
+ logout: "Esci",
364
+ username: "Username",
365
+ password: "Password"
366
+ },
367
+ modal: { close: "Chiudi" },
368
+ accessGate: {
369
+ title: "Non hai accesso a {{app}}",
370
+ pending: "La tua richiesta è in attesa di approvazione.",
371
+ rejected: "La tua richiesta di accesso è stata rifiutata. Puoi inviarne una nuova.",
372
+ none: "Per usare questa app devi chiedere l’accesso a un amministratore.",
373
+ failed: "Invio non riuscito, riprova.",
374
+ sending: "Invio…",
375
+ request: "Richiedi accesso"
376
+ },
377
+ launcher: {
378
+ label: "App",
379
+ loading: "Caricamento…",
380
+ loadFailed: "Impossibile caricare le app.",
381
+ locked: "accesso su richiesta"
382
+ },
383
+ setPassword: {
384
+ title: "Imposta una nuova password",
385
+ newPassword: "Nuova password",
386
+ confirmPassword: "Conferma password",
387
+ submit: "Salva password",
388
+ errorEmpty: "Inserisci e conferma la nuova password.",
389
+ errorMismatch: "Le password non coincidono."
390
+ },
391
+ languageSwitcher: { label: "Lingua" },
392
+ status: { loading: "Caricamento…" },
393
+ badge: { remove: "Rimuovi" },
394
+ confirm: {
395
+ confirm: "Conferma",
396
+ cancel: "Annulla"
397
+ }
398
+ }, ee = {
399
+ auth: {
400
+ login: "Log in",
401
+ logout: "Log out",
402
+ username: "Username",
403
+ password: "Password"
404
+ },
405
+ modal: { close: "Close" },
406
+ accessGate: {
407
+ title: "You don't have access to {{app}}",
408
+ pending: "Your request is awaiting approval.",
409
+ rejected: "Your access request was rejected. You can send a new one.",
410
+ none: "To use this app you need to ask an administrator for access.",
411
+ failed: "Sending failed, please try again.",
412
+ sending: "Sending…",
413
+ request: "Request access"
414
+ },
415
+ launcher: {
416
+ label: "Apps",
417
+ loading: "Loading…",
418
+ loadFailed: "Unable to load the apps.",
419
+ locked: "access on request"
420
+ },
421
+ setPassword: {
422
+ title: "Set a new password",
423
+ newPassword: "New password",
424
+ confirmPassword: "Confirm password",
425
+ submit: "Save password",
426
+ errorEmpty: "Enter and confirm the new password.",
427
+ errorMismatch: "The passwords don't match."
428
+ },
429
+ languageSwitcher: { label: "Language" },
430
+ status: { loading: "Loading…" },
431
+ badge: { remove: "Remove" },
432
+ confirm: {
433
+ confirm: "Confirm",
434
+ cancel: "Cancel"
435
+ }
436
+ }, te = {
437
+ auth: {
438
+ login: "Se connecter",
439
+ logout: "Se déconnecter",
440
+ username: "Nom d’utilisateur",
441
+ password: "Mot de passe"
442
+ },
443
+ modal: { close: "Fermer" },
444
+ accessGate: {
445
+ title: "Vous n’avez pas accès à {{app}}",
446
+ pending: "Votre demande est en attente d’approbation.",
447
+ rejected: "Votre demande d’accès a été refusée. Vous pouvez en envoyer une nouvelle.",
448
+ none: "Pour utiliser cette application, vous devez demander l’accès à un administrateur.",
449
+ failed: "Échec de l’envoi, veuillez réessayer.",
450
+ sending: "Envoi…",
451
+ request: "Demander l’accès"
452
+ },
453
+ launcher: {
454
+ label: "Applications",
455
+ loading: "Chargement…",
456
+ loadFailed: "Impossible de charger les applications.",
457
+ locked: "accès sur demande"
458
+ },
459
+ setPassword: {
460
+ title: "Définir un nouveau mot de passe",
461
+ newPassword: "Nouveau mot de passe",
462
+ confirmPassword: "Confirmer le mot de passe",
463
+ submit: "Enregistrer le mot de passe",
464
+ errorEmpty: "Saisissez et confirmez le nouveau mot de passe.",
465
+ errorMismatch: "Les mots de passe ne correspondent pas."
466
+ },
467
+ languageSwitcher: { label: "Langue" },
468
+ status: { loading: "Chargement…" },
469
+ badge: { remove: "Retirer" },
470
+ confirm: {
471
+ confirm: "Confirmer",
472
+ cancel: "Annuler"
473
+ }
474
+ }, ne = {
475
+ auth: {
476
+ login: "Anmelden",
477
+ logout: "Abmelden",
478
+ username: "Benutzername",
479
+ password: "Passwort"
480
+ },
481
+ modal: { close: "Schließen" },
482
+ accessGate: {
483
+ title: "Du hast keinen Zugriff auf {{app}}",
484
+ pending: "Deine Anfrage wartet auf Freigabe.",
485
+ rejected: "Deine Zugriffsanfrage wurde abgelehnt. Du kannst eine neue senden.",
486
+ none: "Um diese App zu nutzen, musst du einen Administrator um Zugriff bitten.",
487
+ failed: "Senden fehlgeschlagen, bitte versuche es erneut.",
488
+ sending: "Wird gesendet…",
489
+ request: "Zugriff anfragen"
490
+ },
491
+ launcher: {
492
+ label: "Apps",
493
+ loading: "Wird geladen…",
494
+ loadFailed: "Die Apps konnten nicht geladen werden.",
495
+ locked: "Zugriff auf Anfrage"
496
+ },
497
+ setPassword: {
498
+ title: "Neues Passwort festlegen",
499
+ newPassword: "Neues Passwort",
500
+ confirmPassword: "Passwort bestätigen",
501
+ submit: "Passwort speichern",
502
+ errorEmpty: "Gib das neue Passwort ein und bestätige es.",
503
+ errorMismatch: "Die Passwörter stimmen nicht überein."
504
+ },
505
+ languageSwitcher: { label: "Sprache" },
506
+ status: { loading: "Wird geladen…" },
507
+ badge: { remove: "Entfernen" },
508
+ confirm: {
509
+ confirm: "Bestätigen",
510
+ cancel: "Abbrechen"
511
+ }
512
+ }, re = {
513
+ auth: {
514
+ login: "Iniciar sesión",
515
+ logout: "Cerrar sesión",
516
+ username: "Usuario",
517
+ password: "Contraseña"
518
+ },
519
+ modal: { close: "Cerrar" },
520
+ accessGate: {
521
+ title: "No tienes acceso a {{app}}",
522
+ pending: "Tu solicitud está pendiente de aprobación.",
523
+ rejected: "Tu solicitud de acceso ha sido rechazada. Puedes enviar una nueva.",
524
+ none: "Para usar esta aplicación debes pedir acceso a un administrador.",
525
+ failed: "No se pudo enviar, inténtalo de nuevo.",
526
+ sending: "Enviando…",
527
+ request: "Solicitar acceso"
528
+ },
529
+ launcher: {
530
+ label: "Aplicaciones",
531
+ loading: "Cargando…",
532
+ loadFailed: "No se pudieron cargar las aplicaciones.",
533
+ locked: "acceso bajo solicitud"
534
+ },
535
+ setPassword: {
536
+ title: "Establecer una nueva contraseña",
537
+ newPassword: "Nueva contraseña",
538
+ confirmPassword: "Confirmar contraseña",
539
+ submit: "Guardar contraseña",
540
+ errorEmpty: "Introduce y confirma la nueva contraseña.",
541
+ errorMismatch: "Las contraseñas no coinciden."
542
+ },
543
+ languageSwitcher: { label: "Idioma" },
544
+ status: { loading: "Cargando…" },
545
+ badge: { remove: "Quitar" },
546
+ confirm: {
547
+ confirm: "Confirmar",
548
+ cancel: "Cancelar"
549
+ }
550
+ }, A = {
551
+ auth: {
552
+ login: "ログイン",
553
+ logout: "ログアウト",
554
+ username: "ユーザー名",
555
+ password: "パスワード"
556
+ },
557
+ modal: { close: "閉じる" },
558
+ accessGate: {
559
+ title: "{{app}} へのアクセス権がありません",
560
+ pending: "リクエストは承認待ちです。",
561
+ rejected: "アクセスリクエストは却下されました。新しいリクエストを送信できます。",
562
+ none: "このアプリを使うには、管理者にアクセスを申請してください。",
563
+ failed: "送信に失敗しました。もう一度お試しください。",
564
+ sending: "送信中…",
565
+ request: "アクセスを申請"
566
+ },
567
+ launcher: {
568
+ label: "アプリ",
569
+ loading: "読み込み中…",
570
+ loadFailed: "アプリを読み込めませんでした。",
571
+ locked: "申請によりアクセス可能"
572
+ },
573
+ setPassword: {
574
+ title: "新しいパスワードを設定",
575
+ newPassword: "新しいパスワード",
576
+ confirmPassword: "パスワードの確認",
577
+ submit: "パスワードを保存",
578
+ errorEmpty: "新しいパスワードを入力して確認してください。",
579
+ errorMismatch: "パスワードが一致しません。"
580
+ },
581
+ languageSwitcher: { label: "言語" },
582
+ status: { loading: "読み込み中…" },
583
+ badge: { remove: "削除" },
584
+ confirm: {
585
+ confirm: "確認",
586
+ cancel: "キャンセル"
587
+ }
588
+ }, j = [
589
+ "it",
590
+ "en",
591
+ "fr",
592
+ "de",
593
+ "es",
594
+ "ja"
595
+ ], M = {
596
+ it: "Italiano",
597
+ en: "English",
598
+ fr: "Français",
599
+ de: "Deutsch",
600
+ es: "Español",
601
+ ja: "日本語"
602
+ }, N = "sg-language", P = "it", F = (e) => !!e && j.includes(e), I = () => {
603
+ let e = document.cookie.split("; ").find((e) => e.startsWith(`${N}=`))?.slice(12);
604
+ return F(e) ? e : null;
605
+ }, ie = (e) => {
606
+ let t = window.location.hostname.endsWith("simonegentili.com") ? "; domain=.simonegentili.com; secure" : "";
607
+ document.cookie = `${N}=${e}; path=/; max-age=31536000; samesite=lax${t}`;
608
+ }, L = h.createInstance();
609
+ L.init({
610
+ resources: {
611
+ it: { sg: k },
612
+ en: { sg: ee },
613
+ fr: { sg: te },
614
+ de: { sg: ne },
615
+ es: { sg: re },
616
+ ja: { sg: A }
617
+ },
618
+ lng: I() ?? P,
619
+ fallbackLng: P,
620
+ supportedLngs: [...j],
621
+ ns: ["sg", "translation"],
622
+ defaultNS: "translation",
623
+ initAsync: !1,
624
+ interpolation: { escapeValue: !1 }
625
+ }), L.on("languageChanged", ie);
626
+ var ae = ({ resources: e }) => {
627
+ for (let [t, n] of Object.entries(e)) L.addResourceBundle(t, "translation", n, !0, !0);
628
+ return p(L), L;
629
+ }, R = "https://api.simonegentili.com/heimdall", z = (e) => e.endsWith("/") ? e : `${e}/`, oe = (e) => {
630
+ let t = z(window.location.origin + window.location.pathname);
631
+ return e.filter((e) => t.startsWith(z(e.url))).sort((e, t) => t.url.length - e.url.length)[0] ?? null;
632
+ }, B = ({ token: e, heimdallUrl: t = R }) => {
633
+ let { t: n } = m("sg", { i18n: L }), [r, i] = l(null), [o, s] = l(!1), [c, p] = l(!1);
634
+ a(() => {
363
635
  e && fetch(`${t}/access`, { headers: { Authorization: `Bearer ${e}` } }).then((e) => e.ok ? e.json() : Promise.reject(e.status)).then((t) => i({
364
636
  token: e,
365
- app: T(t.apps)
637
+ app: oe(t.apps)
366
638
  })).catch(() => i({
367
639
  token: e,
368
640
  app: null
369
641
  }));
370
642
  }, [e, t]);
371
- let m = r?.token === e ? r.app : null;
372
- return !e || m === null || m.access === "open" || m.access === "approved" ? null : /* @__PURE__ */ c("div", {
643
+ let h = r?.token === e ? r.app : null;
644
+ return !e || h === null || h.access === "open" || h.access === "approved" ? null : /* @__PURE__ */ d("div", {
373
645
  className: "sg-access-gate",
374
646
  role: "dialog",
375
647
  "aria-modal": "true",
376
648
  "aria-labelledby": "sg-access-gate-title",
377
- children: /* @__PURE__ */ l("div", {
649
+ children: /* @__PURE__ */ f("div", {
378
650
  className: "sg-access-gate-card",
379
- children: [/* @__PURE__ */ l("h2", {
651
+ children: [/* @__PURE__ */ d("h2", {
380
652
  id: "sg-access-gate-title",
381
- children: ["Non hai accesso a ", m.name]
382
- }), m.access === "pending" ? /* @__PURE__ */ c("p", { children: "La tua richiesta è in attesa di approvazione." }) : /* @__PURE__ */ l(s, { children: [
383
- /* @__PURE__ */ c("p", { children: m.access === "rejected" ? "La tua richiesta di accesso è stata rifiutata. Puoi inviarne una nuova." : "Per usare questa app devi chiedere l’accesso a un amministratore." }),
384
- d && /* @__PURE__ */ c("p", {
653
+ children: n("accessGate.title", { app: h.name })
654
+ }), h.access === "pending" ? /* @__PURE__ */ d("p", { children: n("accessGate.pending") }) : /* @__PURE__ */ f(u, { children: [
655
+ /* @__PURE__ */ d("p", { children: h.access === "rejected" ? n("accessGate.rejected") : n("accessGate.none") }),
656
+ c && /* @__PURE__ */ d("p", {
385
657
  className: "sg-access-gate-error",
386
- children: "Invio non riuscito, riprova."
658
+ children: n("accessGate.failed")
387
659
  }),
388
- /* @__PURE__ */ c(f, {
389
- label: a ? "Invio…" : "Richiedi accesso",
390
- disabled: a,
660
+ /* @__PURE__ */ d(v, {
661
+ label: n(o ? "accessGate.sending" : "accessGate.request"),
662
+ disabled: o,
391
663
  onClick: async () => {
392
- u(!0), p(!1);
664
+ s(!0), p(!1);
393
665
  try {
394
666
  let n = await fetch(`${t}/access-requests`, {
395
667
  method: "POST",
@@ -397,411 +669,458 @@ var v = ({ privacyPolicyHref: e = "https://simonegentili.com/privacy" }) => {
397
669
  Authorization: `Bearer ${e}`,
398
670
  "Content-Type": "application/json"
399
671
  },
400
- body: JSON.stringify({ app: m.slug })
672
+ body: JSON.stringify({ app: h.slug })
401
673
  });
402
674
  n.ok || n.status === 409 ? i({
403
675
  token: e,
404
676
  app: {
405
- ...m,
677
+ ...h,
406
678
  access: "pending"
407
679
  }
408
680
  }) : p(!0);
409
681
  } catch {
410
682
  p(!0);
411
683
  } finally {
412
- u(!1);
684
+ s(!1);
413
685
  }
414
686
  }
415
687
  })
416
688
  ] })]
417
689
  })
418
690
  });
419
- }, D = "https://api.simonegentili.com/heimdall/launcher", O = ({ appsUrl: e = D, label: t = "App", token: r = null }) => {
420
- let [i, s] = o(!1), [u, f] = o(null), p = u?.token === r ? u.apps : null, [m, h] = o(!1), g = a(null);
421
- return n(() => {
422
- !i || p !== null || fetch(e, r ? { headers: { Authorization: `Bearer ${r}` } } : void 0).then((e) => e.ok ? e.json() : Promise.reject(e.status)).then((e) => f({
423
- token: r,
691
+ }, V = "https://api.simonegentili.com/heimdall/launcher", H = ({ appsUrl: e = V, label: t, token: n = null }) => {
692
+ let { t: r } = m("sg", { i18n: L }), i = t ?? r("launcher.label"), [o, s] = l(!1), [u, p] = l(null), h = u?.token === n ? u.apps : null, [g, v] = l(!1), y = c(null);
693
+ return a(() => {
694
+ !o || h !== null || fetch(e, n ? { headers: { Authorization: `Bearer ${n}` } } : void 0).then((e) => e.ok ? e.json() : Promise.reject(e.status)).then((e) => p({
695
+ token: n,
424
696
  apps: e.apps
425
- })).catch(() => h(!0));
697
+ })).catch(() => v(!0));
426
698
  }, [
427
- i,
428
- p,
699
+ o,
700
+ h,
429
701
  e,
430
- r
431
- ]), n(() => {
432
- if (!i) return;
702
+ n
703
+ ]), a(() => {
704
+ if (!o) return;
433
705
  let e = (e) => {
434
- g.current?.contains(e.target) || s(!1);
706
+ y.current?.contains(e.target) || s(!1);
435
707
  }, t = (e) => {
436
708
  e.key === "Escape" && s(!1);
437
709
  };
438
710
  return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
439
711
  document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
440
712
  };
441
- }, [i]), /* @__PURE__ */ l("div", {
713
+ }, [o]), /* @__PURE__ */ f("div", {
442
714
  className: "sg-app-launcher",
443
- ref: g,
444
- children: [/* @__PURE__ */ c("button", {
715
+ ref: y,
716
+ children: [/* @__PURE__ */ d("button", {
445
717
  type: "button",
446
718
  className: "sg-app-launcher-toggle",
447
- "aria-label": t,
448
- title: t,
449
- "aria-expanded": i,
719
+ "aria-label": i,
720
+ title: i,
721
+ "aria-expanded": o,
450
722
  onClick: () => {
451
- i || h(!1), s(!i);
723
+ o || v(!1), s(!o);
452
724
  },
453
- children: /* @__PURE__ */ c(d, {
725
+ children: /* @__PURE__ */ d(_, {
454
726
  name: "grid",
455
727
  size: 22
456
728
  })
457
- }), i && /* @__PURE__ */ c("div", {
729
+ }), o && /* @__PURE__ */ d("div", {
458
730
  className: "sg-app-launcher-panel",
459
- children: m ? /* @__PURE__ */ c("p", {
731
+ children: g ? /* @__PURE__ */ d("p", {
460
732
  className: "sg-app-launcher-message",
461
- children: "Impossibile caricare le app."
462
- }) : p === null ? /* @__PURE__ */ c("p", {
733
+ children: r("launcher.loadFailed")
734
+ }) : h === null ? /* @__PURE__ */ d("p", {
463
735
  className: "sg-app-launcher-message",
464
- children: "Caricamento…"
465
- }) : /* @__PURE__ */ c("ul", {
736
+ children: r("launcher.loading")
737
+ }) : /* @__PURE__ */ d("ul", {
466
738
  className: "sg-app-launcher-grid",
467
- children: p.map((e) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ l("a", {
739
+ children: h.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ f("a", {
468
740
  href: e.url,
469
741
  className: [
470
742
  "sg-app-launcher-app",
471
743
  new URL(e.url).origin === window.location.origin ? "current" : "",
472
744
  e.locked ? "locked" : ""
473
745
  ].filter(Boolean).join(" "),
474
- title: e.locked ? `${e.name}: accesso su richiesta` : void 0,
475
- children: [/* @__PURE__ */ l("span", {
746
+ title: e.locked ? `${e.name}: ${r("launcher.locked")}` : void 0,
747
+ children: [/* @__PURE__ */ f("span", {
476
748
  className: "sg-app-launcher-tile",
477
749
  "aria-hidden": "true",
478
- children: [e.name.charAt(0).toUpperCase(), e.locked && /* @__PURE__ */ c("span", {
750
+ children: [e.name.charAt(0).toUpperCase(), e.locked && /* @__PURE__ */ d("span", {
479
751
  className: "sg-app-launcher-lock",
480
- children: /* @__PURE__ */ c(d, {
752
+ children: /* @__PURE__ */ d(_, {
481
753
  name: "lock",
482
754
  size: 12
483
755
  })
484
756
  })]
485
- }), /* @__PURE__ */ l("span", {
757
+ }), /* @__PURE__ */ f("span", {
486
758
  className: "sg-app-launcher-name",
487
- children: [e.name, e.locked && /* @__PURE__ */ c("span", {
759
+ children: [e.name, e.locked && /* @__PURE__ */ f("span", {
488
760
  className: "sg-visually-hidden",
489
- children: " (accesso su richiesta)"
761
+ children: [
762
+ " (",
763
+ r("launcher.locked"),
764
+ ")"
765
+ ]
490
766
  })]
491
767
  })]
492
768
  }) }, e.url))
493
769
  })
494
770
  })]
495
771
  });
496
- }, k = ({ isLoggedIn: e, handleLogin: t, handleLogout: n }) => /* @__PURE__ */ c(s, { children: e ? /* @__PURE__ */ c("button", {
497
- onClick: n,
498
- className: "sg-authenticator-button",
499
- children: "logout"
500
- }) : /* @__PURE__ */ c("button", {
501
- onClick: t,
502
- className: "sg-authenticator-button",
503
- children: "Login"
504
- }) }), A = 220, j = ({ open: t, onClose: r, title: i, icon: a, children: s, buttons: u, footer: d, closeLabel: p = "Close", className: m }) => {
505
- let [h, g] = o(!1), [_, v] = o({
772
+ }, U = ({ src: e, name: t, size: n = 32, className: r }) => {
773
+ let i = ["sg-avatar", r].filter(Boolean).join(" "), a = { "--avatar-size": `${n}px` };
774
+ return e ? /* @__PURE__ */ d("img", {
775
+ className: i,
776
+ style: a,
777
+ src: e,
778
+ alt: t ?? ""
779
+ }) : /* @__PURE__ */ d("span", {
780
+ className: i,
781
+ style: a,
782
+ role: "img",
783
+ "aria-label": t ?? void 0,
784
+ children: t?.trim().charAt(0).toUpperCase() || "?"
785
+ });
786
+ }, W = ({ isLoggedIn: e, handleLogin: t, handleLogout: n }) => {
787
+ let { t: r } = m("sg", { i18n: L });
788
+ return /* @__PURE__ */ d(u, { children: e ? /* @__PURE__ */ d("button", {
789
+ onClick: n,
790
+ className: "sg-authenticator-button",
791
+ children: r("auth.logout")
792
+ }) : /* @__PURE__ */ d("button", {
793
+ onClick: t,
794
+ className: "sg-authenticator-button",
795
+ children: r("auth.login")
796
+ }) });
797
+ }, G = 220, K = ({ open: t, onClose: n, title: r, icon: i, children: o, buttons: s, footer: c, closeLabel: u, className: p }) => {
798
+ let { t: h } = m("sg", { i18n: L }), [g, _] = l(!1), [y, b] = l({
506
799
  x: 0,
507
800
  y: 0
508
- }), y = e.useRef(null), [b, x] = o(!1), S = (e) => {
509
- h || (g(!0), setTimeout(() => {
510
- g(!1), e();
511
- }, A));
801
+ }), x = e.useRef(null), [S, C] = l(!1), w = (e) => {
802
+ g || (_(!0), setTimeout(() => {
803
+ _(!1), e();
804
+ }, G));
512
805
  };
513
- n(() => {
806
+ a(() => {
514
807
  if (!t) return;
515
808
  let e = (e) => {
516
- e.key === "Escape" && S(r);
809
+ e.key === "Escape" && w(n);
517
810
  };
518
811
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
519
- }, [t, r]);
520
- let [C, w] = o(t);
521
- if (t !== C && (w(t), t && v({
812
+ }, [t, n]);
813
+ let [T, E] = l(t);
814
+ if (t !== T && (E(t), t && b({
522
815
  x: 0,
523
816
  y: 0
524
817
  })), !t) return null;
525
- function T(e) {
526
- e.target.closest(".modal-close") || (y.current = {
818
+ function D(e) {
819
+ e.target.closest(".modal-close") || (x.current = {
527
820
  pointerX: e.clientX,
528
821
  pointerY: e.clientY,
529
- offsetX: _.x,
530
- offsetY: _.y
531
- }, x(!0), e.currentTarget.setPointerCapture(e.pointerId));
822
+ offsetX: y.x,
823
+ offsetY: y.y
824
+ }, C(!0), e.currentTarget.setPointerCapture(e.pointerId));
532
825
  }
533
- function E(e) {
534
- if (!y.current) return;
535
- let { pointerX: t, pointerY: n, offsetX: r, offsetY: i } = y.current;
536
- v({
826
+ function O(e) {
827
+ if (!x.current) return;
828
+ let { pointerX: t, pointerY: n, offsetX: r, offsetY: i } = x.current;
829
+ b({
537
830
  x: r + (e.clientX - t),
538
831
  y: i + (e.clientY - n)
539
832
  });
540
833
  }
541
- function D() {
542
- y.current = null, x(!1);
834
+ function k() {
835
+ x.current = null, C(!1);
543
836
  }
544
- return /* @__PURE__ */ c("div", {
545
- className: `modal-overlay${h ? " modal-overlay-closing" : ""}`,
546
- onClick: () => S(r),
547
- children: /* @__PURE__ */ l("div", {
548
- className: `modal-content${m ? ` ${m}` : ""}${h ? " modal-content-closing" : ""}`,
837
+ return /* @__PURE__ */ d("div", {
838
+ className: `modal-overlay${g ? " modal-overlay-closing" : ""}`,
839
+ onClick: () => w(n),
840
+ children: /* @__PURE__ */ f("div", {
841
+ className: `modal-content${p ? ` ${p}` : ""}${g ? " modal-content-closing" : ""}`,
549
842
  style: {
550
- "--drag-x": `${_.x}px`,
551
- "--drag-y": `${_.y}px`
843
+ "--drag-x": `${y.x}px`,
844
+ "--drag-y": `${y.y}px`
552
845
  },
553
846
  onClick: (e) => e.stopPropagation(),
554
847
  children: [
555
- /* @__PURE__ */ l("div", {
556
- className: `modal-header${b ? " modal-header-dragging" : ""}`,
557
- onPointerDown: T,
558
- onPointerMove: E,
559
- onPointerUp: D,
560
- onPointerCancel: D,
848
+ /* @__PURE__ */ f("div", {
849
+ className: `modal-header${S ? " modal-header-dragging" : ""}`,
850
+ onPointerDown: D,
851
+ onPointerMove: O,
852
+ onPointerUp: k,
853
+ onPointerCancel: k,
561
854
  children: [
562
- a && /* @__PURE__ */ c("span", {
855
+ i && /* @__PURE__ */ d("span", {
563
856
  className: "modal-icon",
564
- children: a
857
+ children: i
565
858
  }),
566
- i && /* @__PURE__ */ c("h2", {
859
+ r && /* @__PURE__ */ d("h2", {
567
860
  className: "modal-title",
568
- children: i
861
+ children: r
569
862
  }),
570
- /* @__PURE__ */ c("button", {
863
+ /* @__PURE__ */ d("button", {
571
864
  type: "button",
572
865
  className: "modal-close",
573
- "aria-label": p,
574
- onClick: () => S(r),
575
- disabled: h,
866
+ "aria-label": u ?? h("modal.close"),
867
+ onClick: () => w(n),
868
+ disabled: g,
576
869
  children: "×"
577
870
  })
578
871
  ]
579
872
  }),
580
- /* @__PURE__ */ c("div", {
873
+ /* @__PURE__ */ d("div", {
581
874
  className: "modal-children",
582
- children: s
875
+ children: o
583
876
  }),
584
- u && /* @__PURE__ */ c("div", {
877
+ s && /* @__PURE__ */ d("div", {
585
878
  className: "modal-footer",
586
- children: u.map((e, t) => /* @__PURE__ */ c(f, {
879
+ children: s.map((e, t) => /* @__PURE__ */ d(v, {
587
880
  label: e.label,
588
- onClick: () => S(e.onClick),
589
- disabled: h
881
+ onClick: () => w(e.onClick),
882
+ disabled: g
590
883
  }, t))
591
884
  }),
592
- d && /* @__PURE__ */ c("div", {
885
+ c && /* @__PURE__ */ d("div", {
593
886
  className: "modal-footer",
594
- children: d
887
+ children: c
595
888
  })
596
889
  ]
597
890
  })
598
891
  });
599
- }, M = ({ label: e, invalid: t, className: n, id: i, ...a }) => {
600
- let o = r(), s = i ?? o;
601
- return /* @__PURE__ */ l("div", {
892
+ }, q = ({ label: e, invalid: t, className: n, id: r, ...i }) => {
893
+ let a = o(), s = r ?? a;
894
+ return /* @__PURE__ */ f("div", {
602
895
  className: "input-wrapper",
603
- children: [e && /* @__PURE__ */ c("label", {
896
+ children: [e && /* @__PURE__ */ d("label", {
604
897
  className: "input-label",
605
898
  htmlFor: s,
606
899
  children: e
607
- }), /* @__PURE__ */ c("input", {
900
+ }), /* @__PURE__ */ d("input", {
608
901
  id: s,
609
902
  className: [
610
903
  "input-field",
611
904
  t ? "input-field--invalid" : "",
612
905
  n
613
906
  ].filter(Boolean).join(" "),
614
- ...a
907
+ ...i
615
908
  })]
616
909
  });
617
- }, N = ({ label: e, className: t, id: n, ...i }) => {
618
- let a = r(), o = n ?? a;
619
- return /* @__PURE__ */ l("div", {
910
+ }, J = ({ label: e, invalid: t, className: n, id: r, ...i }) => {
911
+ let a = o(), s = r ?? a;
912
+ return /* @__PURE__ */ f("div", {
620
913
  className: "input-wrapper",
621
- children: [e && /* @__PURE__ */ c("label", {
914
+ children: [e && /* @__PURE__ */ d("label", {
622
915
  className: "input-label",
623
- htmlFor: o,
916
+ htmlFor: s,
624
917
  children: e
625
- }), /* @__PURE__ */ c("input", {
626
- id: o,
918
+ }), /* @__PURE__ */ d("input", {
919
+ id: s,
627
920
  type: "password",
628
- className: ["input-field", t].filter(Boolean).join(" "),
921
+ className: [
922
+ "input-field",
923
+ t ? "input-field--invalid" : "",
924
+ n
925
+ ].filter(Boolean).join(" "),
629
926
  ...i
630
927
  })]
631
928
  });
632
- }, P = ({ open: e, onClose: t, onLogin: n }) => {
633
- let [r, i] = o(""), [a, s] = o("");
634
- return /* @__PURE__ */ c(j, {
929
+ }, se = ({ open: e, onClose: t, onLogin: n }) => {
930
+ let { t: r } = m("sg", { i18n: L }), [i, a] = l(""), [o, s] = l("");
931
+ return /* @__PURE__ */ d(K, {
635
932
  open: e,
636
933
  onClose: t,
637
- title: "Login",
638
- children: /* @__PURE__ */ l("form", {
934
+ title: r("auth.login"),
935
+ children: /* @__PURE__ */ f("form", {
639
936
  onSubmit: (e) => {
640
- e.preventDefault(), n(r, a);
937
+ e.preventDefault(), n(i, o);
641
938
  },
642
939
  children: [
643
- /* @__PURE__ */ c(M, {
644
- label: "Username",
645
- value: r,
646
- onChange: (e) => i(e.target.value),
940
+ /* @__PURE__ */ d(q, {
941
+ label: r("auth.username"),
942
+ value: i,
943
+ onChange: (e) => a(e.target.value),
647
944
  autoFocus: !0
648
945
  }),
649
- /* @__PURE__ */ c(N, {
650
- label: "Password",
651
- value: a,
946
+ /* @__PURE__ */ d(J, {
947
+ label: r("auth.password"),
948
+ value: o,
652
949
  onChange: (e) => s(e.target.value)
653
950
  }),
654
- /* @__PURE__ */ c(f, {
655
- label: "Login",
951
+ /* @__PURE__ */ d(v, {
952
+ label: r("auth.login"),
656
953
  type: "submit",
657
954
  style: { width: "100%" }
658
955
  })
659
956
  ]
660
957
  })
661
958
  });
662
- }, F = "simonegentili.com-access-token", I = (e) => document.cookie.split("; ").some((t) => t.startsWith(`${e}=`) && t.slice(e.length + 1).length > 0), L = (e) => {
959
+ }, ce = "simonegentili.com-access-token", Y = "sg-avatar-change", X = (e) => document.cookie.split("; ").some((t) => t.startsWith(`${e}=`) && t.slice(e.length + 1).length > 0), le = (e) => {
663
960
  let t = document.cookie.split("; ").find((t) => t.startsWith(`${e}=`));
664
961
  return t ? t.slice(e.length + 1) : null;
665
- }, R = (e, t) => {
962
+ }, ue = (e, t) => {
666
963
  try {
667
964
  return JSON.parse(atob(e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/")))[t] ?? null;
668
965
  } catch {
669
966
  return null;
670
967
  }
671
- }, z = t(({ title: e = "Quadrato", homePageKey: t = "home", onNavigate: r, cookieName: a = F, username: u = null, usernameJwtField: d = "sub", onLogin: f, onLogout: p, onUserAuthenticated: m, appsUrl: h, heimdallUrl: g }, _) => {
672
- let [v, y] = o(() => I(a)), [b, S] = o(!1);
673
- i(_, () => ({ openLoginModal: () => S(!0) }));
674
- let C = v ? L(a) : null, w = u ?? (C ? R(C, d) : null);
675
- return n(() => {
676
- m?.(v, v ? w : null);
677
- }, []), /* @__PURE__ */ l(s, { children: [
678
- /* @__PURE__ */ l(x, {
679
- onNavigate: r,
968
+ }, Z = r(({ title: e = "Quadrato", homePageKey: t = "home", onNavigate: n, cookieName: r = ce, username: i = null, usernameJwtField: o = "sub", onLogin: c, onLogout: p, onUserAuthenticated: m, appsUrl: h, heimdallUrl: g = R }, _) => {
969
+ let [v, y] = l(() => X(r)), [b, x] = l(!1);
970
+ s(_, () => ({ openLoginModal: () => x(!0) }));
971
+ let S = v ? le(r) : null, C = i ?? (S ? ue(S, o) : null), [w, T] = l(null), E = S && w?.token === S ? w.src : null;
972
+ return a(() => {
973
+ if (!S) return;
974
+ let e = !1;
975
+ return fetch(`${g}/me/avatar`, { headers: { Authorization: `Bearer ${S}` } }).then((e) => e.ok ? e.json() : null).then((t) => {
976
+ e || T({
977
+ token: S,
978
+ src: t?.avatar ?? null
979
+ });
980
+ }).catch(() => {}), () => {
981
+ e = !0;
982
+ };
983
+ }, [S, g]), a(() => {
984
+ if (!S) return;
985
+ let e = (e) => T({
986
+ token: S,
987
+ src: e.detail
988
+ });
989
+ return window.addEventListener(Y, e), () => window.removeEventListener(Y, e);
990
+ }, [S]), a(() => {
991
+ m?.(v, v ? C : null);
992
+ }, []), /* @__PURE__ */ f(u, { children: [
993
+ /* @__PURE__ */ f(D, {
994
+ onNavigate: n,
680
995
  title: e,
681
996
  homePageKey: t,
682
997
  className: "quadrato-header",
683
- children: [/* @__PURE__ */ c(O, {
998
+ children: [/* @__PURE__ */ d(H, {
684
999
  appsUrl: h,
685
- token: C
686
- }), /* @__PURE__ */ l("div", {
1000
+ token: S
1001
+ }), /* @__PURE__ */ f("div", {
687
1002
  className: "quadrato-header-auth",
688
- children: [v && w && /* @__PURE__ */ c("span", {
689
- className: "quadrato-header-username",
690
- children: w
691
- }), /* @__PURE__ */ c(k, {
692
- isLoggedIn: v,
693
- handleLogin: () => S(!0),
694
- handleLogout: () => {
695
- p?.();
696
- let e = I(a);
697
- y(e), m?.(e, null);
698
- }
699
- })]
1003
+ children: [
1004
+ v && E && /* @__PURE__ */ d(U, { src: E }),
1005
+ v && C && /* @__PURE__ */ d("span", {
1006
+ className: "quadrato-header-username",
1007
+ children: C
1008
+ }),
1009
+ /* @__PURE__ */ d(W, {
1010
+ isLoggedIn: v,
1011
+ handleLogin: () => x(!0),
1012
+ handleLogout: () => {
1013
+ p?.();
1014
+ let e = X(r);
1015
+ y(e), m?.(e, null);
1016
+ }
1017
+ })
1018
+ ]
700
1019
  })]
701
1020
  }),
702
- /* @__PURE__ */ c(E, {
703
- token: C,
1021
+ /* @__PURE__ */ d(B, {
1022
+ token: S,
704
1023
  heimdallUrl: g
705
1024
  }),
706
- /* @__PURE__ */ c(P, {
1025
+ /* @__PURE__ */ d(se, {
707
1026
  open: b,
708
- onClose: () => S(!1),
1027
+ onClose: () => x(!1),
709
1028
  onLogin: async (e, t) => {
710
- await f(e, t);
711
- let n = I(a);
712
- y(n), S(!1), m?.(n, n ? u ?? e : null);
1029
+ await c(e, t);
1030
+ let n = X(r);
1031
+ y(n), x(!1), m?.(n, n ? i ?? e : null);
713
1032
  }
714
1033
  })
715
1034
  ] });
716
1035
  });
717
- z.displayName = "QuadratoHeader";
1036
+ Z.displayName = "QuadratoHeader";
718
1037
  //#endregion
719
1038
  //#region src/components/SetPasswordModal/SetPasswordModal.tsx
720
- var B = ({ open: e, onClose: t, onSubmit: n }) => {
721
- let [r, i] = o(""), [a, s] = o(""), [u, d] = o("");
722
- return /* @__PURE__ */ c(j, {
1039
+ var de = ({ open: e, onClose: t, onSubmit: n }) => {
1040
+ let { t: r } = m("sg", { i18n: L }), [i, a] = l(""), [o, s] = l(""), [c, u] = l("");
1041
+ return /* @__PURE__ */ d(K, {
723
1042
  open: e,
724
1043
  onClose: t,
725
- title: "Imposta una nuova password",
726
- children: /* @__PURE__ */ l("form", {
1044
+ title: r("setPassword.title"),
1045
+ children: /* @__PURE__ */ f("form", {
727
1046
  className: "set-password-modal-form",
728
1047
  onSubmit: (e) => {
729
- if (e.preventDefault(), r === "" || a === "") {
730
- d("Inserisci ed conferma la nuova password.");
1048
+ if (e.preventDefault(), i === "" || o === "") {
1049
+ u(r("setPassword.errorEmpty"));
731
1050
  return;
732
1051
  }
733
- if (r !== a) {
734
- d("Le password non coincidono.");
1052
+ if (i !== o) {
1053
+ u(r("setPassword.errorMismatch"));
735
1054
  return;
736
1055
  }
737
- d(""), n(r);
1056
+ u(""), n(i);
738
1057
  },
739
1058
  children: [
740
- /* @__PURE__ */ c(N, {
741
- label: "Nuova password",
742
- value: r,
743
- onChange: (e) => i(e.target.value),
1059
+ /* @__PURE__ */ d(J, {
1060
+ label: r("setPassword.newPassword"),
1061
+ value: i,
1062
+ onChange: (e) => a(e.target.value),
744
1063
  autoFocus: !0
745
1064
  }),
746
- /* @__PURE__ */ c(N, {
747
- label: "Conferma password",
748
- value: a,
1065
+ /* @__PURE__ */ d(J, {
1066
+ label: r("setPassword.confirmPassword"),
1067
+ value: o,
749
1068
  onChange: (e) => s(e.target.value)
750
1069
  }),
751
- u && /* @__PURE__ */ c("p", {
1070
+ c && /* @__PURE__ */ d("p", {
752
1071
  className: "set-password-modal-error",
753
- children: u
1072
+ children: c
754
1073
  }),
755
- /* @__PURE__ */ c(f, {
756
- label: "Salva password",
1074
+ /* @__PURE__ */ d(v, {
1075
+ label: r("setPassword.submit"),
757
1076
  type: "submit",
758
1077
  style: { width: "100%" }
759
1078
  })
760
1079
  ]
761
1080
  })
762
1081
  });
763
- }, V = ({ value: e, onChange: t, swatches: r }) => {
764
- let [i, s] = o(!1), u = a(null);
765
- return n(() => {
766
- if (!i) return;
1082
+ }, fe = ({ value: e, onChange: t, swatches: n }) => {
1083
+ let [r, i] = l(!1), o = c(null);
1084
+ return a(() => {
1085
+ if (!r) return;
767
1086
  let e = (e) => {
768
- u.current && !u.current.contains(e.target) && s(!1);
1087
+ o.current && !o.current.contains(e.target) && i(!1);
769
1088
  }, t = (e) => {
770
- e.key === "Escape" && s(!1);
1089
+ e.key === "Escape" && i(!1);
771
1090
  };
772
1091
  return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
773
1092
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
774
1093
  };
775
- }, [i]), /* @__PURE__ */ l("div", {
776
- ref: u,
1094
+ }, [r]), /* @__PURE__ */ f("div", {
1095
+ ref: o,
777
1096
  className: "sg-color-picker",
778
- children: [/* @__PURE__ */ l("button", {
1097
+ children: [/* @__PURE__ */ f("button", {
779
1098
  type: "button",
780
1099
  className: "sg-color-picker-toggle",
781
- onClick: () => s((e) => !e),
782
- children: [/* @__PURE__ */ c("span", {
1100
+ onClick: () => i((e) => !e),
1101
+ children: [/* @__PURE__ */ d("span", {
783
1102
  className: "sg-color-picker-swatch",
784
1103
  style: { background: e }
785
- }), /* @__PURE__ */ c("span", {
1104
+ }), /* @__PURE__ */ d("span", {
786
1105
  className: "sg-color-picker-toggle-label",
787
1106
  children: e
788
1107
  })]
789
- }), i && /* @__PURE__ */ l("div", {
1108
+ }), r && /* @__PURE__ */ f("div", {
790
1109
  className: "sg-color-picker-popover",
791
- children: [/* @__PURE__ */ c("div", {
1110
+ children: [/* @__PURE__ */ d("div", {
792
1111
  className: "sg-color-picker-grid",
793
- children: r.map((n) => /* @__PURE__ */ c("button", {
1112
+ children: n.map((n) => /* @__PURE__ */ d("button", {
794
1113
  type: "button",
795
1114
  title: n,
796
1115
  className: `sg-color-picker-swatch-button${n.toLowerCase() === e?.toLowerCase() ? " active" : ""}`,
797
1116
  style: { background: n },
798
1117
  onClick: () => {
799
- t(n), s(!1);
1118
+ t(n), i(!1);
800
1119
  }
801
1120
  }, n))
802
- }), /* @__PURE__ */ l("label", {
1121
+ }), /* @__PURE__ */ f("label", {
803
1122
  className: "sg-color-picker-custom",
804
- children: ["Colore personalizzato", /* @__PURE__ */ c("input", {
1123
+ children: ["Colore personalizzato", /* @__PURE__ */ d("input", {
805
1124
  type: "color",
806
1125
  value: e,
807
1126
  onChange: (e) => t(e.target.value)
@@ -809,64 +1128,250 @@ var B = ({ open: e, onClose: t, onSubmit: n }) => {
809
1128
  })]
810
1129
  })]
811
1130
  });
812
- }, H = (e) => e.split(",")[0].replace(/'/g, ""), U = ({ value: e, onChange: t, options: r }) => {
813
- let [i, s] = o(!1), u = a(null);
814
- return n(() => {
815
- if (!i) return;
1131
+ }, Q = (e) => e.split(",")[0].replace(/'/g, ""), pe = ({ value: e, onChange: t, options: n }) => {
1132
+ let [r, i] = l(!1), o = c(null);
1133
+ return a(() => {
1134
+ if (!r) return;
816
1135
  let e = (e) => {
817
- u.current && !u.current.contains(e.target) && s(!1);
1136
+ o.current && !o.current.contains(e.target) && i(!1);
818
1137
  }, t = (e) => {
819
- e.key === "Escape" && s(!1);
1138
+ e.key === "Escape" && i(!1);
820
1139
  };
821
1140
  return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
822
1141
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
823
1142
  };
824
- }, [i]), /* @__PURE__ */ l("div", {
825
- ref: u,
1143
+ }, [r]), /* @__PURE__ */ f("div", {
1144
+ ref: o,
826
1145
  className: "sg-font-picker",
827
- children: [/* @__PURE__ */ l("button", {
1146
+ children: [/* @__PURE__ */ f("button", {
828
1147
  type: "button",
829
1148
  className: "sg-font-picker-toggle",
830
- onClick: () => s((e) => !e),
1149
+ onClick: () => i((e) => !e),
831
1150
  style: { fontFamily: e },
832
- children: [/* @__PURE__ */ c("span", {
1151
+ children: [/* @__PURE__ */ d("span", {
833
1152
  className: "sg-font-picker-toggle-label",
834
- children: H(e)
835
- }), /* @__PURE__ */ c("span", {
1153
+ children: Q(e)
1154
+ }), /* @__PURE__ */ d("span", {
836
1155
  className: "sg-font-picker-toggle-caret",
837
- children: i ? "▲" : "▼"
1156
+ children: r ? "▲" : "▼"
838
1157
  })]
839
- }), i && /* @__PURE__ */ c("ul", {
1158
+ }), r && /* @__PURE__ */ d("ul", {
840
1159
  className: "sg-font-picker-list",
841
- children: r.map((n) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c("button", {
1160
+ children: n.map((n) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d("button", {
842
1161
  type: "button",
843
1162
  className: `sg-font-picker-option${n === e ? " active" : ""}`,
844
1163
  onClick: () => {
845
- t(n), s(!1);
1164
+ t(n), i(!1);
846
1165
  },
847
1166
  style: { fontFamily: n },
848
- children: H(n)
1167
+ children: Q(n)
849
1168
  }) }, n))
850
1169
  })]
851
1170
  });
852
- }, W = ({ checked: e, onChange: t, label: n }) => /* @__PURE__ */ l("label", {
853
- className: "sg-toggle",
1171
+ }, me = ({ checked: e, onChange: t, label: n, icons: r, layout: i = "inline" }) => /* @__PURE__ */ f("label", {
1172
+ className: i === "row" ? "sg-toggle sg-toggle--row" : "sg-toggle",
854
1173
  children: [
855
- /* @__PURE__ */ c("input", {
1174
+ /* @__PURE__ */ d("input", {
856
1175
  type: "checkbox",
857
1176
  checked: e,
858
1177
  onChange: (e) => t(e.target.checked),
859
1178
  className: "sg-toggle-input"
860
1179
  }),
861
- /* @__PURE__ */ c("span", {
1180
+ /* @__PURE__ */ d("span", {
862
1181
  className: "sg-toggle-track",
863
- children: /* @__PURE__ */ c("span", { className: "sg-toggle-thumb" })
1182
+ children: /* @__PURE__ */ d("span", { className: "sg-toggle-thumb" })
864
1183
  }),
865
- /* @__PURE__ */ c("span", {
1184
+ /* @__PURE__ */ d("span", {
866
1185
  className: "sg-toggle-label",
867
1186
  children: n
1187
+ }),
1188
+ r && /* @__PURE__ */ d("span", {
1189
+ className: "sg-toggle-icons",
1190
+ children: r
868
1191
  })
869
1192
  ]
870
- });
1193
+ }), he = ({ className: e }) => {
1194
+ let { t, i18n: n } = m("sg", { i18n: L });
1195
+ return /* @__PURE__ */ d("select", {
1196
+ className: ["sg-language-switcher", e].filter(Boolean).join(" "),
1197
+ value: n.resolvedLanguage,
1198
+ onChange: (e) => n.changeLanguage(e.target.value),
1199
+ "aria-label": t("languageSwitcher.label"),
1200
+ children: j.map((e) => /* @__PURE__ */ d("option", {
1201
+ value: e,
1202
+ children: M[e]
1203
+ }, e))
1204
+ });
1205
+ }, ge = ({ value: e, max: t = 100, label: n, ariaLabel: r, tone: i = "accent", size: a = "md", className: o }) => {
1206
+ let s = t > 0 ? Math.min(100, Math.max(0, e / t * 100)) : 0;
1207
+ return /* @__PURE__ */ f("div", {
1208
+ className: [
1209
+ "sg-progress",
1210
+ `sg-progress--${i}`,
1211
+ `sg-progress--${a}`,
1212
+ o
1213
+ ].filter(Boolean).join(" "),
1214
+ children: [/* @__PURE__ */ d("div", {
1215
+ className: "sg-progress-track",
1216
+ role: "progressbar",
1217
+ "aria-valuemin": 0,
1218
+ "aria-valuemax": t,
1219
+ "aria-valuenow": e,
1220
+ "aria-label": r,
1221
+ children: /* @__PURE__ */ d("div", {
1222
+ className: "sg-progress-fill",
1223
+ style: { width: `${s}%` }
1224
+ })
1225
+ }), n !== void 0 && /* @__PURE__ */ d("span", {
1226
+ className: "sg-progress-label",
1227
+ children: n
1228
+ })]
1229
+ });
1230
+ }, _e = ({ kind: e = "info", boxed: t = !1, children: n, className: r }) => {
1231
+ let { t: i } = m("sg", { i18n: L });
1232
+ return /* @__PURE__ */ f("p", {
1233
+ className: [
1234
+ "sg-status",
1235
+ `sg-status--${e}`,
1236
+ t ? "sg-status--boxed" : "",
1237
+ r
1238
+ ].filter(Boolean).join(" "),
1239
+ role: e === "error" ? "alert" : e === "loading" ? "status" : void 0,
1240
+ children: [e === "loading" && /* @__PURE__ */ d("span", {
1241
+ className: "sg-status-spinner",
1242
+ "aria-hidden": "true"
1243
+ }), n ?? (e === "loading" ? i("status.loading") : null)]
1244
+ });
1245
+ }, ve = ({ header: e, actions: t, children: r, variant: i = "default", interactive: a = !1, as: o = "div", href: s, className: c }) => n(o, {
1246
+ className: [
1247
+ "sg-card",
1248
+ `sg-card--${i}`,
1249
+ a ? "sg-card--interactive" : "",
1250
+ c
1251
+ ].filter(Boolean).join(" "),
1252
+ href: s
1253
+ }, e && /* @__PURE__ */ d("div", {
1254
+ className: "sg-card-header",
1255
+ children: e
1256
+ }), r, t && /* @__PURE__ */ d("div", {
1257
+ className: "sg-card-actions",
1258
+ children: t
1259
+ })), ye = ({ children: e, tone: t = "neutral", onClick: n, selected: r = !1, onRemove: i, removeLabel: a, className: o }) => {
1260
+ let { t: s } = m("sg", { i18n: L });
1261
+ return /* @__PURE__ */ f("span", {
1262
+ className: [
1263
+ "sg-badge",
1264
+ `sg-badge--${t}`,
1265
+ r ? "sg-badge--selected" : "",
1266
+ o
1267
+ ].filter(Boolean).join(" "),
1268
+ children: [n ? /* @__PURE__ */ d("button", {
1269
+ type: "button",
1270
+ className: "sg-badge-toggle",
1271
+ "aria-pressed": r,
1272
+ onClick: n,
1273
+ children: e
1274
+ }) : e, i && /* @__PURE__ */ d("button", {
1275
+ type: "button",
1276
+ className: "sg-badge-remove",
1277
+ "aria-label": a ?? s("badge.remove"),
1278
+ onClick: i,
1279
+ children: "×"
1280
+ })]
1281
+ });
1282
+ }, $ = ({ open: e, title: t, children: n, onConfirm: r, onCancel: i, confirmLabel: a, cancelLabel: o, danger: s = !1, icon: c }) => {
1283
+ let { t: l } = m("sg", { i18n: L });
1284
+ return /* @__PURE__ */ d(K, {
1285
+ open: e,
1286
+ onClose: i,
1287
+ title: t,
1288
+ icon: c,
1289
+ footer: /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(v, {
1290
+ variant: "secondary",
1291
+ label: o ?? l("confirm.cancel"),
1292
+ onClick: i
1293
+ }), /* @__PURE__ */ d(v, {
1294
+ variant: s ? "danger" : "primary",
1295
+ label: a ?? l("confirm.confirm"),
1296
+ onClick: r,
1297
+ autoFocus: !0
1298
+ })] }),
1299
+ children: n && /* @__PURE__ */ d("div", {
1300
+ className: "sg-confirm-message",
1301
+ children: n
1302
+ })
1303
+ });
1304
+ }, be = ({ invalid: e, className: t, rows: n = 3, ...r }) => /* @__PURE__ */ d("textarea", {
1305
+ rows: n,
1306
+ className: [
1307
+ "input-field",
1308
+ "sg-textarea",
1309
+ e ? "input-field--invalid" : "",
1310
+ t
1311
+ ].filter(Boolean).join(" "),
1312
+ ...r
1313
+ }), xe = ({ invalid: e, className: t, children: n, ...r }) => /* @__PURE__ */ d("select", {
1314
+ className: [
1315
+ "input-field",
1316
+ "sg-select",
1317
+ e ? "input-field--invalid" : "",
1318
+ t
1319
+ ].filter(Boolean).join(" "),
1320
+ ...r,
1321
+ children: n
1322
+ }), Se = ({ label: e, children: n, hint: r, error: a, className: s }) => {
1323
+ let c = o(), l = i(n) ? n : null, u = l?.props.id ?? c, p = `${u}-note`, m = a ?? r;
1324
+ return /* @__PURE__ */ f("div", {
1325
+ className: ["sg-field", s].filter(Boolean).join(" "),
1326
+ children: [
1327
+ /* @__PURE__ */ d("label", {
1328
+ className: "input-label",
1329
+ htmlFor: u,
1330
+ children: e
1331
+ }),
1332
+ l ? t(l, {
1333
+ id: u,
1334
+ "aria-describedby": m ? p : l.props["aria-describedby"],
1335
+ ...a ? { "aria-invalid": !0 } : {},
1336
+ ...a && typeof l.type != "string" ? { invalid: !0 } : {}
1337
+ }) : n,
1338
+ m && /* @__PURE__ */ d("p", {
1339
+ id: p,
1340
+ className: a ? "sg-field-error" : "sg-field-hint",
1341
+ children: m
1342
+ })
1343
+ ]
1344
+ });
1345
+ }, Ce = ({ items: e, value: t, onChange: n, variant: r = "underline", ariaLabel: i, className: a }) => {
1346
+ let o = c(null);
1347
+ return /* @__PURE__ */ d("div", {
1348
+ ref: o,
1349
+ role: "tablist",
1350
+ "aria-label": i,
1351
+ className: [
1352
+ "sg-tabs",
1353
+ `sg-tabs--${r}`,
1354
+ a
1355
+ ].filter(Boolean).join(" "),
1356
+ onKeyDown: (r) => {
1357
+ let i = e.filter((e) => !e.disabled), a = i.findIndex((e) => e.value === t), s = r.key === "ArrowRight" ? i[(a + 1) % i.length] : r.key === "ArrowLeft" ? i[(a - 1 + i.length) % i.length] : r.key === "Home" ? i[0] : r.key === "End" ? i[i.length - 1] : null;
1358
+ s && (r.preventDefault(), n(s.value), o.current?.querySelector(`[data-value="${String(s.value)}"]`)?.focus());
1359
+ },
1360
+ children: e.map((e) => {
1361
+ let r = e.value === t;
1362
+ return /* @__PURE__ */ d("button", {
1363
+ type: "button",
1364
+ role: "tab",
1365
+ "data-value": String(e.value),
1366
+ "aria-selected": r,
1367
+ tabIndex: r ? 0 : -1,
1368
+ disabled: e.disabled,
1369
+ className: r ? "sg-tab sg-tab--active" : "sg-tab",
1370
+ onClick: () => n(e.value),
1371
+ children: e.label
1372
+ }, e.value);
1373
+ })
1374
+ });
1375
+ };
871
1376
  //#endregion
872
- export { E as AppAccessGate, O as AppLauncher, k as Authenticator, f as Button, V as ColorPicker, v as CookieConsent, D as DEFAULT_APPS_URL, C as DEFAULT_HEIMDALL_URL, U as FontPicker, p as Footer, x as Header, d as Icon, M as Input, j as Modal, N as PasswordInput, z as QuadratoHeader, b as SGFooter, S as SGHeader, B as SetPasswordModal, W as Toggle };
1377
+ export { Y as AVATAR_CHANGE_EVENT, B as AppAccessGate, H as AppLauncher, W as Authenticator, U as Avatar, ye as Badge, v as Button, ve as Card, fe as ColorPicker, $ as ConfirmModal, w as CookieConsent, V as DEFAULT_APPS_URL, R as DEFAULT_HEIMDALL_URL, pe as FontPicker, y as Footer, Se as FormField, D as Header, _ as Icon, q as Input, N as LANGUAGE_COOKIE, M as LANGUAGE_NAMES, he as LanguageSwitcher, K as Modal, J as PasswordInput, ge as ProgressBar, Z as QuadratoHeader, E as SGFooter, O as SGHeader, j as SUPPORTED_LANGUAGES, xe as Select, de as SetPasswordModal, _e as StatusMessage, Ce as Tabs, be as Textarea, me as Toggle, ae as createI18n, I as readLanguageCookie, L as sgI18n };